Lines Matching refs:pos
66 #define MB_FAILURE(pos, advance) do { \ argument
67 *cursor = pos + (advance); \
72 #define CHECK_LEN(pos, chars_need) ((str_len - (pos)) >= (chars_need)) argument
108 size_t pos = *cursor; in get_next_char() local
112 assert(pos <= str_len); in get_next_char()
114 if (!CHECK_LEN(pos, 1)) in get_next_char()
115 MB_FAILURE(pos, 1); in get_next_char()
125 c = str[pos]; in get_next_char()
128 pos++; in get_next_char()
130 MB_FAILURE(pos, 1); in get_next_char()
132 if (!CHECK_LEN(pos, 2)) in get_next_char()
133 MB_FAILURE(pos, 1); in get_next_char()
135 if (!utf8_trail(str[pos + 1])) { in get_next_char()
136 MB_FAILURE(pos, utf8_lead(str[pos + 1]) ? 1 : 2); in get_next_char()
138 this_char = ((c & 0x1f) << 6) | (str[pos + 1] & 0x3f); in get_next_char()
140 MB_FAILURE(pos, 2); in get_next_char()
142 pos += 2; in get_next_char()
144 size_t avail = str_len - pos; in get_next_char()
147 !utf8_trail(str[pos + 1]) || !utf8_trail(str[pos + 2])) { in get_next_char()
148 if (avail < 2 || utf8_lead(str[pos + 1])) in get_next_char()
149 MB_FAILURE(pos, 1); in get_next_char()
150 else if (avail < 3 || utf8_lead(str[pos + 2])) in get_next_char()
151 MB_FAILURE(pos, 2); in get_next_char()
153 MB_FAILURE(pos, 3); in get_next_char()
156 this_char = ((c & 0x0f) << 12) | ((str[pos + 1] & 0x3f) << 6) | (str[pos + 2] & 0x3f); in get_next_char()
158 MB_FAILURE(pos, 3); in get_next_char()
160 MB_FAILURE(pos, 3); in get_next_char()
162 pos += 3; in get_next_char()
164 size_t avail = str_len - pos; in get_next_char()
167 !utf8_trail(str[pos + 1]) || !utf8_trail(str[pos + 2]) || in get_next_char()
168 !utf8_trail(str[pos + 3])) { in get_next_char()
169 if (avail < 2 || utf8_lead(str[pos + 1])) in get_next_char()
170 MB_FAILURE(pos, 1); in get_next_char()
171 else if (avail < 3 || utf8_lead(str[pos + 2])) in get_next_char()
172 MB_FAILURE(pos, 2); in get_next_char()
173 else if (avail < 4 || utf8_lead(str[pos + 3])) in get_next_char()
174 MB_FAILURE(pos, 3); in get_next_char()
176 MB_FAILURE(pos, 4); in get_next_char()
179 …this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (s… in get_next_char()
181 MB_FAILURE(pos, 4); in get_next_char()
183 pos += 4; in get_next_char()
185 MB_FAILURE(pos, 1); in get_next_char()
193 unsigned char c = str[pos]; in get_next_char()
196 if (!CHECK_LEN(pos, 2)) in get_next_char()
197 MB_FAILURE(pos, 1); in get_next_char()
199 next = str[pos + 1]; in get_next_char()
205 MB_FAILURE(pos, 1); in get_next_char()
207 pos += 2; in get_next_char()
210 pos += 1; in get_next_char()
217 unsigned char c = str[pos]; in get_next_char()
220 if (!CHECK_LEN(pos, 2)) in get_next_char()
221 MB_FAILURE(pos, 1); in get_next_char()
223 next = str[pos + 1]; in get_next_char()
229 MB_FAILURE(pos, 1); in get_next_char()
231 MB_FAILURE(pos, 2); in get_next_char()
233 pos += 2; in get_next_char()
236 pos += 1; in get_next_char()
243 unsigned char c = str[pos]; in get_next_char()
246 if (!CHECK_LEN(pos, 2)) in get_next_char()
247 MB_FAILURE(pos, 1); in get_next_char()
249 next = str[pos + 1]; in get_next_char()
254 MB_FAILURE(pos, 1); in get_next_char()
256 MB_FAILURE(pos, 2); in get_next_char()
258 pos += 2; in get_next_char()
261 pos += 1; in get_next_char()
263 MB_FAILURE(pos, 1); in get_next_char()
270 unsigned char c = str[pos]; in get_next_char()
273 if (!CHECK_LEN(pos, 2)) in get_next_char()
274 MB_FAILURE(pos, 1); in get_next_char()
276 next = str[pos + 1]; in get_next_char()
281 MB_FAILURE(pos, 1); in get_next_char()
283 MB_FAILURE(pos, 2); in get_next_char()
285 pos += 2; in get_next_char()
288 pos += 1; in get_next_char()
290 MB_FAILURE(pos, 1); in get_next_char()
297 unsigned char c = str[pos]; in get_next_char()
301 if (!CHECK_LEN(pos, 2)) in get_next_char()
302 MB_FAILURE(pos, 1); in get_next_char()
303 next = str[pos + 1]; in get_next_char()
309 MB_FAILURE(pos, (next != 0xA0 && next != 0xFF) ? 1 : 2); in get_next_char()
311 pos += 2; in get_next_char()
314 if (!CHECK_LEN(pos, 2)) in get_next_char()
315 MB_FAILURE(pos, 1); in get_next_char()
317 next = str[pos + 1]; in get_next_char()
322 MB_FAILURE(pos, (next != 0xA0 && next != 0xFF) ? 1 : 2); in get_next_char()
324 pos += 2; in get_next_char()
326 size_t avail = str_len - pos; in get_next_char()
328 if (avail < 3 || !(str[pos + 1] >= 0xA1 && str[pos + 1] <= 0xFE) || in get_next_char()
329 !(str[pos + 2] >= 0xA1 && str[pos + 2] <= 0xFE)) { in get_next_char()
330 if (avail < 2 || (str[pos + 1] != 0xA0 && str[pos + 1] != 0xFF)) in get_next_char()
331 MB_FAILURE(pos, 1); in get_next_char()
332 else if (avail < 3 || (str[pos + 2] != 0xA0 && str[pos + 2] != 0xFF)) in get_next_char()
333 MB_FAILURE(pos, 2); in get_next_char()
335 MB_FAILURE(pos, 3); in get_next_char()
338 this_char = (c << 16) | (str[pos + 1] << 8) | str[pos + 2]; in get_next_char()
340 pos += 3; in get_next_char()
344 pos += 1; in get_next_char()
346 MB_FAILURE(pos, 1); in get_next_char()
352 this_char = str[pos++]; in get_next_char()
356 *cursor = pos; in get_next_char()
1389 char *pos = (char*)&old[cursor+1]; in php_escape_html_entities_ex() local
1390 valid = process_numeric_entity((const char **)&pos, &code_point); in php_escape_html_entities_ex()
1397 ent_len = pos - (char*)&old[cursor]; in php_escape_html_entities_ex()