]> arthur.barton.de Git - netatalk.git/blobdiff - include/atalk/unicode.h
Merge master
[netatalk.git] / include / atalk / unicode.h
index cda2bbf65a1bb77f034530d1de8309a404610ec9..27441549e2d803cd3e0f85b147673fb6aa3e51b0 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef _ATALK_UNICODE_H
 #define _ATALK_UNICODE_H 1
 
-#include <sys/cdefs.h>
-#include <netatalk/endian.h>
 #include <errno.h>
 #include <sys/param.h>
 
@@ -46,7 +44,9 @@ typedef struct {
 
 /* conversion flags */
 #define CONV_IGNORE         (1<<0) /* return the first convertable characters. */
-#define CONV_ESCAPEHEX      (1<<1) /* escape unconvertable chars with :[UCS2HEX] */
+#define CONV_ESCAPEHEX      (1<<1) /* escape unconvertable chars with :[UCS2HEX], */
+                                   /* also escape '/'. Escape ':' if also CONV_ALLOW_COLON, */
+                                   /* else ':' raises EILSEQ */
 #define CONV_ESCAPEDOTS     (1<<2) /* escape leading dots with :2600 */
 #define CONV_UNESCAPEHEX    (1<<3)
 #define CONV_TOUPPER        (1<<4) /* convert to UPPERcase */
@@ -55,6 +55,7 @@ typedef struct {
 #define CONV_DECOMPOSE      (1<<7) /* precompose */
 #define CONV_FORCE          (1<<8) /* force convertion */
 #define CONV__EILSEQ        (1<<9) /* ignore EILSEQ, replace with IGNORE_CHAR (try USC2) */
+#define CONV_ALLOW_COLON   (1<<10) /* Allow ':' in name. Needed for Extended Attributes */
 
 /* conversion return flags */
 #define CONV_REQMANGLE  (1<<14) /* mangling of returned name is required */
@@ -68,7 +69,7 @@ typedef enum {CH_UCS2=0, CH_UTF8=1, CH_MAC=2, CH_UNIX=3, CH_UTF8_MAC=4} charset_
 /*
  *   for each charset we have a function that pulls from that charset to
  *     a ucs2 buffer, and a function that pushes to a ucs2 buffer
- *     */
+ */
 
 struct charset_functions {
     const char *name;
@@ -89,9 +90,13 @@ extern int atalk_iconv_close (atalk_iconv_t);
 extern struct charset_functions *find_charset_functions (const char *);
 extern int atalk_register_charset (struct charset_functions *);
 
+/* from utf16_case.c */
+extern ucs2_t    toupper_w  (ucs2_t);
+extern u_int32_t toupper_sp (u_int32_t);
+extern ucs2_t    tolower_w  (ucs2_t);
+extern u_int32_t tolower_sp (u_int32_t);
+
 /* from util_unistr.c */
-extern ucs2_t   toupper_w  (ucs2_t);
-extern ucs2_t   tolower_w  (ucs2_t);
 extern int      strupper_w (ucs2_t *);
 extern int      strlower_w (ucs2_t *);
 extern int      islower_w  (ucs2_t);
@@ -140,6 +145,6 @@ extern size_t   charset_decompose  ( charset_t, char *, size_t, char *, size_t);
 extern size_t   utf8_precompose ( char *, size_t, char *, size_t);
 extern size_t   utf8_decompose  ( char *, size_t, char *, size_t);
 
-extern charset_t add_charset (char* name);
+extern charset_t add_charset (const char* name);
 
 #endif  /* _ATALK_UNICODE_H */