Lines Matching defs:table

81 static inline int is_valid_sbcs_mapping( const struct sbcs_table *table, int flags,
84 if ((flags & WC_NO_BEST_FIT_CHARS) || ch == (unsigned char)table->info.def_char)
85 return (table->cp2uni[ch] == wch);
90 static int get_length_sbcs( const struct sbcs_table *table, int flags,
93 const unsigned char * const uni2cp_low = table->uni2cp_low;
94 const unsigned short * const uni2cp_high = table->uni2cp_high;
110 if (is_valid_sbcs_mapping( table, flags, composed, ch ))
135 *used = !is_valid_sbcs_mapping( table, flags, wch, ch );
142 static inline int wcstombs_sbcs( const struct sbcs_table *table,
146 const unsigned char * const uni2cp_low = table->uni2cp_low;
147 const unsigned short * const uni2cp_high = table->uni2cp_high;
206 static int wcstombs_sbcs_slow( const struct sbcs_table *table, int flags,
211 const unsigned char * const uni2cp_low = table->uni2cp_low;
212 const unsigned short * const uni2cp_high = table->uni2cp_high;
219 def = table->info.def_char & 0xff;
234 if (is_valid_sbcs_mapping( table, flags, composed, *dst ))
259 if (!is_valid_sbcs_mapping( table, flags, wch, *dst ))
274 static inline int is_valid_dbcs_mapping( const struct dbcs_table *table, int flags,
277 if ((flags & WC_NO_BEST_FIT_CHARS) || ch == table->info.def_char)
282 unsigned char off = table->cp2uni_leadbytes[ch >> 8];
283 return (table->cp2uni[(off << 8) + (ch & 0xff)] == wch);
285 return (table->cp2uni[ch & 0xff] == wch);
291 static int get_length_dbcs( const struct dbcs_table *table, int flags,
295 const unsigned short * const uni2cp_low = table->uni2cp_low;
296 const unsigned short * const uni2cp_high = table->uni2cp_high;
297 WCHAR defchar_value = table->info.def_char;
323 if (is_valid_dbcs_mapping( table, flags, composed, res ))
349 if (!is_valid_dbcs_mapping( table, flags, wch, res ))
360 static inline int wcstombs_dbcs( const struct dbcs_table *table,
364 const unsigned short * const uni2cp_low = table->uni2cp_low;
365 const unsigned short * const uni2cp_high = table->uni2cp_high;
384 static int wcstombs_dbcs_slow( const struct dbcs_table *table, int flags,
389 const unsigned short * const uni2cp_low = table->uni2cp_low;
390 const unsigned short * const uni2cp_high = table->uni2cp_high;
391 WCHAR defchar_value = table->info.def_char;
409 if (is_valid_dbcs_mapping( table, flags, composed, res ))
434 if (!is_valid_dbcs_mapping( table, flags, wch, res ))
455 int wine_cp_wcstombs( const union cptable *table, int flags,
459 if (table->info.char_size == 1)
463 if (!dstlen) return get_length_sbcs( &table->sbcs, flags, src, srclen, used );
464 return wcstombs_sbcs_slow( &table->sbcs, flags, src, srclen,
468 return wcstombs_sbcs( &table->sbcs, src, srclen, dst, dstlen );
472 if (!dstlen) return get_length_dbcs( &table->dbcs, flags, src, srclen, defchar, used );
474 return wcstombs_dbcs_slow( &table->dbcs, flags, src, srclen,
476 return wcstombs_dbcs( &table->dbcs, src, srclen, dst, dstlen );