Changeset 745 for trunk/server/lib/util/charset/charset.h
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/lib/util/charset/charset.h
r590 r745 40 40 typedef uint16_t smb_ucs2_t; 41 41 42 #ifdef WORDS_BIGENDIAN 43 #define UCS2_SHIFT 8 44 #else 45 #define UCS2_SHIFT 0 46 #endif 47 48 /* turn a 7 bit character into a ucs2 character */ 49 #define UCS2_CHAR(c) ((c) << UCS2_SHIFT) 50 51 /* return an ascii version of a ucs2 character */ 52 #define UCS2_TO_CHAR(c) (((c) >> UCS2_SHIFT) & 0xff) 53 54 /* Copy into a smb_ucs2_t from a possibly unaligned buffer. Return the copied smb_ucs2_t */ 55 #define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\ 56 ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest)) 57 58 59 42 60 /* 43 61 * for each charset we have a function that pulls from that charset to … … 103 121 104 122 char *strchr_m(const char *s, char c); 123 size_t strlen_m_ext(const char *s, charset_t src_charset, charset_t dst_charset); 124 size_t strlen_m_ext_term(const char *s, charset_t src_charset, 125 charset_t dst_charset); 105 126 size_t strlen_m_term(const char *s); 106 127 size_t strlen_m_term_null(const char *s); … … 150 171 151 172 extern struct smb_iconv_convenience *global_iconv_convenience; 152 173 struct smb_iconv_convenience *get_iconv_convenience(void); 174 smb_iconv_t get_conv_handle(struct smb_iconv_convenience *ic, 175 charset_t from, charset_t to); 176 const char *charset_name(struct smb_iconv_convenience *ic, charset_t ch); 177 178 codepoint_t next_codepoint_ext(const char *str, charset_t src_charset, 179 size_t *size); 153 180 codepoint_t next_codepoint(const char *str, size_t *size); 154 181 ssize_t push_codepoint(char *str, codepoint_t c); 155 182 156 183 /* codepoints */ 184 codepoint_t next_codepoint_convenience_ext(struct smb_iconv_convenience *ic, 185 const char *str, charset_t src_charset, 186 size_t *size); 157 187 codepoint_t next_codepoint_convenience(struct smb_iconv_convenience *ic, 158 188 const char *str, size_t *size); 159 189 ssize_t push_codepoint_convenience(struct smb_iconv_convenience *ic, 160 190 char *str, codepoint_t c); 191 161 192 codepoint_t toupper_m(codepoint_t val); 162 193 codepoint_t tolower_m(codepoint_t val); 194 bool islower_m(codepoint_t val); 195 bool isupper_m(codepoint_t val); 163 196 int codepoint_cmpi(codepoint_t c1, codepoint_t c2); 164 197 165 198 /* Iconv convenience functions */ 166 struct smb_iconv_convenience *smb_iconv_convenience_init(TALLOC_CTX *mem_ctx, 167 const char *dos_charset, 168 const char *unix_charset, 169 bool native_iconv); 199 struct smb_iconv_convenience *smb_iconv_convenience_reinit(TALLOC_CTX *mem_ctx, 200 const char *dos_charset, 201 const char *unix_charset, 202 const char *display_charset, 203 bool native_iconv, 204 struct smb_iconv_convenience *old_ic); 170 205 171 206 bool convert_string_convenience(struct smb_iconv_convenience *ic, … … 189 224 190 225 void load_case_tables(void); 191 bool charset_register_backend(const void *_funcs); 226 void load_case_tables_library(void); 227 bool smb_register_charset(const struct charset_functions *funcs_in); 192 228 193 229 /* … … 264 300 NTSTATUS charset_ ## CHARSETNAME ## _init(void) \ 265 301 { \ 266 return smb_register_charset(& CHARSETNAME ## _functions); \ 267 } \ 302 if (!smb_register_charset(& CHARSETNAME ## _functions)) { \ 303 return NT_STATUS_INTERNAL_ERROR; \ 304 } \ 305 return NT_STATUS_OK; \ 306 } \ 268 307 269 308
Note:
See TracChangeset
for help on using the changeset viewer.