]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/unicode/charcnv.c
Merge master
[netatalk.git] / libatalk / unicode / charcnv.c
index 98e8ffccd53b28905f752591777d292725dc7ec8..7859a228ea1f9756b4a6c5fd72dc585eeff1aadf 100644 (file)
 #if HAVE_LANGINFO_H
 #include <langinfo.h>
 #endif
+#include <arpa/inet.h>
 
-#include <netatalk/endian.h>
 #include <atalk/logger.h>
 #include <atalk/unicode.h>
 #include <atalk/util.h>
+#include <atalk/compat.h>
+
 #include "byteorder.h"
 
 
@@ -139,13 +141,11 @@ static const char *charset_name(charset_t ch)
     if (!ret)
         ret = charset_names[ch];
 
-#if defined(HAVE_NL_LANGINFO) && defined(CODESET)
+#if defined(CODESET)
     if (ret && strcasecmp(ret, "LOCALE") == 0) {
         const char *ln = NULL;
 
-#ifdef HAVE_SETLOCALE
         setlocale(LC_ALL, "");
-#endif
         ln = nl_langinfo(CODESET);
         if (ln) {
             /* Check whether the charset name is supported
@@ -768,9 +768,9 @@ char * debug_out ( char * seq, size_t len)
  *      for e.g. HFS cdroms.
  */
 
-static size_t pull_charset_flags (charset_t from_set, charset_t cap_set, const char *src, size_t srclen, char* dest, size_t destlen, u_int16_t *flags)
+static size_t pull_charset_flags (charset_t from_set, charset_t cap_set, const char *src, size_t srclen, char* dest, size_t destlen, uint16_t *flags)
 {
-    const u_int16_t option = (flags ? *flags : 0);
+    const uint16_t option = (flags ? *flags : 0);
     size_t i_len, o_len;
     size_t j = 0;
     const char* inbuf = (const char*)src;
@@ -880,9 +880,9 @@ end:
  */
 
 
-static size_t push_charset_flags (charset_t to_set, charset_t cap_set, char* src, size_t srclen, char* dest, size_t destlen, u_int16_t *flags)
+static size_t push_charset_flags (charset_t to_set, charset_t cap_set, char* src, size_t srclen, char* dest, size_t destlen, uint16_t *flags)
 {
-    const u_int16_t option = (flags ? *flags : 0);
+    const uint16_t option = (flags ? *flags : 0);
     size_t i_len, o_len, i;
     size_t j = 0;
     const char* inbuf = (const char*)src;
@@ -1029,7 +1029,7 @@ end:
  * FIXME the size is a mess we really need a malloc/free logic
  *`dest size must be dest_len +2
  */
-size_t convert_charset ( charset_t from_set, charset_t to_set, charset_t cap_charset, const char *src, size_t src_len, char *dest, size_t dest_len, u_int16_t *flags)
+size_t convert_charset ( charset_t from_set, charset_t to_set, charset_t cap_charset, const char *src, size_t src_len, char *dest, size_t dest_len, uint16_t *flags)
 {
     size_t i_len, o_len;
     ucs2_t *u;