#include <errno.h>#include <stdint.h>#include <sys/param.h>Go to the source code of this file.
Data Structures | |
| struct | atalk_iconv_t |
| struct | charset_functions |
Macros | |
| #define | ucs2_t uint16_t |
| #define | SAFE_FREE(x) |
| #define | EILSEQ 84 |
| #define | CHARSET_CLIENT 1 |
| #define | CHARSET_VOLUME 2 |
| #define | CHARSET_PRECOMPOSED 4 |
| #define | CHARSET_DECOMPOSED 8 |
| #define | CHARSET_MULTIBYTE 16 |
| #define | CHARSET_WIDECHAR 32 |
| #define | CHARSET_ICONV 64 |
| #define | IGNORE_CHAR '_' |
| #define | CONV_IGNORE (1<<0) |
| #define | CONV_ESCAPEHEX (1<<1) |
| #define | CONV_ESCAPEDOTS (1<<2) |
| #define | CONV_UNESCAPEHEX (1<<3) |
| #define | CONV_TOUPPER (1<<4) |
| #define | CONV_TOLOWER (1<<5) |
| #define | CONV_PRECOMPOSE (1<<6) |
| #define | CONV_DECOMPOSE (1<<7) |
| #define | CONV_FORCE (1<<8) |
| #define | CONV__EILSEQ (1<<9) |
| #define | CONV_REQMANGLE (1<<14) |
| #define | CONV_REQESCAPE (1<<15) |
| #define | NUM_CHARSETS 5 |
Enumerations | |
| enum | charset_t { CH_UCS2 = 0 , CH_UTF8 = 1 , CH_MAC = 2 , CH_UNIX = 3 , CH_UTF8_MAC = 4 } |
Functions | |
| atalk_iconv_t | atalk_iconv_open (const char *, const char *) |
| size_t | atalk_iconv (atalk_iconv_t, const char **, size_t *, char **, size_t *) |
| This is a simple portable iconv() implementaion. | |
| int | atalk_iconv_close (atalk_iconv_t) |
| struct charset_functions * | find_charset_functions (const char *) |
| int | atalk_register_charset (struct charset_functions *) |
| ucs2_t | toupper_w (ucs2_t) |
| uint32_t | toupper_sp (uint32_t) |
| ucs2_t | tolower_w (ucs2_t) |
| uint32_t | tolower_sp (uint32_t) |
| int | strupper_w (ucs2_t *) |
| Convert a string to upper case. | |
| int | strlower_w (ucs2_t *) |
| Convert a string to lower case. | |
| size_t | strlen_w (const ucs2_t *) |
| wide strlen() | |
| size_t | strnlen_w (const ucs2_t *, size_t) |
| wide strnlen() | |
| ucs2_t * | strchr_w (const ucs2_t *, ucs2_t) |
| wide strchr() | |
| ucs2_t * | strcasechr_w (const ucs2_t *s, ucs2_t c) |
| wide strcasechr() | |
| int | strcmp_w (const ucs2_t *, const ucs2_t *) |
| wide strcmp() | |
| int | strncmp_w (const ucs2_t *, const ucs2_t *, size_t) |
| wide strncmp() | |
| int | strcasecmp_w (const ucs2_t *, const ucs2_t *) |
| wide strcasecmp() | |
| int | strncasecmp_w (const ucs2_t *, const ucs2_t *, size_t) |
| wide strncasecmp() | |
| ucs2_t * | strstr_w (const ucs2_t *s, const ucs2_t *ins) |
| wide strstr() | |
| ucs2_t * | strcasestr_w (const ucs2_t *, const ucs2_t *) |
| wide strcasestr() | |
| ucs2_t * | strndup_w (const ucs2_t *, size_t) |
| wide strndup() | |
| ucs2_t * | strdup_w (const ucs2_t *) |
| wide strdup() | |
| size_t | precompose_w (ucs2_t *, size_t, ucs2_t *, size_t *) |
| pre|decomposition | |
| size_t | decompose_w (ucs2_t *, size_t, ucs2_t *, size_t *) |
| int | set_charset_name (charset_t, const char *) |
| void | free_charset_names (void) |
| void | init_iconv (void) |
| Initialize iconv conversion descriptors. | |
| size_t | convert_string (charset_t, charset_t, void const *, size_t, void *, size_t) |
| size_t | convert_string_allocate (charset_t, charset_t, void const *, size_t, char **) |
| size_t | charset_strupper (charset_t, const char *, size_t, char *, size_t) |
| size_t | charset_strlower (charset_t, const char *, size_t, char *, size_t) |
| size_t | ucs2_to_charset_allocate (charset_t, char **dest, const ucs2_t *src) |
| size_t | ucs2_to_charset (charset_t, const ucs2_t *src, char *dest, size_t) |
| Copy a string from a UCS2 src to a unix char * destination, allocating a buffer. | |
| size_t | convert_charset (charset_t, charset_t, charset_t, const char *, size_t, char *, size_t, uint16_t *) |
| size_t | charset_precompose (charset_t, char *, size_t, char *, size_t) |
| size_t | charset_decompose (charset_t, char *, size_t, char *, size_t) |
| charset_t | add_charset (const char *name) |
| #define CHARSET_CLIENT 1 |
| #define CHARSET_DECOMPOSED 8 |
| #define CHARSET_ICONV 64 |
| #define CHARSET_MULTIBYTE 16 |
| #define CHARSET_PRECOMPOSED 4 |
| #define CHARSET_VOLUME 2 |
| #define CHARSET_WIDECHAR 32 |
| #define CONV__EILSEQ (1<<9) |
ignore EILSEQ, replace with IGNORE_CHAR (try USC2)
| #define CONV_DECOMPOSE (1<<7) |
decompose
| #define CONV_ESCAPEDOTS (1<<2) |
escape leading dots with :2600
| #define CONV_ESCAPEHEX (1<<1) |
escape unconvertable chars with :[UCS2HEX], also escape '/'. Escape ':' if also CONV_ALLOW_COLON, else ':' raises EILSEQ
| #define CONV_FORCE (1<<8) |
force convertion
| #define CONV_IGNORE (1<<0) |
return the first convertable characters.
| #define CONV_PRECOMPOSE (1<<6) |
precompose
| #define CONV_REQESCAPE (1<<15) |
espace unconvertable chars with :[UCS2HEX]
| #define CONV_REQMANGLE (1<<14) |
mangling of returned name is required
| #define CONV_TOLOWER (1<<5) |
convert to lowercase
| #define CONV_TOUPPER (1<<4) |
convert to UPPERcase
| #define CONV_UNESCAPEHEX (1<<3) |
| #define EILSEQ 84 |
Illegal byte sequence.
| #define IGNORE_CHAR '_' |
| #define NUM_CHARSETS 5 |
| #define SAFE_FREE | ( | x | ) |
| #define ucs2_t uint16_t |
| enum charset_t |
|
extern |
|
extern |
This is a simple portable iconv() implementaion.
It only knows about a very small number of character sets - just enough that netatalk works on systems that don't have iconv.
|
extern |
simple iconv_close() wrapper
|
extern |
simple iconv_open() wrapper
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Initialize iconv conversion descriptors.
This is called the first time it is needed, and also called again every time the configuration is reloaded, because the charset or codepage might have changed.
pre|decomposition
we can't use static, this stuff needs to be reentrant static char comp[MAXPATHLEN +1];
We don't implement Singleton and Canonical Ordering. We ignore CompositionExclusions.txt because they cause the problem of the roundtrip such as Dancing Icon.
exclude U2000-U2FFF, UFE30-UFE4F and U2F800-U2FA1F ranges in precompose.h from composition according to AFP 3.x spec
|
extern |
wide strcasechr()
wide strcasecmp()
case insensitive string comparison
wide strcasestr()
wide strchr()
wide strcmp()
wide strdup()
duplicate string
|
extern |
wide strlen()
Count the number of characters in a UTF-16 string.
|
extern |
Convert a string to lower case.
wide strncasecmp()
case insensitive string comparison, length limited
wide strncmp()
wide strndup()
duplicate string
|
extern |
wide strnlen()
Count up to max number of characters in a UTF-16 string.
wide strstr()
|
extern |
Convert a string to upper case.
|
extern |
|
extern |
Copy a string from a UCS2 src to a unix char * destination, allocating a buffer.
| ch | destination character set |
| src | source UCS2 string |
| dest | always set at least to NULL |
| destlen | maximum length of destination buffer |