From 8316577b7538f7204c5fd6328756c4c3f171b36e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 16 Sep 2011 14:52:28 -0700 Subject: lib/util/charcnv: Remove broken internal CP850 and CP464 modules These modules are now known to be faulty, and Samba 3.6.0 didn't include support for them, so we now require a system iconv if you wish to support these character sets for the non-ASCII range. Andrew Bartlett --- lib/util/charset/charset.h | 92 ---------------------------------------------- 1 file changed, 92 deletions(-) (limited to 'lib/util/charset/charset.h') diff --git a/lib/util/charset/charset.h b/lib/util/charset/charset.h index 20887e0e9d..2040e2a87c 100644 --- a/lib/util/charset/charset.h +++ b/lib/util/charset/charset.h @@ -67,18 +67,6 @@ typedef uint32_t codepoint_t; #define INVALID_CODEPOINT ((codepoint_t)-1) -/* - * This is auxiliary struct used by source/script/gen-8-bit-gap.sh script - * during generation of an encoding table for charset module - * */ - -struct charset_gap_table { - uint16_t start; - uint16_t end; - int32_t idx; -}; - - /* generic iconv conversion structure */ typedef struct smb_iconv_s { size_t (*direct)(void *cd, const char **inbuf, size_t *inbytesleft, @@ -260,84 +248,4 @@ int strncasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len); int strcmp_wa(const smb_ucs2_t *a, const char *b); smb_ucs2_t toupper_w(smb_ucs2_t v); -/* - * Define stub for charset module which implements 8-bit encoding with gaps. - * Encoding tables for such module should be produced from glibc's CHARMAPs - * using script source/script/gen-8bit-gap.sh - * CHARSETNAME is CAPITALIZED charset name - * - * */ -#define SMB_GENERATE_CHARSET_MODULE_8_BIT_GAP(CHARSETNAME) \ -static size_t CHARSETNAME ## _push(void *cd, const char **inbuf, size_t *inbytesleft, \ - char **outbuf, size_t *outbytesleft) \ -{ \ - while (*inbytesleft >= 2 && *outbytesleft >= 1) { \ - int i; \ - int done = 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)) { \ - ((unsigned char*)(*outbuf))[0] = from_ucs2[from_idx[i].idx+ch]; \ - (*inbytesleft) -= 2; \ - (*outbytesleft) -= 1; \ - (*inbuf) += 2; \ - (*outbuf) += 1; \ - done = 1; \ - break; \ - } \ - } \ - if (!done) { \ - errno = EINVAL; \ - return -1; \ - } \ - \ - } \ - \ - if (*inbytesleft == 1) { \ - errno = EINVAL; \ - return -1; \ - } \ - \ - if (*inbytesleft > 1) { \ - errno = E2BIG; \ - return -1; \ - } \ - \ - return 0; \ -} \ - \ -static size_t CHARSETNAME ## _pull(void *cd, const char **inbuf, size_t *inbytesleft, \ - char **outbuf, size_t *outbytesleft) \ -{ \ - while (*inbytesleft >= 1 && *outbytesleft >= 2) { \ - SSVAL(*outbuf, 0, to_ucs2[((unsigned char*)(*inbuf))[0]]); \ - (*inbytesleft) -= 1; \ - (*outbytesleft) -= 2; \ - (*inbuf) += 1; \ - (*outbuf) += 2; \ - } \ - \ - if (*inbytesleft > 0) { \ - errno = E2BIG; \ - return -1; \ - } \ - \ - return 0; \ -} \ - \ -struct charset_functions CHARSETNAME ## _functions = \ - {#CHARSETNAME, CHARSETNAME ## _pull, CHARSETNAME ## _push}; \ - \ -NTSTATUS charset_ ## CHARSETNAME ## _init(void); \ -NTSTATUS charset_ ## CHARSETNAME ## _init(void) \ -{ \ - if (!smb_register_charset(& CHARSETNAME ## _functions)) { \ - return NT_STATUS_INTERNAL_ERROR; \ - } \ - return NT_STATUS_OK; \ -} \ - - #endif /* __CHARSET_H__ */ -- cgit