Lines Matching refs:pos
60 #define MB_FAILURE(pos, advance) do { \ argument
61 *cursor = pos + (advance); \
66 #define CHECK_LEN(pos, chars_need) ((str_len - (pos)) >= (chars_need)) argument
100 size_t pos = *cursor; in get_next_char() local
104 assert(pos <= str_len); in get_next_char()
106 if (!CHECK_LEN(pos, 1)) in get_next_char()
107 MB_FAILURE(pos, 1); in get_next_char()
117 c = str[pos]; in get_next_char()
120 pos++; in get_next_char()
122 MB_FAILURE(pos, 1); in get_next_char()
124 if (!CHECK_LEN(pos, 2)) in get_next_char()
125 MB_FAILURE(pos, 1); in get_next_char()
127 if (!utf8_trail(str[pos + 1])) { in get_next_char()
128 MB_FAILURE(pos, utf8_lead(str[pos + 1]) ? 1 : 2); in get_next_char()
130 this_char = ((c & 0x1f) << 6) | (str[pos + 1] & 0x3f); in get_next_char()
132 MB_FAILURE(pos, 2); in get_next_char()
134 pos += 2; in get_next_char()
136 size_t avail = str_len - pos; in get_next_char()
139 !utf8_trail(str[pos + 1]) || !utf8_trail(str[pos + 2])) { in get_next_char()
140 if (avail < 2 || utf8_lead(str[pos + 1])) in get_next_char()
141 MB_FAILURE(pos, 1); in get_next_char()
142 else if (avail < 3 || utf8_lead(str[pos + 2])) in get_next_char()
143 MB_FAILURE(pos, 2); in get_next_char()
145 MB_FAILURE(pos, 3); in get_next_char()
148 this_char = ((c & 0x0f) << 12) | ((str[pos + 1] & 0x3f) << 6) | (str[pos + 2] & 0x3f); in get_next_char()
150 MB_FAILURE(pos, 3); in get_next_char()
152 MB_FAILURE(pos, 3); in get_next_char()
154 pos += 3; in get_next_char()
156 size_t avail = str_len - pos; in get_next_char()
159 !utf8_trail(str[pos + 1]) || !utf8_trail(str[pos + 2]) || in get_next_char()
160 !utf8_trail(str[pos + 3])) { in get_next_char()
161 if (avail < 2 || utf8_lead(str[pos + 1])) in get_next_char()
162 MB_FAILURE(pos, 1); in get_next_char()
163 else if (avail < 3 || utf8_lead(str[pos + 2])) in get_next_char()
164 MB_FAILURE(pos, 2); in get_next_char()
165 else if (avail < 4 || utf8_lead(str[pos + 3])) in get_next_char()
166 MB_FAILURE(pos, 3); in get_next_char()
168 MB_FAILURE(pos, 4); in get_next_char()
171 …this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (s… in get_next_char()
173 MB_FAILURE(pos, 4); in get_next_char()
175 pos += 4; in get_next_char()
177 MB_FAILURE(pos, 1); in get_next_char()
185 unsigned char c = str[pos]; in get_next_char()
188 if (!CHECK_LEN(pos, 2)) in get_next_char()
189 MB_FAILURE(pos, 1); in get_next_char()
191 next = str[pos + 1]; in get_next_char()
197 MB_FAILURE(pos, 1); in get_next_char()
199 pos += 2; in get_next_char()
202 pos += 1; in get_next_char()
209 unsigned char c = str[pos]; in get_next_char()
212 if (!CHECK_LEN(pos, 2)) in get_next_char()
213 MB_FAILURE(pos, 1); in get_next_char()
215 next = str[pos + 1]; in get_next_char()
221 MB_FAILURE(pos, 1); in get_next_char()
223 MB_FAILURE(pos, 2); in get_next_char()
225 pos += 2; in get_next_char()
228 pos += 1; in get_next_char()
235 unsigned char c = str[pos]; in get_next_char()
238 if (!CHECK_LEN(pos, 2)) in get_next_char()
239 MB_FAILURE(pos, 1); in get_next_char()
241 next = str[pos + 1]; in get_next_char()
246 MB_FAILURE(pos, 1); in get_next_char()
248 MB_FAILURE(pos, 2); in get_next_char()
250 pos += 2; in get_next_char()
253 pos += 1; in get_next_char()
255 MB_FAILURE(pos, 1); in get_next_char()
262 unsigned char c = str[pos]; in get_next_char()
265 if (!CHECK_LEN(pos, 2)) in get_next_char()
266 MB_FAILURE(pos, 1); in get_next_char()
268 next = str[pos + 1]; in get_next_char()
273 MB_FAILURE(pos, 1); in get_next_char()
275 MB_FAILURE(pos, 2); in get_next_char()
277 pos += 2; in get_next_char()
280 pos += 1; in get_next_char()
282 MB_FAILURE(pos, 1); in get_next_char()
289 unsigned char c = str[pos]; in get_next_char()
293 if (!CHECK_LEN(pos, 2)) in get_next_char()
294 MB_FAILURE(pos, 1); in get_next_char()
295 next = str[pos + 1]; in get_next_char()
301 MB_FAILURE(pos, (next != 0xA0 && next != 0xFF) ? 1 : 2); in get_next_char()
303 pos += 2; in get_next_char()
306 if (!CHECK_LEN(pos, 2)) in get_next_char()
307 MB_FAILURE(pos, 1); in get_next_char()
309 next = str[pos + 1]; in get_next_char()
314 MB_FAILURE(pos, (next != 0xA0 && next != 0xFF) ? 1 : 2); in get_next_char()
316 pos += 2; in get_next_char()
318 size_t avail = str_len - pos; in get_next_char()
320 if (avail < 3 || !(str[pos + 1] >= 0xA1 && str[pos + 1] <= 0xFE) || in get_next_char()
321 !(str[pos + 2] >= 0xA1 && str[pos + 2] <= 0xFE)) { in get_next_char()
322 if (avail < 2 || (str[pos + 1] != 0xA0 && str[pos + 1] != 0xFF)) in get_next_char()
323 MB_FAILURE(pos, 1); in get_next_char()
324 else if (avail < 3 || (str[pos + 2] != 0xA0 && str[pos + 2] != 0xFF)) in get_next_char()
325 MB_FAILURE(pos, 2); in get_next_char()
327 MB_FAILURE(pos, 3); in get_next_char()
330 this_char = (c << 16) | (str[pos + 1] << 8) | str[pos + 2]; in get_next_char()
332 pos += 3; in get_next_char()
336 pos += 1; in get_next_char()
338 MB_FAILURE(pos, 1); in get_next_char()
344 this_char = str[pos++]; in get_next_char()
348 *cursor = pos; in get_next_char()
1266 char *pos = (char*)&old[cursor+1]; in php_escape_html_entities_ex() local
1267 valid = process_numeric_entity((const char **)&pos, &code_point); in php_escape_html_entities_ex()
1274 ent_len = pos - (char*)&old[cursor]; in php_escape_html_entities_ex()