Lines Matching refs:pos

62 #define MB_FAILURE(pos, advance) do { \  argument
63 *cursor = pos + (advance); \
68 #define CHECK_LEN(pos, chars_need) ((str_len - (pos)) >= (chars_need)) argument
104 size_t pos = *cursor; in get_next_char() local
108 assert(pos <= str_len); in get_next_char()
110 if (!CHECK_LEN(pos, 1)) in get_next_char()
111 MB_FAILURE(pos, 1); in get_next_char()
121 c = str[pos]; in get_next_char()
124 pos++; in get_next_char()
126 MB_FAILURE(pos, 1); in get_next_char()
128 if (!CHECK_LEN(pos, 2)) in get_next_char()
129 MB_FAILURE(pos, 1); in get_next_char()
131 if (!utf8_trail(str[pos + 1])) { in get_next_char()
132 MB_FAILURE(pos, utf8_lead(str[pos + 1]) ? 1 : 2); in get_next_char()
134 this_char = ((c & 0x1f) << 6) | (str[pos + 1] & 0x3f); in get_next_char()
136 MB_FAILURE(pos, 2); in get_next_char()
138 pos += 2; in get_next_char()
140 size_t avail = str_len - pos; in get_next_char()
143 !utf8_trail(str[pos + 1]) || !utf8_trail(str[pos + 2])) { in get_next_char()
144 if (avail < 2 || utf8_lead(str[pos + 1])) in get_next_char()
145 MB_FAILURE(pos, 1); in get_next_char()
146 else if (avail < 3 || utf8_lead(str[pos + 2])) in get_next_char()
147 MB_FAILURE(pos, 2); in get_next_char()
149 MB_FAILURE(pos, 3); in get_next_char()
152 this_char = ((c & 0x0f) << 12) | ((str[pos + 1] & 0x3f) << 6) | (str[pos + 2] & 0x3f); in get_next_char()
154 MB_FAILURE(pos, 3); in get_next_char()
156 MB_FAILURE(pos, 3); in get_next_char()
158 pos += 3; in get_next_char()
160 size_t avail = str_len - pos; in get_next_char()
163 !utf8_trail(str[pos + 1]) || !utf8_trail(str[pos + 2]) || in get_next_char()
164 !utf8_trail(str[pos + 3])) { in get_next_char()
165 if (avail < 2 || utf8_lead(str[pos + 1])) in get_next_char()
166 MB_FAILURE(pos, 1); in get_next_char()
167 else if (avail < 3 || utf8_lead(str[pos + 2])) in get_next_char()
168 MB_FAILURE(pos, 2); in get_next_char()
169 else if (avail < 4 || utf8_lead(str[pos + 3])) in get_next_char()
170 MB_FAILURE(pos, 3); in get_next_char()
172 MB_FAILURE(pos, 4); in get_next_char()
175 …this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (s… in get_next_char()
177 MB_FAILURE(pos, 4); in get_next_char()
179 pos += 4; in get_next_char()
181 MB_FAILURE(pos, 1); in get_next_char()
189 unsigned char c = str[pos]; in get_next_char()
192 if (!CHECK_LEN(pos, 2)) in get_next_char()
193 MB_FAILURE(pos, 1); in get_next_char()
195 next = str[pos + 1]; in get_next_char()
201 MB_FAILURE(pos, 1); in get_next_char()
203 pos += 2; in get_next_char()
206 pos += 1; in get_next_char()
213 unsigned char c = str[pos]; in get_next_char()
216 if (!CHECK_LEN(pos, 2)) in get_next_char()
217 MB_FAILURE(pos, 1); in get_next_char()
219 next = str[pos + 1]; in get_next_char()
225 MB_FAILURE(pos, 1); in get_next_char()
227 MB_FAILURE(pos, 2); in get_next_char()
229 pos += 2; in get_next_char()
232 pos += 1; in get_next_char()
239 unsigned char c = str[pos]; in get_next_char()
242 if (!CHECK_LEN(pos, 2)) in get_next_char()
243 MB_FAILURE(pos, 1); in get_next_char()
245 next = str[pos + 1]; in get_next_char()
250 MB_FAILURE(pos, 1); in get_next_char()
252 MB_FAILURE(pos, 2); in get_next_char()
254 pos += 2; in get_next_char()
257 pos += 1; in get_next_char()
259 MB_FAILURE(pos, 1); in get_next_char()
266 unsigned char c = str[pos]; in get_next_char()
269 if (!CHECK_LEN(pos, 2)) in get_next_char()
270 MB_FAILURE(pos, 1); in get_next_char()
272 next = str[pos + 1]; in get_next_char()
277 MB_FAILURE(pos, 1); in get_next_char()
279 MB_FAILURE(pos, 2); in get_next_char()
281 pos += 2; in get_next_char()
284 pos += 1; in get_next_char()
286 MB_FAILURE(pos, 1); in get_next_char()
293 unsigned char c = str[pos]; in get_next_char()
297 if (!CHECK_LEN(pos, 2)) in get_next_char()
298 MB_FAILURE(pos, 1); in get_next_char()
299 next = str[pos + 1]; in get_next_char()
305 MB_FAILURE(pos, (next != 0xA0 && next != 0xFF) ? 1 : 2); in get_next_char()
307 pos += 2; in get_next_char()
310 if (!CHECK_LEN(pos, 2)) in get_next_char()
311 MB_FAILURE(pos, 1); in get_next_char()
313 next = str[pos + 1]; in get_next_char()
318 MB_FAILURE(pos, (next != 0xA0 && next != 0xFF) ? 1 : 2); in get_next_char()
320 pos += 2; in get_next_char()
322 size_t avail = str_len - pos; in get_next_char()
324 if (avail < 3 || !(str[pos + 1] >= 0xA1 && str[pos + 1] <= 0xFE) || in get_next_char()
325 !(str[pos + 2] >= 0xA1 && str[pos + 2] <= 0xFE)) { in get_next_char()
326 if (avail < 2 || (str[pos + 1] != 0xA0 && str[pos + 1] != 0xFF)) in get_next_char()
327 MB_FAILURE(pos, 1); in get_next_char()
328 else if (avail < 3 || (str[pos + 2] != 0xA0 && str[pos + 2] != 0xFF)) in get_next_char()
329 MB_FAILURE(pos, 2); in get_next_char()
331 MB_FAILURE(pos, 3); in get_next_char()
334 this_char = (c << 16) | (str[pos + 1] << 8) | str[pos + 2]; in get_next_char()
336 pos += 3; in get_next_char()
340 pos += 1; in get_next_char()
342 MB_FAILURE(pos, 1); in get_next_char()
348 this_char = str[pos++]; in get_next_char()
352 *cursor = pos; in get_next_char()
1338 char *pos = (char*)&old[cursor+1]; in php_escape_html_entities_ex() local
1339 valid = process_numeric_entity((const char **)&pos, &code_point); in php_escape_html_entities_ex()
1346 ent_len = pos - (char*)&old[cursor]; in php_escape_html_entities_ex()