Lines Matching refs:ctx

18             ctx->u.utf_8.lower = 0x00;                                         \
19 ctx->u.utf_8.need = 0; \
23 ctx->have_error = true; \
32 ctx->codepoint = (ctx->codepoint << 6) | (ch & 0x3F); \
39 ctx->u.utf_8.lower = f_lower; \
40 ctx->u.utf_8.upper = 0xBF; \
43 ctx->u.utf_8.lower = 0x80; \
44 ctx->u.utf_8.upper = s_upper; \
49 #define LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, cp) \ argument
51 (ctx)->buffer_out[(ctx)->buffer_used++] = (cp); \
55 #define LXB_ENCODING_DECODE_APPEND(ctx, cp) \ argument
57 if ((ctx)->buffer_used >= (ctx)->buffer_length) { \
61 (ctx)->buffer_out[(ctx)->buffer_used++] = (cp); \
65 #define LXB_ENCODING_DECODE_APPEND_P(ctx, cp) \ argument
67 if ((ctx)->buffer_used >= (ctx)->buffer_length) { \
72 (ctx)->buffer_out[(ctx)->buffer_used++] = (cp); \
76 #define LXB_ENCODING_DECODE_CHECK_OUT(ctx) \ argument
78 if ((ctx)->buffer_used >= (ctx)->buffer_length) { \
86 if (ctx->replace_to == NULL) { \
90 if ((ctx->buffer_used + ctx->replace_len) > ctx->buffer_length) { \
99 memcpy(&ctx->buffer_out[ctx->buffer_used], ctx->replace_to, \
100 sizeof(lxb_codepoint_t) * ctx->replace_len); \
102 ctx->buffer_used += ctx->replace_len; \
106 #define LXB_ENCODING_DECODE_ERROR(ctx) \ argument
120 ctx->have_error = true; \
133 LXB_ENCODING_DECODE_APPEND_P(ctx, *p++); \
136 ctx->codepoint = decode_map[(*p++) - 0x80].codepoint; \
137 if (ctx->codepoint == LXB_ENCODING_ERROR_CODEPOINT) { \
145 LXB_ENCODING_DECODE_APPEND_P(ctx, ctx->codepoint); \
163 ctx->codepoint = (ctx->codepoint << 6) | (ch & 0x3F); \
171 ctx->u.utf_8.lower = f_lower; \
172 ctx->u.utf_8.upper = 0xBF; \
175 ctx->u.utf_8.lower = 0x80; \
176 ctx->u.utf_8.upper = s_upper; \
183 lxb_encoding_decode_default(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_default() argument
186 return lxb_encoding_decode_utf_8(ctx, data, end); in lxb_encoding_decode_default()
190 lxb_encoding_decode_auto(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_auto() argument
198 lxb_encoding_decode_undefined(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_undefined() argument
206 lxb_encoding_decode_big5(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_big5() argument
212 ctx->status = LXB_STATUS_OK; in lxb_encoding_decode_big5()
214 if (ctx->u.lead != 0x00) { in lxb_encoding_decode_big5()
215 if (ctx->have_error) { in lxb_encoding_decode_big5()
216 ctx->u.lead = 0x00; in lxb_encoding_decode_big5()
217 ctx->have_error = false; in lxb_encoding_decode_big5()
220 ctx->u.lead = 0x01; in lxb_encoding_decode_big5()
221 ctx->have_error = true; in lxb_encoding_decode_big5()
224 else if (ctx->second_codepoint != 0x0000) { in lxb_encoding_decode_big5()
225 if ((ctx->buffer_used + 2) > ctx->buffer_length) { in lxb_encoding_decode_big5()
229 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, ctx->u.lead); in lxb_encoding_decode_big5()
230 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, ctx->second_codepoint); in lxb_encoding_decode_big5()
232 ctx->u.lead = 0x00; in lxb_encoding_decode_big5()
233 ctx->second_codepoint = 0x0000; in lxb_encoding_decode_big5()
237 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_big5()
242 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_big5()
244 lead = (lxb_char_t) ctx->u.lead; in lxb_encoding_decode_big5()
245 ctx->u.lead = 0x00; in lxb_encoding_decode_big5()
252 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_big5()
257 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, lead); in lxb_encoding_decode_big5()
271 ctx->u.lead = lead; in lxb_encoding_decode_big5()
272 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_big5()
303 if ((ctx->buffer_used + 2) > ctx->buffer_length) { in lxb_encoding_decode_big5()
304 ctx->u.lead = 0x00CA; in lxb_encoding_decode_big5()
305 ctx->second_codepoint = 0x0304; in lxb_encoding_decode_big5()
310 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0x00CA); in lxb_encoding_decode_big5()
311 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0x0304); in lxb_encoding_decode_big5()
316 if ((ctx->buffer_used + 2) > ctx->buffer_length) { in lxb_encoding_decode_big5()
317 ctx->u.lead = 0x00CA; in lxb_encoding_decode_big5()
318 ctx->second_codepoint = 0x030C; in lxb_encoding_decode_big5()
323 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0x00CA); in lxb_encoding_decode_big5()
324 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0x030C); in lxb_encoding_decode_big5()
329 if ((ctx->buffer_used + 2) > ctx->buffer_length) { in lxb_encoding_decode_big5()
330 ctx->u.lead = 0x00EA; in lxb_encoding_decode_big5()
331 ctx->second_codepoint = 0x0304; in lxb_encoding_decode_big5()
336 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0x00EA); in lxb_encoding_decode_big5()
337 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0x0304); in lxb_encoding_decode_big5()
342 if ((ctx->buffer_used + 2) > ctx->buffer_length) { in lxb_encoding_decode_big5()
343 ctx->u.lead = 0x00EA; in lxb_encoding_decode_big5()
344 ctx->second_codepoint = 0x030C; in lxb_encoding_decode_big5()
349 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0x00EA); in lxb_encoding_decode_big5()
350 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0x030C); in lxb_encoding_decode_big5()
355 LXB_ENCODING_DECODE_FAILED(ctx->u.lead); in lxb_encoding_decode_big5()
359 ctx->codepoint = lxb_encoding_multi_index_big5[index].codepoint; in lxb_encoding_decode_big5()
360 if (ctx->codepoint == LXB_ENCODING_ERROR_CODEPOINT) { in lxb_encoding_decode_big5()
361 LXB_ENCODING_DECODE_FAILED(ctx->u.lead); in lxb_encoding_decode_big5()
365 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, ctx->codepoint); in lxb_encoding_decode_big5()
372 lxb_encoding_decode_euc_jp(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_euc_jp() argument
378 ctx->status = LXB_STATUS_OK; in lxb_encoding_decode_euc_jp()
380 if (ctx->u.euc_jp.lead != 0x00) { in lxb_encoding_decode_euc_jp()
381 if (ctx->have_error) { in lxb_encoding_decode_euc_jp()
382 ctx->have_error = false; in lxb_encoding_decode_euc_jp()
383 ctx->u.euc_jp.lead = 0x00; in lxb_encoding_decode_euc_jp()
386 ctx->have_error = true; in lxb_encoding_decode_euc_jp()
387 ctx->u.euc_jp.lead = 0x01; in lxb_encoding_decode_euc_jp()
392 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_euc_jp()
397 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_euc_jp()
399 lead = ctx->u.euc_jp.lead; in lxb_encoding_decode_euc_jp()
402 ctx->u.euc_jp.lead = 0x00; in lxb_encoding_decode_euc_jp()
404 if (ctx->u.euc_jp.is_jis0212) { in lxb_encoding_decode_euc_jp()
406 ctx->u.euc_jp.is_jis0212 = false; in lxb_encoding_decode_euc_jp()
416 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_euc_jp()
421 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, lead); in lxb_encoding_decode_euc_jp()
437 ctx->u.euc_jp.lead = lead; in lxb_encoding_decode_euc_jp()
438 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_euc_jp()
448 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0xFF61 - 0xA1 + byte); in lxb_encoding_decode_euc_jp()
456 ctx->u.euc_jp.lead = byte; in lxb_encoding_decode_euc_jp()
457 ctx->u.euc_jp.is_jis0212 = true; in lxb_encoding_decode_euc_jp()
459 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_euc_jp()
474 LXB_ENCODING_DECODE_FAILED(ctx->u.euc_jp.lead); in lxb_encoding_decode_euc_jp()
479 ctx->codepoint = (lead - 0xA1) * 94 + byte - 0xA1; in lxb_encoding_decode_euc_jp()
483 / sizeof(lxb_encoding_multi_index_t)) <= ctx->codepoint) in lxb_encoding_decode_euc_jp()
485 LXB_ENCODING_DECODE_FAILED(ctx->u.euc_jp.lead); in lxb_encoding_decode_euc_jp()
489 ctx->codepoint = lxb_encoding_multi_index_jis0212[ctx->codepoint].codepoint; in lxb_encoding_decode_euc_jp()
493 / sizeof(lxb_encoding_multi_index_t)) <= ctx->codepoint) in lxb_encoding_decode_euc_jp()
495 LXB_ENCODING_DECODE_FAILED(ctx->u.euc_jp.lead); in lxb_encoding_decode_euc_jp()
499 ctx->codepoint = lxb_encoding_multi_index_jis0208[ctx->codepoint].codepoint; in lxb_encoding_decode_euc_jp()
502 if (ctx->codepoint == LXB_ENCODING_ERROR_CODEPOINT) { in lxb_encoding_decode_euc_jp()
503 LXB_ENCODING_DECODE_FAILED(ctx->u.euc_jp.lead); in lxb_encoding_decode_euc_jp()
507 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, ctx->codepoint); in lxb_encoding_decode_euc_jp()
514 lxb_encoding_decode_euc_kr(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_euc_kr() argument
519 ctx->status = LXB_STATUS_OK; in lxb_encoding_decode_euc_kr()
521 if (ctx->u.lead != 0x00) { in lxb_encoding_decode_euc_kr()
522 if (ctx->have_error) { in lxb_encoding_decode_euc_kr()
523 ctx->have_error = false; in lxb_encoding_decode_euc_kr()
524 ctx->u.lead = 0x00; in lxb_encoding_decode_euc_kr()
527 ctx->have_error = true; in lxb_encoding_decode_euc_kr()
528 ctx->u.lead = 0x01; in lxb_encoding_decode_euc_kr()
533 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_euc_kr()
538 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_euc_kr()
540 lead = (lxb_char_t) ctx->u.lead; in lxb_encoding_decode_euc_kr()
541 ctx->u.lead = 0x00; in lxb_encoding_decode_euc_kr()
548 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_euc_kr()
553 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, lead); in lxb_encoding_decode_euc_kr()
567 ctx->u.lead = lead; in lxb_encoding_decode_euc_kr()
568 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_euc_kr()
578 LXB_ENCODING_DECODE_FAILED(ctx->u.lead); in lxb_encoding_decode_euc_kr()
583 ctx->codepoint = (lead - 0x81) * 190 + (byte - 0x41); in lxb_encoding_decode_euc_kr()
585 if (ctx->codepoint >= sizeof(lxb_encoding_multi_index_euc_kr) in lxb_encoding_decode_euc_kr()
588 LXB_ENCODING_DECODE_FAILED(ctx->u.lead); in lxb_encoding_decode_euc_kr()
592 ctx->codepoint = lxb_encoding_multi_index_euc_kr[ctx->codepoint].codepoint; in lxb_encoding_decode_euc_kr()
593 if (ctx->codepoint == LXB_ENCODING_ERROR_CODEPOINT) { in lxb_encoding_decode_euc_kr()
594 LXB_ENCODING_DECODE_FAILED(ctx->u.lead); in lxb_encoding_decode_euc_kr()
598 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, ctx->codepoint); in lxb_encoding_decode_euc_kr()
605 lxb_encoding_decode_gbk(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_gbk() argument
608 return lxb_encoding_decode_gb18030(ctx, data, end); in lxb_encoding_decode_gbk()
612 lxb_encoding_decode_ibm866(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_ibm866() argument
621 lxb_encoding_decode_iso_2022_jp(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_2022_jp() argument
635 ctx->status = LXB_STATUS_CONTINUE; \ in lxb_encoding_decode_iso_2022_jp()
643 lxb_encoding_ctx_2022_jp_t *iso = &ctx->u.iso_2022_jp; in lxb_encoding_decode_iso_2022_jp()
645 ctx->status = LXB_STATUS_OK; in lxb_encoding_decode_iso_2022_jp()
647 if (ctx->have_error) { in lxb_encoding_decode_iso_2022_jp()
648 ctx->have_error = false; in lxb_encoding_decode_iso_2022_jp()
651 ctx->have_error = true; in lxb_encoding_decode_iso_2022_jp()
658 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_iso_2022_jp()
663 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_iso_2022_jp()
676 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_iso_2022_jp()
697 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, byte); in lxb_encoding_decode_iso_2022_jp()
705 ctx->have_error = true; in lxb_encoding_decode_iso_2022_jp()
723 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0x00A5); in lxb_encoding_decode_iso_2022_jp()
731 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0x203E); in lxb_encoding_decode_iso_2022_jp()
745 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, byte); in lxb_encoding_decode_iso_2022_jp()
757 ctx->have_error = true; in lxb_encoding_decode_iso_2022_jp()
776 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, in lxb_encoding_decode_iso_2022_jp()
785 ctx->have_error = true; in lxb_encoding_decode_iso_2022_jp()
813 ctx->have_error = true; in lxb_encoding_decode_iso_2022_jp()
825 ctx->have_error = true; in lxb_encoding_decode_iso_2022_jp()
838 ctx->codepoint = (iso->lead - 0x21) * 94 + byte - 0x21; in lxb_encoding_decode_iso_2022_jp()
840 ctx->codepoint = lxb_encoding_multi_index_jis0208[ctx->codepoint].codepoint; in lxb_encoding_decode_iso_2022_jp()
842 if (ctx->codepoint != LXB_ENCODING_ERROR_CODEPOINT) { in lxb_encoding_decode_iso_2022_jp()
843 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, ctx->codepoint); in lxb_encoding_decode_iso_2022_jp()
852 ctx->have_error = true; in lxb_encoding_decode_iso_2022_jp()
871 iso->state = ctx->u.iso_2022_jp.out_state; in lxb_encoding_decode_iso_2022_jp()
875 ctx->have_error = true; in lxb_encoding_decode_iso_2022_jp()
911 ctx->have_error = true; in lxb_encoding_decode_iso_2022_jp()
926 ctx->have_error = true; in lxb_encoding_decode_iso_2022_jp()
949 lxb_encoding_decode_iso_8859_10(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_10() argument
958 lxb_encoding_decode_iso_8859_13(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_13() argument
967 lxb_encoding_decode_iso_8859_14(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_14() argument
976 lxb_encoding_decode_iso_8859_15(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_15() argument
985 lxb_encoding_decode_iso_8859_16(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_16() argument
994 lxb_encoding_decode_iso_8859_2(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_2() argument
1003 lxb_encoding_decode_iso_8859_3(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_3() argument
1012 lxb_encoding_decode_iso_8859_4(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_4() argument
1021 lxb_encoding_decode_iso_8859_5(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_5() argument
1030 lxb_encoding_decode_iso_8859_6(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_6() argument
1039 lxb_encoding_decode_iso_8859_7(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_7() argument
1048 lxb_encoding_decode_iso_8859_8(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_8() argument
1057 lxb_encoding_decode_iso_8859_8_i(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_8_i() argument
1066 lxb_encoding_decode_koi8_r(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_koi8_r() argument
1075 lxb_encoding_decode_koi8_u(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_koi8_u() argument
1084 lxb_encoding_decode_shift_jis(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_shift_jis() argument
1089 ctx->status = LXB_STATUS_OK; in lxb_encoding_decode_shift_jis()
1091 if (ctx->u.lead != 0x00) { in lxb_encoding_decode_shift_jis()
1092 if (ctx->have_error) { in lxb_encoding_decode_shift_jis()
1093 ctx->have_error = false; in lxb_encoding_decode_shift_jis()
1094 ctx->u.lead = 0x00; in lxb_encoding_decode_shift_jis()
1097 ctx->have_error = true; in lxb_encoding_decode_shift_jis()
1098 ctx->u.lead = 0x01; in lxb_encoding_decode_shift_jis()
1103 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_shift_jis()
1108 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_shift_jis()
1110 lead = (lxb_char_t) ctx->u.lead; in lxb_encoding_decode_shift_jis()
1111 ctx->u.lead = 0x00; in lxb_encoding_decode_shift_jis()
1118 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_shift_jis()
1123 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, lead); in lxb_encoding_decode_shift_jis()
1128 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0xFF61 - 0xA1 + lead); in lxb_encoding_decode_shift_jis()
1144 ctx->u.lead = lead; in lxb_encoding_decode_shift_jis()
1145 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_shift_jis()
1155 ctx->codepoint = 0x40; in lxb_encoding_decode_shift_jis()
1158 ctx->codepoint = 0x41; in lxb_encoding_decode_shift_jis()
1162 ctx->second_codepoint = 0x81; in lxb_encoding_decode_shift_jis()
1165 ctx->second_codepoint = 0xC1; in lxb_encoding_decode_shift_jis()
1171 LXB_ENCODING_DECODE_FAILED(ctx->u.lead); in lxb_encoding_decode_shift_jis()
1176 ctx->codepoint = (lead - ctx->second_codepoint) * 188 in lxb_encoding_decode_shift_jis()
1177 + byte - ctx->codepoint; in lxb_encoding_decode_shift_jis()
1179 if (ctx->codepoint >= (sizeof(lxb_encoding_multi_index_jis0208) in lxb_encoding_decode_shift_jis()
1182 LXB_ENCODING_DECODE_FAILED(ctx->u.lead); in lxb_encoding_decode_shift_jis()
1186 if ((unsigned) (ctx->codepoint - 8836) <= (10715 - 8836)) { in lxb_encoding_decode_shift_jis()
1187 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0xE000 - 8836 + ctx->codepoint); in lxb_encoding_decode_shift_jis()
1191 ctx->codepoint = lxb_encoding_multi_index_jis0208[ctx->codepoint].codepoint; in lxb_encoding_decode_shift_jis()
1192 if (ctx->codepoint == LXB_ENCODING_ERROR_CODEPOINT) { in lxb_encoding_decode_shift_jis()
1193 LXB_ENCODING_DECODE_FAILED(ctx->u.lead); in lxb_encoding_decode_shift_jis()
1197 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, ctx->codepoint); in lxb_encoding_decode_shift_jis()
1204 lxb_encoding_decode_utf_16(lxb_encoding_decode_t *ctx, bool is_be, in lxb_encoding_decode_utf_16() argument
1210 ctx->status = LXB_STATUS_OK; in lxb_encoding_decode_utf_16()
1212 if (ctx->have_error) { in lxb_encoding_decode_utf_16()
1213 ctx->have_error = false; in lxb_encoding_decode_utf_16()
1216 ctx->have_error = true; in lxb_encoding_decode_utf_16()
1221 if (ctx->u.lead != 0x00) { in lxb_encoding_decode_utf_16()
1223 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_utf_16()
1228 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_utf_16()
1230 lead = ctx->u.lead - 0x01; in lxb_encoding_decode_utf_16()
1231 ctx->u.lead = 0x00; in lxb_encoding_decode_utf_16()
1237 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_utf_16()
1244 ctx->u.lead = lead + 0x01; in lxb_encoding_decode_utf_16()
1245 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_utf_16()
1260 if (ctx->second_codepoint != 0x00) { in lxb_encoding_decode_utf_16()
1262 ctx->codepoint = 0x10000 + ((ctx->second_codepoint - 0xD800) << 10) in lxb_encoding_decode_utf_16()
1265 ctx->second_codepoint = 0x00; in lxb_encoding_decode_utf_16()
1267 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, ctx->codepoint); in lxb_encoding_decode_utf_16()
1273 ctx->second_codepoint = 0x00; in lxb_encoding_decode_utf_16()
1276 ctx->have_error = true; in lxb_encoding_decode_utf_16()
1278 ctx->u.lead = lead + 0x01; in lxb_encoding_decode_utf_16()
1289 ctx->have_error = true; in lxb_encoding_decode_utf_16()
1296 ctx->second_codepoint = unit; in lxb_encoding_decode_utf_16()
1299 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_utf_16()
1307 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, unit); in lxb_encoding_decode_utf_16()
1314 lxb_encoding_decode_utf_16be(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_utf_16be() argument
1317 return lxb_encoding_decode_utf_16(ctx, true, data, end); in lxb_encoding_decode_utf_16be()
1321 lxb_encoding_decode_utf_16le(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_utf_16le() argument
1324 return lxb_encoding_decode_utf_16(ctx, false, data, end); in lxb_encoding_decode_utf_16le()
1328 lxb_encoding_decode_utf_8(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_utf_8() argument
1335 ctx->status = LXB_STATUS_OK; in lxb_encoding_decode_utf_8()
1337 if (ctx->have_error) { in lxb_encoding_decode_utf_8()
1338 ctx->have_error = false; in lxb_encoding_decode_utf_8()
1341 ctx->have_error = true; in lxb_encoding_decode_utf_8()
1346 if (ctx->u.utf_8.need != 0) { in lxb_encoding_decode_utf_8()
1348 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_utf_8()
1353 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_utf_8()
1355 need = ctx->u.utf_8.need; in lxb_encoding_decode_utf_8()
1356 ctx->u.utf_8.need = 0; in lxb_encoding_decode_utf_8()
1358 if (ctx->u.utf_8.lower != 0x00) { in lxb_encoding_decode_utf_8()
1359 LXB_ENCODING_DECODE_UTF_8_BOUNDARY(ctx->u.utf_8.lower, in lxb_encoding_decode_utf_8()
1360 ctx->u.utf_8.upper, goto begin); in lxb_encoding_decode_utf_8()
1361 ctx->u.utf_8.lower = 0x00; in lxb_encoding_decode_utf_8()
1370 if (ctx->buffer_used >= ctx->buffer_length) { in lxb_encoding_decode_utf_8()
1379 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, ch); in lxb_encoding_decode_utf_8()
1393 ctx->codepoint = ch & 0x1F; in lxb_encoding_decode_utf_8()
1397 ctx->codepoint = ch & 0x0F; in lxb_encoding_decode_utf_8()
1404 ctx->u.utf_8.need = need; in lxb_encoding_decode_utf_8()
1405 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_utf_8()
1419 ctx->codepoint = ch & 0x07; in lxb_encoding_decode_utf_8()
1426 ctx->u.utf_8.need = need; in lxb_encoding_decode_utf_8()
1427 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_utf_8()
1454 ctx->u.utf_8.need = need; in lxb_encoding_decode_utf_8()
1455 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_utf_8()
1465 ctx->u.utf_8.need = 0; in lxb_encoding_decode_utf_8()
1469 ctx->have_error = true; in lxb_encoding_decode_utf_8()
1476 ctx->codepoint = (ctx->codepoint << 6) | (ch & 0x3F); in lxb_encoding_decode_utf_8()
1479 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, ctx->codepoint); in lxb_encoding_decode_utf_8()
1546 lxb_encoding_decode_gb18030(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_gb18030() argument
1555 ctx->status = LXB_STATUS_OK; in lxb_encoding_decode_gb18030()
1557 if (ctx->have_error) { in lxb_encoding_decode_gb18030()
1558 ctx->have_error = false; in lxb_encoding_decode_gb18030()
1561 ctx->have_error = true; in lxb_encoding_decode_gb18030()
1566 if (ctx->u.gb18030.first != 0) { in lxb_encoding_decode_gb18030()
1568 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_gb18030()
1573 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_gb18030()
1575 if (ctx->u.gb18030.third != 0x00) { in lxb_encoding_decode_gb18030()
1576 first = ctx->u.gb18030.first; in lxb_encoding_decode_gb18030()
1577 second = ctx->u.gb18030.second; in lxb_encoding_decode_gb18030()
1578 third = ctx->u.gb18030.third; in lxb_encoding_decode_gb18030()
1580 memset(&ctx->u.gb18030, 0, sizeof(lxb_encoding_ctx_gb18030_t)); in lxb_encoding_decode_gb18030()
1582 if (ctx->prepend) { in lxb_encoding_decode_gb18030()
1584 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, second); in lxb_encoding_decode_gb18030()
1586 if (ctx->buffer_used == ctx->buffer_length) { in lxb_encoding_decode_gb18030()
1587 ctx->u.gb18030.first = third; in lxb_encoding_decode_gb18030()
1593 ctx->prepend = false; in lxb_encoding_decode_gb18030()
1600 else if (ctx->u.gb18030.second != 0x00) { in lxb_encoding_decode_gb18030()
1601 first = ctx->u.gb18030.first; in lxb_encoding_decode_gb18030()
1602 second = ctx->u.gb18030.second; in lxb_encoding_decode_gb18030()
1604 memset(&ctx->u.gb18030, 0, sizeof(lxb_encoding_ctx_gb18030_t)); in lxb_encoding_decode_gb18030()
1609 first = ctx->u.gb18030.first; in lxb_encoding_decode_gb18030()
1610 ctx->u.gb18030.first = 0x00; in lxb_encoding_decode_gb18030()
1612 if (ctx->prepend) { in lxb_encoding_decode_gb18030()
1613 ctx->prepend = false; in lxb_encoding_decode_gb18030()
1621 LXB_ENCODING_DECODE_CHECK_OUT(ctx); in lxb_encoding_decode_gb18030()
1628 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, first); in lxb_encoding_decode_gb18030()
1633 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, 0x20AC); in lxb_encoding_decode_gb18030()
1648 ctx->u.gb18030.first = first; in lxb_encoding_decode_gb18030()
1649 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_gb18030()
1675 ctx->have_error = true; in lxb_encoding_decode_gb18030()
1683 ctx->codepoint = lxb_encoding_multi_index_gb18030[pointer].codepoint; in lxb_encoding_decode_gb18030()
1684 if (ctx->codepoint == LXB_ENCODING_ERROR_CODEPOINT) { in lxb_encoding_decode_gb18030()
1690 ctx->have_error = true; in lxb_encoding_decode_gb18030()
1697 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, ctx->codepoint); in lxb_encoding_decode_gb18030()
1702 ctx->u.gb18030.first = first; in lxb_encoding_decode_gb18030()
1703 ctx->u.gb18030.second = second; in lxb_encoding_decode_gb18030()
1705 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_gb18030()
1720 ctx->prepend = true; in lxb_encoding_decode_gb18030()
1721 ctx->have_error = true; in lxb_encoding_decode_gb18030()
1722 ctx->u.gb18030.first = second; in lxb_encoding_decode_gb18030()
1732 ctx->u.gb18030.first = first; in lxb_encoding_decode_gb18030()
1733 ctx->u.gb18030.second = second; in lxb_encoding_decode_gb18030()
1734 ctx->u.gb18030.third = third; in lxb_encoding_decode_gb18030()
1736 ctx->status = LXB_STATUS_CONTINUE; in lxb_encoding_decode_gb18030()
1746 ctx->prepend = true; in lxb_encoding_decode_gb18030()
1749 ctx->prepend = true; in lxb_encoding_decode_gb18030()
1750 ctx->have_error = true; in lxb_encoding_decode_gb18030()
1753 ctx->u.gb18030.first = 0x01; in lxb_encoding_decode_gb18030()
1754 ctx->u.gb18030.second = second; in lxb_encoding_decode_gb18030()
1755 ctx->u.gb18030.third = third; in lxb_encoding_decode_gb18030()
1759 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, second); in lxb_encoding_decode_gb18030()
1761 if (ctx->buffer_used == ctx->buffer_length) { in lxb_encoding_decode_gb18030()
1762 ctx->prepend = true; in lxb_encoding_decode_gb18030()
1763 ctx->have_error = true; in lxb_encoding_decode_gb18030()
1766 ctx->u.gb18030.first = 0x01; in lxb_encoding_decode_gb18030()
1767 ctx->u.gb18030.second = second; in lxb_encoding_decode_gb18030()
1768 ctx->u.gb18030.third = third; in lxb_encoding_decode_gb18030()
1782 ctx->codepoint = lxb_encoding_decode_gb18030_range(pointer); in lxb_encoding_decode_gb18030()
1784 if (ctx->codepoint == LXB_ENCODING_ERROR_CODEPOINT) { in lxb_encoding_decode_gb18030()
1791 LXB_ENCODING_DECODE_APPEND_WO_CHECK(ctx, ctx->codepoint); in lxb_encoding_decode_gb18030()
1798 lxb_encoding_decode_macintosh(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_macintosh() argument
1807 lxb_encoding_decode_replacement(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_replacement() argument
1815 lxb_encoding_decode_windows_1250(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1250() argument
1824 lxb_encoding_decode_windows_1251(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1251() argument
1833 lxb_encoding_decode_windows_1252(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1252() argument
1842 lxb_encoding_decode_windows_1253(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1253() argument
1851 lxb_encoding_decode_windows_1254(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1254() argument
1860 lxb_encoding_decode_windows_1255(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1255() argument
1869 lxb_encoding_decode_windows_1256(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1256() argument
1878 lxb_encoding_decode_windows_1257(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1257() argument
1887 lxb_encoding_decode_windows_1258(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1258() argument
1896 lxb_encoding_decode_windows_874(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_874() argument
1905 lxb_encoding_decode_x_mac_cyrillic(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_x_mac_cyrillic() argument
1914 lxb_encoding_decode_x_user_defined(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_x_user_defined() argument
1919 LXB_ENCODING_DECODE_APPEND(ctx, *(*data)++); in lxb_encoding_decode_x_user_defined()
1922 LXB_ENCODING_DECODE_APPEND(ctx, 0xF780 + (*(*data)++) - 0x80); in lxb_encoding_decode_x_user_defined()
1933 lxb_encoding_decode_default_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_default_single() argument
1936 return lxb_encoding_decode_utf_8_single(ctx, data, end); in lxb_encoding_decode_default_single()
1940 lxb_encoding_decode_auto_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_auto_single() argument
1947 lxb_encoding_decode_undefined_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_undefined_single() argument
1954 lxb_encoding_decode_big5_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_big5_single() argument
1960 if (ctx->u.lead != 0x00) { in lxb_encoding_decode_big5_single()
1961 if (ctx->second_codepoint != 0x00) { in lxb_encoding_decode_big5_single()
1964 ctx->u.lead = 0x00; in lxb_encoding_decode_big5_single()
1966 ctx->codepoint = ctx->second_codepoint; in lxb_encoding_decode_big5_single()
1967 ctx->second_codepoint = 0x00; in lxb_encoding_decode_big5_single()
1969 return ctx->codepoint; in lxb_encoding_decode_big5_single()
1972 lead = (lxb_char_t) ctx->u.lead; in lxb_encoding_decode_big5_single()
1973 ctx->u.lead = 0x00; in lxb_encoding_decode_big5_single()
1989 ctx->u.lead = lead; in lxb_encoding_decode_big5_single()
2020 ctx->u.lead = lead; in lxb_encoding_decode_big5_single()
2021 ctx->second_codepoint = 0x0304; in lxb_encoding_decode_big5_single()
2025 ctx->u.lead = lead; in lxb_encoding_decode_big5_single()
2026 ctx->second_codepoint = 0x030C; in lxb_encoding_decode_big5_single()
2030 ctx->u.lead = lead; in lxb_encoding_decode_big5_single()
2031 ctx->second_codepoint = 0x0304; in lxb_encoding_decode_big5_single()
2035 ctx->u.lead = lead; in lxb_encoding_decode_big5_single()
2036 ctx->second_codepoint = 0x030C; in lxb_encoding_decode_big5_single()
2043 ctx->codepoint = lxb_encoding_multi_index_big5[index].codepoint; in lxb_encoding_decode_big5_single()
2044 if (ctx->codepoint == LXB_ENCODING_ERROR_CODEPOINT) { in lxb_encoding_decode_big5_single()
2050 return ctx->codepoint; in lxb_encoding_decode_big5_single()
2062 lxb_encoding_decode_euc_jp_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_euc_jp_single() argument
2068 if (ctx->u.euc_jp.lead != 0x00) { in lxb_encoding_decode_euc_jp_single()
2069 lead = ctx->u.euc_jp.lead; in lxb_encoding_decode_euc_jp_single()
2072 ctx->u.euc_jp.lead = 0x00; in lxb_encoding_decode_euc_jp_single()
2074 if (ctx->u.euc_jp.is_jis0212) { in lxb_encoding_decode_euc_jp_single()
2076 ctx->u.euc_jp.is_jis0212 = false; in lxb_encoding_decode_euc_jp_single()
2097 ctx->u.euc_jp.lead = lead; in lxb_encoding_decode_euc_jp_single()
2113 ctx->u.euc_jp.lead = byte; in lxb_encoding_decode_euc_jp_single()
2114 ctx->u.euc_jp.is_jis0212 = true; in lxb_encoding_decode_euc_jp_single()
2133 ctx->codepoint = (lead - 0xA1) * 94 + byte - 0xA1; in lxb_encoding_decode_euc_jp_single()
2137 / sizeof(lxb_encoding_multi_index_t)) <= ctx->codepoint) in lxb_encoding_decode_euc_jp_single()
2142 ctx->codepoint = lxb_encoding_multi_index_jis0212[ctx->codepoint].codepoint; in lxb_encoding_decode_euc_jp_single()
2146 / sizeof(lxb_encoding_multi_index_t)) <= ctx->codepoint) in lxb_encoding_decode_euc_jp_single()
2151 ctx->codepoint = lxb_encoding_multi_index_jis0208[ctx->codepoint].codepoint; in lxb_encoding_decode_euc_jp_single()
2154 if (ctx->codepoint == LXB_ENCODING_ERROR_CODEPOINT) { in lxb_encoding_decode_euc_jp_single()
2158 return ctx->codepoint; in lxb_encoding_decode_euc_jp_single()
2170 lxb_encoding_decode_euc_kr_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_euc_kr_single() argument
2175 if (ctx->u.lead != 0x00) { in lxb_encoding_decode_euc_kr_single()
2176 lead = (lxb_char_t) ctx->u.lead; in lxb_encoding_decode_euc_kr_single()
2177 ctx->u.lead = 0x00; in lxb_encoding_decode_euc_kr_single()
2193 ctx->u.lead = lead; in lxb_encoding_decode_euc_kr_single()
2206 ctx->codepoint = (lead - 0x81) * 190 + (byte - 0x41); in lxb_encoding_decode_euc_kr_single()
2208 if (ctx->codepoint >= sizeof(lxb_encoding_multi_index_euc_kr) in lxb_encoding_decode_euc_kr_single()
2214 ctx->codepoint = lxb_encoding_multi_index_euc_kr[ctx->codepoint].codepoint; in lxb_encoding_decode_euc_kr_single()
2215 if (ctx->codepoint == LXB_ENCODING_ERROR_CODEPOINT) { in lxb_encoding_decode_euc_kr_single()
2219 return ctx->codepoint; in lxb_encoding_decode_euc_kr_single()
2231 lxb_encoding_decode_gbk_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_gbk_single() argument
2234 return lxb_encoding_decode_gb18030_single(ctx, data, end); in lxb_encoding_decode_gbk_single()
2238 lxb_encoding_decode_ibm866_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_ibm866_single() argument
2249 lxb_encoding_decode_iso_2022_jp_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_2022_jp_single() argument
2253 lxb_encoding_ctx_2022_jp_t *iso = &ctx->u.iso_2022_jp; in lxb_encoding_decode_iso_2022_jp_single()
2374 ctx->codepoint = (iso->lead - 0x21) * 94 + byte - 0x21; in lxb_encoding_decode_iso_2022_jp_single()
2376 return lxb_encoding_multi_index_jis0208[ctx->codepoint].codepoint; in lxb_encoding_decode_iso_2022_jp_single()
2392 iso->state = ctx->u.iso_2022_jp.out_state; in lxb_encoding_decode_iso_2022_jp_single()
2446 lxb_encoding_decode_iso_8859_10_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_10_single() argument
2457 lxb_encoding_decode_iso_8859_13_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_13_single() argument
2468 lxb_encoding_decode_iso_8859_14_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_14_single() argument
2479 lxb_encoding_decode_iso_8859_15_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_15_single() argument
2490 lxb_encoding_decode_iso_8859_16_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_16_single() argument
2501 lxb_encoding_decode_iso_8859_2_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_2_single() argument
2512 lxb_encoding_decode_iso_8859_3_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_3_single() argument
2523 lxb_encoding_decode_iso_8859_4_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_4_single() argument
2534 lxb_encoding_decode_iso_8859_5_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_5_single() argument
2545 lxb_encoding_decode_iso_8859_6_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_6_single() argument
2556 lxb_encoding_decode_iso_8859_7_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_7_single() argument
2567 lxb_encoding_decode_iso_8859_8_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_8_single() argument
2578 lxb_encoding_decode_iso_8859_8_i_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_iso_8859_8_i_single() argument
2589 lxb_encoding_decode_koi8_r_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_koi8_r_single() argument
2600 lxb_encoding_decode_koi8_u_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_koi8_u_single() argument
2611 lxb_encoding_decode_shift_jis_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_shift_jis_single() argument
2616 if (ctx->u.lead != 0x00) { in lxb_encoding_decode_shift_jis_single()
2617 lead = (lxb_char_t) ctx->u.lead; in lxb_encoding_decode_shift_jis_single()
2618 ctx->u.lead = 0x00; in lxb_encoding_decode_shift_jis_single()
2640 ctx->u.lead = lead; in lxb_encoding_decode_shift_jis_single()
2650 ctx->codepoint = 0x40; in lxb_encoding_decode_shift_jis_single()
2653 ctx->codepoint = 0x41; in lxb_encoding_decode_shift_jis_single()
2657 ctx->second_codepoint = 0x81; in lxb_encoding_decode_shift_jis_single()
2660 ctx->second_codepoint = 0xC1; in lxb_encoding_decode_shift_jis_single()
2667 ctx->codepoint = (lead - ctx->second_codepoint) * 188 in lxb_encoding_decode_shift_jis_single()
2668 + byte - ctx->codepoint; in lxb_encoding_decode_shift_jis_single()
2670 if (ctx->codepoint >= (sizeof(lxb_encoding_multi_index_jis0208) in lxb_encoding_decode_shift_jis_single()
2676 if ((unsigned) (ctx->codepoint - 8836) <= (10715 - 8836)) { in lxb_encoding_decode_shift_jis_single()
2677 return 0xE000 - 8836 + ctx->codepoint; in lxb_encoding_decode_shift_jis_single()
2680 ctx->codepoint = lxb_encoding_multi_index_jis0208[ctx->codepoint].codepoint; in lxb_encoding_decode_shift_jis_single()
2681 if (ctx->codepoint == LXB_ENCODING_ERROR_CODEPOINT) { in lxb_encoding_decode_shift_jis_single()
2685 return ctx->codepoint; in lxb_encoding_decode_shift_jis_single()
2698 lxb_encoding_decode_utf_16_single(lxb_encoding_decode_t *ctx, bool is_be, in lxb_encoding_decode_utf_16_single() argument
2704 if (ctx->u.lead != 0x00) { in lxb_encoding_decode_utf_16_single()
2705 lead = ctx->u.lead - 0x01; in lxb_encoding_decode_utf_16_single()
2706 ctx->u.lead = 0x00; in lxb_encoding_decode_utf_16_single()
2716 ctx->u.lead = lead + 0x01; in lxb_encoding_decode_utf_16_single()
2730 if (ctx->second_codepoint != 0x00) { in lxb_encoding_decode_utf_16_single()
2732 ctx->codepoint = 0x10000 + ((ctx->second_codepoint - 0xD800) << 10) in lxb_encoding_decode_utf_16_single()
2735 ctx->second_codepoint = 0x00; in lxb_encoding_decode_utf_16_single()
2736 return ctx->codepoint; in lxb_encoding_decode_utf_16_single()
2741 ctx->u.lead = lead + 0x01; in lxb_encoding_decode_utf_16_single()
2742 ctx->second_codepoint = 0x00; in lxb_encoding_decode_utf_16_single()
2753 ctx->second_codepoint = unit; in lxb_encoding_decode_utf_16_single()
2766 lxb_encoding_decode_utf_16be_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_utf_16be_single() argument
2769 return lxb_encoding_decode_utf_16_single(ctx, true, data, end); in lxb_encoding_decode_utf_16be_single()
2773 lxb_encoding_decode_utf_16le_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_utf_16le_single() argument
2776 return lxb_encoding_decode_utf_16_single(ctx, false, data, end); in lxb_encoding_decode_utf_16le_single()
2780 lxb_encoding_decode_utf_8_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_utf_8_single() argument
2787 if (ctx->u.utf_8.need != 0) { in lxb_encoding_decode_utf_8_single()
2788 needed = ctx->u.utf_8.need; in lxb_encoding_decode_utf_8_single()
2789 ctx->u.utf_8.need = 0; in lxb_encoding_decode_utf_8_single()
2791 if (ctx->u.utf_8.lower != 0x00) { in lxb_encoding_decode_utf_8_single()
2792 LXB_ENCODING_DECODE_UTF_8_BOUNDARY_SINGLE(ctx->u.utf_8.lower, in lxb_encoding_decode_utf_8_single()
2793 ctx->u.utf_8.upper); in lxb_encoding_decode_utf_8_single()
2794 ctx->u.utf_8.lower = 0x00; in lxb_encoding_decode_utf_8_single()
2811 ctx->codepoint = ch & 0x1F; in lxb_encoding_decode_utf_8_single()
2815 ctx->codepoint = ch & 0x0F; in lxb_encoding_decode_utf_8_single()
2832 ctx->codepoint = ch & 0x07; in lxb_encoding_decode_utf_8_single()
2863 ctx->codepoint = (ctx->codepoint << 6) | (ch & 0x3F); in lxb_encoding_decode_utf_8_single()
2868 return ctx->codepoint; in lxb_encoding_decode_utf_8_single()
2876 ctx->u.utf_8.need = needed; in lxb_encoding_decode_utf_8_single()
2882 ctx->u.utf_8.lower = 0x00; in lxb_encoding_decode_utf_8_single()
2883 ctx->u.utf_8.need = 0; in lxb_encoding_decode_utf_8_single()
2979 lxb_encoding_decode_gb18030_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_gb18030_single() argument
2988 if (ctx->u.gb18030.first != 0) { in lxb_encoding_decode_gb18030_single()
2989 if (ctx->u.gb18030.third != 0x00) { in lxb_encoding_decode_gb18030_single()
2990 first = ctx->u.gb18030.first; in lxb_encoding_decode_gb18030_single()
2991 second = ctx->u.gb18030.second; in lxb_encoding_decode_gb18030_single()
2992 third = ctx->u.gb18030.third; in lxb_encoding_decode_gb18030_single()
2994 memset(&ctx->u.gb18030, 0, sizeof(lxb_encoding_ctx_gb18030_t)); in lxb_encoding_decode_gb18030_single()
2996 if (ctx->prepend) { in lxb_encoding_decode_gb18030_single()
2998 ctx->u.gb18030.first = third; in lxb_encoding_decode_gb18030_single()
3005 else if (ctx->u.gb18030.second != 0x00) { in lxb_encoding_decode_gb18030_single()
3006 first = ctx->u.gb18030.first; in lxb_encoding_decode_gb18030_single()
3007 second = ctx->u.gb18030.second; in lxb_encoding_decode_gb18030_single()
3009 memset(&ctx->u.gb18030, 0, sizeof(lxb_encoding_ctx_gb18030_t)); in lxb_encoding_decode_gb18030_single()
3014 first = ctx->u.gb18030.first; in lxb_encoding_decode_gb18030_single()
3015 ctx->u.gb18030.first = 0x00; in lxb_encoding_decode_gb18030_single()
3017 if (ctx->prepend) { in lxb_encoding_decode_gb18030_single()
3018 ctx->prepend = false; in lxb_encoding_decode_gb18030_single()
3043 ctx->u.gb18030.first = first; in lxb_encoding_decode_gb18030_single()
3067 ctx->codepoint = lxb_encoding_multi_index_gb18030[pointer].codepoint; in lxb_encoding_decode_gb18030_single()
3068 if (ctx->codepoint == LXB_ENCODING_ERROR_CODEPOINT) { in lxb_encoding_decode_gb18030_single()
3072 return ctx->codepoint; in lxb_encoding_decode_gb18030_single()
3076 ctx->u.gb18030.first = first; in lxb_encoding_decode_gb18030_single()
3077 ctx->u.gb18030.second = second; in lxb_encoding_decode_gb18030_single()
3091 ctx->prepend = true; in lxb_encoding_decode_gb18030_single()
3092 ctx->u.gb18030.first = second; in lxb_encoding_decode_gb18030_single()
3098 ctx->u.gb18030.first = first; in lxb_encoding_decode_gb18030_single()
3099 ctx->u.gb18030.second = second; in lxb_encoding_decode_gb18030_single()
3100 ctx->u.gb18030.third = third; in lxb_encoding_decode_gb18030_single()
3110 ctx->prepend = true; in lxb_encoding_decode_gb18030_single()
3113 ctx->u.gb18030.first = 0x01; in lxb_encoding_decode_gb18030_single()
3114 ctx->u.gb18030.second = second; in lxb_encoding_decode_gb18030_single()
3115 ctx->u.gb18030.third = third; in lxb_encoding_decode_gb18030_single()
3136 lxb_encoding_decode_macintosh_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_macintosh_single() argument
3147 lxb_encoding_decode_replacement_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_replacement_single() argument
3154 lxb_encoding_decode_windows_1250_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1250_single() argument
3165 lxb_encoding_decode_windows_1251_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1251_single() argument
3176 lxb_encoding_decode_windows_1252_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1252_single() argument
3187 lxb_encoding_decode_windows_1253_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1253_single() argument
3198 lxb_encoding_decode_windows_1254_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1254_single() argument
3209 lxb_encoding_decode_windows_1255_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1255_single() argument
3220 lxb_encoding_decode_windows_1256_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1256_single() argument
3231 lxb_encoding_decode_windows_1257_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1257_single() argument
3242 lxb_encoding_decode_windows_1258_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_1258_single() argument
3253 lxb_encoding_decode_windows_874_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_windows_874_single() argument
3264 lxb_encoding_decode_x_mac_cyrillic_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_x_mac_cyrillic_single() argument
3275 lxb_encoding_decode_x_user_defined_single(lxb_encoding_decode_t *ctx, in lxb_encoding_decode_x_user_defined_single() argument