decancer 3.2.4
A library that removes common unicode confusables/homoglyphs from strings.
 
Not such query exists :(
Functions
Type definitions
Macros
Loading...
Searching...
No Matches
decancer_translation_t Struct Reference

Represents a translation of a unicode codepoint. More...

Data Fields

uint8_t kind
 The type of the translation result. This can be any of the following values:
 
union { 
 
   uint32_t   character 
 The translation, as a unicode character. More...
 
   struct { 
 
      const uint8_t *   contents 
 Raw UTF-8 encoded string. More...
 
      size_t   size 
 UTF-8 size of the string, in bytes. More...
 
      void *   __heap 
 A pointer to a heap memory block, unused. More...
 
   }   string 
 The translation, as a UTF-8 encoded string. More...
 
contents 
 A union of translation results. This can either be a unicode character or a UTF-8 encoded string.
 

Detailed Description

Represents a translation of a unicode codepoint.

typedef struct {
uint8_t kind;
union {
uint32_t character;
struct {
const uint8_t* contents;
size_t size;
void* __heap;
} string;
Represents a translation of a unicode codepoint.
Definition decancer.h:440
uint32_t character
The translation, as a unicode character.
Definition decancer.h:459
uint8_t kind
The type of the translation result. This can be any of the following values:
Definition decancer.h:448
void * __heap
A pointer to a heap memory block, unused.
Definition decancer.h:483
const uint8_t * contents
Raw UTF-8 encoded string.
Definition decancer.h:470
struct decancer_translation_t::@0::@1 string
The translation, as a UTF-8 encoded string.
size_t size
UTF-8 size of the string, in bytes.
Definition decancer.h:476
See also
decancer_cure_char
decancer_translation_init
decancer_translation_clone
decancer_translation_free
Note
You are responsible in freeing this object later passing it as a pointer to decancer_translation_free.
Warning
You MUST pass this struct to decancer_translation_init first before using decancer_cure_char. Not doing so could result in possible undefined behavior.

Field Documentation

◆ __heap

void* decancer_translation_t::__heap

A pointer to a heap memory block, unused.

Note
If this value is not NULL and kind is DECANCER_TRANSLATION_KIND_STRING, then you must pass this struct to decancer_translation_free later.
Since
3.1.0

◆ character

uint32_t decancer_translation_t::character

The translation, as a unicode character.

Since
1.5.4

◆ contents [1/2]

const uint8_t* decancer_translation_t::contents

Raw UTF-8 encoded string.

Since
1.5.4

◆ [union] [2/2]

union { ... } decancer_translation_t::contents

A union of translation results. This can either be a unicode character or a UTF-8 encoded string.

Since
1.5.4

◆ kind

uint8_t decancer_translation_t::kind

The type of the translation result. This can be any of the following values:

See also
DECANCER_TRANSLATION_KIND_CHARACTER
DECANCER_TRANSLATION_KIND_STRING
DECANCER_TRANSLATION_KIND_NONE

◆ size

size_t decancer_translation_t::size

UTF-8 size of the string, in bytes.

Since
1.5.4

◆ [struct]

struct { ... } decancer_translation_t::string

The translation, as a UTF-8 encoded string.

Since
1.5.4

The documentation for this struct was generated from the following file: