Freeciv-3.1
|
Go to the source code of this file.
Macros | |
#define | fc_ut8_next_char(utf8_char) (utf8_char + fc_utf8_skip[*(unsigned char *) utf8_char]) |
Functions | |
bool | fc_utf8_char_validate (const char *utf8_char) fc__attribute((nonnull(1))) |
const char * | fc_utf8_find_next_char (const char *utf8_char) fc__attribute((nonnull(1))) |
const char * | fc_utf8_find_prev_char (const char *utf8_char, const char *utf8_string) fc__attribute((nonnull(1 |
bool | fc_utf8_validate (const char *utf8_string, const char **end) fc__attribute((nonnull(1))) |
bool | fc_utf8_validate_len (const char *utf8_string, size_t byte_len, const char **end) fc__attribute((nonnull(1))) |
char * | fc_utf8_validate_trunc (char *utf8_string) fc__attribute((nonnull(1))) |
char * | fc_utf8_validate_trunc_len (char *utf8_string, size_t byte_len) fc__attribute((nonnull(1))) |
char * | fc_utf8_validate_trunc_dup (const char *utf8_string) fc__attribute((nonnull(1))) fc__attribute((warn_unused_result)) |
char * | fc_utf8_validate_rep_len (char *utf8_string, size_t byte_len) fc__attribute((nonnull(1))) |
char * | fc_utf8_validate_rep_dup (const char *utf8_string) fc__attribute((nonnull(1))) fc__attribute((warn_unused_result)) |
size_t | fc_utf8_strlen (const char *utf8_string) fc__attribute((nonnull(1))) |
size_t | fc_utf8_strlcpy_trunc (char *dest, const char *src, size_t n) fc__attribute((nonnull(1 |
size_t size_t | fc_utf8_strlcpy_rep (char *dest, const char *src, size_t n) fc__attribute((nonnull(1 |
size_t size_t size_t | fc_utf8_strlcat_trunc (char *dest, const char *src, size_t n) fc__attribute((nonnull(1 |
size_t size_t size_t size_t | fc_utf8_strlcat_rep (char *dest, const char *src, size_t n) fc__attribute((nonnull(1 |
size_t size_t size_t size_t int | fc_utf8_snprintf_trunc (char *str, size_t n, const char *format,...) fc__attribute((__format__(__printf__ |
size_t size_t size_t size_t int | fc__attribute ((nonnull(1, 3))) |
int | fc_utf8_snprintf_rep (char *str, size_t n, const char *format,...) fc__attribute((__format__(__printf__ |
int | fc_utf8_vsnprintf_trunc (char *str, size_t n, const char *format, va_list args) fc__attribute((nonnull(1 |
int int | fc_utf8_vsnprintf_rep (char *str, size_t n, const char *format, va_list args) fc__attribute((nonnull(1 |
int int int | cat_utf8_snprintf_trunc (char *str, size_t n, const char *format,...) fc__attribute((__format__(__printf__ |
int | cat_utf8_snprintf_rep (char *str, size_t n, const char *format,...) fc__attribute((__format__(__printf__ |
Variables | |
const char | fc_utf8_skip [256] |
#define fc_ut8_next_char | ( | utf8_char | ) | (utf8_char + fc_utf8_skip[*(unsigned char *) utf8_char]) |
int cat_utf8_snprintf_rep | ( | char * | str, |
size_t | n, | ||
const char * | format, | ||
... | |||
) |
int int int cat_utf8_snprintf_trunc | ( | char * | str, |
size_t | n, | ||
const char * | format, | ||
... | |||
) |
int int fc__attribute | ( | (nonnull(1, 3)) | ) |
bool fc_utf8_char_validate | ( | const char * | utf8_char | ) |
const char * fc_utf8_find_next_char | ( | const char * | utf8_char | ) |
Jump to next UTF-8 character start.
NB: This function can return a invalid UTF-8 character. Check with fc_utf8_char_validate() to ensure.
Definition at line 204 of file fc_utf8.c.
Referenced by base_fc_utf8_strlcpy_rep().
const char * fc_utf8_find_prev_char | ( | const char * | utf8_char, |
const char * | utf8_string | ||
) |
int fc_utf8_snprintf_rep | ( | char * | str, |
size_t | n, | ||
const char * | format, | ||
... | |||
) |
size_t size_t size_t size_t int fc_utf8_snprintf_trunc | ( | char * | str, |
size_t | n, | ||
const char * | format, | ||
... | |||
) |
size_t size_t size_t size_t fc_utf8_strlcat_rep | ( | char * | dest, |
const char * | src, | ||
size_t | n | ||
) |
size_t size_t size_t fc_utf8_strlcat_trunc | ( | char * | dest, |
const char * | src, | ||
size_t | n | ||
) |
size_t size_t fc_utf8_strlcpy_rep | ( | char * | dest, |
const char * | src, | ||
size_t | n | ||
) |
size_t fc_utf8_strlcpy_trunc | ( | char * | dest, |
const char * | src, | ||
size_t | n | ||
) |
size_t fc_utf8_strlen | ( | const char * | utf8_string | ) |
Returns the number of characters in the string 'utf8_string'. To know the number of used bytes, used strlen() instead.
NB: 'utf8_string' must be UTF-8 valid (see fc_utf8_validate()), or the behaviour of this function will be unknown.
bool fc_utf8_validate | ( | const char * | utf8_string, |
const char ** | end | ||
) |
Returns TRUE if the string 'utf8_string' contains only valid UTF-8 characters. If 'end' is not NULL, the end of the valid string will be stored there, even if it returns TRUE.
See also fc_utf8_validate_len().
Definition at line 239 of file fc_utf8.c.
Referenced by fc_utf8_validate_trunc(), fc_utf8_validate_trunc_dup(), fc_utf8_vsnprintf_rep(), and fc_utf8_vsnprintf_trunc().
bool fc_utf8_validate_len | ( | const char * | utf8_string, |
size_t | byte_len, | ||
const char ** | end | ||
) |
Returns TRUE if the string 'utf8_string' contains only valid UTF-8 characters in the limit of the length (in bytes) 'byte_len'. If 'end' is not NULL, the end of the valid string will be stored there, even if it returns TRUE.
See also fc_utf8_validate().
Definition at line 268 of file fc_utf8.c.
Referenced by base_fc_utf8_strlcpy_rep(), base_fc_utf8_strlcpy_trunc(), and fc_utf8_validate_trunc_len().
char * fc_utf8_validate_rep_dup | ( | const char * | utf8_string | ) |
Duplicate 'utf8_string' and replace all invalid characters with the replacement character.
See also fc_utf8_validate_rep_len(), and fc_utf8_validate_trunc_dup().
char * fc_utf8_validate_rep_len | ( | char * | utf8_string, |
size_t | byte_len | ||
) |
Transform 'utf8_string' with replacing all invalid characters with the replacement character in the limit of 'byte_len', truncate the last character. Returns 'utf8_string'.
See also fc_utf8_validate_len(), fc_utf8_validate_trunc(), and fc_utf8_validate_rep_dup().
Definition at line 368 of file fc_utf8.c.
Referenced by fc_utf8_vsnprintf_rep().
char * fc_utf8_validate_trunc | ( | char * | utf8_string | ) |
Truncate the string 'utf8_string' at the first invalid UTF-8 character. Returns 'utf8_string'.
See also fc_utf8_validate(), fc_utf8_validate_trunc_len(), and fc_utf8_validate_trunc_dup().
char * fc_utf8_validate_trunc_dup | ( | const char * | utf8_string | ) |
Duplicate the truncation of the string 'utf8_string' at the first invalid UTF-8 character.
See also fc_utf8_validate_trunc(), fc_utf8_validate_trunc_len(), and fc_utf8_validate_rep_dup().
char * fc_utf8_validate_trunc_len | ( | char * | utf8_string, |
size_t | byte_len | ||
) |
Truncate the string 'utf8_string' at the first invalid UTF-8 character in the limit (in bytes) of 'byte_len'. Returns 'utf8_string'.
See also fc_utf8_validate_trunc(), fc_utf8_validate_trunc_dup(), and fc_utf8_validate_rep_len().
int int fc_utf8_vsnprintf_rep | ( | char * | str, |
size_t | n, | ||
const char * | format, | ||
va_list | args | ||
) |
int fc_utf8_vsnprintf_trunc | ( | char * | str, |
size_t | n, | ||
const char * | format, | ||
va_list | args | ||
) |