lib/util/charset Move built-in charset modules to the top level
authorAndrew Bartlett <abartlet@samba.org>
Fri, 13 May 2011 08:26:20 +0000 (10:26 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 13 May 2011 16:50:23 +0000 (18:50 +0200)
This removes the 'charset' subsystem and allows these modules to be
used across the whole of Samba.

Andrew Bartlett

lib/util/charset/CP437.c [moved from source3/modules/CP437.c with 99% similarity]
lib/util/charset/CP850.c [moved from source3/modules/CP850.c with 99% similarity]
lib/util/charset/charset.h
lib/util/charset/charset_macosxfs.c [moved from source3/modules/charset_macosxfs.c with 100% similarity]
lib/util/charset/weird.c [moved from source3/modules/weird.c with 100% similarity]
lib/util/charset/wscript_build
source3/Makefile.in
source3/modules/wscript_build
source3/wscript_build

similarity index 99%
rename from source3/modules/CP437.c
rename to lib/util/charset/CP437.c
index 96d14b1f0233e480d2e81fa16d064384ac9990b0..1e478d678f9519345232eb1674446e3ccf064f5d 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "includes.h"
 
-static const uint16 to_ucs2[256] = {
+static const uint16_t to_ucs2[256] = {
  0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
  0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
  0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
similarity index 99%
rename from source3/modules/CP850.c
rename to lib/util/charset/CP850.c
index 40730c0d8d61e33922bade48130320e9867527d6..87a76f4cdf958b8959ec808771a23d8c507241fd 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "includes.h"
 
-static const uint16 to_ucs2[256] = {
+static const uint16_t to_ucs2[256] = {
  0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
  0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
  0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
index e5fd596f8f50850585384da4862676b231e6553b..a7e554204bcabef985f3f270af3d8a4b27530e2f 100644 (file)
@@ -279,7 +279,7 @@ static size_t CHARSETNAME ## _push(void *cd, const char **inbuf, size_t *inbytes
                int i;                                                                          \
                int done = 0;                                                                   \
                                                                                                \
-               uint16 ch = SVAL(*inbuf,0);                                                     \
+               uint16_t ch = SVAL(*inbuf,0);                                                   \
                                                                                                \
                for (i=0; from_idx[i].start != 0xffff; i++) {                                   \
                        if ((from_idx[i].start <= ch) && (from_idx[i].end >= ch)) {             \
index 762313114602201726d817cf1b51af4c4ea3da5d..3b29ace6d32abafbbe743e6e59b5e91b3ac5e15c 100644 (file)
@@ -9,3 +9,36 @@ bld.SAMBA_SUBSYSTEM('CHARSET',
                     source='codepoints.c convert_string.c util_str.c util_unistr_w.c charcnv.c pull_push.c util_unistr.c',
                     deps='DYNCONFIG ICONV_WRAPPER'
                     )
+
+bld.SAMBA_MODULE('charset_weird',
+                 subsystem='CHARSET',
+                 source='weird.c',
+                 init_function='',
+                 deps='samba-util',
+                 internal_module=bld.SAMBA3_IS_STATIC_MODULE('charset_weird'),
+                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('charset_weird'))
+
+bld.SAMBA_MODULE('charset_CP850',
+                 subsystem='CHARSET',
+                 source='CP850.c',
+                 init_function='',
+                 deps='samba-util',
+                 internal_module=bld.SAMBA3_IS_STATIC_MODULE('charset_CP850'),
+                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('charset_CP850'))
+
+bld.SAMBA_MODULE('charset_CP437',
+                 subsystem='CHARSET',
+                 source='CP437.c',
+                 init_function='',
+                 deps='samba-util',
+                 internal_module=bld.SAMBA3_IS_STATIC_MODULE('charset_CP437'),
+                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('charset_CP437'))
+
+bld.SAMBA_MODULE('charset_macosxfs',
+                 subsystem='CHARSET',
+                 source='charset_macosxfs.c',
+                 init_function='',
+                 internal_module=bld.SAMBA3_IS_STATIC_MODULE('charset_macosxfs'),
+                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('charset_macosxfs'))
+
+
index 2ad1dc7d46743c8bf45d8a3741d18c7486981bd6..84bfd9aa39baf02df89b30ccece17ef12af4a813 100644 (file)
@@ -778,10 +778,10 @@ PASSDB_OBJ = $(PASSDB_GET_SET_OBJ) passdb/passdb.o passdb/pdb_interface.o \
                lib/util_nscd.o lib/winbind_util.o $(SERVER_MUTEX_OBJ) \
                passdb/pdb_util.o
 
-DEVEL_HELP_WEIRD_OBJ = modules/weird.o
-CP850_OBJ = modules/CP850.o
-CP437_OBJ = modules/CP437.o
-CHARSET_MACOSXFS_OBJ = modules/charset_macosxfs.o
+DEVEL_HELP_WEIRD_OBJ = ../lib/util/charset/weird.o
+CP850_OBJ = ../lib/util/charset/CP850.o
+CP437_OBJ = ../lib/util/charset/CP437.o
+CHARSET_MACOSXFS_OBJ = ../lib/util/charset/charset_macosxfs.o
 
 GROUPDB_OBJ = groupdb/mapping.o groupdb/mapping_tdb.o
 
index ff7163fdc776efc1560fec61c557d8b388b1ed51..a16a4f292fb7a04ccd9c9c2a21f201dbaa178f46 100644 (file)
@@ -410,45 +410,6 @@ bld.SAMBA3_MODULE('vfs_time_audit',
 
 
 
-CHARSET_WEIRD_SRC = 'weird.c'
-CHARSET_CP850_SRC = 'CP850.c'
-CHARSET_CP437_SRC = 'CP437.c'
-CHARSET_MACOSXFS_SRC = 'charset_macosxfs.c'
-
-
-bld.SAMBA3_SUBSYSTEM('charset',
-                    source='',
-                    vars=locals())
-
-bld.SAMBA3_MODULE('charset_weird',
-                 subsystem='charset',
-                 source=CHARSET_WEIRD_SRC,
-                 init_function='',
-                 internal_module=bld.SAMBA3_IS_STATIC_MODULE('charset_weird'),
-                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('charset_weird'))
-
-bld.SAMBA3_MODULE('charset_CP850',
-                 subsystem='charset',
-                 source=CHARSET_CP850_SRC,
-                 init_function='',
-                 internal_module=bld.SAMBA3_IS_STATIC_MODULE('charset_CP850'),
-                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('charset_CP850'))
-
-bld.SAMBA3_MODULE('charset_CP437',
-                 subsystem='charset',
-                 source=CHARSET_CP437_SRC,
-                 init_function='',
-                 internal_module=bld.SAMBA3_IS_STATIC_MODULE('charset_CP437'),
-                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('charset_CP437'))
-
-bld.SAMBA3_MODULE('charset_macosxfs',
-                 subsystem='charset',
-                 source=CHARSET_MACOSXFS_SRC,
-                 init_function='',
-                 internal_module=bld.SAMBA3_IS_STATIC_MODULE('charset_macosxfs'),
-                 enabled=bld.SAMBA3_IS_ENABLED_MODULE('charset_macosxfs'))
-
-
 PERFCOUNT_ONEFS_SRC = 'perfcount_onefs.c'
 PERFCOUNT_TEST_SRC = 'perfcount_test.c'
 
index 105aee99cb50a893c9f67cbfe92e29a8b7393c20..61e892d55ebbccbefc1438f72231db93dcce6774 100755 (executable)
@@ -777,7 +777,7 @@ bld.SAMBA3_SUBSYSTEM('KRBCLIENT',
 
 bld.SAMBA3_LIBRARY('samba3core',
                    source=LIB_SRC,
-                   deps='LIBCRYPTO ndr ndr-util security NDR_SECURITY charset NDR_MESSAGING LIBASYNC_REQ tdb-wrap3 CHARSET3 UTIL_TDB UTIL_PW SAMBA_VERSION KRB5_WRAP flag_mapping util_reg passdb PTHREADPOOL interfaces',
+                   deps='LIBCRYPTO ndr ndr-util security NDR_SECURITY samba-util NDR_MESSAGING LIBASYNC_REQ tdb-wrap3 UTIL_TDB UTIL_PW SAMBA_VERSION KRB5_WRAP flag_mapping util_reg passdb PTHREADPOOL interfaces',
                    private_library=True,
                    vars=locals())