]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/unicode/charcnv.c
Add function to set charset_name so we can make the array status
[netatalk.git] / libatalk / unicode / charcnv.c
index d3b5fee6e8bd1156b3ca57ef45ab74e05516d78d..cd2fe6e5959984f5ecc0604405eb7b498f30c926 100644 (file)
@@ -67,7 +67,7 @@
 #define CHECK_FLAGS(a,b) (((a)!=NULL) ? (*(a) & (b)) : 0 )
 
 static atalk_iconv_t conv_handles[MAX_CHARSETS][MAX_CHARSETS];
-char* charset_names[MAX_CHARSETS];
+static char* charset_names[MAX_CHARSETS];
 static struct charset_functions* charsets[MAX_CHARSETS];
 static char hexdig[] = "0123456789abcdef";
 #define hextoint( c )   ( isdigit( c ) ? c - '0' : c + 10 - 'a' )
@@ -87,6 +87,14 @@ static const char *charset_name(charset_t ch)
     return ret;
 }
 
+int set_charset_name(charset_t ch, const char *name)
+{
+    if (ch >= NUM_CHARSETS)
+        return -1;
+    charset_names[ch] = strdup(name);
+    return 0;
+}
+
 static struct charset_functions* get_charset_functions (charset_t ch)
 {
     if (charsets[ch] != NULL)