Lines Matching refs:table
31 static inline int is_valid_sbcs_mapping( const struct sbcs_table *table, int flags, in is_valid_sbcs_mapping() argument
34 if ((flags & WC_NO_BEST_FIT_CHARS) || ch == (unsigned char)table->info.def_char) in is_valid_sbcs_mapping()
35 return (table->cp2uni[ch] == wch); in is_valid_sbcs_mapping()
40 static int get_length_sbcs( const struct sbcs_table *table, int flags, in get_length_sbcs() argument
43 const unsigned char * const uni2cp_low = table->uni2cp_low; in get_length_sbcs()
44 const unsigned short * const uni2cp_high = table->uni2cp_high; in get_length_sbcs()
60 if (is_valid_sbcs_mapping( table, flags, composed, ch )) in get_length_sbcs()
85 *used = !is_valid_sbcs_mapping( table, flags, wch, ch ); in get_length_sbcs()
92 static inline int wcstombs_sbcs( const struct sbcs_table *table, in wcstombs_sbcs() argument
96 const unsigned char * const uni2cp_low = table->uni2cp_low; in wcstombs_sbcs()
97 const unsigned short * const uni2cp_high = table->uni2cp_high; in wcstombs_sbcs()
156 static int wcstombs_sbcs_slow( const struct sbcs_table *table, int flags, in wcstombs_sbcs_slow() argument
161 const unsigned char * const uni2cp_low = table->uni2cp_low; in wcstombs_sbcs_slow()
162 const unsigned short * const uni2cp_high = table->uni2cp_high; in wcstombs_sbcs_slow()
169 def = table->info.def_char & 0xff; in wcstombs_sbcs_slow()
184 if (is_valid_sbcs_mapping( table, flags, composed, *dst )) in wcstombs_sbcs_slow()
209 if (!is_valid_sbcs_mapping( table, flags, wch, *dst )) in wcstombs_sbcs_slow()
224 static inline int is_valid_dbcs_mapping( const struct dbcs_table *table, int flags, in is_valid_dbcs_mapping() argument
227 if ((flags & WC_NO_BEST_FIT_CHARS) || ch == table->info.def_char) in is_valid_dbcs_mapping()
232 unsigned char off = table->cp2uni_leadbytes[ch >> 8]; in is_valid_dbcs_mapping()
233 return (table->cp2uni[(off << 8) + (ch & 0xff)] == wch); in is_valid_dbcs_mapping()
235 return (table->cp2uni[ch & 0xff] == wch); in is_valid_dbcs_mapping()
241 static inline WCHAR get_defchar_dbcs( const struct dbcs_table *table, const char *defchar ) in get_defchar_dbcs() argument
243 if (!defchar) return table->info.def_char; in get_defchar_dbcs()
249 static int get_length_dbcs( const struct dbcs_table *table, int flags, in get_length_dbcs() argument
253 const unsigned short * const uni2cp_low = table->uni2cp_low; in get_length_dbcs()
254 const unsigned short * const uni2cp_high = table->uni2cp_high; in get_length_dbcs()
267 defchar_value = get_defchar_dbcs( table, defchar ); in get_length_dbcs()
280 if (is_valid_dbcs_mapping( table, flags, composed, res )) in get_length_dbcs()
306 if (!is_valid_dbcs_mapping( table, flags, wch, res )) in get_length_dbcs()
317 static inline int wcstombs_dbcs( const struct dbcs_table *table, in wcstombs_dbcs() argument
321 const unsigned short * const uni2cp_low = table->uni2cp_low; in wcstombs_dbcs()
322 const unsigned short * const uni2cp_high = table->uni2cp_high; in wcstombs_dbcs()
341 static int wcstombs_dbcs_slow( const struct dbcs_table *table, int flags, in wcstombs_dbcs_slow() argument
346 const unsigned short * const uni2cp_low = table->uni2cp_low; in wcstombs_dbcs_slow()
347 const unsigned short * const uni2cp_high = table->uni2cp_high; in wcstombs_dbcs_slow()
348 WCHAR defchar_value = get_defchar_dbcs( table, defchar ); in wcstombs_dbcs_slow()
365 if (is_valid_dbcs_mapping( table, flags, composed, res )) in wcstombs_dbcs_slow()
390 if (!is_valid_dbcs_mapping( table, flags, wch, res )) in wcstombs_dbcs_slow()
411 int wine_cp_wcstombs( const union cptable *table, int flags, in wine_cp_wcstombs() argument
415 if (table->info.char_size == 1) in wine_cp_wcstombs()
419 if (!dstlen) return get_length_sbcs( &table->sbcs, flags, src, srclen, used ); in wine_cp_wcstombs()
420 return wcstombs_sbcs_slow( &table->sbcs, flags, src, srclen, in wine_cp_wcstombs()
424 return wcstombs_sbcs( &table->sbcs, src, srclen, dst, dstlen ); in wine_cp_wcstombs()
428 if (!dstlen) return get_length_dbcs( &table->dbcs, flags, src, srclen, defchar, used ); in wine_cp_wcstombs()
430 return wcstombs_dbcs_slow( &table->dbcs, flags, src, srclen, in wine_cp_wcstombs()
432 return wcstombs_dbcs( &table->dbcs, src, srclen, dst, dstlen ); in wine_cp_wcstombs()