]>
Commit | Line | Data |
---|---|---|
45516216 | 1 | # 1 "regex.c" |
2 | # 1 "/var/tmp/portage/glibc-2.5/work/glibc-2.5/posix//" | |
3 | # 1 "<built-in>" | |
4 | # 1 "<command line>" | |
5 | # 1 "./../include/libc-symbols.h" 1 | |
6 | # 55 "./../include/libc-symbols.h" | |
7 | # 1 "/var/tmp/portage/glibc-2.5/work/build-default-hppa2.0-unknown-linux-gnu-nptl/config.h" 1 | |
8 | # 56 "./../include/libc-symbols.h" 2 | |
9 | # 824 "./../include/libc-symbols.h" | |
10 | # 1 "../sysdeps/wordsize-32/symbol-hacks.h" 1 | |
11 | # 825 "./../include/libc-symbols.h" 2 | |
12 | # 1 "<command line>" 2 | |
13 | # 1 "regex.c" | |
14 | # 52 "regex.c" | |
15 | # 1 "../locale/localeinfo.h" 1 | |
16 | # 23 "../locale/localeinfo.h" | |
17 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
18 | # 152 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 3 4 | |
19 | typedef int ptrdiff_t; | |
20 | # 214 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 3 4 | |
21 | typedef unsigned int size_t; | |
22 | # 326 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 3 4 | |
23 | typedef long int wchar_t; | |
24 | # 24 "../locale/localeinfo.h" 2 | |
25 | # 1 "../include/langinfo.h" 1 | |
26 | ||
27 | ||
28 | # 1 "../locale/langinfo.h" 1 | |
29 | # 24 "../locale/langinfo.h" | |
30 | # 1 "../include/nl_types.h" 1 | |
31 | # 1 "../catgets/nl_types.h" 1 | |
32 | # 22 "../catgets/nl_types.h" | |
33 | # 1 "../include/features.h" 1 | |
34 | # 323 "../include/features.h" | |
35 | # 1 "../include/sys/cdefs.h" 1 | |
36 | ||
37 | ||
38 | # 1 "../misc/sys/cdefs.h" 1 | |
39 | # 313 "../misc/sys/cdefs.h" | |
40 | # 1 "../sysdeps/wordsize-32/bits/wordsize.h" 1 | |
41 | # 314 "../misc/sys/cdefs.h" 2 | |
42 | # 4 "../include/sys/cdefs.h" 2 | |
43 | ||
44 | extern void __chk_fail (void) __attribute__ ((__noreturn__)); | |
45 | ||
46 | ||
47 | # 324 "../include/features.h" 2 | |
48 | # 346 "../include/features.h" | |
49 | # 1 "../include/gnu/stubs.h" 1 | |
50 | # 347 "../include/features.h" 2 | |
51 | # 23 "../catgets/nl_types.h" 2 | |
52 | # 31 "../catgets/nl_types.h" | |
53 | ||
54 | ||
55 | ||
56 | typedef void *nl_catd; | |
57 | ||
58 | ||
59 | typedef int nl_item; | |
60 | ||
61 | ||
62 | ||
63 | ||
64 | ||
65 | extern nl_catd catopen (__const char *__cat_name, int __flag) __attribute__ ((__nonnull__ (1))); | |
66 | ||
67 | ||
68 | ||
69 | extern char *catgets (nl_catd __catalog, int __set, int __number, | |
70 | __const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
71 | ||
72 | ||
73 | extern int catclose (nl_catd __catalog) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
74 | ||
75 | ||
76 | # 1 "../include/nl_types.h" 2 | |
77 | # 25 "../locale/langinfo.h" 2 | |
78 | ||
79 | # 1 "../include/bits/locale.h" 1 | |
80 | # 1 "../locale/bits/locale.h" 1 | |
81 | # 27 "../locale/bits/locale.h" | |
82 | enum | |
83 | { | |
84 | __LC_CTYPE = 0, | |
85 | __LC_NUMERIC = 1, | |
86 | __LC_TIME = 2, | |
87 | __LC_COLLATE = 3, | |
88 | __LC_MONETARY = 4, | |
89 | __LC_MESSAGES = 5, | |
90 | __LC_ALL = 6, | |
91 | __LC_PAPER = 7, | |
92 | __LC_NAME = 8, | |
93 | __LC_ADDRESS = 9, | |
94 | __LC_TELEPHONE = 10, | |
95 | __LC_MEASUREMENT = 11, | |
96 | __LC_IDENTIFICATION = 12 | |
97 | }; | |
98 | # 1 "../include/bits/locale.h" 2 | |
99 | # 27 "../locale/langinfo.h" 2 | |
100 | ||
101 | ||
102 | ||
103 | # 42 "../locale/langinfo.h" | |
104 | enum | |
105 | { | |
106 | ||
107 | ||
108 | ||
109 | ABDAY_1 = (((__LC_TIME) << 16) | (0)), | |
110 | ||
111 | ABDAY_2, | |
112 | ||
113 | ABDAY_3, | |
114 | ||
115 | ABDAY_4, | |
116 | ||
117 | ABDAY_5, | |
118 | ||
119 | ABDAY_6, | |
120 | ||
121 | ABDAY_7, | |
122 | ||
123 | ||
124 | ||
125 | DAY_1, | |
126 | ||
127 | DAY_2, | |
128 | ||
129 | DAY_3, | |
130 | ||
131 | DAY_4, | |
132 | ||
133 | DAY_5, | |
134 | ||
135 | DAY_6, | |
136 | ||
137 | DAY_7, | |
138 | ||
139 | ||
140 | ||
141 | ABMON_1, | |
142 | ||
143 | ABMON_2, | |
144 | ||
145 | ABMON_3, | |
146 | ||
147 | ABMON_4, | |
148 | ||
149 | ABMON_5, | |
150 | ||
151 | ABMON_6, | |
152 | ||
153 | ABMON_7, | |
154 | ||
155 | ABMON_8, | |
156 | ||
157 | ABMON_9, | |
158 | ||
159 | ABMON_10, | |
160 | ||
161 | ABMON_11, | |
162 | ||
163 | ABMON_12, | |
164 | ||
165 | ||
166 | ||
167 | MON_1, | |
168 | ||
169 | MON_2, | |
170 | ||
171 | MON_3, | |
172 | ||
173 | MON_4, | |
174 | ||
175 | MON_5, | |
176 | ||
177 | MON_6, | |
178 | ||
179 | MON_7, | |
180 | ||
181 | MON_8, | |
182 | ||
183 | MON_9, | |
184 | ||
185 | MON_10, | |
186 | ||
187 | MON_11, | |
188 | ||
189 | MON_12, | |
190 | ||
191 | ||
192 | AM_STR, | |
193 | ||
194 | PM_STR, | |
195 | ||
196 | ||
197 | D_T_FMT, | |
198 | ||
199 | D_FMT, | |
200 | ||
201 | T_FMT, | |
202 | ||
203 | T_FMT_AMPM, | |
204 | ||
205 | ||
206 | ERA, | |
207 | ||
208 | __ERA_YEAR, | |
209 | ||
210 | ||
211 | ||
212 | ERA_D_FMT, | |
213 | ||
214 | ALT_DIGITS, | |
215 | ||
216 | ERA_D_T_FMT, | |
217 | ||
218 | ERA_T_FMT, | |
219 | ||
220 | ||
221 | _NL_TIME_ERA_NUM_ENTRIES, | |
222 | _NL_TIME_ERA_ENTRIES, | |
223 | ||
224 | _NL_WABDAY_1, | |
225 | _NL_WABDAY_2, | |
226 | _NL_WABDAY_3, | |
227 | _NL_WABDAY_4, | |
228 | _NL_WABDAY_5, | |
229 | _NL_WABDAY_6, | |
230 | _NL_WABDAY_7, | |
231 | ||
232 | ||
233 | _NL_WDAY_1, | |
234 | _NL_WDAY_2, | |
235 | _NL_WDAY_3, | |
236 | _NL_WDAY_4, | |
237 | _NL_WDAY_5, | |
238 | _NL_WDAY_6, | |
239 | _NL_WDAY_7, | |
240 | ||
241 | ||
242 | _NL_WABMON_1, | |
243 | _NL_WABMON_2, | |
244 | _NL_WABMON_3, | |
245 | _NL_WABMON_4, | |
246 | _NL_WABMON_5, | |
247 | _NL_WABMON_6, | |
248 | _NL_WABMON_7, | |
249 | _NL_WABMON_8, | |
250 | _NL_WABMON_9, | |
251 | _NL_WABMON_10, | |
252 | _NL_WABMON_11, | |
253 | _NL_WABMON_12, | |
254 | ||
255 | ||
256 | _NL_WMON_1, | |
257 | _NL_WMON_2, | |
258 | _NL_WMON_3, | |
259 | _NL_WMON_4, | |
260 | _NL_WMON_5, | |
261 | _NL_WMON_6, | |
262 | _NL_WMON_7, | |
263 | _NL_WMON_8, | |
264 | _NL_WMON_9, | |
265 | _NL_WMON_10, | |
266 | _NL_WMON_11, | |
267 | _NL_WMON_12, | |
268 | ||
269 | _NL_WAM_STR, | |
270 | _NL_WPM_STR, | |
271 | ||
272 | _NL_WD_T_FMT, | |
273 | _NL_WD_FMT, | |
274 | _NL_WT_FMT, | |
275 | _NL_WT_FMT_AMPM, | |
276 | ||
277 | _NL_WERA_YEAR, | |
278 | _NL_WERA_D_FMT, | |
279 | _NL_WALT_DIGITS, | |
280 | _NL_WERA_D_T_FMT, | |
281 | _NL_WERA_T_FMT, | |
282 | ||
283 | _NL_TIME_WEEK_NDAYS, | |
284 | _NL_TIME_WEEK_1STDAY, | |
285 | _NL_TIME_WEEK_1STWEEK, | |
286 | _NL_TIME_FIRST_WEEKDAY, | |
287 | _NL_TIME_FIRST_WORKDAY, | |
288 | _NL_TIME_CAL_DIRECTION, | |
289 | _NL_TIME_TIMEZONE, | |
290 | ||
291 | _DATE_FMT, | |
292 | ||
293 | _NL_W_DATE_FMT, | |
294 | ||
295 | _NL_TIME_CODESET, | |
296 | ||
297 | _NL_NUM_LC_TIME, | |
298 | ||
299 | ||
300 | ||
301 | ||
302 | _NL_COLLATE_NRULES = (((__LC_COLLATE) << 16) | (0)), | |
303 | _NL_COLLATE_RULESETS, | |
304 | _NL_COLLATE_TABLEMB, | |
305 | _NL_COLLATE_WEIGHTMB, | |
306 | _NL_COLLATE_EXTRAMB, | |
307 | _NL_COLLATE_INDIRECTMB, | |
308 | _NL_COLLATE_GAP1, | |
309 | _NL_COLLATE_GAP2, | |
310 | _NL_COLLATE_GAP3, | |
311 | _NL_COLLATE_TABLEWC, | |
312 | _NL_COLLATE_WEIGHTWC, | |
313 | _NL_COLLATE_EXTRAWC, | |
314 | _NL_COLLATE_INDIRECTWC, | |
315 | _NL_COLLATE_SYMB_HASH_SIZEMB, | |
316 | _NL_COLLATE_SYMB_TABLEMB, | |
317 | _NL_COLLATE_SYMB_EXTRAMB, | |
318 | _NL_COLLATE_COLLSEQMB, | |
319 | _NL_COLLATE_COLLSEQWC, | |
320 | _NL_COLLATE_CODESET, | |
321 | _NL_NUM_LC_COLLATE, | |
322 | ||
323 | ||
324 | ||
325 | ||
326 | _NL_CTYPE_CLASS = (((__LC_CTYPE) << 16) | (0)), | |
327 | _NL_CTYPE_TOUPPER, | |
328 | _NL_CTYPE_GAP1, | |
329 | _NL_CTYPE_TOLOWER, | |
330 | _NL_CTYPE_GAP2, | |
331 | _NL_CTYPE_CLASS32, | |
332 | _NL_CTYPE_GAP3, | |
333 | _NL_CTYPE_GAP4, | |
334 | _NL_CTYPE_GAP5, | |
335 | _NL_CTYPE_GAP6, | |
336 | _NL_CTYPE_CLASS_NAMES, | |
337 | _NL_CTYPE_MAP_NAMES, | |
338 | _NL_CTYPE_WIDTH, | |
339 | _NL_CTYPE_MB_CUR_MAX, | |
340 | _NL_CTYPE_CODESET_NAME, | |
341 | CODESET = _NL_CTYPE_CODESET_NAME, | |
342 | ||
343 | _NL_CTYPE_TOUPPER32, | |
344 | _NL_CTYPE_TOLOWER32, | |
345 | _NL_CTYPE_CLASS_OFFSET, | |
346 | _NL_CTYPE_MAP_OFFSET, | |
347 | _NL_CTYPE_INDIGITS_MB_LEN, | |
348 | _NL_CTYPE_INDIGITS0_MB, | |
349 | _NL_CTYPE_INDIGITS1_MB, | |
350 | _NL_CTYPE_INDIGITS2_MB, | |
351 | _NL_CTYPE_INDIGITS3_MB, | |
352 | _NL_CTYPE_INDIGITS4_MB, | |
353 | _NL_CTYPE_INDIGITS5_MB, | |
354 | _NL_CTYPE_INDIGITS6_MB, | |
355 | _NL_CTYPE_INDIGITS7_MB, | |
356 | _NL_CTYPE_INDIGITS8_MB, | |
357 | _NL_CTYPE_INDIGITS9_MB, | |
358 | _NL_CTYPE_INDIGITS_WC_LEN, | |
359 | _NL_CTYPE_INDIGITS0_WC, | |
360 | _NL_CTYPE_INDIGITS1_WC, | |
361 | _NL_CTYPE_INDIGITS2_WC, | |
362 | _NL_CTYPE_INDIGITS3_WC, | |
363 | _NL_CTYPE_INDIGITS4_WC, | |
364 | _NL_CTYPE_INDIGITS5_WC, | |
365 | _NL_CTYPE_INDIGITS6_WC, | |
366 | _NL_CTYPE_INDIGITS7_WC, | |
367 | _NL_CTYPE_INDIGITS8_WC, | |
368 | _NL_CTYPE_INDIGITS9_WC, | |
369 | _NL_CTYPE_OUTDIGIT0_MB, | |
370 | _NL_CTYPE_OUTDIGIT1_MB, | |
371 | _NL_CTYPE_OUTDIGIT2_MB, | |
372 | _NL_CTYPE_OUTDIGIT3_MB, | |
373 | _NL_CTYPE_OUTDIGIT4_MB, | |
374 | _NL_CTYPE_OUTDIGIT5_MB, | |
375 | _NL_CTYPE_OUTDIGIT6_MB, | |
376 | _NL_CTYPE_OUTDIGIT7_MB, | |
377 | _NL_CTYPE_OUTDIGIT8_MB, | |
378 | _NL_CTYPE_OUTDIGIT9_MB, | |
379 | _NL_CTYPE_OUTDIGIT0_WC, | |
380 | _NL_CTYPE_OUTDIGIT1_WC, | |
381 | _NL_CTYPE_OUTDIGIT2_WC, | |
382 | _NL_CTYPE_OUTDIGIT3_WC, | |
383 | _NL_CTYPE_OUTDIGIT4_WC, | |
384 | _NL_CTYPE_OUTDIGIT5_WC, | |
385 | _NL_CTYPE_OUTDIGIT6_WC, | |
386 | _NL_CTYPE_OUTDIGIT7_WC, | |
387 | _NL_CTYPE_OUTDIGIT8_WC, | |
388 | _NL_CTYPE_OUTDIGIT9_WC, | |
389 | _NL_CTYPE_TRANSLIT_TAB_SIZE, | |
390 | _NL_CTYPE_TRANSLIT_FROM_IDX, | |
391 | _NL_CTYPE_TRANSLIT_FROM_TBL, | |
392 | _NL_CTYPE_TRANSLIT_TO_IDX, | |
393 | _NL_CTYPE_TRANSLIT_TO_TBL, | |
394 | _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN, | |
395 | _NL_CTYPE_TRANSLIT_DEFAULT_MISSING, | |
396 | _NL_CTYPE_TRANSLIT_IGNORE_LEN, | |
397 | _NL_CTYPE_TRANSLIT_IGNORE, | |
398 | _NL_CTYPE_MAP_TO_NONASCII, | |
399 | _NL_CTYPE_EXTRA_MAP_1, | |
400 | _NL_CTYPE_EXTRA_MAP_2, | |
401 | _NL_CTYPE_EXTRA_MAP_3, | |
402 | _NL_CTYPE_EXTRA_MAP_4, | |
403 | _NL_CTYPE_EXTRA_MAP_5, | |
404 | _NL_CTYPE_EXTRA_MAP_6, | |
405 | _NL_CTYPE_EXTRA_MAP_7, | |
406 | _NL_CTYPE_EXTRA_MAP_8, | |
407 | _NL_CTYPE_EXTRA_MAP_9, | |
408 | _NL_CTYPE_EXTRA_MAP_10, | |
409 | _NL_CTYPE_EXTRA_MAP_11, | |
410 | _NL_CTYPE_EXTRA_MAP_12, | |
411 | _NL_CTYPE_EXTRA_MAP_13, | |
412 | _NL_CTYPE_EXTRA_MAP_14, | |
413 | _NL_NUM_LC_CTYPE, | |
414 | ||
415 | ||
416 | ||
417 | ||
418 | __INT_CURR_SYMBOL = (((__LC_MONETARY) << 16) | (0)), | |
419 | ||
420 | ||
421 | ||
422 | __CURRENCY_SYMBOL, | |
423 | ||
424 | ||
425 | ||
426 | __MON_DECIMAL_POINT, | |
427 | ||
428 | ||
429 | ||
430 | __MON_THOUSANDS_SEP, | |
431 | ||
432 | ||
433 | ||
434 | __MON_GROUPING, | |
435 | ||
436 | ||
437 | ||
438 | __POSITIVE_SIGN, | |
439 | ||
440 | ||
441 | ||
442 | __NEGATIVE_SIGN, | |
443 | ||
444 | ||
445 | ||
446 | __INT_FRAC_DIGITS, | |
447 | ||
448 | ||
449 | ||
450 | __FRAC_DIGITS, | |
451 | ||
452 | ||
453 | ||
454 | __P_CS_PRECEDES, | |
455 | ||
456 | ||
457 | ||
458 | __P_SEP_BY_SPACE, | |
459 | ||
460 | ||
461 | ||
462 | __N_CS_PRECEDES, | |
463 | ||
464 | ||
465 | ||
466 | __N_SEP_BY_SPACE, | |
467 | ||
468 | ||
469 | ||
470 | __P_SIGN_POSN, | |
471 | ||
472 | ||
473 | ||
474 | __N_SIGN_POSN, | |
475 | ||
476 | ||
477 | ||
478 | _NL_MONETARY_CRNCYSTR, | |
479 | ||
480 | __INT_P_CS_PRECEDES, | |
481 | ||
482 | ||
483 | ||
484 | __INT_P_SEP_BY_SPACE, | |
485 | ||
486 | ||
487 | ||
488 | __INT_N_CS_PRECEDES, | |
489 | ||
490 | ||
491 | ||
492 | __INT_N_SEP_BY_SPACE, | |
493 | ||
494 | ||
495 | ||
496 | __INT_P_SIGN_POSN, | |
497 | ||
498 | ||
499 | ||
500 | __INT_N_SIGN_POSN, | |
501 | ||
502 | ||
503 | ||
504 | _NL_MONETARY_DUO_INT_CURR_SYMBOL, | |
505 | _NL_MONETARY_DUO_CURRENCY_SYMBOL, | |
506 | _NL_MONETARY_DUO_INT_FRAC_DIGITS, | |
507 | _NL_MONETARY_DUO_FRAC_DIGITS, | |
508 | _NL_MONETARY_DUO_P_CS_PRECEDES, | |
509 | _NL_MONETARY_DUO_P_SEP_BY_SPACE, | |
510 | _NL_MONETARY_DUO_N_CS_PRECEDES, | |
511 | _NL_MONETARY_DUO_N_SEP_BY_SPACE, | |
512 | _NL_MONETARY_DUO_INT_P_CS_PRECEDES, | |
513 | _NL_MONETARY_DUO_INT_P_SEP_BY_SPACE, | |
514 | _NL_MONETARY_DUO_INT_N_CS_PRECEDES, | |
515 | _NL_MONETARY_DUO_INT_N_SEP_BY_SPACE, | |
516 | _NL_MONETARY_DUO_P_SIGN_POSN, | |
517 | _NL_MONETARY_DUO_N_SIGN_POSN, | |
518 | _NL_MONETARY_DUO_INT_P_SIGN_POSN, | |
519 | _NL_MONETARY_DUO_INT_N_SIGN_POSN, | |
520 | _NL_MONETARY_UNO_VALID_FROM, | |
521 | _NL_MONETARY_UNO_VALID_TO, | |
522 | _NL_MONETARY_DUO_VALID_FROM, | |
523 | _NL_MONETARY_DUO_VALID_TO, | |
524 | _NL_MONETARY_CONVERSION_RATE, | |
525 | _NL_MONETARY_DECIMAL_POINT_WC, | |
526 | _NL_MONETARY_THOUSANDS_SEP_WC, | |
527 | _NL_MONETARY_CODESET, | |
528 | _NL_NUM_LC_MONETARY, | |
529 | ||
530 | ||
531 | ||
532 | __DECIMAL_POINT = (((__LC_NUMERIC) << 16) | (0)), | |
533 | ||
534 | ||
535 | ||
536 | RADIXCHAR = __DECIMAL_POINT, | |
537 | ||
538 | __THOUSANDS_SEP, | |
539 | ||
540 | ||
541 | ||
542 | THOUSEP = __THOUSANDS_SEP, | |
543 | ||
544 | __GROUPING, | |
545 | ||
546 | ||
547 | ||
548 | _NL_NUMERIC_DECIMAL_POINT_WC, | |
549 | _NL_NUMERIC_THOUSANDS_SEP_WC, | |
550 | _NL_NUMERIC_CODESET, | |
551 | _NL_NUM_LC_NUMERIC, | |
552 | ||
553 | __YESEXPR = (((__LC_MESSAGES) << 16) | (0)), | |
554 | ||
555 | __NOEXPR, | |
556 | ||
557 | __YESSTR, | |
558 | ||
559 | ||
560 | ||
561 | __NOSTR, | |
562 | ||
563 | ||
564 | ||
565 | _NL_MESSAGES_CODESET, | |
566 | _NL_NUM_LC_MESSAGES, | |
567 | ||
568 | _NL_PAPER_HEIGHT = (((__LC_PAPER) << 16) | (0)), | |
569 | _NL_PAPER_WIDTH, | |
570 | _NL_PAPER_CODESET, | |
571 | _NL_NUM_LC_PAPER, | |
572 | ||
573 | _NL_NAME_NAME_FMT = (((__LC_NAME) << 16) | (0)), | |
574 | _NL_NAME_NAME_GEN, | |
575 | _NL_NAME_NAME_MR, | |
576 | _NL_NAME_NAME_MRS, | |
577 | _NL_NAME_NAME_MISS, | |
578 | _NL_NAME_NAME_MS, | |
579 | _NL_NAME_CODESET, | |
580 | _NL_NUM_LC_NAME, | |
581 | ||
582 | _NL_ADDRESS_POSTAL_FMT = (((__LC_ADDRESS) << 16) | (0)), | |
583 | _NL_ADDRESS_COUNTRY_NAME, | |
584 | _NL_ADDRESS_COUNTRY_POST, | |
585 | _NL_ADDRESS_COUNTRY_AB2, | |
586 | _NL_ADDRESS_COUNTRY_AB3, | |
587 | _NL_ADDRESS_COUNTRY_CAR, | |
588 | _NL_ADDRESS_COUNTRY_NUM, | |
589 | _NL_ADDRESS_COUNTRY_ISBN, | |
590 | _NL_ADDRESS_LANG_NAME, | |
591 | _NL_ADDRESS_LANG_AB, | |
592 | _NL_ADDRESS_LANG_TERM, | |
593 | _NL_ADDRESS_LANG_LIB, | |
594 | _NL_ADDRESS_CODESET, | |
595 | _NL_NUM_LC_ADDRESS, | |
596 | ||
597 | _NL_TELEPHONE_TEL_INT_FMT = (((__LC_TELEPHONE) << 16) | (0)), | |
598 | _NL_TELEPHONE_TEL_DOM_FMT, | |
599 | _NL_TELEPHONE_INT_SELECT, | |
600 | _NL_TELEPHONE_INT_PREFIX, | |
601 | _NL_TELEPHONE_CODESET, | |
602 | _NL_NUM_LC_TELEPHONE, | |
603 | ||
604 | _NL_MEASUREMENT_MEASUREMENT = (((__LC_MEASUREMENT) << 16) | (0)), | |
605 | _NL_MEASUREMENT_CODESET, | |
606 | _NL_NUM_LC_MEASUREMENT, | |
607 | ||
608 | _NL_IDENTIFICATION_TITLE = (((__LC_IDENTIFICATION) << 16) | (0)), | |
609 | _NL_IDENTIFICATION_SOURCE, | |
610 | _NL_IDENTIFICATION_ADDRESS, | |
611 | _NL_IDENTIFICATION_CONTACT, | |
612 | _NL_IDENTIFICATION_EMAIL, | |
613 | _NL_IDENTIFICATION_TEL, | |
614 | _NL_IDENTIFICATION_FAX, | |
615 | _NL_IDENTIFICATION_LANGUAGE, | |
616 | _NL_IDENTIFICATION_TERRITORY, | |
617 | _NL_IDENTIFICATION_AUDIENCE, | |
618 | _NL_IDENTIFICATION_APPLICATION, | |
619 | _NL_IDENTIFICATION_ABBREVIATION, | |
620 | _NL_IDENTIFICATION_REVISION, | |
621 | _NL_IDENTIFICATION_DATE, | |
622 | _NL_IDENTIFICATION_CATEGORY, | |
623 | _NL_IDENTIFICATION_CODESET, | |
624 | _NL_NUM_LC_IDENTIFICATION, | |
625 | ||
626 | ||
627 | _NL_NUM | |
628 | }; | |
629 | # 582 "../locale/langinfo.h" | |
630 | extern char *nl_langinfo (nl_item __item) __attribute__ ((__nothrow__)); | |
631 | ||
632 | ||
633 | ||
634 | ||
635 | ||
636 | ||
637 | ||
638 | # 1 "../include/xlocale.h" 1 | |
639 | # 1 "../locale/xlocale.h" 1 | |
640 | # 28 "../locale/xlocale.h" | |
641 | typedef struct __locale_struct | |
642 | { | |
643 | ||
644 | struct locale_data *__locales[13]; | |
645 | ||
646 | ||
647 | const unsigned short int *__ctype_b; | |
648 | const int *__ctype_tolower; | |
649 | const int *__ctype_toupper; | |
650 | ||
651 | ||
652 | const char *__names[13]; | |
653 | } *__locale_t; | |
654 | # 1 "../include/xlocale.h" 2 | |
655 | # 591 "../locale/langinfo.h" 2 | |
656 | ||
657 | ||
658 | extern char *nl_langinfo_l (nl_item __item, __locale_t l); | |
659 | ||
660 | ||
661 | ||
662 | # 4 "../include/langinfo.h" 2 | |
663 | ||
664 | ||
665 | ||
666 | extern __typeof (nl_langinfo_l) __nl_langinfo_l; | |
667 | # 25 "../locale/localeinfo.h" 2 | |
668 | # 1 "../include/limits.h" 1 | |
669 | # 125 "../include/limits.h" | |
670 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/limits.h" 1 3 4 | |
671 | # 126 "../include/limits.h" 2 | |
672 | # 145 "../include/limits.h" | |
673 | # 1 "../include/bits/posix1_lim.h" 1 | |
674 | # 1 "../posix/bits/posix1_lim.h" 1 | |
675 | # 153 "../posix/bits/posix1_lim.h" | |
676 | # 1 "../nptl/sysdeps/unix/sysv/linux/bits/local_lim.h" 1 | |
677 | # 36 "../nptl/sysdeps/unix/sysv/linux/bits/local_lim.h" | |
678 | # 1 "/usr/include/linux/limits.h" 1 3 4 | |
679 | # 37 "../nptl/sysdeps/unix/sysv/linux/bits/local_lim.h" 2 | |
680 | # 154 "../posix/bits/posix1_lim.h" 2 | |
681 | # 1 "../include/bits/posix1_lim.h" 2 | |
682 | # 146 "../include/limits.h" 2 | |
683 | ||
684 | ||
685 | ||
686 | # 1 "../include/bits/posix2_lim.h" 1 | |
687 | # 1 "../posix/bits/posix2_lim.h" 1 | |
688 | # 1 "../include/bits/posix2_lim.h" 2 | |
689 | # 150 "../include/limits.h" 2 | |
690 | ||
691 | ||
692 | ||
693 | # 1 "../include/bits/xopen_lim.h" 1 | |
694 | # 34 "../include/bits/xopen_lim.h" | |
695 | # 1 "/var/tmp/portage/glibc-2.5/work/build-default-hppa2.0-unknown-linux-gnu-nptl/bits/stdio_lim.h" 1 | |
696 | # 35 "../include/bits/xopen_lim.h" 2 | |
697 | # 154 "../include/limits.h" 2 | |
698 | # 26 "../locale/localeinfo.h" 2 | |
699 | # 1 "../include/locale.h" 1 | |
700 | ||
701 | # 1 "../locale/locale.h" 1 | |
702 | # 29 "../locale/locale.h" | |
703 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
704 | # 30 "../locale/locale.h" 2 | |
705 | # 1 "../include/bits/locale.h" 1 | |
706 | # 1 "../locale/bits/locale.h" 1 | |
707 | # 1 "../include/bits/locale.h" 2 | |
708 | # 31 "../locale/locale.h" 2 | |
709 | ||
710 | ||
711 | # 52 "../locale/locale.h" | |
712 | struct lconv | |
713 | { | |
714 | ||
715 | ||
716 | char *decimal_point; | |
717 | char *thousands_sep; | |
718 | ||
719 | ||
720 | ||
721 | ||
722 | ||
723 | char *grouping; | |
724 | ||
725 | ||
726 | ||
727 | ||
728 | ||
729 | char *int_curr_symbol; | |
730 | char *currency_symbol; | |
731 | char *mon_decimal_point; | |
732 | char *mon_thousands_sep; | |
733 | char *mon_grouping; | |
734 | char *positive_sign; | |
735 | char *negative_sign; | |
736 | char int_frac_digits; | |
737 | char frac_digits; | |
738 | ||
739 | char p_cs_precedes; | |
740 | ||
741 | char p_sep_by_space; | |
742 | ||
743 | char n_cs_precedes; | |
744 | ||
745 | char n_sep_by_space; | |
746 | ||
747 | ||
748 | ||
749 | ||
750 | ||
751 | ||
752 | char p_sign_posn; | |
753 | char n_sign_posn; | |
754 | ||
755 | ||
756 | char int_p_cs_precedes; | |
757 | ||
758 | char int_p_sep_by_space; | |
759 | ||
760 | char int_n_cs_precedes; | |
761 | ||
762 | char int_n_sep_by_space; | |
763 | ||
764 | ||
765 | ||
766 | ||
767 | ||
768 | ||
769 | char int_p_sign_posn; | |
770 | char int_n_sign_posn; | |
771 | # 119 "../locale/locale.h" | |
772 | }; | |
773 | ||
774 | ||
775 | ||
776 | ||
777 | ||
778 | extern char *setlocale (int __category, __const char *__locale) __attribute__ ((__nothrow__)); | |
779 | ||
780 | ||
781 | extern struct lconv *localeconv (void) __attribute__ ((__nothrow__)); | |
782 | ||
783 | ||
784 | # 146 "../locale/locale.h" | |
785 | # 1 "../include/xlocale.h" 1 | |
786 | # 147 "../locale/locale.h" 2 | |
787 | ||
788 | typedef __locale_t locale_t; | |
789 | ||
790 | ||
791 | ||
792 | ||
793 | ||
794 | extern __locale_t newlocale (int __category_mask, __const char *__locale, | |
795 | __locale_t __base) __attribute__ ((__nothrow__)); | |
796 | # 189 "../locale/locale.h" | |
797 | extern __locale_t duplocale (__locale_t __dataset) __attribute__ ((__nothrow__)); | |
798 | ||
799 | ||
800 | ||
801 | extern void freelocale (__locale_t __dataset) __attribute__ ((__nothrow__)); | |
802 | ||
803 | ||
804 | ||
805 | ||
806 | ||
807 | ||
808 | extern __locale_t uselocale (__locale_t __dataset) __attribute__ ((__nothrow__)); | |
809 | ||
810 | ||
811 | ||
812 | ||
813 | ||
814 | ||
815 | ||
816 | ||
817 | # 3 "../include/locale.h" 2 | |
818 | ||
819 | extern __typeof (uselocale) __uselocale; | |
820 | ||
821 | ||
822 | ||
823 | ||
824 | ||
825 | ||
826 | extern struct loaded_l10nfile *_nl_locale_file_list[] ; | |
827 | ||
828 | ||
829 | extern const struct __locale_struct _nl_C_locobj ; | |
830 | ||
831 | ||
832 | ||
833 | extern struct lconv *__localeconv (void); | |
834 | ||
835 | ||
836 | extern const char *__current_locale_name (int category) ; | |
837 | # 27 "../locale/localeinfo.h" 2 | |
838 | # 1 "../include/time.h" 1 | |
839 | ||
840 | ||
841 | ||
842 | ||
843 | # 1 "../time/time.h" 1 | |
844 | # 31 "../time/time.h" | |
845 | ||
846 | ||
847 | ||
848 | ||
849 | ||
850 | ||
851 | ||
852 | ||
853 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
854 | # 40 "../time/time.h" 2 | |
855 | ||
856 | ||
857 | ||
858 | # 1 "../bits/time.h" 1 | |
859 | # 44 "../time/time.h" 2 | |
860 | # 57 "../time/time.h" | |
861 | # 1 "../bits/types.h" 1 | |
862 | # 28 "../bits/types.h" | |
863 | # 1 "../sysdeps/wordsize-32/bits/wordsize.h" 1 | |
864 | # 29 "../bits/types.h" 2 | |
865 | ||
866 | ||
867 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
868 | # 32 "../bits/types.h" 2 | |
869 | ||
870 | ||
871 | typedef unsigned char __u_char; | |
872 | typedef unsigned short int __u_short; | |
873 | typedef unsigned int __u_int; | |
874 | typedef unsigned long int __u_long; | |
875 | ||
876 | ||
877 | typedef signed char __int8_t; | |
878 | typedef unsigned char __uint8_t; | |
879 | typedef signed short int __int16_t; | |
880 | typedef unsigned short int __uint16_t; | |
881 | typedef signed int __int32_t; | |
882 | typedef unsigned int __uint32_t; | |
883 | ||
884 | ||
885 | ||
886 | ||
887 | __extension__ typedef signed long long int __int64_t; | |
888 | __extension__ typedef unsigned long long int __uint64_t; | |
889 | ||
890 | ||
891 | ||
892 | ||
893 | ||
894 | ||
895 | ||
896 | __extension__ typedef long long int __quad_t; | |
897 | __extension__ typedef unsigned long long int __u_quad_t; | |
898 | # 134 "../bits/types.h" | |
899 | # 1 "../bits/typesizes.h" 1 | |
900 | # 135 "../bits/types.h" 2 | |
901 | ||
902 | ||
903 | __extension__ typedef __u_quad_t __dev_t; | |
904 | __extension__ typedef unsigned int __uid_t; | |
905 | __extension__ typedef unsigned int __gid_t; | |
906 | __extension__ typedef unsigned long int __ino_t; | |
907 | __extension__ typedef __u_quad_t __ino64_t; | |
908 | __extension__ typedef unsigned int __mode_t; | |
909 | __extension__ typedef unsigned int __nlink_t; | |
910 | __extension__ typedef long int __off_t; | |
911 | __extension__ typedef __quad_t __off64_t; | |
912 | __extension__ typedef int __pid_t; | |
913 | __extension__ typedef struct { int __val[2]; } __fsid_t; | |
914 | __extension__ typedef long int __clock_t; | |
915 | __extension__ typedef unsigned long int __rlim_t; | |
916 | __extension__ typedef __u_quad_t __rlim64_t; | |
917 | __extension__ typedef unsigned int __id_t; | |
918 | __extension__ typedef long int __time_t; | |
919 | __extension__ typedef unsigned int __useconds_t; | |
920 | __extension__ typedef long int __suseconds_t; | |
921 | ||
922 | __extension__ typedef int __daddr_t; | |
923 | __extension__ typedef long int __swblk_t; | |
924 | __extension__ typedef int __key_t; | |
925 | ||
926 | ||
927 | __extension__ typedef int __clockid_t; | |
928 | ||
929 | ||
930 | __extension__ typedef void * __timer_t; | |
931 | ||
932 | ||
933 | __extension__ typedef long int __blksize_t; | |
934 | ||
935 | ||
936 | ||
937 | ||
938 | __extension__ typedef long int __blkcnt_t; | |
939 | __extension__ typedef __quad_t __blkcnt64_t; | |
940 | ||
941 | ||
942 | __extension__ typedef unsigned long int __fsblkcnt_t; | |
943 | __extension__ typedef __u_quad_t __fsblkcnt64_t; | |
944 | ||
945 | ||
946 | __extension__ typedef unsigned long int __fsfilcnt_t; | |
947 | __extension__ typedef __u_quad_t __fsfilcnt64_t; | |
948 | ||
949 | __extension__ typedef int __ssize_t; | |
950 | ||
951 | ||
952 | ||
953 | typedef __off64_t __loff_t; | |
954 | typedef __quad_t *__qaddr_t; | |
955 | typedef char *__caddr_t; | |
956 | ||
957 | ||
958 | __extension__ typedef int __intptr_t; | |
959 | ||
960 | ||
961 | __extension__ typedef unsigned int __socklen_t; | |
962 | # 58 "../time/time.h" 2 | |
963 | ||
964 | ||
965 | ||
966 | typedef __clock_t clock_t; | |
967 | ||
968 | ||
969 | ||
970 | # 75 "../time/time.h" | |
971 | ||
972 | ||
973 | typedef __time_t time_t; | |
974 | ||
975 | ||
976 | ||
977 | # 93 "../time/time.h" | |
978 | typedef __clockid_t clockid_t; | |
979 | # 105 "../time/time.h" | |
980 | typedef __timer_t timer_t; | |
981 | # 121 "../time/time.h" | |
982 | struct timespec | |
983 | { | |
984 | __time_t tv_sec; | |
985 | long int tv_nsec; | |
986 | }; | |
987 | ||
988 | ||
989 | ||
990 | ||
991 | ||
992 | ||
993 | ||
994 | ||
995 | struct tm | |
996 | { | |
997 | int tm_sec; | |
998 | int tm_min; | |
999 | int tm_hour; | |
1000 | int tm_mday; | |
1001 | int tm_mon; | |
1002 | int tm_year; | |
1003 | int tm_wday; | |
1004 | int tm_yday; | |
1005 | int tm_isdst; | |
1006 | ||
1007 | ||
1008 | long int tm_gmtoff; | |
1009 | __const char *tm_zone; | |
1010 | ||
1011 | ||
1012 | ||
1013 | ||
1014 | }; | |
1015 | ||
1016 | ||
1017 | ||
1018 | ||
1019 | ||
1020 | ||
1021 | ||
1022 | ||
1023 | struct itimerspec | |
1024 | { | |
1025 | struct timespec it_interval; | |
1026 | struct timespec it_value; | |
1027 | }; | |
1028 | ||
1029 | ||
1030 | struct sigevent; | |
1031 | ||
1032 | ||
1033 | ||
1034 | ||
1035 | ||
1036 | typedef __pid_t pid_t; | |
1037 | ||
1038 | ||
1039 | ||
1040 | ||
1041 | ||
1042 | ||
1043 | ||
1044 | ||
1045 | extern clock_t clock (void) __attribute__ ((__nothrow__)); | |
1046 | ||
1047 | ||
1048 | extern time_t time (time_t *__timer) __attribute__ ((__nothrow__)); | |
1049 | ||
1050 | ||
1051 | extern double difftime (time_t __time1, time_t __time0) | |
1052 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1053 | ||
1054 | ||
1055 | extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__)); | |
1056 | ||
1057 | ||
1058 | ||
1059 | ||
1060 | ||
1061 | extern size_t strftime (char *__restrict __s, size_t __maxsize, | |
1062 | __const char *__restrict __format, | |
1063 | __const struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
1064 | ||
1065 | ||
1066 | ||
1067 | ||
1068 | ||
1069 | extern char *strptime (__const char *__restrict __s, | |
1070 | __const char *__restrict __fmt, struct tm *__tp) | |
1071 | __attribute__ ((__nothrow__)); | |
1072 | ||
1073 | ||
1074 | ||
1075 | ||
1076 | ||
1077 | # 1 "../include/xlocale.h" 1 | |
1078 | # 217 "../time/time.h" 2 | |
1079 | ||
1080 | extern size_t strftime_l (char *__restrict __s, size_t __maxsize, | |
1081 | __const char *__restrict __format, | |
1082 | __const struct tm *__restrict __tp, | |
1083 | __locale_t __loc) __attribute__ ((__nothrow__)); | |
1084 | ||
1085 | extern char *strptime_l (__const char *__restrict __s, | |
1086 | __const char *__restrict __fmt, struct tm *__tp, | |
1087 | __locale_t __loc) __attribute__ ((__nothrow__)); | |
1088 | ||
1089 | ||
1090 | ||
1091 | ||
1092 | ||
1093 | ||
1094 | extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__)); | |
1095 | ||
1096 | ||
1097 | ||
1098 | extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__)); | |
1099 | ||
1100 | ||
1101 | ||
1102 | ||
1103 | ||
1104 | extern struct tm *gmtime_r (__const time_t *__restrict __timer, | |
1105 | struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
1106 | ||
1107 | ||
1108 | ||
1109 | extern struct tm *localtime_r (__const time_t *__restrict __timer, | |
1110 | struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
1111 | ||
1112 | ||
1113 | ||
1114 | ||
1115 | ||
1116 | extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__)); | |
1117 | ||
1118 | ||
1119 | extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__)); | |
1120 | ||
1121 | ||
1122 | ||
1123 | ||
1124 | ||
1125 | ||
1126 | ||
1127 | extern char *asctime_r (__const struct tm *__restrict __tp, | |
1128 | char *__restrict __buf) __attribute__ ((__nothrow__)); | |
1129 | ||
1130 | ||
1131 | extern char *ctime_r (__const time_t *__restrict __timer, | |
1132 | char *__restrict __buf) __attribute__ ((__nothrow__)); | |
1133 | ||
1134 | ||
1135 | ||
1136 | ||
1137 | extern char *__tzname[2]; | |
1138 | extern int __daylight; | |
1139 | extern long int __timezone; | |
1140 | ||
1141 | ||
1142 | ||
1143 | ||
1144 | extern char *tzname[2]; | |
1145 | ||
1146 | ||
1147 | ||
1148 | extern void tzset (void) __attribute__ ((__nothrow__)); | |
1149 | ||
1150 | ||
1151 | ||
1152 | extern int daylight; | |
1153 | extern long int timezone; | |
1154 | ||
1155 | ||
1156 | ||
1157 | ||
1158 | ||
1159 | extern int stime (__const time_t *__when) __attribute__ ((__nothrow__)); | |
1160 | # 312 "../time/time.h" | |
1161 | extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__)); | |
1162 | ||
1163 | ||
1164 | extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__)); | |
1165 | ||
1166 | ||
1167 | extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1168 | # 327 "../time/time.h" | |
1169 | extern int nanosleep (__const struct timespec *__requested_time, | |
1170 | struct timespec *__remaining); | |
1171 | ||
1172 | ||
1173 | ||
1174 | extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__)); | |
1175 | ||
1176 | ||
1177 | extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__)); | |
1178 | ||
1179 | ||
1180 | extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp) | |
1181 | __attribute__ ((__nothrow__)); | |
1182 | ||
1183 | ||
1184 | ||
1185 | ||
1186 | ||
1187 | ||
1188 | extern int clock_nanosleep (clockid_t __clock_id, int __flags, | |
1189 | __const struct timespec *__req, | |
1190 | struct timespec *__rem); | |
1191 | ||
1192 | ||
1193 | extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__)); | |
1194 | ||
1195 | ||
1196 | ||
1197 | ||
1198 | extern int timer_create (clockid_t __clock_id, | |
1199 | struct sigevent *__restrict __evp, | |
1200 | timer_t *__restrict __timerid) __attribute__ ((__nothrow__)); | |
1201 | ||
1202 | ||
1203 | extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__)); | |
1204 | ||
1205 | ||
1206 | extern int timer_settime (timer_t __timerid, int __flags, | |
1207 | __const struct itimerspec *__restrict __value, | |
1208 | struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__)); | |
1209 | ||
1210 | ||
1211 | extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) | |
1212 | __attribute__ ((__nothrow__)); | |
1213 | ||
1214 | ||
1215 | extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__)); | |
1216 | # 389 "../time/time.h" | |
1217 | extern int getdate_err; | |
1218 | # 398 "../time/time.h" | |
1219 | extern struct tm *getdate (__const char *__string); | |
1220 | # 412 "../time/time.h" | |
1221 | extern int getdate_r (__const char *__restrict __string, | |
1222 | struct tm *__restrict __resbufp); | |
1223 | ||
1224 | ||
1225 | ||
1226 | # 6 "../include/time.h" 2 | |
1227 | # 1 "../include/xlocale.h" 1 | |
1228 | # 7 "../include/time.h" 2 | |
1229 | ||
1230 | ||
1231 | ||
1232 | extern __typeof (strftime_l) __strftime_l; | |
1233 | ||
1234 | extern __typeof (strptime_l) __strptime_l; | |
1235 | ||
1236 | ||
1237 | ||
1238 | ||
1239 | ||
1240 | ||
1241 | ||
1242 | ||
1243 | ||
1244 | ||
1245 | ||
1246 | ||
1247 | struct tm; | |
1248 | ||
1249 | ||
1250 | extern const unsigned short int __mon_yday[2][13] ; | |
1251 | ||
1252 | ||
1253 | extern struct tm _tmbuf ; | |
1254 | ||
1255 | ||
1256 | extern char *__tzstring (const char *string); | |
1257 | ||
1258 | ||
1259 | extern size_t __tzname_cur_max ; | |
1260 | ||
1261 | ||
1262 | extern int __use_tzfile ; | |
1263 | ||
1264 | extern void __tzfile_read (const char *file, size_t extra, | |
1265 | char **extrap); | |
1266 | extern void __tzfile_compute (time_t timer, int use_localtime, | |
1267 | long int *leap_correct, int *leap_hit, | |
1268 | struct tm *tp); | |
1269 | extern void __tzfile_default (const char *std, const char *dst, | |
1270 | long int stdoff, long int dstoff); | |
1271 | ||
1272 | ||
1273 | ||
1274 | ||
1275 | extern time_t __mktime_internal (struct tm *__tp, | |
1276 | struct tm *(*__func) (const time_t *, | |
1277 | struct tm *), | |
1278 | time_t *__offset); | |
1279 | extern struct tm *__localtime_r (__const time_t *__timer, | |
1280 | struct tm *__tp) ; | |
1281 | ||
1282 | extern struct tm *__gmtime_r (__const time_t *__restrict __timer, | |
1283 | struct tm *__restrict __tp); | |
1284 | ||
1285 | ||
1286 | ||
1287 | ||
1288 | ||
1289 | ||
1290 | extern int __offtime (__const time_t *__timer, | |
1291 | long int __offset, | |
1292 | struct tm *__tp); | |
1293 | ||
1294 | extern char *__asctime_r (__const struct tm *__tp, char *__buf); | |
1295 | extern void __tzset (void); | |
1296 | ||
1297 | ||
1298 | extern struct tm *__tz_convert (const time_t *timer, int use_localtime, struct tm *tp); | |
1299 | ||
1300 | ||
1301 | ||
1302 | extern long int __tzname_max (void); | |
1303 | ||
1304 | extern int __nanosleep (__const struct timespec *__requested_time, | |
1305 | struct timespec *__remaining); | |
1306 | ||
1307 | extern int __nanosleep_nocancel (__const struct timespec *__requested_time, | |
1308 | struct timespec *__remaining) | |
1309 | ; | |
1310 | extern int __getdate_r (__const char *__string, struct tm *__resbufp); | |
1311 | ||
1312 | ||
1313 | ||
1314 | extern int __getclktck (void); | |
1315 | ||
1316 | ||
1317 | ||
1318 | ||
1319 | ||
1320 | ||
1321 | enum ptime_locale_status { not, loc, raw }; | |
1322 | ||
1323 | extern char * __strptime_internal (const char *rp, const char *fmt, | |
1324 | struct tm *tm, | |
1325 | enum ptime_locale_status *decided, | |
1326 | int era_cnt, __locale_t locparam) | |
1327 | ; | |
1328 | ||
1329 | ||
1330 | extern double __difftime (time_t time1, time_t time0); | |
1331 | # 117 "../include/time.h" | |
1332 | ||
1333 | # 28 "../locale/localeinfo.h" 2 | |
1334 | # 1 "../sysdeps/generic/stdint.h" 1 | |
1335 | # 27 "../sysdeps/generic/stdint.h" | |
1336 | # 1 "../bits/wchar.h" 1 | |
1337 | # 28 "../sysdeps/generic/stdint.h" 2 | |
1338 | # 1 "../sysdeps/wordsize-32/bits/wordsize.h" 1 | |
1339 | # 29 "../sysdeps/generic/stdint.h" 2 | |
1340 | # 37 "../sysdeps/generic/stdint.h" | |
1341 | typedef signed char int8_t; | |
1342 | typedef short int int16_t; | |
1343 | typedef int int32_t; | |
1344 | ||
1345 | ||
1346 | ||
1347 | __extension__ | |
1348 | typedef long long int int64_t; | |
1349 | ||
1350 | ||
1351 | ||
1352 | ||
1353 | typedef unsigned char uint8_t; | |
1354 | typedef unsigned short int uint16_t; | |
1355 | ||
1356 | typedef unsigned int uint32_t; | |
1357 | ||
1358 | ||
1359 | ||
1360 | ||
1361 | ||
1362 | __extension__ | |
1363 | typedef unsigned long long int uint64_t; | |
1364 | ||
1365 | ||
1366 | ||
1367 | ||
1368 | ||
1369 | ||
1370 | typedef signed char int_least8_t; | |
1371 | typedef short int int_least16_t; | |
1372 | typedef int int_least32_t; | |
1373 | ||
1374 | ||
1375 | ||
1376 | __extension__ | |
1377 | typedef long long int int_least64_t; | |
1378 | ||
1379 | ||
1380 | ||
1381 | typedef unsigned char uint_least8_t; | |
1382 | typedef unsigned short int uint_least16_t; | |
1383 | typedef unsigned int uint_least32_t; | |
1384 | ||
1385 | ||
1386 | ||
1387 | __extension__ | |
1388 | typedef unsigned long long int uint_least64_t; | |
1389 | ||
1390 | ||
1391 | ||
1392 | ||
1393 | ||
1394 | ||
1395 | typedef signed char int_fast8_t; | |
1396 | ||
1397 | ||
1398 | ||
1399 | ||
1400 | ||
1401 | typedef int int_fast16_t; | |
1402 | typedef int int_fast32_t; | |
1403 | __extension__ | |
1404 | typedef long long int int_fast64_t; | |
1405 | ||
1406 | ||
1407 | ||
1408 | typedef unsigned char uint_fast8_t; | |
1409 | ||
1410 | ||
1411 | ||
1412 | ||
1413 | ||
1414 | typedef unsigned int uint_fast16_t; | |
1415 | typedef unsigned int uint_fast32_t; | |
1416 | __extension__ | |
1417 | typedef unsigned long long int uint_fast64_t; | |
1418 | # 126 "../sysdeps/generic/stdint.h" | |
1419 | typedef int intptr_t; | |
1420 | ||
1421 | ||
1422 | typedef unsigned int uintptr_t; | |
1423 | # 138 "../sysdeps/generic/stdint.h" | |
1424 | __extension__ | |
1425 | typedef long long int intmax_t; | |
1426 | __extension__ | |
1427 | typedef unsigned long long int uintmax_t; | |
1428 | # 29 "../locale/localeinfo.h" 2 | |
1429 | # 1 "../include/sys/types.h" 1 | |
1430 | # 1 "../posix/sys/types.h" 1 | |
1431 | # 29 "../posix/sys/types.h" | |
1432 | ||
1433 | ||
1434 | ||
1435 | ||
1436 | ||
1437 | ||
1438 | typedef __u_char u_char; | |
1439 | typedef __u_short u_short; | |
1440 | typedef __u_int u_int; | |
1441 | typedef __u_long u_long; | |
1442 | typedef __quad_t quad_t; | |
1443 | typedef __u_quad_t u_quad_t; | |
1444 | typedef __fsid_t fsid_t; | |
1445 | ||
1446 | ||
1447 | ||
1448 | ||
1449 | typedef __loff_t loff_t; | |
1450 | ||
1451 | ||
1452 | ||
1453 | typedef __ino_t ino_t; | |
1454 | ||
1455 | ||
1456 | ||
1457 | ||
1458 | ||
1459 | ||
1460 | typedef __ino64_t ino64_t; | |
1461 | ||
1462 | ||
1463 | ||
1464 | ||
1465 | typedef __dev_t dev_t; | |
1466 | ||
1467 | ||
1468 | ||
1469 | ||
1470 | typedef __gid_t gid_t; | |
1471 | ||
1472 | ||
1473 | ||
1474 | ||
1475 | typedef __mode_t mode_t; | |
1476 | ||
1477 | ||
1478 | ||
1479 | ||
1480 | typedef __nlink_t nlink_t; | |
1481 | ||
1482 | ||
1483 | ||
1484 | ||
1485 | typedef __uid_t uid_t; | |
1486 | ||
1487 | ||
1488 | ||
1489 | ||
1490 | ||
1491 | typedef __off_t off_t; | |
1492 | ||
1493 | ||
1494 | ||
1495 | ||
1496 | ||
1497 | ||
1498 | typedef __off64_t off64_t; | |
1499 | # 105 "../posix/sys/types.h" | |
1500 | typedef __id_t id_t; | |
1501 | ||
1502 | ||
1503 | ||
1504 | ||
1505 | typedef __ssize_t ssize_t; | |
1506 | ||
1507 | ||
1508 | ||
1509 | ||
1510 | ||
1511 | typedef __daddr_t daddr_t; | |
1512 | typedef __caddr_t caddr_t; | |
1513 | ||
1514 | ||
1515 | ||
1516 | ||
1517 | ||
1518 | typedef __key_t key_t; | |
1519 | # 137 "../posix/sys/types.h" | |
1520 | typedef __useconds_t useconds_t; | |
1521 | ||
1522 | ||
1523 | ||
1524 | typedef __suseconds_t suseconds_t; | |
1525 | ||
1526 | ||
1527 | ||
1528 | ||
1529 | ||
1530 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
1531 | # 148 "../posix/sys/types.h" 2 | |
1532 | ||
1533 | ||
1534 | ||
1535 | typedef unsigned long int ulong; | |
1536 | typedef unsigned short int ushort; | |
1537 | typedef unsigned int uint; | |
1538 | # 201 "../posix/sys/types.h" | |
1539 | typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); | |
1540 | typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); | |
1541 | typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); | |
1542 | typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); | |
1543 | ||
1544 | typedef int register_t __attribute__ ((__mode__ (__word__))); | |
1545 | # 217 "../posix/sys/types.h" | |
1546 | # 1 "../include/endian.h" 1 | |
1547 | # 1 "../string/endian.h" 1 | |
1548 | # 37 "../string/endian.h" | |
1549 | # 1 "../ports/sysdeps/hppa/bits/endian.h" 1 | |
1550 | # 38 "../string/endian.h" 2 | |
1551 | # 2 "../include/endian.h" 2 | |
1552 | # 218 "../posix/sys/types.h" 2 | |
1553 | ||
1554 | ||
1555 | # 1 "../include/sys/select.h" 1 | |
1556 | ||
1557 | # 1 "../misc/sys/select.h" 1 | |
1558 | # 31 "../misc/sys/select.h" | |
1559 | # 1 "../bits/select.h" 1 | |
1560 | # 32 "../misc/sys/select.h" 2 | |
1561 | ||
1562 | ||
1563 | # 1 "../sysdeps/unix/sysv/linux/bits/sigset.h" 1 | |
1564 | # 23 "../sysdeps/unix/sysv/linux/bits/sigset.h" | |
1565 | typedef int __sig_atomic_t; | |
1566 | ||
1567 | ||
1568 | ||
1569 | ||
1570 | typedef struct | |
1571 | { | |
1572 | unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; | |
1573 | } __sigset_t; | |
1574 | # 35 "../misc/sys/select.h" 2 | |
1575 | ||
1576 | ||
1577 | ||
1578 | typedef __sigset_t sigset_t; | |
1579 | ||
1580 | ||
1581 | ||
1582 | ||
1583 | ||
1584 | ||
1585 | ||
1586 | # 1 "../bits/time.h" 1 | |
1587 | # 69 "../bits/time.h" | |
1588 | struct timeval | |
1589 | { | |
1590 | __time_t tv_sec; | |
1591 | __suseconds_t tv_usec; | |
1592 | }; | |
1593 | # 47 "../misc/sys/select.h" 2 | |
1594 | # 55 "../misc/sys/select.h" | |
1595 | typedef long int __fd_mask; | |
1596 | # 67 "../misc/sys/select.h" | |
1597 | typedef struct | |
1598 | { | |
1599 | ||
1600 | ||
1601 | ||
1602 | __fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask))]; | |
1603 | ||
1604 | ||
1605 | ||
1606 | ||
1607 | ||
1608 | } fd_set; | |
1609 | ||
1610 | ||
1611 | ||
1612 | ||
1613 | ||
1614 | ||
1615 | typedef __fd_mask fd_mask; | |
1616 | # 99 "../misc/sys/select.h" | |
1617 | ||
1618 | # 109 "../misc/sys/select.h" | |
1619 | extern int select (int __nfds, fd_set *__restrict __readfds, | |
1620 | fd_set *__restrict __writefds, | |
1621 | fd_set *__restrict __exceptfds, | |
1622 | struct timeval *__restrict __timeout); | |
1623 | # 121 "../misc/sys/select.h" | |
1624 | extern int pselect (int __nfds, fd_set *__restrict __readfds, | |
1625 | fd_set *__restrict __writefds, | |
1626 | fd_set *__restrict __exceptfds, | |
1627 | const struct timespec *__restrict __timeout, | |
1628 | const __sigset_t *__restrict __sigmask); | |
1629 | ||
1630 | ||
1631 | ||
1632 | # 3 "../include/sys/select.h" 2 | |
1633 | ||
1634 | ||
1635 | extern int __pselect (int __nfds, fd_set *__readfds, | |
1636 | fd_set *__writefds, fd_set *__exceptfds, | |
1637 | const struct timespec *__timeout, | |
1638 | const __sigset_t *__sigmask); | |
1639 | ||
1640 | extern int __select (int __nfds, fd_set *__restrict __readfds, | |
1641 | fd_set *__restrict __writefds, | |
1642 | fd_set *__restrict __exceptfds, | |
1643 | struct timeval *__restrict __timeout); | |
1644 | ||
1645 | # 221 "../posix/sys/types.h" 2 | |
1646 | ||
1647 | ||
1648 | # 1 "../sysdeps/unix/sysv/linux/sys/sysmacros.h" 1 | |
1649 | # 29 "../sysdeps/unix/sysv/linux/sys/sysmacros.h" | |
1650 | __extension__ | |
1651 | extern __inline unsigned int gnu_dev_major (unsigned long long int __dev) | |
1652 | __attribute__ ((__nothrow__)); | |
1653 | __extension__ | |
1654 | extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev) | |
1655 | __attribute__ ((__nothrow__)); | |
1656 | __extension__ | |
1657 | extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major, | |
1658 | unsigned int __minor) | |
1659 | __attribute__ ((__nothrow__)); | |
1660 | ||
1661 | ||
1662 | __extension__ extern __inline unsigned int | |
1663 | __attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev) | |
1664 | { | |
1665 | return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); | |
1666 | } | |
1667 | ||
1668 | __extension__ extern __inline unsigned int | |
1669 | __attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev) | |
1670 | { | |
1671 | return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); | |
1672 | } | |
1673 | ||
1674 | __extension__ extern __inline unsigned long long int | |
1675 | __attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor) | |
1676 | { | |
1677 | return ((__minor & 0xff) | ((__major & 0xfff) << 8) | |
1678 | | (((unsigned long long int) (__minor & ~0xff)) << 12) | |
1679 | | (((unsigned long long int) (__major & ~0xfff)) << 32)); | |
1680 | } | |
1681 | # 224 "../posix/sys/types.h" 2 | |
1682 | ||
1683 | ||
1684 | ||
1685 | ||
1686 | typedef __blksize_t blksize_t; | |
1687 | ||
1688 | ||
1689 | ||
1690 | ||
1691 | ||
1692 | ||
1693 | typedef __blkcnt_t blkcnt_t; | |
1694 | ||
1695 | ||
1696 | ||
1697 | typedef __fsblkcnt_t fsblkcnt_t; | |
1698 | ||
1699 | ||
1700 | ||
1701 | typedef __fsfilcnt_t fsfilcnt_t; | |
1702 | # 262 "../posix/sys/types.h" | |
1703 | typedef __blkcnt64_t blkcnt64_t; | |
1704 | typedef __fsblkcnt64_t fsblkcnt64_t; | |
1705 | typedef __fsfilcnt64_t fsfilcnt64_t; | |
1706 | ||
1707 | ||
1708 | ||
1709 | ||
1710 | ||
1711 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h" 1 | |
1712 | # 48 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h" | |
1713 | typedef unsigned long int pthread_t; | |
1714 | # 60 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h" | |
1715 | typedef union | |
1716 | { | |
1717 | char __size[36]; | |
1718 | long int __align; | |
1719 | } pthread_attr_t; | |
1720 | ||
1721 | ||
1722 | typedef struct __pthread_internal_slist | |
1723 | { | |
1724 | struct __pthread_internal_slist *__next; | |
1725 | } __pthread_slist_t; | |
1726 | ||
1727 | ||
1728 | ||
1729 | ||
1730 | typedef union | |
1731 | { | |
1732 | struct __pthread_mutex_s | |
1733 | { | |
1734 | int __lock; | |
1735 | unsigned int __count; | |
1736 | int __owner; | |
1737 | ||
1738 | ||
1739 | int __kind; | |
1740 | unsigned int __nusers; | |
1741 | __extension__ union | |
1742 | { | |
1743 | int __spins; | |
1744 | __pthread_slist_t __list; | |
1745 | }; | |
1746 | } __data; | |
1747 | char __size[48]; | |
1748 | long int __align; | |
1749 | } pthread_mutex_t; | |
1750 | ||
1751 | typedef union | |
1752 | { | |
1753 | char __size[4]; | |
1754 | long int __align; | |
1755 | } pthread_mutexattr_t; | |
1756 | ||
1757 | ||
1758 | ||
1759 | ||
1760 | typedef union | |
1761 | { | |
1762 | struct | |
1763 | { | |
1764 | int __lock; | |
1765 | unsigned int __futex; | |
1766 | __extension__ unsigned long long int __total_seq; | |
1767 | __extension__ unsigned long long int __wakeup_seq; | |
1768 | __extension__ unsigned long long int __woken_seq; | |
1769 | void *__mutex; | |
1770 | unsigned int __nwaiters; | |
1771 | unsigned int __broadcast_seq; | |
1772 | } __data; | |
1773 | char __size[64]; | |
1774 | __extension__ long long int __align; | |
1775 | } pthread_cond_t; | |
1776 | ||
1777 | typedef union | |
1778 | { | |
1779 | char __size[4]; | |
1780 | long int __align; | |
1781 | } pthread_condattr_t; | |
1782 | ||
1783 | ||
1784 | ||
1785 | typedef unsigned int pthread_key_t; | |
1786 | ||
1787 | ||
1788 | ||
1789 | typedef int pthread_once_t; | |
1790 | ||
1791 | ||
1792 | ||
1793 | ||
1794 | ||
1795 | typedef union | |
1796 | { | |
1797 | struct | |
1798 | { | |
1799 | int __lock; | |
1800 | unsigned int __nr_readers; | |
1801 | unsigned int __readers_wakeup; | |
1802 | unsigned int __writer_wakeup; | |
1803 | unsigned int __nr_readers_queued; | |
1804 | unsigned int __nr_writers_queued; | |
1805 | ||
1806 | ||
1807 | unsigned int __flags; | |
1808 | int __writer; | |
1809 | } __data; | |
1810 | char __size[64]; | |
1811 | long int __align; | |
1812 | } pthread_rwlock_t; | |
1813 | ||
1814 | typedef union | |
1815 | { | |
1816 | char __size[8]; | |
1817 | long int __align; | |
1818 | } pthread_rwlockattr_t; | |
1819 | ||
1820 | ||
1821 | ||
1822 | ||
1823 | ||
1824 | typedef volatile int pthread_spinlock_t; | |
1825 | ||
1826 | ||
1827 | ||
1828 | ||
1829 | typedef union | |
1830 | { | |
1831 | char __size[48]; | |
1832 | long int __align; | |
1833 | } pthread_barrier_t; | |
1834 | ||
1835 | typedef union | |
1836 | { | |
1837 | char __size[4]; | |
1838 | int __align; | |
1839 | } pthread_barrierattr_t; | |
1840 | # 271 "../posix/sys/types.h" 2 | |
1841 | ||
1842 | ||
1843 | ||
1844 | # 1 "../include/sys/types.h" 2 | |
1845 | # 30 "../locale/localeinfo.h" 2 | |
1846 | ||
1847 | # 1 "../intl/loadinfo.h" 1 | |
1848 | # 60 "../intl/loadinfo.h" | |
1849 | struct loaded_l10nfile | |
1850 | { | |
1851 | const char *filename; | |
1852 | int decided; | |
1853 | ||
1854 | const void *data; | |
1855 | ||
1856 | struct loaded_l10nfile *next; | |
1857 | struct loaded_l10nfile *successor[1]; | |
1858 | }; | |
1859 | ||
1860 | ||
1861 | ||
1862 | ||
1863 | ||
1864 | ||
1865 | extern const char *_nl_normalize_codeset (const char *codeset, size_t name_len); | |
1866 | ||
1867 | ||
1868 | extern struct loaded_l10nfile * | |
1869 | _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list, const char *dirlist, size_t dirlist_len, int mask, const char *language, const char *territory, const char *codeset, const char *normalized_codeset, const char *modifier, const char *filename, int do_allocate); | |
1870 | # 89 "../intl/loadinfo.h" | |
1871 | extern const char *_nl_expand_alias (const char *name); | |
1872 | ||
1873 | ||
1874 | ||
1875 | extern int _nl_explode_name (char *name, const char **language, const char **modifier, const char **territory, const char **codeset, const char **normalized_codeset); | |
1876 | # 32 "../locale/localeinfo.h" 2 | |
1877 | # 48 "../locale/localeinfo.h" | |
1878 | struct locale_data | |
1879 | { | |
1880 | const char *name; | |
1881 | const char *filedata; | |
1882 | off_t filesize; | |
1883 | enum | |
1884 | { | |
1885 | ld_malloced, | |
1886 | ld_mapped, | |
1887 | ld_archive | |
1888 | } alloc; | |
1889 | ||
1890 | ||
1891 | ||
1892 | ||
1893 | struct | |
1894 | { | |
1895 | void (*cleanup) (struct locale_data *) ; | |
1896 | union | |
1897 | { | |
1898 | void *data; | |
1899 | struct lc_time_data *time; | |
1900 | const struct gconv_fcts *ctype; | |
1901 | }; | |
1902 | } private; | |
1903 | ||
1904 | unsigned int usage_count; | |
1905 | ||
1906 | int use_translit; | |
1907 | ||
1908 | ||
1909 | unsigned int nstrings; | |
1910 | union locale_data_value | |
1911 | { | |
1912 | const uint32_t *wstr; | |
1913 | const char *string; | |
1914 | unsigned int word; | |
1915 | } | |
1916 | values []; | |
1917 | }; | |
1918 | ||
1919 | ||
1920 | enum coll_sort_rule | |
1921 | { | |
1922 | illegal_0__, | |
1923 | sort_forward, | |
1924 | sort_backward, | |
1925 | illegal_3__, | |
1926 | sort_position, | |
1927 | sort_forward_position, | |
1928 | sort_backward_position, | |
1929 | sort_mask | |
1930 | }; | |
1931 | ||
1932 | ||
1933 | enum value_type | |
1934 | { | |
1935 | none, | |
1936 | string, | |
1937 | stringarray, | |
1938 | byte, | |
1939 | bytearray, | |
1940 | word, | |
1941 | stringlist, | |
1942 | wordarray, | |
1943 | wstring, | |
1944 | wstringarray, | |
1945 | wstringlist | |
1946 | }; | |
1947 | # 128 "../locale/localeinfo.h" | |
1948 | struct era_entry | |
1949 | { | |
1950 | uint32_t direction; | |
1951 | int32_t offset; | |
1952 | int32_t start_date[3]; | |
1953 | int32_t stop_date[3]; | |
1954 | const char *era_name; | |
1955 | const char *era_format; | |
1956 | const wchar_t *era_wname; | |
1957 | const wchar_t *era_wformat; | |
1958 | int absolute_direction; | |
1959 | ||
1960 | ||
1961 | ||
1962 | }; | |
1963 | ||
1964 | ||
1965 | ||
1966 | struct lc_time_data | |
1967 | { | |
1968 | struct era_entry *eras; | |
1969 | size_t num_eras; | |
1970 | int era_initialized; | |
1971 | ||
1972 | const char **alt_digits; | |
1973 | const wchar_t **walt_digits; | |
1974 | int alt_digits_initialized; | |
1975 | int walt_digits_initialized; | |
1976 | }; | |
1977 | ||
1978 | ||
1979 | ||
1980 | ||
1981 | enum | |
1982 | { | |
1983 | __TOW_toupper = 0, | |
1984 | __TOW_tolower = 1 | |
1985 | }; | |
1986 | # 178 "../locale/localeinfo.h" | |
1987 | extern const union catnamestr_t | |
1988 | { | |
1989 | struct | |
1990 | { | |
1991 | ||
1992 | ||
1993 | # 1 "../locale/categories.def" 1 | |
1994 | # 42 "../locale/categories.def" | |
1995 | char str62[sizeof ("LC_COLLATE")]; | |
1996 | # 68 "../locale/categories.def" | |
1997 | char str137[sizeof ("LC_CTYPE")]; | |
1998 | # 140 "../locale/categories.def" | |
1999 | char str189[sizeof ("LC_MONETARY")]; | |
2000 | # 192 "../locale/categories.def" | |
2001 | char str203[sizeof ("LC_NUMERIC")]; | |
2002 | # 206 "../locale/categories.def" | |
2003 | char str251[sizeof ("LC_TIME")]; | |
2004 | # 254 "../locale/categories.def" | |
2005 | char str263[sizeof ("LC_MESSAGES")]; | |
2006 | # 265 "../locale/categories.def" | |
2007 | char str272[sizeof ("LC_PAPER")]; | |
2008 | # 274 "../locale/categories.def" | |
2009 | char str285[sizeof ("LC_NAME")]; | |
2010 | # 287 "../locale/categories.def" | |
2011 | char str304[sizeof ("LC_ADDRESS")]; | |
2012 | # 306 "../locale/categories.def" | |
2013 | char str315[sizeof ("LC_TELEPHONE")]; | |
2014 | # 317 "../locale/categories.def" | |
2015 | char str323[sizeof ("LC_MEASUREMENT")]; | |
2016 | ||
2017 | ||
2018 | ||
2019 | ||
2020 | ||
2021 | ||
2022 | ||
2023 | char str345[sizeof ("LC_IDENTIFICATION")]; | |
2024 | # 185 "../locale/localeinfo.h" 2 | |
2025 | ||
2026 | }; | |
2027 | char str[0]; | |
2028 | } _nl_category_names ; | |
2029 | const uint8_t _nl_category_name_idxs[13] ; | |
2030 | extern const uint8_t _nl_category_name_sizes[13] ; | |
2031 | ||
2032 | ||
2033 | extern const char _nl_C_name[] ; | |
2034 | extern const char _nl_POSIX_name[] ; | |
2035 | ||
2036 | ||
2037 | extern const char _nl_C_codeset[] ; | |
2038 | ||
2039 | ||
2040 | ||
2041 | ||
2042 | extern struct __locale_struct _nl_global_locale ; | |
2043 | ||
2044 | ||
2045 | ||
2046 | ||
2047 | # 1 "../bits/libc-tsd.h" 1 | |
2048 | # 45 "../bits/libc-tsd.h" | |
2049 | # 1 "../include/tls.h" 1 | |
2050 | ||
2051 | ||
2052 | ||
2053 | ||
2054 | ||
2055 | # 1 "../ports/sysdeps/hppa/nptl/tls.h" 1 | |
2056 | # 23 "../ports/sysdeps/hppa/nptl/tls.h" | |
2057 | # 1 "../sysdeps/unix/sysv/linux/dl-sysdep.h" 1 | |
2058 | # 20 "../sysdeps/unix/sysv/linux/dl-sysdep.h" | |
2059 | # 1 "../sysdeps/generic/dl-sysdep.h" 1 | |
2060 | # 21 "../sysdeps/unix/sysv/linux/dl-sysdep.h" 2 | |
2061 | # 24 "../ports/sysdeps/hppa/nptl/tls.h" 2 | |
2062 | ||
2063 | ||
2064 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stdbool.h" 1 3 4 | |
2065 | # 27 "../ports/sysdeps/hppa/nptl/tls.h" 2 | |
2066 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
2067 | # 28 "../ports/sysdeps/hppa/nptl/tls.h" 2 | |
2068 | ||
2069 | ||
2070 | ||
2071 | typedef union dtv | |
2072 | { | |
2073 | size_t counter; | |
2074 | struct | |
2075 | { | |
2076 | void *val; | |
2077 | _Bool is_static; | |
2078 | } pointer; | |
2079 | } dtv_t; | |
2080 | # 57 "../ports/sysdeps/hppa/nptl/tls.h" | |
2081 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" 1 | |
2082 | # 22 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" | |
2083 | # 1 "/usr/include/asm/unistd.h" 1 3 4 | |
2084 | # 23 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" 2 | |
2085 | # 1 "../sysdeps/generic/sysdep.h" 1 | |
2086 | # 24 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" 2 | |
2087 | # 1 "../sysdeps/unix/sysv/linux/sys/syscall.h" 1 | |
2088 | # 25 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" 2 | |
2089 | # 58 "../ports/sysdeps/hppa/nptl/tls.h" 2 | |
2090 | ||
2091 | ||
2092 | ||
2093 | ||
2094 | ||
2095 | # 1 "../nptl/descr.h" 1 | |
2096 | # 23 "../nptl/descr.h" | |
2097 | # 1 "../include/limits.h" 1 | |
2098 | # 145 "../include/limits.h" | |
2099 | # 1 "../include/bits/posix1_lim.h" 1 | |
2100 | # 146 "../include/limits.h" 2 | |
2101 | ||
2102 | ||
2103 | ||
2104 | # 1 "../include/bits/posix2_lim.h" 1 | |
2105 | # 150 "../include/limits.h" 2 | |
2106 | # 24 "../nptl/descr.h" 2 | |
2107 | # 1 "../include/sched.h" 1 | |
2108 | ||
2109 | # 1 "../posix/sched.h" 1 | |
2110 | # 32 "../posix/sched.h" | |
2111 | # 1 "../sysdeps/unix/sysv/linux/bits/sched.h" 1 | |
2112 | # 65 "../sysdeps/unix/sysv/linux/bits/sched.h" | |
2113 | struct sched_param | |
2114 | { | |
2115 | int __sched_priority; | |
2116 | }; | |
2117 | ||
2118 | ||
2119 | ||
2120 | ||
2121 | ||
2122 | extern int clone (int (*__fn) (void *__arg), void *__child_stack, | |
2123 | int __flags, void *__arg, ...) __attribute__ ((__nothrow__)); | |
2124 | ||
2125 | ||
2126 | extern int unshare (int __flags) __attribute__ ((__nothrow__)); | |
2127 | ||
2128 | ||
2129 | ||
2130 | ||
2131 | ||
2132 | ||
2133 | ||
2134 | ||
2135 | ||
2136 | ||
2137 | struct __sched_param | |
2138 | { | |
2139 | int __sched_priority; | |
2140 | }; | |
2141 | # 104 "../sysdeps/unix/sysv/linux/bits/sched.h" | |
2142 | typedef unsigned long int __cpu_mask; | |
2143 | ||
2144 | ||
2145 | ||
2146 | ||
2147 | ||
2148 | ||
2149 | typedef struct | |
2150 | { | |
2151 | __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))]; | |
2152 | } cpu_set_t; | |
2153 | # 33 "../posix/sched.h" 2 | |
2154 | ||
2155 | ||
2156 | ||
2157 | ||
2158 | ||
2159 | ||
2160 | ||
2161 | extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param) | |
2162 | __attribute__ ((__nothrow__)); | |
2163 | ||
2164 | ||
2165 | extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__)); | |
2166 | ||
2167 | ||
2168 | extern int sched_setscheduler (__pid_t __pid, int __policy, | |
2169 | __const struct sched_param *__param) __attribute__ ((__nothrow__)); | |
2170 | ||
2171 | ||
2172 | extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__)); | |
2173 | ||
2174 | ||
2175 | extern int sched_yield (void) __attribute__ ((__nothrow__)); | |
2176 | ||
2177 | ||
2178 | extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__)); | |
2179 | ||
2180 | ||
2181 | extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__)); | |
2182 | ||
2183 | ||
2184 | extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__)); | |
2185 | # 76 "../posix/sched.h" | |
2186 | extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize, | |
2187 | __const cpu_set_t *__cpuset) __attribute__ ((__nothrow__)); | |
2188 | ||
2189 | ||
2190 | extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize, | |
2191 | cpu_set_t *__cpuset) __attribute__ ((__nothrow__)); | |
2192 | ||
2193 | ||
2194 | ||
2195 | # 3 "../include/sched.h" 2 | |
2196 | ||
2197 | ||
2198 | extern int __sched_setparam (__pid_t __pid, | |
2199 | __const struct sched_param *__param); | |
2200 | extern int __sched_getparam (__pid_t __pid, struct sched_param *__param); | |
2201 | extern int __sched_setscheduler (__pid_t __pid, int __policy, | |
2202 | __const struct sched_param *__param); | |
2203 | ||
2204 | extern int __sched_getscheduler (__pid_t __pid); | |
2205 | extern int __sched_yield (void); | |
2206 | ||
2207 | extern int __sched_get_priority_max (int __algorithm); | |
2208 | extern int __sched_get_priority_min (int __algorithm); | |
2209 | extern int __sched_rr_get_interval (__pid_t __pid, struct timespec *__t); | |
2210 | ||
2211 | ||
2212 | extern int __clone (int (*__fn) (void *__arg), void *__child_stack, | |
2213 | int __flags, void *__arg, ...); | |
2214 | extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base, | |
2215 | size_t __child_stack_size, int __flags, void *__arg, ...); | |
2216 | # 25 "../nptl/descr.h" 2 | |
2217 | # 1 "../include/setjmp.h" 1 | |
2218 | ||
2219 | # 1 "../setjmp/setjmp.h" 1 | |
2220 | # 28 "../setjmp/setjmp.h" | |
2221 | ||
2222 | ||
2223 | # 1 "../ports/sysdeps/hppa/bits/setjmp.h" 1 | |
2224 | # 33 "../ports/sysdeps/hppa/bits/setjmp.h" | |
2225 | typedef double __jmp_buf[21]; | |
2226 | # 31 "../setjmp/setjmp.h" 2 | |
2227 | # 1 "../sysdeps/unix/sysv/linux/bits/sigset.h" 1 | |
2228 | # 32 "../setjmp/setjmp.h" 2 | |
2229 | ||
2230 | ||
2231 | ||
2232 | ||
2233 | typedef struct __jmp_buf_tag | |
2234 | { | |
2235 | ||
2236 | ||
2237 | ||
2238 | ||
2239 | __jmp_buf __jmpbuf; | |
2240 | int __mask_was_saved; | |
2241 | __sigset_t __saved_mask; | |
2242 | } jmp_buf[1]; | |
2243 | ||
2244 | ||
2245 | ||
2246 | ||
2247 | extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__)); | |
2248 | ||
2249 | ||
2250 | ||
2251 | ||
2252 | ||
2253 | ||
2254 | ||
2255 | extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__)); | |
2256 | ||
2257 | ||
2258 | ||
2259 | ||
2260 | extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__)); | |
2261 | # 76 "../setjmp/setjmp.h" | |
2262 | ||
2263 | ||
2264 | ||
2265 | ||
2266 | extern void longjmp (struct __jmp_buf_tag __env[1], int __val) | |
2267 | __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
2268 | ||
2269 | ||
2270 | ||
2271 | ||
2272 | ||
2273 | ||
2274 | ||
2275 | extern void _longjmp (struct __jmp_buf_tag __env[1], int __val) | |
2276 | __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
2277 | ||
2278 | ||
2279 | ||
2280 | ||
2281 | ||
2282 | ||
2283 | ||
2284 | typedef struct __jmp_buf_tag sigjmp_buf[1]; | |
2285 | # 108 "../setjmp/setjmp.h" | |
2286 | extern void siglongjmp (sigjmp_buf __env, int __val) | |
2287 | __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
2288 | ||
2289 | ||
2290 | ||
2291 | # 3 "../include/setjmp.h" 2 | |
2292 | ||
2293 | ||
2294 | ||
2295 | ||
2296 | extern void __longjmp (__jmp_buf __env, int __val) | |
2297 | __attribute__ ((__noreturn__)); | |
2298 | ||
2299 | ||
2300 | ||
2301 | ||
2302 | ||
2303 | extern int __sigjmp_save (jmp_buf __env, int __savemask); | |
2304 | ||
2305 | extern void _longjmp_unwind (jmp_buf env, int val); | |
2306 | ||
2307 | extern void __libc_siglongjmp (sigjmp_buf env, int val) | |
2308 | __attribute__ ((noreturn)); | |
2309 | extern void __libc_longjmp (sigjmp_buf env, int val) | |
2310 | __attribute__ ((noreturn)); | |
2311 | ||
2312 | ||
2313 | ||
2314 | ||
2315 | # 26 "../nptl/descr.h" 2 | |
2316 | ||
2317 | # 1 "../include/sys/types.h" 1 | |
2318 | # 28 "../nptl/descr.h" 2 | |
2319 | # 1 "../sysdeps/generic/hp-timing.h" 1 | |
2320 | # 71 "../sysdeps/generic/hp-timing.h" | |
2321 | typedef int hp_timing_t; | |
2322 | # 29 "../nptl/descr.h" 2 | |
2323 | # 1 "../nptl/sysdeps/pthread/list.h" 1 | |
2324 | # 29 "../nptl/sysdeps/pthread/list.h" | |
2325 | typedef struct list_head | |
2326 | { | |
2327 | struct list_head *next; | |
2328 | struct list_head *prev; | |
2329 | } list_t; | |
2330 | # 46 "../nptl/sysdeps/pthread/list.h" | |
2331 | static inline void | |
2332 | list_add (list_t *newp, list_t *head) | |
2333 | { | |
2334 | head->next->prev = newp; | |
2335 | newp->next = head->next; | |
2336 | newp->prev = head; | |
2337 | head->next = newp; | |
2338 | } | |
2339 | ||
2340 | ||
2341 | ||
2342 | static inline void | |
2343 | list_add_tail (list_t *newp, list_t *head) | |
2344 | { | |
2345 | head->prev->next = newp; | |
2346 | newp->next = head; | |
2347 | newp->prev = head->prev; | |
2348 | head->prev = newp; | |
2349 | } | |
2350 | ||
2351 | ||
2352 | ||
2353 | static inline void | |
2354 | list_del (list_t *elem) | |
2355 | { | |
2356 | elem->next->prev = elem->prev; | |
2357 | elem->prev->next = elem->next; | |
2358 | } | |
2359 | ||
2360 | ||
2361 | ||
2362 | static inline void | |
2363 | list_splice (list_t *add, list_t *head) | |
2364 | { | |
2365 | ||
2366 | if (add != add->next) | |
2367 | { | |
2368 | add->next->prev = head; | |
2369 | add->prev->next = head->next; | |
2370 | head->next->prev = add->prev; | |
2371 | head->next = add->next; | |
2372 | } | |
2373 | } | |
2374 | # 30 "../nptl/descr.h" 2 | |
2375 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h" 1 | |
2376 | # 23 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h" | |
2377 | # 1 "../sysdeps/unix/sysv/linux/sys/param.h" 1 | |
2378 | # 22 "../sysdeps/unix/sysv/linux/sys/param.h" | |
2379 | # 1 "../include/limits.h" 1 | |
2380 | # 145 "../include/limits.h" | |
2381 | # 1 "../include/bits/posix1_lim.h" 1 | |
2382 | # 146 "../include/limits.h" 2 | |
2383 | ||
2384 | ||
2385 | ||
2386 | # 1 "../include/bits/posix2_lim.h" 1 | |
2387 | # 150 "../include/limits.h" 2 | |
2388 | # 23 "../sysdeps/unix/sysv/linux/sys/param.h" 2 | |
2389 | ||
2390 | # 1 "/usr/include/linux/param.h" 1 3 4 | |
2391 | ||
2392 | ||
2393 | ||
2394 | # 1 "/usr/include/asm/param.h" 1 3 4 | |
2395 | # 5 "/usr/include/linux/param.h" 2 3 4 | |
2396 | # 25 "../sysdeps/unix/sysv/linux/sys/param.h" 2 | |
2397 | # 42 "../sysdeps/unix/sysv/linux/sys/param.h" | |
2398 | # 1 "../include/sys/types.h" 1 | |
2399 | # 43 "../sysdeps/unix/sysv/linux/sys/param.h" 2 | |
2400 | # 24 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h" 2 | |
2401 | ||
2402 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" 1 | |
2403 | # 23 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" | |
2404 | # 1 "../sysdeps/generic/sysdep.h" 1 | |
2405 | # 24 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" 2 | |
2406 | # 26 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h" 2 | |
2407 | # 1 "../include/atomic.h" 1 | |
2408 | # 49 "../include/atomic.h" | |
2409 | # 1 "../include/stdlib.h" 1 | |
2410 | ||
2411 | ||
2412 | ||
2413 | ||
2414 | ||
2415 | ||
2416 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
2417 | # 8 "../include/stdlib.h" 2 | |
2418 | # 1 "../stdlib/stdlib.h" 1 | |
2419 | # 33 "../stdlib/stdlib.h" | |
2420 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
2421 | # 34 "../stdlib/stdlib.h" 2 | |
2422 | ||
2423 | ||
2424 | ||
2425 | ||
2426 | ||
2427 | ||
2428 | ||
2429 | ||
2430 | # 1 "../sysdeps/unix/sysv/linux/bits/waitflags.h" 1 | |
2431 | # 43 "../stdlib/stdlib.h" 2 | |
2432 | # 1 "../bits/waitstatus.h" 1 | |
2433 | # 65 "../bits/waitstatus.h" | |
2434 | # 1 "../include/endian.h" 1 | |
2435 | # 66 "../bits/waitstatus.h" 2 | |
2436 | ||
2437 | union wait | |
2438 | { | |
2439 | int w_status; | |
2440 | struct | |
2441 | { | |
2442 | ||
2443 | ||
2444 | ||
2445 | ||
2446 | ||
2447 | ||
2448 | ||
2449 | unsigned int:16; | |
2450 | unsigned int __w_retcode:8; | |
2451 | unsigned int __w_coredump:1; | |
2452 | unsigned int __w_termsig:7; | |
2453 | ||
2454 | } __wait_terminated; | |
2455 | struct | |
2456 | { | |
2457 | ||
2458 | ||
2459 | ||
2460 | ||
2461 | ||
2462 | ||
2463 | unsigned int:16; | |
2464 | unsigned int __w_stopsig:8; | |
2465 | unsigned int __w_stopval:8; | |
2466 | ||
2467 | } __wait_stopped; | |
2468 | }; | |
2469 | # 44 "../stdlib/stdlib.h" 2 | |
2470 | # 68 "../stdlib/stdlib.h" | |
2471 | typedef union | |
2472 | { | |
2473 | union wait *__uptr; | |
2474 | int *__iptr; | |
2475 | } __WAIT_STATUS __attribute__ ((__transparent_union__)); | |
2476 | # 96 "../stdlib/stdlib.h" | |
2477 | ||
2478 | ||
2479 | typedef struct | |
2480 | { | |
2481 | int quot; | |
2482 | int rem; | |
2483 | } div_t; | |
2484 | ||
2485 | ||
2486 | ||
2487 | typedef struct | |
2488 | { | |
2489 | long int quot; | |
2490 | long int rem; | |
2491 | } ldiv_t; | |
2492 | ||
2493 | ||
2494 | ||
2495 | ||
2496 | ||
2497 | ||
2498 | ||
2499 | __extension__ typedef struct | |
2500 | { | |
2501 | long long int quot; | |
2502 | long long int rem; | |
2503 | } lldiv_t; | |
2504 | ||
2505 | ||
2506 | # 140 "../stdlib/stdlib.h" | |
2507 | extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) ; | |
2508 | ||
2509 | ||
2510 | ||
2511 | ||
2512 | extern double atof (__const char *__nptr) | |
2513 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
2514 | ||
2515 | extern int atoi (__const char *__nptr) | |
2516 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
2517 | ||
2518 | extern long int atol (__const char *__nptr) | |
2519 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
2520 | ||
2521 | ||
2522 | ||
2523 | ||
2524 | ||
2525 | __extension__ extern long long int atoll (__const char *__nptr) | |
2526 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
2527 | ||
2528 | ||
2529 | ||
2530 | ||
2531 | ||
2532 | extern double strtod (__const char *__restrict __nptr, | |
2533 | char **__restrict __endptr) | |
2534 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2535 | ||
2536 | ||
2537 | ||
2538 | ||
2539 | ||
2540 | extern float strtof (__const char *__restrict __nptr, | |
2541 | char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2542 | ||
2543 | extern long double strtold (__const char *__restrict __nptr, | |
2544 | char **__restrict __endptr) | |
2545 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2546 | ||
2547 | ||
2548 | ||
2549 | ||
2550 | ||
2551 | extern long int strtol (__const char *__restrict __nptr, | |
2552 | char **__restrict __endptr, int __base) | |
2553 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2554 | ||
2555 | extern unsigned long int strtoul (__const char *__restrict __nptr, | |
2556 | char **__restrict __endptr, int __base) | |
2557 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2558 | ||
2559 | ||
2560 | ||
2561 | ||
2562 | __extension__ | |
2563 | extern long long int strtoq (__const char *__restrict __nptr, | |
2564 | char **__restrict __endptr, int __base) | |
2565 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2566 | ||
2567 | __extension__ | |
2568 | extern unsigned long long int strtouq (__const char *__restrict __nptr, | |
2569 | char **__restrict __endptr, int __base) | |
2570 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2571 | ||
2572 | ||
2573 | ||
2574 | ||
2575 | ||
2576 | __extension__ | |
2577 | extern long long int strtoll (__const char *__restrict __nptr, | |
2578 | char **__restrict __endptr, int __base) | |
2579 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2580 | ||
2581 | __extension__ | |
2582 | extern unsigned long long int strtoull (__const char *__restrict __nptr, | |
2583 | char **__restrict __endptr, int __base) | |
2584 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2585 | ||
2586 | # 236 "../stdlib/stdlib.h" | |
2587 | # 1 "../include/xlocale.h" 1 | |
2588 | # 237 "../stdlib/stdlib.h" 2 | |
2589 | ||
2590 | ||
2591 | ||
2592 | extern long int strtol_l (__const char *__restrict __nptr, | |
2593 | char **__restrict __endptr, int __base, | |
2594 | __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) ; | |
2595 | ||
2596 | extern unsigned long int strtoul_l (__const char *__restrict __nptr, | |
2597 | char **__restrict __endptr, | |
2598 | int __base, __locale_t __loc) | |
2599 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) ; | |
2600 | ||
2601 | __extension__ | |
2602 | extern long long int strtoll_l (__const char *__restrict __nptr, | |
2603 | char **__restrict __endptr, int __base, | |
2604 | __locale_t __loc) | |
2605 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) ; | |
2606 | ||
2607 | __extension__ | |
2608 | extern unsigned long long int strtoull_l (__const char *__restrict __nptr, | |
2609 | char **__restrict __endptr, | |
2610 | int __base, __locale_t __loc) | |
2611 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) ; | |
2612 | ||
2613 | extern double strtod_l (__const char *__restrict __nptr, | |
2614 | char **__restrict __endptr, __locale_t __loc) | |
2615 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) ; | |
2616 | ||
2617 | extern float strtof_l (__const char *__restrict __nptr, | |
2618 | char **__restrict __endptr, __locale_t __loc) | |
2619 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) ; | |
2620 | ||
2621 | extern long double strtold_l (__const char *__restrict __nptr, | |
2622 | char **__restrict __endptr, | |
2623 | __locale_t __loc) | |
2624 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) ; | |
2625 | ||
2626 | ||
2627 | ||
2628 | ||
2629 | ||
2630 | ||
2631 | extern double __strtod_internal (__const char *__restrict __nptr, | |
2632 | char **__restrict __endptr, int __group) | |
2633 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2634 | extern float __strtof_internal (__const char *__restrict __nptr, | |
2635 | char **__restrict __endptr, int __group) | |
2636 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2637 | extern long double __strtold_internal (__const char *__restrict __nptr, | |
2638 | char **__restrict __endptr, | |
2639 | int __group) | |
2640 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2641 | ||
2642 | extern long int __strtol_internal (__const char *__restrict __nptr, | |
2643 | char **__restrict __endptr, | |
2644 | int __base, int __group) | |
2645 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2646 | ||
2647 | ||
2648 | ||
2649 | extern unsigned long int __strtoul_internal (__const char *__restrict __nptr, | |
2650 | char **__restrict __endptr, | |
2651 | int __base, int __group) | |
2652 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2653 | ||
2654 | ||
2655 | ||
2656 | ||
2657 | __extension__ | |
2658 | extern long long int __strtoll_internal (__const char *__restrict __nptr, | |
2659 | char **__restrict __endptr, | |
2660 | int __base, int __group) | |
2661 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2662 | ||
2663 | ||
2664 | ||
2665 | __extension__ | |
2666 | extern unsigned long long int __strtoull_internal (__const char * | |
2667 | __restrict __nptr, | |
2668 | char **__restrict __endptr, | |
2669 | int __base, int __group) | |
2670 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
2671 | ||
2672 | ||
2673 | ||
2674 | ||
2675 | ||
2676 | ||
2677 | ||
2678 | ||
2679 | extern __inline double | |
2680 | __attribute__ ((__nothrow__)) strtod (__const char *__restrict __nptr, char **__restrict __endptr) | |
2681 | { | |
2682 | return __strtod_internal (__nptr, __endptr, 0); | |
2683 | } | |
2684 | extern __inline long int | |
2685 | __attribute__ ((__nothrow__)) strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
2686 | ||
2687 | { | |
2688 | return __strtol_internal (__nptr, __endptr, __base, 0); | |
2689 | } | |
2690 | extern __inline unsigned long int | |
2691 | __attribute__ ((__nothrow__)) strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
2692 | ||
2693 | { | |
2694 | return __strtoul_internal (__nptr, __endptr, __base, 0); | |
2695 | } | |
2696 | ||
2697 | ||
2698 | ||
2699 | ||
2700 | extern __inline float | |
2701 | __attribute__ ((__nothrow__)) strtof (__const char *__restrict __nptr, char **__restrict __endptr) | |
2702 | { | |
2703 | return __strtof_internal (__nptr, __endptr, 0); | |
2704 | } | |
2705 | ||
2706 | extern __inline long double | |
2707 | __attribute__ ((__nothrow__)) strtold (__const char *__restrict __nptr, char **__restrict __endptr) | |
2708 | { | |
2709 | return __strtold_internal (__nptr, __endptr, 0); | |
2710 | } | |
2711 | ||
2712 | ||
2713 | ||
2714 | ||
2715 | ||
2716 | __extension__ extern __inline long long int | |
2717 | __attribute__ ((__nothrow__)) strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
2718 | ||
2719 | { | |
2720 | return __strtoll_internal (__nptr, __endptr, __base, 0); | |
2721 | } | |
2722 | __extension__ extern __inline unsigned long long int | |
2723 | __attribute__ ((__nothrow__)) strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
2724 | ||
2725 | { | |
2726 | return __strtoull_internal (__nptr, __endptr, __base, 0); | |
2727 | } | |
2728 | ||
2729 | ||
2730 | ||
2731 | ||
2732 | __extension__ extern __inline long long int | |
2733 | __attribute__ ((__nothrow__)) strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
2734 | ||
2735 | { | |
2736 | return __strtoll_internal (__nptr, __endptr, __base, 0); | |
2737 | } | |
2738 | __extension__ extern __inline unsigned long long int | |
2739 | __attribute__ ((__nothrow__)) strtoull (__const char * __restrict __nptr, char **__restrict __endptr, int __base) | |
2740 | ||
2741 | { | |
2742 | return __strtoull_internal (__nptr, __endptr, __base, 0); | |
2743 | } | |
2744 | ||
2745 | ||
2746 | ||
2747 | ||
2748 | extern __inline double | |
2749 | __attribute__ ((__nothrow__)) atof (__const char *__nptr) | |
2750 | { | |
2751 | return strtod (__nptr, (char **) ((void *)0)); | |
2752 | } | |
2753 | extern __inline int | |
2754 | __attribute__ ((__nothrow__)) atoi (__const char *__nptr) | |
2755 | { | |
2756 | return (int) strtol (__nptr, (char **) ((void *)0), 10); | |
2757 | } | |
2758 | extern __inline long int | |
2759 | __attribute__ ((__nothrow__)) atol (__const char *__nptr) | |
2760 | { | |
2761 | return strtol (__nptr, (char **) ((void *)0), 10); | |
2762 | } | |
2763 | ||
2764 | ||
2765 | ||
2766 | ||
2767 | __extension__ extern __inline long long int | |
2768 | __attribute__ ((__nothrow__)) atoll (__const char *__nptr) | |
2769 | { | |
2770 | return strtoll (__nptr, (char **) ((void *)0), 10); | |
2771 | } | |
2772 | ||
2773 | # 429 "../stdlib/stdlib.h" | |
2774 | extern char *l64a (long int __n) __attribute__ ((__nothrow__)) ; | |
2775 | ||
2776 | ||
2777 | extern long int a64l (__const char *__s) | |
2778 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
2779 | ||
2780 | ||
2781 | ||
2782 | ||
2783 | # 1 "../include/sys/types.h" 1 | |
2784 | # 439 "../stdlib/stdlib.h" 2 | |
2785 | ||
2786 | ||
2787 | ||
2788 | ||
2789 | ||
2790 | ||
2791 | extern long int random (void) __attribute__ ((__nothrow__)); | |
2792 | ||
2793 | ||
2794 | extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__)); | |
2795 | ||
2796 | ||
2797 | ||
2798 | ||
2799 | ||
2800 | extern char *initstate (unsigned int __seed, char *__statebuf, | |
2801 | size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
2802 | ||
2803 | ||
2804 | ||
2805 | extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
2806 | ||
2807 | ||
2808 | ||
2809 | ||
2810 | ||
2811 | ||
2812 | ||
2813 | struct random_data | |
2814 | { | |
2815 | int32_t *fptr; | |
2816 | int32_t *rptr; | |
2817 | int32_t *state; | |
2818 | int rand_type; | |
2819 | int rand_deg; | |
2820 | int rand_sep; | |
2821 | int32_t *end_ptr; | |
2822 | }; | |
2823 | ||
2824 | extern int random_r (struct random_data *__restrict __buf, | |
2825 | int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
2826 | ||
2827 | extern int srandom_r (unsigned int __seed, struct random_data *__buf) | |
2828 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
2829 | ||
2830 | extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, | |
2831 | size_t __statelen, | |
2832 | struct random_data *__restrict __buf) | |
2833 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); | |
2834 | ||
2835 | extern int setstate_r (char *__restrict __statebuf, | |
2836 | struct random_data *__restrict __buf) | |
2837 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
2838 | ||
2839 | ||
2840 | ||
2841 | ||
2842 | ||
2843 | ||
2844 | extern int rand (void) __attribute__ ((__nothrow__)); | |
2845 | ||
2846 | extern void srand (unsigned int __seed) __attribute__ ((__nothrow__)); | |
2847 | ||
2848 | ||
2849 | ||
2850 | ||
2851 | extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__)); | |
2852 | ||
2853 | ||
2854 | ||
2855 | ||
2856 | ||
2857 | ||
2858 | ||
2859 | extern double drand48 (void) __attribute__ ((__nothrow__)); | |
2860 | extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
2861 | ||
2862 | ||
2863 | extern long int lrand48 (void) __attribute__ ((__nothrow__)); | |
2864 | extern long int nrand48 (unsigned short int __xsubi[3]) | |
2865 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
2866 | ||
2867 | ||
2868 | extern long int mrand48 (void) __attribute__ ((__nothrow__)); | |
2869 | extern long int jrand48 (unsigned short int __xsubi[3]) | |
2870 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
2871 | ||
2872 | ||
2873 | extern void srand48 (long int __seedval) __attribute__ ((__nothrow__)); | |
2874 | extern unsigned short int *seed48 (unsigned short int __seed16v[3]) | |
2875 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
2876 | extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
2877 | ||
2878 | ||
2879 | ||
2880 | ||
2881 | ||
2882 | struct drand48_data | |
2883 | { | |
2884 | unsigned short int __x[3]; | |
2885 | unsigned short int __old_x[3]; | |
2886 | unsigned short int __c; | |
2887 | unsigned short int __init; | |
2888 | unsigned long long int __a; | |
2889 | }; | |
2890 | ||
2891 | ||
2892 | extern int drand48_r (struct drand48_data *__restrict __buffer, | |
2893 | double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
2894 | extern int erand48_r (unsigned short int __xsubi[3], | |
2895 | struct drand48_data *__restrict __buffer, | |
2896 | double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
2897 | ||
2898 | ||
2899 | extern int lrand48_r (struct drand48_data *__restrict __buffer, | |
2900 | long int *__restrict __result) | |
2901 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
2902 | extern int nrand48_r (unsigned short int __xsubi[3], | |
2903 | struct drand48_data *__restrict __buffer, | |
2904 | long int *__restrict __result) | |
2905 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
2906 | ||
2907 | ||
2908 | extern int mrand48_r (struct drand48_data *__restrict __buffer, | |
2909 | long int *__restrict __result) | |
2910 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
2911 | extern int jrand48_r (unsigned short int __xsubi[3], | |
2912 | struct drand48_data *__restrict __buffer, | |
2913 | long int *__restrict __result) | |
2914 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
2915 | ||
2916 | ||
2917 | extern int srand48_r (long int __seedval, struct drand48_data *__buffer) | |
2918 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
2919 | ||
2920 | extern int seed48_r (unsigned short int __seed16v[3], | |
2921 | struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
2922 | ||
2923 | extern int lcong48_r (unsigned short int __param[7], | |
2924 | struct drand48_data *__buffer) | |
2925 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
2926 | ||
2927 | ||
2928 | ||
2929 | ||
2930 | ||
2931 | ||
2932 | ||
2933 | ||
2934 | ||
2935 | extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; | |
2936 | ||
2937 | extern void *calloc (size_t __nmemb, size_t __size) | |
2938 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; | |
2939 | ||
2940 | ||
2941 | ||
2942 | ||
2943 | ||
2944 | ||
2945 | ||
2946 | extern void *realloc (void *__ptr, size_t __size) | |
2947 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); | |
2948 | ||
2949 | extern void free (void *__ptr) __attribute__ ((__nothrow__)); | |
2950 | ||
2951 | ||
2952 | ||
2953 | ||
2954 | extern void cfree (void *__ptr) __attribute__ ((__nothrow__)); | |
2955 | ||
2956 | ||
2957 | ||
2958 | # 1 "../include/alloca.h" 1 | |
2959 | ||
2960 | ||
2961 | # 1 "../stdlib/alloca.h" 1 | |
2962 | # 25 "../stdlib/alloca.h" | |
2963 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
2964 | # 26 "../stdlib/alloca.h" 2 | |
2965 | ||
2966 | ||
2967 | ||
2968 | ||
2969 | ||
2970 | ||
2971 | ||
2972 | extern void *alloca (size_t __size) __attribute__ ((__nothrow__)); | |
2973 | ||
2974 | ||
2975 | ||
2976 | ||
2977 | ||
2978 | ||
2979 | # 4 "../include/alloca.h" 2 | |
2980 | # 1 "../ports/sysdeps/hppa/stackinfo.h" 1 | |
2981 | # 5 "../include/alloca.h" 2 | |
2982 | ||
2983 | ||
2984 | ||
2985 | ||
2986 | extern void *__alloca (size_t __size); | |
2987 | ||
2988 | ||
2989 | ||
2990 | ||
2991 | ||
2992 | extern int __libc_use_alloca (size_t size) __attribute__ ((const)); | |
2993 | extern int __libc_alloca_cutoff (size_t size) __attribute__ ((const)); | |
2994 | ||
2995 | ||
2996 | ||
2997 | # 1 "../nptl/sysdeps/pthread/allocalim.h" 1 | |
2998 | # 20 "../nptl/sysdeps/pthread/allocalim.h" | |
2999 | # 1 "../include/alloca.h" 1 | |
3000 | # 21 "../nptl/sysdeps/pthread/allocalim.h" 2 | |
3001 | # 1 "../include/limits.h" 1 | |
3002 | # 145 "../include/limits.h" | |
3003 | # 1 "../include/bits/posix1_lim.h" 1 | |
3004 | # 146 "../include/limits.h" 2 | |
3005 | ||
3006 | ||
3007 | ||
3008 | # 1 "../include/bits/posix2_lim.h" 1 | |
3009 | # 150 "../include/limits.h" 2 | |
3010 | # 22 "../nptl/sysdeps/pthread/allocalim.h" 2 | |
3011 | ||
3012 | ||
3013 | extern int | |
3014 | __inline __attribute__ ((__always_inline__)) | |
3015 | __libc_use_alloca (size_t size) | |
3016 | { | |
3017 | return (__builtin_expect (size <= 16384 / 4, 1) | |
3018 | || __libc_alloca_cutoff (size)); | |
3019 | } | |
3020 | # 21 "../include/alloca.h" 2 | |
3021 | # 613 "../stdlib/stdlib.h" 2 | |
3022 | ||
3023 | ||
3024 | ||
3025 | ||
3026 | extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; | |
3027 | ||
3028 | ||
3029 | ||
3030 | ||
3031 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) | |
3032 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3033 | ||
3034 | ||
3035 | ||
3036 | ||
3037 | extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
3038 | ||
3039 | ||
3040 | ||
3041 | extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3042 | ||
3043 | ||
3044 | ||
3045 | ||
3046 | ||
3047 | extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) | |
3048 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3049 | ||
3050 | ||
3051 | ||
3052 | ||
3053 | ||
3054 | ||
3055 | extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
3056 | ||
3057 | ||
3058 | ||
3059 | ||
3060 | ||
3061 | ||
3062 | extern void _Exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
3063 | ||
3064 | ||
3065 | ||
3066 | ||
3067 | ||
3068 | ||
3069 | extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3070 | ||
3071 | ||
3072 | ||
3073 | ||
3074 | extern char *__secure_getenv (__const char *__name) | |
3075 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3076 | ||
3077 | ||
3078 | ||
3079 | ||
3080 | ||
3081 | extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3082 | ||
3083 | ||
3084 | ||
3085 | ||
3086 | ||
3087 | extern int setenv (__const char *__name, __const char *__value, int __replace) | |
3088 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
3089 | ||
3090 | ||
3091 | extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__)); | |
3092 | ||
3093 | ||
3094 | ||
3095 | ||
3096 | ||
3097 | ||
3098 | extern int clearenv (void) __attribute__ ((__nothrow__)); | |
3099 | # 698 "../stdlib/stdlib.h" | |
3100 | extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3101 | # 709 "../stdlib/stdlib.h" | |
3102 | extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ; | |
3103 | # 719 "../stdlib/stdlib.h" | |
3104 | extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ; | |
3105 | # 729 "../stdlib/stdlib.h" | |
3106 | extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3107 | ||
3108 | ||
3109 | ||
3110 | ||
3111 | ||
3112 | ||
3113 | ||
3114 | ||
3115 | extern int system (__const char *__command) ; | |
3116 | ||
3117 | ||
3118 | ||
3119 | ||
3120 | ||
3121 | ||
3122 | extern char *canonicalize_file_name (__const char *__name) | |
3123 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3124 | # 756 "../stdlib/stdlib.h" | |
3125 | extern char *realpath (__const char *__restrict __name, | |
3126 | char *__restrict __resolved) __attribute__ ((__nothrow__)) ; | |
3127 | ||
3128 | ||
3129 | ||
3130 | ||
3131 | ||
3132 | ||
3133 | typedef int (*__compar_fn_t) (__const void *, __const void *); | |
3134 | ||
3135 | ||
3136 | typedef __compar_fn_t comparison_fn_t; | |
3137 | ||
3138 | ||
3139 | ||
3140 | ||
3141 | ||
3142 | ||
3143 | extern void *bsearch (__const void *__key, __const void *__base, | |
3144 | size_t __nmemb, size_t __size, __compar_fn_t __compar) | |
3145 | __attribute__ ((__nonnull__ (1, 2, 5))) ; | |
3146 | ||
3147 | ||
3148 | ||
3149 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | |
3150 | __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); | |
3151 | ||
3152 | ||
3153 | ||
3154 | extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
3155 | extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
3156 | ||
3157 | ||
3158 | ||
3159 | __extension__ extern long long int llabs (long long int __x) | |
3160 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
3161 | ||
3162 | ||
3163 | ||
3164 | ||
3165 | ||
3166 | ||
3167 | ||
3168 | extern div_t div (int __numer, int __denom) | |
3169 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
3170 | extern ldiv_t ldiv (long int __numer, long int __denom) | |
3171 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
3172 | ||
3173 | ||
3174 | ||
3175 | ||
3176 | __extension__ extern lldiv_t lldiv (long long int __numer, | |
3177 | long long int __denom) | |
3178 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
3179 | ||
3180 | # 821 "../stdlib/stdlib.h" | |
3181 | extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, | |
3182 | int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; | |
3183 | ||
3184 | ||
3185 | ||
3186 | ||
3187 | extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, | |
3188 | int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; | |
3189 | ||
3190 | ||
3191 | ||
3192 | ||
3193 | extern char *gcvt (double __value, int __ndigit, char *__buf) | |
3194 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ; | |
3195 | ||
3196 | ||
3197 | ||
3198 | ||
3199 | extern char *qecvt (long double __value, int __ndigit, | |
3200 | int *__restrict __decpt, int *__restrict __sign) | |
3201 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; | |
3202 | extern char *qfcvt (long double __value, int __ndigit, | |
3203 | int *__restrict __decpt, int *__restrict __sign) | |
3204 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; | |
3205 | extern char *qgcvt (long double __value, int __ndigit, char *__buf) | |
3206 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ; | |
3207 | ||
3208 | ||
3209 | ||
3210 | ||
3211 | extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, | |
3212 | int *__restrict __sign, char *__restrict __buf, | |
3213 | size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); | |
3214 | extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, | |
3215 | int *__restrict __sign, char *__restrict __buf, | |
3216 | size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); | |
3217 | ||
3218 | extern int qecvt_r (long double __value, int __ndigit, | |
3219 | int *__restrict __decpt, int *__restrict __sign, | |
3220 | char *__restrict __buf, size_t __len) | |
3221 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); | |
3222 | extern int qfcvt_r (long double __value, int __ndigit, | |
3223 | int *__restrict __decpt, int *__restrict __sign, | |
3224 | char *__restrict __buf, size_t __len) | |
3225 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); | |
3226 | ||
3227 | ||
3228 | ||
3229 | ||
3230 | ||
3231 | ||
3232 | ||
3233 | extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) ; | |
3234 | ||
3235 | ||
3236 | extern int mbtowc (wchar_t *__restrict __pwc, | |
3237 | __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) ; | |
3238 | ||
3239 | ||
3240 | extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) ; | |
3241 | ||
3242 | ||
3243 | ||
3244 | extern size_t mbstowcs (wchar_t *__restrict __pwcs, | |
3245 | __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)); | |
3246 | ||
3247 | extern size_t wcstombs (char *__restrict __s, | |
3248 | __const wchar_t *__restrict __pwcs, size_t __n) | |
3249 | __attribute__ ((__nothrow__)); | |
3250 | ||
3251 | ||
3252 | ||
3253 | ||
3254 | ||
3255 | ||
3256 | ||
3257 | ||
3258 | extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
3259 | # 909 "../stdlib/stdlib.h" | |
3260 | extern int getsubopt (char **__restrict __optionp, | |
3261 | char *__const *__restrict __tokens, | |
3262 | char **__restrict __valuep) | |
3263 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))) ; | |
3264 | ||
3265 | ||
3266 | ||
3267 | ||
3268 | ||
3269 | extern void setkey (__const char *__key) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3270 | ||
3271 | ||
3272 | ||
3273 | ||
3274 | ||
3275 | ||
3276 | ||
3277 | extern int posix_openpt (int __oflag) ; | |
3278 | ||
3279 | ||
3280 | ||
3281 | ||
3282 | ||
3283 | ||
3284 | ||
3285 | extern int grantpt (int __fd) __attribute__ ((__nothrow__)); | |
3286 | ||
3287 | ||
3288 | ||
3289 | extern int unlockpt (int __fd) __attribute__ ((__nothrow__)); | |
3290 | ||
3291 | ||
3292 | ||
3293 | ||
3294 | extern char *ptsname (int __fd) __attribute__ ((__nothrow__)) ; | |
3295 | ||
3296 | ||
3297 | ||
3298 | ||
3299 | ||
3300 | ||
3301 | extern int ptsname_r (int __fd, char *__buf, size_t __buflen) | |
3302 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
3303 | ||
3304 | ||
3305 | extern int getpt (void); | |
3306 | ||
3307 | ||
3308 | ||
3309 | ||
3310 | ||
3311 | ||
3312 | extern int getloadavg (double __loadavg[], int __nelem) | |
3313 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3314 | # 977 "../stdlib/stdlib.h" | |
3315 | ||
3316 | # 9 "../include/stdlib.h" 2 | |
3317 | ||
3318 | ||
3319 | ||
3320 | ||
3321 | ||
3322 | ||
3323 | extern __typeof (strtol_l) __strtol_l; | |
3324 | extern __typeof (strtoul_l) __strtoul_l; | |
3325 | extern __typeof (strtoll_l) __strtoll_l; | |
3326 | extern __typeof (strtoull_l) __strtoull_l; | |
3327 | extern __typeof (strtod_l) __strtod_l; | |
3328 | extern __typeof (strtof_l) __strtof_l; | |
3329 | extern __typeof (strtold_l) __strtold_l; | |
3330 | ||
3331 | ||
3332 | ||
3333 | ||
3334 | ||
3335 | ||
3336 | ||
3337 | ||
3338 | ||
3339 | ||
3340 | ||
3341 | ||
3342 | ||
3343 | ||
3344 | ||
3345 | ||
3346 | ||
3347 | extern long int __random (void); | |
3348 | extern void __srandom (unsigned int __seed); | |
3349 | extern char *__initstate (unsigned int __seed, char *__statebuf, | |
3350 | size_t __statelen); | |
3351 | extern char *__setstate (char *__statebuf); | |
3352 | extern int __random_r (struct random_data *__buf, int32_t *__result); | |
3353 | extern int __srandom_r (unsigned int __seed, struct random_data *__buf); | |
3354 | extern int __initstate_r (unsigned int __seed, char *__statebuf, | |
3355 | size_t __statelen, struct random_data *__buf); | |
3356 | extern int __setstate_r (char *__statebuf, struct random_data *__buf); | |
3357 | extern int __rand_r (unsigned int *__seed); | |
3358 | extern int __erand48_r (unsigned short int __xsubi[3], | |
3359 | struct drand48_data *__buffer, double *__result); | |
3360 | extern int __nrand48_r (unsigned short int __xsubi[3], | |
3361 | struct drand48_data *__buffer, | |
3362 | long int *__result); | |
3363 | extern int __jrand48_r (unsigned short int __xsubi[3], | |
3364 | struct drand48_data *__buffer, | |
3365 | long int *__result); | |
3366 | extern int __srand48_r (long int __seedval, | |
3367 | struct drand48_data *__buffer); | |
3368 | extern int __seed48_r (unsigned short int __seed16v[3], | |
3369 | struct drand48_data *__buffer); | |
3370 | extern int __lcong48_r (unsigned short int __param[7], | |
3371 | struct drand48_data *__buffer); | |
3372 | ||
3373 | ||
3374 | extern int __drand48_iterate (unsigned short int __xsubi[3], | |
3375 | struct drand48_data *__buffer); | |
3376 | ||
3377 | ||
3378 | extern struct drand48_data __libc_drand48_data ; | |
3379 | ||
3380 | extern int __setenv (__const char *__name, __const char *__value, | |
3381 | int __replace); | |
3382 | extern int __unsetenv (__const char *__name); | |
3383 | extern int __clearenv (void); | |
3384 | extern char *__canonicalize_file_name (__const char *__name); | |
3385 | extern char *__realpath (__const char *__name, char *__resolved); | |
3386 | extern int __ptsname_r (int __fd, char *__buf, size_t __buflen); | |
3387 | extern int __getpt (void); | |
3388 | extern int __posix_openpt (int __oflag); | |
3389 | ||
3390 | extern int __add_to_environ (const char *name, const char *value, | |
3391 | const char *combines, int replace); | |
3392 | ||
3393 | extern void _quicksort (void *const pbase, size_t total_elems, | |
3394 | size_t size, __compar_fn_t cmp); | |
3395 | ||
3396 | extern int __on_exit (void (*__func) (int __status, void *__arg), void *__arg); | |
3397 | ||
3398 | extern int __cxa_atexit (void (*func) (void *), void *arg, void *d); | |
3399 | extern int __cxa_atexit_internal (void (*func) (void *), void *arg, void *d) | |
3400 | ; | |
3401 | ||
3402 | extern void __cxa_finalize (void *d); | |
3403 | ||
3404 | extern int __posix_memalign (void **memptr, size_t alignment, size_t size); | |
3405 | ||
3406 | extern void *__libc_memalign (size_t alignment, size_t size) | |
3407 | __attribute__ ((__malloc__)); | |
3408 | ||
3409 | extern int __libc_system (const char *line); | |
3410 | ||
3411 | extern double ____strtod_l_internal (__const char *__restrict __nptr, | |
3412 | char **__restrict __endptr, int __group, | |
3413 | __locale_t __loc); | |
3414 | extern float ____strtof_l_internal (__const char *__restrict __nptr, | |
3415 | char **__restrict __endptr, int __group, | |
3416 | __locale_t __loc); | |
3417 | extern long double ____strtold_l_internal (__const char *__restrict __nptr, | |
3418 | char **__restrict __endptr, | |
3419 | int __group, __locale_t __loc); | |
3420 | extern long int ____strtol_l_internal (__const char *__restrict __nptr, | |
3421 | char **__restrict __endptr, | |
3422 | int __base, int __group, | |
3423 | __locale_t __loc); | |
3424 | extern unsigned long int ____strtoul_l_internal (__const char * | |
3425 | __restrict __nptr, | |
3426 | char **__restrict __endptr, | |
3427 | int __base, int __group, | |
3428 | __locale_t __loc); | |
3429 | __extension__ | |
3430 | extern long long int ____strtoll_l_internal (__const char *__restrict __nptr, | |
3431 | char **__restrict __endptr, | |
3432 | int __base, int __group, | |
3433 | __locale_t __loc); | |
3434 | __extension__ | |
3435 | extern unsigned long long int ____strtoull_l_internal (__const char * | |
3436 | __restrict __nptr, | |
3437 | char ** | |
3438 | __restrict __endptr, | |
3439 | int __base, int __group, | |
3440 | __locale_t __loc); | |
3441 | ||
3442 | ||
3443 | ||
3444 | ||
3445 | ||
3446 | ||
3447 | ||
3448 | ||
3449 | ||
3450 | extern __inline double | |
3451 | __attribute__ ((__nothrow__)) __strtod_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) | |
3452 | ||
3453 | { | |
3454 | return ____strtod_l_internal (__nptr, __endptr, 0, __loc); | |
3455 | } | |
3456 | extern __inline long int | |
3457 | __attribute__ ((__nothrow__)) __strtol_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) | |
3458 | ||
3459 | { | |
3460 | return ____strtol_l_internal (__nptr, __endptr, __base, 0, __loc); | |
3461 | } | |
3462 | extern __inline unsigned long int | |
3463 | __attribute__ ((__nothrow__)) __strtoul_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) | |
3464 | ||
3465 | { | |
3466 | return ____strtoul_l_internal (__nptr, __endptr, __base, 0, __loc); | |
3467 | } | |
3468 | extern __inline float | |
3469 | __attribute__ ((__nothrow__)) __strtof_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) | |
3470 | ||
3471 | { | |
3472 | return ____strtof_l_internal (__nptr, __endptr, 0, __loc); | |
3473 | } | |
3474 | extern __inline long double | |
3475 | __attribute__ ((__nothrow__)) __strtold_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) | |
3476 | ||
3477 | { | |
3478 | return ____strtold_l_internal (__nptr, __endptr, 0, __loc); | |
3479 | } | |
3480 | __extension__ extern __inline long long int | |
3481 | __attribute__ ((__nothrow__)) __strtoll_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) | |
3482 | ||
3483 | { | |
3484 | return ____strtoll_l_internal (__nptr, __endptr, __base, 0, __loc); | |
3485 | } | |
3486 | __extension__ extern __inline unsigned long long int | |
3487 | __attribute__ ((__nothrow__)) __strtoull_l (__const char * __restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) | |
3488 | ||
3489 | { | |
3490 | return ____strtoull_l_internal (__nptr, __endptr, __base, 0, __loc); | |
3491 | } | |
3492 | ||
3493 | extern char *__ecvt (double __value, int __ndigit, int *__restrict __decpt, | |
3494 | int *__restrict __sign); | |
3495 | extern char *__fcvt (double __value, int __ndigit, int *__restrict __decpt, | |
3496 | int *__restrict __sign); | |
3497 | extern char *__gcvt (double __value, int __ndigit, char *__buf); | |
3498 | extern int __ecvt_r (double __value, int __ndigit, int *__restrict __decpt, | |
3499 | int *__restrict __sign, char *__restrict __buf, | |
3500 | size_t __len); | |
3501 | extern int __fcvt_r (double __value, int __ndigit, int *__restrict __decpt, | |
3502 | int *__restrict __sign, char *__restrict __buf, | |
3503 | size_t __len); | |
3504 | extern char *__qecvt (long double __value, int __ndigit, | |
3505 | int *__restrict __decpt, int *__restrict __sign); | |
3506 | extern char *__qfcvt (long double __value, int __ndigit, | |
3507 | int *__restrict __decpt, int *__restrict __sign); | |
3508 | extern char *__qgcvt (long double __value, int __ndigit, char *__buf); | |
3509 | extern int __qecvt_r (long double __value, int __ndigit, | |
3510 | int *__restrict __decpt, int *__restrict __sign, | |
3511 | char *__restrict __buf, size_t __len); | |
3512 | extern int __qfcvt_r (long double __value, int __ndigit, | |
3513 | int *__restrict __decpt, int *__restrict __sign, | |
3514 | char *__restrict __buf, size_t __len); | |
3515 | # 217 "../include/stdlib.h" | |
3516 | extern void *__default_morecore (ptrdiff_t) __attribute__ ((__nothrow__)); | |
3517 | ||
3518 | ||
3519 | ||
3520 | # 50 "../include/atomic.h" 2 | |
3521 | ||
3522 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h" 1 | |
3523 | # 21 "../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h" | |
3524 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" 1 | |
3525 | # 23 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" | |
3526 | # 1 "../sysdeps/generic/sysdep.h" 1 | |
3527 | # 24 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" 2 | |
3528 | # 22 "../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h" 2 | |
3529 | # 1 "../ports/sysdeps/hppa/abort-instr.h" 1 | |
3530 | # 23 "../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h" 2 | |
3531 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h" 1 | |
3532 | # 39 "../ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h" | |
3533 | # 1 "../sysdeps/unix/sysv/linux/kernel-features.h" 1 | |
3534 | # 39 "../ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h" 2 | |
3535 | # 24 "../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h" 2 | |
3536 | # 34 "../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h" | |
3537 | typedef int8_t atomic8_t; | |
3538 | typedef uint8_t uatomic8_t; | |
3539 | typedef int_fast8_t atomic_fast8_t; | |
3540 | typedef uint_fast8_t uatomic_fast8_t; | |
3541 | ||
3542 | typedef int32_t atomic32_t; | |
3543 | typedef uint32_t uatomic32_t; | |
3544 | typedef int_fast32_t atomic_fast32_t; | |
3545 | typedef uint_fast32_t uatomic_fast32_t; | |
3546 | ||
3547 | typedef intptr_t atomicptr_t; | |
3548 | typedef uintptr_t uatomicptr_t; | |
3549 | typedef intmax_t atomic_max_t; | |
3550 | typedef uintmax_t uatomic_max_t; | |
3551 | # 52 "../include/atomic.h" 2 | |
3552 | # 27 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h" 2 | |
3553 | # 48 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h" | |
3554 | typedef int lll_lock_t; | |
3555 | # 110 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h" | |
3556 | static inline int __attribute__((always_inline)) | |
3557 | __lll_mutex_trylock(lll_lock_t *futex) | |
3558 | { | |
3559 | return ({ volatile int lws_errno = 14; volatile int lws_ret = 0xdeadbeef; asm volatile( "0: \n\t" "copy %3, %%r26 \n\t" "copy %4, %%r25 \n\t" "copy %5, %%r24 \n\t" "ble " "0xb0" "(%%sr2, %%r0) \n\t" "ldi " "0" ", %%r20 \n\t" "cmpib,=,n " "11" ",%%r21,0b \n\t" "nop \n\t" "stw %%r28, %0 \n\t" "sub %%r0, %%r21, %%r21 \n\t" "stw %%r21, %1 \n\t" : "=m" (lws_ret), "=m" (lws_errno), "=m" (*futex) : "r" (futex), "r" (0), "r" (1) : "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" ); if(lws_errno == 14 || lws_errno == 251) asm ("iitlbp %r0,(%sr0, %r0)"); lws_ret; }) != 0; | |
3560 | } | |
3561 | ||
3562 | ||
3563 | static inline int __attribute__((always_inline)) | |
3564 | __lll_robust_mutex_trylock(int *futex, int id) | |
3565 | { | |
3566 | return ({ volatile int lws_errno = 14; volatile int lws_ret = 0xdeadbeef; asm volatile( "0: \n\t" "copy %3, %%r26 \n\t" "copy %4, %%r25 \n\t" "copy %5, %%r24 \n\t" "ble " "0xb0" "(%%sr2, %%r0) \n\t" "ldi " "0" ", %%r20 \n\t" "cmpib,=,n " "11" ",%%r21,0b \n\t" "nop \n\t" "stw %%r28, %0 \n\t" "sub %%r0, %%r21, %%r21 \n\t" "stw %%r21, %1 \n\t" : "=m" (lws_ret), "=m" (lws_errno), "=m" (*futex) : "r" (futex), "r" (0), "r" (id) : "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" ); if(lws_errno == 14 || lws_errno == 251) asm ("iitlbp %r0,(%sr0, %r0)"); lws_ret; }) != 0; | |
3567 | } | |
3568 | ||
3569 | ||
3570 | ||
3571 | ||
3572 | static inline int __attribute__((always_inline)) | |
3573 | __lll_mutex_cond_trylock(lll_lock_t *futex) | |
3574 | { | |
3575 | return ({ volatile int lws_errno = 14; volatile int lws_ret = 0xdeadbeef; asm volatile( "0: \n\t" "copy %3, %%r26 \n\t" "copy %4, %%r25 \n\t" "copy %5, %%r24 \n\t" "ble " "0xb0" "(%%sr2, %%r0) \n\t" "ldi " "0" ", %%r20 \n\t" "cmpib,=,n " "11" ",%%r21,0b \n\t" "nop \n\t" "stw %%r28, %0 \n\t" "sub %%r0, %%r21, %%r21 \n\t" "stw %%r21, %1 \n\t" : "=m" (lws_ret), "=m" (lws_errno), "=m" (*futex) : "r" (futex), "r" (0), "r" (2) : "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" ); if(lws_errno == 14 || lws_errno == 251) asm ("iitlbp %r0,(%sr0, %r0)"); lws_ret; }) != 0; | |
3576 | } | |
3577 | ||
3578 | ||
3579 | ||
3580 | extern void __lll_lock_wait (lll_lock_t *futex) ; | |
3581 | ||
3582 | static inline void __attribute__((always_inline)) | |
3583 | __lll_mutex_lock(lll_lock_t *futex) | |
3584 | { | |
3585 | if (({ int ret; ret = ({ volatile int lws_errno = 14; volatile int lws_ret = 0xdeadbeef; asm volatile( "0: \n\t" "copy %3, %%r26 \n\t" "copy %4, %%r25 \n\t" "copy %5, %%r24 \n\t" "ble " "0xb0" "(%%sr2, %%r0) \n\t" "ldi " "0" ", %%r20 \n\t" "cmpib,=,n " "11" ",%%r21,0b \n\t" "nop \n\t" "stw %%r28, %0 \n\t" "sub %%r0, %%r21, %%r21 \n\t" "stw %%r21, %1 \n\t" : "=m" (lws_ret), "=m" (lws_errno), "=m" (*futex) : "r" (futex), "r" (0), "r" (1) : "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" ); if(lws_errno == 14 || lws_errno == 251) asm ("iitlbp %r0,(%sr0, %r0)"); lws_ret; }); (ret != 0); }) != 0) | |
3586 | __lll_lock_wait (futex); | |
3587 | } | |
3588 | ||
3589 | ||
3590 | extern int __lll_robust_lock_wait (int *futex) ; | |
3591 | ||
3592 | static inline int __attribute__ ((always_inline)) | |
3593 | __lll_robust_mutex_lock (int *futex, int id) | |
3594 | { | |
3595 | int result = 0; | |
3596 | if (({ int ret; ret = ({ volatile int lws_errno = 14; volatile int lws_ret = 0xdeadbeef; asm volatile( "0: \n\t" "copy %3, %%r26 \n\t" "copy %4, %%r25 \n\t" "copy %5, %%r24 \n\t" "ble " "0xb0" "(%%sr2, %%r0) \n\t" "ldi " "0" ", %%r20 \n\t" "cmpib,=,n " "11" ",%%r21,0b \n\t" "nop \n\t" "stw %%r28, %0 \n\t" "sub %%r0, %%r21, %%r21 \n\t" "stw %%r21, %1 \n\t" : "=m" (lws_ret), "=m" (lws_errno), "=m" (*futex) : "r" (futex), "r" (0), "r" (id) : "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" ); if(lws_errno == 14 || lws_errno == 251) asm ("iitlbp %r0,(%sr0, %r0)"); lws_ret; }); (ret != 0); }) != 0) | |
3597 | result = __lll_robust_lock_wait (futex); | |
3598 | return result; | |
3599 | } | |
3600 | ||
3601 | ||
3602 | ||
3603 | static inline void __attribute__ ((always_inline)) | |
3604 | __lll_mutex_cond_lock (lll_lock_t *futex) | |
3605 | { | |
3606 | if (({ int ret; ret = ({ volatile int lws_errno = 14; volatile int lws_ret = 0xdeadbeef; asm volatile( "0: \n\t" "copy %3, %%r26 \n\t" "copy %4, %%r25 \n\t" "copy %5, %%r24 \n\t" "ble " "0xb0" "(%%sr2, %%r0) \n\t" "ldi " "0" ", %%r20 \n\t" "cmpib,=,n " "11" ",%%r21,0b \n\t" "nop \n\t" "stw %%r28, %0 \n\t" "sub %%r0, %%r21, %%r21 \n\t" "stw %%r21, %1 \n\t" : "=m" (lws_ret), "=m" (lws_errno), "=m" (*futex) : "r" (futex), "r" (0), "r" (2) : "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" ); if(lws_errno == 14 || lws_errno == 251) asm ("iitlbp %r0,(%sr0, %r0)"); lws_ret; }); (ret != 0); }) != 0) | |
3607 | __lll_lock_wait (futex); | |
3608 | } | |
3609 | ||
3610 | ||
3611 | ||
3612 | ||
3613 | ||
3614 | ||
3615 | ||
3616 | extern int __lll_timedlock_wait (lll_lock_t *futex, const struct timespec *) | |
3617 | ; | |
3618 | extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *) | |
3619 | ; | |
3620 | ||
3621 | static inline int __attribute__ ((always_inline)) | |
3622 | __lll_mutex_timedlock (lll_lock_t *futex, const struct timespec *abstime) | |
3623 | { | |
3624 | int result = 0; | |
3625 | if (({ int ret; ret = ({ volatile int lws_errno = 14; volatile int lws_ret = 0xdeadbeef; asm volatile( "0: \n\t" "copy %3, %%r26 \n\t" "copy %4, %%r25 \n\t" "copy %5, %%r24 \n\t" "ble " "0xb0" "(%%sr2, %%r0) \n\t" "ldi " "0" ", %%r20 \n\t" "cmpib,=,n " "11" ",%%r21,0b \n\t" "nop \n\t" "stw %%r28, %0 \n\t" "sub %%r0, %%r21, %%r21 \n\t" "stw %%r21, %1 \n\t" : "=m" (lws_ret), "=m" (lws_errno), "=m" (*futex) : "r" (futex), "r" (0), "r" (1) : "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" ); if(lws_errno == 14 || lws_errno == 251) asm ("iitlbp %r0,(%sr0, %r0)"); lws_ret; }); (ret != 0); }) != 0) | |
3626 | result = __lll_timedlock_wait (futex, abstime); | |
3627 | return result; | |
3628 | } | |
3629 | ||
3630 | ||
3631 | ||
3632 | static inline int __attribute__ ((always_inline)) | |
3633 | __lll_robust_mutex_timedlock (int *futex, const struct timespec *abstime, | |
3634 | int id) | |
3635 | { | |
3636 | int result = 0; | |
3637 | if (({ int ret; ret = ({ volatile int lws_errno = 14; volatile int lws_ret = 0xdeadbeef; asm volatile( "0: \n\t" "copy %3, %%r26 \n\t" "copy %4, %%r25 \n\t" "copy %5, %%r24 \n\t" "ble " "0xb0" "(%%sr2, %%r0) \n\t" "ldi " "0" ", %%r20 \n\t" "cmpib,=,n " "11" ",%%r21,0b \n\t" "nop \n\t" "stw %%r28, %0 \n\t" "sub %%r0, %%r21, %%r21 \n\t" "stw %%r21, %1 \n\t" : "=m" (lws_ret), "=m" (lws_errno), "=m" (*futex) : "r" (futex), "r" (0), "r" (id) : "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" ); if(lws_errno == 14 || lws_errno == 251) asm ("iitlbp %r0,(%sr0, %r0)"); lws_ret; }); (ret != 0); }) != 0) | |
3638 | result = __lll_robust_timedlock_wait (futex, abstime); | |
3639 | return result; | |
3640 | } | |
3641 | ||
3642 | ||
3643 | ||
3644 | ||
3645 | static inline void __attribute__ ((always_inline)) | |
3646 | __lll_mutex_unlock (lll_lock_t *futex) | |
3647 | { | |
3648 | int val = ({ __typeof (*(futex)) __atg5_oldval; __typeof (futex) __atg5_memp = (futex); __typeof (*(futex)) __atg5_value = (0); do __atg5_oldval = *__atg5_memp; while (__builtin_expect (({ int ret; ret = ({ volatile int lws_errno = 14; volatile int lws_ret = 0xdeadbeef; asm volatile( "0: \n\t" "copy %3, %%r26 \n\t" "copy %4, %%r25 \n\t" "copy %5, %%r24 \n\t" "ble " "0xb0" "(%%sr2, %%r0) \n\t" "ldi " "0" ", %%r20 \n\t" "cmpib,=,n " "11" ",%%r21,0b \n\t" "nop \n\t" "stw %%r28, %0 \n\t" "sub %%r0, %%r21, %%r21 \n\t" "stw %%r21, %1 \n\t" : "=m" (lws_ret), "=m" (lws_errno), "=m" (*__atg5_memp) : "r" (__atg5_memp), "r" (__atg5_oldval), "r" (__atg5_value) : "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" ); if(lws_errno == 14 || lws_errno == 251) asm ("iitlbp %r0,(%sr0, %r0)"); lws_ret; }); (ret != __atg5_oldval); }), 0)); __atg5_oldval; }); | |
3649 | if (__builtin_expect (val > 1, 0)) | |
3650 | ({ ; long int __ret; __ret = ({ long __sys_res; { register unsigned long __res asm("r28"); register unsigned long __r23 __asm__("r23") = (unsigned long)(0); register unsigned long __r24 __asm__("r24") = (unsigned long)((1)); register unsigned long __r25 __asm__("r25") = (unsigned long)(1); register unsigned long __r26 __asm__("r26") = (unsigned long)((futex)); asm volatile( "nop \n" " ble 0x100(%%sr2, %%r0)\n" " ldi %1, %%r20\n" "nop \n" : "=r" (__res) : "i" (((0 + 210))) , "r" (__r26), "r" (__r25), "r" (__r24), "r" (__r23) : "memory", "%r1", "%r2", "%r20", "%r29", "%r31" , "%r21", "%r22" ); __sys_res = (long)__res; } __sys_res; }); __ret; }); | |
3651 | } | |
3652 | ||
3653 | ||
3654 | ||
3655 | static inline void __attribute__ ((always_inline)) | |
3656 | __lll_robust_mutex_unlock (int *futex, int mask) | |
3657 | { | |
3658 | int val = ({ __typeof (*(futex)) __atg5_oldval; __typeof (futex) __atg5_memp = (futex); __typeof (*(futex)) __atg5_value = (0); do __atg5_oldval = *__atg5_memp; while (__builtin_expect (({ int ret; ret = ({ volatile int lws_errno = 14; volatile int lws_ret = 0xdeadbeef; asm volatile( "0: \n\t" "copy %3, %%r26 \n\t" "copy %4, %%r25 \n\t" "copy %5, %%r24 \n\t" "ble " "0xb0" "(%%sr2, %%r0) \n\t" "ldi " "0" ", %%r20 \n\t" "cmpib,=,n " "11" ",%%r21,0b \n\t" "nop \n\t" "stw %%r28, %0 \n\t" "sub %%r0, %%r21, %%r21 \n\t" "stw %%r21, %1 \n\t" : "=m" (lws_ret), "=m" (lws_errno), "=m" (*__atg5_memp) : "r" (__atg5_memp), "r" (__atg5_oldval), "r" (__atg5_value) : "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" ); if(lws_errno == 14 || lws_errno == 251) asm ("iitlbp %r0,(%sr0, %r0)"); lws_ret; }); (ret != __atg5_oldval); }), 0)); __atg5_oldval; }); | |
3659 | if (__builtin_expect (val & mask, 0)) | |
3660 | ({ ; long int __ret; __ret = ({ long __sys_res; { register unsigned long __res asm("r28"); register unsigned long __r23 __asm__("r23") = (unsigned long)(0); register unsigned long __r24 __asm__("r24") = (unsigned long)((1)); register unsigned long __r25 __asm__("r25") = (unsigned long)(1); register unsigned long __r26 __asm__("r26") = (unsigned long)((futex)); asm volatile( "nop \n" " ble 0x100(%%sr2, %%r0)\n" " ldi %1, %%r20\n" "nop \n" : "=r" (__res) : "i" (((0 + 210))) , "r" (__r26), "r" (__r25), "r" (__r24), "r" (__r23) : "memory", "%r1", "%r2", "%r20", "%r29", "%r31" , "%r21", "%r22" ); __sys_res = (long)__res; } __sys_res; }); __ret; }); | |
3661 | } | |
3662 | ||
3663 | ||
3664 | ||
3665 | ||
3666 | static inline void __attribute__ ((always_inline)) | |
3667 | __lll_mutex_unlock_force (lll_lock_t *futex) | |
3668 | { | |
3669 | (void) ({ __typeof (*(futex)) __atg5_oldval; __typeof (futex) __atg5_memp = (futex); __typeof (*(futex)) __atg5_value = (0); do __atg5_oldval = *__atg5_memp; while (__builtin_expect (({ int ret; ret = ({ volatile int lws_errno = 14; volatile int lws_ret = 0xdeadbeef; asm volatile( "0: \n\t" "copy %3, %%r26 \n\t" "copy %4, %%r25 \n\t" "copy %5, %%r24 \n\t" "ble " "0xb0" "(%%sr2, %%r0) \n\t" "ldi " "0" ", %%r20 \n\t" "cmpib,=,n " "11" ",%%r21,0b \n\t" "nop \n\t" "stw %%r28, %0 \n\t" "sub %%r0, %%r21, %%r21 \n\t" "stw %%r21, %1 \n\t" : "=m" (lws_ret), "=m" (lws_errno), "=m" (*__atg5_memp) : "r" (__atg5_memp), "r" (__atg5_oldval), "r" (__atg5_value) : "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory" ); if(lws_errno == 14 || lws_errno == 251) asm ("iitlbp %r0,(%sr0, %r0)"); lws_ret; }); (ret != __atg5_oldval); }), 0)); __atg5_oldval; }); | |
3670 | ({ ; long int __ret; __ret = ({ long __sys_res; { register unsigned long __res asm("r28"); register unsigned long __r23 __asm__("r23") = (unsigned long)(0); register unsigned long __r24 __asm__("r24") = (unsigned long)((1)); register unsigned long __r25 __asm__("r25") = (unsigned long)(1); register unsigned long __r26 __asm__("r26") = (unsigned long)((futex)); asm volatile( "nop \n" " ble 0x100(%%sr2, %%r0)\n" " ldi %1, %%r20\n" "nop \n" : "=r" (__res) : "i" (((0 + 210))) , "r" (__r26), "r" (__r25), "r" (__r24), "r" (__r23) : "memory", "%r1", "%r2", "%r20", "%r29", "%r31" , "%r21", "%r22" ); __sys_res = (long)__res; } __sys_res; }); __ret; }); | |
3671 | } | |
3672 | # 242 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h" | |
3673 | extern int lll_unlock_wake_cb (lll_lock_t *__futex) ; | |
3674 | # 265 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h" | |
3675 | extern int __lll_timedwait_tid (int *, const struct timespec *) | |
3676 | ; | |
3677 | # 279 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h" | |
3678 | extern void __lll_cond_wait (pthread_cond_t *cond) | |
3679 | ; | |
3680 | extern int __lll_cond_timedwait (pthread_cond_t *cond, | |
3681 | const struct timespec *abstime) | |
3682 | ; | |
3683 | extern void __lll_cond_wake (pthread_cond_t *cond) | |
3684 | ; | |
3685 | extern void __lll_cond_broadcast (pthread_cond_t *cond) | |
3686 | ; | |
3687 | # 31 "../nptl/descr.h" 2 | |
3688 | # 1 "../ports/sysdeps/hppa/nptl/pthreaddef.h" 1 | |
3689 | # 34 "../ports/sysdeps/hppa/nptl/pthreaddef.h" | |
3690 | register char * stack_pointer __asm__ ("%r30"); | |
3691 | # 32 "../nptl/descr.h" 2 | |
3692 | # 1 "../sysdeps/unix/sysv/linux/dl-sysdep.h" 1 | |
3693 | # 20 "../sysdeps/unix/sysv/linux/dl-sysdep.h" | |
3694 | # 1 "../sysdeps/generic/dl-sysdep.h" 1 | |
3695 | # 21 "../sysdeps/unix/sysv/linux/dl-sysdep.h" 2 | |
3696 | # 33 "../nptl/descr.h" 2 | |
3697 | # 1 "../nptl/../nptl_db/thread_db.h" 1 | |
3698 | # 26 "../nptl/../nptl_db/thread_db.h" | |
3699 | # 1 "../include/pthread.h" 1 | |
3700 | # 1 "../nptl/sysdeps/pthread/pthread.h" 1 | |
3701 | # 27 "../nptl/sysdeps/pthread/pthread.h" | |
3702 | # 1 "../include/signal.h" 1 | |
3703 | ||
3704 | ||
3705 | # 1 "../signal/signal.h" 1 | |
3706 | # 31 "../signal/signal.h" | |
3707 | ||
3708 | ||
3709 | # 1 "../sysdeps/unix/sysv/linux/bits/sigset.h" 1 | |
3710 | # 34 "../signal/signal.h" 2 | |
3711 | # 400 "../signal/signal.h" | |
3712 | ||
3713 | # 4 "../include/signal.h" 2 | |
3714 | # 28 "../nptl/sysdeps/pthread/pthread.h" 2 | |
3715 | ||
3716 | ||
3717 | # 1 "../sysdeps/wordsize-32/bits/wordsize.h" 1 | |
3718 | # 31 "../nptl/sysdeps/pthread/pthread.h" 2 | |
3719 | ||
3720 | ||
3721 | ||
3722 | enum | |
3723 | { | |
3724 | PTHREAD_CREATE_JOINABLE, | |
3725 | ||
3726 | PTHREAD_CREATE_DETACHED | |
3727 | ||
3728 | }; | |
3729 | ||
3730 | ||
3731 | ||
3732 | enum | |
3733 | { | |
3734 | PTHREAD_MUTEX_TIMED_NP, | |
3735 | PTHREAD_MUTEX_RECURSIVE_NP, | |
3736 | PTHREAD_MUTEX_ERRORCHECK_NP, | |
3737 | PTHREAD_MUTEX_ADAPTIVE_NP | |
3738 | ||
3739 | , | |
3740 | PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, | |
3741 | PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, | |
3742 | PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, | |
3743 | PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL | |
3744 | ||
3745 | ||
3746 | ||
3747 | , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP | |
3748 | ||
3749 | }; | |
3750 | ||
3751 | ||
3752 | ||
3753 | ||
3754 | enum | |
3755 | { | |
3756 | PTHREAD_MUTEX_STALLED_NP, | |
3757 | PTHREAD_MUTEX_ROBUST_NP | |
3758 | }; | |
3759 | ||
3760 | ||
3761 | ||
3762 | ||
3763 | ||
3764 | enum | |
3765 | { | |
3766 | PTHREAD_PRIO_NONE, | |
3767 | PTHREAD_PRIO_INHERIT, | |
3768 | PTHREAD_PRIO_PROTECT | |
3769 | }; | |
3770 | # 113 "../nptl/sysdeps/pthread/pthread.h" | |
3771 | enum | |
3772 | { | |
3773 | PTHREAD_RWLOCK_PREFER_READER_NP, | |
3774 | PTHREAD_RWLOCK_PREFER_WRITER_NP, | |
3775 | PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, | |
3776 | PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP | |
3777 | }; | |
3778 | # 143 "../nptl/sysdeps/pthread/pthread.h" | |
3779 | enum | |
3780 | { | |
3781 | PTHREAD_INHERIT_SCHED, | |
3782 | ||
3783 | PTHREAD_EXPLICIT_SCHED | |
3784 | ||
3785 | }; | |
3786 | ||
3787 | ||
3788 | ||
3789 | enum | |
3790 | { | |
3791 | PTHREAD_SCOPE_SYSTEM, | |
3792 | ||
3793 | PTHREAD_SCOPE_PROCESS | |
3794 | ||
3795 | }; | |
3796 | ||
3797 | ||
3798 | ||
3799 | enum | |
3800 | { | |
3801 | PTHREAD_PROCESS_PRIVATE, | |
3802 | ||
3803 | PTHREAD_PROCESS_SHARED | |
3804 | ||
3805 | }; | |
3806 | # 178 "../nptl/sysdeps/pthread/pthread.h" | |
3807 | struct _pthread_cleanup_buffer | |
3808 | { | |
3809 | void (*__routine) (void *); | |
3810 | void *__arg; | |
3811 | int __canceltype; | |
3812 | struct _pthread_cleanup_buffer *__prev; | |
3813 | }; | |
3814 | ||
3815 | ||
3816 | enum | |
3817 | { | |
3818 | PTHREAD_CANCEL_ENABLE, | |
3819 | ||
3820 | PTHREAD_CANCEL_DISABLE | |
3821 | ||
3822 | }; | |
3823 | enum | |
3824 | { | |
3825 | PTHREAD_CANCEL_DEFERRED, | |
3826 | ||
3827 | PTHREAD_CANCEL_ASYNCHRONOUS | |
3828 | ||
3829 | }; | |
3830 | # 216 "../nptl/sysdeps/pthread/pthread.h" | |
3831 | ||
3832 | ||
3833 | ||
3834 | ||
3835 | ||
3836 | extern int pthread_create (pthread_t *__restrict __newthread, | |
3837 | __const pthread_attr_t *__restrict __attr, | |
3838 | void *(*__start_routine) (void *), | |
3839 | void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))); | |
3840 | ||
3841 | ||
3842 | ||
3843 | ||
3844 | ||
3845 | extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); | |
3846 | ||
3847 | ||
3848 | ||
3849 | ||
3850 | ||
3851 | ||
3852 | ||
3853 | extern int pthread_join (pthread_t __th, void **__thread_return); | |
3854 | ||
3855 | ||
3856 | ||
3857 | ||
3858 | extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __attribute__ ((__nothrow__)); | |
3859 | ||
3860 | ||
3861 | ||
3862 | ||
3863 | ||
3864 | ||
3865 | ||
3866 | extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return, | |
3867 | __const struct timespec *__abstime); | |
3868 | ||
3869 | ||
3870 | ||
3871 | ||
3872 | ||
3873 | ||
3874 | extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__)); | |
3875 | ||
3876 | ||
3877 | ||
3878 | extern pthread_t pthread_self (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
3879 | ||
3880 | ||
3881 | extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __attribute__ ((__nothrow__)); | |
3882 | ||
3883 | ||
3884 | ||
3885 | ||
3886 | ||
3887 | ||
3888 | ||
3889 | extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3890 | ||
3891 | ||
3892 | extern int pthread_attr_destroy (pthread_attr_t *__attr) | |
3893 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3894 | ||
3895 | ||
3896 | extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr, | |
3897 | int *__detachstate) | |
3898 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3899 | ||
3900 | ||
3901 | extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, | |
3902 | int __detachstate) | |
3903 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3904 | ||
3905 | ||
3906 | ||
3907 | extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr, | |
3908 | size_t *__guardsize) | |
3909 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3910 | ||
3911 | ||
3912 | extern int pthread_attr_setguardsize (pthread_attr_t *__attr, | |
3913 | size_t __guardsize) | |
3914 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3915 | ||
3916 | ||
3917 | ||
3918 | extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict | |
3919 | __attr, | |
3920 | struct sched_param *__restrict __param) | |
3921 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3922 | ||
3923 | ||
3924 | extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, | |
3925 | __const struct sched_param *__restrict | |
3926 | __param) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3927 | ||
3928 | ||
3929 | extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict | |
3930 | __attr, int *__restrict __policy) | |
3931 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3932 | ||
3933 | ||
3934 | extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) | |
3935 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3936 | ||
3937 | ||
3938 | extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict | |
3939 | __attr, int *__restrict __inherit) | |
3940 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3941 | ||
3942 | ||
3943 | extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, | |
3944 | int __inherit) | |
3945 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3946 | ||
3947 | ||
3948 | ||
3949 | extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr, | |
3950 | int *__restrict __scope) | |
3951 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3952 | ||
3953 | ||
3954 | extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) | |
3955 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3956 | ||
3957 | ||
3958 | extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict | |
3959 | __attr, void **__restrict __stackaddr) | |
3960 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__)); | |
3961 | ||
3962 | ||
3963 | ||
3964 | ||
3965 | ||
3966 | extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, | |
3967 | void *__stackaddr) | |
3968 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)); | |
3969 | ||
3970 | ||
3971 | extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict | |
3972 | __attr, size_t *__restrict __stacksize) | |
3973 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
3974 | ||
3975 | ||
3976 | ||
3977 | ||
3978 | extern int pthread_attr_setstacksize (pthread_attr_t *__attr, | |
3979 | size_t __stacksize) | |
3980 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3981 | ||
3982 | ||
3983 | ||
3984 | extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr, | |
3985 | void **__restrict __stackaddr, | |
3986 | size_t *__restrict __stacksize) | |
3987 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))); | |
3988 | ||
3989 | ||
3990 | ||
3991 | ||
3992 | extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, | |
3993 | size_t __stacksize) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
3994 | ||
3995 | ||
3996 | ||
3997 | ||
3998 | ||
3999 | extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr, | |
4000 | size_t __cpusetsize, | |
4001 | __const cpu_set_t *__cpuset) | |
4002 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))); | |
4003 | ||
4004 | ||
4005 | ||
4006 | extern int pthread_attr_getaffinity_np (__const pthread_attr_t *__attr, | |
4007 | size_t __cpusetsize, | |
4008 | cpu_set_t *__cpuset) | |
4009 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))); | |
4010 | ||
4011 | ||
4012 | ||
4013 | ||
4014 | ||
4015 | extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) | |
4016 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
4017 | ||
4018 | ||
4019 | ||
4020 | ||
4021 | ||
4022 | ||
4023 | ||
4024 | extern int pthread_setschedparam (pthread_t __target_thread, int __policy, | |
4025 | __const struct sched_param *__param) | |
4026 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))); | |
4027 | ||
4028 | ||
4029 | extern int pthread_getschedparam (pthread_t __target_thread, | |
4030 | int *__restrict __policy, | |
4031 | struct sched_param *__restrict __param) | |
4032 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); | |
4033 | ||
4034 | ||
4035 | extern int pthread_setschedprio (pthread_t __target_thread, int __prio) | |
4036 | __attribute__ ((__nothrow__)); | |
4037 | ||
4038 | ||
4039 | ||
4040 | ||
4041 | extern int pthread_getconcurrency (void) __attribute__ ((__nothrow__)); | |
4042 | ||
4043 | ||
4044 | extern int pthread_setconcurrency (int __level) __attribute__ ((__nothrow__)); | |
4045 | ||
4046 | ||
4047 | ||
4048 | ||
4049 | ||
4050 | ||
4051 | ||
4052 | extern int pthread_yield (void) __attribute__ ((__nothrow__)); | |
4053 | ||
4054 | ||
4055 | ||
4056 | ||
4057 | extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize, | |
4058 | __const cpu_set_t *__cpuset) | |
4059 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))); | |
4060 | ||
4061 | ||
4062 | extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize, | |
4063 | cpu_set_t *__cpuset) | |
4064 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))); | |
4065 | # 462 "../nptl/sysdeps/pthread/pthread.h" | |
4066 | extern int pthread_once (pthread_once_t *__once_control, | |
4067 | void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2))); | |
4068 | # 474 "../nptl/sysdeps/pthread/pthread.h" | |
4069 | extern int pthread_setcancelstate (int __state, int *__oldstate); | |
4070 | ||
4071 | ||
4072 | ||
4073 | extern int pthread_setcanceltype (int __type, int *__oldtype); | |
4074 | ||
4075 | ||
4076 | extern int pthread_cancel (pthread_t __th); | |
4077 | ||
4078 | ||
4079 | ||
4080 | ||
4081 | extern void pthread_testcancel (void); | |
4082 | ||
4083 | ||
4084 | ||
4085 | ||
4086 | typedef struct | |
4087 | { | |
4088 | struct | |
4089 | { | |
4090 | __jmp_buf __cancel_jmp_buf; | |
4091 | int __mask_was_saved; | |
4092 | } __cancel_jmp_buf[1]; | |
4093 | void *__pad[4]; | |
4094 | } __pthread_unwind_buf_t __attribute__ ((__aligned__)); | |
4095 | # 508 "../nptl/sysdeps/pthread/pthread.h" | |
4096 | struct __pthread_cleanup_frame | |
4097 | { | |
4098 | void (*__cancel_routine) (void *); | |
4099 | void *__cancel_arg; | |
4100 | int __do_it; | |
4101 | int __cancel_type; | |
4102 | }; | |
4103 | # 648 "../nptl/sysdeps/pthread/pthread.h" | |
4104 | extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf) | |
4105 | ; | |
4106 | # 659 "../nptl/sysdeps/pthread/pthread.h" | |
4107 | extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) | |
4108 | ; | |
4109 | # 682 "../nptl/sysdeps/pthread/pthread.h" | |
4110 | extern void __pthread_register_cancel_defer (__pthread_unwind_buf_t *__buf) | |
4111 | ; | |
4112 | # 694 "../nptl/sysdeps/pthread/pthread.h" | |
4113 | extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf) | |
4114 | ; | |
4115 | ||
4116 | ||
4117 | ||
4118 | extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) | |
4119 | __attribute__ ((__noreturn__)) | |
4120 | ||
4121 | __attribute__ ((__weak__)) | |
4122 | ||
4123 | ; | |
4124 | ||
4125 | ||
4126 | ||
4127 | struct __jmp_buf_tag; | |
4128 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__)); | |
4129 | ||
4130 | ||
4131 | ||
4132 | ||
4133 | ||
4134 | extern int pthread_mutex_init (pthread_mutex_t *__mutex, | |
4135 | __const pthread_mutexattr_t *__mutexattr) | |
4136 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4137 | ||
4138 | ||
4139 | extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) | |
4140 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4141 | ||
4142 | ||
4143 | extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) | |
4144 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4145 | ||
4146 | ||
4147 | extern int pthread_mutex_lock (pthread_mutex_t *__mutex) | |
4148 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4149 | ||
4150 | ||
4151 | ||
4152 | extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, | |
4153 | __const struct timespec *__restrict | |
4154 | __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4155 | ||
4156 | ||
4157 | ||
4158 | extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) | |
4159 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4160 | ||
4161 | ||
4162 | ||
4163 | ||
4164 | extern int pthread_mutex_getprioceiling (__const pthread_mutex_t * | |
4165 | __restrict __mutex, | |
4166 | int *__restrict __prioceiling) | |
4167 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4168 | ||
4169 | ||
4170 | ||
4171 | extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, | |
4172 | int __prioceiling, | |
4173 | int *__restrict __old_ceiling) | |
4174 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))); | |
4175 | ||
4176 | ||
4177 | ||
4178 | ||
4179 | ||
4180 | extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) | |
4181 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4182 | ||
4183 | ||
4184 | ||
4185 | ||
4186 | ||
4187 | ||
4188 | ||
4189 | extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) | |
4190 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4191 | ||
4192 | ||
4193 | extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) | |
4194 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4195 | ||
4196 | ||
4197 | extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t * | |
4198 | __restrict __attr, | |
4199 | int *__restrict __pshared) | |
4200 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4201 | ||
4202 | ||
4203 | extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, | |
4204 | int __pshared) | |
4205 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4206 | ||
4207 | ||
4208 | ||
4209 | extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict | |
4210 | __attr, int *__restrict __kind) | |
4211 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4212 | ||
4213 | ||
4214 | ||
4215 | ||
4216 | extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) | |
4217 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4218 | ||
4219 | ||
4220 | extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t * | |
4221 | __restrict __attr, | |
4222 | int *__restrict __protocol) | |
4223 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4224 | ||
4225 | ||
4226 | ||
4227 | extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr, | |
4228 | int __protocol) | |
4229 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4230 | ||
4231 | ||
4232 | extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t * | |
4233 | __restrict __attr, | |
4234 | int *__restrict __prioceiling) | |
4235 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4236 | ||
4237 | ||
4238 | extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, | |
4239 | int __prioceiling) | |
4240 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4241 | ||
4242 | ||
4243 | ||
4244 | ||
4245 | extern int pthread_mutexattr_getrobust_np (__const pthread_mutexattr_t *__attr, | |
4246 | int *__robustness) | |
4247 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4248 | ||
4249 | ||
4250 | extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr, | |
4251 | int __robustness) | |
4252 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4253 | # 842 "../nptl/sysdeps/pthread/pthread.h" | |
4254 | extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, | |
4255 | __const pthread_rwlockattr_t *__restrict | |
4256 | __attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4257 | ||
4258 | ||
4259 | extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) | |
4260 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4261 | ||
4262 | ||
4263 | extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) | |
4264 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4265 | ||
4266 | ||
4267 | extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) | |
4268 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4269 | ||
4270 | ||
4271 | ||
4272 | extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, | |
4273 | __const struct timespec *__restrict | |
4274 | __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4275 | ||
4276 | ||
4277 | ||
4278 | extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) | |
4279 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4280 | ||
4281 | ||
4282 | extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) | |
4283 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4284 | ||
4285 | ||
4286 | ||
4287 | extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, | |
4288 | __const struct timespec *__restrict | |
4289 | __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4290 | ||
4291 | ||
4292 | ||
4293 | extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) | |
4294 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4295 | ||
4296 | ||
4297 | ||
4298 | ||
4299 | ||
4300 | extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) | |
4301 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4302 | ||
4303 | ||
4304 | extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) | |
4305 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4306 | ||
4307 | ||
4308 | extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t * | |
4309 | __restrict __attr, | |
4310 | int *__restrict __pshared) | |
4311 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4312 | ||
4313 | ||
4314 | extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, | |
4315 | int __pshared) | |
4316 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4317 | ||
4318 | ||
4319 | extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t * | |
4320 | __restrict __attr, | |
4321 | int *__restrict __pref) | |
4322 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4323 | ||
4324 | ||
4325 | extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, | |
4326 | int __pref) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4327 | ||
4328 | ||
4329 | ||
4330 | ||
4331 | ||
4332 | ||
4333 | ||
4334 | extern int pthread_cond_init (pthread_cond_t *__restrict __cond, | |
4335 | __const pthread_condattr_t *__restrict | |
4336 | __cond_attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4337 | ||
4338 | ||
4339 | extern int pthread_cond_destroy (pthread_cond_t *__cond) | |
4340 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4341 | ||
4342 | ||
4343 | extern int pthread_cond_signal (pthread_cond_t *__cond) | |
4344 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4345 | ||
4346 | ||
4347 | extern int pthread_cond_broadcast (pthread_cond_t *__cond) | |
4348 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4349 | ||
4350 | ||
4351 | ||
4352 | ||
4353 | ||
4354 | ||
4355 | extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, | |
4356 | pthread_mutex_t *__restrict __mutex) | |
4357 | __attribute__ ((__nonnull__ (1, 2))); | |
4358 | # 954 "../nptl/sysdeps/pthread/pthread.h" | |
4359 | extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, | |
4360 | pthread_mutex_t *__restrict __mutex, | |
4361 | __const struct timespec *__restrict | |
4362 | __abstime) __attribute__ ((__nonnull__ (1, 2, 3))); | |
4363 | ||
4364 | ||
4365 | ||
4366 | ||
4367 | extern int pthread_condattr_init (pthread_condattr_t *__attr) | |
4368 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4369 | ||
4370 | ||
4371 | extern int pthread_condattr_destroy (pthread_condattr_t *__attr) | |
4372 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4373 | ||
4374 | ||
4375 | extern int pthread_condattr_getpshared (__const pthread_condattr_t * | |
4376 | __restrict __attr, | |
4377 | int *__restrict __pshared) | |
4378 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4379 | ||
4380 | ||
4381 | extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, | |
4382 | int __pshared) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4383 | ||
4384 | ||
4385 | ||
4386 | extern int pthread_condattr_getclock (__const pthread_condattr_t * | |
4387 | __restrict __attr, | |
4388 | __clockid_t *__restrict __clock_id) | |
4389 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4390 | ||
4391 | ||
4392 | extern int pthread_condattr_setclock (pthread_condattr_t *__attr, | |
4393 | __clockid_t __clock_id) | |
4394 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4395 | # 998 "../nptl/sysdeps/pthread/pthread.h" | |
4396 | extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) | |
4397 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4398 | ||
4399 | ||
4400 | extern int pthread_spin_destroy (pthread_spinlock_t *__lock) | |
4401 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4402 | ||
4403 | ||
4404 | extern int pthread_spin_lock (pthread_spinlock_t *__lock) | |
4405 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4406 | ||
4407 | ||
4408 | extern int pthread_spin_trylock (pthread_spinlock_t *__lock) | |
4409 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4410 | ||
4411 | ||
4412 | extern int pthread_spin_unlock (pthread_spinlock_t *__lock) | |
4413 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4414 | ||
4415 | ||
4416 | ||
4417 | ||
4418 | ||
4419 | ||
4420 | extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, | |
4421 | __const pthread_barrierattr_t *__restrict | |
4422 | __attr, unsigned int __count) | |
4423 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4424 | ||
4425 | ||
4426 | extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) | |
4427 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4428 | ||
4429 | ||
4430 | extern int pthread_barrier_wait (pthread_barrier_t *__barrier) | |
4431 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4432 | ||
4433 | ||
4434 | ||
4435 | extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) | |
4436 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4437 | ||
4438 | ||
4439 | extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) | |
4440 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4441 | ||
4442 | ||
4443 | extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t * | |
4444 | __restrict __attr, | |
4445 | int *__restrict __pshared) | |
4446 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
4447 | ||
4448 | ||
4449 | extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, | |
4450 | int __pshared) | |
4451 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4452 | # 1065 "../nptl/sysdeps/pthread/pthread.h" | |
4453 | extern int pthread_key_create (pthread_key_t *__key, | |
4454 | void (*__destr_function) (void *)) | |
4455 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4456 | ||
4457 | ||
4458 | extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__)); | |
4459 | ||
4460 | ||
4461 | extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__)); | |
4462 | ||
4463 | ||
4464 | extern int pthread_setspecific (pthread_key_t __key, | |
4465 | __const void *__pointer) __attribute__ ((__nothrow__)) ; | |
4466 | ||
4467 | ||
4468 | ||
4469 | ||
4470 | extern int pthread_getcpuclockid (pthread_t __thread_id, | |
4471 | __clockid_t *__clock_id) | |
4472 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
4473 | # 1099 "../nptl/sysdeps/pthread/pthread.h" | |
4474 | extern int pthread_atfork (void (*__prepare) (void), | |
4475 | void (*__parent) (void), | |
4476 | void (*__child) (void)) __attribute__ ((__nothrow__)); | |
4477 | ||
4478 | ||
4479 | ||
4480 | ||
4481 | extern __inline int | |
4482 | __attribute__ ((__nothrow__)) pthread_equal (pthread_t __thread1, pthread_t __thread2) | |
4483 | { | |
4484 | return __thread1 == __thread2; | |
4485 | } | |
4486 | ||
4487 | ||
4488 | ||
4489 | # 2 "../include/pthread.h" 2 | |
4490 | ||
4491 | ||
4492 | extern void __pthread_initialize (void) __attribute__ ((weak)); | |
4493 | # 27 "../nptl/../nptl_db/thread_db.h" 2 | |
4494 | ||
4495 | # 1 "../include/sys/types.h" 1 | |
4496 | # 29 "../nptl/../nptl_db/thread_db.h" 2 | |
4497 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h" 1 | |
4498 | # 32 "../ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h" | |
4499 | # 1 "../include/signal.h" 1 | |
4500 | ||
4501 | ||
4502 | ||
4503 | ||
4504 | # 1 "../signal/signal.h" 1 | |
4505 | # 31 "../signal/signal.h" | |
4506 | ||
4507 | ||
4508 | # 1 "../sysdeps/unix/sysv/linux/bits/sigset.h" 1 | |
4509 | # 103 "../sysdeps/unix/sysv/linux/bits/sigset.h" | |
4510 | extern int __sigismember (__const __sigset_t *, int); | |
4511 | extern int __sigaddset (__sigset_t *, int); | |
4512 | extern int __sigdelset (__sigset_t *, int); | |
4513 | # 117 "../sysdeps/unix/sysv/linux/bits/sigset.h" | |
4514 | extern __inline int __sigismember (__const __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return (__set->__val[__word] & __mask) ? 1 : 0; } | |
4515 | extern __inline int __sigaddset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] |= __mask), 0); } | |
4516 | extern __inline int __sigdelset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] &= ~__mask), 0); } | |
4517 | # 34 "../signal/signal.h" 2 | |
4518 | ||
4519 | ||
4520 | ||
4521 | ||
4522 | ||
4523 | ||
4524 | ||
4525 | typedef __sig_atomic_t sig_atomic_t; | |
4526 | ||
4527 | # 58 "../signal/signal.h" | |
4528 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/bits/signum.h" 1 | |
4529 | # 59 "../signal/signal.h" 2 | |
4530 | # 75 "../signal/signal.h" | |
4531 | typedef void (*__sighandler_t) (int); | |
4532 | ||
4533 | ||
4534 | ||
4535 | ||
4536 | extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler) | |
4537 | __attribute__ ((__nothrow__)); | |
4538 | ||
4539 | extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler) | |
4540 | __attribute__ ((__nothrow__)); | |
4541 | ||
4542 | ||
4543 | ||
4544 | ||
4545 | ||
4546 | ||
4547 | ||
4548 | extern __sighandler_t signal (int __sig, __sighandler_t __handler) | |
4549 | __attribute__ ((__nothrow__)); | |
4550 | # 104 "../signal/signal.h" | |
4551 | ||
4552 | ||
4553 | ||
4554 | ||
4555 | ||
4556 | extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler) | |
4557 | __attribute__ ((__nothrow__)); | |
4558 | ||
4559 | ||
4560 | ||
4561 | ||
4562 | ||
4563 | ||
4564 | extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__)); | |
4565 | ||
4566 | ||
4567 | ||
4568 | ||
4569 | ||
4570 | ||
4571 | extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__)); | |
4572 | ||
4573 | ||
4574 | ||
4575 | ||
4576 | extern int raise (int __sig) __attribute__ ((__nothrow__)); | |
4577 | ||
4578 | ||
4579 | ||
4580 | ||
4581 | extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) | |
4582 | __attribute__ ((__nothrow__)); | |
4583 | extern int gsignal (int __sig) __attribute__ ((__nothrow__)); | |
4584 | ||
4585 | ||
4586 | ||
4587 | ||
4588 | extern void psignal (int __sig, __const char *__s); | |
4589 | # 153 "../signal/signal.h" | |
4590 | extern int __sigpause (int __sig_or_mask, int __is_sig); | |
4591 | # 162 "../signal/signal.h" | |
4592 | extern int sigpause (int __sig) __asm__ ("__xpg_sigpause"); | |
4593 | # 181 "../signal/signal.h" | |
4594 | extern int sigblock (int __mask) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
4595 | ||
4596 | ||
4597 | extern int sigsetmask (int __mask) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
4598 | ||
4599 | ||
4600 | extern int siggetmask (void) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
4601 | # 196 "../signal/signal.h" | |
4602 | typedef __sighandler_t sighandler_t; | |
4603 | ||
4604 | ||
4605 | ||
4606 | ||
4607 | typedef __sighandler_t sig_t; | |
4608 | # 212 "../signal/signal.h" | |
4609 | # 1 "../sysdeps/unix/sysv/linux/bits/siginfo.h" 1 | |
4610 | # 25 "../sysdeps/unix/sysv/linux/bits/siginfo.h" | |
4611 | # 1 "../sysdeps/wordsize-32/bits/wordsize.h" 1 | |
4612 | # 26 "../sysdeps/unix/sysv/linux/bits/siginfo.h" 2 | |
4613 | ||
4614 | ||
4615 | ||
4616 | ||
4617 | ||
4618 | ||
4619 | ||
4620 | typedef union sigval | |
4621 | { | |
4622 | int sival_int; | |
4623 | void *sival_ptr; | |
4624 | } sigval_t; | |
4625 | # 51 "../sysdeps/unix/sysv/linux/bits/siginfo.h" | |
4626 | typedef struct siginfo | |
4627 | { | |
4628 | int si_signo; | |
4629 | int si_errno; | |
4630 | ||
4631 | int si_code; | |
4632 | ||
4633 | union | |
4634 | { | |
4635 | int _pad[((128 / sizeof (int)) - 3)]; | |
4636 | ||
4637 | ||
4638 | struct | |
4639 | { | |
4640 | __pid_t si_pid; | |
4641 | __uid_t si_uid; | |
4642 | } _kill; | |
4643 | ||
4644 | ||
4645 | struct | |
4646 | { | |
4647 | int si_tid; | |
4648 | int si_overrun; | |
4649 | sigval_t si_sigval; | |
4650 | } _timer; | |
4651 | ||
4652 | ||
4653 | struct | |
4654 | { | |
4655 | __pid_t si_pid; | |
4656 | __uid_t si_uid; | |
4657 | sigval_t si_sigval; | |
4658 | } _rt; | |
4659 | ||
4660 | ||
4661 | struct | |
4662 | { | |
4663 | __pid_t si_pid; | |
4664 | __uid_t si_uid; | |
4665 | int si_status; | |
4666 | __clock_t si_utime; | |
4667 | __clock_t si_stime; | |
4668 | } _sigchld; | |
4669 | ||
4670 | ||
4671 | struct | |
4672 | { | |
4673 | void *si_addr; | |
4674 | } _sigfault; | |
4675 | ||
4676 | ||
4677 | struct | |
4678 | { | |
4679 | long int si_band; | |
4680 | int si_fd; | |
4681 | } _sigpoll; | |
4682 | } _sifields; | |
4683 | } siginfo_t; | |
4684 | # 129 "../sysdeps/unix/sysv/linux/bits/siginfo.h" | |
4685 | enum | |
4686 | { | |
4687 | SI_ASYNCNL = -60, | |
4688 | ||
4689 | SI_TKILL = -6, | |
4690 | ||
4691 | SI_SIGIO, | |
4692 | ||
4693 | SI_ASYNCIO, | |
4694 | ||
4695 | SI_MESGQ, | |
4696 | ||
4697 | SI_TIMER, | |
4698 | ||
4699 | SI_QUEUE, | |
4700 | ||
4701 | SI_USER, | |
4702 | ||
4703 | SI_KERNEL = 0x80 | |
4704 | ||
4705 | }; | |
4706 | ||
4707 | ||
4708 | ||
4709 | enum | |
4710 | { | |
4711 | ILL_ILLOPC = 1, | |
4712 | ||
4713 | ILL_ILLOPN, | |
4714 | ||
4715 | ILL_ILLADR, | |
4716 | ||
4717 | ILL_ILLTRP, | |
4718 | ||
4719 | ILL_PRVOPC, | |
4720 | ||
4721 | ILL_PRVREG, | |
4722 | ||
4723 | ILL_COPROC, | |
4724 | ||
4725 | ILL_BADSTK | |
4726 | ||
4727 | }; | |
4728 | ||
4729 | ||
4730 | enum | |
4731 | { | |
4732 | FPE_INTDIV = 1, | |
4733 | ||
4734 | FPE_INTOVF, | |
4735 | ||
4736 | FPE_FLTDIV, | |
4737 | ||
4738 | FPE_FLTOVF, | |
4739 | ||
4740 | FPE_FLTUND, | |
4741 | ||
4742 | FPE_FLTRES, | |
4743 | ||
4744 | FPE_FLTINV, | |
4745 | ||
4746 | FPE_FLTSUB | |
4747 | ||
4748 | }; | |
4749 | ||
4750 | ||
4751 | enum | |
4752 | { | |
4753 | SEGV_MAPERR = 1, | |
4754 | ||
4755 | SEGV_ACCERR | |
4756 | ||
4757 | }; | |
4758 | ||
4759 | ||
4760 | enum | |
4761 | { | |
4762 | BUS_ADRALN = 1, | |
4763 | ||
4764 | BUS_ADRERR, | |
4765 | ||
4766 | BUS_OBJERR | |
4767 | ||
4768 | }; | |
4769 | ||
4770 | ||
4771 | enum | |
4772 | { | |
4773 | TRAP_BRKPT = 1, | |
4774 | ||
4775 | TRAP_TRACE | |
4776 | ||
4777 | }; | |
4778 | ||
4779 | ||
4780 | enum | |
4781 | { | |
4782 | CLD_EXITED = 1, | |
4783 | ||
4784 | CLD_KILLED, | |
4785 | ||
4786 | CLD_DUMPED, | |
4787 | ||
4788 | CLD_TRAPPED, | |
4789 | ||
4790 | CLD_STOPPED, | |
4791 | ||
4792 | CLD_CONTINUED | |
4793 | ||
4794 | }; | |
4795 | ||
4796 | ||
4797 | enum | |
4798 | { | |
4799 | POLL_IN = 1, | |
4800 | ||
4801 | POLL_OUT, | |
4802 | ||
4803 | POLL_MSG, | |
4804 | ||
4805 | POLL_ERR, | |
4806 | ||
4807 | POLL_PRI, | |
4808 | ||
4809 | POLL_HUP | |
4810 | ||
4811 | }; | |
4812 | # 273 "../sysdeps/unix/sysv/linux/bits/siginfo.h" | |
4813 | typedef struct sigevent | |
4814 | { | |
4815 | sigval_t sigev_value; | |
4816 | int sigev_signo; | |
4817 | int sigev_notify; | |
4818 | ||
4819 | union | |
4820 | { | |
4821 | int _pad[((64 / sizeof (int)) - 3)]; | |
4822 | ||
4823 | ||
4824 | ||
4825 | __pid_t _tid; | |
4826 | ||
4827 | struct | |
4828 | { | |
4829 | void (*_function) (sigval_t); | |
4830 | void *_attribute; | |
4831 | } _sigev_thread; | |
4832 | } _sigev_un; | |
4833 | } sigevent_t; | |
4834 | ||
4835 | ||
4836 | ||
4837 | ||
4838 | ||
4839 | ||
4840 | enum | |
4841 | { | |
4842 | SIGEV_SIGNAL = 0, | |
4843 | ||
4844 | SIGEV_NONE, | |
4845 | ||
4846 | SIGEV_THREAD, | |
4847 | ||
4848 | ||
4849 | SIGEV_THREAD_ID = 4 | |
4850 | ||
4851 | }; | |
4852 | # 213 "../signal/signal.h" 2 | |
4853 | ||
4854 | ||
4855 | ||
4856 | extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4857 | ||
4858 | ||
4859 | extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4860 | ||
4861 | ||
4862 | extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4863 | ||
4864 | ||
4865 | extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4866 | ||
4867 | ||
4868 | extern int sigismember (__const sigset_t *__set, int __signo) | |
4869 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4870 | ||
4871 | ||
4872 | ||
4873 | extern int sigisemptyset (__const sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4874 | ||
4875 | ||
4876 | extern int sigandset (sigset_t *__set, __const sigset_t *__left, | |
4877 | __const sigset_t *__right) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))); | |
4878 | ||
4879 | ||
4880 | extern int sigorset (sigset_t *__set, __const sigset_t *__left, | |
4881 | __const sigset_t *__right) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))); | |
4882 | ||
4883 | ||
4884 | ||
4885 | ||
4886 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h" 1 | |
4887 | # 25 "../ports/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h" | |
4888 | struct sigaction | |
4889 | { | |
4890 | ||
4891 | ||
4892 | union | |
4893 | { | |
4894 | ||
4895 | __sighandler_t sa_handler; | |
4896 | ||
4897 | void (*sa_sigaction) (int, siginfo_t *, void *); | |
4898 | } | |
4899 | __sigaction_handler; | |
4900 | ||
4901 | ||
4902 | ||
4903 | ||
4904 | ||
4905 | ||
4906 | ||
4907 | unsigned long int sa_flags; | |
4908 | ||
4909 | ||
4910 | __sigset_t sa_mask; | |
4911 | }; | |
4912 | # 247 "../signal/signal.h" 2 | |
4913 | ||
4914 | ||
4915 | extern int sigprocmask (int __how, __const sigset_t *__restrict __set, | |
4916 | sigset_t *__restrict __oset) __attribute__ ((__nothrow__)); | |
4917 | ||
4918 | ||
4919 | ||
4920 | ||
4921 | ||
4922 | ||
4923 | extern int sigsuspend (__const sigset_t *__set) __attribute__ ((__nonnull__ (1))); | |
4924 | ||
4925 | ||
4926 | extern int sigaction (int __sig, __const struct sigaction *__restrict __act, | |
4927 | struct sigaction *__restrict __oact) __attribute__ ((__nothrow__)); | |
4928 | ||
4929 | ||
4930 | extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
4931 | ||
4932 | ||
4933 | ||
4934 | ||
4935 | ||
4936 | ||
4937 | extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig) | |
4938 | __attribute__ ((__nonnull__ (1, 2))); | |
4939 | ||
4940 | ||
4941 | ||
4942 | ||
4943 | ||
4944 | ||
4945 | extern int sigwaitinfo (__const sigset_t *__restrict __set, | |
4946 | siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1))); | |
4947 | ||
4948 | ||
4949 | ||
4950 | ||
4951 | ||
4952 | ||
4953 | extern int sigtimedwait (__const sigset_t *__restrict __set, | |
4954 | siginfo_t *__restrict __info, | |
4955 | __const struct timespec *__restrict __timeout) | |
4956 | __attribute__ ((__nonnull__ (1))); | |
4957 | ||
4958 | ||
4959 | ||
4960 | extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val) | |
4961 | __attribute__ ((__nothrow__)); | |
4962 | # 304 "../signal/signal.h" | |
4963 | extern __const char *__const _sys_siglist[65]; | |
4964 | extern __const char *__const sys_siglist[65]; | |
4965 | ||
4966 | ||
4967 | struct sigvec | |
4968 | { | |
4969 | __sighandler_t sv_handler; | |
4970 | int sv_mask; | |
4971 | ||
4972 | int sv_flags; | |
4973 | ||
4974 | }; | |
4975 | # 328 "../signal/signal.h" | |
4976 | extern int sigvec (int __sig, __const struct sigvec *__vec, | |
4977 | struct sigvec *__ovec) __attribute__ ((__nothrow__)); | |
4978 | ||
4979 | ||
4980 | ||
4981 | # 1 "../sysdeps/unix/sysv/linux/bits/sigcontext.h" 1 | |
4982 | # 28 "../sysdeps/unix/sysv/linux/bits/sigcontext.h" | |
4983 | # 1 "/usr/include/asm/sigcontext.h" 1 3 4 | |
4984 | # 9 "/usr/include/asm/sigcontext.h" 3 4 | |
4985 | struct sigcontext { | |
4986 | unsigned long sc_flags; | |
4987 | ||
4988 | unsigned long sc_gr[32]; | |
4989 | unsigned long long sc_fr[32]; | |
4990 | unsigned long sc_iasq[2]; | |
4991 | unsigned long sc_iaoq[2]; | |
4992 | unsigned long sc_sar; | |
4993 | }; | |
4994 | # 29 "../sysdeps/unix/sysv/linux/bits/sigcontext.h" 2 | |
4995 | # 334 "../signal/signal.h" 2 | |
4996 | ||
4997 | ||
4998 | extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__)); | |
4999 | # 346 "../signal/signal.h" | |
5000 | extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__)); | |
5001 | ||
5002 | # 1 "../sysdeps/unix/sysv/linux/bits/sigstack.h" 1 | |
5003 | # 26 "../sysdeps/unix/sysv/linux/bits/sigstack.h" | |
5004 | struct sigstack | |
5005 | { | |
5006 | void *ss_sp; | |
5007 | int ss_onstack; | |
5008 | }; | |
5009 | ||
5010 | ||
5011 | ||
5012 | enum | |
5013 | { | |
5014 | SS_ONSTACK = 1, | |
5015 | ||
5016 | SS_DISABLE | |
5017 | ||
5018 | }; | |
5019 | # 50 "../sysdeps/unix/sysv/linux/bits/sigstack.h" | |
5020 | typedef struct sigaltstack | |
5021 | { | |
5022 | void *ss_sp; | |
5023 | int ss_flags; | |
5024 | size_t ss_size; | |
5025 | } stack_t; | |
5026 | # 349 "../signal/signal.h" 2 | |
5027 | ||
5028 | ||
5029 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h" 1 | |
5030 | # 29 "../ports/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h" | |
5031 | # 1 "../sysdeps/unix/sysv/linux/bits/sigcontext.h" 1 | |
5032 | # 30 "../ports/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h" 2 | |
5033 | ||
5034 | ||
5035 | ||
5036 | typedef unsigned long int greg_t; | |
5037 | ||
5038 | ||
5039 | ||
5040 | ||
5041 | ||
5042 | ||
5043 | typedef struct gregset | |
5044 | { | |
5045 | greg_t g_regs[32]; | |
5046 | greg_t sr_regs[8]; | |
5047 | greg_t cr_regs[24]; | |
5048 | greg_t g_pad[16]; | |
5049 | } gregset_t; | |
5050 | ||
5051 | ||
5052 | typedef struct fpregset | |
5053 | { | |
5054 | double fp_dregs[32]; | |
5055 | } fpregset_t; | |
5056 | ||
5057 | ||
5058 | typedef struct sigcontext mcontext_t; | |
5059 | ||
5060 | ||
5061 | typedef struct ucontext | |
5062 | { | |
5063 | unsigned long int uc_flags; | |
5064 | struct ucontext *uc_link; | |
5065 | stack_t uc_stack; | |
5066 | mcontext_t uc_mcontext; | |
5067 | __sigset_t uc_sigmask; | |
5068 | } ucontext_t; | |
5069 | # 352 "../signal/signal.h" 2 | |
5070 | ||
5071 | ||
5072 | ||
5073 | ||
5074 | ||
5075 | extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) | |
5076 | __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
5077 | ||
5078 | ||
5079 | ||
5080 | extern int sigaltstack (__const struct sigaltstack *__restrict __ss, | |
5081 | struct sigaltstack *__restrict __oss) __attribute__ ((__nothrow__)); | |
5082 | ||
5083 | ||
5084 | ||
5085 | ||
5086 | ||
5087 | ||
5088 | ||
5089 | extern int sighold (int __sig) __attribute__ ((__nothrow__)); | |
5090 | ||
5091 | ||
5092 | extern int sigrelse (int __sig) __attribute__ ((__nothrow__)); | |
5093 | ||
5094 | ||
5095 | extern int sigignore (int __sig) __attribute__ ((__nothrow__)); | |
5096 | ||
5097 | ||
5098 | extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __attribute__ ((__nothrow__)); | |
5099 | ||
5100 | ||
5101 | ||
5102 | ||
5103 | ||
5104 | ||
5105 | # 1 "../nptl/sysdeps/pthread/bits/sigthread.h" 1 | |
5106 | # 31 "../nptl/sysdeps/pthread/bits/sigthread.h" | |
5107 | extern int pthread_sigmask (int __how, | |
5108 | __const __sigset_t *__restrict __newmask, | |
5109 | __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__)); | |
5110 | ||
5111 | ||
5112 | extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__)); | |
5113 | # 388 "../signal/signal.h" 2 | |
5114 | ||
5115 | ||
5116 | ||
5117 | ||
5118 | ||
5119 | ||
5120 | extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__)); | |
5121 | ||
5122 | extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__)); | |
5123 | ||
5124 | ||
5125 | ||
5126 | ||
5127 | # 6 "../include/signal.h" 2 | |
5128 | ||
5129 | ||
5130 | ||
5131 | ||
5132 | ||
5133 | ||
5134 | ||
5135 | ||
5136 | ||
5137 | ||
5138 | ||
5139 | ||
5140 | extern __sighandler_t __bsd_signal (int __sig, __sighandler_t __handler); | |
5141 | extern int __kill (__pid_t __pid, int __sig); | |
5142 | extern int __sigaction (int __sig, __const struct sigaction *__restrict __act, | |
5143 | struct sigaction *__restrict __oact); | |
5144 | ||
5145 | extern int __sigblock (int __mask); | |
5146 | extern int __sigsetmask (int __mask); | |
5147 | extern int __sigprocmask (int __how, | |
5148 | __const sigset_t *__set, sigset_t *__oset); | |
5149 | extern int __sigsuspend (__const sigset_t *__set); | |
5150 | ||
5151 | ||
5152 | extern int __sigsuspend_nocancel (__const sigset_t *__set) ; | |
5153 | ||
5154 | extern int __sigwait (__const sigset_t *__set, int *__sig); | |
5155 | ||
5156 | extern int __sigwaitinfo (__const sigset_t *__set, siginfo_t *__info); | |
5157 | ||
5158 | extern int __sigtimedwait (__const sigset_t *__set, siginfo_t *__info, | |
5159 | __const struct timespec *__timeout); | |
5160 | ||
5161 | extern int __sigqueue (__pid_t __pid, int __sig, | |
5162 | __const union sigval __val); | |
5163 | extern int __sigvec (int __sig, __const struct sigvec *__vec, | |
5164 | struct sigvec *__ovec); | |
5165 | extern int __sigreturn (struct sigcontext *__scp); | |
5166 | extern int __sigaltstack (__const struct sigaltstack *__ss, | |
5167 | struct sigaltstack *__oss); | |
5168 | extern int __libc_sigaction (int sig, const struct sigaction *act, | |
5169 | struct sigaction *oact); | |
5170 | ||
5171 | ||
5172 | extern int __sigpause (int sig_or_mask, int is_sig); | |
5173 | extern int __default_sigpause (int mask); | |
5174 | extern int __xpg_sigpause (int sig); | |
5175 | ||
5176 | ||
5177 | ||
5178 | ||
5179 | ||
5180 | ||
5181 | ||
5182 | extern int __libc_allocate_rtsig (int __high); | |
5183 | # 33 "../ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h" 2 | |
5184 | # 1 "../include/sys/time.h" 1 | |
5185 | ||
5186 | # 1 "../time/sys/time.h" 1 | |
5187 | # 29 "../time/sys/time.h" | |
5188 | # 1 "../bits/time.h" 1 | |
5189 | # 30 "../time/sys/time.h" 2 | |
5190 | # 39 "../time/sys/time.h" | |
5191 | ||
5192 | # 57 "../time/sys/time.h" | |
5193 | struct timezone | |
5194 | { | |
5195 | int tz_minuteswest; | |
5196 | int tz_dsttime; | |
5197 | }; | |
5198 | ||
5199 | typedef struct timezone *__restrict __timezone_ptr_t; | |
5200 | # 73 "../time/sys/time.h" | |
5201 | extern int gettimeofday (struct timeval *__restrict __tv, | |
5202 | __timezone_ptr_t __tz) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5203 | ||
5204 | ||
5205 | ||
5206 | ||
5207 | extern int settimeofday (__const struct timeval *__tv, | |
5208 | __const struct timezone *__tz) | |
5209 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5210 | ||
5211 | ||
5212 | ||
5213 | ||
5214 | ||
5215 | extern int adjtime (__const struct timeval *__delta, | |
5216 | struct timeval *__olddelta) __attribute__ ((__nothrow__)); | |
5217 | ||
5218 | ||
5219 | ||
5220 | ||
5221 | enum __itimer_which | |
5222 | { | |
5223 | ||
5224 | ITIMER_REAL = 0, | |
5225 | ||
5226 | ||
5227 | ITIMER_VIRTUAL = 1, | |
5228 | ||
5229 | ||
5230 | ||
5231 | ITIMER_PROF = 2 | |
5232 | ||
5233 | }; | |
5234 | ||
5235 | ||
5236 | ||
5237 | struct itimerval | |
5238 | { | |
5239 | ||
5240 | struct timeval it_interval; | |
5241 | ||
5242 | struct timeval it_value; | |
5243 | }; | |
5244 | ||
5245 | ||
5246 | ||
5247 | ||
5248 | typedef enum __itimer_which __itimer_which_t; | |
5249 | ||
5250 | ||
5251 | ||
5252 | ||
5253 | ||
5254 | ||
5255 | extern int getitimer (__itimer_which_t __which, | |
5256 | struct itimerval *__value) __attribute__ ((__nothrow__)); | |
5257 | ||
5258 | ||
5259 | ||
5260 | ||
5261 | extern int setitimer (__itimer_which_t __which, | |
5262 | __const struct itimerval *__restrict __new, | |
5263 | struct itimerval *__restrict __old) __attribute__ ((__nothrow__)); | |
5264 | ||
5265 | ||
5266 | ||
5267 | ||
5268 | extern int utimes (__const char *__file, __const struct timeval __tvp[2]) | |
5269 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5270 | ||
5271 | ||
5272 | ||
5273 | extern int lutimes (__const char *__file, __const struct timeval __tvp[2]) | |
5274 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
5275 | ||
5276 | ||
5277 | extern int futimes (int __fd, __const struct timeval __tvp[2]) __attribute__ ((__nothrow__)); | |
5278 | ||
5279 | ||
5280 | ||
5281 | ||
5282 | ||
5283 | ||
5284 | extern int futimesat (int __fd, __const char *__file, | |
5285 | __const struct timeval __tvp[2]) __attribute__ ((__nothrow__)); | |
5286 | # 191 "../time/sys/time.h" | |
5287 | ||
5288 | # 3 "../include/sys/time.h" 2 | |
5289 | ||
5290 | ||
5291 | extern int __gettimeofday (struct timeval *__tv, | |
5292 | struct timezone *__tz); | |
5293 | extern int __gettimeofday_internal (struct timeval *__tv, | |
5294 | struct timezone *__tz) | |
5295 | ; | |
5296 | extern int __settimeofday (__const struct timeval *__tv, | |
5297 | __const struct timezone *__tz) | |
5298 | ; | |
5299 | extern int __adjtime (__const struct timeval *__delta, | |
5300 | struct timeval *__olddelta); | |
5301 | extern int __getitimer (enum __itimer_which __which, | |
5302 | struct itimerval *__value); | |
5303 | extern int __setitimer (enum __itimer_which __which, | |
5304 | __const struct itimerval *__restrict __new, | |
5305 | struct itimerval *__restrict __old) | |
5306 | ; | |
5307 | extern int __utimes (__const char *__file, const struct timeval __tvp[2]) | |
5308 | ; | |
5309 | extern int __futimes (int fd, __const struct timeval tvp[2]) ; | |
5310 | # 34 "../ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h" 2 | |
5311 | # 1 "../include/sys/types.h" 1 | |
5312 | # 35 "../ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h" 2 | |
5313 | ||
5314 | # 1 "../sysdeps/unix/sysv/linux/sys/user.h" 1 | |
5315 | # 1 "/usr/include/linux/user.h" 1 3 4 | |
5316 | # 1 "/usr/include/asm/user.h" 1 3 4 | |
5317 | # 1 "/usr/include/linux/user.h" 2 3 4 | |
5318 | # 1 "../sysdeps/unix/sysv/linux/sys/user.h" 2 | |
5319 | # 37 "../ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h" 2 | |
5320 | # 1 "/usr/include/asm/elf.h" 1 3 4 | |
5321 | ||
5322 | ||
5323 | ||
5324 | ||
5325 | ||
5326 | ||
5327 | ||
5328 | # 1 "/usr/include/asm/ptrace.h" 1 3 4 | |
5329 | ||
5330 | ||
5331 | ||
5332 | ||
5333 | ||
5334 | ||
5335 | ||
5336 | # 1 "/usr/include/linux/types.h" 1 3 4 | |
5337 | ||
5338 | ||
5339 | ||
5340 | # 1 "../include/sys/types.h" 1 3 4 | |
5341 | # 5 "/usr/include/linux/types.h" 2 3 4 | |
5342 | # 1 "../sysdeps/generic/inttypes.h" 1 3 4 | |
5343 | # 35 "../sysdeps/generic/inttypes.h" 3 4 | |
5344 | typedef long int __gwchar_t; | |
5345 | # 274 "../sysdeps/generic/inttypes.h" 3 4 | |
5346 | ||
5347 | # 288 "../sysdeps/generic/inttypes.h" 3 4 | |
5348 | typedef struct | |
5349 | { | |
5350 | long long int quot; | |
5351 | long long int rem; | |
5352 | } imaxdiv_t; | |
5353 | ||
5354 | ||
5355 | ||
5356 | ||
5357 | ||
5358 | extern intmax_t imaxabs (intmax_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
5359 | ||
5360 | ||
5361 | extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom) | |
5362 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
5363 | ||
5364 | ||
5365 | extern intmax_t strtoimax (__const char *__restrict __nptr, | |
5366 | char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)); | |
5367 | ||
5368 | ||
5369 | extern uintmax_t strtoumax (__const char *__restrict __nptr, | |
5370 | char ** __restrict __endptr, int __base) __attribute__ ((__nothrow__)); | |
5371 | ||
5372 | ||
5373 | extern intmax_t wcstoimax (__const __gwchar_t *__restrict __nptr, | |
5374 | __gwchar_t **__restrict __endptr, int __base) | |
5375 | __attribute__ ((__nothrow__)); | |
5376 | ||
5377 | ||
5378 | extern uintmax_t wcstoumax (__const __gwchar_t *__restrict __nptr, | |
5379 | __gwchar_t ** __restrict __endptr, int __base) | |
5380 | __attribute__ ((__nothrow__)); | |
5381 | # 396 "../sysdeps/generic/inttypes.h" 3 4 | |
5382 | extern __inline intmax_t | |
5383 | __attribute__ ((__nothrow__)) strtoimax (__const char *__restrict nptr, char **__restrict endptr, int base) | |
5384 | ||
5385 | { | |
5386 | return __strtoll_internal (nptr, endptr, base, 0); | |
5387 | } | |
5388 | # 414 "../sysdeps/generic/inttypes.h" 3 4 | |
5389 | extern __inline uintmax_t | |
5390 | __attribute__ ((__nothrow__)) strtoumax (__const char *__restrict nptr, char **__restrict endptr, int base) | |
5391 | ||
5392 | { | |
5393 | return __strtoull_internal (nptr, endptr, base, 0); | |
5394 | } | |
5395 | ||
5396 | ||
5397 | ||
5398 | __extension__ | |
5399 | extern long long int __wcstoll_internal (__const __gwchar_t * | |
5400 | __restrict __nptr, | |
5401 | __gwchar_t **__restrict __endptr, | |
5402 | int __base, int __group) __attribute__ ((__nothrow__)); | |
5403 | ||
5404 | ||
5405 | extern __inline intmax_t | |
5406 | __attribute__ ((__nothrow__)) wcstoimax (__const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base) | |
5407 | ||
5408 | { | |
5409 | return __wcstoll_internal (nptr, endptr, base, 0); | |
5410 | } | |
5411 | ||
5412 | ||
5413 | ||
5414 | ||
5415 | __extension__ | |
5416 | extern unsigned long long int __wcstoull_internal (__const __gwchar_t * | |
5417 | __restrict __nptr, | |
5418 | __gwchar_t ** | |
5419 | __restrict __endptr, | |
5420 | int __base, | |
5421 | int __group) __attribute__ ((__nothrow__)); | |
5422 | ||
5423 | ||
5424 | extern __inline uintmax_t | |
5425 | __attribute__ ((__nothrow__)) wcstoumax (__const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base) | |
5426 | ||
5427 | { | |
5428 | return __wcstoull_internal (nptr, endptr, base, 0); | |
5429 | } | |
5430 | ||
5431 | ||
5432 | ||
5433 | ||
5434 | ||
5435 | # 6 "/usr/include/linux/types.h" 2 3 4 | |
5436 | # 1 "/usr/include/linux/posix_types.h" 1 3 4 | |
5437 | ||
5438 | ||
5439 | ||
5440 | # 1 "/usr/include/linux/stddef.h" 1 3 4 | |
5441 | # 5 "/usr/include/linux/posix_types.h" 2 3 4 | |
5442 | # 36 "/usr/include/linux/posix_types.h" 3 4 | |
5443 | typedef struct { | |
5444 | unsigned long fds_bits [(1024/(8 * sizeof(unsigned long)))]; | |
5445 | } __kernel_fd_set; | |
5446 | ||
5447 | ||
5448 | typedef void (*__kernel_sighandler_t)(int); | |
5449 | ||
5450 | ||
5451 | typedef int __kernel_key_t; | |
5452 | typedef int __kernel_mqd_t; | |
5453 | ||
5454 | # 1 "/usr/include/asm/posix_types.h" 1 3 4 | |
5455 | # 9 "/usr/include/asm/posix_types.h" 3 4 | |
5456 | typedef unsigned long __kernel_ino_t; | |
5457 | typedef unsigned short __kernel_mode_t; | |
5458 | typedef unsigned short __kernel_nlink_t; | |
5459 | typedef long __kernel_off_t; | |
5460 | typedef int __kernel_pid_t; | |
5461 | typedef unsigned short __kernel_ipc_pid_t; | |
5462 | typedef unsigned int __kernel_uid_t; | |
5463 | typedef unsigned int __kernel_gid_t; | |
5464 | typedef int __kernel_suseconds_t; | |
5465 | typedef long __kernel_clock_t; | |
5466 | typedef int __kernel_timer_t; | |
5467 | typedef int __kernel_clockid_t; | |
5468 | typedef int __kernel_daddr_t; | |
5469 | ||
5470 | ||
5471 | ||
5472 | ||
5473 | ||
5474 | ||
5475 | ||
5476 | typedef unsigned int __kernel_size_t; | |
5477 | typedef int __kernel_ssize_t; | |
5478 | typedef int __kernel_ptrdiff_t; | |
5479 | typedef long __kernel_time_t; | |
5480 | ||
5481 | typedef char * __kernel_caddr_t; | |
5482 | ||
5483 | typedef unsigned short __kernel_uid16_t; | |
5484 | typedef unsigned short __kernel_gid16_t; | |
5485 | typedef unsigned int __kernel_uid32_t; | |
5486 | typedef unsigned int __kernel_gid32_t; | |
5487 | ||
5488 | ||
5489 | typedef long long __kernel_loff_t; | |
5490 | typedef long long __kernel_off64_t; | |
5491 | typedef unsigned long long __kernel_ino64_t; | |
5492 | ||
5493 | ||
5494 | typedef unsigned int __kernel_old_dev_t; | |
5495 | ||
5496 | typedef struct { | |
5497 | ||
5498 | ||
5499 | ||
5500 | int __val[2]; | |
5501 | ||
5502 | } __kernel_fsid_t; | |
5503 | ||
5504 | ||
5505 | typedef __kernel_uid_t __kernel_old_uid_t; | |
5506 | typedef __kernel_gid_t __kernel_old_gid_t; | |
5507 | # 48 "/usr/include/linux/posix_types.h" 2 3 4 | |
5508 | # 7 "/usr/include/linux/types.h" 2 3 4 | |
5509 | # 1 "/usr/include/asm/types.h" 1 3 4 | |
5510 | ||
5511 | ||
5512 | ||
5513 | ||
5514 | ||
5515 | typedef unsigned short umode_t; | |
5516 | ||
5517 | ||
5518 | ||
5519 | ||
5520 | ||
5521 | ||
5522 | typedef __signed__ char __s8; | |
5523 | typedef unsigned char __u8; | |
5524 | ||
5525 | typedef __signed__ short __s16; | |
5526 | typedef unsigned short __u16; | |
5527 | ||
5528 | typedef __signed__ int __s32; | |
5529 | typedef unsigned int __u32; | |
5530 | ||
5531 | ||
5532 | typedef __signed__ long long __s64; | |
5533 | typedef unsigned long long __u64; | |
5534 | # 8 "/usr/include/linux/types.h" 2 3 4 | |
5535 | # 148 "/usr/include/linux/types.h" 3 4 | |
5536 | typedef __u16 __le16; | |
5537 | typedef __u16 __be16; | |
5538 | typedef __u32 __le32; | |
5539 | typedef __u32 __be32; | |
5540 | ||
5541 | typedef __u64 __le64; | |
5542 | typedef __u64 __be64; | |
5543 | ||
5544 | ||
5545 | ||
5546 | struct ustat { | |
5547 | __kernel_daddr_t f_tfree; | |
5548 | __kernel_ino_t f_tinode; | |
5549 | char f_fname[6]; | |
5550 | char f_fpack[6]; | |
5551 | }; | |
5552 | # 9 "/usr/include/asm/ptrace.h" 2 3 4 | |
5553 | # 18 "/usr/include/asm/ptrace.h" 3 4 | |
5554 | struct pt_regs { | |
5555 | unsigned long gr[32]; | |
5556 | __u64 fr[32]; | |
5557 | unsigned long sr[ 8]; | |
5558 | unsigned long iasq[2]; | |
5559 | unsigned long iaoq[2]; | |
5560 | unsigned long cr27; | |
5561 | unsigned long pad0; | |
5562 | unsigned long orig_r28; | |
5563 | unsigned long ksp; | |
5564 | unsigned long kpc; | |
5565 | unsigned long sar; | |
5566 | unsigned long iir; | |
5567 | unsigned long isr; | |
5568 | unsigned long ior; | |
5569 | unsigned long ipsw; | |
5570 | }; | |
5571 | # 9 "/usr/include/asm/elf.h" 2 3 4 | |
5572 | # 158 "/usr/include/asm/elf.h" 3 4 | |
5573 | typedef struct elf32_fdesc { | |
5574 | __u32 addr; | |
5575 | __u32 gp; | |
5576 | } Elf32_Fdesc; | |
5577 | ||
5578 | ||
5579 | typedef struct elf64_fdesc { | |
5580 | __u64 dummy[2]; | |
5581 | ||
5582 | __u64 addr; | |
5583 | __u64 gp; | |
5584 | } Elf64_Fdesc; | |
5585 | # 229 "/usr/include/asm/elf.h" 3 4 | |
5586 | typedef unsigned long elf_greg_t; | |
5587 | # 285 "/usr/include/asm/elf.h" 3 4 | |
5588 | typedef elf_greg_t elf_gregset_t[80]; | |
5589 | ||
5590 | ||
5591 | typedef double elf_fpreg_t; | |
5592 | typedef elf_fpreg_t elf_fpregset_t[32]; | |
5593 | ||
5594 | struct task_struct; | |
5595 | ||
5596 | extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *); | |
5597 | ||
5598 | ||
5599 | struct pt_regs; | |
5600 | # 38 "../ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h" 2 | |
5601 | ||
5602 | ||
5603 | ||
5604 | struct elf_siginfo | |
5605 | { | |
5606 | int si_signo; | |
5607 | int si_code; | |
5608 | int si_errno; | |
5609 | }; | |
5610 | # 55 "../ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h" | |
5611 | struct elf_prstatus | |
5612 | { | |
5613 | struct elf_siginfo pr_info; | |
5614 | short int pr_cursig; | |
5615 | unsigned long int pr_sigpend; | |
5616 | unsigned long int pr_sighold; | |
5617 | __pid_t pr_pid; | |
5618 | __pid_t pr_ppid; | |
5619 | __pid_t pr_pgrp; | |
5620 | __pid_t pr_sid; | |
5621 | struct timeval pr_utime; | |
5622 | struct timeval pr_stime; | |
5623 | struct timeval pr_cutime; | |
5624 | struct timeval pr_cstime; | |
5625 | elf_gregset_t pr_reg; | |
5626 | int pr_fpvalid; | |
5627 | }; | |
5628 | ||
5629 | ||
5630 | ||
5631 | ||
5632 | struct elf_prpsinfo | |
5633 | { | |
5634 | char pr_state; | |
5635 | char pr_sname; | |
5636 | char pr_zomb; | |
5637 | char pr_nice; | |
5638 | unsigned long int pr_flag; | |
5639 | unsigned int pr_uid; | |
5640 | unsigned int pr_gid; | |
5641 | int pr_pid, pr_ppid, pr_pgrp, pr_sid; | |
5642 | ||
5643 | char pr_fname[16]; | |
5644 | char pr_psargs[(80)]; | |
5645 | }; | |
5646 | ||
5647 | ||
5648 | ||
5649 | ||
5650 | ||
5651 | ||
5652 | ||
5653 | typedef void *psaddr_t; | |
5654 | ||
5655 | ||
5656 | typedef elf_gregset_t prgregset_t; | |
5657 | typedef elf_fpregset_t prfpregset_t; | |
5658 | ||
5659 | ||
5660 | ||
5661 | typedef __pid_t lwpid_t; | |
5662 | ||
5663 | ||
5664 | typedef struct elf_prstatus prstatus_t; | |
5665 | typedef struct elf_prpsinfo prpsinfo_t; | |
5666 | ||
5667 | ||
5668 | # 30 "../nptl/../nptl_db/thread_db.h" 2 | |
5669 | ||
5670 | ||
5671 | ||
5672 | typedef enum | |
5673 | { | |
5674 | TD_OK, | |
5675 | TD_ERR, | |
5676 | TD_NOTHR, | |
5677 | TD_NOSV, | |
5678 | TD_NOLWP, | |
5679 | TD_BADPH, | |
5680 | TD_BADTH, | |
5681 | TD_BADSH, | |
5682 | TD_BADTA, | |
5683 | TD_BADKEY, | |
5684 | TD_NOMSG, | |
5685 | TD_NOFPREGS, | |
5686 | TD_NOLIBTHREAD, | |
5687 | TD_NOEVENT, | |
5688 | TD_NOCAPAB, | |
5689 | TD_DBERR, | |
5690 | TD_NOAPLIC, | |
5691 | TD_NOTSD, | |
5692 | TD_MALLOC, | |
5693 | TD_PARTIALREG, | |
5694 | TD_NOXREGS, | |
5695 | TD_TLSDEFER, | |
5696 | TD_NOTALLOC = TD_TLSDEFER, | |
5697 | TD_VERSION, | |
5698 | TD_NOTLS | |
5699 | } td_err_e; | |
5700 | ||
5701 | ||
5702 | ||
5703 | ||
5704 | typedef enum | |
5705 | { | |
5706 | TD_THR_ANY_STATE, | |
5707 | TD_THR_UNKNOWN, | |
5708 | TD_THR_STOPPED, | |
5709 | TD_THR_RUN, | |
5710 | TD_THR_ACTIVE, | |
5711 | TD_THR_ZOMBIE, | |
5712 | TD_THR_SLEEP, | |
5713 | TD_THR_STOPPED_ASLEEP | |
5714 | } td_thr_state_e; | |
5715 | ||
5716 | ||
5717 | ||
5718 | typedef enum | |
5719 | { | |
5720 | TD_THR_ANY_TYPE, | |
5721 | TD_THR_USER, | |
5722 | TD_THR_SYSTEM | |
5723 | } td_thr_type_e; | |
5724 | ||
5725 | ||
5726 | ||
5727 | ||
5728 | ||
5729 | typedef struct td_thragent td_thragent_t; | |
5730 | ||
5731 | ||
5732 | typedef struct td_thrhandle | |
5733 | { | |
5734 | td_thragent_t *th_ta_p; | |
5735 | psaddr_t th_unique; | |
5736 | } td_thrhandle_t; | |
5737 | ||
5738 | ||
5739 | ||
5740 | struct link_map; | |
5741 | # 116 "../nptl/../nptl_db/thread_db.h" | |
5742 | typedef struct td_thr_events | |
5743 | { | |
5744 | uint32_t event_bits[2]; | |
5745 | } td_thr_events_t; | |
5746 | # 155 "../nptl/../nptl_db/thread_db.h" | |
5747 | typedef enum | |
5748 | { | |
5749 | TD_ALL_EVENTS, | |
5750 | TD_EVENT_NONE = TD_ALL_EVENTS, | |
5751 | TD_READY, | |
5752 | TD_SLEEP, | |
5753 | TD_SWITCHTO, | |
5754 | TD_SWITCHFROM, | |
5755 | TD_LOCK_TRY, | |
5756 | TD_CATCHSIG, | |
5757 | TD_IDLE, | |
5758 | TD_CREATE, | |
5759 | TD_DEATH, | |
5760 | TD_PREEMPT, | |
5761 | TD_PRI_INHERIT, | |
5762 | TD_REAP, | |
5763 | TD_CONCURRENCY, | |
5764 | TD_TIMEOUT, | |
5765 | TD_MIN_EVENT_NUM = TD_READY, | |
5766 | TD_MAX_EVENT_NUM = TD_TIMEOUT, | |
5767 | TD_EVENTS_ENABLE = 31 | |
5768 | } td_event_e; | |
5769 | ||
5770 | ||
5771 | typedef enum | |
5772 | { | |
5773 | NOTIFY_BPT, | |
5774 | NOTIFY_AUTOBPT, | |
5775 | ||
5776 | NOTIFY_SYSCALL | |
5777 | } td_notify_e; | |
5778 | ||
5779 | ||
5780 | typedef struct td_notify | |
5781 | { | |
5782 | td_notify_e type; | |
5783 | union | |
5784 | { | |
5785 | psaddr_t bptaddr; | |
5786 | int syscallno; | |
5787 | } u; | |
5788 | } td_notify_t; | |
5789 | ||
5790 | ||
5791 | typedef struct td_event_msg | |
5792 | { | |
5793 | td_event_e event; | |
5794 | const td_thrhandle_t *th_p; | |
5795 | union | |
5796 | { | |
5797 | ||
5798 | ||
5799 | ||
5800 | uintptr_t data; | |
5801 | } msg; | |
5802 | } td_event_msg_t; | |
5803 | ||
5804 | ||
5805 | typedef struct | |
5806 | { | |
5807 | td_thr_events_t eventmask; | |
5808 | td_event_e eventnum; | |
5809 | void *eventdata; | |
5810 | } td_eventbuf_t; | |
5811 | ||
5812 | ||
5813 | ||
5814 | typedef struct td_ta_stats | |
5815 | { | |
5816 | int nthreads; | |
5817 | int r_concurrency; | |
5818 | int nrunnable_num; | |
5819 | int nrunnable_den; | |
5820 | int a_concurrency_num; | |
5821 | int a_concurrency_den; | |
5822 | int nlwps_num; | |
5823 | ||
5824 | int nlwps_den; | |
5825 | ||
5826 | int nidle_num; | |
5827 | ||
5828 | int nidle_den; | |
5829 | ||
5830 | } td_ta_stats_t; | |
5831 | ||
5832 | ||
5833 | ||
5834 | ||
5835 | typedef pthread_t thread_t; | |
5836 | typedef pthread_key_t thread_key_t; | |
5837 | ||
5838 | ||
5839 | ||
5840 | typedef int td_thr_iter_f (const td_thrhandle_t *, void *); | |
5841 | ||
5842 | ||
5843 | typedef int td_key_iter_f (thread_key_t, void (*) (void *), void *); | |
5844 | ||
5845 | ||
5846 | ||
5847 | ||
5848 | struct ps_prochandle; | |
5849 | ||
5850 | ||
5851 | ||
5852 | typedef struct td_thrinfo | |
5853 | { | |
5854 | td_thragent_t *ti_ta_p; | |
5855 | unsigned int ti_user_flags; | |
5856 | thread_t ti_tid; | |
5857 | ||
5858 | char *ti_tls; | |
5859 | psaddr_t ti_startfunc; | |
5860 | ||
5861 | psaddr_t ti_stkbase; | |
5862 | long int ti_stksize; | |
5863 | psaddr_t ti_ro_area; | |
5864 | int ti_ro_size; | |
5865 | td_thr_state_e ti_state; | |
5866 | unsigned char ti_db_suspended; | |
5867 | td_thr_type_e ti_type; | |
5868 | ||
5869 | intptr_t ti_pc; | |
5870 | intptr_t ti_sp; | |
5871 | short int ti_flags; | |
5872 | int ti_pri; | |
5873 | lwpid_t ti_lid; | |
5874 | sigset_t ti_sigmask; | |
5875 | unsigned char ti_traceme; | |
5876 | ||
5877 | unsigned char ti_preemptflag; | |
5878 | unsigned char ti_pirecflag; | |
5879 | sigset_t ti_pending; | |
5880 | td_thr_events_t ti_events; | |
5881 | } td_thrinfo_t; | |
5882 | ||
5883 | ||
5884 | ||
5885 | ||
5886 | ||
5887 | ||
5888 | extern td_err_e td_init (void); | |
5889 | ||
5890 | ||
5891 | extern td_err_e td_log (void); | |
5892 | ||
5893 | ||
5894 | extern const char **td_symbol_list (void); | |
5895 | ||
5896 | ||
5897 | extern td_err_e td_ta_new (struct ps_prochandle *__ps, td_thragent_t **__ta); | |
5898 | ||
5899 | ||
5900 | extern td_err_e td_ta_delete (td_thragent_t *__ta); | |
5901 | ||
5902 | ||
5903 | extern td_err_e td_ta_get_nthreads (const td_thragent_t *__ta, int *__np); | |
5904 | ||
5905 | ||
5906 | ||
5907 | extern td_err_e td_ta_get_ph (const td_thragent_t *__ta, | |
5908 | struct ps_prochandle **__ph); | |
5909 | ||
5910 | ||
5911 | ||
5912 | extern td_err_e td_ta_map_id2thr (const td_thragent_t *__ta, pthread_t __pt, | |
5913 | td_thrhandle_t *__th); | |
5914 | ||
5915 | ||
5916 | ||
5917 | extern td_err_e td_ta_map_lwp2thr (const td_thragent_t *__ta, lwpid_t __lwpid, | |
5918 | td_thrhandle_t *__th); | |
5919 | ||
5920 | ||
5921 | ||
5922 | ||
5923 | extern td_err_e td_ta_thr_iter (const td_thragent_t *__ta, | |
5924 | td_thr_iter_f *__callback, void *__cbdata_p, | |
5925 | td_thr_state_e __state, int __ti_pri, | |
5926 | sigset_t *__ti_sigmask_p, | |
5927 | unsigned int __ti_user_flags); | |
5928 | ||
5929 | ||
5930 | extern td_err_e td_ta_tsd_iter (const td_thragent_t *__ta, td_key_iter_f *__ki, | |
5931 | void *__p); | |
5932 | ||
5933 | ||
5934 | ||
5935 | extern td_err_e td_ta_event_addr (const td_thragent_t *__ta, | |
5936 | td_event_e __event, td_notify_t *__ptr); | |
5937 | ||
5938 | ||
5939 | extern td_err_e td_ta_set_event (const td_thragent_t *__ta, | |
5940 | td_thr_events_t *__event); | |
5941 | ||
5942 | ||
5943 | extern td_err_e td_ta_clear_event (const td_thragent_t *__ta, | |
5944 | td_thr_events_t *__event); | |
5945 | ||
5946 | ||
5947 | extern td_err_e td_ta_event_getmsg (const td_thragent_t *__ta, | |
5948 | td_event_msg_t *__msg); | |
5949 | ||
5950 | ||
5951 | ||
5952 | extern td_err_e td_ta_setconcurrency (const td_thragent_t *__ta, int __level); | |
5953 | ||
5954 | ||
5955 | ||
5956 | extern td_err_e td_ta_enable_stats (const td_thragent_t *__ta, int __enable); | |
5957 | ||
5958 | ||
5959 | extern td_err_e td_ta_reset_stats (const td_thragent_t *__ta); | |
5960 | ||
5961 | ||
5962 | extern td_err_e td_ta_get_stats (const td_thragent_t *__ta, | |
5963 | td_ta_stats_t *__statsp); | |
5964 | ||
5965 | ||
5966 | ||
5967 | extern td_err_e td_thr_validate (const td_thrhandle_t *__th); | |
5968 | ||
5969 | ||
5970 | extern td_err_e td_thr_get_info (const td_thrhandle_t *__th, | |
5971 | td_thrinfo_t *__infop); | |
5972 | ||
5973 | ||
5974 | extern td_err_e td_thr_getfpregs (const td_thrhandle_t *__th, | |
5975 | prfpregset_t *__regset); | |
5976 | ||
5977 | ||
5978 | extern td_err_e td_thr_getgregs (const td_thrhandle_t *__th, | |
5979 | prgregset_t __gregs); | |
5980 | ||
5981 | ||
5982 | extern td_err_e td_thr_getxregs (const td_thrhandle_t *__th, void *__xregs); | |
5983 | ||
5984 | ||
5985 | extern td_err_e td_thr_getxregsize (const td_thrhandle_t *__th, int *__sizep); | |
5986 | ||
5987 | ||
5988 | extern td_err_e td_thr_setfpregs (const td_thrhandle_t *__th, | |
5989 | const prfpregset_t *__fpregs); | |
5990 | ||
5991 | ||
5992 | extern td_err_e td_thr_setgregs (const td_thrhandle_t *__th, | |
5993 | prgregset_t __gregs); | |
5994 | ||
5995 | ||
5996 | extern td_err_e td_thr_setxregs (const td_thrhandle_t *__th, | |
5997 | const void *__addr); | |
5998 | ||
5999 | ||
6000 | ||
6001 | extern td_err_e td_thr_tlsbase (const td_thrhandle_t *__th, | |
6002 | unsigned long int __modid, | |
6003 | psaddr_t *__base); | |
6004 | ||
6005 | ||
6006 | extern td_err_e td_thr_tls_get_addr (const td_thrhandle_t *__th, | |
6007 | psaddr_t __map_address, size_t __offset, | |
6008 | psaddr_t *__address); | |
6009 | ||
6010 | ||
6011 | ||
6012 | extern td_err_e td_thr_event_enable (const td_thrhandle_t *__th, int __event); | |
6013 | ||
6014 | ||
6015 | extern td_err_e td_thr_set_event (const td_thrhandle_t *__th, | |
6016 | td_thr_events_t *__event); | |
6017 | ||
6018 | ||
6019 | extern td_err_e td_thr_clear_event (const td_thrhandle_t *__th, | |
6020 | td_thr_events_t *__event); | |
6021 | ||
6022 | ||
6023 | extern td_err_e td_thr_event_getmsg (const td_thrhandle_t *__th, | |
6024 | td_event_msg_t *__msg); | |
6025 | ||
6026 | ||
6027 | ||
6028 | extern td_err_e td_thr_setprio (const td_thrhandle_t *__th, int __prio); | |
6029 | ||
6030 | ||
6031 | ||
6032 | extern td_err_e td_thr_setsigpending (const td_thrhandle_t *__th, | |
6033 | unsigned char __n, const sigset_t *__ss); | |
6034 | ||
6035 | ||
6036 | extern td_err_e td_thr_sigsetmask (const td_thrhandle_t *__th, | |
6037 | const sigset_t *__ss); | |
6038 | ||
6039 | ||
6040 | ||
6041 | extern td_err_e td_thr_tsd (const td_thrhandle_t *__th, | |
6042 | const thread_key_t __tk, void **__data); | |
6043 | ||
6044 | ||
6045 | ||
6046 | extern td_err_e td_thr_dbsuspend (const td_thrhandle_t *__th); | |
6047 | ||
6048 | ||
6049 | extern td_err_e td_thr_dbresume (const td_thrhandle_t *__th); | |
6050 | # 34 "../nptl/descr.h" 2 | |
6051 | # 1 "../include/tls.h" 1 | |
6052 | # 35 "../nptl/descr.h" 2 | |
6053 | ||
6054 | # 1 "../sysdeps/generic/unwind.h" 1 | |
6055 | # 35 "../sysdeps/generic/unwind.h" | |
6056 | typedef unsigned _Unwind_Word __attribute__((__mode__(__word__))); | |
6057 | typedef signed _Unwind_Sword __attribute__((__mode__(__word__))); | |
6058 | ||
6059 | ||
6060 | ||
6061 | typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); | |
6062 | ||
6063 | typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__))); | |
6064 | ||
6065 | ||
6066 | ||
6067 | ||
6068 | ||
6069 | typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__))); | |
6070 | ||
6071 | ||
6072 | ||
6073 | typedef enum | |
6074 | { | |
6075 | _URC_NO_REASON = 0, | |
6076 | _URC_FOREIGN_EXCEPTION_CAUGHT = 1, | |
6077 | _URC_FATAL_PHASE2_ERROR = 2, | |
6078 | _URC_FATAL_PHASE1_ERROR = 3, | |
6079 | _URC_NORMAL_STOP = 4, | |
6080 | _URC_END_OF_STACK = 5, | |
6081 | _URC_HANDLER_FOUND = 6, | |
6082 | _URC_INSTALL_CONTEXT = 7, | |
6083 | _URC_CONTINUE_UNWIND = 8 | |
6084 | } _Unwind_Reason_Code; | |
6085 | # 72 "../sysdeps/generic/unwind.h" | |
6086 | struct _Unwind_Exception; | |
6087 | ||
6088 | typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, | |
6089 | struct _Unwind_Exception *); | |
6090 | ||
6091 | struct _Unwind_Exception | |
6092 | { | |
6093 | _Unwind_Exception_Class exception_class; | |
6094 | _Unwind_Exception_Cleanup_Fn exception_cleanup; | |
6095 | _Unwind_Word private_1; | |
6096 | _Unwind_Word private_2; | |
6097 | ||
6098 | ||
6099 | ||
6100 | ||
6101 | } __attribute__((__aligned__)); | |
6102 | ||
6103 | ||
6104 | ||
6105 | ||
6106 | typedef int _Unwind_Action; | |
6107 | # 104 "../sysdeps/generic/unwind.h" | |
6108 | struct _Unwind_Context; | |
6109 | ||
6110 | ||
6111 | extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *); | |
6112 | ||
6113 | ||
6114 | ||
6115 | typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) | |
6116 | (int, _Unwind_Action, _Unwind_Exception_Class, | |
6117 | struct _Unwind_Exception *, struct _Unwind_Context *, void *); | |
6118 | ||
6119 | extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *, | |
6120 | _Unwind_Stop_Fn, | |
6121 | void *); | |
6122 | ||
6123 | ||
6124 | extern void _Unwind_DeleteException (struct _Unwind_Exception *); | |
6125 | ||
6126 | ||
6127 | ||
6128 | extern void _Unwind_Resume (struct _Unwind_Exception *); | |
6129 | ||
6130 | ||
6131 | ||
6132 | ||
6133 | typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) | |
6134 | (struct _Unwind_Context *, void *); | |
6135 | ||
6136 | extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *); | |
6137 | ||
6138 | ||
6139 | ||
6140 | ||
6141 | ||
6142 | ||
6143 | extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int); | |
6144 | extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word); | |
6145 | ||
6146 | extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *); | |
6147 | extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr); | |
6148 | ||
6149 | ||
6150 | extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *); | |
6151 | ||
6152 | extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *); | |
6153 | ||
6154 | extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *); | |
6155 | # 167 "../sysdeps/generic/unwind.h" | |
6156 | typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn) | |
6157 | (int, _Unwind_Action, _Unwind_Exception_Class, | |
6158 | struct _Unwind_Exception *, struct _Unwind_Context *); | |
6159 | ||
6160 | ||
6161 | ||
6162 | ||
6163 | struct SjLj_Function_Context; | |
6164 | extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *); | |
6165 | extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *); | |
6166 | ||
6167 | extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException | |
6168 | (struct _Unwind_Exception *); | |
6169 | extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind | |
6170 | (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); | |
6171 | extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *); | |
6172 | # 208 "../sysdeps/generic/unwind.h" | |
6173 | extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *); | |
6174 | extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *); | |
6175 | ||
6176 | ||
6177 | ||
6178 | ||
6179 | extern void * _Unwind_FindEnclosingFunction (void *pc); | |
6180 | # 37 "../nptl/descr.h" 2 | |
6181 | ||
6182 | ||
6183 | # 1 "../include/resolv.h" 1 | |
6184 | # 12 "../include/resolv.h" | |
6185 | # 1 "../resolv/resolv.h" 1 | |
6186 | # 56 "../resolv/resolv.h" | |
6187 | # 1 "../include/sys/types.h" 1 | |
6188 | # 57 "../resolv/resolv.h" 2 | |
6189 | # 1 "../include/netinet/in.h" 1 | |
6190 | ||
6191 | ||
6192 | # 1 "../inet/netinet/in.h" 1 | |
6193 | # 24 "../inet/netinet/in.h" | |
6194 | # 1 "../include/sys/socket.h" 1 | |
6195 | ||
6196 | # 1 "../socket/sys/socket.h" 1 | |
6197 | # 25 "../socket/sys/socket.h" | |
6198 | ||
6199 | ||
6200 | # 1 "../include/sys/uio.h" 1 | |
6201 | ||
6202 | # 1 "../misc/sys/uio.h" 1 | |
6203 | # 24 "../misc/sys/uio.h" | |
6204 | # 1 "../include/sys/types.h" 1 | |
6205 | # 25 "../misc/sys/uio.h" 2 | |
6206 | ||
6207 | ||
6208 | ||
6209 | ||
6210 | # 1 "../sysdeps/unix/sysv/linux/bits/uio.h" 1 | |
6211 | # 26 "../sysdeps/unix/sysv/linux/bits/uio.h" | |
6212 | # 1 "../include/sys/types.h" 1 | |
6213 | # 27 "../sysdeps/unix/sysv/linux/bits/uio.h" 2 | |
6214 | # 44 "../sysdeps/unix/sysv/linux/bits/uio.h" | |
6215 | struct iovec | |
6216 | { | |
6217 | void *iov_base; | |
6218 | size_t iov_len; | |
6219 | }; | |
6220 | # 30 "../misc/sys/uio.h" 2 | |
6221 | # 40 "../misc/sys/uio.h" | |
6222 | extern ssize_t readv (int __fd, __const struct iovec *__iovec, int __count); | |
6223 | # 50 "../misc/sys/uio.h" | |
6224 | extern ssize_t writev (int __fd, __const struct iovec *__iovec, int __count); | |
6225 | ||
6226 | ||
6227 | # 3 "../include/sys/uio.h" 2 | |
6228 | ||
6229 | ||
6230 | extern ssize_t __readv (int __fd, __const struct iovec *__vector, | |
6231 | int __count); | |
6232 | extern ssize_t __libc_readv (int __fd, __const struct iovec *__vector, | |
6233 | int __count); | |
6234 | extern ssize_t __writev (int __fd, __const struct iovec *__vector, | |
6235 | int __count); | |
6236 | extern ssize_t __libc_writev (int __fd, __const struct iovec *__vector, | |
6237 | int __count); | |
6238 | # 28 "../socket/sys/socket.h" 2 | |
6239 | ||
6240 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
6241 | # 30 "../socket/sys/socket.h" 2 | |
6242 | ||
6243 | ||
6244 | ||
6245 | ||
6246 | ||
6247 | # 1 "../sysdeps/unix/sysv/linux/bits/socket.h" 1 | |
6248 | # 29 "../sysdeps/unix/sysv/linux/bits/socket.h" | |
6249 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
6250 | # 30 "../sysdeps/unix/sysv/linux/bits/socket.h" 2 | |
6251 | ||
6252 | # 1 "../include/limits.h" 1 | |
6253 | # 145 "../include/limits.h" | |
6254 | # 1 "../include/bits/posix1_lim.h" 1 | |
6255 | # 146 "../include/limits.h" 2 | |
6256 | ||
6257 | ||
6258 | ||
6259 | # 1 "../include/bits/posix2_lim.h" 1 | |
6260 | # 150 "../include/limits.h" 2 | |
6261 | # 32 "../sysdeps/unix/sysv/linux/bits/socket.h" 2 | |
6262 | # 1 "../include/sys/types.h" 1 | |
6263 | # 33 "../sysdeps/unix/sysv/linux/bits/socket.h" 2 | |
6264 | ||
6265 | ||
6266 | ||
6267 | typedef __socklen_t socklen_t; | |
6268 | ||
6269 | ||
6270 | ||
6271 | ||
6272 | enum __socket_type | |
6273 | { | |
6274 | SOCK_STREAM = 1, | |
6275 | ||
6276 | ||
6277 | SOCK_DGRAM = 2, | |
6278 | ||
6279 | ||
6280 | SOCK_RAW = 3, | |
6281 | ||
6282 | SOCK_RDM = 4, | |
6283 | ||
6284 | SOCK_SEQPACKET = 5, | |
6285 | ||
6286 | ||
6287 | SOCK_PACKET = 10 | |
6288 | ||
6289 | ||
6290 | ||
6291 | }; | |
6292 | # 142 "../sysdeps/unix/sysv/linux/bits/socket.h" | |
6293 | # 1 "../bits/sockaddr.h" 1 | |
6294 | # 29 "../bits/sockaddr.h" | |
6295 | typedef unsigned short int sa_family_t; | |
6296 | # 143 "../sysdeps/unix/sysv/linux/bits/socket.h" 2 | |
6297 | ||
6298 | ||
6299 | struct sockaddr | |
6300 | { | |
6301 | sa_family_t sa_family; | |
6302 | char sa_data[14]; | |
6303 | }; | |
6304 | # 162 "../sysdeps/unix/sysv/linux/bits/socket.h" | |
6305 | struct sockaddr_storage | |
6306 | { | |
6307 | sa_family_t ss_family; | |
6308 | __uint32_t __ss_align; | |
6309 | char __ss_padding[(128 - (2 * sizeof (__uint32_t)))]; | |
6310 | }; | |
6311 | ||
6312 | ||
6313 | ||
6314 | enum | |
6315 | { | |
6316 | MSG_OOB = 0x01, | |
6317 | ||
6318 | MSG_PEEK = 0x02, | |
6319 | ||
6320 | MSG_DONTROUTE = 0x04, | |
6321 | ||
6322 | ||
6323 | ||
6324 | MSG_TRYHARD = MSG_DONTROUTE, | |
6325 | ||
6326 | ||
6327 | MSG_CTRUNC = 0x08, | |
6328 | ||
6329 | MSG_PROXY = 0x10, | |
6330 | ||
6331 | MSG_TRUNC = 0x20, | |
6332 | ||
6333 | MSG_DONTWAIT = 0x40, | |
6334 | ||
6335 | MSG_EOR = 0x80, | |
6336 | ||
6337 | MSG_WAITALL = 0x100, | |
6338 | ||
6339 | MSG_FIN = 0x200, | |
6340 | ||
6341 | MSG_SYN = 0x400, | |
6342 | ||
6343 | MSG_CONFIRM = 0x800, | |
6344 | ||
6345 | MSG_RST = 0x1000, | |
6346 | ||
6347 | MSG_ERRQUEUE = 0x2000, | |
6348 | ||
6349 | MSG_NOSIGNAL = 0x4000, | |
6350 | ||
6351 | MSG_MORE = 0x8000 | |
6352 | ||
6353 | }; | |
6354 | ||
6355 | ||
6356 | ||
6357 | ||
6358 | struct msghdr | |
6359 | { | |
6360 | void *msg_name; | |
6361 | socklen_t msg_namelen; | |
6362 | ||
6363 | struct iovec *msg_iov; | |
6364 | size_t msg_iovlen; | |
6365 | ||
6366 | void *msg_control; | |
6367 | size_t msg_controllen; | |
6368 | ||
6369 | ||
6370 | ||
6371 | ||
6372 | int msg_flags; | |
6373 | }; | |
6374 | ||
6375 | ||
6376 | struct cmsghdr | |
6377 | { | |
6378 | size_t cmsg_len; | |
6379 | ||
6380 | ||
6381 | ||
6382 | ||
6383 | int cmsg_level; | |
6384 | int cmsg_type; | |
6385 | ||
6386 | __extension__ unsigned char __cmsg_data []; | |
6387 | ||
6388 | }; | |
6389 | # 263 "../sysdeps/unix/sysv/linux/bits/socket.h" | |
6390 | extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, | |
6391 | struct cmsghdr *__cmsg) __attribute__ ((__nothrow__)); | |
6392 | ||
6393 | ||
6394 | ||
6395 | ||
6396 | extern __inline struct cmsghdr * | |
6397 | __attribute__ ((__nothrow__)) __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) | |
6398 | { | |
6399 | if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) | |
6400 | ||
6401 | return 0; | |
6402 | ||
6403 | __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg | |
6404 | + (((__cmsg->cmsg_len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))); | |
6405 | if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control | |
6406 | + __mhdr->msg_controllen) | |
6407 | || ((unsigned char *) __cmsg + (((__cmsg->cmsg_len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1)) | |
6408 | > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) | |
6409 | ||
6410 | return 0; | |
6411 | return __cmsg; | |
6412 | } | |
6413 | ||
6414 | ||
6415 | ||
6416 | ||
6417 | enum | |
6418 | { | |
6419 | SCM_RIGHTS = 0x01 | |
6420 | ||
6421 | ||
6422 | , SCM_CREDENTIALS = 0x02 | |
6423 | ||
6424 | ||
6425 | }; | |
6426 | ||
6427 | ||
6428 | ||
6429 | struct ucred | |
6430 | { | |
6431 | pid_t pid; | |
6432 | uid_t uid; | |
6433 | gid_t gid; | |
6434 | }; | |
6435 | ||
6436 | ||
6437 | # 1 "/usr/include/asm/socket.h" 1 3 4 | |
6438 | ||
6439 | ||
6440 | ||
6441 | # 1 "/usr/include/asm/sockios.h" 1 3 4 | |
6442 | # 5 "/usr/include/asm/socket.h" 2 3 4 | |
6443 | # 311 "../sysdeps/unix/sysv/linux/bits/socket.h" 2 | |
6444 | ||
6445 | ||
6446 | ||
6447 | struct linger | |
6448 | { | |
6449 | int l_onoff; | |
6450 | int l_linger; | |
6451 | }; | |
6452 | # 36 "../socket/sys/socket.h" 2 | |
6453 | ||
6454 | ||
6455 | ||
6456 | ||
6457 | struct osockaddr | |
6458 | { | |
6459 | unsigned short int sa_family; | |
6460 | unsigned char sa_data[14]; | |
6461 | }; | |
6462 | ||
6463 | ||
6464 | ||
6465 | ||
6466 | enum | |
6467 | { | |
6468 | SHUT_RD = 0, | |
6469 | ||
6470 | SHUT_WR, | |
6471 | ||
6472 | SHUT_RDWR | |
6473 | ||
6474 | }; | |
6475 | # 87 "../socket/sys/socket.h" | |
6476 | typedef union { struct sockaddr *__restrict __sockaddr__; struct sockaddr_at *__restrict __sockaddr_at__; struct sockaddr_ax25 *__restrict __sockaddr_ax25__; struct sockaddr_dl *__restrict __sockaddr_dl__; struct sockaddr_eon *__restrict __sockaddr_eon__; struct sockaddr_in *__restrict __sockaddr_in__; struct sockaddr_in6 *__restrict __sockaddr_in6__; struct sockaddr_inarp *__restrict __sockaddr_inarp__; struct sockaddr_ipx *__restrict __sockaddr_ipx__; struct sockaddr_iso *__restrict __sockaddr_iso__; struct sockaddr_ns *__restrict __sockaddr_ns__; struct sockaddr_un *__restrict __sockaddr_un__; struct sockaddr_x25 *__restrict __sockaddr_x25__; | |
6477 | } __SOCKADDR_ARG __attribute__ ((__transparent_union__)); | |
6478 | ||
6479 | ||
6480 | typedef union { __const struct sockaddr *__restrict __sockaddr__; __const struct sockaddr_at *__restrict __sockaddr_at__; __const struct sockaddr_ax25 *__restrict __sockaddr_ax25__; __const struct sockaddr_dl *__restrict __sockaddr_dl__; __const struct sockaddr_eon *__restrict __sockaddr_eon__; __const struct sockaddr_in *__restrict __sockaddr_in__; __const struct sockaddr_in6 *__restrict __sockaddr_in6__; __const struct sockaddr_inarp *__restrict __sockaddr_inarp__; __const struct sockaddr_ipx *__restrict __sockaddr_ipx__; __const struct sockaddr_iso *__restrict __sockaddr_iso__; __const struct sockaddr_ns *__restrict __sockaddr_ns__; __const struct sockaddr_un *__restrict __sockaddr_un__; __const struct sockaddr_x25 *__restrict __sockaddr_x25__; | |
6481 | } __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__)); | |
6482 | ||
6483 | ||
6484 | ||
6485 | ||
6486 | ||
6487 | ||
6488 | ||
6489 | extern int socket (int __domain, int __type, int __protocol) __attribute__ ((__nothrow__)); | |
6490 | ||
6491 | ||
6492 | ||
6493 | ||
6494 | ||
6495 | extern int socketpair (int __domain, int __type, int __protocol, | |
6496 | int __fds[2]) __attribute__ ((__nothrow__)); | |
6497 | ||
6498 | ||
6499 | extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len) | |
6500 | __attribute__ ((__nothrow__)); | |
6501 | ||
6502 | ||
6503 | extern int getsockname (int __fd, __SOCKADDR_ARG __addr, | |
6504 | socklen_t *__restrict __len) __attribute__ ((__nothrow__)); | |
6505 | # 124 "../socket/sys/socket.h" | |
6506 | extern int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len); | |
6507 | ||
6508 | ||
6509 | ||
6510 | extern int getpeername (int __fd, __SOCKADDR_ARG __addr, | |
6511 | socklen_t *__restrict __len) __attribute__ ((__nothrow__)); | |
6512 | ||
6513 | ||
6514 | ||
6515 | ||
6516 | ||
6517 | ||
6518 | extern ssize_t send (int __fd, __const void *__buf, size_t __n, int __flags); | |
6519 | ||
6520 | ||
6521 | ||
6522 | ||
6523 | ||
6524 | ||
6525 | extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags); | |
6526 | ||
6527 | ||
6528 | ||
6529 | ||
6530 | ||
6531 | ||
6532 | extern ssize_t sendto (int __fd, __const void *__buf, size_t __n, | |
6533 | int __flags, __CONST_SOCKADDR_ARG __addr, | |
6534 | socklen_t __addr_len); | |
6535 | # 161 "../socket/sys/socket.h" | |
6536 | extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, | |
6537 | int __flags, __SOCKADDR_ARG __addr, | |
6538 | socklen_t *__restrict __addr_len); | |
6539 | ||
6540 | ||
6541 | ||
6542 | ||
6543 | ||
6544 | ||
6545 | ||
6546 | extern ssize_t sendmsg (int __fd, __const struct msghdr *__message, | |
6547 | int __flags); | |
6548 | ||
6549 | ||
6550 | ||
6551 | ||
6552 | ||
6553 | ||
6554 | extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); | |
6555 | ||
6556 | ||
6557 | ||
6558 | ||
6559 | ||
6560 | extern int getsockopt (int __fd, int __level, int __optname, | |
6561 | void *__restrict __optval, | |
6562 | socklen_t *__restrict __optlen) __attribute__ ((__nothrow__)); | |
6563 | ||
6564 | ||
6565 | ||
6566 | ||
6567 | extern int setsockopt (int __fd, int __level, int __optname, | |
6568 | __const void *__optval, socklen_t __optlen) __attribute__ ((__nothrow__)); | |
6569 | ||
6570 | ||
6571 | ||
6572 | ||
6573 | ||
6574 | extern int listen (int __fd, int __n) __attribute__ ((__nothrow__)); | |
6575 | # 209 "../socket/sys/socket.h" | |
6576 | extern int accept (int __fd, __SOCKADDR_ARG __addr, | |
6577 | socklen_t *__restrict __addr_len); | |
6578 | ||
6579 | ||
6580 | ||
6581 | ||
6582 | ||
6583 | ||
6584 | ||
6585 | extern int shutdown (int __fd, int __how) __attribute__ ((__nothrow__)); | |
6586 | ||
6587 | ||
6588 | ||
6589 | ||
6590 | extern int sockatmark (int __fd) __attribute__ ((__nothrow__)); | |
6591 | ||
6592 | ||
6593 | ||
6594 | ||
6595 | ||
6596 | ||
6597 | ||
6598 | extern int isfdtype (int __fd, int __fdtype) __attribute__ ((__nothrow__)); | |
6599 | # 240 "../socket/sys/socket.h" | |
6600 | ||
6601 | # 3 "../include/sys/socket.h" 2 | |
6602 | ||
6603 | ||
6604 | ||
6605 | ||
6606 | ||
6607 | ||
6608 | extern int __socket (int __domain, int __type, | |
6609 | int __protocol) ; | |
6610 | ||
6611 | ||
6612 | ||
6613 | ||
6614 | ||
6615 | extern int __socketpair (int __domain, int __type, int __protocol, | |
6616 | int __fds[2]) ; | |
6617 | ||
6618 | ||
6619 | ||
6620 | extern int __opensock (void) ; | |
6621 | ||
6622 | ||
6623 | ||
6624 | extern int __getpeername (int __fd, __SOCKADDR_ARG __addr, | |
6625 | socklen_t *__len) ; | |
6626 | ||
6627 | ||
6628 | extern ssize_t __libc_send (int __fd, __const void *__buf, size_t __n, | |
6629 | int __flags); | |
6630 | extern ssize_t __send (int __fd, __const void *__buf, size_t __n, int __flags); | |
6631 | ||
6632 | ||
6633 | ||
6634 | ||
6635 | extern ssize_t __libc_recv (int __fd, void *__buf, size_t __n, int __flags); | |
6636 | ||
6637 | ||
6638 | ||
6639 | extern ssize_t __libc_sendto (int __fd, __const void *__buf, size_t __n, | |
6640 | int __flags, __CONST_SOCKADDR_ARG __addr, | |
6641 | socklen_t __addr_len); | |
6642 | ||
6643 | ||
6644 | ||
6645 | ||
6646 | ||
6647 | extern ssize_t __libc_recvfrom (int __fd, void *__restrict __buf, size_t __n, | |
6648 | int __flags, __SOCKADDR_ARG __addr, | |
6649 | socklen_t *__restrict __addr_len); | |
6650 | ||
6651 | ||
6652 | ||
6653 | ||
6654 | ||
6655 | extern int __libc_connect (int __fd, __CONST_SOCKADDR_ARG __addr, | |
6656 | socklen_t __len); | |
6657 | extern int __connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len); | |
6658 | extern int __connect_internal (int __fd, __CONST_SOCKADDR_ARG __addr, | |
6659 | socklen_t __len) ; | |
6660 | ||
6661 | ||
6662 | ||
6663 | ||
6664 | ||
6665 | ||
6666 | extern ssize_t __recv (int __fd, void *__buf, size_t __n, int __flags) | |
6667 | ; | |
6668 | ||
6669 | ||
6670 | ||
6671 | extern ssize_t __libc_sendto (int __fd, __const void *__buf, size_t __n, | |
6672 | int __flags, __CONST_SOCKADDR_ARG __addr, | |
6673 | socklen_t __addr_len); | |
6674 | extern ssize_t __sendto (int __fd, __const void *__buf, size_t __n, | |
6675 | int __flags, __CONST_SOCKADDR_ARG __addr, | |
6676 | socklen_t __addr_len) ; | |
6677 | ||
6678 | ||
6679 | ||
6680 | ||
6681 | ||
6682 | extern ssize_t __recvfrom (int __fd, void *__restrict __buf, size_t __n, | |
6683 | int __flags, __SOCKADDR_ARG __addr, | |
6684 | socklen_t *__restrict __addr_len) ; | |
6685 | ||
6686 | ||
6687 | ||
6688 | extern ssize_t __libc_sendmsg (int __fd, __const struct msghdr *__message, | |
6689 | int __flags); | |
6690 | extern ssize_t __sendmsg (int __fd, __const struct msghdr *__message, | |
6691 | int __flags) ; | |
6692 | ||
6693 | ||
6694 | ||
6695 | extern ssize_t __libc_recvmsg (int __fd, struct msghdr *__message, | |
6696 | int __flags); | |
6697 | extern ssize_t __recvmsg (int __fd, struct msghdr *__message, | |
6698 | int __flags) ; | |
6699 | ||
6700 | ||
6701 | ||
6702 | ||
6703 | extern int __setsockopt (int __fd, int __level, int __optname, | |
6704 | __const void *__optval, | |
6705 | socklen_t __optlen) ; | |
6706 | ||
6707 | ||
6708 | ||
6709 | ||
6710 | extern int __getsockopt (int __fd, int __level, int __optname, | |
6711 | void *__restrict __optval, | |
6712 | socklen_t *__restrict __optlen) ; | |
6713 | ||
6714 | ||
6715 | extern int __getsockname (int __fd, __SOCKADDR_ARG __addr, | |
6716 | socklen_t *__restrict __len) ; | |
6717 | ||
6718 | ||
6719 | extern int __bind (int __fd, __CONST_SOCKADDR_ARG __addr, | |
6720 | socklen_t __len) ; | |
6721 | ||
6722 | ||
6723 | ||
6724 | ||
6725 | extern int __listen (int __fd, int __n) ; | |
6726 | ||
6727 | ||
6728 | ||
6729 | ||
6730 | ||
6731 | ||
6732 | extern int __libc_accept (int __fd, __SOCKADDR_ARG __addr, | |
6733 | socklen_t *__restrict __addr_len) | |
6734 | __attribute__ ((__nothrow__)); | |
6735 | ||
6736 | ||
6737 | ||
6738 | ||
6739 | ||
6740 | ||
6741 | extern int __libc_sa_len (sa_family_t __af); | |
6742 | extern int __libc_sa_len_internal (sa_family_t __af) ; | |
6743 | # 25 "../inet/netinet/in.h" 2 | |
6744 | ||
6745 | ||
6746 | ||
6747 | ||
6748 | ||
6749 | ||
6750 | enum | |
6751 | { | |
6752 | IPPROTO_IP = 0, | |
6753 | ||
6754 | IPPROTO_HOPOPTS = 0, | |
6755 | ||
6756 | IPPROTO_ICMP = 1, | |
6757 | ||
6758 | IPPROTO_IGMP = 2, | |
6759 | ||
6760 | IPPROTO_IPIP = 4, | |
6761 | ||
6762 | IPPROTO_TCP = 6, | |
6763 | ||
6764 | IPPROTO_EGP = 8, | |
6765 | ||
6766 | IPPROTO_PUP = 12, | |
6767 | ||
6768 | IPPROTO_UDP = 17, | |
6769 | ||
6770 | IPPROTO_IDP = 22, | |
6771 | ||
6772 | IPPROTO_TP = 29, | |
6773 | ||
6774 | IPPROTO_IPV6 = 41, | |
6775 | ||
6776 | IPPROTO_ROUTING = 43, | |
6777 | ||
6778 | IPPROTO_FRAGMENT = 44, | |
6779 | ||
6780 | IPPROTO_RSVP = 46, | |
6781 | ||
6782 | IPPROTO_GRE = 47, | |
6783 | ||
6784 | IPPROTO_ESP = 50, | |
6785 | ||
6786 | IPPROTO_AH = 51, | |
6787 | ||
6788 | IPPROTO_ICMPV6 = 58, | |
6789 | ||
6790 | IPPROTO_NONE = 59, | |
6791 | ||
6792 | IPPROTO_DSTOPTS = 60, | |
6793 | ||
6794 | IPPROTO_MTP = 92, | |
6795 | ||
6796 | IPPROTO_ENCAP = 98, | |
6797 | ||
6798 | IPPROTO_PIM = 103, | |
6799 | ||
6800 | IPPROTO_COMP = 108, | |
6801 | ||
6802 | IPPROTO_SCTP = 132, | |
6803 | ||
6804 | IPPROTO_RAW = 255, | |
6805 | ||
6806 | IPPROTO_MAX | |
6807 | }; | |
6808 | ||
6809 | ||
6810 | ||
6811 | typedef uint16_t in_port_t; | |
6812 | ||
6813 | ||
6814 | enum | |
6815 | { | |
6816 | IPPORT_ECHO = 7, | |
6817 | IPPORT_DISCARD = 9, | |
6818 | IPPORT_SYSTAT = 11, | |
6819 | IPPORT_DAYTIME = 13, | |
6820 | IPPORT_NETSTAT = 15, | |
6821 | IPPORT_FTP = 21, | |
6822 | IPPORT_TELNET = 23, | |
6823 | IPPORT_SMTP = 25, | |
6824 | IPPORT_TIMESERVER = 37, | |
6825 | IPPORT_NAMESERVER = 42, | |
6826 | IPPORT_WHOIS = 43, | |
6827 | IPPORT_MTP = 57, | |
6828 | ||
6829 | IPPORT_TFTP = 69, | |
6830 | IPPORT_RJE = 77, | |
6831 | IPPORT_FINGER = 79, | |
6832 | IPPORT_TTYLINK = 87, | |
6833 | IPPORT_SUPDUP = 95, | |
6834 | ||
6835 | ||
6836 | IPPORT_EXECSERVER = 512, | |
6837 | IPPORT_LOGINSERVER = 513, | |
6838 | IPPORT_CMDSERVER = 514, | |
6839 | IPPORT_EFSSERVER = 520, | |
6840 | ||
6841 | ||
6842 | IPPORT_BIFFUDP = 512, | |
6843 | IPPORT_WHOSERVER = 513, | |
6844 | IPPORT_ROUTESERVER = 520, | |
6845 | ||
6846 | ||
6847 | IPPORT_RESERVED = 1024, | |
6848 | ||
6849 | ||
6850 | IPPORT_USERRESERVED = 5000 | |
6851 | }; | |
6852 | ||
6853 | ||
6854 | ||
6855 | typedef uint32_t in_addr_t; | |
6856 | struct in_addr | |
6857 | { | |
6858 | in_addr_t s_addr; | |
6859 | }; | |
6860 | # 193 "../inet/netinet/in.h" | |
6861 | struct in6_addr | |
6862 | { | |
6863 | union | |
6864 | { | |
6865 | uint8_t u6_addr8[16]; | |
6866 | uint16_t u6_addr16[8]; | |
6867 | uint32_t u6_addr32[4]; | |
6868 | } in6_u; | |
6869 | ||
6870 | ||
6871 | ||
6872 | }; | |
6873 | ||
6874 | extern const struct in6_addr in6addr_any; | |
6875 | extern const struct in6_addr in6addr_loopback; | |
6876 | # 219 "../inet/netinet/in.h" | |
6877 | struct sockaddr_in | |
6878 | { | |
6879 | sa_family_t sin_family; | |
6880 | in_port_t sin_port; | |
6881 | struct in_addr sin_addr; | |
6882 | ||
6883 | ||
6884 | unsigned char sin_zero[sizeof (struct sockaddr) - | |
6885 | (sizeof (unsigned short int)) - | |
6886 | sizeof (in_port_t) - | |
6887 | sizeof (struct in_addr)]; | |
6888 | }; | |
6889 | ||
6890 | ||
6891 | struct sockaddr_in6 | |
6892 | { | |
6893 | sa_family_t sin6_family; | |
6894 | in_port_t sin6_port; | |
6895 | uint32_t sin6_flowinfo; | |
6896 | struct in6_addr sin6_addr; | |
6897 | uint32_t sin6_scope_id; | |
6898 | }; | |
6899 | ||
6900 | ||
6901 | ||
6902 | struct ip_mreq | |
6903 | { | |
6904 | ||
6905 | struct in_addr imr_multiaddr; | |
6906 | ||
6907 | ||
6908 | struct in_addr imr_interface; | |
6909 | }; | |
6910 | ||
6911 | struct ip_mreq_source | |
6912 | { | |
6913 | ||
6914 | struct in_addr imr_multiaddr; | |
6915 | ||
6916 | ||
6917 | struct in_addr imr_interface; | |
6918 | ||
6919 | ||
6920 | struct in_addr imr_sourceaddr; | |
6921 | }; | |
6922 | ||
6923 | ||
6924 | struct ipv6_mreq | |
6925 | { | |
6926 | ||
6927 | struct in6_addr ipv6mr_multiaddr; | |
6928 | ||
6929 | ||
6930 | unsigned int ipv6mr_interface; | |
6931 | }; | |
6932 | ||
6933 | ||
6934 | ||
6935 | struct group_req | |
6936 | { | |
6937 | ||
6938 | uint32_t gr_interface; | |
6939 | ||
6940 | ||
6941 | struct sockaddr_storage gr_group; | |
6942 | }; | |
6943 | ||
6944 | struct group_source_req | |
6945 | { | |
6946 | ||
6947 | uint32_t gsr_interface; | |
6948 | ||
6949 | ||
6950 | struct sockaddr_storage gsr_group; | |
6951 | ||
6952 | ||
6953 | struct sockaddr_storage gsr_source; | |
6954 | }; | |
6955 | ||
6956 | ||
6957 | ||
6958 | struct ip_msfilter | |
6959 | { | |
6960 | ||
6961 | struct in_addr imsf_multiaddr; | |
6962 | ||
6963 | ||
6964 | struct in_addr imsf_interface; | |
6965 | ||
6966 | ||
6967 | uint32_t imsf_fmode; | |
6968 | ||
6969 | ||
6970 | uint32_t imsf_numsrc; | |
6971 | ||
6972 | struct in_addr imsf_slist[1]; | |
6973 | }; | |
6974 | ||
6975 | ||
6976 | ||
6977 | ||
6978 | ||
6979 | struct group_filter | |
6980 | { | |
6981 | ||
6982 | uint32_t gf_interface; | |
6983 | ||
6984 | ||
6985 | struct sockaddr_storage gf_group; | |
6986 | ||
6987 | ||
6988 | uint32_t gf_fmode; | |
6989 | ||
6990 | ||
6991 | uint32_t gf_numsrc; | |
6992 | ||
6993 | struct sockaddr_storage gf_slist[1]; | |
6994 | }; | |
6995 | # 345 "../inet/netinet/in.h" | |
6996 | # 1 "../sysdeps/unix/sysv/linux/bits/in.h" 1 | |
6997 | # 82 "../sysdeps/unix/sysv/linux/bits/in.h" | |
6998 | struct ip_opts | |
6999 | { | |
7000 | struct in_addr ip_dst; | |
7001 | char ip_opts[40]; | |
7002 | }; | |
7003 | ||
7004 | ||
7005 | struct ip_mreqn | |
7006 | { | |
7007 | struct in_addr imr_multiaddr; | |
7008 | struct in_addr imr_address; | |
7009 | int imr_ifindex; | |
7010 | }; | |
7011 | ||
7012 | ||
7013 | struct in_pktinfo | |
7014 | { | |
7015 | int ipi_ifindex; | |
7016 | struct in_addr ipi_spec_dst; | |
7017 | struct in_addr ipi_addr; | |
7018 | }; | |
7019 | # 346 "../inet/netinet/in.h" 2 | |
7020 | # 354 "../inet/netinet/in.h" | |
7021 | extern uint32_t ntohl (uint32_t __netlong) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
7022 | extern uint16_t ntohs (uint16_t __netshort) | |
7023 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
7024 | extern uint32_t htonl (uint32_t __hostlong) | |
7025 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
7026 | extern uint16_t htons (uint16_t __hostshort) | |
7027 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
7028 | ||
7029 | # 1 "../include/endian.h" 1 | |
7030 | # 363 "../inet/netinet/in.h" 2 | |
7031 | ||
7032 | ||
7033 | # 1 "../bits/byteswap.h" 1 | |
7034 | # 366 "../inet/netinet/in.h" 2 | |
7035 | # 428 "../inet/netinet/in.h" | |
7036 | extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __attribute__ ((__nothrow__)); | |
7037 | ||
7038 | ||
7039 | extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in) | |
7040 | __attribute__ ((__nothrow__)); | |
7041 | # 456 "../inet/netinet/in.h" | |
7042 | struct in6_pktinfo | |
7043 | { | |
7044 | struct in6_addr ipi6_addr; | |
7045 | unsigned int ipi6_ifindex; | |
7046 | }; | |
7047 | ||
7048 | ||
7049 | struct ip6_mtuinfo | |
7050 | { | |
7051 | struct sockaddr_in6 ip6m_addr; | |
7052 | uint32_t ip6m_mtu; | |
7053 | }; | |
7054 | ||
7055 | ||
7056 | ||
7057 | ||
7058 | extern int inet6_option_space (int __nbytes) | |
7059 | __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
7060 | extern int inet6_option_init (void *__bp, struct cmsghdr **__cmsgp, | |
7061 | int __type) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
7062 | extern int inet6_option_append (struct cmsghdr *__cmsg, | |
7063 | __const uint8_t *__typep, int __multx, | |
7064 | int __plusy) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
7065 | extern uint8_t *inet6_option_alloc (struct cmsghdr *__cmsg, int __datalen, | |
7066 | int __multx, int __plusy) | |
7067 | __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
7068 | extern int inet6_option_next (__const struct cmsghdr *__cmsg, | |
7069 | uint8_t **__tptrp) | |
7070 | __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
7071 | extern int inet6_option_find (__const struct cmsghdr *__cmsg, | |
7072 | uint8_t **__tptrp, int __type) | |
7073 | __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__)); | |
7074 | ||
7075 | ||
7076 | ||
7077 | extern int inet6_opt_init (void *__extbuf, socklen_t __extlen) __attribute__ ((__nothrow__)); | |
7078 | extern int inet6_opt_append (void *__extbuf, socklen_t __extlen, int __offset, | |
7079 | uint8_t __type, socklen_t __len, uint8_t __align, | |
7080 | void **__databufp) __attribute__ ((__nothrow__)); | |
7081 | extern int inet6_opt_finish (void *__extbuf, socklen_t __extlen, int __offset) | |
7082 | __attribute__ ((__nothrow__)); | |
7083 | extern int inet6_opt_set_val (void *__databuf, int __offset, void *__val, | |
7084 | socklen_t __vallen) __attribute__ ((__nothrow__)); | |
7085 | extern int inet6_opt_next (void *__extbuf, socklen_t __extlen, int __offset, | |
7086 | uint8_t *__typep, socklen_t *__lenp, | |
7087 | void **__databufp) __attribute__ ((__nothrow__)); | |
7088 | extern int inet6_opt_find (void *__extbuf, socklen_t __extlen, int __offset, | |
7089 | uint8_t __type, socklen_t *__lenp, | |
7090 | void **__databufp) __attribute__ ((__nothrow__)); | |
7091 | extern int inet6_opt_get_val (void *__databuf, int __offset, void *__val, | |
7092 | socklen_t __vallen) __attribute__ ((__nothrow__)); | |
7093 | ||
7094 | ||
7095 | ||
7096 | extern socklen_t inet6_rth_space (int __type, int __segments) __attribute__ ((__nothrow__)); | |
7097 | extern void *inet6_rth_init (void *__bp, socklen_t __bp_len, int __type, | |
7098 | int __segments) __attribute__ ((__nothrow__)); | |
7099 | extern int inet6_rth_add (void *__bp, __const struct in6_addr *__addr) __attribute__ ((__nothrow__)); | |
7100 | extern int inet6_rth_reverse (__const void *__in, void *__out) __attribute__ ((__nothrow__)); | |
7101 | extern int inet6_rth_segments (__const void *__bp) __attribute__ ((__nothrow__)); | |
7102 | extern struct in6_addr *inet6_rth_getaddr (__const void *__bp, int __index) | |
7103 | __attribute__ ((__nothrow__)); | |
7104 | ||
7105 | ||
7106 | ||
7107 | ||
7108 | ||
7109 | extern int getipv4sourcefilter (int __s, struct in_addr __interface_addr, | |
7110 | struct in_addr __group, uint32_t *__fmode, | |
7111 | uint32_t *__numsrc, struct in_addr *__slist) | |
7112 | __attribute__ ((__nothrow__)); | |
7113 | ||
7114 | ||
7115 | extern int setipv4sourcefilter (int __s, struct in_addr __interface_addr, | |
7116 | struct in_addr __group, uint32_t __fmode, | |
7117 | uint32_t __numsrc, | |
7118 | __const struct in_addr *__slist) | |
7119 | __attribute__ ((__nothrow__)); | |
7120 | ||
7121 | ||
7122 | ||
7123 | extern int getsourcefilter (int __s, uint32_t __interface_addr, | |
7124 | __const struct sockaddr *__group, | |
7125 | socklen_t __grouplen, uint32_t *__fmode, | |
7126 | uint32_t *__numsrc, | |
7127 | struct sockaddr_storage *__slist) __attribute__ ((__nothrow__)); | |
7128 | ||
7129 | ||
7130 | extern int setsourcefilter (int __s, uint32_t __interface_addr, | |
7131 | __const struct sockaddr *__group, | |
7132 | socklen_t __grouplen, uint32_t __fmode, | |
7133 | uint32_t __numsrc, | |
7134 | __const struct sockaddr_storage *__slist) __attribute__ ((__nothrow__)); | |
7135 | ||
7136 | ||
7137 | ||
7138 | # 4 "../include/netinet/in.h" 2 | |
7139 | ||
7140 | ||
7141 | ||
7142 | ||
7143 | # 58 "../resolv/resolv.h" 2 | |
7144 | # 71 "../resolv/resolv.h" | |
7145 | typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error } | |
7146 | res_sendhookact; | |
7147 | ||
7148 | typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *ns, | |
7149 | const u_char **query, | |
7150 | int *querylen, | |
7151 | u_char *ans, | |
7152 | int anssiz, | |
7153 | int *resplen); | |
7154 | ||
7155 | typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *ns, | |
7156 | const u_char *query, | |
7157 | int querylen, | |
7158 | u_char *ans, | |
7159 | int anssiz, | |
7160 | int *resplen); | |
7161 | # 104 "../resolv/resolv.h" | |
7162 | struct __res_state { | |
7163 | int retrans; | |
7164 | int retry; | |
7165 | u_long options; | |
7166 | int nscount; | |
7167 | struct sockaddr_in | |
7168 | nsaddr_list[3]; | |
7169 | ||
7170 | u_short id; | |
7171 | char *dnsrch[6 +1]; | |
7172 | char defdname[256]; | |
7173 | u_long pfcode; | |
7174 | unsigned ndots:4; | |
7175 | unsigned nsort:4; | |
7176 | char unused[3]; | |
7177 | struct { | |
7178 | struct in_addr addr; | |
7179 | u_int32_t mask; | |
7180 | } sort_list[10]; | |
7181 | res_send_qhook qhook; | |
7182 | res_send_rhook rhook; | |
7183 | int res_h_errno; | |
7184 | int _vcsock; | |
7185 | u_int _flags; | |
7186 | union { | |
7187 | char pad[52]; | |
7188 | struct { | |
7189 | u_int16_t nscount; | |
7190 | u_int16_t nsmap[3]; | |
7191 | int nssocks[3]; | |
7192 | u_int16_t nscount6; | |
7193 | u_int16_t nsinit; | |
7194 | struct sockaddr_in6 *nsaddrs[3]; | |
7195 | ||
7196 | unsigned long long int initstamp | |
7197 | __attribute__((packed)); | |
7198 | ||
7199 | ||
7200 | ||
7201 | } _ext; | |
7202 | } _u; | |
7203 | }; | |
7204 | ||
7205 | typedef struct __res_state *res_state; | |
7206 | # 13 "../include/resolv.h" 2 | |
7207 | # 40 "../nptl/descr.h" 2 | |
7208 | # 65 "../nptl/descr.h" | |
7209 | struct pthread_unwind_buf | |
7210 | { | |
7211 | struct | |
7212 | { | |
7213 | __jmp_buf jmp_buf; | |
7214 | int mask_was_saved; | |
7215 | } cancel_jmp_buf[1]; | |
7216 | ||
7217 | union | |
7218 | { | |
7219 | ||
7220 | void *pad[4]; | |
7221 | ||
7222 | struct | |
7223 | { | |
7224 | ||
7225 | struct pthread_unwind_buf *prev; | |
7226 | ||
7227 | ||
7228 | ||
7229 | ||
7230 | struct _pthread_cleanup_buffer *cleanup; | |
7231 | ||
7232 | ||
7233 | int canceltype; | |
7234 | } data; | |
7235 | } priv; | |
7236 | }; | |
7237 | ||
7238 | ||
7239 | ||
7240 | ||
7241 | struct xid_command | |
7242 | { | |
7243 | int syscall_no; | |
7244 | long int id[3]; | |
7245 | volatile int cntr; | |
7246 | }; | |
7247 | ||
7248 | ||
7249 | ||
7250 | struct robust_list_head | |
7251 | { | |
7252 | void *list; | |
7253 | long int futex_offset; | |
7254 | void *list_op_pending; | |
7255 | }; | |
7256 | ||
7257 | ||
7258 | ||
7259 | struct priority_protection_data | |
7260 | { | |
7261 | int priomax; | |
7262 | unsigned int priomap[]; | |
7263 | }; | |
7264 | ||
7265 | ||
7266 | ||
7267 | struct pthread | |
7268 | { | |
7269 | union | |
7270 | { | |
7271 | ||
7272 | ||
7273 | ||
7274 | ||
7275 | struct | |
7276 | { | |
7277 | int multiple_threads; | |
7278 | } header; | |
7279 | ||
7280 | ||
7281 | ||
7282 | ||
7283 | ||
7284 | ||
7285 | void *__padding[16]; | |
7286 | }; | |
7287 | ||
7288 | ||
7289 | list_t list; | |
7290 | ||
7291 | ||
7292 | ||
7293 | pid_t tid; | |
7294 | ||
7295 | ||
7296 | pid_t pid; | |
7297 | # 193 "../nptl/descr.h" | |
7298 | union | |
7299 | { | |
7300 | __pthread_slist_t robust_list; | |
7301 | struct robust_list_head robust_head; | |
7302 | }; | |
7303 | # 231 "../nptl/descr.h" | |
7304 | struct _pthread_cleanup_buffer *cleanup; | |
7305 | ||
7306 | ||
7307 | struct pthread_unwind_buf *cleanup_jmp_buf; | |
7308 | ||
7309 | ||
7310 | ||
7311 | int cancelhandling; | |
7312 | # 273 "../nptl/descr.h" | |
7313 | struct pthread_key_data | |
7314 | { | |
7315 | ||
7316 | ||
7317 | ||
7318 | uintptr_t seq; | |
7319 | ||
7320 | ||
7321 | void *data; | |
7322 | } specific_1stblock[32]; | |
7323 | ||
7324 | ||
7325 | struct pthread_key_data *specific[((1024 + 32 - 1) / 32)]; | |
7326 | ||
7327 | ||
7328 | _Bool specific_used; | |
7329 | ||
7330 | ||
7331 | _Bool report_events; | |
7332 | ||
7333 | ||
7334 | _Bool user_stack; | |
7335 | ||
7336 | ||
7337 | _Bool stopped_start; | |
7338 | ||
7339 | ||
7340 | ||
7341 | int parent_cancelhandling; | |
7342 | ||
7343 | ||
7344 | lll_lock_t lock; | |
7345 | ||
7346 | ||
7347 | lll_lock_t setxid_futex; | |
7348 | # 320 "../nptl/descr.h" | |
7349 | struct pthread *joinid; | |
7350 | ||
7351 | ||
7352 | ||
7353 | ||
7354 | int flags; | |
7355 | ||
7356 | ||
7357 | void *result; | |
7358 | ||
7359 | ||
7360 | struct sched_param schedparam; | |
7361 | int schedpolicy; | |
7362 | ||
7363 | ||
7364 | ||
7365 | void *(*start_routine) (void *); | |
7366 | void *arg; | |
7367 | ||
7368 | ||
7369 | td_eventbuf_t eventbuf; | |
7370 | ||
7371 | struct pthread *nextevent; | |
7372 | ||
7373 | ||
7374 | ||
7375 | struct _Unwind_Exception exc; | |
7376 | ||
7377 | ||
7378 | ||
7379 | ||
7380 | void *stackblock; | |
7381 | size_t stackblock_size; | |
7382 | ||
7383 | size_t guardsize; | |
7384 | ||
7385 | size_t reported_guardsize; | |
7386 | ||
7387 | ||
7388 | struct priority_protection_data *tpp; | |
7389 | ||
7390 | ||
7391 | struct __res_state res; | |
7392 | ||
7393 | ||
7394 | char end_padding[]; | |
7395 | ||
7396 | ||
7397 | ||
7398 | } __attribute ((aligned (64))); | |
7399 | # 64 "../ports/sysdeps/hppa/nptl/tls.h" 2 | |
7400 | ||
7401 | typedef struct | |
7402 | { | |
7403 | dtv_t *dtv; | |
7404 | void *private; | |
7405 | } tcbhead_t; | |
7406 | # 135 "../ports/sysdeps/hppa/nptl/tls.h" | |
7407 | static inline struct pthread *__get_cr27(void) | |
7408 | { | |
7409 | long cr27; | |
7410 | asm ("mfctl %%cr27, %0" : "=r" (cr27) : ); | |
7411 | return (struct pthread *) cr27; | |
7412 | } | |
7413 | ||
7414 | static inline void __set_cr27(struct pthread *cr27) | |
7415 | { | |
7416 | asm ( "ble 0xe0(%%sr2, %%r0)\n\t" | |
7417 | "copy %0, %%r26" | |
7418 | : : "r" (cr27) : "r26" ); | |
7419 | } | |
7420 | # 7 "../include/tls.h" 2 | |
7421 | # 46 "../bits/libc-tsd.h" 2 | |
7422 | # 208 "../locale/localeinfo.h" 2 | |
7423 | extern __thread void *__libc_tsd_LOCALE __attribute__ ((tls_model ("initial-exec"))); | |
7424 | # 234 "../locale/localeinfo.h" | |
7425 | # 1 "../locale/categories.def" 1 | |
7426 | # 42 "../locale/categories.def" | |
7427 | extern __thread struct locale_data *const *_nl_current_LC_COLLATE __attribute__ ((tls_model ("initial-exec"))); | |
7428 | # 68 "../locale/categories.def" | |
7429 | extern __thread struct locale_data *const *_nl_current_LC_CTYPE __attribute__ ((tls_model ("initial-exec"))); | |
7430 | # 140 "../locale/categories.def" | |
7431 | extern __thread struct locale_data *const *_nl_current_LC_MONETARY __attribute__ ((tls_model ("initial-exec"))); | |
7432 | # 192 "../locale/categories.def" | |
7433 | extern __thread struct locale_data *const *_nl_current_LC_NUMERIC __attribute__ ((tls_model ("initial-exec"))); | |
7434 | # 206 "../locale/categories.def" | |
7435 | extern __thread struct locale_data *const *_nl_current_LC_TIME __attribute__ ((tls_model ("initial-exec"))); | |
7436 | # 254 "../locale/categories.def" | |
7437 | extern __thread struct locale_data *const *_nl_current_LC_MESSAGES __attribute__ ((tls_model ("initial-exec"))); | |
7438 | # 265 "../locale/categories.def" | |
7439 | extern __thread struct locale_data *const *_nl_current_LC_PAPER __attribute__ ((tls_model ("initial-exec"))); | |
7440 | # 274 "../locale/categories.def" | |
7441 | extern __thread struct locale_data *const *_nl_current_LC_NAME __attribute__ ((tls_model ("initial-exec"))); | |
7442 | # 287 "../locale/categories.def" | |
7443 | extern __thread struct locale_data *const *_nl_current_LC_ADDRESS __attribute__ ((tls_model ("initial-exec"))); | |
7444 | # 306 "../locale/categories.def" | |
7445 | extern __thread struct locale_data *const *_nl_current_LC_TELEPHONE __attribute__ ((tls_model ("initial-exec"))); | |
7446 | # 317 "../locale/categories.def" | |
7447 | extern __thread struct locale_data *const *_nl_current_LC_MEASUREMENT __attribute__ ((tls_model ("initial-exec"))); | |
7448 | ||
7449 | ||
7450 | ||
7451 | ||
7452 | ||
7453 | ||
7454 | ||
7455 | extern __thread struct locale_data *const *_nl_current_LC_IDENTIFICATION __attribute__ ((tls_model ("initial-exec"))); | |
7456 | # 235 "../locale/localeinfo.h" 2 | |
7457 | # 296 "../locale/localeinfo.h" | |
7458 | extern const char _nl_default_locale_path[] ; | |
7459 | ||
7460 | ||
7461 | ||
7462 | ||
7463 | ||
7464 | ||
7465 | ||
7466 | extern struct locale_data *_nl_find_locale (const char *locale_path, | |
7467 | size_t locale_path_len, | |
7468 | int category, const char **name) | |
7469 | ; | |
7470 | ||
7471 | ||
7472 | extern void _nl_load_locale (struct loaded_l10nfile *file, int category) | |
7473 | ; | |
7474 | ||
7475 | ||
7476 | extern void _nl_unload_locale (struct locale_data *locale) | |
7477 | ; | |
7478 | ||
7479 | ||
7480 | extern void _nl_remove_locale (int locale, struct locale_data *data) | |
7481 | ; | |
7482 | ||
7483 | ||
7484 | ||
7485 | ||
7486 | ||
7487 | ||
7488 | extern struct locale_data *_nl_load_locale_from_archive (int category, | |
7489 | const char **namep) | |
7490 | ; | |
7491 | ||
7492 | ||
7493 | extern void _nl_archive_subfreeres (void) ; | |
7494 | ||
7495 | ||
7496 | extern void _nl_locale_subfreeres (void) ; | |
7497 | ||
7498 | ||
7499 | ||
7500 | ||
7501 | ||
7502 | ||
7503 | extern struct locale_data *_nl_intern_locale_data (int category, | |
7504 | const void *data, | |
7505 | size_t datasize) | |
7506 | ; | |
7507 | ||
7508 | ||
7509 | ||
7510 | extern struct era_entry *_nl_get_era_entry (const struct tm *tp, | |
7511 | struct locale_data *lc_time) | |
7512 | ; | |
7513 | ||
7514 | ||
7515 | extern struct era_entry *_nl_select_era_entry (int cnt, | |
7516 | struct locale_data *lc_time) | |
7517 | ; | |
7518 | ||
7519 | ||
7520 | extern const char *_nl_get_alt_digit (unsigned int number, | |
7521 | struct locale_data *lc_time) | |
7522 | ; | |
7523 | ||
7524 | ||
7525 | extern const wchar_t *_nl_get_walt_digit (unsigned int number, | |
7526 | struct locale_data *lc_time) | |
7527 | ; | |
7528 | ||
7529 | ||
7530 | extern int _nl_parse_alt_digit (const char **strp, | |
7531 | struct locale_data *lc_time) | |
7532 | ; | |
7533 | ||
7534 | ||
7535 | extern void _nl_postload_ctype (void); | |
7536 | ||
7537 | ||
7538 | extern void _nl_cleanup_time (struct locale_data *) | |
7539 | ; | |
7540 | # 53 "regex.c" 2 | |
7541 | ||
7542 | ||
7543 | ||
7544 | ||
7545 | ||
7546 | # 1 "../include/limits.h" 1 | |
7547 | # 145 "../include/limits.h" | |
7548 | # 1 "../include/bits/posix1_lim.h" 1 | |
7549 | # 146 "../include/limits.h" 2 | |
7550 | ||
7551 | ||
7552 | ||
7553 | # 1 "../include/bits/posix2_lim.h" 1 | |
7554 | # 150 "../include/limits.h" 2 | |
7555 | # 59 "regex.c" 2 | |
7556 | ||
7557 | # 1 "../include/regex.h" 1 | |
7558 | ||
7559 | # 1 "../posix/regex.h" 1 | |
7560 | # 25 "../posix/regex.h" | |
7561 | # 1 "../include/sys/types.h" 1 | |
7562 | # 26 "../posix/regex.h" 2 | |
7563 | # 36 "../posix/regex.h" | |
7564 | typedef long int s_reg_t; | |
7565 | typedef unsigned long int active_reg_t; | |
7566 | ||
7567 | ||
7568 | ||
7569 | ||
7570 | ||
7571 | ||
7572 | typedef unsigned long int reg_syntax_t; | |
7573 | # 181 "../posix/regex.h" | |
7574 | extern reg_syntax_t re_syntax_options; | |
7575 | # 303 "../posix/regex.h" | |
7576 | typedef enum | |
7577 | { | |
7578 | ||
7579 | REG_ENOSYS = -1, | |
7580 | ||
7581 | ||
7582 | REG_NOERROR = 0, | |
7583 | REG_NOMATCH, | |
7584 | ||
7585 | ||
7586 | ||
7587 | REG_BADPAT, | |
7588 | REG_ECOLLATE, | |
7589 | REG_ECTYPE, | |
7590 | REG_EESCAPE, | |
7591 | REG_ESUBREG, | |
7592 | REG_EBRACK, | |
7593 | REG_EPAREN, | |
7594 | REG_EBRACE, | |
7595 | REG_BADBR, | |
7596 | REG_ERANGE, | |
7597 | REG_ESPACE, | |
7598 | REG_BADRPT, | |
7599 | ||
7600 | ||
7601 | REG_EEND, | |
7602 | REG_ESIZE, | |
7603 | REG_ERPAREN | |
7604 | } reg_errcode_t; | |
7605 | # 343 "../posix/regex.h" | |
7606 | struct re_pattern_buffer | |
7607 | { | |
7608 | ||
7609 | ||
7610 | ||
7611 | unsigned char *buffer; | |
7612 | ||
7613 | ||
7614 | unsigned long int allocated; | |
7615 | ||
7616 | ||
7617 | unsigned long int used; | |
7618 | ||
7619 | ||
7620 | reg_syntax_t syntax; | |
7621 | ||
7622 | ||
7623 | ||
7624 | ||
7625 | char *fastmap; | |
7626 | ||
7627 | ||
7628 | ||
7629 | ||
7630 | ||
7631 | unsigned char * translate; | |
7632 | ||
7633 | ||
7634 | size_t re_nsub; | |
7635 | ||
7636 | ||
7637 | ||
7638 | ||
7639 | ||
7640 | unsigned can_be_null : 1; | |
7641 | # 386 "../posix/regex.h" | |
7642 | unsigned regs_allocated : 2; | |
7643 | ||
7644 | ||
7645 | ||
7646 | unsigned fastmap_accurate : 1; | |
7647 | ||
7648 | ||
7649 | ||
7650 | unsigned no_sub : 1; | |
7651 | ||
7652 | ||
7653 | ||
7654 | unsigned not_bol : 1; | |
7655 | ||
7656 | ||
7657 | unsigned not_eol : 1; | |
7658 | ||
7659 | ||
7660 | unsigned newline_anchor : 1; | |
7661 | }; | |
7662 | ||
7663 | typedef struct re_pattern_buffer regex_t; | |
7664 | ||
7665 | ||
7666 | typedef int regoff_t; | |
7667 | ||
7668 | ||
7669 | ||
7670 | ||
7671 | struct re_registers | |
7672 | { | |
7673 | unsigned num_regs; | |
7674 | regoff_t *start; | |
7675 | regoff_t *end; | |
7676 | }; | |
7677 | # 434 "../posix/regex.h" | |
7678 | typedef struct | |
7679 | { | |
7680 | regoff_t rm_so; | |
7681 | regoff_t rm_eo; | |
7682 | } regmatch_t; | |
7683 | ||
7684 | ||
7685 | ||
7686 | ||
7687 | ||
7688 | extern reg_syntax_t __re_set_syntax (reg_syntax_t __syntax); | |
7689 | ||
7690 | ||
7691 | ||
7692 | ||
7693 | extern const char *__re_compile_pattern (const char *__pattern, size_t __length, struct re_pattern_buffer *__buffer); | |
7694 | ||
7695 | ||
7696 | ||
7697 | ||
7698 | ||
7699 | ||
7700 | extern int __re_compile_fastmap (struct re_pattern_buffer *__buffer); | |
7701 | ||
7702 | ||
7703 | ||
7704 | ||
7705 | ||
7706 | ||
7707 | ||
7708 | extern int __re_search (struct re_pattern_buffer *__buffer, const char *__string, int __length, int __start, int __range, struct re_registers *__regs); | |
7709 | ||
7710 | ||
7711 | ||
7712 | ||
7713 | ||
7714 | ||
7715 | extern int __re_search_2 (struct re_pattern_buffer *__buffer, const char *__string1, int __length1, const char *__string2, int __length2, int __start, int __range, struct re_registers *__regs, int __stop); | |
7716 | ||
7717 | ||
7718 | ||
7719 | ||
7720 | ||
7721 | ||
7722 | ||
7723 | extern int __re_match (struct re_pattern_buffer *__buffer, const char *__string, int __length, int __start, struct re_registers *__regs); | |
7724 | ||
7725 | ||
7726 | ||
7727 | ||
7728 | extern int __re_match_2 (struct re_pattern_buffer *__buffer, const char *__string1, int __length1, const char *__string2, int __length2, int __start, struct re_registers *__regs, int __stop); | |
7729 | # 502 "../posix/regex.h" | |
7730 | extern void __re_set_registers (struct re_pattern_buffer *__buffer, struct re_registers *__regs, unsigned int __num_regs, regoff_t *__starts, regoff_t *__ends); | |
7731 | ||
7732 | ||
7733 | ||
7734 | ||
7735 | ||
7736 | ||
7737 | ||
7738 | extern char *re_comp (const char *); | |
7739 | extern int re_exec (const char *); | |
7740 | # 537 "../posix/regex.h" | |
7741 | extern int __regcomp (regex_t *__restrict __preg, const char *__restrict __pattern, int __cflags); | |
7742 | ||
7743 | ||
7744 | ||
7745 | extern int __regexec (const regex_t *__restrict __preg, const char *__restrict __string, size_t __nmatch, regmatch_t __pmatch[__restrict], int __eflags); | |
7746 | ||
7747 | ||
7748 | ||
7749 | ||
7750 | extern size_t __regerror(int __errcode, const regex_t *__restrict __preg, char *__restrict __errbuf, size_t __errbuf_size); | |
7751 | ||
7752 | ||
7753 | extern void __regfree (regex_t *__preg); | |
7754 | # 3 "../include/regex.h" 2 | |
7755 | ||
7756 | ||
7757 | extern reg_syntax_t __re_set_syntax (reg_syntax_t syntax); | |
7758 | ||
7759 | extern const char *__re_compile_pattern (const char *pattern, size_t length, | |
7760 | struct re_pattern_buffer *buffer); | |
7761 | ||
7762 | extern int __re_compile_fastmap (struct re_pattern_buffer *buffer); | |
7763 | ||
7764 | extern int __re_search (struct re_pattern_buffer *buffer, const char *string, | |
7765 | int length, int start, int range, | |
7766 | struct re_registers *regs); | |
7767 | ||
7768 | extern int __re_search_2 | |
7769 | (struct re_pattern_buffer *buffer, const char *string1, | |
7770 | int length1, const char *string2, int length2, | |
7771 | int start, int range, struct re_registers *regs, int stop); | |
7772 | ||
7773 | extern int __re_match | |
7774 | (struct re_pattern_buffer *buffer, const char *string, | |
7775 | int length, int start, struct re_registers *regs); | |
7776 | ||
7777 | extern int __re_match_2 | |
7778 | (struct re_pattern_buffer *buffer, const char *string1, | |
7779 | int length1, const char *string2, int length2, | |
7780 | int start, struct re_registers *regs, int stop); | |
7781 | ||
7782 | extern void __re_set_registers | |
7783 | (struct re_pattern_buffer *buffer, struct re_registers *regs, | |
7784 | unsigned num_regs, regoff_t *starts, regoff_t *ends); | |
7785 | ||
7786 | extern int __regcomp (regex_t *__preg, const char *__pattern, int __cflags); | |
7787 | ||
7788 | extern int __regexec (const regex_t *__preg, const char *__string, | |
7789 | size_t __nmatch, regmatch_t __pmatch[], int __eflags); | |
7790 | ||
7791 | extern size_t __regerror (int __errcode, const regex_t *__preg, | |
7792 | char *__errbuf, size_t __errbuf_size); | |
7793 | ||
7794 | extern void __regfree (regex_t *__preg); | |
7795 | # 61 "regex.c" 2 | |
7796 | # 1 "regex_internal.h" 1 | |
7797 | # 24 "regex_internal.h" | |
7798 | # 1 "../include/assert.h" 1 | |
7799 | # 1 "../assert/assert.h" 1 | |
7800 | # 65 "../assert/assert.h" | |
7801 | ||
7802 | ||
7803 | ||
7804 | extern void __assert_fail (__const char *__assertion, __const char *__file, | |
7805 | unsigned int __line, __const char *__function) | |
7806 | __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
7807 | ||
7808 | ||
7809 | extern void __assert_perror_fail (int __errnum, __const char *__file, | |
7810 | unsigned int __line, | |
7811 | __const char *__function) | |
7812 | __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
7813 | ||
7814 | ||
7815 | ||
7816 | ||
7817 | extern void __assert (const char *__assertion, const char *__file, int __line) | |
7818 | __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
7819 | ||
7820 | ||
7821 | ||
7822 | # 2 "../include/assert.h" 2 | |
7823 | ||
7824 | ||
7825 | ||
7826 | ||
7827 | extern void __assert_fail (__const char *__assertion, __const char *__file, | |
7828 | unsigned int __line, __const char *__function) | |
7829 | __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
7830 | ||
7831 | ||
7832 | extern void __assert_perror_fail (int __errnum, __const char *__file, | |
7833 | unsigned int __line, | |
7834 | __const char *__function) | |
7835 | __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
7836 | ||
7837 | ||
7838 | ||
7839 | ||
7840 | # 25 "regex_internal.h" 2 | |
7841 | # 1 "../include/ctype.h" 1 | |
7842 | ||
7843 | ||
7844 | extern int __isctype (int __c, int __mask); | |
7845 | # 14 "../include/ctype.h" | |
7846 | # 1 "../include/../locale/localeinfo.h" 1 | |
7847 | # 15 "../include/ctype.h" 2 | |
7848 | ||
7849 | ||
7850 | ||
7851 | ||
7852 | ||
7853 | ||
7854 | extern __thread void *__libc_tsd_CTYPE_B __attribute__ ((tls_model ("initial-exec"))); | |
7855 | extern __thread void *__libc_tsd_CTYPE_TOUPPER __attribute__ ((tls_model ("initial-exec"))); | |
7856 | extern __thread void *__libc_tsd_CTYPE_TOLOWER __attribute__ ((tls_model ("initial-exec"))); | |
7857 | ||
7858 | extern inline const uint16_t ** __attribute__ ((const)) | |
7859 | __ctype_b_loc (void) | |
7860 | { | |
7861 | union | |
7862 | { | |
7863 | void **ptr; | |
7864 | const uint16_t **tablep; | |
7865 | } u; | |
7866 | u.ptr = (&__libc_tsd_CTYPE_B); | |
7867 | if (__builtin_expect (*u.tablep == ((void *)0), 0)) | |
7868 | *u.tablep = (const uint16_t *) ((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CLASS) & 0xffff)].string) + 128; | |
7869 | return u.tablep; | |
7870 | } | |
7871 | ||
7872 | extern inline const int32_t ** __attribute__ ((const)) | |
7873 | __ctype_toupper_loc (void) | |
7874 | { | |
7875 | union | |
7876 | { | |
7877 | void **ptr; | |
7878 | const int32_t **tablep; | |
7879 | } u; | |
7880 | u.ptr = (&__libc_tsd_CTYPE_TOUPPER); | |
7881 | if (__builtin_expect (*u.tablep == ((void *)0), 0)) | |
7882 | *u.tablep = ((int32_t *) ((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_TOUPPER) & 0xffff)].string) + 128); | |
7883 | return u.tablep; | |
7884 | } | |
7885 | ||
7886 | extern inline const int32_t ** __attribute__ ((const)) | |
7887 | __ctype_tolower_loc (void) | |
7888 | { | |
7889 | union | |
7890 | { | |
7891 | void **ptr; | |
7892 | const int32_t **tablep; | |
7893 | } u; | |
7894 | u.ptr = (&__libc_tsd_CTYPE_TOLOWER); | |
7895 | if (__builtin_expect (*u.tablep == ((void *)0), 0)) | |
7896 | *u.tablep = ((int32_t *) ((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_TOLOWER) & 0xffff)].string) + 128); | |
7897 | return u.tablep; | |
7898 | } | |
7899 | ||
7900 | ||
7901 | ||
7902 | # 1 "../ctype/ctype.h" 1 | |
7903 | # 30 "../ctype/ctype.h" | |
7904 | ||
7905 | # 41 "../ctype/ctype.h" | |
7906 | # 1 "../include/endian.h" 1 | |
7907 | # 42 "../ctype/ctype.h" 2 | |
7908 | ||
7909 | ||
7910 | ||
7911 | ||
7912 | ||
7913 | ||
7914 | enum | |
7915 | { | |
7916 | _ISupper = (1 << (0)), | |
7917 | _ISlower = (1 << (1)), | |
7918 | _ISalpha = (1 << (2)), | |
7919 | _ISdigit = (1 << (3)), | |
7920 | _ISxdigit = (1 << (4)), | |
7921 | _ISspace = (1 << (5)), | |
7922 | _ISprint = (1 << (6)), | |
7923 | _ISgraph = (1 << (7)), | |
7924 | _ISblank = (1 << (8)), | |
7925 | _IScntrl = (1 << (9)), | |
7926 | _ISpunct = (1 << (10)), | |
7927 | _ISalnum = (1 << (11)) | |
7928 | }; | |
7929 | # 81 "../ctype/ctype.h" | |
7930 | extern __const unsigned short int **__ctype_b_loc (void) | |
7931 | __attribute__ ((__const)); | |
7932 | extern __const __int32_t **__ctype_tolower_loc (void) | |
7933 | __attribute__ ((__const)); | |
7934 | extern __const __int32_t **__ctype_toupper_loc (void) | |
7935 | __attribute__ ((__const)); | |
7936 | # 96 "../ctype/ctype.h" | |
7937 | ||
7938 | ||
7939 | ||
7940 | ||
7941 | ||
7942 | ||
7943 | extern int isalnum (int) __attribute__ ((__nothrow__)); | |
7944 | extern int isalpha (int) __attribute__ ((__nothrow__)); | |
7945 | extern int iscntrl (int) __attribute__ ((__nothrow__)); | |
7946 | extern int isdigit (int) __attribute__ ((__nothrow__)); | |
7947 | extern int islower (int) __attribute__ ((__nothrow__)); | |
7948 | extern int isgraph (int) __attribute__ ((__nothrow__)); | |
7949 | extern int isprint (int) __attribute__ ((__nothrow__)); | |
7950 | extern int ispunct (int) __attribute__ ((__nothrow__)); | |
7951 | extern int isspace (int) __attribute__ ((__nothrow__)); | |
7952 | extern int isupper (int) __attribute__ ((__nothrow__)); | |
7953 | extern int isxdigit (int) __attribute__ ((__nothrow__)); | |
7954 | ||
7955 | ||
7956 | ||
7957 | extern int tolower (int __c) __attribute__ ((__nothrow__)); | |
7958 | ||
7959 | ||
7960 | extern int toupper (int __c) __attribute__ ((__nothrow__)); | |
7961 | ||
7962 | ||
7963 | ||
7964 | ||
7965 | ||
7966 | ||
7967 | ||
7968 | ||
7969 | extern int isblank (int) __attribute__ ((__nothrow__)); | |
7970 | ||
7971 | ||
7972 | ||
7973 | ||
7974 | ||
7975 | ||
7976 | extern int isctype (int __c, int __mask) __attribute__ ((__nothrow__)); | |
7977 | ||
7978 | ||
7979 | ||
7980 | ||
7981 | ||
7982 | ||
7983 | extern int isascii (int __c) __attribute__ ((__nothrow__)); | |
7984 | ||
7985 | ||
7986 | ||
7987 | extern int toascii (int __c) __attribute__ ((__nothrow__)); | |
7988 | ||
7989 | ||
7990 | ||
7991 | extern int _toupper (int) __attribute__ ((__nothrow__)); | |
7992 | extern int _tolower (int) __attribute__ ((__nothrow__)); | |
7993 | # 190 "../ctype/ctype.h" | |
7994 | extern __inline int | |
7995 | __attribute__ ((__nothrow__)) tolower (int __c) | |
7996 | { | |
7997 | return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c; | |
7998 | } | |
7999 | ||
8000 | extern __inline int | |
8001 | __attribute__ ((__nothrow__)) toupper (int __c) | |
8002 | { | |
8003 | return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c; | |
8004 | } | |
8005 | # 233 "../ctype/ctype.h" | |
8006 | # 1 "../include/xlocale.h" 1 | |
8007 | # 234 "../ctype/ctype.h" 2 | |
8008 | # 247 "../ctype/ctype.h" | |
8009 | extern int isalnum_l (int, __locale_t) __attribute__ ((__nothrow__)); | |
8010 | extern int isalpha_l (int, __locale_t) __attribute__ ((__nothrow__)); | |
8011 | extern int iscntrl_l (int, __locale_t) __attribute__ ((__nothrow__)); | |
8012 | extern int isdigit_l (int, __locale_t) __attribute__ ((__nothrow__)); | |
8013 | extern int islower_l (int, __locale_t) __attribute__ ((__nothrow__)); | |
8014 | extern int isgraph_l (int, __locale_t) __attribute__ ((__nothrow__)); | |
8015 | extern int isprint_l (int, __locale_t) __attribute__ ((__nothrow__)); | |
8016 | extern int ispunct_l (int, __locale_t) __attribute__ ((__nothrow__)); | |
8017 | extern int isspace_l (int, __locale_t) __attribute__ ((__nothrow__)); | |
8018 | extern int isupper_l (int, __locale_t) __attribute__ ((__nothrow__)); | |
8019 | extern int isxdigit_l (int, __locale_t) __attribute__ ((__nothrow__)); | |
8020 | ||
8021 | extern int isblank_l (int, __locale_t) __attribute__ ((__nothrow__)); | |
8022 | ||
8023 | ||
8024 | ||
8025 | extern int __tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); | |
8026 | extern int tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); | |
8027 | ||
8028 | ||
8029 | extern int __toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); | |
8030 | extern int toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); | |
8031 | # 323 "../ctype/ctype.h" | |
8032 | ||
8033 | # 70 "../include/ctype.h" 2 | |
8034 | # 26 "regex_internal.h" 2 | |
8035 | # 1 "../include/stdio.h" 1 | |
8036 | ||
8037 | ||
8038 | ||
8039 | ||
8040 | # 1 "../libio/stdio.h" 1 | |
8041 | # 30 "../libio/stdio.h" | |
8042 | ||
8043 | ||
8044 | ||
8045 | ||
8046 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
8047 | # 35 "../libio/stdio.h" 2 | |
8048 | # 44 "../libio/stdio.h" | |
8049 | ||
8050 | ||
8051 | typedef struct _IO_FILE FILE; | |
8052 | ||
8053 | ||
8054 | ||
8055 | ||
8056 | ||
8057 | # 62 "../libio/stdio.h" | |
8058 | typedef struct _IO_FILE __FILE; | |
8059 | # 72 "../libio/stdio.h" | |
8060 | # 1 "../include/libio.h" 1 | |
8061 | # 1 "../libio/libio.h" 1 | |
8062 | # 32 "../libio/libio.h" | |
8063 | # 1 "../sysdeps/gnu/_G_config.h" 1 | |
8064 | # 14 "../sysdeps/gnu/_G_config.h" | |
8065 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
8066 | # 355 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 3 4 | |
8067 | typedef unsigned int wint_t; | |
8068 | # 15 "../sysdeps/gnu/_G_config.h" 2 | |
8069 | # 24 "../sysdeps/gnu/_G_config.h" | |
8070 | # 1 "../include/wchar.h" 1 | |
8071 | ||
8072 | # 1 "../wcsmbs/wchar.h" 1 | |
8073 | # 48 "../wcsmbs/wchar.h" | |
8074 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
8075 | # 49 "../wcsmbs/wchar.h" 2 | |
8076 | # 76 "../wcsmbs/wchar.h" | |
8077 | typedef struct | |
8078 | { | |
8079 | int __count; | |
8080 | union | |
8081 | { | |
8082 | wint_t __wch; | |
8083 | char __wchb[4]; | |
8084 | } __value; | |
8085 | } __mbstate_t; | |
8086 | # 3 "../include/wchar.h" 2 | |
8087 | # 25 "../sysdeps/gnu/_G_config.h" 2 | |
8088 | ||
8089 | typedef struct | |
8090 | { | |
8091 | __off_t __pos; | |
8092 | __mbstate_t __state; | |
8093 | } _G_fpos_t; | |
8094 | typedef struct | |
8095 | { | |
8096 | __off64_t __pos; | |
8097 | __mbstate_t __state; | |
8098 | } _G_fpos64_t; | |
8099 | # 44 "../sysdeps/gnu/_G_config.h" | |
8100 | # 1 "../include/gconv.h" 1 | |
8101 | # 1 "../iconv/gconv.h" 1 | |
8102 | # 28 "../iconv/gconv.h" | |
8103 | # 1 "../include/wchar.h" 1 | |
8104 | ||
8105 | # 1 "../wcsmbs/wchar.h" 1 | |
8106 | # 48 "../wcsmbs/wchar.h" | |
8107 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
8108 | # 49 "../wcsmbs/wchar.h" 2 | |
8109 | # 3 "../include/wchar.h" 2 | |
8110 | # 29 "../iconv/gconv.h" 2 | |
8111 | ||
8112 | ||
8113 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
8114 | # 32 "../iconv/gconv.h" 2 | |
8115 | ||
8116 | ||
8117 | ||
8118 | ||
8119 | ||
8120 | enum | |
8121 | { | |
8122 | __GCONV_OK = 0, | |
8123 | __GCONV_NOCONV, | |
8124 | __GCONV_NODB, | |
8125 | __GCONV_NOMEM, | |
8126 | ||
8127 | __GCONV_EMPTY_INPUT, | |
8128 | __GCONV_FULL_OUTPUT, | |
8129 | __GCONV_ILLEGAL_INPUT, | |
8130 | __GCONV_INCOMPLETE_INPUT, | |
8131 | ||
8132 | __GCONV_ILLEGAL_DESCRIPTOR, | |
8133 | __GCONV_INTERNAL_ERROR | |
8134 | }; | |
8135 | ||
8136 | ||
8137 | ||
8138 | enum | |
8139 | { | |
8140 | __GCONV_IS_LAST = 0x0001, | |
8141 | __GCONV_IGNORE_ERRORS = 0x0002 | |
8142 | }; | |
8143 | ||
8144 | ||
8145 | ||
8146 | struct __gconv_step; | |
8147 | struct __gconv_step_data; | |
8148 | struct __gconv_loaded_object; | |
8149 | struct __gconv_trans_data; | |
8150 | ||
8151 | ||
8152 | ||
8153 | typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *, | |
8154 | __const unsigned char **, __const unsigned char *, | |
8155 | unsigned char **, size_t *, int, int); | |
8156 | ||
8157 | ||
8158 | typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char); | |
8159 | ||
8160 | ||
8161 | typedef int (*__gconv_init_fct) (struct __gconv_step *); | |
8162 | typedef void (*__gconv_end_fct) (struct __gconv_step *); | |
8163 | ||
8164 | ||
8165 | ||
8166 | typedef int (*__gconv_trans_fct) (struct __gconv_step *, | |
8167 | struct __gconv_step_data *, void *, | |
8168 | __const unsigned char *, | |
8169 | __const unsigned char **, | |
8170 | __const unsigned char *, unsigned char **, | |
8171 | size_t *); | |
8172 | ||
8173 | ||
8174 | typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *, | |
8175 | __const unsigned char *, | |
8176 | unsigned char *, unsigned char *); | |
8177 | ||
8178 | ||
8179 | typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***, | |
8180 | size_t *); | |
8181 | ||
8182 | ||
8183 | typedef int (*__gconv_trans_init_fct) (void **, const char *); | |
8184 | typedef void (*__gconv_trans_end_fct) (void *); | |
8185 | ||
8186 | struct __gconv_trans_data | |
8187 | { | |
8188 | ||
8189 | __gconv_trans_fct __trans_fct; | |
8190 | __gconv_trans_context_fct __trans_context_fct; | |
8191 | __gconv_trans_end_fct __trans_end_fct; | |
8192 | void *__data; | |
8193 | struct __gconv_trans_data *__next; | |
8194 | }; | |
8195 | ||
8196 | ||
8197 | ||
8198 | struct __gconv_step | |
8199 | { | |
8200 | struct __gconv_loaded_object *__shlib_handle; | |
8201 | __const char *__modname; | |
8202 | ||
8203 | int __counter; | |
8204 | ||
8205 | char *__from_name; | |
8206 | char *__to_name; | |
8207 | ||
8208 | __gconv_fct __fct; | |
8209 | __gconv_btowc_fct __btowc_fct; | |
8210 | __gconv_init_fct __init_fct; | |
8211 | __gconv_end_fct __end_fct; | |
8212 | ||
8213 | ||
8214 | ||
8215 | int __min_needed_from; | |
8216 | int __max_needed_from; | |
8217 | int __min_needed_to; | |
8218 | int __max_needed_to; | |
8219 | ||
8220 | ||
8221 | int __stateful; | |
8222 | ||
8223 | void *__data; | |
8224 | }; | |
8225 | ||
8226 | ||
8227 | ||
8228 | struct __gconv_step_data | |
8229 | { | |
8230 | unsigned char *__outbuf; | |
8231 | unsigned char *__outbufend; | |
8232 | ||
8233 | ||
8234 | ||
8235 | int __flags; | |
8236 | ||
8237 | ||
8238 | ||
8239 | int __invocation_counter; | |
8240 | ||
8241 | ||
8242 | ||
8243 | int __internal_use; | |
8244 | ||
8245 | __mbstate_t *__statep; | |
8246 | __mbstate_t __state; | |
8247 | ||
8248 | ||
8249 | ||
8250 | struct __gconv_trans_data *__trans; | |
8251 | }; | |
8252 | ||
8253 | ||
8254 | ||
8255 | typedef struct __gconv_info | |
8256 | { | |
8257 | size_t __nsteps; | |
8258 | struct __gconv_step *__steps; | |
8259 | __extension__ struct __gconv_step_data __data []; | |
8260 | } *__gconv_t; | |
8261 | # 1 "../include/gconv.h" 2 | |
8262 | # 45 "../sysdeps/gnu/_G_config.h" 2 | |
8263 | typedef union | |
8264 | { | |
8265 | struct __gconv_info __cd; | |
8266 | struct | |
8267 | { | |
8268 | struct __gconv_info __cd; | |
8269 | struct __gconv_step_data __data; | |
8270 | } __combined; | |
8271 | } _G_iconv_t; | |
8272 | ||
8273 | typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); | |
8274 | typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); | |
8275 | typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); | |
8276 | typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); | |
8277 | # 33 "../libio/libio.h" 2 | |
8278 | # 53 "../libio/libio.h" | |
8279 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stdarg.h" 1 3 4 | |
8280 | # 43 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stdarg.h" 3 4 | |
8281 | typedef __builtin_va_list __gnuc_va_list; | |
8282 | # 54 "../libio/libio.h" 2 | |
8283 | # 167 "../libio/libio.h" | |
8284 | struct _IO_jump_t; struct _IO_FILE; | |
8285 | # 177 "../libio/libio.h" | |
8286 | typedef void _IO_lock_t; | |
8287 | ||
8288 | ||
8289 | ||
8290 | ||
8291 | ||
8292 | struct _IO_marker { | |
8293 | struct _IO_marker *_next; | |
8294 | struct _IO_FILE *_sbuf; | |
8295 | ||
8296 | ||
8297 | ||
8298 | int _pos; | |
8299 | # 200 "../libio/libio.h" | |
8300 | }; | |
8301 | ||
8302 | ||
8303 | enum __codecvt_result | |
8304 | { | |
8305 | __codecvt_ok, | |
8306 | __codecvt_partial, | |
8307 | __codecvt_error, | |
8308 | __codecvt_noconv | |
8309 | }; | |
8310 | ||
8311 | ||
8312 | ||
8313 | ||
8314 | struct _IO_codecvt | |
8315 | { | |
8316 | void (*__codecvt_destr) (struct _IO_codecvt *); | |
8317 | enum __codecvt_result (*__codecvt_do_out) (struct _IO_codecvt *, | |
8318 | __mbstate_t *, | |
8319 | const wchar_t *, | |
8320 | const wchar_t *, | |
8321 | const wchar_t **, char *, | |
8322 | char *, char **); | |
8323 | enum __codecvt_result (*__codecvt_do_unshift) (struct _IO_codecvt *, | |
8324 | __mbstate_t *, char *, | |
8325 | char *, char **); | |
8326 | enum __codecvt_result (*__codecvt_do_in) (struct _IO_codecvt *, | |
8327 | __mbstate_t *, | |
8328 | const char *, const char *, | |
8329 | const char **, wchar_t *, | |
8330 | wchar_t *, wchar_t **); | |
8331 | int (*__codecvt_do_encoding) (struct _IO_codecvt *); | |
8332 | int (*__codecvt_do_always_noconv) (struct _IO_codecvt *); | |
8333 | int (*__codecvt_do_length) (struct _IO_codecvt *, __mbstate_t *, | |
8334 | const char *, const char *, size_t); | |
8335 | int (*__codecvt_do_max_length) (struct _IO_codecvt *); | |
8336 | ||
8337 | _G_iconv_t __cd_in; | |
8338 | _G_iconv_t __cd_out; | |
8339 | }; | |
8340 | ||
8341 | ||
8342 | struct _IO_wide_data | |
8343 | { | |
8344 | wchar_t *_IO_read_ptr; | |
8345 | wchar_t *_IO_read_end; | |
8346 | wchar_t *_IO_read_base; | |
8347 | wchar_t *_IO_write_base; | |
8348 | wchar_t *_IO_write_ptr; | |
8349 | wchar_t *_IO_write_end; | |
8350 | wchar_t *_IO_buf_base; | |
8351 | wchar_t *_IO_buf_end; | |
8352 | ||
8353 | wchar_t *_IO_save_base; | |
8354 | wchar_t *_IO_backup_base; | |
8355 | ||
8356 | wchar_t *_IO_save_end; | |
8357 | ||
8358 | __mbstate_t _IO_state; | |
8359 | __mbstate_t _IO_last_state; | |
8360 | struct _IO_codecvt _codecvt; | |
8361 | ||
8362 | wchar_t _shortbuf[1]; | |
8363 | ||
8364 | const struct _IO_jump_t *_wide_vtable; | |
8365 | }; | |
8366 | ||
8367 | ||
8368 | struct _IO_FILE { | |
8369 | int _flags; | |
8370 | ||
8371 | ||
8372 | ||
8373 | ||
8374 | char* _IO_read_ptr; | |
8375 | char* _IO_read_end; | |
8376 | char* _IO_read_base; | |
8377 | char* _IO_write_base; | |
8378 | char* _IO_write_ptr; | |
8379 | char* _IO_write_end; | |
8380 | char* _IO_buf_base; | |
8381 | char* _IO_buf_end; | |
8382 | ||
8383 | char *_IO_save_base; | |
8384 | char *_IO_backup_base; | |
8385 | char *_IO_save_end; | |
8386 | ||
8387 | struct _IO_marker *_markers; | |
8388 | ||
8389 | struct _IO_FILE *_chain; | |
8390 | ||
8391 | int _fileno; | |
8392 | ||
8393 | ||
8394 | ||
8395 | int _flags2; | |
8396 | ||
8397 | __off_t _old_offset; | |
8398 | ||
8399 | ||
8400 | ||
8401 | unsigned short _cur_column; | |
8402 | signed char _vtable_offset; | |
8403 | char _shortbuf[1]; | |
8404 | ||
8405 | ||
8406 | ||
8407 | _IO_lock_t *_lock; | |
8408 | # 316 "../libio/libio.h" | |
8409 | __off64_t _offset; | |
8410 | ||
8411 | ||
8412 | struct _IO_codecvt *_codecvt; | |
8413 | struct _IO_wide_data *_wide_data; | |
8414 | struct _IO_FILE *_freeres_list; | |
8415 | void *_freeres_buf; | |
8416 | size_t _freeres_size; | |
8417 | ||
8418 | ||
8419 | ||
8420 | ||
8421 | ||
8422 | ||
8423 | ||
8424 | int _mode; | |
8425 | ||
8426 | char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; | |
8427 | ||
8428 | }; | |
8429 | ||
8430 | ||
8431 | typedef struct _IO_FILE _IO_FILE; | |
8432 | ||
8433 | ||
8434 | struct _IO_FILE_plus; | |
8435 | ||
8436 | extern struct _IO_FILE_plus _IO_2_1_stdin_; | |
8437 | extern struct _IO_FILE_plus _IO_2_1_stdout_; | |
8438 | extern struct _IO_FILE_plus _IO_2_1_stderr_; | |
8439 | ||
8440 | ||
8441 | ||
8442 | ||
8443 | ||
8444 | extern _IO_FILE *_IO_stdin ; | |
8445 | extern _IO_FILE *_IO_stdout ; | |
8446 | extern _IO_FILE *_IO_stderr ; | |
8447 | ||
8448 | ||
8449 | ||
8450 | ||
8451 | ||
8452 | ||
8453 | ||
8454 | typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); | |
8455 | ||
8456 | ||
8457 | ||
8458 | ||
8459 | ||
8460 | ||
8461 | ||
8462 | typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, | |
8463 | size_t __n); | |
8464 | ||
8465 | ||
8466 | ||
8467 | ||
8468 | ||
8469 | ||
8470 | ||
8471 | typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); | |
8472 | ||
8473 | ||
8474 | typedef int __io_close_fn (void *__cookie); | |
8475 | ||
8476 | ||
8477 | ||
8478 | ||
8479 | typedef __io_read_fn cookie_read_function_t; | |
8480 | typedef __io_write_fn cookie_write_function_t; | |
8481 | typedef __io_seek_fn cookie_seek_function_t; | |
8482 | typedef __io_close_fn cookie_close_function_t; | |
8483 | ||
8484 | ||
8485 | typedef struct | |
8486 | { | |
8487 | __io_read_fn *read; | |
8488 | __io_write_fn *write; | |
8489 | __io_seek_fn *seek; | |
8490 | __io_close_fn *close; | |
8491 | } _IO_cookie_io_functions_t; | |
8492 | typedef _IO_cookie_io_functions_t cookie_io_functions_t; | |
8493 | ||
8494 | struct _IO_cookie_file; | |
8495 | ||
8496 | ||
8497 | extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write, | |
8498 | void *__cookie, _IO_cookie_io_functions_t __fns); | |
8499 | ||
8500 | ||
8501 | ||
8502 | ||
8503 | ||
8504 | ||
8505 | ||
8506 | extern int __underflow (_IO_FILE *) __attribute__ ((__nothrow__)); | |
8507 | extern int __uflow (_IO_FILE *) __attribute__ ((__nothrow__)); | |
8508 | extern int __overflow (_IO_FILE *, int) __attribute__ ((__nothrow__)); | |
8509 | extern wint_t __wunderflow (_IO_FILE *) __attribute__ ((__nothrow__)); | |
8510 | extern wint_t __wuflow (_IO_FILE *) __attribute__ ((__nothrow__)); | |
8511 | extern wint_t __woverflow (_IO_FILE *, wint_t) __attribute__ ((__nothrow__)); | |
8512 | # 451 "../libio/libio.h" | |
8513 | extern int _IO_getc (_IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
8514 | extern int _IO_putc (int __c, _IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
8515 | extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
8516 | extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
8517 | ||
8518 | extern int _IO_peekc_locked (_IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
8519 | ||
8520 | ||
8521 | ||
8522 | ||
8523 | ||
8524 | extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__)); | |
8525 | extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__)); | |
8526 | extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__)); | |
8527 | # 481 "../libio/libio.h" | |
8528 | extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, | |
8529 | __gnuc_va_list, int *__restrict); | |
8530 | extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, | |
8531 | __gnuc_va_list); | |
8532 | extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) __attribute__ ((__nothrow__)); | |
8533 | extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) __attribute__ ((__nothrow__)); | |
8534 | ||
8535 | extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) __attribute__ ((__nothrow__)); | |
8536 | extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) __attribute__ ((__nothrow__)); | |
8537 | ||
8538 | extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__)); | |
8539 | ||
8540 | ||
8541 | extern wint_t _IO_getwc (_IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
8542 | extern wint_t _IO_putwc (wchar_t __wc, _IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
8543 | extern int _IO_fwide (_IO_FILE *__fp, int __mode) __attribute__ ((__nothrow__)); | |
8544 | # 530 "../libio/libio.h" | |
8545 | extern int _IO_vfwscanf (_IO_FILE * __restrict, const wchar_t * __restrict, | |
8546 | __gnuc_va_list, int *__restrict); | |
8547 | extern int _IO_vfwprintf (_IO_FILE *__restrict, const wchar_t *__restrict, | |
8548 | __gnuc_va_list); | |
8549 | extern __ssize_t _IO_wpadn (_IO_FILE *, wint_t, __ssize_t) __attribute__ ((__nothrow__)); | |
8550 | extern void _IO_free_wbackup_area (_IO_FILE *) __attribute__ ((__nothrow__)); | |
8551 | # 2 "../include/libio.h" 2 | |
8552 | ||
8553 | ||
8554 | ||
8555 | ||
8556 | ||
8557 | ||
8558 | ||
8559 | ||
8560 | ||
8561 | ||
8562 | # 73 "../libio/stdio.h" 2 | |
8563 | ||
8564 | ||
8565 | ||
8566 | ||
8567 | typedef __gnuc_va_list va_list; | |
8568 | # 86 "../libio/stdio.h" | |
8569 | ||
8570 | ||
8571 | typedef _G_fpos_t fpos_t; | |
8572 | ||
8573 | ||
8574 | ||
8575 | ||
8576 | ||
8577 | typedef _G_fpos64_t fpos64_t; | |
8578 | # 138 "../libio/stdio.h" | |
8579 | # 1 "/var/tmp/portage/glibc-2.5/work/build-default-hppa2.0-unknown-linux-gnu-nptl/bits/stdio_lim.h" 1 | |
8580 | # 139 "../libio/stdio.h" 2 | |
8581 | ||
8582 | ||
8583 | ||
8584 | extern struct _IO_FILE *stdin; | |
8585 | extern struct _IO_FILE *stdout; | |
8586 | extern struct _IO_FILE *stderr; | |
8587 | ||
8588 | ||
8589 | ||
8590 | ||
8591 | ||
8592 | ||
8593 | ||
8594 | extern int remove (__const char *__filename) __attribute__ ((__nothrow__)); | |
8595 | ||
8596 | extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__)); | |
8597 | ||
8598 | ||
8599 | ||
8600 | ||
8601 | extern int renameat (int __oldfd, __const char *__old, int __newfd, | |
8602 | __const char *__new) __attribute__ ((__nothrow__)); | |
8603 | ||
8604 | ||
8605 | ||
8606 | ||
8607 | ||
8608 | ||
8609 | ||
8610 | ||
8611 | extern FILE *tmpfile (void) ; | |
8612 | # 179 "../libio/stdio.h" | |
8613 | extern FILE *tmpfile64 (void) ; | |
8614 | ||
8615 | ||
8616 | ||
8617 | extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) ; | |
8618 | ||
8619 | ||
8620 | ||
8621 | ||
8622 | ||
8623 | extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) ; | |
8624 | # 201 "../libio/stdio.h" | |
8625 | extern char *tempnam (__const char *__dir, __const char *__pfx) | |
8626 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; | |
8627 | ||
8628 | ||
8629 | ||
8630 | ||
8631 | ||
8632 | ||
8633 | ||
8634 | ||
8635 | extern int fclose (FILE *__stream); | |
8636 | ||
8637 | ||
8638 | ||
8639 | ||
8640 | extern int fflush (FILE *__stream); | |
8641 | ||
8642 | # 226 "../libio/stdio.h" | |
8643 | extern int fflush_unlocked (FILE *__stream); | |
8644 | # 236 "../libio/stdio.h" | |
8645 | extern int fcloseall (void); | |
8646 | ||
8647 | ||
8648 | ||
8649 | ||
8650 | ||
8651 | ||
8652 | ||
8653 | ||
8654 | ||
8655 | extern FILE *fopen (__const char *__restrict __filename, | |
8656 | __const char *__restrict __modes) ; | |
8657 | ||
8658 | ||
8659 | ||
8660 | ||
8661 | extern FILE *freopen (__const char *__restrict __filename, | |
8662 | __const char *__restrict __modes, | |
8663 | FILE *__restrict __stream) ; | |
8664 | # 269 "../libio/stdio.h" | |
8665 | ||
8666 | ||
8667 | extern FILE *fopen64 (__const char *__restrict __filename, | |
8668 | __const char *__restrict __modes) ; | |
8669 | extern FILE *freopen64 (__const char *__restrict __filename, | |
8670 | __const char *__restrict __modes, | |
8671 | FILE *__restrict __stream) ; | |
8672 | ||
8673 | ||
8674 | ||
8675 | ||
8676 | extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) ; | |
8677 | ||
8678 | ||
8679 | ||
8680 | ||
8681 | ||
8682 | extern FILE *fopencookie (void *__restrict __magic_cookie, | |
8683 | __const char *__restrict __modes, | |
8684 | _IO_cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__)) ; | |
8685 | ||
8686 | ||
8687 | extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes) | |
8688 | __attribute__ ((__nothrow__)) ; | |
8689 | ||
8690 | ||
8691 | ||
8692 | ||
8693 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)) ; | |
8694 | ||
8695 | ||
8696 | ||
8697 | ||
8698 | ||
8699 | ||
8700 | extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__)); | |
8701 | ||
8702 | ||
8703 | ||
8704 | extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, | |
8705 | int __modes, size_t __n) __attribute__ ((__nothrow__)); | |
8706 | ||
8707 | ||
8708 | ||
8709 | ||
8710 | ||
8711 | extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, | |
8712 | size_t __size) __attribute__ ((__nothrow__)); | |
8713 | ||
8714 | ||
8715 | extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__)); | |
8716 | ||
8717 | ||
8718 | ||
8719 | ||
8720 | ||
8721 | ||
8722 | ||
8723 | ||
8724 | extern int fprintf (FILE *__restrict __stream, | |
8725 | __const char *__restrict __format, ...); | |
8726 | ||
8727 | ||
8728 | ||
8729 | ||
8730 | extern int printf (__const char *__restrict __format, ...); | |
8731 | ||
8732 | extern int sprintf (char *__restrict __s, | |
8733 | __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); | |
8734 | ||
8735 | ||
8736 | ||
8737 | ||
8738 | ||
8739 | extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, | |
8740 | __gnuc_va_list __arg); | |
8741 | ||
8742 | ||
8743 | ||
8744 | ||
8745 | extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg); | |
8746 | ||
8747 | extern int vsprintf (char *__restrict __s, __const char *__restrict __format, | |
8748 | __gnuc_va_list __arg) __attribute__ ((__nothrow__)); | |
8749 | ||
8750 | ||
8751 | ||
8752 | ||
8753 | ||
8754 | extern int snprintf (char *__restrict __s, size_t __maxlen, | |
8755 | __const char *__restrict __format, ...) | |
8756 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); | |
8757 | ||
8758 | extern int vsnprintf (char *__restrict __s, size_t __maxlen, | |
8759 | __const char *__restrict __format, __gnuc_va_list __arg) | |
8760 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); | |
8761 | ||
8762 | ||
8763 | ||
8764 | ||
8765 | ||
8766 | ||
8767 | extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f, | |
8768 | __gnuc_va_list __arg) | |
8769 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ; | |
8770 | extern int __asprintf (char **__restrict __ptr, | |
8771 | __const char *__restrict __fmt, ...) | |
8772 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ; | |
8773 | extern int asprintf (char **__restrict __ptr, | |
8774 | __const char *__restrict __fmt, ...) | |
8775 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ; | |
8776 | ||
8777 | ||
8778 | ||
8779 | ||
8780 | ||
8781 | ||
8782 | ||
8783 | extern int vdprintf (int __fd, __const char *__restrict __fmt, | |
8784 | __gnuc_va_list __arg) | |
8785 | __attribute__ ((__format__ (__printf__, 2, 0))); | |
8786 | extern int dprintf (int __fd, __const char *__restrict __fmt, ...) | |
8787 | __attribute__ ((__format__ (__printf__, 2, 3))); | |
8788 | ||
8789 | ||
8790 | ||
8791 | ||
8792 | ||
8793 | ||
8794 | ||
8795 | ||
8796 | extern int fscanf (FILE *__restrict __stream, | |
8797 | __const char *__restrict __format, ...) ; | |
8798 | ||
8799 | ||
8800 | ||
8801 | ||
8802 | extern int scanf (__const char *__restrict __format, ...) ; | |
8803 | ||
8804 | extern int sscanf (__const char *__restrict __s, | |
8805 | __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); | |
8806 | ||
8807 | ||
8808 | ||
8809 | ||
8810 | ||
8811 | ||
8812 | ||
8813 | ||
8814 | extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, | |
8815 | __gnuc_va_list __arg) | |
8816 | __attribute__ ((__format__ (__scanf__, 2, 0))) ; | |
8817 | ||
8818 | ||
8819 | ||
8820 | ||
8821 | ||
8822 | extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) | |
8823 | __attribute__ ((__format__ (__scanf__, 1, 0))) ; | |
8824 | ||
8825 | ||
8826 | extern int vsscanf (__const char *__restrict __s, | |
8827 | __const char *__restrict __format, __gnuc_va_list __arg) | |
8828 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0))); | |
8829 | ||
8830 | ||
8831 | ||
8832 | ||
8833 | ||
8834 | ||
8835 | ||
8836 | ||
8837 | ||
8838 | extern int fgetc (FILE *__stream); | |
8839 | extern int getc (FILE *__stream); | |
8840 | ||
8841 | ||
8842 | ||
8843 | ||
8844 | ||
8845 | extern int getchar (void); | |
8846 | ||
8847 | # 461 "../libio/stdio.h" | |
8848 | extern int getc_unlocked (FILE *__stream); | |
8849 | extern int getchar_unlocked (void); | |
8850 | # 472 "../libio/stdio.h" | |
8851 | extern int fgetc_unlocked (FILE *__stream); | |
8852 | ||
8853 | ||
8854 | ||
8855 | ||
8856 | ||
8857 | ||
8858 | ||
8859 | ||
8860 | ||
8861 | ||
8862 | ||
8863 | extern int fputc (int __c, FILE *__stream); | |
8864 | extern int putc (int __c, FILE *__stream); | |
8865 | ||
8866 | ||
8867 | ||
8868 | ||
8869 | ||
8870 | extern int putchar (int __c); | |
8871 | ||
8872 | # 505 "../libio/stdio.h" | |
8873 | extern int fputc_unlocked (int __c, FILE *__stream); | |
8874 | ||
8875 | ||
8876 | ||
8877 | ||
8878 | ||
8879 | ||
8880 | ||
8881 | extern int putc_unlocked (int __c, FILE *__stream); | |
8882 | extern int putchar_unlocked (int __c); | |
8883 | ||
8884 | ||
8885 | ||
8886 | ||
8887 | ||
8888 | ||
8889 | extern int getw (FILE *__stream); | |
8890 | ||
8891 | ||
8892 | extern int putw (int __w, FILE *__stream); | |
8893 | ||
8894 | ||
8895 | ||
8896 | ||
8897 | ||
8898 | ||
8899 | ||
8900 | ||
8901 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) | |
8902 | ; | |
8903 | ||
8904 | ||
8905 | ||
8906 | ||
8907 | ||
8908 | ||
8909 | extern char *gets (char *__s) ; | |
8910 | ||
8911 | # 551 "../libio/stdio.h" | |
8912 | extern char *fgets_unlocked (char *__restrict __s, int __n, | |
8913 | FILE *__restrict __stream) ; | |
8914 | # 567 "../libio/stdio.h" | |
8915 | extern __ssize_t __getdelim (char **__restrict __lineptr, | |
8916 | size_t *__restrict __n, int __delimiter, | |
8917 | FILE *__restrict __stream) ; | |
8918 | extern __ssize_t getdelim (char **__restrict __lineptr, | |
8919 | size_t *__restrict __n, int __delimiter, | |
8920 | FILE *__restrict __stream) ; | |
8921 | ||
8922 | ||
8923 | ||
8924 | ||
8925 | ||
8926 | ||
8927 | ||
8928 | extern __ssize_t getline (char **__restrict __lineptr, | |
8929 | size_t *__restrict __n, | |
8930 | FILE *__restrict __stream) ; | |
8931 | ||
8932 | ||
8933 | ||
8934 | ||
8935 | ||
8936 | ||
8937 | ||
8938 | ||
8939 | extern int fputs (__const char *__restrict __s, FILE *__restrict __stream); | |
8940 | ||
8941 | ||
8942 | ||
8943 | ||
8944 | ||
8945 | extern int puts (__const char *__s); | |
8946 | ||
8947 | ||
8948 | ||
8949 | ||
8950 | ||
8951 | ||
8952 | extern int ungetc (int __c, FILE *__stream); | |
8953 | ||
8954 | ||
8955 | ||
8956 | ||
8957 | ||
8958 | ||
8959 | extern size_t fread (void *__restrict __ptr, size_t __size, | |
8960 | size_t __n, FILE *__restrict __stream) ; | |
8961 | ||
8962 | ||
8963 | ||
8964 | ||
8965 | extern size_t fwrite (__const void *__restrict __ptr, size_t __size, | |
8966 | size_t __n, FILE *__restrict __s) ; | |
8967 | ||
8968 | # 628 "../libio/stdio.h" | |
8969 | extern int fputs_unlocked (__const char *__restrict __s, | |
8970 | FILE *__restrict __stream); | |
8971 | # 639 "../libio/stdio.h" | |
8972 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, | |
8973 | size_t __n, FILE *__restrict __stream) ; | |
8974 | extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, | |
8975 | size_t __n, FILE *__restrict __stream) ; | |
8976 | ||
8977 | ||
8978 | ||
8979 | ||
8980 | ||
8981 | ||
8982 | ||
8983 | ||
8984 | extern int fseek (FILE *__stream, long int __off, int __whence); | |
8985 | ||
8986 | ||
8987 | ||
8988 | ||
8989 | extern long int ftell (FILE *__stream) ; | |
8990 | ||
8991 | ||
8992 | ||
8993 | ||
8994 | extern void rewind (FILE *__stream); | |
8995 | ||
8996 | # 675 "../libio/stdio.h" | |
8997 | extern int fseeko (FILE *__stream, __off_t __off, int __whence); | |
8998 | ||
8999 | ||
9000 | ||
9001 | ||
9002 | extern __off_t ftello (FILE *__stream) ; | |
9003 | # 694 "../libio/stdio.h" | |
9004 | ||
9005 | ||
9006 | ||
9007 | ||
9008 | ||
9009 | ||
9010 | extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); | |
9011 | ||
9012 | ||
9013 | ||
9014 | ||
9015 | extern int fsetpos (FILE *__stream, __const fpos_t *__pos); | |
9016 | # 717 "../libio/stdio.h" | |
9017 | ||
9018 | ||
9019 | ||
9020 | extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence); | |
9021 | extern __off64_t ftello64 (FILE *__stream) ; | |
9022 | extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos); | |
9023 | extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos); | |
9024 | ||
9025 | ||
9026 | ||
9027 | ||
9028 | extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__)); | |
9029 | ||
9030 | extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
9031 | ||
9032 | extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
9033 | ||
9034 | ||
9035 | ||
9036 | ||
9037 | extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); | |
9038 | extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
9039 | extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
9040 | ||
9041 | ||
9042 | ||
9043 | ||
9044 | ||
9045 | ||
9046 | ||
9047 | ||
9048 | extern void perror (__const char *__s); | |
9049 | ||
9050 | ||
9051 | ||
9052 | ||
9053 | ||
9054 | ||
9055 | # 1 "../sysdeps/unix/sysv/linux/bits/sys_errlist.h" 1 | |
9056 | # 27 "../sysdeps/unix/sysv/linux/bits/sys_errlist.h" | |
9057 | extern int sys_nerr; | |
9058 | extern __const char *__const sys_errlist[]; | |
9059 | ||
9060 | ||
9061 | extern int _sys_nerr; | |
9062 | extern __const char *__const _sys_errlist[]; | |
9063 | # 756 "../libio/stdio.h" 2 | |
9064 | ||
9065 | ||
9066 | ||
9067 | ||
9068 | extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
9069 | ||
9070 | ||
9071 | ||
9072 | ||
9073 | extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
9074 | # 775 "../libio/stdio.h" | |
9075 | extern FILE *popen (__const char *__command, __const char *__modes) ; | |
9076 | ||
9077 | ||
9078 | ||
9079 | ||
9080 | ||
9081 | extern int pclose (FILE *__stream); | |
9082 | ||
9083 | ||
9084 | ||
9085 | ||
9086 | ||
9087 | extern char *ctermid (char *__s) __attribute__ ((__nothrow__)); | |
9088 | ||
9089 | ||
9090 | ||
9091 | ||
9092 | ||
9093 | extern char *cuserid (char *__s); | |
9094 | ||
9095 | ||
9096 | ||
9097 | ||
9098 | struct obstack; | |
9099 | ||
9100 | ||
9101 | extern int obstack_printf (struct obstack *__restrict __obstack, | |
9102 | __const char *__restrict __format, ...) | |
9103 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))); | |
9104 | extern int obstack_vprintf (struct obstack *__restrict __obstack, | |
9105 | __const char *__restrict __format, | |
9106 | __gnuc_va_list __args) | |
9107 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))); | |
9108 | ||
9109 | ||
9110 | ||
9111 | ||
9112 | ||
9113 | ||
9114 | ||
9115 | extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__)); | |
9116 | ||
9117 | ||
9118 | ||
9119 | extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
9120 | ||
9121 | ||
9122 | extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__)); | |
9123 | # 836 "../libio/stdio.h" | |
9124 | # 1 "../libio/bits/stdio.h" 1 | |
9125 | # 33 "../libio/bits/stdio.h" | |
9126 | extern __inline int | |
9127 | vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg) | |
9128 | { | |
9129 | return vfprintf (stdout, __fmt, __arg); | |
9130 | } | |
9131 | ||
9132 | ||
9133 | extern __inline int | |
9134 | getchar (void) | |
9135 | { | |
9136 | return _IO_getc (stdin); | |
9137 | } | |
9138 | ||
9139 | ||
9140 | ||
9141 | ||
9142 | extern __inline int | |
9143 | getc_unlocked (FILE *__fp) | |
9144 | { | |
9145 | return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); | |
9146 | } | |
9147 | ||
9148 | ||
9149 | extern __inline int | |
9150 | getchar_unlocked (void) | |
9151 | { | |
9152 | return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); | |
9153 | } | |
9154 | ||
9155 | ||
9156 | ||
9157 | ||
9158 | extern __inline int | |
9159 | putchar (int __c) | |
9160 | { | |
9161 | return _IO_putc (__c, stdout); | |
9162 | } | |
9163 | ||
9164 | ||
9165 | ||
9166 | ||
9167 | extern __inline int | |
9168 | fputc_unlocked (int __c, FILE *__stream) | |
9169 | { | |
9170 | return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); | |
9171 | } | |
9172 | ||
9173 | ||
9174 | ||
9175 | ||
9176 | ||
9177 | extern __inline int | |
9178 | putc_unlocked (int __c, FILE *__stream) | |
9179 | { | |
9180 | return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); | |
9181 | } | |
9182 | ||
9183 | ||
9184 | extern __inline int | |
9185 | putchar_unlocked (int __c) | |
9186 | { | |
9187 | return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); | |
9188 | } | |
9189 | ||
9190 | ||
9191 | ||
9192 | ||
9193 | ||
9194 | extern __inline __ssize_t | |
9195 | getline (char **__lineptr, size_t *__n, FILE *__stream) | |
9196 | { | |
9197 | return __getdelim (__lineptr, __n, '\n', __stream); | |
9198 | } | |
9199 | ||
9200 | ||
9201 | ||
9202 | ||
9203 | ||
9204 | extern __inline int | |
9205 | __attribute__ ((__nothrow__)) feof_unlocked (FILE *__stream) | |
9206 | { | |
9207 | return (((__stream)->_flags & 0x10) != 0); | |
9208 | } | |
9209 | ||
9210 | ||
9211 | extern __inline int | |
9212 | __attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream) | |
9213 | { | |
9214 | return (((__stream)->_flags & 0x20) != 0); | |
9215 | } | |
9216 | # 837 "../libio/stdio.h" 2 | |
9217 | # 845 "../libio/stdio.h" | |
9218 | ||
9219 | # 6 "../include/stdio.h" 2 | |
9220 | ||
9221 | ||
9222 | extern int __fcloseall (void); | |
9223 | extern int __snprintf (char *__restrict __s, size_t __maxlen, | |
9224 | __const char *__restrict __format, ...) | |
9225 | __attribute__ ((__format__ (__printf__, 3, 4))); | |
9226 | extern int __vsnprintf (char *__restrict __s, size_t __maxlen, | |
9227 | __const char *__restrict __format, __gnuc_va_list __arg) | |
9228 | __attribute__ ((__format__ (__printf__, 3, 0))); | |
9229 | extern int __vfscanf (FILE *__restrict __s, | |
9230 | __const char *__restrict __format, | |
9231 | __gnuc_va_list __arg) | |
9232 | __attribute__ ((__format__ (__scanf__, 2, 0))); | |
9233 | ||
9234 | extern int __vscanf (__const char *__restrict __format, | |
9235 | __gnuc_va_list __arg) | |
9236 | __attribute__ ((__format__ (__scanf__, 1, 0))); | |
9237 | extern __ssize_t __getline (char **__lineptr, size_t *__n, | |
9238 | FILE *__stream); | |
9239 | extern int __vsscanf (__const char *__restrict __s, | |
9240 | __const char *__restrict __format, | |
9241 | __gnuc_va_list __arg) | |
9242 | __attribute__ ((__format__ (__scanf__, 2, 0))); | |
9243 | ||
9244 | extern int __sprintf_chk (char *, int, size_t, const char *, ...) __attribute__ ((__nothrow__)); | |
9245 | extern int __snprintf_chk (char *, size_t, int, size_t, const char *, ...) | |
9246 | __attribute__ ((__nothrow__)); | |
9247 | extern int __vsprintf_chk (char *, int, size_t, const char *, | |
9248 | __gnuc_va_list) __attribute__ ((__nothrow__)); | |
9249 | extern int __vsnprintf_chk (char *, size_t, int, size_t, const char *, | |
9250 | __gnuc_va_list) __attribute__ ((__nothrow__)); | |
9251 | extern int __printf_chk (int, const char *, ...); | |
9252 | extern int __fprintf_chk (FILE *, int, const char *, ...); | |
9253 | extern int __vprintf_chk (int, const char *, __gnuc_va_list); | |
9254 | extern int __vfprintf_chk (FILE *, int, const char *, __gnuc_va_list); | |
9255 | extern char *__fgets_unlocked_chk (char *buf, size_t size, int n, FILE *fp); | |
9256 | extern char *__fgets_chk (char *buf, size_t size, int n, FILE *fp); | |
9257 | ||
9258 | ||
9259 | extern FILE *__new_tmpfile (void); | |
9260 | extern FILE *__old_tmpfile (void); | |
9261 | ||
9262 | ||
9263 | ||
9264 | ||
9265 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
9266 | # 52 "../include/stdio.h" 2 | |
9267 | ||
9268 | extern int __path_search (char *__tmpl, size_t __tmpl_len, | |
9269 | __const char *__dir, __const char *__pfx, | |
9270 | int __try_tempdir); | |
9271 | ||
9272 | extern int __gen_tempname (char *__tmpl, int __kind); | |
9273 | ||
9274 | ||
9275 | ||
9276 | ||
9277 | ||
9278 | ||
9279 | ||
9280 | extern void __libc_fatal (__const char *__message) | |
9281 | __attribute__ ((__noreturn__)); | |
9282 | extern void __libc_message (int do_abort, __const char *__fnt, ...); | |
9283 | ||
9284 | ||
9285 | extern void __flockfile (FILE *__stream); | |
9286 | ||
9287 | ||
9288 | extern void __funlockfile (FILE *__stream); | |
9289 | ||
9290 | ||
9291 | ||
9292 | extern int __ftrylockfile (FILE *__stream); | |
9293 | ||
9294 | extern int __getc_unlocked (FILE *__fp); | |
9295 | extern wint_t __getwc_unlocked (FILE *__fp); | |
9296 | ||
9297 | extern int __fxprintf (FILE *__fp, const char *__fmt, ...) | |
9298 | __attribute__ ((__format__ (__printf__, 2, 3))); | |
9299 | ||
9300 | extern __const char *__const _sys_errlist_internal[] ; | |
9301 | extern int _sys_nerr_internal ; | |
9302 | ||
9303 | extern int __asprintf_internal (char **__restrict __ptr, | |
9304 | __const char *__restrict __fmt, ...) | |
9305 | __attribute__ ((__format__ (__printf__, 2, 3))); | |
9306 | ||
9307 | ||
9308 | ||
9309 | ||
9310 | extern _IO_FILE *_IO_new_fopen (const char*, const char*); | |
9311 | ||
9312 | extern _IO_FILE *_IO_new_fdopen (int, const char*); | |
9313 | ||
9314 | extern int _IO_new_fclose (_IO_FILE*); | |
9315 | ||
9316 | extern int _IO_fputs (const char*, _IO_FILE*); | |
9317 | ||
9318 | ||
9319 | extern int _IO_new_fsetpos (_IO_FILE *, const _G_fpos_t *); | |
9320 | ||
9321 | extern int _IO_new_fgetpos (_IO_FILE *, _G_fpos_t *); | |
9322 | ||
9323 | ||
9324 | ||
9325 | ||
9326 | ||
9327 | ||
9328 | ||
9329 | ||
9330 | ||
9331 | ||
9332 | ||
9333 | ||
9334 | ||
9335 | ||
9336 | ||
9337 | ||
9338 | ||
9339 | ||
9340 | ||
9341 | ||
9342 | ||
9343 | ||
9344 | ||
9345 | ||
9346 | ||
9347 | # 27 "regex_internal.h" 2 | |
9348 | ||
9349 | # 1 "../include/string.h" 1 | |
9350 | ||
9351 | ||
9352 | # 1 "../include/sys/types.h" 1 | |
9353 | # 4 "../include/string.h" 2 | |
9354 | ||
9355 | extern void *__memccpy (void *__dest, __const void *__src, | |
9356 | int __c, size_t __n); | |
9357 | ||
9358 | extern size_t __strnlen (__const char *__string, size_t __maxlen) | |
9359 | __attribute__ ((__pure__)); | |
9360 | ||
9361 | extern char *__strsep (char **__stringp, __const char *__delim); | |
9362 | ||
9363 | extern int __strverscmp (__const char *__s1, __const char *__s2) | |
9364 | __attribute__ ((__pure__)); | |
9365 | ||
9366 | extern int __strncasecmp (__const char *__s1, __const char *__s2, | |
9367 | size_t __n) | |
9368 | __attribute__ ((__pure__)); | |
9369 | ||
9370 | extern int __strcasecmp (__const char *__s1, __const char *__s2) | |
9371 | __attribute__ ((__pure__)); | |
9372 | ||
9373 | extern char *__strcasestr (__const char *__haystack, __const char *__needle) | |
9374 | __attribute__ ((__pure__)); | |
9375 | ||
9376 | extern char *__strdup (__const char *__string) | |
9377 | __attribute__ ((__malloc__)); | |
9378 | extern char *__strndup (__const char *__string, size_t __n) | |
9379 | __attribute__ ((__malloc__)); | |
9380 | ||
9381 | extern void *__rawmemchr (__const void *__s, int __c) | |
9382 | __attribute__ ((__pure__)); | |
9383 | ||
9384 | extern char *__strchrnul (__const char *__s, int __c) | |
9385 | __attribute__ ((__pure__)); | |
9386 | ||
9387 | extern void *__memrchr (__const void *__s, int __c, size_t __n) | |
9388 | __attribute__ ((__pure__)); | |
9389 | ||
9390 | extern void *__memchr (__const void *__s, int __c, size_t __n) | |
9391 | __attribute__ ((__pure__)); | |
9392 | ||
9393 | extern int __ffs (int __i) __attribute__ ((const)); | |
9394 | ||
9395 | extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen); | |
9396 | ||
9397 | ||
9398 | ||
9399 | # 1 "../string/string.h" 1 | |
9400 | # 28 "../string/string.h" | |
9401 | ||
9402 | ||
9403 | ||
9404 | ||
9405 | ||
9406 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
9407 | # 34 "../string/string.h" 2 | |
9408 | ||
9409 | ||
9410 | ||
9411 | ||
9412 | extern void *memcpy (void *__restrict __dest, | |
9413 | __const void *__restrict __src, size_t __n) | |
9414 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9415 | ||
9416 | ||
9417 | extern void *memmove (void *__dest, __const void *__src, size_t __n) | |
9418 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9419 | ||
9420 | ||
9421 | ||
9422 | ||
9423 | ||
9424 | ||
9425 | extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, | |
9426 | int __c, size_t __n) | |
9427 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9428 | ||
9429 | ||
9430 | ||
9431 | ||
9432 | ||
9433 | extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
9434 | ||
9435 | ||
9436 | extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) | |
9437 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9438 | ||
9439 | ||
9440 | extern void *memchr (__const void *__s, int __c, size_t __n) | |
9441 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
9442 | ||
9443 | ||
9444 | ||
9445 | ||
9446 | ||
9447 | extern void *rawmemchr (__const void *__s, int __c) | |
9448 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
9449 | ||
9450 | ||
9451 | extern void *memrchr (__const void *__s, int __c, size_t __n) | |
9452 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
9453 | ||
9454 | ||
9455 | ||
9456 | ||
9457 | ||
9458 | extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) | |
9459 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9460 | ||
9461 | extern char *strncpy (char *__restrict __dest, | |
9462 | __const char *__restrict __src, size_t __n) | |
9463 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9464 | ||
9465 | ||
9466 | extern char *strcat (char *__restrict __dest, __const char *__restrict __src) | |
9467 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9468 | ||
9469 | extern char *strncat (char *__restrict __dest, __const char *__restrict __src, | |
9470 | size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9471 | ||
9472 | ||
9473 | extern int strcmp (__const char *__s1, __const char *__s2) | |
9474 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9475 | ||
9476 | extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) | |
9477 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9478 | ||
9479 | ||
9480 | extern int strcoll (__const char *__s1, __const char *__s2) | |
9481 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9482 | ||
9483 | extern size_t strxfrm (char *__restrict __dest, | |
9484 | __const char *__restrict __src, size_t __n) | |
9485 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
9486 | ||
9487 | ||
9488 | ||
9489 | ||
9490 | ||
9491 | ||
9492 | # 1 "../include/xlocale.h" 1 | |
9493 | # 119 "../string/string.h" 2 | |
9494 | ||
9495 | ||
9496 | extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) | |
9497 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); | |
9498 | ||
9499 | extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n, | |
9500 | __locale_t __l) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); | |
9501 | ||
9502 | ||
9503 | ||
9504 | ||
9505 | extern char *strdup (__const char *__s) | |
9506 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); | |
9507 | ||
9508 | ||
9509 | ||
9510 | ||
9511 | ||
9512 | ||
9513 | extern char *strndup (__const char *__string, size_t __n) | |
9514 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); | |
9515 | # 165 "../string/string.h" | |
9516 | ||
9517 | ||
9518 | extern char *strchr (__const char *__s, int __c) | |
9519 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
9520 | ||
9521 | extern char *strrchr (__const char *__s, int __c) | |
9522 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
9523 | ||
9524 | ||
9525 | ||
9526 | ||
9527 | ||
9528 | extern char *strchrnul (__const char *__s, int __c) | |
9529 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
9530 | ||
9531 | ||
9532 | ||
9533 | ||
9534 | ||
9535 | extern size_t strcspn (__const char *__s, __const char *__reject) | |
9536 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9537 | ||
9538 | ||
9539 | extern size_t strspn (__const char *__s, __const char *__accept) | |
9540 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9541 | ||
9542 | extern char *strpbrk (__const char *__s, __const char *__accept) | |
9543 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9544 | ||
9545 | extern char *strstr (__const char *__haystack, __const char *__needle) | |
9546 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9547 | ||
9548 | ||
9549 | ||
9550 | extern char *strtok (char *__restrict __s, __const char *__restrict __delim) | |
9551 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
9552 | ||
9553 | ||
9554 | ||
9555 | ||
9556 | extern char *__strtok_r (char *__restrict __s, | |
9557 | __const char *__restrict __delim, | |
9558 | char **__restrict __save_ptr) | |
9559 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); | |
9560 | ||
9561 | extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, | |
9562 | char **__restrict __save_ptr) | |
9563 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); | |
9564 | ||
9565 | ||
9566 | ||
9567 | ||
9568 | extern char *strcasestr (__const char *__haystack, __const char *__needle) | |
9569 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9570 | ||
9571 | ||
9572 | ||
9573 | ||
9574 | ||
9575 | ||
9576 | extern void *memmem (__const void *__haystack, size_t __haystacklen, | |
9577 | __const void *__needle, size_t __needlelen) | |
9578 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3))); | |
9579 | ||
9580 | ||
9581 | ||
9582 | extern void *__mempcpy (void *__restrict __dest, | |
9583 | __const void *__restrict __src, size_t __n) | |
9584 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9585 | extern void *mempcpy (void *__restrict __dest, | |
9586 | __const void *__restrict __src, size_t __n) | |
9587 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9588 | ||
9589 | ||
9590 | ||
9591 | ||
9592 | ||
9593 | extern size_t strlen (__const char *__s) | |
9594 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
9595 | ||
9596 | ||
9597 | ||
9598 | ||
9599 | ||
9600 | extern size_t strnlen (__const char *__string, size_t __maxlen) | |
9601 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
9602 | ||
9603 | ||
9604 | ||
9605 | ||
9606 | ||
9607 | extern char *strerror (int __errnum) __attribute__ ((__nothrow__)); | |
9608 | ||
9609 | # 281 "../string/string.h" | |
9610 | extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) | |
9611 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
9612 | ||
9613 | ||
9614 | ||
9615 | ||
9616 | ||
9617 | extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
9618 | ||
9619 | ||
9620 | ||
9621 | extern void bcopy (__const void *__src, void *__dest, size_t __n) | |
9622 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9623 | ||
9624 | ||
9625 | extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
9626 | ||
9627 | ||
9628 | extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) | |
9629 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9630 | ||
9631 | ||
9632 | extern char *index (__const char *__s, int __c) | |
9633 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
9634 | ||
9635 | ||
9636 | extern char *rindex (__const char *__s, int __c) | |
9637 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
9638 | ||
9639 | ||
9640 | ||
9641 | extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
9642 | ||
9643 | ||
9644 | ||
9645 | ||
9646 | extern int ffsl (long int __l) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
9647 | ||
9648 | __extension__ extern int ffsll (long long int __ll) | |
9649 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
9650 | ||
9651 | ||
9652 | ||
9653 | ||
9654 | extern int strcasecmp (__const char *__s1, __const char *__s2) | |
9655 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9656 | ||
9657 | ||
9658 | extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) | |
9659 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9660 | ||
9661 | ||
9662 | ||
9663 | ||
9664 | ||
9665 | extern int strcasecmp_l (__const char *__s1, __const char *__s2, | |
9666 | __locale_t __loc) | |
9667 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); | |
9668 | ||
9669 | extern int strncasecmp_l (__const char *__s1, __const char *__s2, | |
9670 | size_t __n, __locale_t __loc) | |
9671 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4))); | |
9672 | ||
9673 | ||
9674 | ||
9675 | ||
9676 | ||
9677 | extern char *strsep (char **__restrict __stringp, | |
9678 | __const char *__restrict __delim) | |
9679 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9680 | ||
9681 | ||
9682 | ||
9683 | ||
9684 | extern int strverscmp (__const char *__s1, __const char *__s2) | |
9685 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
9686 | ||
9687 | ||
9688 | extern char *strsignal (int __sig) __attribute__ ((__nothrow__)); | |
9689 | ||
9690 | ||
9691 | extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src) | |
9692 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9693 | extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src) | |
9694 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9695 | ||
9696 | ||
9697 | ||
9698 | extern char *__stpncpy (char *__restrict __dest, | |
9699 | __const char *__restrict __src, size_t __n) | |
9700 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9701 | extern char *stpncpy (char *__restrict __dest, | |
9702 | __const char *__restrict __src, size_t __n) | |
9703 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9704 | ||
9705 | ||
9706 | extern char *strfry (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
9707 | ||
9708 | ||
9709 | extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
9710 | ||
9711 | ||
9712 | ||
9713 | ||
9714 | ||
9715 | ||
9716 | extern char *basename (__const char *__filename) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
9717 | # 414 "../string/string.h" | |
9718 | # 1 "../bits/string.h" 1 | |
9719 | # 415 "../string/string.h" 2 | |
9720 | ||
9721 | ||
9722 | # 1 "../include/bits/string2.h" 1 | |
9723 | # 1 "../string/bits/string2.h" 1 | |
9724 | # 80 "../string/bits/string2.h" | |
9725 | typedef struct { unsigned char __arr[2]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR2; | |
9726 | typedef struct { unsigned char __arr[3]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR3; | |
9727 | typedef struct { unsigned char __arr[4]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR4; | |
9728 | typedef struct { unsigned char __arr[5]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR5; | |
9729 | typedef struct { unsigned char __arr[6]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR6; | |
9730 | typedef struct { unsigned char __arr[7]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR7; | |
9731 | typedef struct { unsigned char __arr[8]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR8; | |
9732 | # 394 "../string/bits/string2.h" | |
9733 | extern void *__rawmemchr (const void *__s, int __c); | |
9734 | # 969 "../string/bits/string2.h" | |
9735 | extern __inline size_t __strcspn_c1 (__const char *__s, int __reject); | |
9736 | extern __inline size_t | |
9737 | __strcspn_c1 (__const char *__s, int __reject) | |
9738 | { | |
9739 | register size_t __result = 0; | |
9740 | while (__s[__result] != '\0' && __s[__result] != __reject) | |
9741 | ++__result; | |
9742 | return __result; | |
9743 | } | |
9744 | ||
9745 | extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1, | |
9746 | int __reject2); | |
9747 | extern __inline size_t | |
9748 | __strcspn_c2 (__const char *__s, int __reject1, int __reject2) | |
9749 | { | |
9750 | register size_t __result = 0; | |
9751 | while (__s[__result] != '\0' && __s[__result] != __reject1 | |
9752 | && __s[__result] != __reject2) | |
9753 | ++__result; | |
9754 | return __result; | |
9755 | } | |
9756 | ||
9757 | extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1, | |
9758 | int __reject2, int __reject3); | |
9759 | extern __inline size_t | |
9760 | __strcspn_c3 (__const char *__s, int __reject1, int __reject2, | |
9761 | int __reject3) | |
9762 | { | |
9763 | register size_t __result = 0; | |
9764 | while (__s[__result] != '\0' && __s[__result] != __reject1 | |
9765 | && __s[__result] != __reject2 && __s[__result] != __reject3) | |
9766 | ++__result; | |
9767 | return __result; | |
9768 | } | |
9769 | # 1045 "../string/bits/string2.h" | |
9770 | extern __inline size_t __strspn_c1 (__const char *__s, int __accept); | |
9771 | extern __inline size_t | |
9772 | __strspn_c1 (__const char *__s, int __accept) | |
9773 | { | |
9774 | register size_t __result = 0; | |
9775 | ||
9776 | while (__s[__result] == __accept) | |
9777 | ++__result; | |
9778 | return __result; | |
9779 | } | |
9780 | ||
9781 | extern __inline size_t __strspn_c2 (__const char *__s, int __accept1, | |
9782 | int __accept2); | |
9783 | extern __inline size_t | |
9784 | __strspn_c2 (__const char *__s, int __accept1, int __accept2) | |
9785 | { | |
9786 | register size_t __result = 0; | |
9787 | ||
9788 | while (__s[__result] == __accept1 || __s[__result] == __accept2) | |
9789 | ++__result; | |
9790 | return __result; | |
9791 | } | |
9792 | ||
9793 | extern __inline size_t __strspn_c3 (__const char *__s, int __accept1, | |
9794 | int __accept2, int __accept3); | |
9795 | extern __inline size_t | |
9796 | __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) | |
9797 | { | |
9798 | register size_t __result = 0; | |
9799 | ||
9800 | while (__s[__result] == __accept1 || __s[__result] == __accept2 | |
9801 | || __s[__result] == __accept3) | |
9802 | ++__result; | |
9803 | return __result; | |
9804 | } | |
9805 | # 1121 "../string/bits/string2.h" | |
9806 | extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1, | |
9807 | int __accept2); | |
9808 | extern __inline char * | |
9809 | __strpbrk_c2 (__const char *__s, int __accept1, int __accept2) | |
9810 | { | |
9811 | ||
9812 | while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) | |
9813 | ++__s; | |
9814 | return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; | |
9815 | } | |
9816 | ||
9817 | extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1, | |
9818 | int __accept2, int __accept3); | |
9819 | extern __inline char * | |
9820 | __strpbrk_c3 (__const char *__s, int __accept1, int __accept2, | |
9821 | int __accept3) | |
9822 | { | |
9823 | ||
9824 | while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 | |
9825 | && *__s != __accept3) | |
9826 | ++__s; | |
9827 | return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; | |
9828 | } | |
9829 | # 1173 "../string/bits/string2.h" | |
9830 | extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp); | |
9831 | extern __inline char * | |
9832 | __strtok_r_1c (char *__s, char __sep, char **__nextp) | |
9833 | { | |
9834 | char *__result; | |
9835 | if (__s == ((void *)0)) | |
9836 | __s = *__nextp; | |
9837 | while (*__s == __sep) | |
9838 | ++__s; | |
9839 | __result = ((void *)0); | |
9840 | if (*__s != '\0') | |
9841 | { | |
9842 | __result = __s++; | |
9843 | while (*__s != '\0') | |
9844 | if (*__s++ == __sep) | |
9845 | { | |
9846 | __s[-1] = '\0'; | |
9847 | break; | |
9848 | } | |
9849 | *__nextp = __s; | |
9850 | } | |
9851 | return __result; | |
9852 | } | |
9853 | # 1205 "../string/bits/string2.h" | |
9854 | extern char *__strsep_g (char **__stringp, __const char *__delim); | |
9855 | # 1223 "../string/bits/string2.h" | |
9856 | extern __inline char *__strsep_1c (char **__s, char __reject); | |
9857 | extern __inline char * | |
9858 | __strsep_1c (char **__s, char __reject) | |
9859 | { | |
9860 | register char *__retval = *__s; | |
9861 | if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0)) | |
9862 | *(*__s)++ = '\0'; | |
9863 | return __retval; | |
9864 | } | |
9865 | ||
9866 | extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2); | |
9867 | extern __inline char * | |
9868 | __strsep_2c (char **__s, char __reject1, char __reject2) | |
9869 | { | |
9870 | register char *__retval = *__s; | |
9871 | if (__retval != ((void *)0)) | |
9872 | { | |
9873 | register char *__cp = __retval; | |
9874 | while (1) | |
9875 | { | |
9876 | if (*__cp == '\0') | |
9877 | { | |
9878 | __cp = ((void *)0); | |
9879 | break; | |
9880 | } | |
9881 | if (*__cp == __reject1 || *__cp == __reject2) | |
9882 | { | |
9883 | *__cp++ = '\0'; | |
9884 | break; | |
9885 | } | |
9886 | ++__cp; | |
9887 | } | |
9888 | *__s = __cp; | |
9889 | } | |
9890 | return __retval; | |
9891 | } | |
9892 | ||
9893 | extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2, | |
9894 | char __reject3); | |
9895 | extern __inline char * | |
9896 | __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) | |
9897 | { | |
9898 | register char *__retval = *__s; | |
9899 | if (__retval != ((void *)0)) | |
9900 | { | |
9901 | register char *__cp = __retval; | |
9902 | while (1) | |
9903 | { | |
9904 | if (*__cp == '\0') | |
9905 | { | |
9906 | __cp = ((void *)0); | |
9907 | break; | |
9908 | } | |
9909 | if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3) | |
9910 | { | |
9911 | *__cp++ = '\0'; | |
9912 | break; | |
9913 | } | |
9914 | ++__cp; | |
9915 | } | |
9916 | *__s = __cp; | |
9917 | } | |
9918 | return __retval; | |
9919 | } | |
9920 | # 1304 "../string/bits/string2.h" | |
9921 | extern char *__strdup (__const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); | |
9922 | # 1323 "../string/bits/string2.h" | |
9923 | extern char *__strndup (__const char *__string, size_t __n) | |
9924 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); | |
9925 | # 1 "../include/bits/string2.h" 2 | |
9926 | # 418 "../string/string.h" 2 | |
9927 | # 426 "../string/string.h" | |
9928 | ||
9929 | # 50 "../include/string.h" 2 | |
9930 | ||
9931 | extern __typeof (strcoll_l) __strcoll_l; | |
9932 | extern __typeof (strxfrm_l) __strxfrm_l; | |
9933 | extern __typeof (strcasecmp_l) __strcasecmp_l; | |
9934 | extern __typeof (strncasecmp_l) __strncasecmp_l; | |
9935 | # 70 "../include/string.h" | |
9936 | ||
9937 | ||
9938 | ||
9939 | ||
9940 | ||
9941 | ||
9942 | ||
9943 | ||
9944 | ||
9945 | ||
9946 | ||
9947 | ||
9948 | ||
9949 | ||
9950 | ||
9951 | ||
9952 | extern char *__strsep_g (char **__stringp, __const char *__delim); | |
9953 | ||
9954 | ||
9955 | ||
9956 | ||
9957 | ||
9958 | ||
9959 | ||
9960 | ||
9961 | ||
9962 | ||
9963 | ||
9964 | ||
9965 | ||
9966 | ||
9967 | ||
9968 | ||
9969 | ||
9970 | ||
9971 | ||
9972 | ||
9973 | ||
9974 | ||
9975 | ||
9976 | # 120 "../include/string.h" | |
9977 | extern void *__memcpy_chk (void *__restrict __dest, | |
9978 | const void *__restrict __src, size_t __len, | |
9979 | size_t __destlen) __attribute__ ((__nothrow__)); | |
9980 | extern void *__memmove_chk (void *__dest, const void *__src, size_t __len, | |
9981 | size_t __destlen) __attribute__ ((__nothrow__)); | |
9982 | extern void *__mempcpy_chk (void *__restrict __dest, | |
9983 | const void *__restrict __src, size_t __len, | |
9984 | size_t __destlen) __attribute__ ((__nothrow__)); | |
9985 | extern void *__memset_chk (void *__dest, int __ch, size_t __len, | |
9986 | size_t __destlen) __attribute__ ((__nothrow__)); | |
9987 | extern char *__strcpy_chk (char *__restrict __dest, | |
9988 | const char *__restrict __src, | |
9989 | size_t __destlen) __attribute__ ((__nothrow__)); | |
9990 | extern char *__stpcpy_chk (char *__restrict __dest, | |
9991 | const char *__restrict __src, | |
9992 | size_t __destlen) __attribute__ ((__nothrow__)); | |
9993 | extern char *__strncpy_chk (char *__restrict __dest, | |
9994 | const char *__restrict __src, | |
9995 | size_t __len, size_t __destlen) __attribute__ ((__nothrow__)); | |
9996 | extern char *__strcat_chk (char *__restrict __dest, | |
9997 | const char *__restrict __src, | |
9998 | size_t __destlen) __attribute__ ((__nothrow__)); | |
9999 | extern char *__strncat_chk (char *__restrict __dest, | |
10000 | const char *__restrict __src, | |
10001 | size_t __len, size_t __destlen) __attribute__ ((__nothrow__)); | |
10002 | # 29 "regex_internal.h" 2 | |
10003 | # 37 "regex_internal.h" | |
10004 | # 1 "../include/wchar.h" 1 | |
10005 | ||
10006 | # 1 "../wcsmbs/wchar.h" 1 | |
10007 | # 40 "../wcsmbs/wchar.h" | |
10008 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stdarg.h" 1 3 4 | |
10009 | # 41 "../wcsmbs/wchar.h" 2 | |
10010 | ||
10011 | ||
10012 | ||
10013 | ||
10014 | ||
10015 | ||
10016 | ||
10017 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
10018 | # 49 "../wcsmbs/wchar.h" 2 | |
10019 | # 93 "../wcsmbs/wchar.h" | |
10020 | ||
10021 | ||
10022 | typedef __mbstate_t mbstate_t; | |
10023 | ||
10024 | ||
10025 | ||
10026 | # 118 "../wcsmbs/wchar.h" | |
10027 | ||
10028 | ||
10029 | ||
10030 | ||
10031 | ||
10032 | struct tm; | |
10033 | ||
10034 | ||
10035 | ||
10036 | ||
10037 | ||
10038 | ||
10039 | ||
10040 | ||
10041 | ||
10042 | extern wchar_t *wcscpy (wchar_t *__restrict __dest, | |
10043 | __const wchar_t *__restrict __src) __attribute__ ((__nothrow__)); | |
10044 | ||
10045 | extern wchar_t *wcsncpy (wchar_t *__restrict __dest, | |
10046 | __const wchar_t *__restrict __src, size_t __n) | |
10047 | __attribute__ ((__nothrow__)); | |
10048 | ||
10049 | ||
10050 | extern wchar_t *wcscat (wchar_t *__restrict __dest, | |
10051 | __const wchar_t *__restrict __src) __attribute__ ((__nothrow__)); | |
10052 | ||
10053 | extern wchar_t *wcsncat (wchar_t *__restrict __dest, | |
10054 | __const wchar_t *__restrict __src, size_t __n) | |
10055 | __attribute__ ((__nothrow__)); | |
10056 | ||
10057 | ||
10058 | extern int wcscmp (__const wchar_t *__s1, __const wchar_t *__s2) | |
10059 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10060 | ||
10061 | extern int wcsncmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n) | |
10062 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10063 | ||
10064 | ||
10065 | ||
10066 | ||
10067 | extern int wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2) __attribute__ ((__nothrow__)); | |
10068 | ||
10069 | ||
10070 | extern int wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2, | |
10071 | size_t __n) __attribute__ ((__nothrow__)); | |
10072 | ||
10073 | ||
10074 | ||
10075 | # 1 "../include/xlocale.h" 1 | |
10076 | # 167 "../wcsmbs/wchar.h" 2 | |
10077 | ||
10078 | extern int wcscasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2, | |
10079 | __locale_t __loc) __attribute__ ((__nothrow__)); | |
10080 | ||
10081 | extern int wcsncasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2, | |
10082 | size_t __n, __locale_t __loc) __attribute__ ((__nothrow__)); | |
10083 | ||
10084 | ||
10085 | ||
10086 | ||
10087 | ||
10088 | extern int wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) __attribute__ ((__nothrow__)); | |
10089 | ||
10090 | ||
10091 | ||
10092 | extern size_t wcsxfrm (wchar_t *__restrict __s1, | |
10093 | __const wchar_t *__restrict __s2, size_t __n) __attribute__ ((__nothrow__)); | |
10094 | ||
10095 | ||
10096 | ||
10097 | ||
10098 | ||
10099 | ||
10100 | ||
10101 | ||
10102 | extern int wcscoll_l (__const wchar_t *__s1, __const wchar_t *__s2, | |
10103 | __locale_t __loc) __attribute__ ((__nothrow__)); | |
10104 | ||
10105 | ||
10106 | ||
10107 | ||
10108 | extern size_t wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2, | |
10109 | size_t __n, __locale_t __loc) __attribute__ ((__nothrow__)); | |
10110 | ||
10111 | ||
10112 | extern wchar_t *wcsdup (__const wchar_t *__s) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); | |
10113 | ||
10114 | ||
10115 | ||
10116 | ||
10117 | extern wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc) | |
10118 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10119 | ||
10120 | extern wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc) | |
10121 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10122 | ||
10123 | ||
10124 | ||
10125 | ||
10126 | ||
10127 | extern wchar_t *wcschrnul (__const wchar_t *__s, wchar_t __wc) | |
10128 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10129 | ||
10130 | ||
10131 | ||
10132 | ||
10133 | ||
10134 | extern size_t wcscspn (__const wchar_t *__wcs, __const wchar_t *__reject) | |
10135 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10136 | ||
10137 | ||
10138 | extern size_t wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept) | |
10139 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10140 | ||
10141 | extern wchar_t *wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept) | |
10142 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10143 | ||
10144 | extern wchar_t *wcsstr (__const wchar_t *__haystack, __const wchar_t *__needle) | |
10145 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10146 | ||
10147 | ||
10148 | extern wchar_t *wcstok (wchar_t *__restrict __s, | |
10149 | __const wchar_t *__restrict __delim, | |
10150 | wchar_t **__restrict __ptr) __attribute__ ((__nothrow__)); | |
10151 | ||
10152 | ||
10153 | extern size_t wcslen (__const wchar_t *__s) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10154 | ||
10155 | ||
10156 | ||
10157 | ||
10158 | extern wchar_t *wcswcs (__const wchar_t *__haystack, __const wchar_t *__needle) | |
10159 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10160 | ||
10161 | ||
10162 | ||
10163 | ||
10164 | extern size_t wcsnlen (__const wchar_t *__s, size_t __maxlen) | |
10165 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10166 | ||
10167 | ||
10168 | ||
10169 | ||
10170 | ||
10171 | extern wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n) | |
10172 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10173 | ||
10174 | ||
10175 | extern int wmemcmp (__const wchar_t *__restrict __s1, | |
10176 | __const wchar_t *__restrict __s2, size_t __n) | |
10177 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10178 | ||
10179 | ||
10180 | extern wchar_t *wmemcpy (wchar_t *__restrict __s1, | |
10181 | __const wchar_t *__restrict __s2, size_t __n) __attribute__ ((__nothrow__)); | |
10182 | ||
10183 | ||
10184 | ||
10185 | extern wchar_t *wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n) | |
10186 | __attribute__ ((__nothrow__)); | |
10187 | ||
10188 | ||
10189 | extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __attribute__ ((__nothrow__)); | |
10190 | ||
10191 | ||
10192 | ||
10193 | ||
10194 | ||
10195 | extern wchar_t *wmempcpy (wchar_t *__restrict __s1, | |
10196 | __const wchar_t *__restrict __s2, size_t __n) | |
10197 | __attribute__ ((__nothrow__)); | |
10198 | ||
10199 | ||
10200 | ||
10201 | ||
10202 | ||
10203 | ||
10204 | extern wint_t btowc (int __c) __attribute__ ((__nothrow__)); | |
10205 | ||
10206 | ||
10207 | ||
10208 | extern int wctob (wint_t __c) __attribute__ ((__nothrow__)); | |
10209 | ||
10210 | ||
10211 | ||
10212 | extern int mbsinit (__const mbstate_t *__ps) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)); | |
10213 | ||
10214 | ||
10215 | ||
10216 | extern size_t mbrtowc (wchar_t *__restrict __pwc, | |
10217 | __const char *__restrict __s, size_t __n, | |
10218 | mbstate_t *__p) __attribute__ ((__nothrow__)); | |
10219 | ||
10220 | ||
10221 | extern size_t wcrtomb (char *__restrict __s, wchar_t __wc, | |
10222 | mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); | |
10223 | ||
10224 | ||
10225 | extern size_t __mbrlen (__const char *__restrict __s, size_t __n, | |
10226 | mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); | |
10227 | extern size_t mbrlen (__const char *__restrict __s, size_t __n, | |
10228 | mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); | |
10229 | ||
10230 | # 328 "../wcsmbs/wchar.h" | |
10231 | extern wint_t __btowc_alias (int __c) __asm ("btowc"); | |
10232 | extern __inline wint_t | |
10233 | __attribute__ ((__nothrow__)) btowc (int __c) | |
10234 | { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f' | |
10235 | ? (wint_t) __c : __btowc_alias (__c)); } | |
10236 | ||
10237 | extern int __wctob_alias (wint_t __c) __asm ("wctob"); | |
10238 | extern __inline int | |
10239 | __attribute__ ((__nothrow__)) wctob (wint_t __wc) | |
10240 | { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f' | |
10241 | ? (int) __wc : __wctob_alias (__wc)); } | |
10242 | ||
10243 | ||
10244 | extern __inline size_t | |
10245 | __attribute__ ((__nothrow__)) mbrlen (__const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) | |
10246 | ||
10247 | { return (__ps != ((void *)0) | |
10248 | ? mbrtowc (((void *)0), __s, __n, __ps) : __mbrlen (__s, __n, ((void *)0))); } | |
10249 | ||
10250 | ||
10251 | ||
10252 | ||
10253 | ||
10254 | extern size_t mbsrtowcs (wchar_t *__restrict __dst, | |
10255 | __const char **__restrict __src, size_t __len, | |
10256 | mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); | |
10257 | ||
10258 | ||
10259 | ||
10260 | extern size_t wcsrtombs (char *__restrict __dst, | |
10261 | __const wchar_t **__restrict __src, size_t __len, | |
10262 | mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); | |
10263 | ||
10264 | ||
10265 | ||
10266 | ||
10267 | ||
10268 | ||
10269 | extern size_t mbsnrtowcs (wchar_t *__restrict __dst, | |
10270 | __const char **__restrict __src, size_t __nmc, | |
10271 | size_t __len, mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); | |
10272 | ||
10273 | ||
10274 | ||
10275 | extern size_t wcsnrtombs (char *__restrict __dst, | |
10276 | __const wchar_t **__restrict __src, | |
10277 | size_t __nwc, size_t __len, | |
10278 | mbstate_t *__restrict __ps) __attribute__ ((__nothrow__)); | |
10279 | ||
10280 | ||
10281 | ||
10282 | ||
10283 | ||
10284 | ||
10285 | extern int wcwidth (wchar_t __c) __attribute__ ((__nothrow__)); | |
10286 | ||
10287 | ||
10288 | ||
10289 | extern int wcswidth (__const wchar_t *__s, size_t __n) __attribute__ ((__nothrow__)); | |
10290 | ||
10291 | ||
10292 | ||
10293 | ||
10294 | ||
10295 | ||
10296 | extern double wcstod (__const wchar_t *__restrict __nptr, | |
10297 | wchar_t **__restrict __endptr) __attribute__ ((__nothrow__)); | |
10298 | ||
10299 | ||
10300 | ||
10301 | extern float wcstof (__const wchar_t *__restrict __nptr, | |
10302 | wchar_t **__restrict __endptr) __attribute__ ((__nothrow__)); | |
10303 | extern long double wcstold (__const wchar_t *__restrict __nptr, | |
10304 | wchar_t **__restrict __endptr) __attribute__ ((__nothrow__)); | |
10305 | ||
10306 | ||
10307 | ||
10308 | ||
10309 | ||
10310 | extern long int wcstol (__const wchar_t *__restrict __nptr, | |
10311 | wchar_t **__restrict __endptr, int __base) __attribute__ ((__nothrow__)); | |
10312 | ||
10313 | ||
10314 | ||
10315 | extern unsigned long int wcstoul (__const wchar_t *__restrict __nptr, | |
10316 | wchar_t **__restrict __endptr, int __base) | |
10317 | __attribute__ ((__nothrow__)); | |
10318 | ||
10319 | ||
10320 | ||
10321 | ||
10322 | __extension__ | |
10323 | extern long long int wcstoll (__const wchar_t *__restrict __nptr, | |
10324 | wchar_t **__restrict __endptr, int __base) | |
10325 | __attribute__ ((__nothrow__)); | |
10326 | ||
10327 | ||
10328 | ||
10329 | __extension__ | |
10330 | extern unsigned long long int wcstoull (__const wchar_t *__restrict __nptr, | |
10331 | wchar_t **__restrict __endptr, | |
10332 | int __base) __attribute__ ((__nothrow__)); | |
10333 | ||
10334 | ||
10335 | ||
10336 | ||
10337 | ||
10338 | ||
10339 | __extension__ | |
10340 | extern long long int wcstoq (__const wchar_t *__restrict __nptr, | |
10341 | wchar_t **__restrict __endptr, int __base) | |
10342 | __attribute__ ((__nothrow__)); | |
10343 | ||
10344 | ||
10345 | ||
10346 | __extension__ | |
10347 | extern unsigned long long int wcstouq (__const wchar_t *__restrict __nptr, | |
10348 | wchar_t **__restrict __endptr, | |
10349 | int __base) __attribute__ ((__nothrow__)); | |
10350 | # 463 "../wcsmbs/wchar.h" | |
10351 | # 1 "../include/xlocale.h" 1 | |
10352 | # 464 "../wcsmbs/wchar.h" 2 | |
10353 | ||
10354 | ||
10355 | ||
10356 | extern long int wcstol_l (__const wchar_t *__restrict __nptr, | |
10357 | wchar_t **__restrict __endptr, int __base, | |
10358 | __locale_t __loc) __attribute__ ((__nothrow__)); | |
10359 | ||
10360 | extern unsigned long int wcstoul_l (__const wchar_t *__restrict __nptr, | |
10361 | wchar_t **__restrict __endptr, | |
10362 | int __base, __locale_t __loc) __attribute__ ((__nothrow__)); | |
10363 | ||
10364 | __extension__ | |
10365 | extern long long int wcstoll_l (__const wchar_t *__restrict __nptr, | |
10366 | wchar_t **__restrict __endptr, | |
10367 | int __base, __locale_t __loc) __attribute__ ((__nothrow__)); | |
10368 | ||
10369 | __extension__ | |
10370 | extern unsigned long long int wcstoull_l (__const wchar_t *__restrict __nptr, | |
10371 | wchar_t **__restrict __endptr, | |
10372 | int __base, __locale_t __loc) | |
10373 | __attribute__ ((__nothrow__)); | |
10374 | ||
10375 | extern double wcstod_l (__const wchar_t *__restrict __nptr, | |
10376 | wchar_t **__restrict __endptr, __locale_t __loc) | |
10377 | __attribute__ ((__nothrow__)); | |
10378 | ||
10379 | extern float wcstof_l (__const wchar_t *__restrict __nptr, | |
10380 | wchar_t **__restrict __endptr, __locale_t __loc) | |
10381 | __attribute__ ((__nothrow__)); | |
10382 | ||
10383 | extern long double wcstold_l (__const wchar_t *__restrict __nptr, | |
10384 | wchar_t **__restrict __endptr, | |
10385 | __locale_t __loc) __attribute__ ((__nothrow__)); | |
10386 | ||
10387 | ||
10388 | ||
10389 | ||
10390 | ||
10391 | extern double __wcstod_internal (__const wchar_t *__restrict __nptr, | |
10392 | wchar_t **__restrict __endptr, int __group) | |
10393 | __attribute__ ((__nothrow__)); | |
10394 | extern float __wcstof_internal (__const wchar_t *__restrict __nptr, | |
10395 | wchar_t **__restrict __endptr, int __group) | |
10396 | __attribute__ ((__nothrow__)); | |
10397 | extern long double __wcstold_internal (__const wchar_t *__restrict __nptr, | |
10398 | wchar_t **__restrict __endptr, | |
10399 | int __group) __attribute__ ((__nothrow__)); | |
10400 | ||
10401 | ||
10402 | ||
10403 | extern long int __wcstol_internal (__const wchar_t *__restrict __nptr, | |
10404 | wchar_t **__restrict __endptr, | |
10405 | int __base, int __group) __attribute__ ((__nothrow__)); | |
10406 | ||
10407 | ||
10408 | ||
10409 | ||
10410 | extern unsigned long int __wcstoul_internal (__const wchar_t *__restrict __npt, | |
10411 | wchar_t **__restrict __endptr, | |
10412 | int __base, int __group) __attribute__ ((__nothrow__)); | |
10413 | # 549 "../wcsmbs/wchar.h" | |
10414 | ||
10415 | ||
10416 | extern __inline double | |
10417 | __attribute__ ((__nothrow__)) wcstod (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) | |
10418 | ||
10419 | { return __wcstod_internal (__nptr, __endptr, 0); } | |
10420 | extern __inline long int | |
10421 | __attribute__ ((__nothrow__)) wcstol (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) | |
10422 | ||
10423 | { return __wcstol_internal (__nptr, __endptr, __base, 0); } | |
10424 | extern __inline unsigned long int | |
10425 | __attribute__ ((__nothrow__)) wcstoul (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) | |
10426 | ||
10427 | { return __wcstoul_internal (__nptr, __endptr, __base, 0); } | |
10428 | ||
10429 | ||
10430 | ||
10431 | extern __inline float | |
10432 | __attribute__ ((__nothrow__)) wcstof (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) | |
10433 | ||
10434 | { return __wcstof_internal (__nptr, __endptr, 0); } | |
10435 | ||
10436 | extern __inline long double | |
10437 | __attribute__ ((__nothrow__)) wcstold (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) | |
10438 | ||
10439 | { return __wcstold_internal (__nptr, __endptr, 0); } | |
10440 | ||
10441 | __extension__ | |
10442 | extern __inline long long int | |
10443 | __attribute__ ((__nothrow__)) wcstoq (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) | |
10444 | ||
10445 | { return __wcstoll_internal (__nptr, __endptr, __base, 0); } | |
10446 | __extension__ | |
10447 | extern __inline unsigned long long int | |
10448 | __attribute__ ((__nothrow__)) wcstouq (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) | |
10449 | ||
10450 | { return __wcstoull_internal (__nptr, __endptr, __base, 0); } | |
10451 | ||
10452 | ||
10453 | ||
10454 | ||
10455 | ||
10456 | ||
10457 | ||
10458 | extern wchar_t *wcpcpy (wchar_t *__dest, __const wchar_t *__src) __attribute__ ((__nothrow__)); | |
10459 | ||
10460 | ||
10461 | ||
10462 | extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n) | |
10463 | __attribute__ ((__nothrow__)); | |
10464 | # 607 "../wcsmbs/wchar.h" | |
10465 | extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)); | |
10466 | ||
10467 | ||
10468 | ||
10469 | ||
10470 | ||
10471 | ||
10472 | extern int fwide (__FILE *__fp, int __mode) __attribute__ ((__nothrow__)); | |
10473 | ||
10474 | ||
10475 | ||
10476 | ||
10477 | ||
10478 | ||
10479 | extern int fwprintf (__FILE *__restrict __stream, | |
10480 | __const wchar_t *__restrict __format, ...) | |
10481 | ; | |
10482 | ||
10483 | ||
10484 | ||
10485 | ||
10486 | extern int wprintf (__const wchar_t *__restrict __format, ...) | |
10487 | ; | |
10488 | ||
10489 | extern int swprintf (wchar_t *__restrict __s, size_t __n, | |
10490 | __const wchar_t *__restrict __format, ...) | |
10491 | __attribute__ ((__nothrow__)) ; | |
10492 | ||
10493 | ||
10494 | ||
10495 | ||
10496 | ||
10497 | extern int vfwprintf (__FILE *__restrict __s, | |
10498 | __const wchar_t *__restrict __format, | |
10499 | __gnuc_va_list __arg) | |
10500 | ; | |
10501 | ||
10502 | ||
10503 | ||
10504 | ||
10505 | extern int vwprintf (__const wchar_t *__restrict __format, | |
10506 | __gnuc_va_list __arg) | |
10507 | ; | |
10508 | ||
10509 | ||
10510 | extern int vswprintf (wchar_t *__restrict __s, size_t __n, | |
10511 | __const wchar_t *__restrict __format, | |
10512 | __gnuc_va_list __arg) | |
10513 | __attribute__ ((__nothrow__)) ; | |
10514 | ||
10515 | ||
10516 | ||
10517 | ||
10518 | ||
10519 | ||
10520 | extern int fwscanf (__FILE *__restrict __stream, | |
10521 | __const wchar_t *__restrict __format, ...) | |
10522 | ; | |
10523 | ||
10524 | ||
10525 | ||
10526 | ||
10527 | extern int wscanf (__const wchar_t *__restrict __format, ...) | |
10528 | ; | |
10529 | ||
10530 | extern int swscanf (__const wchar_t *__restrict __s, | |
10531 | __const wchar_t *__restrict __format, ...) | |
10532 | __attribute__ ((__nothrow__)) ; | |
10533 | ||
10534 | ||
10535 | ||
10536 | ||
10537 | ||
10538 | ||
10539 | ||
10540 | ||
10541 | ||
10542 | ||
10543 | ||
10544 | extern int vfwscanf (__FILE *__restrict __s, | |
10545 | __const wchar_t *__restrict __format, | |
10546 | __gnuc_va_list __arg) | |
10547 | ; | |
10548 | ||
10549 | ||
10550 | ||
10551 | ||
10552 | extern int vwscanf (__const wchar_t *__restrict __format, | |
10553 | __gnuc_va_list __arg) | |
10554 | ; | |
10555 | ||
10556 | extern int vswscanf (__const wchar_t *__restrict __s, | |
10557 | __const wchar_t *__restrict __format, | |
10558 | __gnuc_va_list __arg) | |
10559 | __attribute__ ((__nothrow__)) ; | |
10560 | ||
10561 | ||
10562 | ||
10563 | ||
10564 | ||
10565 | ||
10566 | ||
10567 | ||
10568 | ||
10569 | ||
10570 | extern wint_t fgetwc (__FILE *__stream); | |
10571 | extern wint_t getwc (__FILE *__stream); | |
10572 | ||
10573 | ||
10574 | ||
10575 | ||
10576 | ||
10577 | extern wint_t getwchar (void); | |
10578 | ||
10579 | ||
10580 | ||
10581 | ||
10582 | ||
10583 | ||
10584 | extern wint_t fputwc (wchar_t __wc, __FILE *__stream); | |
10585 | extern wint_t putwc (wchar_t __wc, __FILE *__stream); | |
10586 | ||
10587 | ||
10588 | ||
10589 | ||
10590 | ||
10591 | extern wint_t putwchar (wchar_t __wc); | |
10592 | ||
10593 | ||
10594 | ||
10595 | ||
10596 | ||
10597 | ||
10598 | ||
10599 | extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n, | |
10600 | __FILE *__restrict __stream); | |
10601 | ||
10602 | ||
10603 | ||
10604 | ||
10605 | ||
10606 | extern int fputws (__const wchar_t *__restrict __ws, | |
10607 | __FILE *__restrict __stream); | |
10608 | ||
10609 | ||
10610 | ||
10611 | ||
10612 | ||
10613 | ||
10614 | extern wint_t ungetwc (wint_t __wc, __FILE *__stream); | |
10615 | ||
10616 | # 768 "../wcsmbs/wchar.h" | |
10617 | extern wint_t getwc_unlocked (__FILE *__stream); | |
10618 | extern wint_t getwchar_unlocked (void); | |
10619 | ||
10620 | ||
10621 | ||
10622 | ||
10623 | ||
10624 | ||
10625 | ||
10626 | extern wint_t fgetwc_unlocked (__FILE *__stream); | |
10627 | ||
10628 | ||
10629 | ||
10630 | ||
10631 | ||
10632 | ||
10633 | ||
10634 | extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream); | |
10635 | # 794 "../wcsmbs/wchar.h" | |
10636 | extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream); | |
10637 | extern wint_t putwchar_unlocked (wchar_t __wc); | |
10638 | # 804 "../wcsmbs/wchar.h" | |
10639 | extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n, | |
10640 | __FILE *__restrict __stream); | |
10641 | ||
10642 | ||
10643 | ||
10644 | ||
10645 | ||
10646 | ||
10647 | ||
10648 | extern int fputws_unlocked (__const wchar_t *__restrict __ws, | |
10649 | __FILE *__restrict __stream); | |
10650 | ||
10651 | ||
10652 | ||
10653 | ||
10654 | ||
10655 | ||
10656 | ||
10657 | extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize, | |
10658 | __const wchar_t *__restrict __format, | |
10659 | __const struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
10660 | ||
10661 | ||
10662 | ||
10663 | # 1 "../include/xlocale.h" 1 | |
10664 | # 829 "../wcsmbs/wchar.h" 2 | |
10665 | ||
10666 | ||
10667 | ||
10668 | extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, | |
10669 | __const wchar_t *__restrict __format, | |
10670 | __const struct tm *__restrict __tp, | |
10671 | __locale_t __loc) __attribute__ ((__nothrow__)); | |
10672 | # 858 "../wcsmbs/wchar.h" | |
10673 | ||
10674 | # 3 "../include/wchar.h" 2 | |
10675 | ||
10676 | ||
10677 | ||
10678 | extern __typeof (wcscasecmp_l) __wcscasecmp_l; | |
10679 | extern __typeof (wcsncasecmp_l) __wcsncasecmp_l; | |
10680 | extern __typeof (wcscoll_l) __wcscoll_l; | |
10681 | extern __typeof (wcsxfrm_l) __wcsxfrm_l; | |
10682 | extern __typeof (wcstol_l) __wcstol_l; | |
10683 | extern __typeof (wcstoul_l) __wcstoul_l; | |
10684 | extern __typeof (wcstoll_l) __wcstoll_l; | |
10685 | extern __typeof (wcstoull_l) __wcstoull_l; | |
10686 | extern __typeof (wcstod_l) __wcstod_l; | |
10687 | extern __typeof (wcstof_l) __wcstof_l; | |
10688 | extern __typeof (wcstold_l) __wcstold_l; | |
10689 | extern __typeof (wcsftime_l) __wcsftime_l; | |
10690 | ||
10691 | ||
10692 | ||
10693 | ||
10694 | ||
10695 | ||
10696 | ||
10697 | ||
10698 | ||
10699 | ||
10700 | ||
10701 | ||
10702 | ||
10703 | ||
10704 | ||
10705 | ||
10706 | ||
10707 | ||
10708 | ||
10709 | ||
10710 | ||
10711 | ||
10712 | ||
10713 | ||
10714 | ||
10715 | ||
10716 | ||
10717 | ||
10718 | ||
10719 | ||
10720 | ||
10721 | ||
10722 | ||
10723 | ||
10724 | ||
10725 | ||
10726 | extern int __wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2) | |
10727 | __attribute__ ((__pure__)); | |
10728 | extern int __wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2, | |
10729 | size_t __n) | |
10730 | __attribute__ ((__pure__)); | |
10731 | extern size_t __wcslen (__const wchar_t *__s) __attribute__ ((__pure__)); | |
10732 | extern size_t __wcsnlen (__const wchar_t *__s, size_t __maxlen) | |
10733 | __attribute__ ((__pure__)); | |
10734 | extern wchar_t *__wcscat (wchar_t *dest, const wchar_t *src); | |
10735 | extern wint_t __btowc (int __c); | |
10736 | extern int __mbsinit (__const __mbstate_t *__ps); | |
10737 | extern size_t __mbrtowc (wchar_t *__restrict __pwc, | |
10738 | __const char *__restrict __s, size_t __n, | |
10739 | __mbstate_t *__restrict __p); | |
10740 | ||
10741 | ||
10742 | extern size_t __wcrtomb (char *__restrict __s, wchar_t __wc, | |
10743 | __mbstate_t *__restrict __ps); | |
10744 | extern size_t __mbsrtowcs (wchar_t *__restrict __dst, | |
10745 | __const char **__restrict __src, | |
10746 | size_t __len, __mbstate_t *__restrict __ps); | |
10747 | extern size_t __wcsrtombs (char *__restrict __dst, | |
10748 | __const wchar_t **__restrict __src, | |
10749 | size_t __len, __mbstate_t *__restrict __ps); | |
10750 | extern size_t __mbsnrtowcs (wchar_t *__restrict __dst, | |
10751 | __const char **__restrict __src, size_t __nmc, | |
10752 | size_t __len, __mbstate_t *__restrict __ps); | |
10753 | extern size_t __wcsnrtombs (char *__restrict __dst, | |
10754 | __const wchar_t **__restrict __src, | |
10755 | size_t __nwc, size_t __len, | |
10756 | __mbstate_t *__restrict __ps); | |
10757 | extern wchar_t *__wcsncpy (wchar_t *__restrict __dest, | |
10758 | __const wchar_t *__restrict __src, size_t __n); | |
10759 | extern wchar_t *__wcpcpy (wchar_t *__dest, __const wchar_t *__src); | |
10760 | extern wchar_t *__wcpncpy (wchar_t *__dest, __const wchar_t *__src, | |
10761 | size_t __n); | |
10762 | extern wchar_t *__wmemcpy (wchar_t *__s1, __const wchar_t *s2, | |
10763 | size_t __n); | |
10764 | extern wchar_t *__wmempcpy (wchar_t *__restrict __s1, | |
10765 | __const wchar_t *__restrict __s2, | |
10766 | size_t __n); | |
10767 | extern wchar_t *__wmemmove (wchar_t *__s1, __const wchar_t *__s2, | |
10768 | size_t __n); | |
10769 | extern wchar_t *__wcschrnul (__const wchar_t *__s, wchar_t __wc) | |
10770 | __attribute__ ((__pure__)); | |
10771 | ||
10772 | extern int __vfwscanf (__FILE *__restrict __s, | |
10773 | __const wchar_t *__restrict __format, | |
10774 | __gnuc_va_list __arg) | |
10775 | ; | |
10776 | extern int __vswprintf (wchar_t *__restrict __s, size_t __n, | |
10777 | __const wchar_t *__restrict __format, | |
10778 | __gnuc_va_list __arg) | |
10779 | ; | |
10780 | extern int __fwprintf (__FILE *__restrict __s, | |
10781 | __const wchar_t *__restrict __format, ...) | |
10782 | ; | |
10783 | extern int __vfwprintf (__FILE *__restrict __s, | |
10784 | __const wchar_t *__restrict __format, | |
10785 | __gnuc_va_list __arg) | |
10786 | ; | |
10787 | extern int __vfwprintf_chk (FILE *__restrict __s, int __flag, | |
10788 | const wchar_t *__restrict __format, | |
10789 | __gnuc_va_list __arg) | |
10790 | ; | |
10791 | extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n, | |
10792 | int __flag, size_t __s_len, | |
10793 | __const wchar_t *__restrict __format, | |
10794 | __gnuc_va_list __arg) | |
10795 | ; | |
10796 | ||
10797 | ||
10798 | ||
10799 | ||
10800 | extern size_t __mbsrtowcs_l (wchar_t *dst, const char **src, size_t len, | |
10801 | mbstate_t *ps, __locale_t l) ; | |
10802 | # 38 "regex_internal.h" 2 | |
10803 | ||
10804 | ||
10805 | # 1 "../include/wctype.h" 1 | |
10806 | ||
10807 | ||
10808 | ||
10809 | ||
10810 | ||
10811 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
10812 | # 7 "../include/wctype.h" 2 | |
10813 | # 19 "../include/wctype.h" | |
10814 | extern int iswalpha (wint_t __wc); | |
10815 | extern int iswalnum (wint_t __wc); | |
10816 | extern int iswdigit (wint_t __wc); | |
10817 | extern int iswlower (wint_t __wc); | |
10818 | extern int iswspace (wint_t __wc); | |
10819 | extern int iswxdigit (wint_t __wc); | |
10820 | extern wint_t towlower (wint_t __wc); | |
10821 | extern wint_t towupper (wint_t __wc); | |
10822 | ||
10823 | ||
10824 | ||
10825 | ||
10826 | ||
10827 | ||
10828 | ||
10829 | ||
10830 | ||
10831 | ||
10832 | # 1 "../wctype/wctype.h" 1 | |
10833 | # 35 "../wctype/wctype.h" | |
10834 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
10835 | # 36 "../wctype/wctype.h" 2 | |
10836 | # 45 "../wctype/wctype.h" | |
10837 | ||
10838 | # 63 "../wctype/wctype.h" | |
10839 | ||
10840 | ||
10841 | ||
10842 | typedef unsigned long int wctype_t; | |
10843 | ||
10844 | ||
10845 | ||
10846 | ||
10847 | ||
10848 | ||
10849 | ||
10850 | # 1 "../include/endian.h" 1 | |
10851 | # 75 "../wctype/wctype.h" 2 | |
10852 | # 85 "../wctype/wctype.h" | |
10853 | enum | |
10854 | { | |
10855 | __ISwupper = 0, | |
10856 | __ISwlower = 1, | |
10857 | __ISwalpha = 2, | |
10858 | __ISwdigit = 3, | |
10859 | __ISwxdigit = 4, | |
10860 | __ISwspace = 5, | |
10861 | __ISwprint = 6, | |
10862 | __ISwgraph = 7, | |
10863 | __ISwblank = 8, | |
10864 | __ISwcntrl = 9, | |
10865 | __ISwpunct = 10, | |
10866 | __ISwalnum = 11, | |
10867 | ||
10868 | _ISwupper = (1 << (__ISwupper)), | |
10869 | _ISwlower = (1 << (__ISwlower)), | |
10870 | _ISwalpha = (1 << (__ISwalpha)), | |
10871 | _ISwdigit = (1 << (__ISwdigit)), | |
10872 | _ISwxdigit = (1 << (__ISwxdigit)), | |
10873 | _ISwspace = (1 << (__ISwspace)), | |
10874 | _ISwprint = (1 << (__ISwprint)), | |
10875 | _ISwgraph = (1 << (__ISwgraph)), | |
10876 | _ISwblank = (1 << (__ISwblank)), | |
10877 | _ISwcntrl = (1 << (__ISwcntrl)), | |
10878 | _ISwpunct = (1 << (__ISwpunct)), | |
10879 | _ISwalnum = (1 << (__ISwalnum)) | |
10880 | }; | |
10881 | ||
10882 | ||
10883 | ||
10884 | ||
10885 | ||
10886 | ||
10887 | ||
10888 | ||
10889 | ||
10890 | ||
10891 | ||
10892 | ||
10893 | extern int iswalnum (wint_t __wc) __attribute__ ((__nothrow__)); | |
10894 | ||
10895 | ||
10896 | ||
10897 | ||
10898 | ||
10899 | extern int iswalpha (wint_t __wc) __attribute__ ((__nothrow__)); | |
10900 | ||
10901 | ||
10902 | extern int iswcntrl (wint_t __wc) __attribute__ ((__nothrow__)); | |
10903 | ||
10904 | ||
10905 | ||
10906 | extern int iswdigit (wint_t __wc) __attribute__ ((__nothrow__)); | |
10907 | ||
10908 | ||
10909 | ||
10910 | extern int iswgraph (wint_t __wc) __attribute__ ((__nothrow__)); | |
10911 | ||
10912 | ||
10913 | ||
10914 | ||
10915 | extern int iswlower (wint_t __wc) __attribute__ ((__nothrow__)); | |
10916 | ||
10917 | ||
10918 | extern int iswprint (wint_t __wc) __attribute__ ((__nothrow__)); | |
10919 | ||
10920 | ||
10921 | ||
10922 | ||
10923 | extern int iswpunct (wint_t __wc) __attribute__ ((__nothrow__)); | |
10924 | ||
10925 | ||
10926 | ||
10927 | ||
10928 | extern int iswspace (wint_t __wc) __attribute__ ((__nothrow__)); | |
10929 | ||
10930 | ||
10931 | ||
10932 | ||
10933 | extern int iswupper (wint_t __wc) __attribute__ ((__nothrow__)); | |
10934 | ||
10935 | ||
10936 | ||
10937 | ||
10938 | extern int iswxdigit (wint_t __wc) __attribute__ ((__nothrow__)); | |
10939 | ||
10940 | ||
10941 | ||
10942 | ||
10943 | ||
10944 | extern int iswblank (wint_t __wc) __attribute__ ((__nothrow__)); | |
10945 | # 185 "../wctype/wctype.h" | |
10946 | extern wctype_t wctype (__const char *__property) __attribute__ ((__nothrow__)); | |
10947 | ||
10948 | ||
10949 | ||
10950 | extern int iswctype (wint_t __wc, wctype_t __desc) __attribute__ ((__nothrow__)); | |
10951 | ||
10952 | ||
10953 | ||
10954 | ||
10955 | ||
10956 | ||
10957 | ||
10958 | ||
10959 | ||
10960 | ||
10961 | typedef __const __int32_t *wctrans_t; | |
10962 | ||
10963 | ||
10964 | ||
10965 | ||
10966 | ||
10967 | ||
10968 | ||
10969 | extern wint_t towlower (wint_t __wc) __attribute__ ((__nothrow__)); | |
10970 | ||
10971 | ||
10972 | extern wint_t towupper (wint_t __wc) __attribute__ ((__nothrow__)); | |
10973 | ||
10974 | ||
10975 | ||
10976 | # 227 "../wctype/wctype.h" | |
10977 | ||
10978 | ||
10979 | ||
10980 | ||
10981 | ||
10982 | extern wctrans_t wctrans (__const char *__property) __attribute__ ((__nothrow__)); | |
10983 | ||
10984 | ||
10985 | extern wint_t towctrans (wint_t __wc, wctrans_t __desc) __attribute__ ((__nothrow__)); | |
10986 | ||
10987 | ||
10988 | ||
10989 | ||
10990 | # 1 "../include/xlocale.h" 1 | |
10991 | # 241 "../wctype/wctype.h" 2 | |
10992 | ||
10993 | ||
10994 | ||
10995 | extern int iswalnum_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
10996 | ||
10997 | ||
10998 | ||
10999 | ||
11000 | ||
11001 | extern int iswalpha_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11002 | ||
11003 | ||
11004 | extern int iswcntrl_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11005 | ||
11006 | ||
11007 | ||
11008 | extern int iswdigit_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11009 | ||
11010 | ||
11011 | ||
11012 | extern int iswgraph_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11013 | ||
11014 | ||
11015 | ||
11016 | ||
11017 | extern int iswlower_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11018 | ||
11019 | ||
11020 | extern int iswprint_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11021 | ||
11022 | ||
11023 | ||
11024 | ||
11025 | extern int iswpunct_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11026 | ||
11027 | ||
11028 | ||
11029 | ||
11030 | extern int iswspace_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11031 | ||
11032 | ||
11033 | ||
11034 | ||
11035 | extern int iswupper_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11036 | ||
11037 | ||
11038 | ||
11039 | ||
11040 | extern int iswxdigit_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11041 | ||
11042 | ||
11043 | ||
11044 | ||
11045 | extern int iswblank_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11046 | ||
11047 | ||
11048 | ||
11049 | extern wctype_t wctype_l (__const char *__property, __locale_t __locale) | |
11050 | __attribute__ ((__nothrow__)); | |
11051 | ||
11052 | ||
11053 | ||
11054 | extern int iswctype_l (wint_t __wc, wctype_t __desc, __locale_t __locale) | |
11055 | __attribute__ ((__nothrow__)); | |
11056 | ||
11057 | ||
11058 | ||
11059 | ||
11060 | ||
11061 | ||
11062 | ||
11063 | extern wint_t towlower_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11064 | ||
11065 | ||
11066 | extern wint_t towupper_l (wint_t __wc, __locale_t __locale) __attribute__ ((__nothrow__)); | |
11067 | ||
11068 | ||
11069 | ||
11070 | extern wctrans_t wctrans_l (__const char *__property, __locale_t __locale) | |
11071 | __attribute__ ((__nothrow__)); | |
11072 | ||
11073 | ||
11074 | extern wint_t towctrans_l (wint_t __wc, wctrans_t __desc, | |
11075 | __locale_t __locale) __attribute__ ((__nothrow__)); | |
11076 | ||
11077 | ||
11078 | ||
11079 | ||
11080 | # 38 "../include/wctype.h" 2 | |
11081 | ||
11082 | ||
11083 | extern int __iswalpha_l_internal (wint_t __wc, __locale_t __locale) | |
11084 | ; | |
11085 | extern int __iswdigit_l_internal (wint_t __wc, __locale_t __locale) | |
11086 | ; | |
11087 | extern int __iswspace_l_internal (wint_t __wc, __locale_t __locale) | |
11088 | ; | |
11089 | extern int __iswxdigit_l_internal (wint_t __wc, __locale_t __locale) | |
11090 | ; | |
11091 | extern int __iswspace (wint_t __wc); | |
11092 | extern int __iswctype (wint_t __wc, wctype_t __desc); | |
11093 | extern int __iswctype_internal (wint_t __wc, wctype_t __desc) ; | |
11094 | extern wctype_t __wctype (__const char *__property); | |
11095 | extern wctrans_t __wctrans (const char *__property); | |
11096 | extern wint_t __towctrans (wint_t __wc, wctrans_t __desc); | |
11097 | ||
11098 | extern __typeof (iswalnum_l) __iswalnum_l; | |
11099 | extern __typeof (iswalpha_l) __iswalpha_l; | |
11100 | extern __typeof (iswblank_l) __iswblank_l; | |
11101 | extern __typeof (iswcntrl_l) __iswcntrl_l; | |
11102 | extern __typeof (iswdigit_l) __iswdigit_l; | |
11103 | extern __typeof (iswlower_l) __iswlower_l; | |
11104 | extern __typeof (iswgraph_l) __iswgraph_l; | |
11105 | extern __typeof (iswprint_l) __iswprint_l; | |
11106 | extern __typeof (iswpunct_l) __iswpunct_l; | |
11107 | extern __typeof (iswspace_l) __iswspace_l; | |
11108 | extern __typeof (iswupper_l) __iswupper_l; | |
11109 | extern __typeof (iswxdigit_l) __iswxdigit_l; | |
11110 | extern __typeof (towlower_l) __towlower_l; | |
11111 | extern __typeof (towupper_l) __towupper_l; | |
11112 | ||
11113 | ||
11114 | ||
11115 | ||
11116 | ||
11117 | ||
11118 | ||
11119 | ||
11120 | ||
11121 | ||
11122 | ||
11123 | ||
11124 | ||
11125 | ||
11126 | ||
11127 | ||
11128 | ||
11129 | # 41 "regex_internal.h" 2 | |
11130 | # 49 "regex_internal.h" | |
11131 | # 1 "../nptl/sysdeps/pthread/bits/libc-lock.h" 1 | |
11132 | # 23 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11133 | # 1 "../include/pthread.h" 1 | |
11134 | ||
11135 | ||
11136 | ||
11137 | extern void __pthread_initialize (void) __attribute__ ((weak)); | |
11138 | # 24 "../nptl/sysdeps/pthread/bits/libc-lock.h" 2 | |
11139 | ||
11140 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
11141 | # 26 "../nptl/sysdeps/pthread/bits/libc-lock.h" 2 | |
11142 | # 37 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11143 | # 1 "../nptl/sysdeps/pthread/pthread-functions.h" 1 | |
11144 | # 23 "../nptl/sysdeps/pthread/pthread-functions.h" | |
11145 | # 1 "../include/pthread.h" 1 | |
11146 | ||
11147 | ||
11148 | ||
11149 | extern void __pthread_initialize (void) __attribute__ ((weak)); | |
11150 | # 24 "../nptl/sysdeps/pthread/pthread-functions.h" 2 | |
11151 | ||
11152 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/internaltypes.h" 1 | |
11153 | # 26 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/internaltypes.h" | |
11154 | struct pthread_attr | |
11155 | { | |
11156 | ||
11157 | struct sched_param schedparam; | |
11158 | int schedpolicy; | |
11159 | ||
11160 | int flags; | |
11161 | ||
11162 | size_t guardsize; | |
11163 | ||
11164 | void *stackaddr; | |
11165 | size_t stacksize; | |
11166 | ||
11167 | cpu_set_t *cpuset; | |
11168 | size_t cpusetsize; | |
11169 | }; | |
11170 | # 53 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/internaltypes.h" | |
11171 | struct pthread_mutexattr | |
11172 | { | |
11173 | ||
11174 | ||
11175 | ||
11176 | ||
11177 | ||
11178 | ||
11179 | int mutexkind; | |
11180 | }; | |
11181 | ||
11182 | ||
11183 | ||
11184 | struct pthread_condattr | |
11185 | { | |
11186 | ||
11187 | ||
11188 | ||
11189 | ||
11190 | ||
11191 | ||
11192 | int value; | |
11193 | }; | |
11194 | # 85 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/internaltypes.h" | |
11195 | struct pthread_rwlockattr | |
11196 | { | |
11197 | int lockkind; | |
11198 | int pshared; | |
11199 | }; | |
11200 | ||
11201 | ||
11202 | ||
11203 | struct pthread_barrier | |
11204 | { | |
11205 | unsigned int curr_event; | |
11206 | int lock; | |
11207 | unsigned int left; | |
11208 | unsigned int init_count; | |
11209 | }; | |
11210 | ||
11211 | ||
11212 | ||
11213 | struct pthread_barrierattr | |
11214 | { | |
11215 | int pshared; | |
11216 | }; | |
11217 | ||
11218 | ||
11219 | ||
11220 | struct pthread_key_struct | |
11221 | { | |
11222 | ||
11223 | ||
11224 | ||
11225 | ||
11226 | uintptr_t seq; | |
11227 | ||
11228 | ||
11229 | void (*destr) (void *); | |
11230 | }; | |
11231 | # 140 "../ports/sysdeps/unix/sysv/linux/hppa/nptl/internaltypes.h" | |
11232 | struct sem | |
11233 | { | |
11234 | unsigned int count; | |
11235 | }; | |
11236 | ||
11237 | ||
11238 | ||
11239 | typedef struct | |
11240 | { | |
11241 | pthread_cond_t *cond; | |
11242 | } pthread_cond_2_0_t; | |
11243 | # 26 "../nptl/sysdeps/pthread/pthread-functions.h" 2 | |
11244 | # 1 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" 1 | |
11245 | # 23 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" | |
11246 | # 1 "../sysdeps/generic/sysdep.h" 1 | |
11247 | # 24 "../ports/sysdeps/unix/sysv/linux/hppa/sysdep.h" 2 | |
11248 | # 27 "../nptl/sysdeps/pthread/pthread-functions.h" 2 | |
11249 | ||
11250 | struct xid_command; | |
11251 | ||
11252 | ||
11253 | ||
11254 | struct pthread_functions | |
11255 | { | |
11256 | int (*ptr_pthread_attr_destroy) (pthread_attr_t *); | |
11257 | int (*ptr___pthread_attr_init_2_0) (pthread_attr_t *); | |
11258 | int (*ptr___pthread_attr_init_2_1) (pthread_attr_t *); | |
11259 | int (*ptr_pthread_attr_getdetachstate) (const pthread_attr_t *, int *); | |
11260 | int (*ptr_pthread_attr_setdetachstate) (pthread_attr_t *, int); | |
11261 | int (*ptr_pthread_attr_getinheritsched) (const pthread_attr_t *, int *); | |
11262 | int (*ptr_pthread_attr_setinheritsched) (pthread_attr_t *, int); | |
11263 | int (*ptr_pthread_attr_getschedparam) (const pthread_attr_t *, | |
11264 | struct sched_param *); | |
11265 | int (*ptr_pthread_attr_setschedparam) (pthread_attr_t *, | |
11266 | const struct sched_param *); | |
11267 | int (*ptr_pthread_attr_getschedpolicy) (const pthread_attr_t *, int *); | |
11268 | int (*ptr_pthread_attr_setschedpolicy) (pthread_attr_t *, int); | |
11269 | int (*ptr_pthread_attr_getscope) (const pthread_attr_t *, int *); | |
11270 | int (*ptr_pthread_attr_setscope) (pthread_attr_t *, int); | |
11271 | int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *); | |
11272 | int (*ptr_pthread_condattr_init) (pthread_condattr_t *); | |
11273 | int (*ptr___pthread_cond_broadcast) (pthread_cond_t *); | |
11274 | int (*ptr___pthread_cond_destroy) (pthread_cond_t *); | |
11275 | int (*ptr___pthread_cond_init) (pthread_cond_t *, | |
11276 | const pthread_condattr_t *); | |
11277 | int (*ptr___pthread_cond_signal) (pthread_cond_t *); | |
11278 | int (*ptr___pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *); | |
11279 | int (*ptr___pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *, | |
11280 | const struct timespec *); | |
11281 | int (*ptr___pthread_cond_broadcast_2_0) (pthread_cond_2_0_t *); | |
11282 | int (*ptr___pthread_cond_destroy_2_0) (pthread_cond_2_0_t *); | |
11283 | int (*ptr___pthread_cond_init_2_0) (pthread_cond_2_0_t *, | |
11284 | const pthread_condattr_t *); | |
11285 | int (*ptr___pthread_cond_signal_2_0) (pthread_cond_2_0_t *); | |
11286 | int (*ptr___pthread_cond_wait_2_0) (pthread_cond_2_0_t *, pthread_mutex_t *); | |
11287 | int (*ptr___pthread_cond_timedwait_2_0) (pthread_cond_2_0_t *, | |
11288 | pthread_mutex_t *, | |
11289 | const struct timespec *); | |
11290 | int (*ptr_pthread_equal) (pthread_t, pthread_t); | |
11291 | void (*ptr___pthread_exit) (void *); | |
11292 | int (*ptr_pthread_getschedparam) (pthread_t, int *, struct sched_param *); | |
11293 | int (*ptr_pthread_setschedparam) (pthread_t, int, | |
11294 | const struct sched_param *); | |
11295 | int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *); | |
11296 | int (*ptr_pthread_mutex_init) (pthread_mutex_t *, | |
11297 | const pthread_mutexattr_t *); | |
11298 | int (*ptr_pthread_mutex_lock) (pthread_mutex_t *); | |
11299 | int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *); | |
11300 | pthread_t (*ptr_pthread_self) (void); | |
11301 | int (*ptr_pthread_setcancelstate) (int, int *); | |
11302 | int (*ptr_pthread_setcanceltype) (int, int *); | |
11303 | void (*ptr___pthread_cleanup_upto) (__jmp_buf, char *); | |
11304 | int (*ptr___pthread_once) (pthread_once_t *, void (*) (void)); | |
11305 | int (*ptr___pthread_rwlock_rdlock) (pthread_rwlock_t *); | |
11306 | int (*ptr___pthread_rwlock_wrlock) (pthread_rwlock_t *); | |
11307 | int (*ptr___pthread_rwlock_unlock) (pthread_rwlock_t *); | |
11308 | int (*ptr___pthread_key_create) (pthread_key_t *, void (*) (void *)); | |
11309 | void *(*ptr___pthread_getspecific) (pthread_key_t); | |
11310 | int (*ptr___pthread_setspecific) (pthread_key_t, const void *); | |
11311 | void (*ptr__pthread_cleanup_push_defer) (struct _pthread_cleanup_buffer *, | |
11312 | void (*) (void *), void *); | |
11313 | void (*ptr__pthread_cleanup_pop_restore) (struct _pthread_cleanup_buffer *, | |
11314 | int); | |
11315 | ||
11316 | unsigned int *ptr_nthreads; | |
11317 | void (*ptr___pthread_unwind) (__pthread_unwind_buf_t *) | |
11318 | __attribute ((noreturn)) ; | |
11319 | void (*ptr__nptl_deallocate_tsd) (void); | |
11320 | int (*ptr__nptl_setxid) (struct xid_command *); | |
11321 | void (*ptr_freeres) (void); | |
11322 | }; | |
11323 | ||
11324 | ||
11325 | extern struct pthread_functions __libc_pthread_functions ; | |
11326 | extern int __libc_pthread_functions_init ; | |
11327 | # 38 "../nptl/sysdeps/pthread/bits/libc-lock.h" 2 | |
11328 | # 46 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11329 | typedef int __libc_lock_t; | |
11330 | typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t; | |
11331 | ||
11332 | typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t; | |
11333 | ||
11334 | typedef pthread_rwlock_t __libc_rwlock_t; | |
11335 | # 62 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11336 | typedef pthread_key_t __libc_key_t; | |
11337 | # 374 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11338 | extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer, | |
11339 | void (*routine) (void *), void *arg); | |
11340 | extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer, | |
11341 | int execute); | |
11342 | extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer, | |
11343 | void (*routine) (void *), void *arg); | |
11344 | extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer, | |
11345 | int execute); | |
11346 | # 417 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11347 | extern __inline void | |
11348 | __libc_cleanup_routine (struct __pthread_cleanup_frame *f) | |
11349 | { | |
11350 | if (f->__do_it) | |
11351 | f->__cancel_routine (f->__cancel_arg); | |
11352 | } | |
11353 | # 454 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11354 | extern int __register_atfork (void (*__prepare) (void), | |
11355 | void (*__parent) (void), | |
11356 | void (*__child) (void), | |
11357 | void *__dso_handle); | |
11358 | ||
11359 | ||
11360 | ||
11361 | ||
11362 | extern int __pthread_mutex_init (pthread_mutex_t *__mutex, | |
11363 | __const pthread_mutexattr_t *__mutex_attr); | |
11364 | ||
11365 | extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex); | |
11366 | ||
11367 | extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex); | |
11368 | ||
11369 | extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); | |
11370 | ||
11371 | extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex); | |
11372 | ||
11373 | extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr); | |
11374 | ||
11375 | extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr); | |
11376 | ||
11377 | extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr, | |
11378 | int __kind); | |
11379 | ||
11380 | ||
11381 | extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock, | |
11382 | __const pthread_rwlockattr_t *__attr); | |
11383 | ||
11384 | extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock); | |
11385 | ||
11386 | extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock); | |
11387 | ||
11388 | extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock); | |
11389 | ||
11390 | extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock); | |
11391 | ||
11392 | extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock); | |
11393 | ||
11394 | extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock); | |
11395 | ||
11396 | ||
11397 | extern int __pthread_key_create (pthread_key_t *__key, | |
11398 | void (*__destr_function) (void *)); | |
11399 | ||
11400 | extern int __pthread_setspecific (pthread_key_t __key, | |
11401 | __const void *__pointer); | |
11402 | ||
11403 | extern void *__pthread_getspecific (pthread_key_t __key); | |
11404 | ||
11405 | extern int __pthread_once (pthread_once_t *__once_control, | |
11406 | void (*__init_routine) (void)); | |
11407 | ||
11408 | extern int __pthread_atfork (void (*__prepare) (void), | |
11409 | void (*__parent) (void), | |
11410 | void (*__child) (void)); | |
11411 | # 519 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11412 | # 1 "../sysdeps/generic/bp-sym.h" 1 | |
11413 | # 520 "../nptl/sysdeps/pthread/bits/libc-lock.h" 2 | |
11414 | ||
11415 | ||
11416 | ||
11417 | ||
11418 | # 523 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11419 | #pragma weak __pthread_mutex_init | |
11420 | # 523 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11421 | ||
11422 | ||
11423 | # 524 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11424 | #pragma weak __pthread_mutex_destroy | |
11425 | # 524 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11426 | ||
11427 | ||
11428 | # 525 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11429 | #pragma weak __pthread_mutex_lock | |
11430 | # 525 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11431 | ||
11432 | ||
11433 | # 526 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11434 | #pragma weak __pthread_mutex_trylock | |
11435 | # 526 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11436 | ||
11437 | ||
11438 | # 527 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11439 | #pragma weak __pthread_mutex_unlock | |
11440 | # 527 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11441 | ||
11442 | ||
11443 | # 528 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11444 | #pragma weak __pthread_mutexattr_init | |
11445 | # 528 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11446 | ||
11447 | ||
11448 | # 529 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11449 | #pragma weak __pthread_mutexattr_destroy | |
11450 | # 529 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11451 | ||
11452 | ||
11453 | # 530 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11454 | #pragma weak __pthread_mutexattr_settype | |
11455 | # 530 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11456 | ||
11457 | ||
11458 | # 531 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11459 | #pragma weak __pthread_rwlock_init | |
11460 | # 531 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11461 | ||
11462 | ||
11463 | # 532 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11464 | #pragma weak __pthread_rwlock_destroy | |
11465 | # 532 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11466 | ||
11467 | ||
11468 | # 533 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11469 | #pragma weak __pthread_rwlock_rdlock | |
11470 | # 533 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11471 | ||
11472 | ||
11473 | # 534 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11474 | #pragma weak __pthread_rwlock_tryrdlock | |
11475 | # 534 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11476 | ||
11477 | ||
11478 | # 535 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11479 | #pragma weak __pthread_rwlock_wrlock | |
11480 | # 535 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11481 | ||
11482 | ||
11483 | # 536 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11484 | #pragma weak __pthread_rwlock_trywrlock | |
11485 | # 536 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11486 | ||
11487 | ||
11488 | # 537 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11489 | #pragma weak __pthread_rwlock_unlock | |
11490 | # 537 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11491 | ||
11492 | ||
11493 | # 538 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11494 | #pragma weak __pthread_key_create | |
11495 | # 538 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11496 | ||
11497 | ||
11498 | # 539 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11499 | #pragma weak __pthread_setspecific | |
11500 | # 539 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11501 | ||
11502 | ||
11503 | # 540 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11504 | #pragma weak __pthread_getspecific | |
11505 | # 540 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11506 | ||
11507 | ||
11508 | # 541 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11509 | #pragma weak __pthread_once | |
11510 | # 541 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11511 | ||
11512 | ||
11513 | # 542 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11514 | #pragma weak __pthread_initialize | |
11515 | # 542 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11516 | ||
11517 | ||
11518 | # 543 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11519 | #pragma weak __pthread_atfork | |
11520 | # 543 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11521 | ||
11522 | ||
11523 | # 544 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11524 | #pragma weak _pthread_cleanup_push_defer | |
11525 | # 544 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11526 | ||
11527 | ||
11528 | # 545 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11529 | #pragma weak _pthread_cleanup_pop_restore | |
11530 | # 545 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11531 | ||
11532 | ||
11533 | # 546 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11534 | #pragma weak pthread_setcancelstate | |
11535 | # 546 "../nptl/sysdeps/pthread/bits/libc-lock.h" | |
11536 | ||
11537 | # 50 "regex_internal.h" 2 | |
11538 | # 65 "regex_internal.h" | |
11539 | # 1 "../locale/localeinfo.h" 1 | |
11540 | # 66 "regex_internal.h" 2 | |
11541 | # 1 "../locale/elem-hash.h" 1 | |
11542 | # 22 "../locale/elem-hash.h" | |
11543 | static inline int32_t | |
11544 | elem_hash (const char *str, int_fast32_t n) | |
11545 | { | |
11546 | int32_t result = n; | |
11547 | ||
11548 | while (n-- > 0) | |
11549 | { | |
11550 | result <<= 3; | |
11551 | result += *str++; | |
11552 | } | |
11553 | ||
11554 | return result; | |
11555 | } | |
11556 | # 67 "regex_internal.h" 2 | |
11557 | # 1 "../locale/coll-lookup.h" 1 | |
11558 | # 23 "../locale/coll-lookup.h" | |
11559 | extern int32_t __collidx_table_lookup (const char *table, uint32_t wc) | |
11560 | ; | |
11561 | ||
11562 | ||
11563 | extern uint32_t __collseq_table_lookup (const char *table, uint32_t wc) | |
11564 | ; | |
11565 | # 68 "regex_internal.h" 2 | |
11566 | ||
11567 | ||
11568 | ||
11569 | ||
11570 | ||
11571 | # 1 "../include/libintl.h" 1 | |
11572 | ||
11573 | # 1 "../intl/libintl.h" 1 | |
11574 | # 35 "../intl/libintl.h" | |
11575 | ||
11576 | ||
11577 | ||
11578 | ||
11579 | ||
11580 | extern char *gettext (__const char *__msgid) | |
11581 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (1))); | |
11582 | ||
11583 | ||
11584 | ||
11585 | extern char *dgettext (__const char *__domainname, __const char *__msgid) | |
11586 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); | |
11587 | extern char *__dgettext (__const char *__domainname, __const char *__msgid) | |
11588 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); | |
11589 | ||
11590 | ||
11591 | ||
11592 | extern char *dcgettext (__const char *__domainname, | |
11593 | __const char *__msgid, int __category) | |
11594 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); | |
11595 | extern char *__dcgettext (__const char *__domainname, | |
11596 | __const char *__msgid, int __category) | |
11597 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); | |
11598 | ||
11599 | ||
11600 | ||
11601 | ||
11602 | extern char *ngettext (__const char *__msgid1, __const char *__msgid2, | |
11603 | unsigned long int __n) | |
11604 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2))); | |
11605 | ||
11606 | ||
11607 | ||
11608 | extern char *dngettext (__const char *__domainname, __const char *__msgid1, | |
11609 | __const char *__msgid2, unsigned long int __n) | |
11610 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3))); | |
11611 | ||
11612 | ||
11613 | ||
11614 | extern char *dcngettext (__const char *__domainname, __const char *__msgid1, | |
11615 | __const char *__msgid2, unsigned long int __n, | |
11616 | int __category) | |
11617 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3))); | |
11618 | ||
11619 | ||
11620 | ||
11621 | ||
11622 | ||
11623 | extern char *textdomain (__const char *__domainname) __attribute__ ((__nothrow__)); | |
11624 | ||
11625 | ||
11626 | ||
11627 | extern char *bindtextdomain (__const char *__domainname, | |
11628 | __const char *__dirname) __attribute__ ((__nothrow__)); | |
11629 | ||
11630 | ||
11631 | ||
11632 | extern char *bind_textdomain_codeset (__const char *__domainname, | |
11633 | __const char *__codeset) __attribute__ ((__nothrow__)); | |
11634 | ||
11635 | ||
11636 | ||
11637 | ||
11638 | ||
11639 | ||
11640 | ||
11641 | # 1 "/usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
11642 | # 102 "../intl/libintl.h" 2 | |
11643 | # 122 "../intl/libintl.h" | |
11644 | ||
11645 | # 3 "../include/libintl.h" 2 | |
11646 | ||
11647 | ||
11648 | ||
11649 | extern char *__gettext (__const char *__msgid) | |
11650 | __attribute__ ((__format_arg__ (1))); | |
11651 | extern char *__dgettext (__const char *__domainname, | |
11652 | __const char *__msgid) | |
11653 | __attribute__ ((__format_arg__ (2))); | |
11654 | extern char *__dcgettext (__const char *__domainname, | |
11655 | __const char *__msgid, int __category) | |
11656 | __attribute__ ((__format_arg__ (2))); | |
11657 | ||
11658 | extern char *__dcgettext_internal (__const char *__domainname, | |
11659 | __const char *__msgid, int __category) | |
11660 | __attribute__ ((__format_arg__ (2))) | |
11661 | ; | |
11662 | ||
11663 | extern char *__ngettext (__const char *__msgid1, __const char *__msgid2, | |
11664 | unsigned long int __n) | |
11665 | __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2))); | |
11666 | extern char *__dngettext (__const char *__domainname, | |
11667 | __const char *__msgid1, __const char *__msgid2, | |
11668 | unsigned long int __n) | |
11669 | __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3))); | |
11670 | extern char *__dcngettext (__const char *__domainname, | |
11671 | __const char *__msgid1, __const char *__msgid2, | |
11672 | unsigned long int __n, int __category) | |
11673 | __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3))); | |
11674 | extern char *__dcngettext_internal (__const char *__domainname, | |
11675 | __const char *__msgid1, | |
11676 | __const char *__msgid2, | |
11677 | unsigned long int __n, int __category) | |
11678 | __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3))) | |
11679 | ; | |
11680 | ||
11681 | extern char *__textdomain (__const char *__domainname); | |
11682 | extern char *__bindtextdomain (__const char *__domainname, | |
11683 | __const char *__dirname); | |
11684 | extern char *__bind_textdomain_codeset (__const char *__domainname, | |
11685 | __const char *__codeset); | |
11686 | ||
11687 | extern const char _libc_intl_domainname[]; | |
11688 | ||
11689 | # 74 "regex_internal.h" 2 | |
11690 | # 131 "regex_internal.h" | |
11691 | extern const char __re_error_msgid[] ; | |
11692 | extern const size_t __re_error_msgid_idx[] ; | |
11693 | ||
11694 | ||
11695 | ||
11696 | typedef unsigned long int bitset_word_t; | |
11697 | ||
11698 | ||
11699 | ||
11700 | ||
11701 | ||
11702 | ||
11703 | typedef bitset_word_t bitset_t[(256 / (sizeof (bitset_word_t) * 8))]; | |
11704 | typedef bitset_word_t *re_bitset_ptr_t; | |
11705 | typedef const bitset_word_t *re_const_bitset_ptr_t; | |
11706 | # 168 "regex_internal.h" | |
11707 | typedef enum | |
11708 | { | |
11709 | INSIDE_WORD = 0x0001 | 0x0004, | |
11710 | WORD_FIRST = 0x0002 | 0x0004, | |
11711 | WORD_LAST = 0x0001 | 0x0008, | |
11712 | INSIDE_NOTWORD = 0x0002 | 0x0008, | |
11713 | LINE_FIRST = 0x0010, | |
11714 | LINE_LAST = 0x0020, | |
11715 | BUF_FIRST = 0x0040, | |
11716 | BUF_LAST = 0x0080, | |
11717 | WORD_DELIM = 0x0100, | |
11718 | NOT_WORD_DELIM = 0x0200 | |
11719 | } re_context_type; | |
11720 | ||
11721 | typedef struct | |
11722 | { | |
11723 | int alloc; | |
11724 | int nelem; | |
11725 | int *elems; | |
11726 | } re_node_set; | |
11727 | ||
11728 | typedef enum | |
11729 | { | |
11730 | NON_TYPE = 0, | |
11731 | ||
11732 | ||
11733 | CHARACTER = 1, | |
11734 | END_OF_RE = 2, | |
11735 | SIMPLE_BRACKET = 3, | |
11736 | OP_BACK_REF = 4, | |
11737 | OP_PERIOD = 5, | |
11738 | ||
11739 | COMPLEX_BRACKET = 6, | |
11740 | OP_UTF8_PERIOD = 7, | |
11741 | ||
11742 | ||
11743 | ||
11744 | ||
11745 | ||
11746 | OP_OPEN_SUBEXP = 8 | 0, | |
11747 | OP_CLOSE_SUBEXP = 8 | 1, | |
11748 | OP_ALT = 8 | 2, | |
11749 | OP_DUP_ASTERISK = 8 | 3, | |
11750 | ANCHOR = 8 | 4, | |
11751 | ||
11752 | ||
11753 | CONCAT = 16, | |
11754 | SUBEXP = 17, | |
11755 | ||
11756 | ||
11757 | OP_DUP_PLUS = 18, | |
11758 | OP_DUP_QUESTION, | |
11759 | OP_OPEN_BRACKET, | |
11760 | OP_CLOSE_BRACKET, | |
11761 | OP_CHARSET_RANGE, | |
11762 | OP_OPEN_DUP_NUM, | |
11763 | OP_CLOSE_DUP_NUM, | |
11764 | OP_NON_MATCH_LIST, | |
11765 | OP_OPEN_COLL_ELEM, | |
11766 | OP_CLOSE_COLL_ELEM, | |
11767 | OP_OPEN_EQUIV_CLASS, | |
11768 | OP_CLOSE_EQUIV_CLASS, | |
11769 | OP_OPEN_CHAR_CLASS, | |
11770 | OP_CLOSE_CHAR_CLASS, | |
11771 | OP_WORD, | |
11772 | OP_NOTWORD, | |
11773 | OP_SPACE, | |
11774 | OP_NOTSPACE, | |
11775 | BACK_SLASH | |
11776 | ||
11777 | } re_token_type_t; | |
11778 | ||
11779 | ||
11780 | typedef struct | |
11781 | { | |
11782 | ||
11783 | wchar_t *mbchars; | |
11784 | ||
11785 | ||
11786 | ||
11787 | int32_t *coll_syms; | |
11788 | ||
11789 | ||
11790 | ||
11791 | ||
11792 | int32_t *equiv_classes; | |
11793 | ||
11794 | ||
11795 | ||
11796 | ||
11797 | uint32_t *range_starts; | |
11798 | uint32_t *range_ends; | |
11799 | ||
11800 | ||
11801 | ||
11802 | ||
11803 | ||
11804 | ||
11805 | wctype_t *char_classes; | |
11806 | ||
11807 | ||
11808 | unsigned int non_match : 1; | |
11809 | ||
11810 | ||
11811 | int nmbchars; | |
11812 | ||
11813 | ||
11814 | int ncoll_syms; | |
11815 | ||
11816 | ||
11817 | int nequiv_classes; | |
11818 | ||
11819 | ||
11820 | int nranges; | |
11821 | ||
11822 | ||
11823 | int nchar_classes; | |
11824 | } re_charset_t; | |
11825 | ||
11826 | ||
11827 | typedef struct | |
11828 | { | |
11829 | union | |
11830 | { | |
11831 | unsigned char c; | |
11832 | re_bitset_ptr_t sbcset; | |
11833 | ||
11834 | re_charset_t *mbcset; | |
11835 | ||
11836 | int idx; | |
11837 | re_context_type ctx_type; | |
11838 | } opr; | |
11839 | ||
11840 | re_token_type_t type : 8; | |
11841 | ||
11842 | ||
11843 | ||
11844 | unsigned int constraint : 10; | |
11845 | unsigned int duplicated : 1; | |
11846 | unsigned int opt_subexp : 1; | |
11847 | ||
11848 | unsigned int accept_mb : 1; | |
11849 | ||
11850 | ||
11851 | unsigned int mb_partial : 1; | |
11852 | ||
11853 | unsigned int word_char : 1; | |
11854 | } re_token_t; | |
11855 | ||
11856 | ||
11857 | ||
11858 | struct re_string_t | |
11859 | { | |
11860 | ||
11861 | ||
11862 | const unsigned char *raw_mbs; | |
11863 | ||
11864 | ||
11865 | ||
11866 | unsigned char *mbs; | |
11867 | ||
11868 | ||
11869 | wint_t *wcs; | |
11870 | int *offsets; | |
11871 | mbstate_t cur_state; | |
11872 | ||
11873 | ||
11874 | ||
11875 | int raw_mbs_idx; | |
11876 | ||
11877 | int valid_len; | |
11878 | ||
11879 | int valid_raw_len; | |
11880 | ||
11881 | int bufs_len; | |
11882 | ||
11883 | int cur_idx; | |
11884 | ||
11885 | int raw_len; | |
11886 | ||
11887 | int len; | |
11888 | ||
11889 | ||
11890 | ||
11891 | int raw_stop; | |
11892 | ||
11893 | int stop; | |
11894 | ||
11895 | ||
11896 | ||
11897 | ||
11898 | unsigned int tip_context; | |
11899 | ||
11900 | unsigned char * trans; | |
11901 | ||
11902 | re_const_bitset_ptr_t word_char; | |
11903 | ||
11904 | unsigned char icase; | |
11905 | unsigned char is_utf8; | |
11906 | unsigned char map_notascii; | |
11907 | unsigned char mbs_allocated; | |
11908 | unsigned char offsets_needed; | |
11909 | unsigned char newline_anchor; | |
11910 | unsigned char word_ops_used; | |
11911 | int mb_cur_max; | |
11912 | }; | |
11913 | typedef struct re_string_t re_string_t; | |
11914 | ||
11915 | ||
11916 | struct re_dfa_t; | |
11917 | typedef struct re_dfa_t re_dfa_t; | |
11918 | # 388 "regex_internal.h" | |
11919 | static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr, | |
11920 | int new_buf_len) | |
11921 | ; | |
11922 | ||
11923 | static void build_wcs_buffer (re_string_t *pstr) ; | |
11924 | static int build_wcs_upper_buffer (re_string_t *pstr) ; | |
11925 | ||
11926 | static void build_upper_buffer (re_string_t *pstr) ; | |
11927 | static void re_string_translate_buffer (re_string_t *pstr) ; | |
11928 | static unsigned int re_string_context_at (const re_string_t *input, int idx, | |
11929 | int eflags) | |
11930 | __attribute__ ((pure)); | |
11931 | # 436 "regex_internal.h" | |
11932 | struct bin_tree_t | |
11933 | { | |
11934 | struct bin_tree_t *parent; | |
11935 | struct bin_tree_t *left; | |
11936 | struct bin_tree_t *right; | |
11937 | struct bin_tree_t *first; | |
11938 | struct bin_tree_t *next; | |
11939 | ||
11940 | re_token_t token; | |
11941 | ||
11942 | ||
11943 | ||
11944 | int node_idx; | |
11945 | }; | |
11946 | typedef struct bin_tree_t bin_tree_t; | |
11947 | ||
11948 | ||
11949 | ||
11950 | ||
11951 | struct bin_tree_storage_t | |
11952 | { | |
11953 | struct bin_tree_storage_t *next; | |
11954 | bin_tree_t data[((1024 - sizeof (void *)) / sizeof (bin_tree_t))]; | |
11955 | }; | |
11956 | typedef struct bin_tree_storage_t bin_tree_storage_t; | |
11957 | # 490 "regex_internal.h" | |
11958 | struct re_dfastate_t | |
11959 | { | |
11960 | unsigned int hash; | |
11961 | re_node_set nodes; | |
11962 | re_node_set non_eps_nodes; | |
11963 | re_node_set inveclosure; | |
11964 | re_node_set *entrance_nodes; | |
11965 | struct re_dfastate_t **trtable, **word_trtable; | |
11966 | unsigned int context : 4; | |
11967 | unsigned int halt : 1; | |
11968 | ||
11969 | ||
11970 | ||
11971 | unsigned int accept_mb : 1; | |
11972 | ||
11973 | unsigned int has_backref : 1; | |
11974 | unsigned int has_constraint : 1; | |
11975 | }; | |
11976 | typedef struct re_dfastate_t re_dfastate_t; | |
11977 | ||
11978 | struct re_state_table_entry | |
11979 | { | |
11980 | int num; | |
11981 | int alloc; | |
11982 | re_dfastate_t **array; | |
11983 | }; | |
11984 | ||
11985 | ||
11986 | ||
11987 | typedef struct | |
11988 | { | |
11989 | int next_idx; | |
11990 | int alloc; | |
11991 | re_dfastate_t **array; | |
11992 | } state_array_t; | |
11993 | ||
11994 | ||
11995 | ||
11996 | typedef struct | |
11997 | { | |
11998 | int node; | |
11999 | int str_idx; | |
12000 | state_array_t path; | |
12001 | } re_sub_match_last_t; | |
12002 | ||
12003 | ||
12004 | ||
12005 | ||
12006 | ||
12007 | typedef struct | |
12008 | { | |
12009 | int str_idx; | |
12010 | int node; | |
12011 | state_array_t *path; | |
12012 | int alasts; | |
12013 | int nlasts; | |
12014 | re_sub_match_last_t **lasts; | |
12015 | } re_sub_match_top_t; | |
12016 | ||
12017 | struct re_backref_cache_entry | |
12018 | { | |
12019 | int node; | |
12020 | int str_idx; | |
12021 | int subexp_from; | |
12022 | int subexp_to; | |
12023 | char more; | |
12024 | char unused; | |
12025 | unsigned short int eps_reachable_subexps_map; | |
12026 | }; | |
12027 | ||
12028 | typedef struct | |
12029 | { | |
12030 | ||
12031 | re_string_t input; | |
12032 | ||
12033 | const re_dfa_t *const dfa; | |
12034 | ||
12035 | ||
12036 | ||
12037 | ||
12038 | int eflags; | |
12039 | ||
12040 | int match_last; | |
12041 | int last_node; | |
12042 | ||
12043 | re_dfastate_t **state_log; | |
12044 | int state_log_top; | |
12045 | ||
12046 | int nbkref_ents; | |
12047 | int abkref_ents; | |
12048 | struct re_backref_cache_entry *bkref_ents; | |
12049 | int max_mb_elem_len; | |
12050 | int nsub_tops; | |
12051 | int asub_tops; | |
12052 | re_sub_match_top_t **sub_tops; | |
12053 | } re_match_context_t; | |
12054 | ||
12055 | typedef struct | |
12056 | { | |
12057 | re_dfastate_t **sifted_states; | |
12058 | re_dfastate_t **limited_states; | |
12059 | int last_node; | |
12060 | int last_str_idx; | |
12061 | re_node_set limits; | |
12062 | } re_sift_context_t; | |
12063 | ||
12064 | struct re_fail_stack_ent_t | |
12065 | { | |
12066 | int idx; | |
12067 | int node; | |
12068 | regmatch_t *regs; | |
12069 | re_node_set eps_via_nodes; | |
12070 | }; | |
12071 | ||
12072 | struct re_fail_stack_t | |
12073 | { | |
12074 | int num; | |
12075 | int alloc; | |
12076 | struct re_fail_stack_ent_t *stack; | |
12077 | }; | |
12078 | ||
12079 | struct re_dfa_t | |
12080 | { | |
12081 | re_token_t *nodes; | |
12082 | size_t nodes_alloc; | |
12083 | size_t nodes_len; | |
12084 | int *nexts; | |
12085 | int *org_indices; | |
12086 | re_node_set *edests; | |
12087 | re_node_set *eclosures; | |
12088 | re_node_set *inveclosures; | |
12089 | struct re_state_table_entry *state_table; | |
12090 | re_dfastate_t *init_state; | |
12091 | re_dfastate_t *init_state_word; | |
12092 | re_dfastate_t *init_state_nl; | |
12093 | re_dfastate_t *init_state_begbuf; | |
12094 | bin_tree_t *str_tree; | |
12095 | bin_tree_storage_t *str_tree_storage; | |
12096 | re_bitset_ptr_t sb_char; | |
12097 | int str_tree_storage_idx; | |
12098 | ||
12099 | ||
12100 | unsigned int state_hash_mask; | |
12101 | int init_node; | |
12102 | int nbackref; | |
12103 | ||
12104 | ||
12105 | bitset_word_t used_bkref_map; | |
12106 | bitset_word_t completed_bkref_map; | |
12107 | ||
12108 | unsigned int has_plural_match : 1; | |
12109 | ||
12110 | ||
12111 | ||
12112 | unsigned int has_mb_node : 1; | |
12113 | unsigned int is_utf8 : 1; | |
12114 | unsigned int map_notascii : 1; | |
12115 | unsigned int word_ops_used : 1; | |
12116 | int mb_cur_max; | |
12117 | bitset_t word_char; | |
12118 | reg_syntax_t syntax; | |
12119 | int *subexp_map; | |
12120 | ||
12121 | ||
12122 | ||
12123 | __libc_lock_t lock; | |
12124 | }; | |
12125 | # 665 "regex_internal.h" | |
12126 | typedef enum | |
12127 | { | |
12128 | SB_CHAR, | |
12129 | MB_CHAR, | |
12130 | EQUIV_CLASS, | |
12131 | COLL_SYM, | |
12132 | CHAR_CLASS | |
12133 | } bracket_elem_type; | |
12134 | ||
12135 | typedef struct | |
12136 | { | |
12137 | bracket_elem_type type; | |
12138 | union | |
12139 | { | |
12140 | unsigned char ch; | |
12141 | unsigned char *name; | |
12142 | wchar_t wch; | |
12143 | } opr; | |
12144 | } bracket_elem_t; | |
12145 | ||
12146 | ||
12147 | ||
12148 | static inline void | |
12149 | bitset_not (bitset_t set) | |
12150 | { | |
12151 | int bitset_i; | |
12152 | for (bitset_i = 0; bitset_i < (256 / (sizeof (bitset_word_t) * 8)); ++bitset_i) | |
12153 | set[bitset_i] = ~set[bitset_i]; | |
12154 | } | |
12155 | ||
12156 | static inline void | |
12157 | bitset_merge (bitset_t dest, const bitset_t src) | |
12158 | { | |
12159 | int bitset_i; | |
12160 | for (bitset_i = 0; bitset_i < (256 / (sizeof (bitset_word_t) * 8)); ++bitset_i) | |
12161 | dest[bitset_i] |= src[bitset_i]; | |
12162 | } | |
12163 | ||
12164 | static inline void | |
12165 | bitset_mask (bitset_t dest, const bitset_t src) | |
12166 | { | |
12167 | int bitset_i; | |
12168 | for (bitset_i = 0; bitset_i < (256 / (sizeof (bitset_word_t) * 8)); ++bitset_i) | |
12169 | dest[bitset_i] &= src[bitset_i]; | |
12170 | } | |
12171 | ||
12172 | ||
12173 | ||
12174 | static inline int | |
12175 | __attribute__ ((pure)) | |
12176 | re_string_char_size_at (const re_string_t *pstr, int idx) | |
12177 | { | |
12178 | int byte_idx; | |
12179 | if (pstr->mb_cur_max == 1) | |
12180 | return 1; | |
12181 | for (byte_idx = 1; idx + byte_idx < pstr->valid_len; ++byte_idx) | |
12182 | if (pstr->wcs[idx + byte_idx] != (0xffffffffu)) | |
12183 | break; | |
12184 | return byte_idx; | |
12185 | } | |
12186 | ||
12187 | static inline wint_t | |
12188 | __attribute__ ((pure)) | |
12189 | re_string_wchar_at (const re_string_t *pstr, int idx) | |
12190 | { | |
12191 | if (pstr->mb_cur_max == 1) | |
12192 | return (wint_t) pstr->mbs[idx]; | |
12193 | return (wint_t) pstr->wcs[idx]; | |
12194 | } | |
12195 | ||
12196 | static int | |
12197 | __attribute__ ((pure)) | |
12198 | re_string_elem_size_at (const re_string_t *pstr, int idx) | |
12199 | { | |
12200 | ||
12201 | const unsigned char *p, *extra; | |
12202 | const int32_t *table, *indirect; | |
12203 | int32_t tmp; | |
12204 | # 1 "../locale/weight.h" 1 | |
12205 | # 21 "../locale/weight.h" | |
12206 | auto inline int32_t | |
12207 | __attribute__ ((always_inline)) | |
12208 | findidx (const unsigned char **cpp) | |
12209 | { | |
12210 | int_fast32_t i = table[*(*cpp)++]; | |
12211 | const unsigned char *cp; | |
12212 | const unsigned char *usrc; | |
12213 | ||
12214 | if (i >= 0) | |
12215 | ||
12216 | return i; | |
12217 | ||
12218 | ||
12219 | ||
12220 | cp = &extra[-i]; | |
12221 | usrc = *cpp; | |
12222 | while (1) | |
12223 | { | |
12224 | size_t nhere; | |
12225 | ||
12226 | ||
12227 | i = *((const int32_t *) cp); | |
12228 | cp += sizeof (int32_t); | |
12229 | ||
12230 | ||
12231 | ||
12232 | ||
12233 | nhere = *cp++; | |
12234 | ||
12235 | if (i >= 0) | |
12236 | { | |
12237 | ||
12238 | ||
12239 | ||
12240 | ||
12241 | ||
12242 | size_t cnt; | |
12243 | ||
12244 | for (cnt = 0; cnt < nhere; ++cnt) | |
12245 | if (cp[cnt] != usrc[cnt]) | |
12246 | break; | |
12247 | ||
12248 | if (cnt == nhere) | |
12249 | { | |
12250 | ||
12251 | *cpp += nhere; | |
12252 | return i; | |
12253 | } | |
12254 | ||
12255 | ||
12256 | cp += nhere; | |
12257 | if ((1 + nhere) % __alignof__ (int32_t) != 0) | |
12258 | cp += __alignof__ (int32_t) - (1 + nhere) % __alignof__ (int32_t); | |
12259 | } | |
12260 | else | |
12261 | { | |
12262 | ||
12263 | ||
12264 | size_t cnt; | |
12265 | size_t offset = 0; | |
12266 | ||
12267 | for (cnt = 0; cnt < nhere; ++cnt) | |
12268 | if (cp[cnt] != usrc[cnt]) | |
12269 | break; | |
12270 | ||
12271 | if (cnt != nhere) | |
12272 | { | |
12273 | if (cp[cnt] > usrc[cnt]) | |
12274 | { | |
12275 | ||
12276 | cp += 2 * nhere; | |
12277 | if ((1 + 2 * nhere) % __alignof__ (int32_t) != 0) | |
12278 | cp += (__alignof__ (int32_t) | |
12279 | - (1 + 2 * nhere) % __alignof__ (int32_t)); | |
12280 | continue; | |
12281 | } | |
12282 | ||
12283 | ||
12284 | for (cnt = 0; cnt < nhere; ++cnt) | |
12285 | if (cp[nhere + cnt] != usrc[cnt]) | |
12286 | break; | |
12287 | ||
12288 | if (cnt != nhere && cp[nhere + cnt] < usrc[cnt]) | |
12289 | { | |
12290 | ||
12291 | cp += 2 * nhere; | |
12292 | if ((1 + 2 * nhere) % __alignof__ (int32_t) != 0) | |
12293 | cp += (__alignof__ (int32_t) | |
12294 | - (1 + 2 * nhere) % __alignof__ (int32_t)); | |
12295 | continue; | |
12296 | } | |
12297 | ||
12298 | ||
12299 | ||
12300 | for (cnt = 0; cp[cnt] == usrc[cnt]; ++cnt); | |
12301 | ||
12302 | do | |
12303 | { | |
12304 | offset <<= 8; | |
12305 | offset += usrc[cnt] - cp[cnt]; | |
12306 | } | |
12307 | while (++cnt < nhere); | |
12308 | } | |
12309 | ||
12310 | *cpp += nhere; | |
12311 | return indirect[-i + offset]; | |
12312 | } | |
12313 | } | |
12314 | ||
12315 | ||
12316 | return 0x43219876; | |
12317 | } | |
12318 | # 744 "regex_internal.h" 2 | |
12319 | uint_fast32_t nrules = ((uint32_t) (*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_NRULES) & 0xffff)].word); | |
12320 | ||
12321 | if (nrules != 0) | |
12322 | { | |
12323 | table = (const int32_t *) ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_TABLEMB) & 0xffff)].string); | |
12324 | extra = (const unsigned char *) | |
12325 | ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_EXTRAMB) & 0xffff)].string); | |
12326 | indirect = (const int32_t *) ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_INDIRECTMB) & 0xffff)].string); | |
12327 | ||
12328 | p = pstr->mbs + idx; | |
12329 | tmp = findidx (&p); | |
12330 | return p - pstr->mbs - idx; | |
12331 | } | |
12332 | else | |
12333 | ||
12334 | return 1; | |
12335 | } | |
12336 | # 62 "regex.c" 2 | |
12337 | ||
12338 | # 1 "regex_internal.c" 1 | |
12339 | # 21 "regex_internal.c" | |
12340 | static void re_string_construct_common (const char *str, int len, | |
12341 | re_string_t *pstr, | |
12342 | unsigned char * trans, int icase, | |
12343 | const re_dfa_t *dfa) ; | |
12344 | static re_dfastate_t *create_ci_newstate (const re_dfa_t *dfa, | |
12345 | const re_node_set *nodes, | |
12346 | unsigned int hash) ; | |
12347 | static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa, | |
12348 | const re_node_set *nodes, | |
12349 | unsigned int context, | |
12350 | unsigned int hash) ; | |
12351 | ||
12352 | ||
12353 | ||
12354 | ||
12355 | ||
12356 | ||
12357 | static reg_errcode_t | |
12358 | ||
12359 | re_string_allocate (re_string_t *pstr, const char *str, int len, int init_len, | |
12360 | unsigned char * trans, int icase, const re_dfa_t *dfa) | |
12361 | { | |
12362 | reg_errcode_t ret; | |
12363 | int init_buf_len; | |
12364 | ||
12365 | ||
12366 | if (init_len < dfa->mb_cur_max) | |
12367 | init_len = dfa->mb_cur_max; | |
12368 | init_buf_len = (len + 1 < init_len) ? len + 1: init_len; | |
12369 | re_string_construct_common (str, len, pstr, trans, icase, dfa); | |
12370 | ||
12371 | ret = re_string_realloc_buffers (pstr, init_buf_len); | |
12372 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
12373 | return ret; | |
12374 | ||
12375 | pstr->word_char = dfa->word_char; | |
12376 | pstr->word_ops_used = dfa->word_ops_used; | |
12377 | pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str; | |
12378 | pstr->valid_len = (pstr->mbs_allocated || dfa->mb_cur_max > 1) ? 0 : len; | |
12379 | pstr->valid_raw_len = pstr->valid_len; | |
12380 | return REG_NOERROR; | |
12381 | } | |
12382 | ||
12383 | ||
12384 | ||
12385 | static reg_errcode_t | |
12386 | ||
12387 | re_string_construct (re_string_t *pstr, const char *str, int len, | |
12388 | unsigned char * trans, int icase, const re_dfa_t *dfa) | |
12389 | { | |
12390 | reg_errcode_t ret; | |
12391 | memset (pstr, '\0', sizeof (re_string_t)); | |
12392 | re_string_construct_common (str, len, pstr, trans, icase, dfa); | |
12393 | ||
12394 | if (len > 0) | |
12395 | { | |
12396 | ret = re_string_realloc_buffers (pstr, len + 1); | |
12397 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
12398 | return ret; | |
12399 | } | |
12400 | pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str; | |
12401 | ||
12402 | if (icase) | |
12403 | { | |
12404 | ||
12405 | if (dfa->mb_cur_max > 1) | |
12406 | { | |
12407 | while (1) | |
12408 | { | |
12409 | ret = build_wcs_upper_buffer (pstr); | |
12410 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
12411 | return ret; | |
12412 | if (pstr->valid_raw_len >= len) | |
12413 | break; | |
12414 | if (pstr->bufs_len > pstr->valid_len + dfa->mb_cur_max) | |
12415 | break; | |
12416 | ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2); | |
12417 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
12418 | return ret; | |
12419 | } | |
12420 | } | |
12421 | else | |
12422 | ||
12423 | build_upper_buffer (pstr); | |
12424 | } | |
12425 | else | |
12426 | { | |
12427 | ||
12428 | if (dfa->mb_cur_max > 1) | |
12429 | build_wcs_buffer (pstr); | |
12430 | else | |
12431 | ||
12432 | { | |
12433 | if (trans != ((void *)0)) | |
12434 | re_string_translate_buffer (pstr); | |
12435 | else | |
12436 | { | |
12437 | pstr->valid_len = pstr->bufs_len; | |
12438 | pstr->valid_raw_len = pstr->bufs_len; | |
12439 | } | |
12440 | } | |
12441 | } | |
12442 | ||
12443 | return REG_NOERROR; | |
12444 | } | |
12445 | ||
12446 | ||
12447 | ||
12448 | static reg_errcode_t | |
12449 | ||
12450 | re_string_realloc_buffers (re_string_t *pstr, int new_buf_len) | |
12451 | { | |
12452 | ||
12453 | if (pstr->mb_cur_max > 1) | |
12454 | { | |
12455 | wint_t *new_wcs = ((wint_t *) realloc (pstr->wcs, (new_buf_len) * sizeof (wint_t))); | |
12456 | if (__builtin_expect (new_wcs == ((void *)0), 0)) | |
12457 | return REG_ESPACE; | |
12458 | pstr->wcs = new_wcs; | |
12459 | if (pstr->offsets != ((void *)0)) | |
12460 | { | |
12461 | int *new_offsets = ((int *) realloc (pstr->offsets, (new_buf_len) * sizeof (int))); | |
12462 | if (__builtin_expect (new_offsets == ((void *)0), 0)) | |
12463 | return REG_ESPACE; | |
12464 | pstr->offsets = new_offsets; | |
12465 | } | |
12466 | } | |
12467 | ||
12468 | if (pstr->mbs_allocated) | |
12469 | { | |
12470 | unsigned char *new_mbs = ((unsigned char *) realloc (pstr->mbs, (new_buf_len) * sizeof (unsigned char))); | |
12471 | ||
12472 | if (__builtin_expect (new_mbs == ((void *)0), 0)) | |
12473 | return REG_ESPACE; | |
12474 | pstr->mbs = new_mbs; | |
12475 | } | |
12476 | pstr->bufs_len = new_buf_len; | |
12477 | return REG_NOERROR; | |
12478 | } | |
12479 | ||
12480 | ||
12481 | static void | |
12482 | ||
12483 | re_string_construct_common (const char *str, int len, re_string_t *pstr, | |
12484 | unsigned char * trans, int icase, | |
12485 | const re_dfa_t *dfa) | |
12486 | { | |
12487 | pstr->raw_mbs = (const unsigned char *) str; | |
12488 | pstr->len = len; | |
12489 | pstr->raw_len = len; | |
12490 | pstr->trans = trans; | |
12491 | pstr->icase = icase ? 1 : 0; | |
12492 | pstr->mbs_allocated = (trans != ((void *)0) || icase); | |
12493 | pstr->mb_cur_max = dfa->mb_cur_max; | |
12494 | pstr->is_utf8 = dfa->is_utf8; | |
12495 | pstr->map_notascii = dfa->map_notascii; | |
12496 | pstr->stop = pstr->len; | |
12497 | pstr->raw_stop = pstr->stop; | |
12498 | } | |
12499 | # 194 "regex_internal.c" | |
12500 | static void | |
12501 | ||
12502 | build_wcs_buffer (re_string_t *pstr) | |
12503 | { | |
12504 | ||
12505 | unsigned char buf[16]; | |
12506 | ((16 >= pstr->mb_cur_max) ? (void) (0) : (__assert_fail ("16 >= pstr->mb_cur_max", "regex_internal.c", 200, __PRETTY_FUNCTION__), (void) (0))); | |
12507 | ||
12508 | ||
12509 | ||
12510 | mbstate_t prev_st; | |
12511 | int byte_idx, end_idx, remain_len; | |
12512 | size_t mbclen; | |
12513 | ||
12514 | ||
12515 | ||
12516 | end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len; | |
12517 | for (byte_idx = pstr->valid_len; byte_idx < end_idx;) | |
12518 | { | |
12519 | wchar_t wc; | |
12520 | const char *p; | |
12521 | ||
12522 | remain_len = end_idx - byte_idx; | |
12523 | prev_st = pstr->cur_state; | |
12524 | ||
12525 | if (__builtin_expect (pstr->trans != ((void *)0), 0)) | |
12526 | { | |
12527 | int i, ch; | |
12528 | ||
12529 | for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i) | |
12530 | { | |
12531 | ch = pstr->raw_mbs [pstr->raw_mbs_idx + byte_idx + i]; | |
12532 | buf[i] = pstr->mbs[byte_idx + i] = pstr->trans[ch]; | |
12533 | } | |
12534 | p = (const char *) buf; | |
12535 | } | |
12536 | else | |
12537 | p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx; | |
12538 | mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state); | |
12539 | if (__builtin_expect (mbclen == (size_t) -2, 0)) | |
12540 | { | |
12541 | ||
12542 | pstr->cur_state = prev_st; | |
12543 | break; | |
12544 | } | |
12545 | else if (__builtin_expect (mbclen == (size_t) -1 || mbclen == 0, 0)) | |
12546 | { | |
12547 | ||
12548 | mbclen = 1; | |
12549 | wc = (wchar_t) pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]; | |
12550 | if (__builtin_expect (pstr->trans != ((void *)0), 0)) | |
12551 | wc = pstr->trans[wc]; | |
12552 | pstr->cur_state = prev_st; | |
12553 | } | |
12554 | ||
12555 | ||
12556 | pstr->wcs[byte_idx++] = wc; | |
12557 | ||
12558 | for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;) | |
12559 | pstr->wcs[byte_idx++] = (0xffffffffu); | |
12560 | } | |
12561 | pstr->valid_len = byte_idx; | |
12562 | pstr->valid_raw_len = byte_idx; | |
12563 | } | |
12564 | ||
12565 | ||
12566 | ||
12567 | ||
12568 | static reg_errcode_t | |
12569 | ||
12570 | build_wcs_upper_buffer (re_string_t *pstr) | |
12571 | { | |
12572 | mbstate_t prev_st; | |
12573 | int src_idx, byte_idx, end_idx, remain_len; | |
12574 | size_t mbclen; | |
12575 | ||
12576 | char buf[16]; | |
12577 | ((16 >= pstr->mb_cur_max) ? (void) (0) : (__assert_fail ("16 >= pstr->mb_cur_max", "regex_internal.c", 271, __PRETTY_FUNCTION__), (void) (0))); | |
12578 | ||
12579 | ||
12580 | ||
12581 | ||
12582 | byte_idx = pstr->valid_len; | |
12583 | end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len; | |
12584 | ||
12585 | ||
12586 | ||
12587 | if (! pstr->map_notascii && pstr->trans == ((void *)0) && !pstr->offsets_needed) | |
12588 | { | |
12589 | while (byte_idx < end_idx) | |
12590 | { | |
12591 | wchar_t wc; | |
12592 | ||
12593 | if ((((pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]) & ~0x7f) == 0) | |
12594 | && ((&pstr->cur_state)->__count == 0)) | |
12595 | { | |
12596 | ||
12597 | pstr->mbs[byte_idx] | |
12598 | = (__extension__ ({ int __res; if (sizeof (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]) > 1) { if (__builtin_constant_p (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx])) { int __c = (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]); } else __res = (*__ctype_toupper_loc ())[(int) (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx])]; __res; })); | |
12599 | ||
12600 | ||
12601 | pstr->wcs[byte_idx] = (wchar_t) pstr->mbs[byte_idx]; | |
12602 | ++byte_idx; | |
12603 | continue; | |
12604 | } | |
12605 | ||
12606 | remain_len = end_idx - byte_idx; | |
12607 | prev_st = pstr->cur_state; | |
12608 | mbclen = mbrtowc (&wc, | |
12609 | ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx | |
12610 | + byte_idx), remain_len, &pstr->cur_state); | |
12611 | if (__builtin_expect (mbclen + 2 > 2, 1)) | |
12612 | { | |
12613 | wchar_t wcu = wc; | |
12614 | if (iswlower (wc)) | |
12615 | { | |
12616 | size_t mbcdlen; | |
12617 | ||
12618 | wcu = towupper (wc); | |
12619 | mbcdlen = wcrtomb (buf, wcu, &prev_st); | |
12620 | if (__builtin_expect (mbclen == mbcdlen, 1)) | |
12621 | memcpy (pstr->mbs + byte_idx, buf, mbclen); | |
12622 | else | |
12623 | { | |
12624 | src_idx = byte_idx; | |
12625 | goto offsets_needed; | |
12626 | } | |
12627 | } | |
12628 | else | |
12629 | memcpy (pstr->mbs + byte_idx, | |
12630 | pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx, mbclen); | |
12631 | pstr->wcs[byte_idx++] = wcu; | |
12632 | ||
12633 | for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;) | |
12634 | pstr->wcs[byte_idx++] = (0xffffffffu); | |
12635 | } | |
12636 | else if (mbclen == (size_t) -1 || mbclen == 0) | |
12637 | { | |
12638 | ||
12639 | int ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]; | |
12640 | pstr->mbs[byte_idx] = ch; | |
12641 | ||
12642 | pstr->wcs[byte_idx++] = (wchar_t) ch; | |
12643 | if (__builtin_expect (mbclen == (size_t) -1, 0)) | |
12644 | pstr->cur_state = prev_st; | |
12645 | } | |
12646 | else | |
12647 | { | |
12648 | ||
12649 | pstr->cur_state = prev_st; | |
12650 | break; | |
12651 | } | |
12652 | } | |
12653 | pstr->valid_len = byte_idx; | |
12654 | pstr->valid_raw_len = byte_idx; | |
12655 | return REG_NOERROR; | |
12656 | } | |
12657 | else | |
12658 | for (src_idx = pstr->valid_raw_len; byte_idx < end_idx;) | |
12659 | { | |
12660 | wchar_t wc; | |
12661 | const char *p; | |
12662 | offsets_needed: | |
12663 | remain_len = end_idx - byte_idx; | |
12664 | prev_st = pstr->cur_state; | |
12665 | if (__builtin_expect (pstr->trans != ((void *)0), 0)) | |
12666 | { | |
12667 | int i, ch; | |
12668 | ||
12669 | for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i) | |
12670 | { | |
12671 | ch = pstr->raw_mbs [pstr->raw_mbs_idx + src_idx + i]; | |
12672 | buf[i] = pstr->trans[ch]; | |
12673 | } | |
12674 | p = (const char *) buf; | |
12675 | } | |
12676 | else | |
12677 | p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx; | |
12678 | mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state); | |
12679 | if (__builtin_expect (mbclen + 2 > 2, 1)) | |
12680 | { | |
12681 | wchar_t wcu = wc; | |
12682 | if (iswlower (wc)) | |
12683 | { | |
12684 | size_t mbcdlen; | |
12685 | ||
12686 | wcu = towupper (wc); | |
12687 | mbcdlen = wcrtomb ((char *) buf, wcu, &prev_st); | |
12688 | if (__builtin_expect (mbclen == mbcdlen, 1)) | |
12689 | memcpy (pstr->mbs + byte_idx, buf, mbclen); | |
12690 | else if (mbcdlen != (size_t) -1) | |
12691 | { | |
12692 | size_t i; | |
12693 | ||
12694 | if (byte_idx + mbcdlen > pstr->bufs_len) | |
12695 | { | |
12696 | pstr->cur_state = prev_st; | |
12697 | break; | |
12698 | } | |
12699 | ||
12700 | if (pstr->offsets == ((void *)0)) | |
12701 | { | |
12702 | pstr->offsets = ((int *) malloc ((pstr->bufs_len) * sizeof (int))); | |
12703 | ||
12704 | if (pstr->offsets == ((void *)0)) | |
12705 | return REG_ESPACE; | |
12706 | } | |
12707 | if (!pstr->offsets_needed) | |
12708 | { | |
12709 | for (i = 0; i < (size_t) byte_idx; ++i) | |
12710 | pstr->offsets[i] = i; | |
12711 | pstr->offsets_needed = 1; | |
12712 | } | |
12713 | ||
12714 | memcpy (pstr->mbs + byte_idx, buf, mbcdlen); | |
12715 | pstr->wcs[byte_idx] = wcu; | |
12716 | pstr->offsets[byte_idx] = src_idx; | |
12717 | for (i = 1; i < mbcdlen; ++i) | |
12718 | { | |
12719 | pstr->offsets[byte_idx + i] | |
12720 | = src_idx + (i < mbclen ? i : mbclen - 1); | |
12721 | pstr->wcs[byte_idx + i] = (0xffffffffu); | |
12722 | } | |
12723 | pstr->len += mbcdlen - mbclen; | |
12724 | if (pstr->raw_stop > src_idx) | |
12725 | pstr->stop += mbcdlen - mbclen; | |
12726 | end_idx = (pstr->bufs_len > pstr->len) | |
12727 | ? pstr->len : pstr->bufs_len; | |
12728 | byte_idx += mbcdlen; | |
12729 | src_idx += mbclen; | |
12730 | continue; | |
12731 | } | |
12732 | else | |
12733 | memcpy (pstr->mbs + byte_idx, p, mbclen); | |
12734 | } | |
12735 | else | |
12736 | memcpy (pstr->mbs + byte_idx, p, mbclen); | |
12737 | ||
12738 | if (__builtin_expect (pstr->offsets_needed != 0, 0)) | |
12739 | { | |
12740 | size_t i; | |
12741 | for (i = 0; i < mbclen; ++i) | |
12742 | pstr->offsets[byte_idx + i] = src_idx + i; | |
12743 | } | |
12744 | src_idx += mbclen; | |
12745 | ||
12746 | pstr->wcs[byte_idx++] = wcu; | |
12747 | ||
12748 | for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;) | |
12749 | pstr->wcs[byte_idx++] = (0xffffffffu); | |
12750 | } | |
12751 | else if (mbclen == (size_t) -1 || mbclen == 0) | |
12752 | { | |
12753 | ||
12754 | int ch = pstr->raw_mbs[pstr->raw_mbs_idx + src_idx]; | |
12755 | ||
12756 | if (__builtin_expect (pstr->trans != ((void *)0), 0)) | |
12757 | ch = pstr->trans [ch]; | |
12758 | pstr->mbs[byte_idx] = ch; | |
12759 | ||
12760 | if (__builtin_expect (pstr->offsets_needed != 0, 0)) | |
12761 | pstr->offsets[byte_idx] = src_idx; | |
12762 | ++src_idx; | |
12763 | ||
12764 | ||
12765 | pstr->wcs[byte_idx++] = (wchar_t) ch; | |
12766 | if (__builtin_expect (mbclen == (size_t) -1, 0)) | |
12767 | pstr->cur_state = prev_st; | |
12768 | } | |
12769 | else | |
12770 | { | |
12771 | ||
12772 | pstr->cur_state = prev_st; | |
12773 | break; | |
12774 | } | |
12775 | } | |
12776 | pstr->valid_len = byte_idx; | |
12777 | pstr->valid_raw_len = src_idx; | |
12778 | return REG_NOERROR; | |
12779 | } | |
12780 | ||
12781 | ||
12782 | ||
12783 | ||
12784 | static int | |
12785 | ||
12786 | re_string_skip_chars (re_string_t *pstr, int new_raw_idx, wint_t *last_wc) | |
12787 | { | |
12788 | mbstate_t prev_st; | |
12789 | int rawbuf_idx; | |
12790 | size_t mbclen; | |
12791 | wchar_t wc = (0xffffffffu); | |
12792 | ||
12793 | ||
12794 | for (rawbuf_idx = pstr->raw_mbs_idx + pstr->valid_raw_len; | |
12795 | rawbuf_idx < new_raw_idx;) | |
12796 | { | |
12797 | int remain_len; | |
12798 | remain_len = pstr->len - rawbuf_idx; | |
12799 | prev_st = pstr->cur_state; | |
12800 | mbclen = mbrtowc (&wc, (const char *) pstr->raw_mbs + rawbuf_idx, | |
12801 | remain_len, &pstr->cur_state); | |
12802 | if (__builtin_expect (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0)) | |
12803 | { | |
12804 | ||
12805 | if (mbclen == 0 || remain_len == 0) | |
12806 | wc = L'\0'; | |
12807 | else | |
12808 | wc = *(unsigned char *) (pstr->raw_mbs + rawbuf_idx); | |
12809 | mbclen = 1; | |
12810 | pstr->cur_state = prev_st; | |
12811 | } | |
12812 | ||
12813 | rawbuf_idx += mbclen; | |
12814 | } | |
12815 | *last_wc = (wint_t) wc; | |
12816 | return rawbuf_idx; | |
12817 | } | |
12818 | ||
12819 | ||
12820 | ||
12821 | ||
12822 | ||
12823 | static void | |
12824 | ||
12825 | build_upper_buffer (re_string_t *pstr) | |
12826 | { | |
12827 | int char_idx, end_idx; | |
12828 | end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len; | |
12829 | ||
12830 | for (char_idx = pstr->valid_len; char_idx < end_idx; ++char_idx) | |
12831 | { | |
12832 | int ch = pstr->raw_mbs[pstr->raw_mbs_idx + char_idx]; | |
12833 | if (__builtin_expect (pstr->trans != ((void *)0), 0)) | |
12834 | ch = pstr->trans[ch]; | |
12835 | if (((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISlower)) | |
12836 | pstr->mbs[char_idx] = (__extension__ ({ int __res; if (sizeof (ch) > 1) { if (__builtin_constant_p (ch)) { int __c = (ch); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper (ch); } else __res = (*__ctype_toupper_loc ())[(int) (ch)]; __res; })); | |
12837 | else | |
12838 | pstr->mbs[char_idx] = ch; | |
12839 | } | |
12840 | pstr->valid_len = char_idx; | |
12841 | pstr->valid_raw_len = char_idx; | |
12842 | } | |
12843 | ||
12844 | ||
12845 | ||
12846 | static void | |
12847 | ||
12848 | re_string_translate_buffer (re_string_t *pstr) | |
12849 | { | |
12850 | int buf_idx, end_idx; | |
12851 | end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len; | |
12852 | ||
12853 | for (buf_idx = pstr->valid_len; buf_idx < end_idx; ++buf_idx) | |
12854 | { | |
12855 | int ch = pstr->raw_mbs[pstr->raw_mbs_idx + buf_idx]; | |
12856 | pstr->mbs[buf_idx] = pstr->trans[ch]; | |
12857 | } | |
12858 | ||
12859 | pstr->valid_len = buf_idx; | |
12860 | pstr->valid_raw_len = buf_idx; | |
12861 | } | |
12862 | ||
12863 | ||
12864 | ||
12865 | ||
12866 | ||
12867 | static reg_errcode_t | |
12868 | ||
12869 | re_string_reconstruct (re_string_t *pstr, int idx, int eflags) | |
12870 | { | |
12871 | int offset = idx - pstr->raw_mbs_idx; | |
12872 | if (__builtin_expect (offset < 0, 0)) | |
12873 | { | |
12874 | ||
12875 | ||
12876 | if (pstr->mb_cur_max > 1) | |
12877 | memset (&pstr->cur_state, '\0', sizeof (mbstate_t)); | |
12878 | ||
12879 | pstr->len = pstr->raw_len; | |
12880 | pstr->stop = pstr->raw_stop; | |
12881 | pstr->valid_len = 0; | |
12882 | pstr->raw_mbs_idx = 0; | |
12883 | pstr->valid_raw_len = 0; | |
12884 | pstr->offsets_needed = 0; | |
12885 | pstr->tip_context = ((eflags & 1) ? ((1 << 1) << 1) | |
12886 | : (1 << 1) | ((1 << 1) << 1)); | |
12887 | if (!pstr->mbs_allocated) | |
12888 | pstr->mbs = (unsigned char *) pstr->raw_mbs; | |
12889 | offset = idx; | |
12890 | } | |
12891 | ||
12892 | if (__builtin_expect (offset != 0, 1)) | |
12893 | { | |
12894 | ||
12895 | if (__builtin_expect (offset < pstr->valid_raw_len, 1)) | |
12896 | { | |
12897 | ||
12898 | ||
12899 | if (__builtin_expect (pstr->offsets_needed, 0)) | |
12900 | { | |
12901 | int low = 0, high = pstr->valid_len, mid; | |
12902 | do | |
12903 | { | |
12904 | mid = (high + low) / 2; | |
12905 | if (pstr->offsets[mid] > offset) | |
12906 | high = mid; | |
12907 | else if (pstr->offsets[mid] < offset) | |
12908 | low = mid + 1; | |
12909 | else | |
12910 | break; | |
12911 | } | |
12912 | while (low < high); | |
12913 | if (pstr->offsets[mid] < offset) | |
12914 | ++mid; | |
12915 | pstr->tip_context = re_string_context_at (pstr, mid - 1, | |
12916 | eflags); | |
12917 | ||
12918 | ||
12919 | ||
12920 | ||
12921 | if (pstr->valid_len > offset | |
12922 | && mid == offset && pstr->offsets[mid] == offset) | |
12923 | { | |
12924 | memmove (pstr->wcs, pstr->wcs + offset, | |
12925 | (pstr->valid_len - offset) * sizeof (wint_t)); | |
12926 | memmove (pstr->mbs, pstr->mbs + offset, pstr->valid_len - offset); | |
12927 | pstr->valid_len -= offset; | |
12928 | pstr->valid_raw_len -= offset; | |
12929 | for (low = 0; low < pstr->valid_len; low++) | |
12930 | pstr->offsets[low] = pstr->offsets[low + offset] - offset; | |
12931 | } | |
12932 | else | |
12933 | { | |
12934 | ||
12935 | ||
12936 | pstr->len = pstr->raw_len - idx + offset; | |
12937 | pstr->stop = pstr->raw_stop - idx + offset; | |
12938 | pstr->offsets_needed = 0; | |
12939 | while (mid > 0 && pstr->offsets[mid - 1] == offset) | |
12940 | --mid; | |
12941 | while (mid < pstr->valid_len) | |
12942 | if (pstr->wcs[mid] != (0xffffffffu)) | |
12943 | break; | |
12944 | else | |
12945 | ++mid; | |
12946 | if (mid == pstr->valid_len) | |
12947 | pstr->valid_len = 0; | |
12948 | else | |
12949 | { | |
12950 | pstr->valid_len = pstr->offsets[mid] - offset; | |
12951 | if (pstr->valid_len) | |
12952 | { | |
12953 | for (low = 0; low < pstr->valid_len; ++low) | |
12954 | pstr->wcs[low] = (0xffffffffu); | |
12955 | memset (pstr->mbs, 255, pstr->valid_len); | |
12956 | } | |
12957 | } | |
12958 | pstr->valid_raw_len = pstr->valid_len; | |
12959 | } | |
12960 | } | |
12961 | else | |
12962 | ||
12963 | { | |
12964 | pstr->tip_context = re_string_context_at (pstr, offset - 1, | |
12965 | eflags); | |
12966 | ||
12967 | if (pstr->mb_cur_max > 1) | |
12968 | memmove (pstr->wcs, pstr->wcs + offset, | |
12969 | (pstr->valid_len - offset) * sizeof (wint_t)); | |
12970 | ||
12971 | if (__builtin_expect (pstr->mbs_allocated, 0)) | |
12972 | memmove (pstr->mbs, pstr->mbs + offset, | |
12973 | pstr->valid_len - offset); | |
12974 | pstr->valid_len -= offset; | |
12975 | pstr->valid_raw_len -= offset; | |
12976 | ||
12977 | ||
12978 | ||
12979 | } | |
12980 | } | |
12981 | else | |
12982 | { | |
12983 | ||
12984 | int prev_valid_len = pstr->valid_len; | |
12985 | ||
12986 | ||
12987 | if (__builtin_expect (pstr->offsets_needed, 0)) | |
12988 | { | |
12989 | pstr->len = pstr->raw_len - idx + offset; | |
12990 | pstr->stop = pstr->raw_stop - idx + offset; | |
12991 | pstr->offsets_needed = 0; | |
12992 | } | |
12993 | ||
12994 | pstr->valid_len = 0; | |
12995 | ||
12996 | if (pstr->mb_cur_max > 1) | |
12997 | { | |
12998 | int wcs_idx; | |
12999 | wint_t wc = (0xffffffffu); | |
13000 | ||
13001 | if (pstr->is_utf8) | |
13002 | { | |
13003 | const unsigned char *raw, *p, *q, *end; | |
13004 | ||
13005 | ||
13006 | ||
13007 | raw = pstr->raw_mbs + pstr->raw_mbs_idx; | |
13008 | end = raw + (offset - pstr->mb_cur_max); | |
13009 | if (end < pstr->raw_mbs) | |
13010 | end = pstr->raw_mbs; | |
13011 | p = raw + offset - 1; | |
13012 | ||
13013 | ||
13014 | ||
13015 | if ((((*p) & ~0x7f) == 0) && __builtin_expect (pstr->trans == ((void *)0), 1)) | |
13016 | { | |
13017 | memset (&pstr->cur_state, '\0', sizeof (mbstate_t)); | |
13018 | ||
13019 | wc = (wchar_t) *p; | |
13020 | } | |
13021 | else | |
13022 | ||
13023 | for (; p >= end; --p) | |
13024 | if ((*p & 0xc0) != 0x80) | |
13025 | { | |
13026 | mbstate_t cur_state; | |
13027 | wchar_t wc2; | |
13028 | int mlen = raw + pstr->len - p; | |
13029 | unsigned char buf[6]; | |
13030 | size_t mbclen; | |
13031 | ||
13032 | q = p; | |
13033 | if (__builtin_expect (pstr->trans != ((void *)0), 0)) | |
13034 | { | |
13035 | int i = mlen < 6 ? mlen : 6; | |
13036 | while (--i >= 0) | |
13037 | buf[i] = pstr->trans[p[i]]; | |
13038 | q = buf; | |
13039 | } | |
13040 | ||
13041 | ||
13042 | memset (&cur_state, 0, sizeof (cur_state)); | |
13043 | mbclen = mbrtowc (&wc2, (const char *) p, mlen, | |
13044 | &cur_state); | |
13045 | if (raw + offset - p <= mbclen | |
13046 | && mbclen < (size_t) -2) | |
13047 | { | |
13048 | memset (&pstr->cur_state, '\0', | |
13049 | sizeof (mbstate_t)); | |
13050 | pstr->valid_len = mbclen - (raw + offset - p); | |
13051 | wc = wc2; | |
13052 | } | |
13053 | break; | |
13054 | } | |
13055 | } | |
13056 | ||
13057 | if (wc == (0xffffffffu)) | |
13058 | pstr->valid_len = re_string_skip_chars (pstr, idx, &wc) - idx; | |
13059 | if (wc == (0xffffffffu)) | |
13060 | pstr->tip_context | |
13061 | = re_string_context_at (pstr, prev_valid_len - 1, eflags); | |
13062 | else | |
13063 | pstr->tip_context = ((__builtin_expect (pstr->word_ops_used != 0, 0) | |
13064 | && (iswalnum (wc) || (wc) == L'_')) | |
13065 | ? 1 | |
13066 | : ((((wc) == L'\n') | |
13067 | && pstr->newline_anchor) | |
13068 | ? (1 << 1) : 0)); | |
13069 | if (__builtin_expect (pstr->valid_len, 0)) | |
13070 | { | |
13071 | for (wcs_idx = 0; wcs_idx < pstr->valid_len; ++wcs_idx) | |
13072 | pstr->wcs[wcs_idx] = (0xffffffffu); | |
13073 | if (pstr->mbs_allocated) | |
13074 | memset (pstr->mbs, 255, pstr->valid_len); | |
13075 | } | |
13076 | pstr->valid_raw_len = pstr->valid_len; | |
13077 | } | |
13078 | else | |
13079 | ||
13080 | { | |
13081 | int c = pstr->raw_mbs[pstr->raw_mbs_idx + offset - 1]; | |
13082 | pstr->valid_raw_len = 0; | |
13083 | if (pstr->trans) | |
13084 | c = pstr->trans[c]; | |
13085 | pstr->tip_context = ((pstr->word_char[c / (sizeof (bitset_word_t) * 8)] & ((bitset_word_t) 1 << c % (sizeof (bitset_word_t) * 8))) | |
13086 | ? 1 | |
13087 | : ((((c) == '\n') && pstr->newline_anchor) | |
13088 | ? (1 << 1) : 0)); | |
13089 | } | |
13090 | } | |
13091 | if (!__builtin_expect (pstr->mbs_allocated, 0)) | |
13092 | pstr->mbs += offset; | |
13093 | } | |
13094 | pstr->raw_mbs_idx = idx; | |
13095 | pstr->len -= offset; | |
13096 | pstr->stop -= offset; | |
13097 | ||
13098 | ||
13099 | ||
13100 | if (pstr->mb_cur_max > 1) | |
13101 | { | |
13102 | if (pstr->icase) | |
13103 | { | |
13104 | reg_errcode_t ret = build_wcs_upper_buffer (pstr); | |
13105 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
13106 | return ret; | |
13107 | } | |
13108 | else | |
13109 | build_wcs_buffer (pstr); | |
13110 | } | |
13111 | else | |
13112 | ||
13113 | if (__builtin_expect (pstr->mbs_allocated, 0)) | |
13114 | { | |
13115 | if (pstr->icase) | |
13116 | build_upper_buffer (pstr); | |
13117 | else if (pstr->trans != ((void *)0)) | |
13118 | re_string_translate_buffer (pstr); | |
13119 | } | |
13120 | else | |
13121 | pstr->valid_len = pstr->len; | |
13122 | ||
13123 | pstr->cur_idx = 0; | |
13124 | return REG_NOERROR; | |
13125 | } | |
13126 | ||
13127 | static unsigned char | |
13128 | __attribute__ ((pure)) | |
13129 | re_string_peek_byte_case (const re_string_t *pstr, int idx) | |
13130 | { | |
13131 | int ch, off; | |
13132 | ||
13133 | ||
13134 | if (__builtin_expect (!pstr->mbs_allocated, 1)) | |
13135 | return ((pstr)->mbs[(pstr)->cur_idx + idx]); | |
13136 | ||
13137 | ||
13138 | if (pstr->mb_cur_max > 1 | |
13139 | && ! ((pstr)->wcs[pstr->cur_idx + idx] != (0xffffffffu) && ((pstr)->valid_len == (pstr->cur_idx + idx) + 1 || (pstr)->wcs[(pstr->cur_idx + idx) + 1] != (0xffffffffu)))) | |
13140 | return ((pstr)->mbs[(pstr)->cur_idx + idx]); | |
13141 | ||
13142 | ||
13143 | off = pstr->cur_idx + idx; | |
13144 | ||
13145 | if (pstr->offsets_needed) | |
13146 | off = pstr->offsets[off]; | |
13147 | ||
13148 | ||
13149 | ch = pstr->raw_mbs[pstr->raw_mbs_idx + off]; | |
13150 | ||
13151 | ||
13152 | ||
13153 | ||
13154 | ||
13155 | ||
13156 | if (pstr->offsets_needed && !(((ch) & ~0x7f) == 0)) | |
13157 | return ((pstr)->mbs[(pstr)->cur_idx + idx]); | |
13158 | ||
13159 | ||
13160 | return ch; | |
13161 | } | |
13162 | ||
13163 | static unsigned char | |
13164 | __attribute__ ((pure)) | |
13165 | re_string_fetch_byte_case (re_string_t *pstr) | |
13166 | { | |
13167 | if (__builtin_expect (!pstr->mbs_allocated, 1)) | |
13168 | return ((pstr)->mbs[(pstr)->cur_idx++]); | |
13169 | ||
13170 | ||
13171 | if (pstr->offsets_needed) | |
13172 | { | |
13173 | int off, ch; | |
13174 | # 876 "regex_internal.c" | |
13175 | if (!((pstr->cur_idx) == (pstr)->valid_len || (pstr)->wcs[pstr->cur_idx] != (0xffffffffu))) | |
13176 | return ((pstr)->mbs[(pstr)->cur_idx++]); | |
13177 | ||
13178 | off = pstr->offsets[pstr->cur_idx]; | |
13179 | ch = pstr->raw_mbs[pstr->raw_mbs_idx + off]; | |
13180 | ||
13181 | if (! (((ch) & ~0x7f) == 0)) | |
13182 | return ((pstr)->mbs[(pstr)->cur_idx++]); | |
13183 | ||
13184 | ((pstr)->cur_idx += (re_string_char_size_at (pstr, pstr->cur_idx))); | |
13185 | ||
13186 | return ch; | |
13187 | } | |
13188 | ||
13189 | ||
13190 | return pstr->raw_mbs[pstr->raw_mbs_idx + pstr->cur_idx++]; | |
13191 | } | |
13192 | ||
13193 | static void | |
13194 | ||
13195 | re_string_destruct (re_string_t *pstr) | |
13196 | { | |
13197 | ||
13198 | free (pstr->wcs); | |
13199 | free (pstr->offsets); | |
13200 | ||
13201 | if (pstr->mbs_allocated) | |
13202 | free (pstr->mbs); | |
13203 | } | |
13204 | ||
13205 | ||
13206 | ||
13207 | static unsigned int | |
13208 | ||
13209 | re_string_context_at (const re_string_t *input, int idx, int eflags) | |
13210 | { | |
13211 | int c; | |
13212 | if (__builtin_expect (idx < 0, 0)) | |
13213 | ||
13214 | ||
13215 | return input->tip_context; | |
13216 | if (__builtin_expect (idx == input->len, 0)) | |
13217 | return ((eflags & (1 << 1)) ? (((1 << 1) << 1) << 1) | |
13218 | : (1 << 1) | (((1 << 1) << 1) << 1)); | |
13219 | ||
13220 | if (input->mb_cur_max > 1) | |
13221 | { | |
13222 | wint_t wc; | |
13223 | int wc_idx = idx; | |
13224 | while(input->wcs[wc_idx] == (0xffffffffu)) | |
13225 | { | |
13226 | ||
13227 | ||
13228 | ||
13229 | ||
13230 | --wc_idx; | |
13231 | if (wc_idx < 0) | |
13232 | return input->tip_context; | |
13233 | } | |
13234 | wc = input->wcs[wc_idx]; | |
13235 | if (__builtin_expect (input->word_ops_used != 0, 0) && (iswalnum (wc) || (wc) == L'_')) | |
13236 | return 1; | |
13237 | return (((wc) == L'\n') && input->newline_anchor | |
13238 | ? (1 << 1) : 0); | |
13239 | } | |
13240 | else | |
13241 | ||
13242 | { | |
13243 | c = ((input)->mbs[idx]); | |
13244 | if ((input->word_char[c / (sizeof (bitset_word_t) * 8)] & ((bitset_word_t) 1 << c % (sizeof (bitset_word_t) * 8)))) | |
13245 | return 1; | |
13246 | return ((c) == '\n') && input->newline_anchor ? (1 << 1) : 0; | |
13247 | } | |
13248 | } | |
13249 | ||
13250 | ||
13251 | ||
13252 | static reg_errcode_t | |
13253 | ||
13254 | re_node_set_alloc (re_node_set *set, int size) | |
13255 | { | |
13256 | set->alloc = size; | |
13257 | set->nelem = 0; | |
13258 | set->elems = ((int *) malloc ((size) * sizeof (int))); | |
13259 | if (__builtin_expect (set->elems == ((void *)0), 0)) | |
13260 | return REG_ESPACE; | |
13261 | return REG_NOERROR; | |
13262 | } | |
13263 | ||
13264 | static reg_errcode_t | |
13265 | ||
13266 | re_node_set_init_1 (re_node_set *set, int elem) | |
13267 | { | |
13268 | set->alloc = 1; | |
13269 | set->nelem = 1; | |
13270 | set->elems = ((int *) malloc ((1) * sizeof (int))); | |
13271 | if (__builtin_expect (set->elems == ((void *)0), 0)) | |
13272 | { | |
13273 | set->alloc = set->nelem = 0; | |
13274 | return REG_ESPACE; | |
13275 | } | |
13276 | set->elems[0] = elem; | |
13277 | return REG_NOERROR; | |
13278 | } | |
13279 | ||
13280 | static reg_errcode_t | |
13281 | ||
13282 | re_node_set_init_2 (re_node_set *set, int elem1, int elem2) | |
13283 | { | |
13284 | set->alloc = 2; | |
13285 | set->elems = ((int *) malloc ((2) * sizeof (int))); | |
13286 | if (__builtin_expect (set->elems == ((void *)0), 0)) | |
13287 | return REG_ESPACE; | |
13288 | if (elem1 == elem2) | |
13289 | { | |
13290 | set->nelem = 1; | |
13291 | set->elems[0] = elem1; | |
13292 | } | |
13293 | else | |
13294 | { | |
13295 | set->nelem = 2; | |
13296 | if (elem1 < elem2) | |
13297 | { | |
13298 | set->elems[0] = elem1; | |
13299 | set->elems[1] = elem2; | |
13300 | } | |
13301 | else | |
13302 | { | |
13303 | set->elems[0] = elem2; | |
13304 | set->elems[1] = elem1; | |
13305 | } | |
13306 | } | |
13307 | return REG_NOERROR; | |
13308 | } | |
13309 | ||
13310 | static reg_errcode_t | |
13311 | ||
13312 | re_node_set_init_copy (re_node_set *dest, const re_node_set *src) | |
13313 | { | |
13314 | dest->nelem = src->nelem; | |
13315 | if (src->nelem > 0) | |
13316 | { | |
13317 | dest->alloc = dest->nelem; | |
13318 | dest->elems = ((int *) malloc ((dest->alloc) * sizeof (int))); | |
13319 | if (__builtin_expect (dest->elems == ((void *)0), 0)) | |
13320 | { | |
13321 | dest->alloc = dest->nelem = 0; | |
13322 | return REG_ESPACE; | |
13323 | } | |
13324 | memcpy (dest->elems, src->elems, src->nelem * sizeof (int)); | |
13325 | } | |
13326 | else | |
13327 | memset (dest, '\0', sizeof (re_node_set)); | |
13328 | return REG_NOERROR; | |
13329 | } | |
13330 | ||
13331 | ||
13332 | ||
13333 | ||
13334 | ||
13335 | static reg_errcode_t | |
13336 | ||
13337 | re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1, | |
13338 | const re_node_set *src2) | |
13339 | { | |
13340 | int i1, i2, is, id, delta, sbase; | |
13341 | if (src1->nelem == 0 || src2->nelem == 0) | |
13342 | return REG_NOERROR; | |
13343 | ||
13344 | ||
13345 | ||
13346 | if (src1->nelem + src2->nelem + dest->nelem > dest->alloc) | |
13347 | { | |
13348 | int new_alloc = src1->nelem + src2->nelem + dest->alloc; | |
13349 | int *new_elems = ((int *) realloc (dest->elems, (new_alloc) * sizeof (int))); | |
13350 | if (__builtin_expect (new_elems == ((void *)0), 0)) | |
13351 | return REG_ESPACE; | |
13352 | dest->elems = new_elems; | |
13353 | dest->alloc = new_alloc; | |
13354 | } | |
13355 | ||
13356 | ||
13357 | ||
13358 | sbase = dest->nelem + src1->nelem + src2->nelem; | |
13359 | i1 = src1->nelem - 1; | |
13360 | i2 = src2->nelem - 1; | |
13361 | id = dest->nelem - 1; | |
13362 | for (;;) | |
13363 | { | |
13364 | if (src1->elems[i1] == src2->elems[i2]) | |
13365 | { | |
13366 | ||
13367 | while (id >= 0 && dest->elems[id] > src1->elems[i1]) | |
13368 | --id; | |
13369 | ||
13370 | if (id < 0 || dest->elems[id] != src1->elems[i1]) | |
13371 | dest->elems[--sbase] = src1->elems[i1]; | |
13372 | ||
13373 | if (--i1 < 0 || --i2 < 0) | |
13374 | break; | |
13375 | } | |
13376 | ||
13377 | ||
13378 | else if (src1->elems[i1] < src2->elems[i2]) | |
13379 | { | |
13380 | if (--i2 < 0) | |
13381 | break; | |
13382 | } | |
13383 | else | |
13384 | { | |
13385 | if (--i1 < 0) | |
13386 | break; | |
13387 | } | |
13388 | } | |
13389 | ||
13390 | id = dest->nelem - 1; | |
13391 | is = dest->nelem + src1->nelem + src2->nelem - 1; | |
13392 | delta = is - sbase + 1; | |
13393 | ||
13394 | ||
13395 | ||
13396 | ||
13397 | dest->nelem += delta; | |
13398 | if (delta > 0 && id >= 0) | |
13399 | for (;;) | |
13400 | { | |
13401 | if (dest->elems[is] > dest->elems[id]) | |
13402 | { | |
13403 | ||
13404 | dest->elems[id + delta--] = dest->elems[is--]; | |
13405 | if (delta == 0) | |
13406 | break; | |
13407 | } | |
13408 | else | |
13409 | { | |
13410 | ||
13411 | dest->elems[id + delta] = dest->elems[id]; | |
13412 | if (--id < 0) | |
13413 | break; | |
13414 | } | |
13415 | } | |
13416 | ||
13417 | ||
13418 | memcpy (dest->elems, dest->elems + sbase, delta * sizeof (int)); | |
13419 | ||
13420 | return REG_NOERROR; | |
13421 | } | |
13422 | ||
13423 | ||
13424 | ||
13425 | ||
13426 | static reg_errcode_t | |
13427 | ||
13428 | re_node_set_init_union (re_node_set *dest, const re_node_set *src1, | |
13429 | const re_node_set *src2) | |
13430 | { | |
13431 | int i1, i2, id; | |
13432 | if (src1 != ((void *)0) && src1->nelem > 0 && src2 != ((void *)0) && src2->nelem > 0) | |
13433 | { | |
13434 | dest->alloc = src1->nelem + src2->nelem; | |
13435 | dest->elems = ((int *) malloc ((dest->alloc) * sizeof (int))); | |
13436 | if (__builtin_expect (dest->elems == ((void *)0), 0)) | |
13437 | return REG_ESPACE; | |
13438 | } | |
13439 | else | |
13440 | { | |
13441 | if (src1 != ((void *)0) && src1->nelem > 0) | |
13442 | return re_node_set_init_copy (dest, src1); | |
13443 | else if (src2 != ((void *)0) && src2->nelem > 0) | |
13444 | return re_node_set_init_copy (dest, src2); | |
13445 | else | |
13446 | memset (dest, '\0', sizeof (re_node_set)); | |
13447 | return REG_NOERROR; | |
13448 | } | |
13449 | for (i1 = i2 = id = 0 ; i1 < src1->nelem && i2 < src2->nelem ;) | |
13450 | { | |
13451 | if (src1->elems[i1] > src2->elems[i2]) | |
13452 | { | |
13453 | dest->elems[id++] = src2->elems[i2++]; | |
13454 | continue; | |
13455 | } | |
13456 | if (src1->elems[i1] == src2->elems[i2]) | |
13457 | ++i2; | |
13458 | dest->elems[id++] = src1->elems[i1++]; | |
13459 | } | |
13460 | if (i1 < src1->nelem) | |
13461 | { | |
13462 | memcpy (dest->elems + id, src1->elems + i1, | |
13463 | (src1->nelem - i1) * sizeof (int)); | |
13464 | id += src1->nelem - i1; | |
13465 | } | |
13466 | else if (i2 < src2->nelem) | |
13467 | { | |
13468 | memcpy (dest->elems + id, src2->elems + i2, | |
13469 | (src2->nelem - i2) * sizeof (int)); | |
13470 | id += src2->nelem - i2; | |
13471 | } | |
13472 | dest->nelem = id; | |
13473 | return REG_NOERROR; | |
13474 | } | |
13475 | ||
13476 | ||
13477 | ||
13478 | ||
13479 | static reg_errcode_t | |
13480 | ||
13481 | re_node_set_merge (re_node_set *dest, const re_node_set *src) | |
13482 | { | |
13483 | int is, id, sbase, delta; | |
13484 | if (src == ((void *)0) || src->nelem == 0) | |
13485 | return REG_NOERROR; | |
13486 | if (dest->alloc < 2 * src->nelem + dest->nelem) | |
13487 | { | |
13488 | int new_alloc = 2 * (src->nelem + dest->alloc); | |
13489 | int *new_buffer = ((int *) realloc (dest->elems, (new_alloc) * sizeof (int))); | |
13490 | if (__builtin_expect (new_buffer == ((void *)0), 0)) | |
13491 | return REG_ESPACE; | |
13492 | dest->elems = new_buffer; | |
13493 | dest->alloc = new_alloc; | |
13494 | } | |
13495 | ||
13496 | if (__builtin_expect (dest->nelem == 0, 0)) | |
13497 | { | |
13498 | dest->nelem = src->nelem; | |
13499 | memcpy (dest->elems, src->elems, src->nelem * sizeof (int)); | |
13500 | return REG_NOERROR; | |
13501 | } | |
13502 | ||
13503 | ||
13504 | ||
13505 | for (sbase = dest->nelem + 2 * src->nelem, | |
13506 | is = src->nelem - 1, id = dest->nelem - 1; is >= 0 && id >= 0; ) | |
13507 | { | |
13508 | if (dest->elems[id] == src->elems[is]) | |
13509 | is--, id--; | |
13510 | else if (dest->elems[id] < src->elems[is]) | |
13511 | dest->elems[--sbase] = src->elems[is--]; | |
13512 | else | |
13513 | --id; | |
13514 | } | |
13515 | ||
13516 | if (is >= 0) | |
13517 | { | |
13518 | ||
13519 | sbase -= is + 1; | |
13520 | memcpy (dest->elems + sbase, src->elems, (is + 1) * sizeof (int)); | |
13521 | } | |
13522 | ||
13523 | id = dest->nelem - 1; | |
13524 | is = dest->nelem + 2 * src->nelem - 1; | |
13525 | delta = is - sbase + 1; | |
13526 | if (delta == 0) | |
13527 | return REG_NOERROR; | |
13528 | ||
13529 | ||
13530 | ||
13531 | dest->nelem += delta; | |
13532 | for (;;) | |
13533 | { | |
13534 | if (dest->elems[is] > dest->elems[id]) | |
13535 | { | |
13536 | ||
13537 | dest->elems[id + delta--] = dest->elems[is--]; | |
13538 | if (delta == 0) | |
13539 | break; | |
13540 | } | |
13541 | else | |
13542 | { | |
13543 | ||
13544 | dest->elems[id + delta] = dest->elems[id]; | |
13545 | if (--id < 0) | |
13546 | { | |
13547 | ||
13548 | memcpy (dest->elems, dest->elems + sbase, | |
13549 | delta * sizeof (int)); | |
13550 | break; | |
13551 | } | |
13552 | } | |
13553 | } | |
13554 | ||
13555 | return REG_NOERROR; | |
13556 | } | |
13557 | ||
13558 | ||
13559 | ||
13560 | ||
13561 | ||
13562 | static int | |
13563 | ||
13564 | re_node_set_insert (re_node_set *set, int elem) | |
13565 | { | |
13566 | int idx; | |
13567 | ||
13568 | if (set->alloc == 0) | |
13569 | { | |
13570 | if (__builtin_expect (re_node_set_init_1 (set, elem) == REG_NOERROR, 1)) | |
13571 | return 1; | |
13572 | else | |
13573 | return -1; | |
13574 | } | |
13575 | ||
13576 | if (__builtin_expect (set->nelem, 0) == 0) | |
13577 | { | |
13578 | ||
13579 | set->elems[0] = elem; | |
13580 | ++set->nelem; | |
13581 | return 1; | |
13582 | } | |
13583 | ||
13584 | ||
13585 | if (set->alloc == set->nelem) | |
13586 | { | |
13587 | int *new_elems; | |
13588 | set->alloc = set->alloc * 2; | |
13589 | new_elems = ((int *) realloc (set->elems, (set->alloc) * sizeof (int))); | |
13590 | if (__builtin_expect (new_elems == ((void *)0), 0)) | |
13591 | return -1; | |
13592 | set->elems = new_elems; | |
13593 | } | |
13594 | ||
13595 | ||
13596 | ||
13597 | if (elem < set->elems[0]) | |
13598 | { | |
13599 | idx = 0; | |
13600 | for (idx = set->nelem; idx > 0; idx--) | |
13601 | set->elems[idx] = set->elems[idx - 1]; | |
13602 | } | |
13603 | else | |
13604 | { | |
13605 | for (idx = set->nelem; set->elems[idx - 1] > elem; idx--) | |
13606 | set->elems[idx] = set->elems[idx - 1]; | |
13607 | } | |
13608 | ||
13609 | ||
13610 | set->elems[idx] = elem; | |
13611 | ++set->nelem; | |
13612 | return 1; | |
13613 | } | |
13614 | ||
13615 | ||
13616 | ||
13617 | ||
13618 | ||
13619 | static int | |
13620 | ||
13621 | re_node_set_insert_last (re_node_set *set, int elem) | |
13622 | { | |
13623 | ||
13624 | if (set->alloc == set->nelem) | |
13625 | { | |
13626 | int *new_elems; | |
13627 | set->alloc = (set->alloc + 1) * 2; | |
13628 | new_elems = ((int *) realloc (set->elems, (set->alloc) * sizeof (int))); | |
13629 | if (__builtin_expect (new_elems == ((void *)0), 0)) | |
13630 | return -1; | |
13631 | set->elems = new_elems; | |
13632 | } | |
13633 | ||
13634 | ||
13635 | set->elems[set->nelem++] = elem; | |
13636 | return 1; | |
13637 | } | |
13638 | ||
13639 | ||
13640 | ||
13641 | ||
13642 | static int | |
13643 | __attribute__ ((pure)) | |
13644 | re_node_set_compare (const re_node_set *set1, const re_node_set *set2) | |
13645 | { | |
13646 | int i; | |
13647 | if (set1 == ((void *)0) || set2 == ((void *)0) || set1->nelem != set2->nelem) | |
13648 | return 0; | |
13649 | for (i = set1->nelem ; --i >= 0 ; ) | |
13650 | if (set1->elems[i] != set2->elems[i]) | |
13651 | return 0; | |
13652 | return 1; | |
13653 | } | |
13654 | ||
13655 | ||
13656 | ||
13657 | static int | |
13658 | __attribute__ ((pure)) | |
13659 | re_node_set_contains (const re_node_set *set, int elem) | |
13660 | { | |
13661 | unsigned int idx, right, mid; | |
13662 | if (set->nelem <= 0) | |
13663 | return 0; | |
13664 | ||
13665 | ||
13666 | idx = 0; | |
13667 | right = set->nelem - 1; | |
13668 | while (idx < right) | |
13669 | { | |
13670 | mid = (idx + right) / 2; | |
13671 | if (set->elems[mid] < elem) | |
13672 | idx = mid + 1; | |
13673 | else | |
13674 | right = mid; | |
13675 | } | |
13676 | return set->elems[idx] == elem ? idx + 1 : 0; | |
13677 | } | |
13678 | ||
13679 | static void | |
13680 | ||
13681 | re_node_set_remove_at (re_node_set *set, int idx) | |
13682 | { | |
13683 | if (idx < 0 || idx >= set->nelem) | |
13684 | return; | |
13685 | --set->nelem; | |
13686 | for (; idx < set->nelem; idx++) | |
13687 | set->elems[idx] = set->elems[idx + 1]; | |
13688 | } | |
13689 | ||
13690 | ||
13691 | ||
13692 | ||
13693 | ||
13694 | static int | |
13695 | ||
13696 | re_dfa_add_node (re_dfa_t *dfa, re_token_t token) | |
13697 | { | |
13698 | int type = token.type; | |
13699 | if (__builtin_expect (dfa->nodes_len >= dfa->nodes_alloc, 0)) | |
13700 | { | |
13701 | size_t new_nodes_alloc = dfa->nodes_alloc * 2; | |
13702 | int *new_nexts, *new_indices; | |
13703 | re_node_set *new_edests, *new_eclosures; | |
13704 | re_token_t *new_nodes; | |
13705 | ||
13706 | ||
13707 | if (__builtin_expect (new_nodes_alloc < dfa->nodes_alloc, 0)) | |
13708 | return -1; | |
13709 | ||
13710 | new_nodes = ((re_token_t *) realloc (dfa->nodes, (new_nodes_alloc) * sizeof (re_token_t))); | |
13711 | if (__builtin_expect (new_nodes == ((void *)0), 0)) | |
13712 | return -1; | |
13713 | dfa->nodes = new_nodes; | |
13714 | new_nexts = ((int *) realloc (dfa->nexts, (new_nodes_alloc) * sizeof (int))); | |
13715 | new_indices = ((int *) realloc (dfa->org_indices, (new_nodes_alloc) * sizeof (int))); | |
13716 | new_edests = ((re_node_set *) realloc (dfa->edests, (new_nodes_alloc) * sizeof (re_node_set))); | |
13717 | new_eclosures = ((re_node_set *) realloc (dfa->eclosures, (new_nodes_alloc) * sizeof (re_node_set))); | |
13718 | if (__builtin_expect (new_nexts == ((void *)0) || new_indices == ((void *)0) || new_edests == ((void *)0) || new_eclosures == ((void *)0), 0)) | |
13719 | ||
13720 | return -1; | |
13721 | dfa->nexts = new_nexts; | |
13722 | dfa->org_indices = new_indices; | |
13723 | dfa->edests = new_edests; | |
13724 | dfa->eclosures = new_eclosures; | |
13725 | dfa->nodes_alloc = new_nodes_alloc; | |
13726 | } | |
13727 | dfa->nodes[dfa->nodes_len] = token; | |
13728 | dfa->nodes[dfa->nodes_len].constraint = 0; | |
13729 | ||
13730 | dfa->nodes[dfa->nodes_len].accept_mb = | |
13731 | (type == OP_PERIOD && dfa->mb_cur_max > 1) || type == COMPLEX_BRACKET; | |
13732 | ||
13733 | dfa->nexts[dfa->nodes_len] = -1; | |
13734 | memset (dfa->edests + dfa->nodes_len, '\0', sizeof (re_node_set)); | |
13735 | memset (dfa->eclosures + dfa->nodes_len, '\0', sizeof (re_node_set)); | |
13736 | return dfa->nodes_len++; | |
13737 | } | |
13738 | ||
13739 | static inline unsigned int | |
13740 | ||
13741 | calc_state_hash (const re_node_set *nodes, unsigned int context) | |
13742 | { | |
13743 | unsigned int hash = nodes->nelem + context; | |
13744 | int i; | |
13745 | for (i = 0 ; i < nodes->nelem ; i++) | |
13746 | hash += nodes->elems[i]; | |
13747 | return hash; | |
13748 | } | |
13749 | # 1460 "regex_internal.c" | |
13750 | static re_dfastate_t * | |
13751 | ||
13752 | re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa, | |
13753 | const re_node_set *nodes) | |
13754 | { | |
13755 | unsigned int hash; | |
13756 | re_dfastate_t *new_state; | |
13757 | struct re_state_table_entry *spot; | |
13758 | int i; | |
13759 | if (__builtin_expect (nodes->nelem == 0, 0)) | |
13760 | { | |
13761 | *err = REG_NOERROR; | |
13762 | return ((void *)0); | |
13763 | } | |
13764 | hash = calc_state_hash (nodes, 0); | |
13765 | spot = dfa->state_table + (hash & dfa->state_hash_mask); | |
13766 | ||
13767 | for (i = 0 ; i < spot->num ; i++) | |
13768 | { | |
13769 | re_dfastate_t *state = spot->array[i]; | |
13770 | if (hash != state->hash) | |
13771 | continue; | |
13772 | if (re_node_set_compare (&state->nodes, nodes)) | |
13773 | return state; | |
13774 | } | |
13775 | ||
13776 | ||
13777 | new_state = create_ci_newstate (dfa, nodes, hash); | |
13778 | if (__builtin_expect (new_state == ((void *)0), 0)) | |
13779 | *err = REG_ESPACE; | |
13780 | ||
13781 | return new_state; | |
13782 | } | |
13783 | # 1504 "regex_internal.c" | |
13784 | static re_dfastate_t * | |
13785 | ||
13786 | re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa, | |
13787 | const re_node_set *nodes, unsigned int context) | |
13788 | { | |
13789 | unsigned int hash; | |
13790 | re_dfastate_t *new_state; | |
13791 | struct re_state_table_entry *spot; | |
13792 | int i; | |
13793 | if (nodes->nelem == 0) | |
13794 | { | |
13795 | *err = REG_NOERROR; | |
13796 | return ((void *)0); | |
13797 | } | |
13798 | hash = calc_state_hash (nodes, context); | |
13799 | spot = dfa->state_table + (hash & dfa->state_hash_mask); | |
13800 | ||
13801 | for (i = 0 ; i < spot->num ; i++) | |
13802 | { | |
13803 | re_dfastate_t *state = spot->array[i]; | |
13804 | if (state->hash == hash | |
13805 | && state->context == context | |
13806 | && re_node_set_compare (state->entrance_nodes, nodes)) | |
13807 | return state; | |
13808 | } | |
13809 | ||
13810 | new_state = create_cd_newstate (dfa, nodes, context, hash); | |
13811 | if (__builtin_expect (new_state == ((void *)0), 0)) | |
13812 | *err = REG_ESPACE; | |
13813 | ||
13814 | return new_state; | |
13815 | } | |
13816 | ||
13817 | ||
13818 | ||
13819 | ||
13820 | ||
13821 | static reg_errcode_t | |
13822 | register_state (const re_dfa_t *dfa, re_dfastate_t *newstate, | |
13823 | unsigned int hash) | |
13824 | { | |
13825 | struct re_state_table_entry *spot; | |
13826 | reg_errcode_t err; | |
13827 | int i; | |
13828 | ||
13829 | newstate->hash = hash; | |
13830 | err = re_node_set_alloc (&newstate->non_eps_nodes, newstate->nodes.nelem); | |
13831 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
13832 | return REG_ESPACE; | |
13833 | for (i = 0; i < newstate->nodes.nelem; i++) | |
13834 | { | |
13835 | int elem = newstate->nodes.elems[i]; | |
13836 | if (!((dfa->nodes[elem].type) & 8)) | |
13837 | re_node_set_insert_last (&newstate->non_eps_nodes, elem); | |
13838 | } | |
13839 | ||
13840 | spot = dfa->state_table + (hash & dfa->state_hash_mask); | |
13841 | if (__builtin_expect (spot->alloc <= spot->num, 0)) | |
13842 | { | |
13843 | int new_alloc = 2 * spot->num + 2; | |
13844 | re_dfastate_t **new_array = ((re_dfastate_t * *) realloc (spot->array, (new_alloc) * sizeof (re_dfastate_t *))); | |
13845 | ||
13846 | if (__builtin_expect (new_array == ((void *)0), 0)) | |
13847 | return REG_ESPACE; | |
13848 | spot->array = new_array; | |
13849 | spot->alloc = new_alloc; | |
13850 | } | |
13851 | spot->array[spot->num++] = newstate; | |
13852 | return REG_NOERROR; | |
13853 | } | |
13854 | ||
13855 | static void | |
13856 | free_state (re_dfastate_t *state) | |
13857 | { | |
13858 | free ((&state->non_eps_nodes)->elems); | |
13859 | free ((&state->inveclosure)->elems); | |
13860 | if (state->entrance_nodes != &state->nodes) | |
13861 | { | |
13862 | free ((state->entrance_nodes)->elems); | |
13863 | free (state->entrance_nodes); | |
13864 | } | |
13865 | free ((&state->nodes)->elems); | |
13866 | free (state->word_trtable); | |
13867 | free (state->trtable); | |
13868 | free (state); | |
13869 | } | |
13870 | ||
13871 | ||
13872 | ||
13873 | ||
13874 | static re_dfastate_t * | |
13875 | ||
13876 | create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes, | |
13877 | unsigned int hash) | |
13878 | { | |
13879 | int i; | |
13880 | reg_errcode_t err; | |
13881 | re_dfastate_t *newstate; | |
13882 | ||
13883 | newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1); | |
13884 | if (__builtin_expect (newstate == ((void *)0), 0)) | |
13885 | return ((void *)0); | |
13886 | err = re_node_set_init_copy (&newstate->nodes, nodes); | |
13887 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
13888 | { | |
13889 | free (newstate); | |
13890 | return ((void *)0); | |
13891 | } | |
13892 | ||
13893 | newstate->entrance_nodes = &newstate->nodes; | |
13894 | for (i = 0 ; i < nodes->nelem ; i++) | |
13895 | { | |
13896 | re_token_t *node = dfa->nodes + nodes->elems[i]; | |
13897 | re_token_type_t type = node->type; | |
13898 | if (type == CHARACTER && !node->constraint) | |
13899 | continue; | |
13900 | ||
13901 | newstate->accept_mb |= node->accept_mb; | |
13902 | ||
13903 | ||
13904 | ||
13905 | if (type == END_OF_RE) | |
13906 | newstate->halt = 1; | |
13907 | else if (type == OP_BACK_REF) | |
13908 | newstate->has_backref = 1; | |
13909 | else if (type == ANCHOR || node->constraint) | |
13910 | newstate->has_constraint = 1; | |
13911 | } | |
13912 | err = register_state (dfa, newstate, hash); | |
13913 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
13914 | { | |
13915 | free_state (newstate); | |
13916 | newstate = ((void *)0); | |
13917 | } | |
13918 | return newstate; | |
13919 | } | |
13920 | ||
13921 | ||
13922 | ||
13923 | ||
13924 | static re_dfastate_t * | |
13925 | ||
13926 | create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, | |
13927 | unsigned int context, unsigned int hash) | |
13928 | { | |
13929 | int i, nctx_nodes = 0; | |
13930 | reg_errcode_t err; | |
13931 | re_dfastate_t *newstate; | |
13932 | ||
13933 | newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1); | |
13934 | if (__builtin_expect (newstate == ((void *)0), 0)) | |
13935 | return ((void *)0); | |
13936 | err = re_node_set_init_copy (&newstate->nodes, nodes); | |
13937 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
13938 | { | |
13939 | free (newstate); | |
13940 | return ((void *)0); | |
13941 | } | |
13942 | ||
13943 | newstate->context = context; | |
13944 | newstate->entrance_nodes = &newstate->nodes; | |
13945 | ||
13946 | for (i = 0 ; i < nodes->nelem ; i++) | |
13947 | { | |
13948 | unsigned int constraint = 0; | |
13949 | re_token_t *node = dfa->nodes + nodes->elems[i]; | |
13950 | re_token_type_t type = node->type; | |
13951 | if (node->constraint) | |
13952 | constraint = node->constraint; | |
13953 | ||
13954 | if (type == CHARACTER && !constraint) | |
13955 | continue; | |
13956 | ||
13957 | newstate->accept_mb |= node->accept_mb; | |
13958 | ||
13959 | ||
13960 | ||
13961 | if (type == END_OF_RE) | |
13962 | newstate->halt = 1; | |
13963 | else if (type == OP_BACK_REF) | |
13964 | newstate->has_backref = 1; | |
13965 | else if (type == ANCHOR) | |
13966 | constraint = node->opr.ctx_type; | |
13967 | ||
13968 | if (constraint) | |
13969 | { | |
13970 | if (newstate->entrance_nodes == &newstate->nodes) | |
13971 | { | |
13972 | newstate->entrance_nodes = ((re_node_set *) malloc ((1) * sizeof (re_node_set))); | |
13973 | if (__builtin_expect (newstate->entrance_nodes == ((void *)0), 0)) | |
13974 | { | |
13975 | free_state (newstate); | |
13976 | return ((void *)0); | |
13977 | } | |
13978 | re_node_set_init_copy (newstate->entrance_nodes, nodes); | |
13979 | nctx_nodes = 0; | |
13980 | newstate->has_constraint = 1; | |
13981 | } | |
13982 | ||
13983 | if (((((constraint) & 0x0001) && !((context) & 1)) || ((constraint & 0x0002) && ((context) & 1)) || ((constraint & 0x0010) && !((context) & (1 << 1))) || ((constraint & 0x0040) && !((context) & ((1 << 1) << 1))))) | |
13984 | { | |
13985 | re_node_set_remove_at (&newstate->nodes, i - nctx_nodes); | |
13986 | ++nctx_nodes; | |
13987 | } | |
13988 | } | |
13989 | } | |
13990 | err = register_state (dfa, newstate, hash); | |
13991 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
13992 | { | |
13993 | free_state (newstate); | |
13994 | newstate = ((void *)0); | |
13995 | } | |
13996 | return newstate; | |
13997 | } | |
13998 | # 64 "regex.c" 2 | |
13999 | # 1 "regcomp.c" 1 | |
14000 | # 21 "regcomp.c" | |
14001 | static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern, | |
14002 | size_t length, reg_syntax_t syntax); | |
14003 | static void re_compile_fastmap_iter (regex_t *bufp, | |
14004 | const re_dfastate_t *init_state, | |
14005 | char *fastmap); | |
14006 | static reg_errcode_t init_dfa (re_dfa_t *dfa, size_t pat_len); | |
14007 | ||
14008 | static void free_charset (re_charset_t *cset); | |
14009 | ||
14010 | static void free_workarea_compile (regex_t *preg); | |
14011 | static reg_errcode_t create_initial_state (re_dfa_t *dfa); | |
14012 | ||
14013 | static void optimize_utf8 (re_dfa_t *dfa); | |
14014 | ||
14015 | static reg_errcode_t analyze (regex_t *preg); | |
14016 | static reg_errcode_t preorder (bin_tree_t *root, | |
14017 | reg_errcode_t (fn (void *, bin_tree_t *)), | |
14018 | void *extra); | |
14019 | static reg_errcode_t postorder (bin_tree_t *root, | |
14020 | reg_errcode_t (fn (void *, bin_tree_t *)), | |
14021 | void *extra); | |
14022 | static reg_errcode_t optimize_subexps (void *extra, bin_tree_t *node); | |
14023 | static reg_errcode_t lower_subexps (void *extra, bin_tree_t *node); | |
14024 | static bin_tree_t *lower_subexp (reg_errcode_t *err, regex_t *preg, | |
14025 | bin_tree_t *node); | |
14026 | static reg_errcode_t calc_first (void *extra, bin_tree_t *node); | |
14027 | static reg_errcode_t calc_next (void *extra, bin_tree_t *node); | |
14028 | static reg_errcode_t link_nfa_nodes (void *extra, bin_tree_t *node); | |
14029 | static int duplicate_node (re_dfa_t *dfa, int org_idx, unsigned int constraint); | |
14030 | static int search_duplicated_node (const re_dfa_t *dfa, int org_node, | |
14031 | unsigned int constraint); | |
14032 | static reg_errcode_t calc_eclosure (re_dfa_t *dfa); | |
14033 | static reg_errcode_t calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, | |
14034 | int node, int root); | |
14035 | static reg_errcode_t calc_inveclosure (re_dfa_t *dfa); | |
14036 | static int fetch_number (re_string_t *input, re_token_t *token, | |
14037 | reg_syntax_t syntax); | |
14038 | static int peek_token (re_token_t *token, re_string_t *input, | |
14039 | reg_syntax_t syntax) ; | |
14040 | static bin_tree_t *parse (re_string_t *regexp, regex_t *preg, | |
14041 | reg_syntax_t syntax, reg_errcode_t *err); | |
14042 | static bin_tree_t *parse_reg_exp (re_string_t *regexp, regex_t *preg, | |
14043 | re_token_t *token, reg_syntax_t syntax, | |
14044 | int nest, reg_errcode_t *err); | |
14045 | static bin_tree_t *parse_branch (re_string_t *regexp, regex_t *preg, | |
14046 | re_token_t *token, reg_syntax_t syntax, | |
14047 | int nest, reg_errcode_t *err); | |
14048 | static bin_tree_t *parse_expression (re_string_t *regexp, regex_t *preg, | |
14049 | re_token_t *token, reg_syntax_t syntax, | |
14050 | int nest, reg_errcode_t *err); | |
14051 | static bin_tree_t *parse_sub_exp (re_string_t *regexp, regex_t *preg, | |
14052 | re_token_t *token, reg_syntax_t syntax, | |
14053 | int nest, reg_errcode_t *err); | |
14054 | static bin_tree_t *parse_dup_op (bin_tree_t *dup_elem, re_string_t *regexp, | |
14055 | re_dfa_t *dfa, re_token_t *token, | |
14056 | reg_syntax_t syntax, reg_errcode_t *err); | |
14057 | static bin_tree_t *parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, | |
14058 | re_token_t *token, reg_syntax_t syntax, | |
14059 | reg_errcode_t *err); | |
14060 | static reg_errcode_t parse_bracket_element (bracket_elem_t *elem, | |
14061 | re_string_t *regexp, | |
14062 | re_token_t *token, int token_len, | |
14063 | re_dfa_t *dfa, | |
14064 | reg_syntax_t syntax, | |
14065 | int accept_hyphen); | |
14066 | static reg_errcode_t parse_bracket_symbol (bracket_elem_t *elem, | |
14067 | re_string_t *regexp, | |
14068 | re_token_t *token); | |
14069 | ||
14070 | static reg_errcode_t build_equiv_class (bitset_t sbcset, | |
14071 | re_charset_t *mbcset, | |
14072 | int *equiv_class_alloc, | |
14073 | const unsigned char *name); | |
14074 | static reg_errcode_t build_charclass (unsigned char * trans, | |
14075 | bitset_t sbcset, | |
14076 | re_charset_t *mbcset, | |
14077 | int *char_class_alloc, | |
14078 | const unsigned char *class_name, | |
14079 | reg_syntax_t syntax); | |
14080 | # 108 "regcomp.c" | |
14081 | static bin_tree_t *build_charclass_op (re_dfa_t *dfa, | |
14082 | unsigned char * trans, | |
14083 | const unsigned char *class_name, | |
14084 | const unsigned char *extra, | |
14085 | int non_match, reg_errcode_t *err); | |
14086 | static bin_tree_t *create_tree (re_dfa_t *dfa, | |
14087 | bin_tree_t *left, bin_tree_t *right, | |
14088 | re_token_type_t type); | |
14089 | static bin_tree_t *create_token_tree (re_dfa_t *dfa, | |
14090 | bin_tree_t *left, bin_tree_t *right, | |
14091 | const re_token_t *token); | |
14092 | static bin_tree_t *duplicate_tree (const bin_tree_t *src, re_dfa_t *dfa); | |
14093 | static void free_token (re_token_t *node); | |
14094 | static reg_errcode_t free_tree (void *extra, bin_tree_t *node); | |
14095 | static reg_errcode_t mark_opt_subexp (void *extra, bin_tree_t *node); | |
14096 | ||
14097 | ||
14098 | ||
14099 | ||
14100 | ||
14101 | ||
14102 | const char __re_error_msgid[] = | |
14103 | { | |
14104 | ||
14105 | "Success" | |
14106 | "\0" | |
14107 | ||
14108 | "No match" | |
14109 | "\0" | |
14110 | ||
14111 | "Invalid regular expression" | |
14112 | "\0" | |
14113 | ||
14114 | "Invalid collation character" | |
14115 | "\0" | |
14116 | ||
14117 | "Invalid character class name" | |
14118 | "\0" | |
14119 | ||
14120 | "Trailing backslash" | |
14121 | "\0" | |
14122 | ||
14123 | "Invalid back reference" | |
14124 | "\0" | |
14125 | ||
14126 | "Unmatched [ or [^" | |
14127 | "\0" | |
14128 | ||
14129 | "Unmatched ( or \\(" | |
14130 | "\0" | |
14131 | ||
14132 | "Unmatched \\{" | |
14133 | "\0" | |
14134 | ||
14135 | "Invalid content of \\{\\}" | |
14136 | "\0" | |
14137 | ||
14138 | "Invalid range end" | |
14139 | "\0" | |
14140 | ||
14141 | "Memory exhausted" | |
14142 | "\0" | |
14143 | ||
14144 | "Invalid preceding regular expression" | |
14145 | "\0" | |
14146 | ||
14147 | "Premature end of regular expression" | |
14148 | "\0" | |
14149 | ||
14150 | "Regular expression too big" | |
14151 | "\0" | |
14152 | ||
14153 | "Unmatched ) or \\)" | |
14154 | }; | |
14155 | ||
14156 | const size_t __re_error_msgid_idx[] = | |
14157 | { | |
14158 | 0, | |
14159 | (0 + sizeof "Success"), | |
14160 | ((0 + sizeof "Success") + sizeof "No match"), | |
14161 | (((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression"), | |
14162 | ((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character"), | |
14163 | (((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character") + sizeof "Invalid character class name"), | |
14164 | ((((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character") + sizeof "Invalid character class name") + sizeof "Trailing backslash"), | |
14165 | (((((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character") + sizeof "Invalid character class name") + sizeof "Trailing backslash") + sizeof "Invalid back reference"), | |
14166 | ((((((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character") + sizeof "Invalid character class name") + sizeof "Trailing backslash") + sizeof "Invalid back reference") + sizeof "Unmatched [ or [^"), | |
14167 | (((((((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character") + sizeof "Invalid character class name") + sizeof "Trailing backslash") + sizeof "Invalid back reference") + sizeof "Unmatched [ or [^") + sizeof "Unmatched ( or \\("), | |
14168 | ((((((((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character") + sizeof "Invalid character class name") + sizeof "Trailing backslash") + sizeof "Invalid back reference") + sizeof "Unmatched [ or [^") + sizeof "Unmatched ( or \\(") + sizeof "Unmatched \\{"), | |
14169 | (((((((((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character") + sizeof "Invalid character class name") + sizeof "Trailing backslash") + sizeof "Invalid back reference") + sizeof "Unmatched [ or [^") + sizeof "Unmatched ( or \\(") + sizeof "Unmatched \\{") + sizeof "Invalid content of \\{\\}"), | |
14170 | ((((((((((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character") + sizeof "Invalid character class name") + sizeof "Trailing backslash") + sizeof "Invalid back reference") + sizeof "Unmatched [ or [^") + sizeof "Unmatched ( or \\(") + sizeof "Unmatched \\{") + sizeof "Invalid content of \\{\\}") + sizeof "Invalid range end"), | |
14171 | (((((((((((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character") + sizeof "Invalid character class name") + sizeof "Trailing backslash") + sizeof "Invalid back reference") + sizeof "Unmatched [ or [^") + sizeof "Unmatched ( or \\(") + sizeof "Unmatched \\{") + sizeof "Invalid content of \\{\\}") + sizeof "Invalid range end") + sizeof "Memory exhausted"), | |
14172 | ((((((((((((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character") + sizeof "Invalid character class name") + sizeof "Trailing backslash") + sizeof "Invalid back reference") + sizeof "Unmatched [ or [^") + sizeof "Unmatched ( or \\(") + sizeof "Unmatched \\{") + sizeof "Invalid content of \\{\\}") + sizeof "Invalid range end") + sizeof "Memory exhausted") + sizeof "Invalid preceding regular expression"), | |
14173 | (((((((((((((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character") + sizeof "Invalid character class name") + sizeof "Trailing backslash") + sizeof "Invalid back reference") + sizeof "Unmatched [ or [^") + sizeof "Unmatched ( or \\(") + sizeof "Unmatched \\{") + sizeof "Invalid content of \\{\\}") + sizeof "Invalid range end") + sizeof "Memory exhausted") + sizeof "Invalid preceding regular expression") + sizeof "Premature end of regular expression"), | |
14174 | ((((((((((((((((0 + sizeof "Success") + sizeof "No match") + sizeof "Invalid regular expression") + sizeof "Invalid collation character") + sizeof "Invalid character class name") + sizeof "Trailing backslash") + sizeof "Invalid back reference") + sizeof "Unmatched [ or [^") + sizeof "Unmatched ( or \\(") + sizeof "Unmatched \\{") + sizeof "Invalid content of \\{\\}") + sizeof "Invalid range end") + sizeof "Memory exhausted") + sizeof "Invalid preceding regular expression") + sizeof "Premature end of regular expression") + sizeof "Regular expression too big") | |
14175 | }; | |
14176 | # 213 "regcomp.c" | |
14177 | const char * | |
14178 | __re_compile_pattern (pattern, length, bufp) | |
14179 | const char *pattern; | |
14180 | size_t length; | |
14181 | struct re_pattern_buffer *bufp; | |
14182 | { | |
14183 | reg_errcode_t ret; | |
14184 | ||
14185 | ||
14186 | ||
14187 | ||
14188 | bufp->no_sub = !!(re_syntax_options & (((((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)); | |
14189 | ||
14190 | ||
14191 | bufp->newline_anchor = 1; | |
14192 | ||
14193 | ret = re_compile_internal (bufp, pattern, length, re_syntax_options); | |
14194 | ||
14195 | if (!ret) | |
14196 | return ((void *)0); | |
14197 | return __dcgettext (_libc_intl_domainname, __re_error_msgid + __re_error_msgid_idx[(int) ret], __LC_MESSAGES); | |
14198 | } | |
14199 | ||
14200 | extern __typeof (__re_compile_pattern) re_compile_pattern __attribute__ ((weak, alias ("__re_compile_pattern"))); | |
14201 | ||
14202 | ||
14203 | ||
14204 | ||
14205 | ||
14206 | ||
14207 | ||
14208 | reg_syntax_t re_syntax_options; | |
14209 | # 254 "regcomp.c" | |
14210 | reg_syntax_t | |
14211 | __re_set_syntax (syntax) | |
14212 | reg_syntax_t syntax; | |
14213 | { | |
14214 | reg_syntax_t ret = re_syntax_options; | |
14215 | ||
14216 | re_syntax_options = syntax; | |
14217 | return ret; | |
14218 | } | |
14219 | ||
14220 | extern __typeof (__re_set_syntax) re_set_syntax __attribute__ ((weak, alias ("__re_set_syntax"))); | |
14221 | ||
14222 | ||
14223 | int | |
14224 | __re_compile_fastmap (bufp) | |
14225 | struct re_pattern_buffer *bufp; | |
14226 | { | |
14227 | re_dfa_t *dfa = (re_dfa_t *) bufp->buffer; | |
14228 | char *fastmap = bufp->fastmap; | |
14229 | ||
14230 | memset (fastmap, '\0', sizeof (char) * 256); | |
14231 | re_compile_fastmap_iter (bufp, dfa->init_state, fastmap); | |
14232 | if (dfa->init_state != dfa->init_state_word) | |
14233 | re_compile_fastmap_iter (bufp, dfa->init_state_word, fastmap); | |
14234 | if (dfa->init_state != dfa->init_state_nl) | |
14235 | re_compile_fastmap_iter (bufp, dfa->init_state_nl, fastmap); | |
14236 | if (dfa->init_state != dfa->init_state_begbuf) | |
14237 | re_compile_fastmap_iter (bufp, dfa->init_state_begbuf, fastmap); | |
14238 | bufp->fastmap_accurate = 1; | |
14239 | return 0; | |
14240 | } | |
14241 | ||
14242 | extern __typeof (__re_compile_fastmap) re_compile_fastmap __attribute__ ((weak, alias ("__re_compile_fastmap"))); | |
14243 | ||
14244 | ||
14245 | static inline void | |
14246 | __attribute__ ((always_inline)) | |
14247 | re_set_fastmap (char *fastmap, int icase, int ch) | |
14248 | { | |
14249 | fastmap[ch] = 1; | |
14250 | if (icase) | |
14251 | fastmap[(__extension__ ({ int __res; if (sizeof (ch) > 1) { if (__builtin_constant_p (ch)) { int __c = (ch); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower (ch); } else __res = (*__ctype_tolower_loc ())[(int) (ch)]; __res; }))] = 1; | |
14252 | } | |
14253 | ||
14254 | ||
14255 | ||
14256 | ||
14257 | static void | |
14258 | re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, | |
14259 | char *fastmap) | |
14260 | { | |
14261 | re_dfa_t *dfa = (re_dfa_t *) bufp->buffer; | |
14262 | int node_cnt; | |
14263 | int icase = (dfa->mb_cur_max == 1 && (bufp->syntax & ((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))); | |
14264 | for (node_cnt = 0; node_cnt < init_state->nodes.nelem; ++node_cnt) | |
14265 | { | |
14266 | int node = init_state->nodes.elems[node_cnt]; | |
14267 | re_token_type_t type = dfa->nodes[node].type; | |
14268 | ||
14269 | if (type == CHARACTER) | |
14270 | { | |
14271 | re_set_fastmap (fastmap, icase, dfa->nodes[node].opr.c); | |
14272 | ||
14273 | if ((bufp->syntax & ((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && dfa->mb_cur_max > 1) | |
14274 | { | |
14275 | unsigned char *buf = __builtin_alloca (dfa->mb_cur_max), *p; | |
14276 | wchar_t wc; | |
14277 | mbstate_t state; | |
14278 | ||
14279 | p = buf; | |
14280 | *p++ = dfa->nodes[node].opr.c; | |
14281 | while (++node < dfa->nodes_len | |
14282 | && dfa->nodes[node].type == CHARACTER | |
14283 | && dfa->nodes[node].mb_partial) | |
14284 | *p++ = dfa->nodes[node].opr.c; | |
14285 | memset (&state, '\0', sizeof (state)); | |
14286 | if (mbrtowc (&wc, (const char *) buf, p - buf, | |
14287 | &state) == p - buf | |
14288 | && (__wcrtomb ((char *) buf, towlower (wc), &state) | |
14289 | != (size_t) -1)) | |
14290 | re_set_fastmap (fastmap, 0, buf[0]); | |
14291 | } | |
14292 | ||
14293 | } | |
14294 | else if (type == SIMPLE_BRACKET) | |
14295 | { | |
14296 | int i, ch; | |
14297 | for (i = 0, ch = 0; i < (256 / (sizeof (bitset_word_t) * 8)); ++i) | |
14298 | { | |
14299 | int j; | |
14300 | bitset_word_t w = dfa->nodes[node].opr.sbcset[i]; | |
14301 | for (j = 0; j < (sizeof (bitset_word_t) * 8); ++j, ++ch) | |
14302 | if (w & ((bitset_word_t) 1 << j)) | |
14303 | re_set_fastmap (fastmap, icase, ch); | |
14304 | } | |
14305 | } | |
14306 | ||
14307 | else if (type == COMPLEX_BRACKET) | |
14308 | { | |
14309 | int i; | |
14310 | re_charset_t *cset = dfa->nodes[node].opr.mbcset; | |
14311 | if (cset->non_match || cset->ncoll_syms || cset->nequiv_classes | |
14312 | || cset->nranges || cset->nchar_classes) | |
14313 | { | |
14314 | ||
14315 | if (((uint32_t) (*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_NRULES) & 0xffff)].word) != 0) | |
14316 | { | |
14317 | ||
14318 | ||
14319 | ||
14320 | ||
14321 | ||
14322 | ||
14323 | const int32_t *table = (const int32_t *) | |
14324 | ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_TABLEMB) & 0xffff)].string); | |
14325 | for (i = 0; i < 256; ++i) | |
14326 | if (table[i] < 0) | |
14327 | re_set_fastmap (fastmap, icase, i); | |
14328 | } | |
14329 | ||
14330 | ||
14331 | ||
14332 | ||
14333 | ||
14334 | ||
14335 | } | |
14336 | for (i = 0; i < cset->nmbchars; ++i) | |
14337 | { | |
14338 | char buf[256]; | |
14339 | mbstate_t state; | |
14340 | memset (&state, '\0', sizeof (state)); | |
14341 | if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1) | |
14342 | re_set_fastmap (fastmap, icase, *(unsigned char *) buf); | |
14343 | if ((bufp->syntax & ((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && dfa->mb_cur_max > 1) | |
14344 | { | |
14345 | if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state) | |
14346 | != (size_t) -1) | |
14347 | re_set_fastmap (fastmap, 0, *(unsigned char *) buf); | |
14348 | } | |
14349 | } | |
14350 | } | |
14351 | ||
14352 | else if (type == OP_PERIOD | |
14353 | ||
14354 | || type == OP_UTF8_PERIOD | |
14355 | ||
14356 | || type == END_OF_RE) | |
14357 | { | |
14358 | memset (fastmap, '\1', sizeof (char) * 256); | |
14359 | if (type == END_OF_RE) | |
14360 | bufp->can_be_null = 1; | |
14361 | return; | |
14362 | } | |
14363 | } | |
14364 | } | |
14365 | # 446 "regcomp.c" | |
14366 | int | |
14367 | __regcomp (preg, pattern, cflags) | |
14368 | regex_t *__restrict preg; | |
14369 | const char *__restrict pattern; | |
14370 | int cflags; | |
14371 | { | |
14372 | reg_errcode_t ret; | |
14373 | reg_syntax_t syntax = ((cflags & 1) ? ((((((unsigned long int) 1) << 1) << 1) | ((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | ((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | (((((unsigned long int) 1) << 1) << 1) << 1) | ((((((unsigned long int) 1) << 1) << 1) << 1) << 1) | ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) | (((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | |
14374 | : ((((((unsigned long int) 1) << 1) << 1) | ((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | (((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) | ((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | (((unsigned long int) 1) << 1) | ((((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))); | |
14375 | ||
14376 | preg->buffer = ((void *)0); | |
14377 | preg->allocated = 0; | |
14378 | preg->used = 0; | |
14379 | ||
14380 | ||
14381 | preg->fastmap = ((char *) malloc ((256) * sizeof (char))); | |
14382 | if (__builtin_expect (preg->fastmap == ((void *)0), 0)) | |
14383 | return REG_ESPACE; | |
14384 | ||
14385 | syntax |= (cflags & (1 << 1)) ? ((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) : 0; | |
14386 | ||
14387 | ||
14388 | if (cflags & ((1 << 1) << 1)) | |
14389 | { | |
14390 | syntax &= ~((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1); | |
14391 | syntax |= ((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1); | |
14392 | ||
14393 | preg->newline_anchor = 1; | |
14394 | } | |
14395 | else | |
14396 | preg->newline_anchor = 0; | |
14397 | preg->no_sub = !!(cflags & (((1 << 1) << 1) << 1)); | |
14398 | preg->translate = ((void *)0); | |
14399 | ||
14400 | ret = re_compile_internal (preg, pattern, strlen (pattern), syntax); | |
14401 | ||
14402 | ||
14403 | ||
14404 | if (ret == REG_ERPAREN) | |
14405 | ret = REG_EPAREN; | |
14406 | ||
14407 | ||
14408 | if (__builtin_expect (ret == REG_NOERROR, 1)) | |
14409 | ||
14410 | ||
14411 | (void) __re_compile_fastmap (preg); | |
14412 | else | |
14413 | { | |
14414 | ||
14415 | free (preg->fastmap); | |
14416 | preg->fastmap = ((void *)0); | |
14417 | } | |
14418 | ||
14419 | return (int) ret; | |
14420 | } | |
14421 | ||
14422 | extern __typeof (__regcomp) regcomp __attribute__ ((weak, alias ("__regcomp"))); | |
14423 | ||
14424 | ||
14425 | ||
14426 | ||
14427 | ||
14428 | size_t | |
14429 | __regerror(errcode, preg, errbuf, errbuf_size) | |
14430 | int errcode; | |
14431 | const regex_t *__restrict preg; | |
14432 | char *__restrict errbuf; | |
14433 | size_t errbuf_size; | |
14434 | { | |
14435 | const char *msg; | |
14436 | size_t msg_size; | |
14437 | ||
14438 | if (__builtin_expect (errcode < 0 || errcode >= (int) (sizeof (__re_error_msgid_idx) / sizeof (__re_error_msgid_idx[0])), 0)) | |
14439 | ||
14440 | ||
14441 | ||
14442 | ||
14443 | ||
14444 | ||
14445 | abort (); | |
14446 | ||
14447 | msg = __dcgettext (_libc_intl_domainname, __re_error_msgid + __re_error_msgid_idx[errcode], __LC_MESSAGES); | |
14448 | ||
14449 | msg_size = strlen (msg) + 1; | |
14450 | ||
14451 | if (__builtin_expect (errbuf_size != 0, 1)) | |
14452 | { | |
14453 | if (__builtin_expect (msg_size > errbuf_size, 0)) | |
14454 | { | |
14455 | ||
14456 | *((char *) __builtin_mempcpy (errbuf, msg, errbuf_size - 1)) = '\0'; | |
14457 | ||
14458 | ||
14459 | ||
14460 | ||
14461 | } | |
14462 | else | |
14463 | memcpy (errbuf, msg, msg_size); | |
14464 | } | |
14465 | ||
14466 | return msg_size; | |
14467 | } | |
14468 | ||
14469 | extern __typeof (__regerror) regerror __attribute__ ((weak, alias ("__regerror"))); | |
14470 | # 558 "regcomp.c" | |
14471 | static const bitset_t utf8_sb_map = | |
14472 | { | |
14473 | ||
14474 | [0 ... 0x80 / (sizeof (bitset_word_t) * 8) - 1] = (2147483647L * 2UL + 1UL) | |
14475 | }; | |
14476 | ||
14477 | ||
14478 | ||
14479 | static void | |
14480 | free_dfa_content (re_dfa_t *dfa) | |
14481 | { | |
14482 | int i, j; | |
14483 | ||
14484 | if (dfa->nodes) | |
14485 | for (i = 0; i < dfa->nodes_len; ++i) | |
14486 | free_token (dfa->nodes + i); | |
14487 | free (dfa->nexts); | |
14488 | for (i = 0; i < dfa->nodes_len; ++i) | |
14489 | { | |
14490 | if (dfa->eclosures != ((void *)0)) | |
14491 | free ((dfa->eclosures + i)->elems); | |
14492 | if (dfa->inveclosures != ((void *)0)) | |
14493 | free ((dfa->inveclosures + i)->elems); | |
14494 | if (dfa->edests != ((void *)0)) | |
14495 | free ((dfa->edests + i)->elems); | |
14496 | } | |
14497 | free (dfa->edests); | |
14498 | free (dfa->eclosures); | |
14499 | free (dfa->inveclosures); | |
14500 | free (dfa->nodes); | |
14501 | ||
14502 | if (dfa->state_table) | |
14503 | for (i = 0; i <= dfa->state_hash_mask; ++i) | |
14504 | { | |
14505 | struct re_state_table_entry *entry = dfa->state_table + i; | |
14506 | for (j = 0; j < entry->num; ++j) | |
14507 | { | |
14508 | re_dfastate_t *state = entry->array[j]; | |
14509 | free_state (state); | |
14510 | } | |
14511 | free (entry->array); | |
14512 | } | |
14513 | free (dfa->state_table); | |
14514 | ||
14515 | if (dfa->sb_char != utf8_sb_map) | |
14516 | free (dfa->sb_char); | |
14517 | ||
14518 | free (dfa->subexp_map); | |
14519 | ||
14520 | ||
14521 | ||
14522 | ||
14523 | free (dfa); | |
14524 | } | |
14525 | ||
14526 | ||
14527 | ||
14528 | ||
14529 | void | |
14530 | __regfree (preg) | |
14531 | regex_t *preg; | |
14532 | { | |
14533 | re_dfa_t *dfa = (re_dfa_t *) preg->buffer; | |
14534 | if (__builtin_expect (dfa != ((void *)0), 1)) | |
14535 | free_dfa_content (dfa); | |
14536 | preg->buffer = ((void *)0); | |
14537 | preg->allocated = 0; | |
14538 | ||
14539 | free (preg->fastmap); | |
14540 | preg->fastmap = ((void *)0); | |
14541 | ||
14542 | free (preg->translate); | |
14543 | preg->translate = ((void *)0); | |
14544 | } | |
14545 | ||
14546 | extern __typeof (__regfree) regfree __attribute__ ((weak, alias ("__regfree"))); | |
14547 | # 642 "regcomp.c" | |
14548 | static struct re_pattern_buffer re_comp_buf; | |
14549 | ||
14550 | char * | |
14551 | ||
14552 | ||
14553 | ||
14554 | ||
14555 | __attribute__ ((weak)) | |
14556 | ||
14557 | re_comp (s) | |
14558 | const char *s; | |
14559 | { | |
14560 | reg_errcode_t ret; | |
14561 | char *fastmap; | |
14562 | ||
14563 | if (!s) | |
14564 | { | |
14565 | if (!re_comp_buf.buffer) | |
14566 | return __dcgettext (_libc_intl_domainname, "No previous regular expression", __LC_MESSAGES); | |
14567 | return 0; | |
14568 | } | |
14569 | ||
14570 | if (re_comp_buf.buffer) | |
14571 | { | |
14572 | fastmap = re_comp_buf.fastmap; | |
14573 | re_comp_buf.fastmap = ((void *)0); | |
14574 | __regfree (&re_comp_buf); | |
14575 | memset (&re_comp_buf, '\0', sizeof (re_comp_buf)); | |
14576 | re_comp_buf.fastmap = fastmap; | |
14577 | } | |
14578 | ||
14579 | if (re_comp_buf.fastmap == ((void *)0)) | |
14580 | { | |
14581 | re_comp_buf.fastmap = (char *) malloc (256); | |
14582 | if (re_comp_buf.fastmap == ((void *)0)) | |
14583 | return (char *) __dcgettext (_libc_intl_domainname, __re_error_msgid + __re_error_msgid_idx[(int) REG_ESPACE], __LC_MESSAGES); | |
14584 | ||
14585 | } | |
14586 | ||
14587 | ||
14588 | ||
14589 | ||
14590 | ||
14591 | re_comp_buf.newline_anchor = 1; | |
14592 | ||
14593 | ret = re_compile_internal (&re_comp_buf, s, strlen (s), re_syntax_options); | |
14594 | ||
14595 | if (!ret) | |
14596 | return ((void *)0); | |
14597 | ||
14598 | ||
14599 | return (char *) __dcgettext (_libc_intl_domainname, __re_error_msgid + __re_error_msgid_idx[(int) ret], __LC_MESSAGES); | |
14600 | } | |
14601 | ||
14602 | ||
14603 | static void free_mem (void) __attribute__ ((__used__)) __attribute__ ((section ("__libc_freeres_fn"))); static const void *const __elf_set___libc_subfreeres_element_free_mem__ __attribute__ ((used, section ("__libc_subfreeres"))) = &(free_mem); static void free_mem (void) | |
14604 | { | |
14605 | __regfree (&re_comp_buf); | |
14606 | } | |
14607 | # 709 "regcomp.c" | |
14608 | static reg_errcode_t | |
14609 | re_compile_internal (regex_t *preg, const char * pattern, size_t length, | |
14610 | reg_syntax_t syntax) | |
14611 | { | |
14612 | reg_errcode_t err = REG_NOERROR; | |
14613 | re_dfa_t *dfa; | |
14614 | re_string_t regexp; | |
14615 | ||
14616 | ||
14617 | preg->fastmap_accurate = 0; | |
14618 | preg->syntax = syntax; | |
14619 | preg->not_bol = preg->not_eol = 0; | |
14620 | preg->used = 0; | |
14621 | preg->re_nsub = 0; | |
14622 | preg->can_be_null = 0; | |
14623 | preg->regs_allocated = 0; | |
14624 | ||
14625 | ||
14626 | dfa = (re_dfa_t *) preg->buffer; | |
14627 | if (__builtin_expect (preg->allocated < sizeof (re_dfa_t), 0)) | |
14628 | { | |
14629 | ||
14630 | ||
14631 | ||
14632 | ||
14633 | dfa = ((re_dfa_t *) realloc (preg->buffer, (1) * sizeof (re_dfa_t))); | |
14634 | if (dfa == ((void *)0)) | |
14635 | return REG_ESPACE; | |
14636 | preg->allocated = sizeof (re_dfa_t); | |
14637 | preg->buffer = (unsigned char *) dfa; | |
14638 | } | |
14639 | preg->used = sizeof (re_dfa_t); | |
14640 | ||
14641 | err = init_dfa (dfa, length); | |
14642 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
14643 | { | |
14644 | free_dfa_content (dfa); | |
14645 | preg->buffer = ((void *)0); | |
14646 | preg->allocated = 0; | |
14647 | return err; | |
14648 | } | |
14649 | ||
14650 | ||
14651 | ||
14652 | ||
14653 | ||
14654 | ||
14655 | ((dfa->lock) = (0), 0); | |
14656 | ||
14657 | err = re_string_construct (®exp, pattern, length, preg->translate, | |
14658 | syntax & ((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1), dfa); | |
14659 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
14660 | { | |
14661 | re_compile_internal_free_return: | |
14662 | free_workarea_compile (preg); | |
14663 | re_string_destruct (®exp); | |
14664 | free_dfa_content (dfa); | |
14665 | preg->buffer = ((void *)0); | |
14666 | preg->allocated = 0; | |
14667 | return err; | |
14668 | } | |
14669 | ||
14670 | ||
14671 | preg->re_nsub = 0; | |
14672 | dfa->str_tree = parse (®exp, preg, syntax, &err); | |
14673 | if (__builtin_expect (dfa->str_tree == ((void *)0), 0)) | |
14674 | goto re_compile_internal_free_return; | |
14675 | ||
14676 | ||
14677 | err = analyze (preg); | |
14678 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
14679 | goto re_compile_internal_free_return; | |
14680 | ||
14681 | ||
14682 | ||
14683 | if (dfa->is_utf8 && !(syntax & ((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && preg->translate == ((void *)0)) | |
14684 | optimize_utf8 (dfa); | |
14685 | ||
14686 | ||
14687 | ||
14688 | err = create_initial_state (dfa); | |
14689 | ||
14690 | ||
14691 | free_workarea_compile (preg); | |
14692 | re_string_destruct (®exp); | |
14693 | ||
14694 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
14695 | { | |
14696 | free_dfa_content (dfa); | |
14697 | preg->buffer = ((void *)0); | |
14698 | preg->allocated = 0; | |
14699 | } | |
14700 | ||
14701 | return err; | |
14702 | } | |
14703 | ||
14704 | ||
14705 | ||
14706 | ||
14707 | static reg_errcode_t | |
14708 | init_dfa (re_dfa_t *dfa, size_t pat_len) | |
14709 | { | |
14710 | unsigned int table_size; | |
14711 | ||
14712 | ||
14713 | ||
14714 | ||
14715 | memset (dfa, '\0', sizeof (re_dfa_t)); | |
14716 | ||
14717 | ||
14718 | dfa->str_tree_storage_idx = ((1024 - sizeof (void *)) / sizeof (bin_tree_t)); | |
14719 | ||
14720 | ||
14721 | if (pat_len == (4294967295U)) | |
14722 | return REG_ESPACE; | |
14723 | ||
14724 | dfa->nodes_alloc = pat_len + 1; | |
14725 | dfa->nodes = ((re_token_t *) malloc ((dfa->nodes_alloc) * sizeof (re_token_t))); | |
14726 | ||
14727 | ||
14728 | for (table_size = 1; ; table_size <<= 1) | |
14729 | if (table_size > pat_len) | |
14730 | break; | |
14731 | ||
14732 | dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size); | |
14733 | dfa->state_hash_mask = table_size - 1; | |
14734 | ||
14735 | dfa->mb_cur_max = (((uint32_t) (*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_MB_CUR_MAX) & 0xffff)].word)); | |
14736 | ||
14737 | if (dfa->mb_cur_max == 6 | |
14738 | && __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)) && __builtin_constant_p ("UTF-8") && (__s1_len = strlen (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)), __s2_len = strlen ("UTF-8"), (!((size_t)(const void *)((((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)) + 1) - (size_t)(const void *)(((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("UTF-8") + 1) - (size_t)(const void *)("UTF-8") == 1) || __s2_len >= 4)) ? __builtin_strcmp (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string), "UTF-8") : (__builtin_constant_p (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)) && ((size_t)(const void *)((((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)) + 1) - (size_t)(const void *)(((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)) == 1) && (__s1_len = strlen (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)), __s1_len < 4) ? (__builtin_constant_p ("UTF-8") && ((size_t)(const void *)(("UTF-8") + 1) - (size_t)(const void *)("UTF-8") == 1) ? __builtin_strcmp (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string), "UTF-8") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("UTF-8"); register int __result = (((__const unsigned char *) (__const char *) (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("UTF-8") && ((size_t)(const void *)(("UTF-8") + 1) - (size_t)(const void *)("UTF-8") == 1) && (__s2_len = strlen ("UTF-8"), __s2_len < 4) ? (__builtin_constant_p (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)) && ((size_t)(const void *)((((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)) + 1) - (size_t)(const void *)(((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)) == 1) ? __builtin_strcmp (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string), "UTF-8") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string)); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("UTF-8"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("UTF-8"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("UTF-8"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("UTF-8"))[3]); } } __result; }))) : __builtin_strcmp (((*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_CODESET_NAME) & 0xffff)].string), "UTF-8")))); }) == 0) | |
14739 | dfa->is_utf8 = 1; | |
14740 | dfa->map_notascii = (((uint32_t) (*_nl_current_LC_CTYPE)->values[((int) (_NL_CTYPE_MAP_TO_NONASCII) & 0xffff)].word) | |
14741 | != 0); | |
14742 | # 868 "regcomp.c" | |
14743 | if (dfa->mb_cur_max > 1) | |
14744 | { | |
14745 | if (dfa->is_utf8) | |
14746 | dfa->sb_char = (re_bitset_ptr_t) utf8_sb_map; | |
14747 | else | |
14748 | { | |
14749 | int i, j, ch; | |
14750 | ||
14751 | dfa->sb_char = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1); | |
14752 | if (__builtin_expect (dfa->sb_char == ((void *)0), 0)) | |
14753 | return REG_ESPACE; | |
14754 | ||
14755 | ||
14756 | for (i = 0, ch = 0; i < (256 / (sizeof (bitset_word_t) * 8)); ++i) | |
14757 | for (j = 0; j < (sizeof (bitset_word_t) * 8); ++j, ++ch) | |
14758 | { | |
14759 | wint_t wch = __btowc (ch); | |
14760 | if (wch != (0xffffffffu)) | |
14761 | dfa->sb_char[i] |= (bitset_word_t) 1 << j; | |
14762 | ||
14763 | ||
14764 | ||
14765 | ||
14766 | } | |
14767 | } | |
14768 | } | |
14769 | ||
14770 | ||
14771 | if (__builtin_expect (dfa->nodes == ((void *)0) || dfa->state_table == ((void *)0), 0)) | |
14772 | return REG_ESPACE; | |
14773 | return REG_NOERROR; | |
14774 | } | |
14775 | ||
14776 | ||
14777 | ||
14778 | ||
14779 | ||
14780 | static void | |
14781 | ||
14782 | init_word_char (re_dfa_t *dfa) | |
14783 | { | |
14784 | int i, j, ch; | |
14785 | dfa->word_ops_used = 1; | |
14786 | for (i = 0, ch = 0; i < (256 / (sizeof (bitset_word_t) * 8)); ++i) | |
14787 | for (j = 0; j < (sizeof (bitset_word_t) * 8); ++j, ++ch) | |
14788 | if (((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISalnum) || ch == '_') | |
14789 | dfa->word_char[i] |= (bitset_word_t) 1 << j; | |
14790 | } | |
14791 | ||
14792 | ||
14793 | ||
14794 | static void | |
14795 | free_workarea_compile (regex_t *preg) | |
14796 | { | |
14797 | re_dfa_t *dfa = (re_dfa_t *) preg->buffer; | |
14798 | bin_tree_storage_t *storage, *next; | |
14799 | for (storage = dfa->str_tree_storage; storage; storage = next) | |
14800 | { | |
14801 | next = storage->next; | |
14802 | free (storage); | |
14803 | } | |
14804 | dfa->str_tree_storage = ((void *)0); | |
14805 | dfa->str_tree_storage_idx = ((1024 - sizeof (void *)) / sizeof (bin_tree_t)); | |
14806 | dfa->str_tree = ((void *)0); | |
14807 | free (dfa->org_indices); | |
14808 | dfa->org_indices = ((void *)0); | |
14809 | } | |
14810 | ||
14811 | ||
14812 | ||
14813 | static reg_errcode_t | |
14814 | create_initial_state (re_dfa_t *dfa) | |
14815 | { | |
14816 | int first, i; | |
14817 | reg_errcode_t err; | |
14818 | re_node_set init_nodes; | |
14819 | ||
14820 | ||
14821 | ||
14822 | first = dfa->str_tree->first->node_idx; | |
14823 | dfa->init_node = first; | |
14824 | err = re_node_set_init_copy (&init_nodes, dfa->eclosures + first); | |
14825 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
14826 | return err; | |
14827 | ||
14828 | ||
14829 | ||
14830 | ||
14831 | ||
14832 | if (dfa->nbackref > 0) | |
14833 | for (i = 0; i < init_nodes.nelem; ++i) | |
14834 | { | |
14835 | int node_idx = init_nodes.elems[i]; | |
14836 | re_token_type_t type = dfa->nodes[node_idx].type; | |
14837 | ||
14838 | int clexp_idx; | |
14839 | if (type != OP_BACK_REF) | |
14840 | continue; | |
14841 | for (clexp_idx = 0; clexp_idx < init_nodes.nelem; ++clexp_idx) | |
14842 | { | |
14843 | re_token_t *clexp_node; | |
14844 | clexp_node = dfa->nodes + init_nodes.elems[clexp_idx]; | |
14845 | if (clexp_node->type == OP_CLOSE_SUBEXP | |
14846 | && clexp_node->opr.idx == dfa->nodes[node_idx].opr.idx) | |
14847 | break; | |
14848 | } | |
14849 | if (clexp_idx == init_nodes.nelem) | |
14850 | continue; | |
14851 | ||
14852 | if (type == OP_BACK_REF) | |
14853 | { | |
14854 | int dest_idx = dfa->edests[node_idx].elems[0]; | |
14855 | if (!re_node_set_contains (&init_nodes, dest_idx)) | |
14856 | { | |
14857 | re_node_set_merge (&init_nodes, dfa->eclosures + dest_idx); | |
14858 | i = 0; | |
14859 | } | |
14860 | } | |
14861 | } | |
14862 | ||
14863 | ||
14864 | dfa->init_state = re_acquire_state_context (&err, dfa, &init_nodes, 0); | |
14865 | ||
14866 | if (__builtin_expect (dfa->init_state == ((void *)0), 0)) | |
14867 | return err; | |
14868 | if (dfa->init_state->has_constraint) | |
14869 | { | |
14870 | dfa->init_state_word = re_acquire_state_context (&err, dfa, &init_nodes, | |
14871 | 1); | |
14872 | dfa->init_state_nl = re_acquire_state_context (&err, dfa, &init_nodes, | |
14873 | (1 << 1)); | |
14874 | dfa->init_state_begbuf = re_acquire_state_context (&err, dfa, | |
14875 | &init_nodes, | |
14876 | (1 << 1) | |
14877 | | ((1 << 1) << 1)); | |
14878 | if (__builtin_expect (dfa->init_state_word == ((void *)0) || dfa->init_state_nl == ((void *)0) || dfa->init_state_begbuf == ((void *)0), 0)) | |
14879 | ||
14880 | return err; | |
14881 | } | |
14882 | else | |
14883 | dfa->init_state_word = dfa->init_state_nl | |
14884 | = dfa->init_state_begbuf = dfa->init_state; | |
14885 | ||
14886 | free ((&init_nodes)->elems); | |
14887 | return REG_NOERROR; | |
14888 | } | |
14889 | ||
14890 | ||
14891 | ||
14892 | ||
14893 | ||
14894 | ||
14895 | static void | |
14896 | optimize_utf8 (re_dfa_t *dfa) | |
14897 | { | |
14898 | int node, i, mb_chars = 0, has_period = 0; | |
14899 | ||
14900 | for (node = 0; node < dfa->nodes_len; ++node) | |
14901 | switch (dfa->nodes[node].type) | |
14902 | { | |
14903 | case CHARACTER: | |
14904 | if (dfa->nodes[node].opr.c >= 0x80) | |
14905 | mb_chars = 1; | |
14906 | break; | |
14907 | case ANCHOR: | |
14908 | switch (dfa->nodes[node].opr.idx) | |
14909 | { | |
14910 | case LINE_FIRST: | |
14911 | case LINE_LAST: | |
14912 | case BUF_FIRST: | |
14913 | case BUF_LAST: | |
14914 | break; | |
14915 | default: | |
14916 | ||
14917 | return; | |
14918 | } | |
14919 | break; | |
14920 | case OP_PERIOD: | |
14921 | has_period = 1; | |
14922 | break; | |
14923 | case OP_BACK_REF: | |
14924 | case OP_ALT: | |
14925 | case END_OF_RE: | |
14926 | case OP_DUP_ASTERISK: | |
14927 | case OP_OPEN_SUBEXP: | |
14928 | case OP_CLOSE_SUBEXP: | |
14929 | break; | |
14930 | case COMPLEX_BRACKET: | |
14931 | return; | |
14932 | case SIMPLE_BRACKET: | |
14933 | ||
14934 | ((0x80 % (sizeof (bitset_word_t) * 8) == 0) ? (void) (0) : (__assert_fail ("0x80 % (sizeof (bitset_word_t) * 8) == 0", "regcomp.c", 1059, __PRETTY_FUNCTION__), (void) (0))); | |
14935 | for (i = 0x80 / (sizeof (bitset_word_t) * 8); i < (256 / (sizeof (bitset_word_t) * 8)); ++i) | |
14936 | if (dfa->nodes[node].opr.sbcset[i]) | |
14937 | return; | |
14938 | break; | |
14939 | default: | |
14940 | abort (); | |
14941 | } | |
14942 | ||
14943 | if (mb_chars || has_period) | |
14944 | for (node = 0; node < dfa->nodes_len; ++node) | |
14945 | { | |
14946 | if (dfa->nodes[node].type == CHARACTER | |
14947 | && dfa->nodes[node].opr.c >= 0x80) | |
14948 | dfa->nodes[node].mb_partial = 0; | |
14949 | else if (dfa->nodes[node].type == OP_PERIOD) | |
14950 | dfa->nodes[node].type = OP_UTF8_PERIOD; | |
14951 | } | |
14952 | ||
14953 | ||
14954 | dfa->mb_cur_max = 1; | |
14955 | dfa->is_utf8 = 0; | |
14956 | dfa->has_mb_node = dfa->nbackref > 0 || has_period; | |
14957 | } | |
14958 | ||
14959 | ||
14960 | ||
14961 | ||
14962 | ||
14963 | static reg_errcode_t | |
14964 | analyze (regex_t *preg) | |
14965 | { | |
14966 | re_dfa_t *dfa = (re_dfa_t *) preg->buffer; | |
14967 | reg_errcode_t ret; | |
14968 | ||
14969 | ||
14970 | dfa->nexts = ((int *) malloc ((dfa->nodes_alloc) * sizeof (int))); | |
14971 | dfa->org_indices = ((int *) malloc ((dfa->nodes_alloc) * sizeof (int))); | |
14972 | dfa->edests = ((re_node_set *) malloc ((dfa->nodes_alloc) * sizeof (re_node_set))); | |
14973 | dfa->eclosures = ((re_node_set *) malloc ((dfa->nodes_alloc) * sizeof (re_node_set))); | |
14974 | if (__builtin_expect (dfa->nexts == ((void *)0) || dfa->org_indices == ((void *)0) || dfa->edests == ((void *)0) || dfa->eclosures == ((void *)0), 0)) | |
14975 | ||
14976 | return REG_ESPACE; | |
14977 | ||
14978 | dfa->subexp_map = ((int *) malloc ((preg->re_nsub) * sizeof (int))); | |
14979 | if (dfa->subexp_map != ((void *)0)) | |
14980 | { | |
14981 | int i; | |
14982 | for (i = 0; i < preg->re_nsub; i++) | |
14983 | dfa->subexp_map[i] = i; | |
14984 | preorder (dfa->str_tree, optimize_subexps, dfa); | |
14985 | for (i = 0; i < preg->re_nsub; i++) | |
14986 | if (dfa->subexp_map[i] != i) | |
14987 | break; | |
14988 | if (i == preg->re_nsub) | |
14989 | { | |
14990 | free (dfa->subexp_map); | |
14991 | dfa->subexp_map = ((void *)0); | |
14992 | } | |
14993 | } | |
14994 | ||
14995 | ret = postorder (dfa->str_tree, lower_subexps, preg); | |
14996 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
14997 | return ret; | |
14998 | ret = postorder (dfa->str_tree, calc_first, dfa); | |
14999 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
15000 | return ret; | |
15001 | preorder (dfa->str_tree, calc_next, dfa); | |
15002 | ret = preorder (dfa->str_tree, link_nfa_nodes, dfa); | |
15003 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
15004 | return ret; | |
15005 | ret = calc_eclosure (dfa); | |
15006 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
15007 | return ret; | |
15008 | ||
15009 | ||
15010 | ||
15011 | if ((!preg->no_sub && preg->re_nsub > 0 && dfa->has_plural_match) | |
15012 | || dfa->nbackref) | |
15013 | { | |
15014 | dfa->inveclosures = ((re_node_set *) malloc ((dfa->nodes_len) * sizeof (re_node_set))); | |
15015 | if (__builtin_expect (dfa->inveclosures == ((void *)0), 0)) | |
15016 | return REG_ESPACE; | |
15017 | ret = calc_inveclosure (dfa); | |
15018 | } | |
15019 | ||
15020 | return ret; | |
15021 | } | |
15022 | ||
15023 | ||
15024 | ||
15025 | ||
15026 | static reg_errcode_t | |
15027 | postorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)), | |
15028 | void *extra) | |
15029 | { | |
15030 | bin_tree_t *node, *prev; | |
15031 | ||
15032 | for (node = root; ; ) | |
15033 | { | |
15034 | ||
15035 | ||
15036 | while (node->left || node->right) | |
15037 | if (node->left) | |
15038 | node = node->left; | |
15039 | else | |
15040 | node = node->right; | |
15041 | ||
15042 | do | |
15043 | { | |
15044 | reg_errcode_t err = fn (extra, node); | |
15045 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
15046 | return err; | |
15047 | if (node->parent == ((void *)0)) | |
15048 | return REG_NOERROR; | |
15049 | prev = node; | |
15050 | node = node->parent; | |
15051 | } | |
15052 | ||
15053 | while (node->right == prev || node->right == ((void *)0)); | |
15054 | node = node->right; | |
15055 | } | |
15056 | } | |
15057 | ||
15058 | static reg_errcode_t | |
15059 | preorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)), | |
15060 | void *extra) | |
15061 | { | |
15062 | bin_tree_t *node; | |
15063 | ||
15064 | for (node = root; ; ) | |
15065 | { | |
15066 | reg_errcode_t err = fn (extra, node); | |
15067 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
15068 | return err; | |
15069 | ||
15070 | ||
15071 | if (node->left) | |
15072 | node = node->left; | |
15073 | else | |
15074 | { | |
15075 | bin_tree_t *prev = ((void *)0); | |
15076 | while (node->right == prev || node->right == ((void *)0)) | |
15077 | { | |
15078 | prev = node; | |
15079 | node = node->parent; | |
15080 | if (!node) | |
15081 | return REG_NOERROR; | |
15082 | } | |
15083 | node = node->right; | |
15084 | } | |
15085 | } | |
15086 | } | |
15087 | ||
15088 | ||
15089 | ||
15090 | ||
15091 | static reg_errcode_t | |
15092 | optimize_subexps (void *extra, bin_tree_t *node) | |
15093 | { | |
15094 | re_dfa_t *dfa = (re_dfa_t *) extra; | |
15095 | ||
15096 | if (node->token.type == OP_BACK_REF && dfa->subexp_map) | |
15097 | { | |
15098 | int idx = node->token.opr.idx; | |
15099 | node->token.opr.idx = dfa->subexp_map[idx]; | |
15100 | dfa->used_bkref_map |= 1 << node->token.opr.idx; | |
15101 | } | |
15102 | ||
15103 | else if (node->token.type == SUBEXP | |
15104 | && node->left && node->left->token.type == SUBEXP) | |
15105 | { | |
15106 | int other_idx = node->left->token.opr.idx; | |
15107 | ||
15108 | node->left = node->left->left; | |
15109 | if (node->left) | |
15110 | node->left->parent = node; | |
15111 | ||
15112 | dfa->subexp_map[other_idx] = dfa->subexp_map[node->token.opr.idx]; | |
15113 | if (other_idx < (sizeof (bitset_word_t) * 8)) | |
15114 | dfa->used_bkref_map &= ~((bitset_word_t) 1 << other_idx); | |
15115 | } | |
15116 | ||
15117 | return REG_NOERROR; | |
15118 | } | |
15119 | ||
15120 | ||
15121 | ||
15122 | static reg_errcode_t | |
15123 | lower_subexps (void *extra, bin_tree_t *node) | |
15124 | { | |
15125 | regex_t *preg = (regex_t *) extra; | |
15126 | reg_errcode_t err = REG_NOERROR; | |
15127 | ||
15128 | if (node->left && node->left->token.type == SUBEXP) | |
15129 | { | |
15130 | node->left = lower_subexp (&err, preg, node->left); | |
15131 | if (node->left) | |
15132 | node->left->parent = node; | |
15133 | } | |
15134 | if (node->right && node->right->token.type == SUBEXP) | |
15135 | { | |
15136 | node->right = lower_subexp (&err, preg, node->right); | |
15137 | if (node->right) | |
15138 | node->right->parent = node; | |
15139 | } | |
15140 | ||
15141 | return err; | |
15142 | } | |
15143 | ||
15144 | static bin_tree_t * | |
15145 | lower_subexp (reg_errcode_t *err, regex_t *preg, bin_tree_t *node) | |
15146 | { | |
15147 | re_dfa_t *dfa = (re_dfa_t *) preg->buffer; | |
15148 | bin_tree_t *body = node->left; | |
15149 | bin_tree_t *op, *cls, *tree1, *tree; | |
15150 | ||
15151 | if (preg->no_sub | |
15152 | ||
15153 | ||
15154 | ||
15155 | ||
15156 | && node->left != ((void *)0) | |
15157 | && (node->token.opr.idx >= (sizeof (bitset_word_t) * 8) | |
15158 | || !(dfa->used_bkref_map | |
15159 | & ((bitset_word_t) 1 << node->token.opr.idx)))) | |
15160 | return node->left; | |
15161 | ||
15162 | ||
15163 | ||
15164 | op = create_tree (dfa, ((void *)0), ((void *)0), OP_OPEN_SUBEXP); | |
15165 | cls = create_tree (dfa, ((void *)0), ((void *)0), OP_CLOSE_SUBEXP); | |
15166 | tree1 = body ? create_tree (dfa, body, cls, CONCAT) : cls; | |
15167 | tree = create_tree (dfa, op, tree1, CONCAT); | |
15168 | if (__builtin_expect (tree == ((void *)0) || tree1 == ((void *)0) || op == ((void *)0) || cls == ((void *)0), 0)) | |
15169 | { | |
15170 | *err = REG_ESPACE; | |
15171 | return ((void *)0); | |
15172 | } | |
15173 | ||
15174 | op->token.opr.idx = cls->token.opr.idx = node->token.opr.idx; | |
15175 | op->token.opt_subexp = cls->token.opt_subexp = node->token.opt_subexp; | |
15176 | return tree; | |
15177 | } | |
15178 | ||
15179 | ||
15180 | ||
15181 | static reg_errcode_t | |
15182 | calc_first (void *extra, bin_tree_t *node) | |
15183 | { | |
15184 | re_dfa_t *dfa = (re_dfa_t *) extra; | |
15185 | if (node->token.type == CONCAT) | |
15186 | { | |
15187 | node->first = node->left->first; | |
15188 | node->node_idx = node->left->node_idx; | |
15189 | } | |
15190 | else | |
15191 | { | |
15192 | node->first = node; | |
15193 | node->node_idx = re_dfa_add_node (dfa, node->token); | |
15194 | if (__builtin_expect (node->node_idx == -1, 0)) | |
15195 | return REG_ESPACE; | |
15196 | } | |
15197 | return REG_NOERROR; | |
15198 | } | |
15199 | ||
15200 | ||
15201 | static reg_errcode_t | |
15202 | calc_next (void *extra, bin_tree_t *node) | |
15203 | { | |
15204 | switch (node->token.type) | |
15205 | { | |
15206 | case OP_DUP_ASTERISK: | |
15207 | node->left->next = node; | |
15208 | break; | |
15209 | case CONCAT: | |
15210 | node->left->next = node->right->first; | |
15211 | node->right->next = node->next; | |
15212 | break; | |
15213 | default: | |
15214 | if (node->left) | |
15215 | node->left->next = node->next; | |
15216 | if (node->right) | |
15217 | node->right->next = node->next; | |
15218 | break; | |
15219 | } | |
15220 | return REG_NOERROR; | |
15221 | } | |
15222 | ||
15223 | ||
15224 | static reg_errcode_t | |
15225 | link_nfa_nodes (void *extra, bin_tree_t *node) | |
15226 | { | |
15227 | re_dfa_t *dfa = (re_dfa_t *) extra; | |
15228 | int idx = node->node_idx; | |
15229 | reg_errcode_t err = REG_NOERROR; | |
15230 | ||
15231 | switch (node->token.type) | |
15232 | { | |
15233 | case CONCAT: | |
15234 | break; | |
15235 | ||
15236 | case END_OF_RE: | |
15237 | ((node->next == ((void *)0)) ? (void) (0) : (__assert_fail ("node->next == ((void *)0)", "regcomp.c", 1362, __PRETTY_FUNCTION__), (void) (0))); | |
15238 | break; | |
15239 | ||
15240 | case OP_DUP_ASTERISK: | |
15241 | case OP_ALT: | |
15242 | { | |
15243 | int left, right; | |
15244 | dfa->has_plural_match = 1; | |
15245 | if (node->left != ((void *)0)) | |
15246 | left = node->left->first->node_idx; | |
15247 | else | |
15248 | left = node->next->node_idx; | |
15249 | if (node->right != ((void *)0)) | |
15250 | right = node->right->first->node_idx; | |
15251 | else | |
15252 | right = node->next->node_idx; | |
15253 | ((left > -1) ? (void) (0) : (__assert_fail ("left > -1", "regcomp.c", 1378, __PRETTY_FUNCTION__), (void) (0))); | |
15254 | ((right > -1) ? (void) (0) : (__assert_fail ("right > -1", "regcomp.c", 1379, __PRETTY_FUNCTION__), (void) (0))); | |
15255 | err = re_node_set_init_2 (dfa->edests + idx, left, right); | |
15256 | } | |
15257 | break; | |
15258 | ||
15259 | case ANCHOR: | |
15260 | case OP_OPEN_SUBEXP: | |
15261 | case OP_CLOSE_SUBEXP: | |
15262 | err = re_node_set_init_1 (dfa->edests + idx, node->next->node_idx); | |
15263 | break; | |
15264 | ||
15265 | case OP_BACK_REF: | |
15266 | dfa->nexts[idx] = node->next->node_idx; | |
15267 | if (node->token.type == OP_BACK_REF) | |
15268 | re_node_set_init_1 (dfa->edests + idx, dfa->nexts[idx]); | |
15269 | break; | |
15270 | ||
15271 | default: | |
15272 | ((!((node->token.type) & 8)) ? (void) (0) : (__assert_fail ("!((node->token.type) & 8)", "regcomp.c", 1397, __PRETTY_FUNCTION__), (void) (0))); | |
15273 | dfa->nexts[idx] = node->next->node_idx; | |
15274 | break; | |
15275 | } | |
15276 | ||
15277 | return err; | |
15278 | } | |
15279 | ||
15280 | ||
15281 | ||
15282 | ||
15283 | ||
15284 | static reg_errcode_t | |
15285 | ||
15286 | duplicate_node_closure (re_dfa_t *dfa, int top_org_node, int top_clone_node, | |
15287 | int root_node, unsigned int init_constraint) | |
15288 | { | |
15289 | int org_node, clone_node, ret; | |
15290 | unsigned int constraint = init_constraint; | |
15291 | for (org_node = top_org_node, clone_node = top_clone_node;;) | |
15292 | { | |
15293 | int org_dest, clone_dest; | |
15294 | if (dfa->nodes[org_node].type == OP_BACK_REF) | |
15295 | { | |
15296 | ||
15297 | ||
15298 | ||
15299 | ||
15300 | org_dest = dfa->nexts[org_node]; | |
15301 | ((dfa->edests + clone_node)->nelem = 0); | |
15302 | clone_dest = duplicate_node (dfa, org_dest, constraint); | |
15303 | if (__builtin_expect (clone_dest == -1, 0)) | |
15304 | return REG_ESPACE; | |
15305 | dfa->nexts[clone_node] = dfa->nexts[org_node]; | |
15306 | ret = re_node_set_insert (dfa->edests + clone_node, clone_dest); | |
15307 | if (__builtin_expect (ret < 0, 0)) | |
15308 | return REG_ESPACE; | |
15309 | } | |
15310 | else if (dfa->edests[org_node].nelem == 0) | |
15311 | { | |
15312 | ||
15313 | ||
15314 | ||
15315 | dfa->nexts[clone_node] = dfa->nexts[org_node]; | |
15316 | break; | |
15317 | } | |
15318 | else if (dfa->edests[org_node].nelem == 1) | |
15319 | { | |
15320 | ||
15321 | ||
15322 | org_dest = dfa->edests[org_node].elems[0]; | |
15323 | ((dfa->edests + clone_node)->nelem = 0); | |
15324 | if (dfa->nodes[org_node].type == ANCHOR) | |
15325 | { | |
15326 | ||
15327 | if (org_node == root_node && clone_node != org_node) | |
15328 | { | |
15329 | ||
15330 | ||
15331 | ||
15332 | ret = re_node_set_insert (dfa->edests + clone_node, | |
15333 | org_dest); | |
15334 | if (__builtin_expect (ret < 0, 0)) | |
15335 | return REG_ESPACE; | |
15336 | break; | |
15337 | } | |
15338 | constraint |= dfa->nodes[org_node].opr.ctx_type; | |
15339 | } | |
15340 | clone_dest = duplicate_node (dfa, org_dest, constraint); | |
15341 | if (__builtin_expect (clone_dest == -1, 0)) | |
15342 | return REG_ESPACE; | |
15343 | ret = re_node_set_insert (dfa->edests + clone_node, clone_dest); | |
15344 | if (__builtin_expect (ret < 0, 0)) | |
15345 | return REG_ESPACE; | |
15346 | } | |
15347 | else | |
15348 | { | |
15349 | ||
15350 | ||
15351 | org_dest = dfa->edests[org_node].elems[0]; | |
15352 | ((dfa->edests + clone_node)->nelem = 0); | |
15353 | ||
15354 | clone_dest = search_duplicated_node (dfa, org_dest, constraint); | |
15355 | if (clone_dest == -1) | |
15356 | { | |
15357 | ||
15358 | reg_errcode_t err; | |
15359 | clone_dest = duplicate_node (dfa, org_dest, constraint); | |
15360 | if (__builtin_expect (clone_dest == -1, 0)) | |
15361 | return REG_ESPACE; | |
15362 | ret = re_node_set_insert (dfa->edests + clone_node, clone_dest); | |
15363 | if (__builtin_expect (ret < 0, 0)) | |
15364 | return REG_ESPACE; | |
15365 | err = duplicate_node_closure (dfa, org_dest, clone_dest, | |
15366 | root_node, constraint); | |
15367 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
15368 | return err; | |
15369 | } | |
15370 | else | |
15371 | { | |
15372 | ||
15373 | ||
15374 | ret = re_node_set_insert (dfa->edests + clone_node, clone_dest); | |
15375 | if (__builtin_expect (ret < 0, 0)) | |
15376 | return REG_ESPACE; | |
15377 | } | |
15378 | ||
15379 | org_dest = dfa->edests[org_node].elems[1]; | |
15380 | clone_dest = duplicate_node (dfa, org_dest, constraint); | |
15381 | if (__builtin_expect (clone_dest == -1, 0)) | |
15382 | return REG_ESPACE; | |
15383 | ret = re_node_set_insert (dfa->edests + clone_node, clone_dest); | |
15384 | if (__builtin_expect (ret < 0, 0)) | |
15385 | return REG_ESPACE; | |
15386 | } | |
15387 | org_node = org_dest; | |
15388 | clone_node = clone_dest; | |
15389 | } | |
15390 | return REG_NOERROR; | |
15391 | } | |
15392 | ||
15393 | ||
15394 | ||
15395 | ||
15396 | static int | |
15397 | search_duplicated_node (const re_dfa_t *dfa, int org_node, | |
15398 | unsigned int constraint) | |
15399 | { | |
15400 | int idx; | |
15401 | for (idx = dfa->nodes_len - 1; dfa->nodes[idx].duplicated && idx > 0; --idx) | |
15402 | { | |
15403 | if (org_node == dfa->org_indices[idx] | |
15404 | && constraint == dfa->nodes[idx].constraint) | |
15405 | return idx; | |
15406 | } | |
15407 | return -1; | |
15408 | } | |
15409 | ||
15410 | ||
15411 | ||
15412 | ||
15413 | ||
15414 | static int | |
15415 | duplicate_node (re_dfa_t *dfa, int org_idx, unsigned int constraint) | |
15416 | { | |
15417 | int dup_idx = re_dfa_add_node (dfa, dfa->nodes[org_idx]); | |
15418 | if (__builtin_expect (dup_idx != -1, 1)) | |
15419 | { | |
15420 | dfa->nodes[dup_idx].constraint = constraint; | |
15421 | if (dfa->nodes[org_idx].type == ANCHOR) | |
15422 | dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].opr.ctx_type; | |
15423 | dfa->nodes[dup_idx].duplicated = 1; | |
15424 | ||
15425 | ||
15426 | dfa->org_indices[dup_idx] = org_idx; | |
15427 | } | |
15428 | return dup_idx; | |
15429 | } | |
15430 | ||
15431 | static reg_errcode_t | |
15432 | calc_inveclosure (re_dfa_t *dfa) | |
15433 | { | |
15434 | int src, idx, ret; | |
15435 | for (idx = 0; idx < dfa->nodes_len; ++idx) | |
15436 | memset (dfa->inveclosures + idx, '\0', sizeof (re_node_set)); | |
15437 | ||
15438 | for (src = 0; src < dfa->nodes_len; ++src) | |
15439 | { | |
15440 | int *elems = dfa->eclosures[src].elems; | |
15441 | for (idx = 0; idx < dfa->eclosures[src].nelem; ++idx) | |
15442 | { | |
15443 | ret = re_node_set_insert_last (dfa->inveclosures + elems[idx], src); | |
15444 | if (__builtin_expect (ret == -1, 0)) | |
15445 | return REG_ESPACE; | |
15446 | } | |
15447 | } | |
15448 | ||
15449 | return REG_NOERROR; | |
15450 | } | |
15451 | ||
15452 | ||
15453 | ||
15454 | static reg_errcode_t | |
15455 | calc_eclosure (re_dfa_t *dfa) | |
15456 | { | |
15457 | int node_idx, incomplete; | |
15458 | ||
15459 | ||
15460 | ||
15461 | incomplete = 0; | |
15462 | ||
15463 | for (node_idx = 0; ; ++node_idx) | |
15464 | { | |
15465 | reg_errcode_t err; | |
15466 | re_node_set eclosure_elem; | |
15467 | if (node_idx == dfa->nodes_len) | |
15468 | { | |
15469 | if (!incomplete) | |
15470 | break; | |
15471 | incomplete = 0; | |
15472 | node_idx = 0; | |
15473 | } | |
15474 | ||
15475 | ||
15476 | ||
15477 | ||
15478 | ||
15479 | ||
15480 | if (dfa->eclosures[node_idx].nelem != 0) | |
15481 | continue; | |
15482 | ||
15483 | err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, 1); | |
15484 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
15485 | return err; | |
15486 | ||
15487 | if (dfa->eclosures[node_idx].nelem == 0) | |
15488 | { | |
15489 | incomplete = 1; | |
15490 | free ((&eclosure_elem)->elems); | |
15491 | } | |
15492 | } | |
15493 | return REG_NOERROR; | |
15494 | } | |
15495 | ||
15496 | ||
15497 | ||
15498 | static reg_errcode_t | |
15499 | calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, int node, int root) | |
15500 | { | |
15501 | reg_errcode_t err; | |
15502 | unsigned int constraint; | |
15503 | int i, incomplete; | |
15504 | re_node_set eclosure; | |
15505 | incomplete = 0; | |
15506 | err = re_node_set_alloc (&eclosure, dfa->edests[node].nelem + 1); | |
15507 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
15508 | return err; | |
15509 | ||
15510 | ||
15511 | ||
15512 | dfa->eclosures[node].nelem = -1; | |
15513 | ||
15514 | constraint = ((dfa->nodes[node].type == ANCHOR) | |
15515 | ? dfa->nodes[node].opr.ctx_type : 0); | |
15516 | ||
15517 | ||
15518 | if (constraint | |
15519 | && dfa->edests[node].nelem | |
15520 | && !dfa->nodes[dfa->edests[node].elems[0]].duplicated) | |
15521 | { | |
15522 | err = duplicate_node_closure (dfa, node, node, node, constraint); | |
15523 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
15524 | return err; | |
15525 | } | |
15526 | ||
15527 | ||
15528 | if (((dfa->nodes[node].type) & 8)) | |
15529 | for (i = 0; i < dfa->edests[node].nelem; ++i) | |
15530 | { | |
15531 | re_node_set eclosure_elem; | |
15532 | int edest = dfa->edests[node].elems[i]; | |
15533 | ||
15534 | ||
15535 | if (dfa->eclosures[edest].nelem == -1) | |
15536 | { | |
15537 | incomplete = 1; | |
15538 | continue; | |
15539 | } | |
15540 | ||
15541 | ||
15542 | if (dfa->eclosures[edest].nelem == 0) | |
15543 | { | |
15544 | err = calc_eclosure_iter (&eclosure_elem, dfa, edest, 0); | |
15545 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
15546 | return err; | |
15547 | } | |
15548 | else | |
15549 | eclosure_elem = dfa->eclosures[edest]; | |
15550 | ||
15551 | re_node_set_merge (&eclosure, &eclosure_elem); | |
15552 | ||
15553 | ||
15554 | if (dfa->eclosures[edest].nelem == 0) | |
15555 | { | |
15556 | incomplete = 1; | |
15557 | free ((&eclosure_elem)->elems); | |
15558 | } | |
15559 | } | |
15560 | ||
15561 | ||
15562 | re_node_set_insert (&eclosure, node); | |
15563 | if (incomplete && !root) | |
15564 | dfa->eclosures[node].nelem = 0; | |
15565 | else | |
15566 | dfa->eclosures[node] = eclosure; | |
15567 | *new_set = eclosure; | |
15568 | return REG_NOERROR; | |
15569 | } | |
15570 | ||
15571 | ||
15572 | ||
15573 | ||
15574 | ||
15575 | ||
15576 | static void | |
15577 | ||
15578 | fetch_token (re_token_t *result, re_string_t *input, reg_syntax_t syntax) | |
15579 | { | |
15580 | ((input)->cur_idx += (peek_token (result, input, syntax))); | |
15581 | } | |
15582 | ||
15583 | ||
15584 | ||
15585 | ||
15586 | static int | |
15587 | ||
15588 | peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax) | |
15589 | { | |
15590 | unsigned char c; | |
15591 | ||
15592 | if (((input)->stop <= (input)->cur_idx)) | |
15593 | { | |
15594 | token->type = END_OF_RE; | |
15595 | return 0; | |
15596 | } | |
15597 | ||
15598 | c = ((input)->mbs[(input)->cur_idx + 0]); | |
15599 | token->opr.c = c; | |
15600 | ||
15601 | token->word_char = 0; | |
15602 | ||
15603 | token->mb_partial = 0; | |
15604 | if (input->mb_cur_max > 1 && | |
15605 | !((((input)->cur_idx)) == (input)->valid_len || (input)->wcs[((input)->cur_idx)] != (0xffffffffu))) | |
15606 | { | |
15607 | token->type = CHARACTER; | |
15608 | token->mb_partial = 1; | |
15609 | return 1; | |
15610 | } | |
15611 | ||
15612 | if (c == '\\') | |
15613 | { | |
15614 | unsigned char c2; | |
15615 | if (((input)->cur_idx) + 1 >= ((input)->len)) | |
15616 | { | |
15617 | token->type = BACK_SLASH; | |
15618 | return 1; | |
15619 | } | |
15620 | ||
15621 | c2 = re_string_peek_byte_case (input, 1); | |
15622 | token->opr.c = c2; | |
15623 | token->type = CHARACTER; | |
15624 | ||
15625 | if (input->mb_cur_max > 1) | |
15626 | { | |
15627 | wint_t wc = re_string_wchar_at (input, | |
15628 | ((input)->cur_idx) + 1); | |
15629 | token->word_char = (iswalnum (wc) || (wc) == L'_') != 0; | |
15630 | } | |
15631 | else | |
15632 | ||
15633 | token->word_char = (((*__ctype_b_loc ())[(int) ((c2))] & (unsigned short int) _ISalnum) || (c2) == '_') != 0; | |
15634 | ||
15635 | switch (c2) | |
15636 | { | |
15637 | case '|': | |
15638 | if (!(syntax & ((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && !(syntax & (((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15639 | token->type = OP_ALT; | |
15640 | break; | |
15641 | case '1': case '2': case '3': case '4': case '5': | |
15642 | case '6': case '7': case '8': case '9': | |
15643 | if (!(syntax & ((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15644 | { | |
15645 | token->type = OP_BACK_REF; | |
15646 | token->opr.idx = c2 - '1'; | |
15647 | } | |
15648 | break; | |
15649 | case '<': | |
15650 | if (!(syntax & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15651 | { | |
15652 | token->type = ANCHOR; | |
15653 | token->opr.ctx_type = WORD_FIRST; | |
15654 | } | |
15655 | break; | |
15656 | case '>': | |
15657 | if (!(syntax & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15658 | { | |
15659 | token->type = ANCHOR; | |
15660 | token->opr.ctx_type = WORD_LAST; | |
15661 | } | |
15662 | break; | |
15663 | case 'b': | |
15664 | if (!(syntax & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15665 | { | |
15666 | token->type = ANCHOR; | |
15667 | token->opr.ctx_type = WORD_DELIM; | |
15668 | } | |
15669 | break; | |
15670 | case 'B': | |
15671 | if (!(syntax & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15672 | { | |
15673 | token->type = ANCHOR; | |
15674 | token->opr.ctx_type = NOT_WORD_DELIM; | |
15675 | } | |
15676 | break; | |
15677 | case 'w': | |
15678 | if (!(syntax & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15679 | token->type = OP_WORD; | |
15680 | break; | |
15681 | case 'W': | |
15682 | if (!(syntax & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15683 | token->type = OP_NOTWORD; | |
15684 | break; | |
15685 | case 's': | |
15686 | if (!(syntax & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15687 | token->type = OP_SPACE; | |
15688 | break; | |
15689 | case 'S': | |
15690 | if (!(syntax & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15691 | token->type = OP_NOTSPACE; | |
15692 | break; | |
15693 | case '`': | |
15694 | if (!(syntax & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15695 | { | |
15696 | token->type = ANCHOR; | |
15697 | token->opr.ctx_type = BUF_FIRST; | |
15698 | } | |
15699 | break; | |
15700 | case '\'': | |
15701 | if (!(syntax & (((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15702 | { | |
15703 | token->type = ANCHOR; | |
15704 | token->opr.ctx_type = BUF_LAST; | |
15705 | } | |
15706 | break; | |
15707 | case '(': | |
15708 | if (!(syntax & (((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15709 | token->type = OP_OPEN_SUBEXP; | |
15710 | break; | |
15711 | case ')': | |
15712 | if (!(syntax & (((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15713 | token->type = OP_CLOSE_SUBEXP; | |
15714 | break; | |
15715 | case '+': | |
15716 | if (!(syntax & ((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && (syntax & (((unsigned long int) 1) << 1))) | |
15717 | token->type = OP_DUP_PLUS; | |
15718 | break; | |
15719 | case '?': | |
15720 | if (!(syntax & ((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && (syntax & (((unsigned long int) 1) << 1))) | |
15721 | token->type = OP_DUP_QUESTION; | |
15722 | break; | |
15723 | case '{': | |
15724 | if ((syntax & (((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && (!(syntax & ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)))) | |
15725 | token->type = OP_OPEN_DUP_NUM; | |
15726 | break; | |
15727 | case '}': | |
15728 | if ((syntax & (((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && (!(syntax & ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)))) | |
15729 | token->type = OP_CLOSE_DUP_NUM; | |
15730 | break; | |
15731 | default: | |
15732 | break; | |
15733 | } | |
15734 | return 2; | |
15735 | } | |
15736 | ||
15737 | token->type = CHARACTER; | |
15738 | ||
15739 | if (input->mb_cur_max > 1) | |
15740 | { | |
15741 | wint_t wc = re_string_wchar_at (input, ((input)->cur_idx)); | |
15742 | token->word_char = (iswalnum (wc) || (wc) == L'_') != 0; | |
15743 | } | |
15744 | else | |
15745 | ||
15746 | token->word_char = (((*__ctype_b_loc ())[(int) ((token->opr.c))] & (unsigned short int) _ISalnum) || (token->opr.c) == '_'); | |
15747 | ||
15748 | switch (c) | |
15749 | { | |
15750 | case '\n': | |
15751 | if (syntax & (((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | |
15752 | token->type = OP_ALT; | |
15753 | break; | |
15754 | case '|': | |
15755 | if (!(syntax & ((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && (syntax & (((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15756 | token->type = OP_ALT; | |
15757 | break; | |
15758 | case '*': | |
15759 | token->type = OP_DUP_ASTERISK; | |
15760 | break; | |
15761 | case '+': | |
15762 | if (!(syntax & ((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && !(syntax & (((unsigned long int) 1) << 1))) | |
15763 | token->type = OP_DUP_PLUS; | |
15764 | break; | |
15765 | case '?': | |
15766 | if (!(syntax & ((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && !(syntax & (((unsigned long int) 1) << 1))) | |
15767 | token->type = OP_DUP_QUESTION; | |
15768 | break; | |
15769 | case '{': | |
15770 | if ((syntax & (((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && (syntax & ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15771 | token->type = OP_OPEN_DUP_NUM; | |
15772 | break; | |
15773 | case '}': | |
15774 | if ((syntax & (((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && (syntax & ((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
15775 | token->type = OP_CLOSE_DUP_NUM; | |
15776 | break; | |
15777 | case '(': | |
15778 | if (syntax & (((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | |
15779 | token->type = OP_OPEN_SUBEXP; | |
15780 | break; | |
15781 | case ')': | |
15782 | if (syntax & (((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | |
15783 | token->type = OP_CLOSE_SUBEXP; | |
15784 | break; | |
15785 | case '[': | |
15786 | token->type = OP_OPEN_BRACKET; | |
15787 | break; | |
15788 | case '.': | |
15789 | token->type = OP_PERIOD; | |
15790 | break; | |
15791 | case '^': | |
15792 | if (!(syntax & ((((((unsigned long int) 1) << 1) << 1) << 1) | (((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) && | |
15793 | ((input)->cur_idx) != 0) | |
15794 | { | |
15795 | char prev = ((input)->mbs[(input)->cur_idx + -1]); | |
15796 | if (!(syntax & (((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) || prev != '\n') | |
15797 | break; | |
15798 | } | |
15799 | token->type = ANCHOR; | |
15800 | token->opr.ctx_type = LINE_FIRST; | |
15801 | break; | |
15802 | case '$': | |
15803 | if (!(syntax & (((((unsigned long int) 1) << 1) << 1) << 1)) && | |
15804 | ((input)->cur_idx) + 1 != ((input)->len)) | |
15805 | { | |
15806 | re_token_t next; | |
15807 | ((input)->cur_idx += (1)); | |
15808 | peek_token (&next, input, syntax); | |
15809 | ((input)->cur_idx += (-1)); | |
15810 | if (next.type != OP_ALT && next.type != OP_CLOSE_SUBEXP) | |
15811 | break; | |
15812 | } | |
15813 | token->type = ANCHOR; | |
15814 | token->opr.ctx_type = LINE_LAST; | |
15815 | break; | |
15816 | default: | |
15817 | break; | |
15818 | } | |
15819 | return 1; | |
15820 | } | |
15821 | ||
15822 | ||
15823 | ||
15824 | ||
15825 | static int | |
15826 | ||
15827 | peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax) | |
15828 | { | |
15829 | unsigned char c; | |
15830 | if (((input)->stop <= (input)->cur_idx)) | |
15831 | { | |
15832 | token->type = END_OF_RE; | |
15833 | return 0; | |
15834 | } | |
15835 | c = ((input)->mbs[(input)->cur_idx + 0]); | |
15836 | token->opr.c = c; | |
15837 | ||
15838 | ||
15839 | if (input->mb_cur_max > 1 && | |
15840 | !((((input)->cur_idx)) == (input)->valid_len || (input)->wcs[((input)->cur_idx)] != (0xffffffffu))) | |
15841 | { | |
15842 | token->type = CHARACTER; | |
15843 | return 1; | |
15844 | } | |
15845 | ||
15846 | ||
15847 | if (c == '\\' && (syntax & ((unsigned long int) 1)) | |
15848 | && ((input)->cur_idx) + 1 < ((input)->len)) | |
15849 | { | |
15850 | ||
15851 | unsigned char c2; | |
15852 | ((input)->cur_idx += (1)); | |
15853 | c2 = ((input)->mbs[(input)->cur_idx + 0]); | |
15854 | token->opr.c = c2; | |
15855 | token->type = CHARACTER; | |
15856 | return 1; | |
15857 | } | |
15858 | if (c == '[') | |
15859 | { | |
15860 | unsigned char c2; | |
15861 | int token_len; | |
15862 | if (((input)->cur_idx) + 1 < ((input)->len)) | |
15863 | c2 = ((input)->mbs[(input)->cur_idx + 1]); | |
15864 | else | |
15865 | c2 = 0; | |
15866 | token->opr.c = c2; | |
15867 | token_len = 2; | |
15868 | switch (c2) | |
15869 | { | |
15870 | case '.': | |
15871 | token->type = OP_OPEN_COLL_ELEM; | |
15872 | break; | |
15873 | case '=': | |
15874 | token->type = OP_OPEN_EQUIV_CLASS; | |
15875 | break; | |
15876 | case ':': | |
15877 | if (syntax & ((((unsigned long int) 1) << 1) << 1)) | |
15878 | { | |
15879 | token->type = OP_OPEN_CHAR_CLASS; | |
15880 | break; | |
15881 | } | |
15882 | ||
15883 | default: | |
15884 | token->type = CHARACTER; | |
15885 | token->opr.c = c; | |
15886 | token_len = 1; | |
15887 | break; | |
15888 | } | |
15889 | return token_len; | |
15890 | } | |
15891 | switch (c) | |
15892 | { | |
15893 | case '-': | |
15894 | token->type = OP_CHARSET_RANGE; | |
15895 | break; | |
15896 | case ']': | |
15897 | token->type = OP_CLOSE_BRACKET; | |
15898 | break; | |
15899 | case '^': | |
15900 | token->type = OP_NON_MATCH_LIST; | |
15901 | break; | |
15902 | default: | |
15903 | token->type = CHARACTER; | |
15904 | } | |
15905 | return 1; | |
15906 | } | |
15907 | # 2047 "regcomp.c" | |
15908 | static bin_tree_t * | |
15909 | parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax, | |
15910 | reg_errcode_t *err) | |
15911 | { | |
15912 | re_dfa_t *dfa = (re_dfa_t *) preg->buffer; | |
15913 | bin_tree_t *tree, *eor, *root; | |
15914 | re_token_t current_token; | |
15915 | dfa->syntax = syntax; | |
15916 | fetch_token (¤t_token, regexp, syntax | (((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)); | |
15917 | tree = parse_reg_exp (regexp, preg, ¤t_token, syntax, 0, err); | |
15918 | if (__builtin_expect (*err != REG_NOERROR && tree == ((void *)0), 0)) | |
15919 | return ((void *)0); | |
15920 | eor = create_tree (dfa, ((void *)0), ((void *)0), END_OF_RE); | |
15921 | if (tree != ((void *)0)) | |
15922 | root = create_tree (dfa, tree, eor, CONCAT); | |
15923 | else | |
15924 | root = eor; | |
15925 | if (__builtin_expect (eor == ((void *)0) || root == ((void *)0), 0)) | |
15926 | { | |
15927 | *err = REG_ESPACE; | |
15928 | return ((void *)0); | |
15929 | } | |
15930 | return root; | |
15931 | } | |
15932 | # 2081 "regcomp.c" | |
15933 | static bin_tree_t * | |
15934 | parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, | |
15935 | reg_syntax_t syntax, int nest, reg_errcode_t *err) | |
15936 | { | |
15937 | re_dfa_t *dfa = (re_dfa_t *) preg->buffer; | |
15938 | bin_tree_t *tree, *branch = ((void *)0); | |
15939 | tree = parse_branch (regexp, preg, token, syntax, nest, err); | |
15940 | if (__builtin_expect (*err != REG_NOERROR && tree == ((void *)0), 0)) | |
15941 | return ((void *)0); | |
15942 | ||
15943 | while (token->type == OP_ALT) | |
15944 | { | |
15945 | fetch_token (token, regexp, syntax | (((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)); | |
15946 | if (token->type != OP_ALT && token->type != END_OF_RE | |
15947 | && (nest == 0 || token->type != OP_CLOSE_SUBEXP)) | |
15948 | { | |
15949 | branch = parse_branch (regexp, preg, token, syntax, nest, err); | |
15950 | if (__builtin_expect (*err != REG_NOERROR && branch == ((void *)0), 0)) | |
15951 | return ((void *)0); | |
15952 | } | |
15953 | else | |
15954 | branch = ((void *)0); | |
15955 | tree = create_tree (dfa, tree, branch, OP_ALT); | |
15956 | if (__builtin_expect (tree == ((void *)0), 0)) | |
15957 | { | |
15958 | *err = REG_ESPACE; | |
15959 | return ((void *)0); | |
15960 | } | |
15961 | } | |
15962 | return tree; | |
15963 | } | |
15964 | # 2122 "regcomp.c" | |
15965 | static bin_tree_t * | |
15966 | parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token, | |
15967 | reg_syntax_t syntax, int nest, reg_errcode_t *err) | |
15968 | { | |
15969 | bin_tree_t *tree, *exp; | |
15970 | re_dfa_t *dfa = (re_dfa_t *) preg->buffer; | |
15971 | tree = parse_expression (regexp, preg, token, syntax, nest, err); | |
15972 | if (__builtin_expect (*err != REG_NOERROR && tree == ((void *)0), 0)) | |
15973 | return ((void *)0); | |
15974 | ||
15975 | while (token->type != OP_ALT && token->type != END_OF_RE | |
15976 | && (nest == 0 || token->type != OP_CLOSE_SUBEXP)) | |
15977 | { | |
15978 | exp = parse_expression (regexp, preg, token, syntax, nest, err); | |
15979 | if (__builtin_expect (*err != REG_NOERROR && exp == ((void *)0), 0)) | |
15980 | { | |
15981 | return ((void *)0); | |
15982 | } | |
15983 | if (tree != ((void *)0) && exp != ((void *)0)) | |
15984 | { | |
15985 | tree = create_tree (dfa, tree, exp, CONCAT); | |
15986 | if (tree == ((void *)0)) | |
15987 | { | |
15988 | *err = REG_ESPACE; | |
15989 | return ((void *)0); | |
15990 | } | |
15991 | } | |
15992 | else if (tree == ((void *)0)) | |
15993 | tree = exp; | |
15994 | ||
15995 | } | |
15996 | return tree; | |
15997 | } | |
15998 | ||
15999 | ||
16000 | ||
16001 | ||
16002 | ||
16003 | ||
16004 | ||
16005 | static bin_tree_t * | |
16006 | parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, | |
16007 | reg_syntax_t syntax, int nest, reg_errcode_t *err) | |
16008 | { | |
16009 | re_dfa_t *dfa = (re_dfa_t *) preg->buffer; | |
16010 | bin_tree_t *tree; | |
16011 | switch (token->type) | |
16012 | { | |
16013 | case CHARACTER: | |
16014 | tree = create_token_tree (dfa, ((void *)0), ((void *)0), token); | |
16015 | if (__builtin_expect (tree == ((void *)0), 0)) | |
16016 | { | |
16017 | *err = REG_ESPACE; | |
16018 | return ((void *)0); | |
16019 | } | |
16020 | ||
16021 | if (dfa->mb_cur_max > 1) | |
16022 | { | |
16023 | while (!((regexp)->stop <= (regexp)->cur_idx) | |
16024 | && !((((regexp)->cur_idx)) == (regexp)->valid_len || (regexp)->wcs[((regexp)->cur_idx)] != (0xffffffffu))) | |
16025 | { | |
16026 | bin_tree_t *mbc_remain; | |
16027 | fetch_token (token, regexp, syntax); | |
16028 | mbc_remain = create_token_tree (dfa, ((void *)0), ((void *)0), token); | |
16029 | tree = create_tree (dfa, tree, mbc_remain, CONCAT); | |
16030 | if (__builtin_expect (mbc_remain == ((void *)0) || tree == ((void *)0), 0)) | |
16031 | { | |
16032 | *err = REG_ESPACE; | |
16033 | return ((void *)0); | |
16034 | } | |
16035 | } | |
16036 | } | |
16037 | ||
16038 | break; | |
16039 | case OP_OPEN_SUBEXP: | |
16040 | tree = parse_sub_exp (regexp, preg, token, syntax, nest + 1, err); | |
16041 | if (__builtin_expect (*err != REG_NOERROR && tree == ((void *)0), 0)) | |
16042 | return ((void *)0); | |
16043 | break; | |
16044 | case OP_OPEN_BRACKET: | |
16045 | tree = parse_bracket_exp (regexp, dfa, token, syntax, err); | |
16046 | if (__builtin_expect (*err != REG_NOERROR && tree == ((void *)0), 0)) | |
16047 | return ((void *)0); | |
16048 | break; | |
16049 | case OP_BACK_REF: | |
16050 | if (!__builtin_expect (dfa->completed_bkref_map & (1 << token->opr.idx), 1)) | |
16051 | { | |
16052 | *err = REG_ESUBREG; | |
16053 | return ((void *)0); | |
16054 | } | |
16055 | dfa->used_bkref_map |= 1 << token->opr.idx; | |
16056 | tree = create_token_tree (dfa, ((void *)0), ((void *)0), token); | |
16057 | if (__builtin_expect (tree == ((void *)0), 0)) | |
16058 | { | |
16059 | *err = REG_ESPACE; | |
16060 | return ((void *)0); | |
16061 | } | |
16062 | ++dfa->nbackref; | |
16063 | dfa->has_mb_node = 1; | |
16064 | break; | |
16065 | case OP_OPEN_DUP_NUM: | |
16066 | if (syntax & ((((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | |
16067 | { | |
16068 | *err = REG_BADRPT; | |
16069 | return ((void *)0); | |
16070 | } | |
16071 | ||
16072 | case OP_DUP_ASTERISK: | |
16073 | case OP_DUP_PLUS: | |
16074 | case OP_DUP_QUESTION: | |
16075 | if (syntax & (((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1)) | |
16076 | { | |
16077 | *err = REG_BADRPT; | |
16078 | return ((void *)0); | |
16079 | } | |
16080 | else if (syntax & ((((((unsigned long int) 1) << 1) << 1) << 1) << 1)) | |
16081 | { | |
16082 | fetch_token (token, regexp, syntax); | |
16083 | return parse_expression (regexp, preg, token, syntax, nest, err); | |
16084 | } | |
16085 | ||
16086 | case OP_CLOSE_SUBEXP: | |
16087 | if ((token->type == OP_CLOSE_SUBEXP) && | |
16088 | !(syntax & (((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
16089 | { | |
16090 | *err = REG_ERPAREN; | |
16091 | return ((void *)0); | |
16092 | } | |
16093 | ||
16094 | case OP_CLOSE_DUP_NUM: | |
16095 | ||
16096 | ||
16097 | ||
16098 | token->type = CHARACTER; | |
16099 | ||
16100 | ||
16101 | tree = create_token_tree (dfa, ((void *)0), ((void *)0), token); | |
16102 | if (__builtin_expect (tree == ((void *)0), 0)) | |
16103 | { | |
16104 | *err = REG_ESPACE; | |
16105 | return ((void *)0); | |
16106 | } | |
16107 | break; | |
16108 | case ANCHOR: | |
16109 | if ((token->opr.ctx_type | |
16110 | & (WORD_DELIM | NOT_WORD_DELIM | WORD_FIRST | WORD_LAST)) | |
16111 | && dfa->word_ops_used == 0) | |
16112 | init_word_char (dfa); | |
16113 | if (token->opr.ctx_type == WORD_DELIM | |
16114 | || token->opr.ctx_type == NOT_WORD_DELIM) | |
16115 | { | |
16116 | bin_tree_t *tree_first, *tree_last; | |
16117 | if (token->opr.ctx_type == WORD_DELIM) | |
16118 | { | |
16119 | token->opr.ctx_type = WORD_FIRST; | |
16120 | tree_first = create_token_tree (dfa, ((void *)0), ((void *)0), token); | |
16121 | token->opr.ctx_type = WORD_LAST; | |
16122 | } | |
16123 | else | |
16124 | { | |
16125 | token->opr.ctx_type = INSIDE_WORD; | |
16126 | tree_first = create_token_tree (dfa, ((void *)0), ((void *)0), token); | |
16127 | token->opr.ctx_type = INSIDE_NOTWORD; | |
16128 | } | |
16129 | tree_last = create_token_tree (dfa, ((void *)0), ((void *)0), token); | |
16130 | tree = create_tree (dfa, tree_first, tree_last, OP_ALT); | |
16131 | if (__builtin_expect (tree_first == ((void *)0) || tree_last == ((void *)0) || tree == ((void *)0), 0)) | |
16132 | { | |
16133 | *err = REG_ESPACE; | |
16134 | return ((void *)0); | |
16135 | } | |
16136 | } | |
16137 | else | |
16138 | { | |
16139 | tree = create_token_tree (dfa, ((void *)0), ((void *)0), token); | |
16140 | if (__builtin_expect (tree == ((void *)0), 0)) | |
16141 | { | |
16142 | *err = REG_ESPACE; | |
16143 | return ((void *)0); | |
16144 | } | |
16145 | } | |
16146 | ||
16147 | ||
16148 | ||
16149 | ||
16150 | fetch_token (token, regexp, syntax); | |
16151 | return tree; | |
16152 | case OP_PERIOD: | |
16153 | tree = create_token_tree (dfa, ((void *)0), ((void *)0), token); | |
16154 | if (__builtin_expect (tree == ((void *)0), 0)) | |
16155 | { | |
16156 | *err = REG_ESPACE; | |
16157 | return ((void *)0); | |
16158 | } | |
16159 | if (dfa->mb_cur_max > 1) | |
16160 | dfa->has_mb_node = 1; | |
16161 | break; | |
16162 | case OP_WORD: | |
16163 | case OP_NOTWORD: | |
16164 | tree = build_charclass_op (dfa, regexp->trans, | |
16165 | (const unsigned char *) "alnum", | |
16166 | (const unsigned char *) "_", | |
16167 | token->type == OP_NOTWORD, err); | |
16168 | if (__builtin_expect (*err != REG_NOERROR && tree == ((void *)0), 0)) | |
16169 | return ((void *)0); | |
16170 | break; | |
16171 | case OP_SPACE: | |
16172 | case OP_NOTSPACE: | |
16173 | tree = build_charclass_op (dfa, regexp->trans, | |
16174 | (const unsigned char *) "space", | |
16175 | (const unsigned char *) "", | |
16176 | token->type == OP_NOTSPACE, err); | |
16177 | if (__builtin_expect (*err != REG_NOERROR && tree == ((void *)0), 0)) | |
16178 | return ((void *)0); | |
16179 | break; | |
16180 | case OP_ALT: | |
16181 | case END_OF_RE: | |
16182 | return ((void *)0); | |
16183 | case BACK_SLASH: | |
16184 | *err = REG_EESCAPE; | |
16185 | return ((void *)0); | |
16186 | default: | |
16187 | ||
16188 | ||
16189 | ||
16190 | ||
16191 | return ((void *)0); | |
16192 | } | |
16193 | fetch_token (token, regexp, syntax); | |
16194 | ||
16195 | while (token->type == OP_DUP_ASTERISK || token->type == OP_DUP_PLUS | |
16196 | || token->type == OP_DUP_QUESTION || token->type == OP_OPEN_DUP_NUM) | |
16197 | { | |
16198 | tree = parse_dup_op (tree, regexp, dfa, token, syntax, err); | |
16199 | if (__builtin_expect (*err != REG_NOERROR && tree == ((void *)0), 0)) | |
16200 | return ((void *)0); | |
16201 | ||
16202 | if ((syntax & ((((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | |
16203 | && (token->type == OP_DUP_ASTERISK | |
16204 | || token->type == OP_OPEN_DUP_NUM)) | |
16205 | { | |
16206 | *err = REG_BADRPT; | |
16207 | return ((void *)0); | |
16208 | } | |
16209 | } | |
16210 | ||
16211 | return tree; | |
16212 | } | |
16213 | # 2378 "regcomp.c" | |
16214 | static bin_tree_t * | |
16215 | parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, | |
16216 | reg_syntax_t syntax, int nest, reg_errcode_t *err) | |
16217 | { | |
16218 | re_dfa_t *dfa = (re_dfa_t *) preg->buffer; | |
16219 | bin_tree_t *tree; | |
16220 | size_t cur_nsub; | |
16221 | cur_nsub = preg->re_nsub++; | |
16222 | ||
16223 | fetch_token (token, regexp, syntax | (((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)); | |
16224 | ||
16225 | ||
16226 | if (token->type == OP_CLOSE_SUBEXP) | |
16227 | tree = ((void *)0); | |
16228 | else | |
16229 | { | |
16230 | tree = parse_reg_exp (regexp, preg, token, syntax, nest, err); | |
16231 | if (__builtin_expect (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0)) | |
16232 | *err = REG_EPAREN; | |
16233 | if (__builtin_expect (*err != REG_NOERROR, 0)) | |
16234 | return ((void *)0); | |
16235 | } | |
16236 | ||
16237 | if (cur_nsub <= '9' - '1') | |
16238 | dfa->completed_bkref_map |= 1 << cur_nsub; | |
16239 | ||
16240 | tree = create_tree (dfa, tree, ((void *)0), SUBEXP); | |
16241 | if (__builtin_expect (tree == ((void *)0), 0)) | |
16242 | { | |
16243 | *err = REG_ESPACE; | |
16244 | return ((void *)0); | |
16245 | } | |
16246 | tree->token.opr.idx = cur_nsub; | |
16247 | return tree; | |
16248 | } | |
16249 | ||
16250 | ||
16251 | ||
16252 | static bin_tree_t * | |
16253 | parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, | |
16254 | re_token_t *token, reg_syntax_t syntax, reg_errcode_t *err) | |
16255 | { | |
16256 | bin_tree_t *tree = ((void *)0), *old_tree = ((void *)0); | |
16257 | int i, start, end, start_idx = ((regexp)->cur_idx); | |
16258 | re_token_t start_token = *token; | |
16259 | ||
16260 | if (token->type == OP_OPEN_DUP_NUM) | |
16261 | { | |
16262 | end = 0; | |
16263 | start = fetch_number (regexp, token, syntax); | |
16264 | if (start == -1) | |
16265 | { | |
16266 | if (token->type == CHARACTER && token->opr.c == ',') | |
16267 | start = 0; | |
16268 | else | |
16269 | { | |
16270 | *err = REG_BADBR; | |
16271 | return ((void *)0); | |
16272 | } | |
16273 | } | |
16274 | if (__builtin_expect (start != -2, 1)) | |
16275 | { | |
16276 | ||
16277 | end = ((token->type == OP_CLOSE_DUP_NUM) ? start | |
16278 | : ((token->type == CHARACTER && token->opr.c == ',') | |
16279 | ? fetch_number (regexp, token, syntax) : -2)); | |
16280 | } | |
16281 | if (__builtin_expect (start == -2 || end == -2, 0)) | |
16282 | { | |
16283 | ||
16284 | if (__builtin_expect (!(syntax & (((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)), 0)) | |
16285 | { | |
16286 | if (token->type == END_OF_RE) | |
16287 | *err = REG_EBRACE; | |
16288 | else | |
16289 | *err = REG_BADBR; | |
16290 | ||
16291 | return ((void *)0); | |
16292 | } | |
16293 | ||
16294 | ||
16295 | ((regexp)->cur_idx = (start_idx)); | |
16296 | *token = start_token; | |
16297 | token->type = CHARACTER; | |
16298 | ||
16299 | ||
16300 | return elem; | |
16301 | } | |
16302 | ||
16303 | if (__builtin_expect (end != -1 && start > end, 0)) | |
16304 | { | |
16305 | ||
16306 | *err = REG_BADBR; | |
16307 | return ((void *)0); | |
16308 | } | |
16309 | } | |
16310 | else | |
16311 | { | |
16312 | start = (token->type == OP_DUP_PLUS) ? 1 : 0; | |
16313 | end = (token->type == OP_DUP_QUESTION) ? 1 : -1; | |
16314 | } | |
16315 | ||
16316 | fetch_token (token, regexp, syntax); | |
16317 | ||
16318 | if (__builtin_expect (elem == ((void *)0), 0)) | |
16319 | return ((void *)0); | |
16320 | if (__builtin_expect (start == 0 && end == 0, 0)) | |
16321 | { | |
16322 | postorder (elem, free_tree, ((void *)0)); | |
16323 | return ((void *)0); | |
16324 | } | |
16325 | ||
16326 | ||
16327 | if (__builtin_expect (start > 0, 0)) | |
16328 | { | |
16329 | tree = elem; | |
16330 | for (i = 2; i <= start; ++i) | |
16331 | { | |
16332 | elem = duplicate_tree (elem, dfa); | |
16333 | tree = create_tree (dfa, tree, elem, CONCAT); | |
16334 | if (__builtin_expect (elem == ((void *)0) || tree == ((void *)0), 0)) | |
16335 | goto parse_dup_op_espace; | |
16336 | } | |
16337 | ||
16338 | if (start == end) | |
16339 | return tree; | |
16340 | ||
16341 | ||
16342 | elem = duplicate_tree (elem, dfa); | |
16343 | old_tree = tree; | |
16344 | } | |
16345 | else | |
16346 | old_tree = ((void *)0); | |
16347 | ||
16348 | if (elem->token.type == SUBEXP) | |
16349 | postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx); | |
16350 | ||
16351 | tree = create_tree (dfa, elem, ((void *)0), (end == -1 ? OP_DUP_ASTERISK : OP_ALT)); | |
16352 | if (__builtin_expect (tree == ((void *)0), 0)) | |
16353 | goto parse_dup_op_espace; | |
16354 | ||
16355 | ||
16356 | ||
16357 | ||
16358 | for (i = start + 2; i <= end; ++i) | |
16359 | { | |
16360 | elem = duplicate_tree (elem, dfa); | |
16361 | tree = create_tree (dfa, tree, elem, CONCAT); | |
16362 | if (__builtin_expect (elem == ((void *)0) || tree == ((void *)0), 0)) | |
16363 | goto parse_dup_op_espace; | |
16364 | ||
16365 | tree = create_tree (dfa, tree, ((void *)0), OP_ALT); | |
16366 | if (__builtin_expect (tree == ((void *)0), 0)) | |
16367 | goto parse_dup_op_espace; | |
16368 | } | |
16369 | ||
16370 | if (old_tree) | |
16371 | tree = create_tree (dfa, old_tree, tree, CONCAT); | |
16372 | ||
16373 | return tree; | |
16374 | ||
16375 | parse_dup_op_espace: | |
16376 | *err = REG_ESPACE; | |
16377 | return ((void *)0); | |
16378 | } | |
16379 | # 2700 "regcomp.c" | |
16380 | static bin_tree_t * | |
16381 | parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, | |
16382 | reg_syntax_t syntax, reg_errcode_t *err) | |
16383 | { | |
16384 | ||
16385 | const unsigned char *collseqmb; | |
16386 | const char *collseqwc; | |
16387 | uint32_t nrules; | |
16388 | int32_t table_size; | |
16389 | const int32_t *symb_table; | |
16390 | const unsigned char *extra; | |
16391 | ||
16392 | ||
16393 | ||
16394 | ||
16395 | ||
16396 | auto inline int32_t | |
16397 | __attribute__ ((always_inline)) | |
16398 | seek_collating_symbol_entry (name, name_len) | |
16399 | const unsigned char *name; | |
16400 | size_t name_len; | |
16401 | { | |
16402 | int32_t hash = elem_hash ((const char *) name, name_len); | |
16403 | int32_t elem = hash % table_size; | |
16404 | if (symb_table[2 * elem] != 0) | |
16405 | { | |
16406 | int32_t second = hash % (table_size - 2) + 1; | |
16407 | ||
16408 | do | |
16409 | { | |
16410 | ||
16411 | if (symb_table[2 * elem] == hash | |
16412 | ||
16413 | && name_len == extra[symb_table[2 * elem + 1]] | |
16414 | ||
16415 | && memcmp (name, &extra[symb_table[2 * elem + 1] + 1], | |
16416 | name_len) == 0) | |
16417 | { | |
16418 | ||
16419 | break; | |
16420 | } | |
16421 | ||
16422 | ||
16423 | elem += second; | |
16424 | } | |
16425 | while (symb_table[2 * elem] != 0); | |
16426 | } | |
16427 | return elem; | |
16428 | } | |
16429 | ||
16430 | ||
16431 | ||
16432 | ||
16433 | ||
16434 | auto inline unsigned int | |
16435 | __attribute__ ((always_inline)) | |
16436 | lookup_collation_sequence_value (br_elem) | |
16437 | bracket_elem_t *br_elem; | |
16438 | { | |
16439 | if (br_elem->type == SB_CHAR) | |
16440 | { | |
16441 | ||
16442 | ||
16443 | ||
16444 | if (nrules == 0) | |
16445 | return collseqmb[br_elem->opr.ch]; | |
16446 | else | |
16447 | { | |
16448 | wint_t wc = __btowc (br_elem->opr.ch); | |
16449 | return __collseq_table_lookup (collseqwc, wc); | |
16450 | } | |
16451 | } | |
16452 | else if (br_elem->type == MB_CHAR) | |
16453 | { | |
16454 | return __collseq_table_lookup (collseqwc, br_elem->opr.wch); | |
16455 | } | |
16456 | else if (br_elem->type == COLL_SYM) | |
16457 | { | |
16458 | size_t sym_name_len = strlen ((char *) br_elem->opr.name); | |
16459 | if (nrules != 0) | |
16460 | { | |
16461 | int32_t elem, idx; | |
16462 | elem = seek_collating_symbol_entry (br_elem->opr.name, | |
16463 | sym_name_len); | |
16464 | if (symb_table[2 * elem] != 0) | |
16465 | { | |
16466 | ||
16467 | idx = symb_table[2 * elem + 1]; | |
16468 | ||
16469 | idx += 1 + extra[idx]; | |
16470 | ||
16471 | idx += 1 + extra[idx]; | |
16472 | ||
16473 | idx = (idx + 3) & ~3; | |
16474 | ||
16475 | idx += sizeof (unsigned int); | |
16476 | ||
16477 | idx += sizeof (unsigned int) * | |
16478 | (1 + *(unsigned int *) (extra + idx)); | |
16479 | ||
16480 | return *(unsigned int *) (extra + idx); | |
16481 | } | |
16482 | else if (symb_table[2 * elem] == 0 && sym_name_len == 1) | |
16483 | { | |
16484 | ||
16485 | ||
16486 | return collseqmb[br_elem->opr.name[0]]; | |
16487 | } | |
16488 | } | |
16489 | else if (sym_name_len == 1) | |
16490 | return collseqmb[br_elem->opr.name[0]]; | |
16491 | } | |
16492 | return (2147483647 * 2U + 1U); | |
16493 | } | |
16494 | # 2822 "regcomp.c" | |
16495 | auto inline reg_errcode_t | |
16496 | __attribute__ ((always_inline)) | |
16497 | build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem) | |
16498 | re_charset_t *mbcset; | |
16499 | int *range_alloc; | |
16500 | bitset_t sbcset; | |
16501 | bracket_elem_t *start_elem, *end_elem; | |
16502 | { | |
16503 | unsigned int ch; | |
16504 | uint32_t start_collseq; | |
16505 | uint32_t end_collseq; | |
16506 | ||
16507 | ||
16508 | ||
16509 | if (__builtin_expect (start_elem->type == EQUIV_CLASS || start_elem->type == CHAR_CLASS || end_elem->type == EQUIV_CLASS || end_elem->type == CHAR_CLASS, 0)) | |
16510 | ||
16511 | ||
16512 | return REG_ERANGE; | |
16513 | ||
16514 | start_collseq = lookup_collation_sequence_value (start_elem); | |
16515 | end_collseq = lookup_collation_sequence_value (end_elem); | |
16516 | ||
16517 | if (__builtin_expect (start_collseq == (2147483647 * 2U + 1U) || end_collseq == (2147483647 * 2U + 1U), 0)) | |
16518 | return REG_ECOLLATE; | |
16519 | if (__builtin_expect ((syntax & ((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && start_collseq > end_collseq, 0)) | |
16520 | return REG_ERANGE; | |
16521 | ||
16522 | ||
16523 | ||
16524 | ||
16525 | ||
16526 | if (nrules > 0 || dfa->mb_cur_max > 1) | |
16527 | { | |
16528 | ||
16529 | if (__builtin_expect (*range_alloc == mbcset->nranges, 0)) | |
16530 | { | |
16531 | ||
16532 | uint32_t *new_array_start; | |
16533 | uint32_t *new_array_end; | |
16534 | int new_nranges; | |
16535 | ||
16536 | ||
16537 | new_nranges = 2 * mbcset->nranges + 1; | |
16538 | new_array_start = ((uint32_t *) realloc (mbcset->range_starts, (new_nranges) * sizeof (uint32_t))); | |
16539 | ||
16540 | new_array_end = ((uint32_t *) realloc (mbcset->range_ends, (new_nranges) * sizeof (uint32_t))); | |
16541 | ||
16542 | ||
16543 | if (__builtin_expect (new_array_start == ((void *)0) || new_array_end == ((void *)0), 0)) | |
16544 | return REG_ESPACE; | |
16545 | ||
16546 | mbcset->range_starts = new_array_start; | |
16547 | mbcset->range_ends = new_array_end; | |
16548 | *range_alloc = new_nranges; | |
16549 | } | |
16550 | ||
16551 | mbcset->range_starts[mbcset->nranges] = start_collseq; | |
16552 | mbcset->range_ends[mbcset->nranges++] = end_collseq; | |
16553 | } | |
16554 | ||
16555 | ||
16556 | for (ch = 0; ch < 256; ch++) | |
16557 | { | |
16558 | uint32_t ch_collseq; | |
16559 | ||
16560 | ||
16561 | ||
16562 | if (nrules == 0) | |
16563 | ch_collseq = collseqmb[ch]; | |
16564 | else | |
16565 | ch_collseq = __collseq_table_lookup (collseqwc, __btowc (ch)); | |
16566 | if (start_collseq <= ch_collseq && ch_collseq <= end_collseq) | |
16567 | (sbcset[ch / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << ch % (sizeof (bitset_word_t) * 8)); | |
16568 | } | |
16569 | return REG_NOERROR; | |
16570 | } | |
16571 | ||
16572 | ||
16573 | ||
16574 | ||
16575 | ||
16576 | ||
16577 | ||
16578 | auto inline reg_errcode_t | |
16579 | __attribute__ ((always_inline)) | |
16580 | build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name) | |
16581 | re_charset_t *mbcset; | |
16582 | int *coll_sym_alloc; | |
16583 | bitset_t sbcset; | |
16584 | const unsigned char *name; | |
16585 | { | |
16586 | int32_t elem, idx; | |
16587 | size_t name_len = strlen ((const char *) name); | |
16588 | if (nrules != 0) | |
16589 | { | |
16590 | elem = seek_collating_symbol_entry (name, name_len); | |
16591 | if (symb_table[2 * elem] != 0) | |
16592 | { | |
16593 | ||
16594 | idx = symb_table[2 * elem + 1]; | |
16595 | ||
16596 | idx += 1 + extra[idx]; | |
16597 | } | |
16598 | else if (symb_table[2 * elem] == 0 && name_len == 1) | |
16599 | { | |
16600 | ||
16601 | ||
16602 | (sbcset[name[0] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << name[0] % (sizeof (bitset_word_t) * 8)); | |
16603 | return REG_NOERROR; | |
16604 | } | |
16605 | else | |
16606 | return REG_ECOLLATE; | |
16607 | ||
16608 | ||
16609 | ||
16610 | if (__builtin_expect (*coll_sym_alloc == mbcset->ncoll_syms, 0)) | |
16611 | { | |
16612 | ||
16613 | ||
16614 | int new_coll_sym_alloc = 2 * mbcset->ncoll_syms + 1; | |
16615 | ||
16616 | ||
16617 | int32_t *new_coll_syms = ((int32_t *) realloc (mbcset->coll_syms, (new_coll_sym_alloc) * sizeof (int32_t))); | |
16618 | ||
16619 | if (__builtin_expect (new_coll_syms == ((void *)0), 0)) | |
16620 | return REG_ESPACE; | |
16621 | mbcset->coll_syms = new_coll_syms; | |
16622 | *coll_sym_alloc = new_coll_sym_alloc; | |
16623 | } | |
16624 | mbcset->coll_syms[mbcset->ncoll_syms++] = idx; | |
16625 | return REG_NOERROR; | |
16626 | } | |
16627 | else | |
16628 | { | |
16629 | if (__builtin_expect (name_len != 1, 0)) | |
16630 | return REG_ECOLLATE; | |
16631 | else | |
16632 | { | |
16633 | (sbcset[name[0] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << name[0] % (sizeof (bitset_word_t) * 8)); | |
16634 | return REG_NOERROR; | |
16635 | } | |
16636 | } | |
16637 | } | |
16638 | ||
16639 | ||
16640 | re_token_t br_token; | |
16641 | re_bitset_ptr_t sbcset; | |
16642 | ||
16643 | re_charset_t *mbcset; | |
16644 | int coll_sym_alloc = 0, range_alloc = 0, mbchar_alloc = 0; | |
16645 | int equiv_class_alloc = 0, char_class_alloc = 0; | |
16646 | ||
16647 | int non_match = 0; | |
16648 | bin_tree_t *work_tree; | |
16649 | int token_len; | |
16650 | int first_round = 1; | |
16651 | ||
16652 | collseqmb = (const unsigned char *) | |
16653 | ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_COLLSEQMB) & 0xffff)].string); | |
16654 | nrules = ((uint32_t) (*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_NRULES) & 0xffff)].word); | |
16655 | if (nrules) | |
16656 | { | |
16657 | ||
16658 | ||
16659 | ||
16660 | collseqwc = ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_COLLSEQWC) & 0xffff)].string); | |
16661 | table_size = ((uint32_t) (*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_SYMB_HASH_SIZEMB) & 0xffff)].word); | |
16662 | symb_table = (const int32_t *) ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_SYMB_TABLEMB) & 0xffff)].string); | |
16663 | ||
16664 | extra = (const unsigned char *) ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_SYMB_EXTRAMB) & 0xffff)].string); | |
16665 | ||
16666 | } | |
16667 | ||
16668 | sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1); | |
16669 | ||
16670 | mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1); | |
16671 | ||
16672 | ||
16673 | if (__builtin_expect (sbcset == ((void *)0) || mbcset == ((void *)0), 0)) | |
16674 | ||
16675 | ||
16676 | ||
16677 | { | |
16678 | *err = REG_ESPACE; | |
16679 | return ((void *)0); | |
16680 | } | |
16681 | ||
16682 | token_len = peek_token_bracket (token, regexp, syntax); | |
16683 | if (__builtin_expect (token->type == END_OF_RE, 0)) | |
16684 | { | |
16685 | *err = REG_BADPAT; | |
16686 | goto parse_bracket_exp_free_return; | |
16687 | } | |
16688 | if (token->type == OP_NON_MATCH_LIST) | |
16689 | { | |
16690 | ||
16691 | mbcset->non_match = 1; | |
16692 | ||
16693 | non_match = 1; | |
16694 | if (syntax & ((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | |
16695 | (sbcset['\0' / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << '\0' % (sizeof (bitset_word_t) * 8)); | |
16696 | ((regexp)->cur_idx += (token_len)); | |
16697 | token_len = peek_token_bracket (token, regexp, syntax); | |
16698 | if (__builtin_expect (token->type == END_OF_RE, 0)) | |
16699 | { | |
16700 | *err = REG_BADPAT; | |
16701 | goto parse_bracket_exp_free_return; | |
16702 | } | |
16703 | } | |
16704 | ||
16705 | ||
16706 | if (token->type == OP_CLOSE_BRACKET) | |
16707 | token->type = CHARACTER; | |
16708 | ||
16709 | while (1) | |
16710 | { | |
16711 | bracket_elem_t start_elem, end_elem; | |
16712 | unsigned char start_name_buf[32]; | |
16713 | unsigned char end_name_buf[32]; | |
16714 | reg_errcode_t ret; | |
16715 | int token_len2 = 0, is_range_exp = 0; | |
16716 | re_token_t token2; | |
16717 | ||
16718 | start_elem.opr.name = start_name_buf; | |
16719 | ret = parse_bracket_element (&start_elem, regexp, token, token_len, dfa, | |
16720 | syntax, first_round); | |
16721 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
16722 | { | |
16723 | *err = ret; | |
16724 | goto parse_bracket_exp_free_return; | |
16725 | } | |
16726 | first_round = 0; | |
16727 | ||
16728 | ||
16729 | token_len = peek_token_bracket (token, regexp, syntax); | |
16730 | ||
16731 | ||
16732 | if (start_elem.type != CHAR_CLASS && start_elem.type != EQUIV_CLASS) | |
16733 | { | |
16734 | if (__builtin_expect (token->type == END_OF_RE, 0)) | |
16735 | { | |
16736 | *err = REG_EBRACK; | |
16737 | goto parse_bracket_exp_free_return; | |
16738 | } | |
16739 | if (token->type == OP_CHARSET_RANGE) | |
16740 | { | |
16741 | ((regexp)->cur_idx += (token_len)); | |
16742 | token_len2 = peek_token_bracket (&token2, regexp, syntax); | |
16743 | if (__builtin_expect (token2.type == END_OF_RE, 0)) | |
16744 | { | |
16745 | *err = REG_EBRACK; | |
16746 | goto parse_bracket_exp_free_return; | |
16747 | } | |
16748 | if (token2.type == OP_CLOSE_BRACKET) | |
16749 | { | |
16750 | ||
16751 | ((regexp)->cur_idx += (-token_len)); | |
16752 | token->type = CHARACTER; | |
16753 | } | |
16754 | else | |
16755 | is_range_exp = 1; | |
16756 | } | |
16757 | } | |
16758 | ||
16759 | if (is_range_exp == 1) | |
16760 | { | |
16761 | end_elem.opr.name = end_name_buf; | |
16762 | ret = parse_bracket_element (&end_elem, regexp, &token2, token_len2, | |
16763 | dfa, syntax, 1); | |
16764 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
16765 | { | |
16766 | *err = ret; | |
16767 | goto parse_bracket_exp_free_return; | |
16768 | } | |
16769 | ||
16770 | token_len = peek_token_bracket (token, regexp, syntax); | |
16771 | ||
16772 | ||
16773 | *err = build_range_exp (sbcset, mbcset, &range_alloc, | |
16774 | &start_elem, &end_elem); | |
16775 | # 3111 "regcomp.c" | |
16776 | if (__builtin_expect (*err != REG_NOERROR, 0)) | |
16777 | goto parse_bracket_exp_free_return; | |
16778 | } | |
16779 | else | |
16780 | { | |
16781 | switch (start_elem.type) | |
16782 | { | |
16783 | case SB_CHAR: | |
16784 | (sbcset[start_elem.opr.ch / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << start_elem.opr.ch % (sizeof (bitset_word_t) * 8)); | |
16785 | break; | |
16786 | ||
16787 | case MB_CHAR: | |
16788 | ||
16789 | if (__builtin_expect (mbchar_alloc == mbcset->nmbchars, 0)) | |
16790 | { | |
16791 | wchar_t *new_mbchars; | |
16792 | ||
16793 | ||
16794 | mbchar_alloc = 2 * mbcset->nmbchars + 1; | |
16795 | ||
16796 | new_mbchars = ((wchar_t *) realloc (mbcset->mbchars, (mbchar_alloc) * sizeof (wchar_t))); | |
16797 | ||
16798 | if (__builtin_expect (new_mbchars == ((void *)0), 0)) | |
16799 | goto parse_bracket_exp_espace; | |
16800 | mbcset->mbchars = new_mbchars; | |
16801 | } | |
16802 | mbcset->mbchars[mbcset->nmbchars++] = start_elem.opr.wch; | |
16803 | break; | |
16804 | ||
16805 | case EQUIV_CLASS: | |
16806 | *err = build_equiv_class (sbcset, | |
16807 | ||
16808 | mbcset, &equiv_class_alloc, | |
16809 | ||
16810 | start_elem.opr.name); | |
16811 | if (__builtin_expect (*err != REG_NOERROR, 0)) | |
16812 | goto parse_bracket_exp_free_return; | |
16813 | break; | |
16814 | case COLL_SYM: | |
16815 | *err = build_collating_symbol (sbcset, | |
16816 | ||
16817 | mbcset, &coll_sym_alloc, | |
16818 | ||
16819 | start_elem.opr.name); | |
16820 | if (__builtin_expect (*err != REG_NOERROR, 0)) | |
16821 | goto parse_bracket_exp_free_return; | |
16822 | break; | |
16823 | case CHAR_CLASS: | |
16824 | *err = build_charclass (regexp->trans, sbcset, | |
16825 | ||
16826 | mbcset, &char_class_alloc, | |
16827 | ||
16828 | start_elem.opr.name, syntax); | |
16829 | if (__builtin_expect (*err != REG_NOERROR, 0)) | |
16830 | goto parse_bracket_exp_free_return; | |
16831 | break; | |
16832 | default: | |
16833 | ((0) ? (void) (0) : (__assert_fail ("0", "regcomp.c", 3168, __PRETTY_FUNCTION__), (void) (0))); | |
16834 | break; | |
16835 | } | |
16836 | } | |
16837 | if (__builtin_expect (token->type == END_OF_RE, 0)) | |
16838 | { | |
16839 | *err = REG_EBRACK; | |
16840 | goto parse_bracket_exp_free_return; | |
16841 | } | |
16842 | if (token->type == OP_CLOSE_BRACKET) | |
16843 | break; | |
16844 | } | |
16845 | ||
16846 | ((regexp)->cur_idx += (token_len)); | |
16847 | ||
16848 | ||
16849 | if (non_match) | |
16850 | bitset_not (sbcset); | |
16851 | ||
16852 | ||
16853 | ||
16854 | if (dfa->mb_cur_max > 1) | |
16855 | bitset_mask (sbcset, dfa->sb_char); | |
16856 | ||
16857 | if (mbcset->nmbchars || mbcset->ncoll_syms || mbcset->nequiv_classes | |
16858 | || mbcset->nranges || (dfa->mb_cur_max > 1 && (mbcset->nchar_classes | |
16859 | || mbcset->non_match))) | |
16860 | { | |
16861 | bin_tree_t *mbc_tree; | |
16862 | int sbc_idx; | |
16863 | ||
16864 | dfa->has_mb_node = 1; | |
16865 | br_token.type = COMPLEX_BRACKET; | |
16866 | br_token.opr.mbcset = mbcset; | |
16867 | mbc_tree = create_token_tree (dfa, ((void *)0), ((void *)0), &br_token); | |
16868 | if (__builtin_expect (mbc_tree == ((void *)0), 0)) | |
16869 | goto parse_bracket_exp_espace; | |
16870 | for (sbc_idx = 0; sbc_idx < (256 / (sizeof (bitset_word_t) * 8)); ++sbc_idx) | |
16871 | if (sbcset[sbc_idx]) | |
16872 | break; | |
16873 | ||
16874 | ||
16875 | if (sbc_idx < (256 / (sizeof (bitset_word_t) * 8))) | |
16876 | { | |
16877 | ||
16878 | br_token.type = SIMPLE_BRACKET; | |
16879 | br_token.opr.sbcset = sbcset; | |
16880 | work_tree = create_token_tree (dfa, ((void *)0), ((void *)0), &br_token); | |
16881 | if (__builtin_expect (work_tree == ((void *)0), 0)) | |
16882 | goto parse_bracket_exp_espace; | |
16883 | ||
16884 | ||
16885 | work_tree = create_tree (dfa, work_tree, mbc_tree, OP_ALT); | |
16886 | if (__builtin_expect (work_tree == ((void *)0), 0)) | |
16887 | goto parse_bracket_exp_espace; | |
16888 | } | |
16889 | else | |
16890 | { | |
16891 | free (sbcset); | |
16892 | work_tree = mbc_tree; | |
16893 | } | |
16894 | } | |
16895 | else | |
16896 | ||
16897 | { | |
16898 | ||
16899 | free_charset (mbcset); | |
16900 | ||
16901 | ||
16902 | br_token.type = SIMPLE_BRACKET; | |
16903 | br_token.opr.sbcset = sbcset; | |
16904 | work_tree = create_token_tree (dfa, ((void *)0), ((void *)0), &br_token); | |
16905 | if (__builtin_expect (work_tree == ((void *)0), 0)) | |
16906 | goto parse_bracket_exp_espace; | |
16907 | } | |
16908 | return work_tree; | |
16909 | ||
16910 | parse_bracket_exp_espace: | |
16911 | *err = REG_ESPACE; | |
16912 | parse_bracket_exp_free_return: | |
16913 | free (sbcset); | |
16914 | ||
16915 | free_charset (mbcset); | |
16916 | ||
16917 | return ((void *)0); | |
16918 | } | |
16919 | ||
16920 | ||
16921 | ||
16922 | static reg_errcode_t | |
16923 | parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp, | |
16924 | re_token_t *token, int token_len, re_dfa_t *dfa, | |
16925 | reg_syntax_t syntax, int accept_hyphen) | |
16926 | { | |
16927 | ||
16928 | int cur_char_size; | |
16929 | cur_char_size = re_string_char_size_at (regexp, ((regexp)->cur_idx)); | |
16930 | if (cur_char_size > 1) | |
16931 | { | |
16932 | elem->type = MB_CHAR; | |
16933 | elem->opr.wch = re_string_wchar_at (regexp, ((regexp)->cur_idx)); | |
16934 | ((regexp)->cur_idx += (cur_char_size)); | |
16935 | return REG_NOERROR; | |
16936 | } | |
16937 | ||
16938 | ((regexp)->cur_idx += (token_len)); | |
16939 | if (token->type == OP_OPEN_COLL_ELEM || token->type == OP_OPEN_CHAR_CLASS | |
16940 | || token->type == OP_OPEN_EQUIV_CLASS) | |
16941 | return parse_bracket_symbol (elem, regexp, token); | |
16942 | if (__builtin_expect (token->type == OP_CHARSET_RANGE, 0) && !accept_hyphen) | |
16943 | { | |
16944 | ||
16945 | ||
16946 | re_token_t token2; | |
16947 | (void) peek_token_bracket (&token2, regexp, syntax); | |
16948 | if (token2.type != OP_CLOSE_BRACKET) | |
16949 | ||
16950 | ||
16951 | return REG_ERANGE; | |
16952 | } | |
16953 | elem->type = SB_CHAR; | |
16954 | elem->opr.ch = token->opr.c; | |
16955 | return REG_NOERROR; | |
16956 | } | |
16957 | ||
16958 | ||
16959 | ||
16960 | ||
16961 | ||
16962 | static reg_errcode_t | |
16963 | parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp, | |
16964 | re_token_t *token) | |
16965 | { | |
16966 | unsigned char ch, delim = token->opr.c; | |
16967 | int i = 0; | |
16968 | if (((regexp)->stop <= (regexp)->cur_idx)) | |
16969 | return REG_EBRACK; | |
16970 | for (;; ++i) | |
16971 | { | |
16972 | if (i >= 32) | |
16973 | return REG_EBRACK; | |
16974 | if (token->type == OP_OPEN_CHAR_CLASS) | |
16975 | ch = re_string_fetch_byte_case (regexp); | |
16976 | else | |
16977 | ch = ((regexp)->mbs[(regexp)->cur_idx++]); | |
16978 | if (((regexp)->stop <= (regexp)->cur_idx)) | |
16979 | return REG_EBRACK; | |
16980 | if (ch == delim && ((regexp)->mbs[(regexp)->cur_idx + 0]) == ']') | |
16981 | break; | |
16982 | elem->opr.name[i] = ch; | |
16983 | } | |
16984 | ((regexp)->cur_idx += (1)); | |
16985 | elem->opr.name[i] = '\0'; | |
16986 | switch (token->type) | |
16987 | { | |
16988 | case OP_OPEN_COLL_ELEM: | |
16989 | elem->type = COLL_SYM; | |
16990 | break; | |
16991 | case OP_OPEN_EQUIV_CLASS: | |
16992 | elem->type = EQUIV_CLASS; | |
16993 | break; | |
16994 | case OP_OPEN_CHAR_CLASS: | |
16995 | elem->type = CHAR_CLASS; | |
16996 | break; | |
16997 | default: | |
16998 | break; | |
16999 | } | |
17000 | return REG_NOERROR; | |
17001 | } | |
17002 | ||
17003 | ||
17004 | ||
17005 | ||
17006 | ||
17007 | ||
17008 | ||
17009 | static reg_errcode_t | |
17010 | ||
17011 | build_equiv_class (bitset_t sbcset, re_charset_t *mbcset, | |
17012 | int *equiv_class_alloc, const unsigned char *name) | |
17013 | ||
17014 | ||
17015 | ||
17016 | { | |
17017 | ||
17018 | uint32_t nrules = ((uint32_t) (*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_NRULES) & 0xffff)].word); | |
17019 | if (nrules != 0) | |
17020 | { | |
17021 | const int32_t *table, *indirect; | |
17022 | const unsigned char *weights, *extra, *cp; | |
17023 | unsigned char char_buf[2]; | |
17024 | int32_t idx1, idx2; | |
17025 | unsigned int ch; | |
17026 | size_t len; | |
17027 | ||
17028 | # 1 "../locale/weight.h" 1 | |
17029 | # 21 "../locale/weight.h" | |
17030 | auto inline int32_t | |
17031 | __attribute__ ((always_inline)) | |
17032 | findidx (const unsigned char **cpp) | |
17033 | { | |
17034 | int_fast32_t i = table[*(*cpp)++]; | |
17035 | const unsigned char *cp; | |
17036 | const unsigned char *usrc; | |
17037 | ||
17038 | if (i >= 0) | |
17039 | ||
17040 | return i; | |
17041 | ||
17042 | ||
17043 | ||
17044 | cp = &extra[-i]; | |
17045 | usrc = *cpp; | |
17046 | while (1) | |
17047 | { | |
17048 | size_t nhere; | |
17049 | ||
17050 | ||
17051 | i = *((const int32_t *) cp); | |
17052 | cp += sizeof (int32_t); | |
17053 | ||
17054 | ||
17055 | ||
17056 | ||
17057 | nhere = *cp++; | |
17058 | ||
17059 | if (i >= 0) | |
17060 | { | |
17061 | ||
17062 | ||
17063 | ||
17064 | ||
17065 | ||
17066 | size_t cnt; | |
17067 | ||
17068 | for (cnt = 0; cnt < nhere; ++cnt) | |
17069 | if (cp[cnt] != usrc[cnt]) | |
17070 | break; | |
17071 | ||
17072 | if (cnt == nhere) | |
17073 | { | |
17074 | ||
17075 | *cpp += nhere; | |
17076 | return i; | |
17077 | } | |
17078 | ||
17079 | ||
17080 | cp += nhere; | |
17081 | if ((1 + nhere) % __alignof__ (int32_t) != 0) | |
17082 | cp += __alignof__ (int32_t) - (1 + nhere) % __alignof__ (int32_t); | |
17083 | } | |
17084 | else | |
17085 | { | |
17086 | ||
17087 | ||
17088 | size_t cnt; | |
17089 | size_t offset = 0; | |
17090 | ||
17091 | for (cnt = 0; cnt < nhere; ++cnt) | |
17092 | if (cp[cnt] != usrc[cnt]) | |
17093 | break; | |
17094 | ||
17095 | if (cnt != nhere) | |
17096 | { | |
17097 | if (cp[cnt] > usrc[cnt]) | |
17098 | { | |
17099 | ||
17100 | cp += 2 * nhere; | |
17101 | if ((1 + 2 * nhere) % __alignof__ (int32_t) != 0) | |
17102 | cp += (__alignof__ (int32_t) | |
17103 | - (1 + 2 * nhere) % __alignof__ (int32_t)); | |
17104 | continue; | |
17105 | } | |
17106 | ||
17107 | ||
17108 | for (cnt = 0; cnt < nhere; ++cnt) | |
17109 | if (cp[nhere + cnt] != usrc[cnt]) | |
17110 | break; | |
17111 | ||
17112 | if (cnt != nhere && cp[nhere + cnt] < usrc[cnt]) | |
17113 | { | |
17114 | ||
17115 | cp += 2 * nhere; | |
17116 | if ((1 + 2 * nhere) % __alignof__ (int32_t) != 0) | |
17117 | cp += (__alignof__ (int32_t) | |
17118 | - (1 + 2 * nhere) % __alignof__ (int32_t)); | |
17119 | continue; | |
17120 | } | |
17121 | ||
17122 | ||
17123 | ||
17124 | for (cnt = 0; cp[cnt] == usrc[cnt]; ++cnt); | |
17125 | ||
17126 | do | |
17127 | { | |
17128 | offset <<= 8; | |
17129 | offset += usrc[cnt] - cp[cnt]; | |
17130 | } | |
17131 | while (++cnt < nhere); | |
17132 | } | |
17133 | ||
17134 | *cpp += nhere; | |
17135 | return indirect[-i + offset]; | |
17136 | } | |
17137 | } | |
17138 | ||
17139 | ||
17140 | return 0x43219876; | |
17141 | } | |
17142 | # 3364 "regcomp.c" 2 | |
17143 | ||
17144 | cp = name; | |
17145 | table = (const int32_t *) ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_TABLEMB) & 0xffff)].string); | |
17146 | weights = (const unsigned char *) ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_WEIGHTMB) & 0xffff)].string); | |
17147 | ||
17148 | extra = (const unsigned char *) ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_EXTRAMB) & 0xffff)].string); | |
17149 | ||
17150 | indirect = (const int32_t *) ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_INDIRECTMB) & 0xffff)].string); | |
17151 | ||
17152 | idx1 = findidx (&cp); | |
17153 | if (__builtin_expect (idx1 == 0 || cp < name + strlen ((const char *) name), 0)) | |
17154 | ||
17155 | return REG_ECOLLATE; | |
17156 | ||
17157 | ||
17158 | char_buf[1] = (unsigned char) '\0'; | |
17159 | len = weights[idx1]; | |
17160 | for (ch = 0; ch < 256; ++ch) | |
17161 | { | |
17162 | char_buf[0] = ch; | |
17163 | cp = char_buf; | |
17164 | idx2 = findidx (&cp); | |
17165 | ||
17166 | ||
17167 | ||
17168 | if (idx2 == 0) | |
17169 | ||
17170 | continue; | |
17171 | if (len == weights[idx2]) | |
17172 | { | |
17173 | int cnt = 0; | |
17174 | while (cnt <= len && | |
17175 | weights[idx1 + 1 + cnt] == weights[idx2 + 1 + cnt]) | |
17176 | ++cnt; | |
17177 | ||
17178 | if (cnt > len) | |
17179 | (sbcset[ch / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << ch % (sizeof (bitset_word_t) * 8)); | |
17180 | } | |
17181 | } | |
17182 | ||
17183 | if (__builtin_expect (*equiv_class_alloc == mbcset->nequiv_classes, 0)) | |
17184 | { | |
17185 | ||
17186 | ||
17187 | int new_equiv_class_alloc = 2 * mbcset->nequiv_classes + 1; | |
17188 | ||
17189 | int32_t *new_equiv_classes = ((int32_t *) realloc (mbcset->equiv_classes, (new_equiv_class_alloc) * sizeof (int32_t))); | |
17190 | ||
17191 | ||
17192 | if (__builtin_expect (new_equiv_classes == ((void *)0), 0)) | |
17193 | return REG_ESPACE; | |
17194 | mbcset->equiv_classes = new_equiv_classes; | |
17195 | *equiv_class_alloc = new_equiv_class_alloc; | |
17196 | } | |
17197 | mbcset->equiv_classes[mbcset->nequiv_classes++] = idx1; | |
17198 | } | |
17199 | else | |
17200 | ||
17201 | { | |
17202 | if (__builtin_expect (strlen ((const char *) name) != 1, 0)) | |
17203 | return REG_ECOLLATE; | |
17204 | (sbcset[*name / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << *name % (sizeof (bitset_word_t) * 8)); | |
17205 | } | |
17206 | return REG_NOERROR; | |
17207 | } | |
17208 | ||
17209 | ||
17210 | ||
17211 | ||
17212 | ||
17213 | ||
17214 | ||
17215 | static reg_errcode_t | |
17216 | ||
17217 | build_charclass (unsigned char * trans, bitset_t sbcset, | |
17218 | re_charset_t *mbcset, int *char_class_alloc, | |
17219 | const unsigned char *class_name, reg_syntax_t syntax) | |
17220 | ||
17221 | ||
17222 | ||
17223 | ||
17224 | { | |
17225 | int i; | |
17226 | const char *name = (const char *) class_name; | |
17227 | ||
17228 | ||
17229 | ||
17230 | if ((syntax & ((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | |
17231 | && (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("upper") && (__s1_len = strlen (name), __s2_len = strlen ("upper"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("upper") + 1) - (size_t)(const void *)("upper") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "upper") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("upper") && ((size_t)(const void *)(("upper") + 1) - (size_t)(const void *)("upper") == 1) ? __builtin_strcmp (name, "upper") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("upper"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("upper") && ((size_t)(const void *)(("upper") + 1) - (size_t)(const void *)("upper") == 1) && (__s2_len = strlen ("upper"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "upper") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("upper"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("upper"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("upper"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("upper"))[3]); } } __result; }))) : __builtin_strcmp (name, "upper")))); }) == 0 || __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("lower") && (__s1_len = strlen (name), __s2_len = strlen ("lower"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("lower") + 1) - (size_t)(const void *)("lower") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "lower") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("lower") && ((size_t)(const void *)(("lower") + 1) - (size_t)(const void *)("lower") == 1) ? __builtin_strcmp (name, "lower") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("lower"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("lower") && ((size_t)(const void *)(("lower") + 1) - (size_t)(const void *)("lower") == 1) && (__s2_len = strlen ("lower"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "lower") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("lower"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("lower"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("lower"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("lower"))[3]); } } __result; }))) : __builtin_strcmp (name, "lower")))); }) == 0)) | |
17232 | name = "alpha"; | |
17233 | ||
17234 | ||
17235 | ||
17236 | if (__builtin_expect (*char_class_alloc == mbcset->nchar_classes, 0)) | |
17237 | { | |
17238 | ||
17239 | ||
17240 | int new_char_class_alloc = 2 * mbcset->nchar_classes + 1; | |
17241 | ||
17242 | wctype_t *new_char_classes = ((wctype_t *) realloc (mbcset->char_classes, (new_char_class_alloc) * sizeof (wctype_t))); | |
17243 | ||
17244 | if (__builtin_expect (new_char_classes == ((void *)0), 0)) | |
17245 | return REG_ESPACE; | |
17246 | mbcset->char_classes = new_char_classes; | |
17247 | *char_class_alloc = new_char_class_alloc; | |
17248 | } | |
17249 | mbcset->char_classes[mbcset->nchar_classes++] = __wctype (name); | |
17250 | # 3489 "regcomp.c" | |
17251 | if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("alnum") && (__s1_len = strlen (name), __s2_len = strlen ("alnum"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("alnum") + 1) - (size_t)(const void *)("alnum") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "alnum") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("alnum") && ((size_t)(const void *)(("alnum") + 1) - (size_t)(const void *)("alnum") == 1) ? __builtin_strcmp (name, "alnum") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("alnum"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("alnum") && ((size_t)(const void *)(("alnum") + 1) - (size_t)(const void *)("alnum") == 1) && (__s2_len = strlen ("alnum"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "alnum") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("alnum"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("alnum"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("alnum"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("alnum"))[3]); } } __result; }))) : __builtin_strcmp (name, "alnum")))); }) == 0) | |
17252 | do { if (__builtin_expect (trans != ((void *)0), 0)) { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISalnum)) (sbcset[trans[i] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << trans[i] % (sizeof (bitset_word_t) * 8)); } else { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISalnum)) (sbcset[i / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << i % (sizeof (bitset_word_t) * 8)); } } while (0); | |
17253 | else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("cntrl") && (__s1_len = strlen (name), __s2_len = strlen ("cntrl"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("cntrl") + 1) - (size_t)(const void *)("cntrl") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "cntrl") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("cntrl") && ((size_t)(const void *)(("cntrl") + 1) - (size_t)(const void *)("cntrl") == 1) ? __builtin_strcmp (name, "cntrl") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("cntrl"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("cntrl") && ((size_t)(const void *)(("cntrl") + 1) - (size_t)(const void *)("cntrl") == 1) && (__s2_len = strlen ("cntrl"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "cntrl") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("cntrl"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("cntrl"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("cntrl"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("cntrl"))[3]); } } __result; }))) : __builtin_strcmp (name, "cntrl")))); }) == 0) | |
17254 | do { if (__builtin_expect (trans != ((void *)0), 0)) { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _IScntrl)) (sbcset[trans[i] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << trans[i] % (sizeof (bitset_word_t) * 8)); } else { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _IScntrl)) (sbcset[i / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << i % (sizeof (bitset_word_t) * 8)); } } while (0); | |
17255 | else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("lower") && (__s1_len = strlen (name), __s2_len = strlen ("lower"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("lower") + 1) - (size_t)(const void *)("lower") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "lower") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("lower") && ((size_t)(const void *)(("lower") + 1) - (size_t)(const void *)("lower") == 1) ? __builtin_strcmp (name, "lower") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("lower"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("lower") && ((size_t)(const void *)(("lower") + 1) - (size_t)(const void *)("lower") == 1) && (__s2_len = strlen ("lower"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "lower") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("lower"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("lower"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("lower"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("lower"))[3]); } } __result; }))) : __builtin_strcmp (name, "lower")))); }) == 0) | |
17256 | do { if (__builtin_expect (trans != ((void *)0), 0)) { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISlower)) (sbcset[trans[i] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << trans[i] % (sizeof (bitset_word_t) * 8)); } else { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISlower)) (sbcset[i / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << i % (sizeof (bitset_word_t) * 8)); } } while (0); | |
17257 | else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("space") && (__s1_len = strlen (name), __s2_len = strlen ("space"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("space") + 1) - (size_t)(const void *)("space") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "space") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("space") && ((size_t)(const void *)(("space") + 1) - (size_t)(const void *)("space") == 1) ? __builtin_strcmp (name, "space") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("space"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("space") && ((size_t)(const void *)(("space") + 1) - (size_t)(const void *)("space") == 1) && (__s2_len = strlen ("space"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "space") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("space"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("space"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("space"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("space"))[3]); } } __result; }))) : __builtin_strcmp (name, "space")))); }) == 0) | |
17258 | do { if (__builtin_expect (trans != ((void *)0), 0)) { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISspace)) (sbcset[trans[i] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << trans[i] % (sizeof (bitset_word_t) * 8)); } else { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISspace)) (sbcset[i / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << i % (sizeof (bitset_word_t) * 8)); } } while (0); | |
17259 | else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("alpha") && (__s1_len = strlen (name), __s2_len = strlen ("alpha"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("alpha") + 1) - (size_t)(const void *)("alpha") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "alpha") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("alpha") && ((size_t)(const void *)(("alpha") + 1) - (size_t)(const void *)("alpha") == 1) ? __builtin_strcmp (name, "alpha") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("alpha"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("alpha") && ((size_t)(const void *)(("alpha") + 1) - (size_t)(const void *)("alpha") == 1) && (__s2_len = strlen ("alpha"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "alpha") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("alpha"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("alpha"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("alpha"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("alpha"))[3]); } } __result; }))) : __builtin_strcmp (name, "alpha")))); }) == 0) | |
17260 | do { if (__builtin_expect (trans != ((void *)0), 0)) { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISalpha)) (sbcset[trans[i] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << trans[i] % (sizeof (bitset_word_t) * 8)); } else { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISalpha)) (sbcset[i / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << i % (sizeof (bitset_word_t) * 8)); } } while (0); | |
17261 | else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("digit") && (__s1_len = strlen (name), __s2_len = strlen ("digit"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("digit") + 1) - (size_t)(const void *)("digit") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "digit") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("digit") && ((size_t)(const void *)(("digit") + 1) - (size_t)(const void *)("digit") == 1) ? __builtin_strcmp (name, "digit") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("digit"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("digit") && ((size_t)(const void *)(("digit") + 1) - (size_t)(const void *)("digit") == 1) && (__s2_len = strlen ("digit"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "digit") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("digit"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("digit"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("digit"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("digit"))[3]); } } __result; }))) : __builtin_strcmp (name, "digit")))); }) == 0) | |
17262 | do { if (__builtin_expect (trans != ((void *)0), 0)) { for (i = 0; i < 256; ++i) if (({ int __c = (i); __c >= '0' && __c <= '9'; })) (sbcset[trans[i] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << trans[i] % (sizeof (bitset_word_t) * 8)); } else { for (i = 0; i < 256; ++i) if (({ int __c = (i); __c >= '0' && __c <= '9'; })) (sbcset[i / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << i % (sizeof (bitset_word_t) * 8)); } } while (0); | |
17263 | else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("print") && (__s1_len = strlen (name), __s2_len = strlen ("print"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("print") + 1) - (size_t)(const void *)("print") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "print") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("print") && ((size_t)(const void *)(("print") + 1) - (size_t)(const void *)("print") == 1) ? __builtin_strcmp (name, "print") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("print"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("print") && ((size_t)(const void *)(("print") + 1) - (size_t)(const void *)("print") == 1) && (__s2_len = strlen ("print"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "print") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("print"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("print"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("print"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("print"))[3]); } } __result; }))) : __builtin_strcmp (name, "print")))); }) == 0) | |
17264 | do { if (__builtin_expect (trans != ((void *)0), 0)) { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISprint)) (sbcset[trans[i] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << trans[i] % (sizeof (bitset_word_t) * 8)); } else { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISprint)) (sbcset[i / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << i % (sizeof (bitset_word_t) * 8)); } } while (0); | |
17265 | else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("upper") && (__s1_len = strlen (name), __s2_len = strlen ("upper"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("upper") + 1) - (size_t)(const void *)("upper") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "upper") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("upper") && ((size_t)(const void *)(("upper") + 1) - (size_t)(const void *)("upper") == 1) ? __builtin_strcmp (name, "upper") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("upper"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("upper") && ((size_t)(const void *)(("upper") + 1) - (size_t)(const void *)("upper") == 1) && (__s2_len = strlen ("upper"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "upper") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("upper"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("upper"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("upper"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("upper"))[3]); } } __result; }))) : __builtin_strcmp (name, "upper")))); }) == 0) | |
17266 | do { if (__builtin_expect (trans != ((void *)0), 0)) { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISupper)) (sbcset[trans[i] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << trans[i] % (sizeof (bitset_word_t) * 8)); } else { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISupper)) (sbcset[i / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << i % (sizeof (bitset_word_t) * 8)); } } while (0); | |
17267 | else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("blank") && (__s1_len = strlen (name), __s2_len = strlen ("blank"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("blank") + 1) - (size_t)(const void *)("blank") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "blank") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("blank") && ((size_t)(const void *)(("blank") + 1) - (size_t)(const void *)("blank") == 1) ? __builtin_strcmp (name, "blank") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("blank"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("blank") && ((size_t)(const void *)(("blank") + 1) - (size_t)(const void *)("blank") == 1) && (__s2_len = strlen ("blank"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "blank") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("blank"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("blank"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("blank"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("blank"))[3]); } } __result; }))) : __builtin_strcmp (name, "blank")))); }) == 0) | |
17268 | do { if (__builtin_expect (trans != ((void *)0), 0)) { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISblank)) (sbcset[trans[i] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << trans[i] % (sizeof (bitset_word_t) * 8)); } else { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISblank)) (sbcset[i / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << i % (sizeof (bitset_word_t) * 8)); } } while (0); | |
17269 | else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("graph") && (__s1_len = strlen (name), __s2_len = strlen ("graph"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("graph") + 1) - (size_t)(const void *)("graph") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "graph") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("graph") && ((size_t)(const void *)(("graph") + 1) - (size_t)(const void *)("graph") == 1) ? __builtin_strcmp (name, "graph") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("graph"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("graph") && ((size_t)(const void *)(("graph") + 1) - (size_t)(const void *)("graph") == 1) && (__s2_len = strlen ("graph"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "graph") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("graph"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("graph"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("graph"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("graph"))[3]); } } __result; }))) : __builtin_strcmp (name, "graph")))); }) == 0) | |
17270 | do { if (__builtin_expect (trans != ((void *)0), 0)) { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISgraph)) (sbcset[trans[i] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << trans[i] % (sizeof (bitset_word_t) * 8)); } else { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISgraph)) (sbcset[i / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << i % (sizeof (bitset_word_t) * 8)); } } while (0); | |
17271 | else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("punct") && (__s1_len = strlen (name), __s2_len = strlen ("punct"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("punct") + 1) - (size_t)(const void *)("punct") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "punct") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("punct") && ((size_t)(const void *)(("punct") + 1) - (size_t)(const void *)("punct") == 1) ? __builtin_strcmp (name, "punct") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("punct"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("punct") && ((size_t)(const void *)(("punct") + 1) - (size_t)(const void *)("punct") == 1) && (__s2_len = strlen ("punct"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "punct") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("punct"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("punct"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("punct"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("punct"))[3]); } } __result; }))) : __builtin_strcmp (name, "punct")))); }) == 0) | |
17272 | do { if (__builtin_expect (trans != ((void *)0), 0)) { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISpunct)) (sbcset[trans[i] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << trans[i] % (sizeof (bitset_word_t) * 8)); } else { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISpunct)) (sbcset[i / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << i % (sizeof (bitset_word_t) * 8)); } } while (0); | |
17273 | else if (__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("xdigit") && (__s1_len = strlen (name), __s2_len = strlen ("xdigit"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("xdigit") + 1) - (size_t)(const void *)("xdigit") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "xdigit") : (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) && (__s1_len = strlen (name), __s1_len < 4) ? (__builtin_constant_p ("xdigit") && ((size_t)(const void *)(("xdigit") + 1) - (size_t)(const void *)("xdigit") == 1) ? __builtin_strcmp (name, "xdigit") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("xdigit"); register int __result = (((__const unsigned char *) (__const char *) (name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("xdigit") && ((size_t)(const void *)(("xdigit") + 1) - (size_t)(const void *)("xdigit") == 1) && (__s2_len = strlen ("xdigit"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "xdigit") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("xdigit"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("xdigit"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("xdigit"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("xdigit"))[3]); } } __result; }))) : __builtin_strcmp (name, "xdigit")))); }) == 0) | |
17274 | do { if (__builtin_expect (trans != ((void *)0), 0)) { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISxdigit)) (sbcset[trans[i] / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << trans[i] % (sizeof (bitset_word_t) * 8)); } else { for (i = 0; i < 256; ++i) if (((*__ctype_b_loc ())[(int) ((i))] & (unsigned short int) _ISxdigit)) (sbcset[i / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << i % (sizeof (bitset_word_t) * 8)); } } while (0); | |
17275 | else | |
17276 | return REG_ECTYPE; | |
17277 | ||
17278 | return REG_NOERROR; | |
17279 | } | |
17280 | ||
17281 | static bin_tree_t * | |
17282 | build_charclass_op (re_dfa_t *dfa, unsigned char * trans, | |
17283 | const unsigned char *class_name, | |
17284 | const unsigned char *extra, int non_match, | |
17285 | reg_errcode_t *err) | |
17286 | { | |
17287 | re_bitset_ptr_t sbcset; | |
17288 | ||
17289 | re_charset_t *mbcset; | |
17290 | int alloc = 0; | |
17291 | ||
17292 | reg_errcode_t ret; | |
17293 | re_token_t br_token; | |
17294 | bin_tree_t *tree; | |
17295 | ||
17296 | sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1); | |
17297 | ||
17298 | mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1); | |
17299 | ||
17300 | ||
17301 | ||
17302 | if (__builtin_expect (sbcset == ((void *)0) || mbcset == ((void *)0), 0)) | |
17303 | ||
17304 | ||
17305 | ||
17306 | { | |
17307 | *err = REG_ESPACE; | |
17308 | return ((void *)0); | |
17309 | } | |
17310 | ||
17311 | if (non_match) | |
17312 | { | |
17313 | ||
17314 | ||
17315 | ||
17316 | ||
17317 | ||
17318 | mbcset->non_match = 1; | |
17319 | ||
17320 | } | |
17321 | ||
17322 | ||
17323 | ret = build_charclass (trans, sbcset, | |
17324 | ||
17325 | mbcset, &alloc, | |
17326 | ||
17327 | class_name, 0); | |
17328 | ||
17329 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
17330 | { | |
17331 | free (sbcset); | |
17332 | ||
17333 | free_charset (mbcset); | |
17334 | ||
17335 | *err = ret; | |
17336 | return ((void *)0); | |
17337 | } | |
17338 | ||
17339 | for (; *extra; extra++) | |
17340 | (sbcset[*extra / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << *extra % (sizeof (bitset_word_t) * 8)); | |
17341 | ||
17342 | ||
17343 | if (non_match) | |
17344 | bitset_not (sbcset); | |
17345 | ||
17346 | ||
17347 | ||
17348 | if (dfa->mb_cur_max > 1) | |
17349 | bitset_mask (sbcset, dfa->sb_char); | |
17350 | ||
17351 | ||
17352 | ||
17353 | br_token.type = SIMPLE_BRACKET; | |
17354 | br_token.opr.sbcset = sbcset; | |
17355 | tree = create_token_tree (dfa, ((void *)0), ((void *)0), &br_token); | |
17356 | if (__builtin_expect (tree == ((void *)0), 0)) | |
17357 | goto build_word_op_espace; | |
17358 | ||
17359 | ||
17360 | if (dfa->mb_cur_max > 1) | |
17361 | { | |
17362 | bin_tree_t *mbc_tree; | |
17363 | ||
17364 | br_token.type = COMPLEX_BRACKET; | |
17365 | br_token.opr.mbcset = mbcset; | |
17366 | dfa->has_mb_node = 1; | |
17367 | mbc_tree = create_token_tree (dfa, ((void *)0), ((void *)0), &br_token); | |
17368 | if (__builtin_expect (mbc_tree == ((void *)0), 0)) | |
17369 | goto build_word_op_espace; | |
17370 | ||
17371 | tree = create_tree (dfa, tree, mbc_tree, OP_ALT); | |
17372 | if (__builtin_expect (mbc_tree != ((void *)0), 1)) | |
17373 | return tree; | |
17374 | } | |
17375 | else | |
17376 | { | |
17377 | free_charset (mbcset); | |
17378 | return tree; | |
17379 | } | |
17380 | ||
17381 | ||
17382 | ||
17383 | ||
17384 | build_word_op_espace: | |
17385 | free (sbcset); | |
17386 | ||
17387 | free_charset (mbcset); | |
17388 | ||
17389 | *err = REG_ESPACE; | |
17390 | return ((void *)0); | |
17391 | } | |
17392 | ||
17393 | ||
17394 | ||
17395 | ||
17396 | ||
17397 | ||
17398 | static int | |
17399 | fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax) | |
17400 | { | |
17401 | int num = -1; | |
17402 | unsigned char c; | |
17403 | while (1) | |
17404 | { | |
17405 | fetch_token (token, input, syntax); | |
17406 | c = token->opr.c; | |
17407 | if (__builtin_expect (token->type == END_OF_RE, 0)) | |
17408 | return -2; | |
17409 | if (token->type == OP_CLOSE_DUP_NUM || c == ',') | |
17410 | break; | |
17411 | num = ((token->type != CHARACTER || c < '0' || '9' < c || num == -2) | |
17412 | ? -2 : ((num == -1) ? c - '0' : num * 10 + c - '0')); | |
17413 | num = (num > (0x7fff)) ? -2 : num; | |
17414 | } | |
17415 | return num; | |
17416 | } | |
17417 | ||
17418 | ||
17419 | static void | |
17420 | free_charset (re_charset_t *cset) | |
17421 | { | |
17422 | free (cset->mbchars); | |
17423 | ||
17424 | free (cset->coll_syms); | |
17425 | free (cset->equiv_classes); | |
17426 | free (cset->range_starts); | |
17427 | free (cset->range_ends); | |
17428 | ||
17429 | free (cset->char_classes); | |
17430 | free (cset); | |
17431 | } | |
17432 | ||
17433 | ||
17434 | ||
17435 | ||
17436 | ||
17437 | ||
17438 | static bin_tree_t * | |
17439 | create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, | |
17440 | re_token_type_t type) | |
17441 | { | |
17442 | re_token_t t; | |
17443 | t.type = type; | |
17444 | return create_token_tree (dfa, left, right, &t); | |
17445 | } | |
17446 | ||
17447 | static bin_tree_t * | |
17448 | create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, | |
17449 | const re_token_t *token) | |
17450 | { | |
17451 | bin_tree_t *tree; | |
17452 | if (__builtin_expect (dfa->str_tree_storage_idx == ((1024 - sizeof (void *)) / sizeof (bin_tree_t)), 0)) | |
17453 | { | |
17454 | bin_tree_storage_t *storage = ((bin_tree_storage_t *) malloc ((1) * sizeof (bin_tree_storage_t))); | |
17455 | ||
17456 | if (storage == ((void *)0)) | |
17457 | return ((void *)0); | |
17458 | storage->next = dfa->str_tree_storage; | |
17459 | dfa->str_tree_storage = storage; | |
17460 | dfa->str_tree_storage_idx = 0; | |
17461 | } | |
17462 | tree = &dfa->str_tree_storage->data[dfa->str_tree_storage_idx++]; | |
17463 | ||
17464 | tree->parent = ((void *)0); | |
17465 | tree->left = left; | |
17466 | tree->right = right; | |
17467 | tree->token = *token; | |
17468 | tree->token.duplicated = 0; | |
17469 | tree->token.opt_subexp = 0; | |
17470 | tree->first = ((void *)0); | |
17471 | tree->next = ((void *)0); | |
17472 | tree->node_idx = -1; | |
17473 | ||
17474 | if (left != ((void *)0)) | |
17475 | left->parent = tree; | |
17476 | if (right != ((void *)0)) | |
17477 | right->parent = tree; | |
17478 | return tree; | |
17479 | } | |
17480 | ||
17481 | ||
17482 | ||
17483 | ||
17484 | static reg_errcode_t | |
17485 | mark_opt_subexp (void *extra, bin_tree_t *node) | |
17486 | { | |
17487 | int idx = (int) (long) extra; | |
17488 | if (node->token.type == SUBEXP && node->token.opr.idx == idx) | |
17489 | node->token.opt_subexp = 1; | |
17490 | ||
17491 | return REG_NOERROR; | |
17492 | } | |
17493 | ||
17494 | ||
17495 | ||
17496 | static void | |
17497 | free_token (re_token_t *node) | |
17498 | { | |
17499 | ||
17500 | if (node->type == COMPLEX_BRACKET && node->duplicated == 0) | |
17501 | free_charset (node->opr.mbcset); | |
17502 | else | |
17503 | ||
17504 | if (node->type == SIMPLE_BRACKET && node->duplicated == 0) | |
17505 | free (node->opr.sbcset); | |
17506 | } | |
17507 | ||
17508 | ||
17509 | ||
17510 | ||
17511 | static reg_errcode_t | |
17512 | free_tree (void *extra, bin_tree_t *node) | |
17513 | { | |
17514 | free_token (&node->token); | |
17515 | return REG_NOERROR; | |
17516 | } | |
17517 | ||
17518 | ||
17519 | ||
17520 | ||
17521 | ||
17522 | ||
17523 | ||
17524 | static bin_tree_t * | |
17525 | duplicate_tree (const bin_tree_t *root, re_dfa_t *dfa) | |
17526 | { | |
17527 | const bin_tree_t *node; | |
17528 | bin_tree_t *dup_root; | |
17529 | bin_tree_t **p_new = &dup_root, *dup_node = root->parent; | |
17530 | ||
17531 | for (node = root; ; ) | |
17532 | { | |
17533 | ||
17534 | *p_new = create_token_tree (dfa, ((void *)0), ((void *)0), &node->token); | |
17535 | if (*p_new == ((void *)0)) | |
17536 | return ((void *)0); | |
17537 | (*p_new)->parent = dup_node; | |
17538 | (*p_new)->token.duplicated = 1; | |
17539 | dup_node = *p_new; | |
17540 | ||
17541 | ||
17542 | if (node->left) | |
17543 | { | |
17544 | node = node->left; | |
17545 | p_new = &dup_node->left; | |
17546 | } | |
17547 | else | |
17548 | { | |
17549 | const bin_tree_t *prev = ((void *)0); | |
17550 | while (node->right == prev || node->right == ((void *)0)) | |
17551 | { | |
17552 | prev = node; | |
17553 | node = node->parent; | |
17554 | dup_node = dup_node->parent; | |
17555 | if (!node) | |
17556 | return dup_root; | |
17557 | } | |
17558 | node = node->right; | |
17559 | p_new = &dup_node->right; | |
17560 | } | |
17561 | } | |
17562 | } | |
17563 | # 65 "regex.c" 2 | |
17564 | # 1 "regexec.c" 1 | |
17565 | # 21 "regexec.c" | |
17566 | static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags, | |
17567 | int n) ; | |
17568 | static void match_ctx_clean (re_match_context_t *mctx) ; | |
17569 | static void match_ctx_free (re_match_context_t *cache) ; | |
17570 | static reg_errcode_t match_ctx_add_entry (re_match_context_t *cache, int node, | |
17571 | int str_idx, int from, int to) | |
17572 | ; | |
17573 | static int search_cur_bkref_entry (const re_match_context_t *mctx, int str_idx) | |
17574 | ; | |
17575 | static reg_errcode_t match_ctx_add_subtop (re_match_context_t *mctx, int node, | |
17576 | int str_idx) ; | |
17577 | static re_sub_match_last_t * match_ctx_add_sublast (re_sub_match_top_t *subtop, | |
17578 | int node, int str_idx) | |
17579 | ; | |
17580 | static void sift_ctx_init (re_sift_context_t *sctx, re_dfastate_t **sifted_sts, | |
17581 | re_dfastate_t **limited_sts, int last_node, | |
17582 | int last_str_idx) | |
17583 | ; | |
17584 | static reg_errcode_t re_search_internal (const regex_t *preg, | |
17585 | const char *string, int length, | |
17586 | int start, int range, int stop, | |
17587 | size_t nmatch, regmatch_t pmatch[], | |
17588 | int eflags) ; | |
17589 | static int re_search_2_stub (struct re_pattern_buffer *bufp, | |
17590 | const char *string1, int length1, | |
17591 | const char *string2, int length2, | |
17592 | int start, int range, struct re_registers *regs, | |
17593 | int stop, int ret_len) ; | |
17594 | static int re_search_stub (struct re_pattern_buffer *bufp, | |
17595 | const char *string, int length, int start, | |
17596 | int range, int stop, struct re_registers *regs, | |
17597 | int ret_len) ; | |
17598 | static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, | |
17599 | int nregs, int regs_allocated) ; | |
17600 | static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx) | |
17601 | ; | |
17602 | static int check_matching (re_match_context_t *mctx, int fl_longest_match, | |
17603 | int *p_match_first) ; | |
17604 | static int check_halt_state_context (const re_match_context_t *mctx, | |
17605 | const re_dfastate_t *state, int idx) | |
17606 | ; | |
17607 | static void update_regs (const re_dfa_t *dfa, regmatch_t *pmatch, | |
17608 | regmatch_t *prev_idx_match, int cur_node, | |
17609 | int cur_idx, int nmatch) ; | |
17610 | static reg_errcode_t push_fail_stack (struct re_fail_stack_t *fs, | |
17611 | int str_idx, int dest_node, int nregs, | |
17612 | regmatch_t *regs, | |
17613 | re_node_set *eps_via_nodes) | |
17614 | ; | |
17615 | static reg_errcode_t set_regs (const regex_t *preg, | |
17616 | const re_match_context_t *mctx, | |
17617 | size_t nmatch, regmatch_t *pmatch, | |
17618 | int fl_backtrack) ; | |
17619 | static reg_errcode_t free_fail_stack_return (struct re_fail_stack_t *fs) | |
17620 | ; | |
17621 | ||
17622 | ||
17623 | static int sift_states_iter_mb (const re_match_context_t *mctx, | |
17624 | re_sift_context_t *sctx, | |
17625 | int node_idx, int str_idx, int max_str_idx) | |
17626 | ; | |
17627 | ||
17628 | static reg_errcode_t sift_states_backward (const re_match_context_t *mctx, | |
17629 | re_sift_context_t *sctx) | |
17630 | ; | |
17631 | static reg_errcode_t build_sifted_states (const re_match_context_t *mctx, | |
17632 | re_sift_context_t *sctx, int str_idx, | |
17633 | re_node_set *cur_dest) | |
17634 | ; | |
17635 | static reg_errcode_t update_cur_sifted_state (const re_match_context_t *mctx, | |
17636 | re_sift_context_t *sctx, | |
17637 | int str_idx, | |
17638 | re_node_set *dest_nodes) | |
17639 | ; | |
17640 | static reg_errcode_t add_epsilon_src_nodes (const re_dfa_t *dfa, | |
17641 | re_node_set *dest_nodes, | |
17642 | const re_node_set *candidates) | |
17643 | ; | |
17644 | static int check_dst_limits (const re_match_context_t *mctx, | |
17645 | re_node_set *limits, | |
17646 | int dst_node, int dst_idx, int src_node, | |
17647 | int src_idx) ; | |
17648 | static int check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, | |
17649 | int boundaries, int subexp_idx, | |
17650 | int from_node, int bkref_idx) | |
17651 | ; | |
17652 | static int check_dst_limits_calc_pos (const re_match_context_t *mctx, | |
17653 | int limit, int subexp_idx, | |
17654 | int node, int str_idx, | |
17655 | int bkref_idx) ; | |
17656 | static reg_errcode_t check_subexp_limits (const re_dfa_t *dfa, | |
17657 | re_node_set *dest_nodes, | |
17658 | const re_node_set *candidates, | |
17659 | re_node_set *limits, | |
17660 | struct re_backref_cache_entry *bkref_ents, | |
17661 | int str_idx) ; | |
17662 | static reg_errcode_t sift_states_bkref (const re_match_context_t *mctx, | |
17663 | re_sift_context_t *sctx, | |
17664 | int str_idx, const re_node_set *candidates) | |
17665 | ; | |
17666 | static reg_errcode_t merge_state_array (const re_dfa_t *dfa, | |
17667 | re_dfastate_t **dst, | |
17668 | re_dfastate_t **src, int num) | |
17669 | ; | |
17670 | static re_dfastate_t *find_recover_state (reg_errcode_t *err, | |
17671 | re_match_context_t *mctx) ; | |
17672 | static re_dfastate_t *transit_state (reg_errcode_t *err, | |
17673 | re_match_context_t *mctx, | |
17674 | re_dfastate_t *state) ; | |
17675 | static re_dfastate_t *merge_state_with_log (reg_errcode_t *err, | |
17676 | re_match_context_t *mctx, | |
17677 | re_dfastate_t *next_state) | |
17678 | ; | |
17679 | static reg_errcode_t check_subexp_matching_top (re_match_context_t *mctx, | |
17680 | re_node_set *cur_nodes, | |
17681 | int str_idx) ; | |
17682 | ||
17683 | ||
17684 | ||
17685 | ||
17686 | ||
17687 | ||
17688 | ||
17689 | static reg_errcode_t transit_state_mb (re_match_context_t *mctx, | |
17690 | re_dfastate_t *pstate) | |
17691 | ; | |
17692 | ||
17693 | static reg_errcode_t transit_state_bkref (re_match_context_t *mctx, | |
17694 | const re_node_set *nodes) | |
17695 | ; | |
17696 | static reg_errcode_t get_subexp (re_match_context_t *mctx, | |
17697 | int bkref_node, int bkref_str_idx) | |
17698 | ; | |
17699 | static reg_errcode_t get_subexp_sub (re_match_context_t *mctx, | |
17700 | const re_sub_match_top_t *sub_top, | |
17701 | re_sub_match_last_t *sub_last, | |
17702 | int bkref_node, int bkref_str) | |
17703 | ; | |
17704 | static int find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes, | |
17705 | int subexp_idx, int type) ; | |
17706 | static reg_errcode_t check_arrival (re_match_context_t *mctx, | |
17707 | state_array_t *path, int top_node, | |
17708 | int top_str, int last_node, int last_str, | |
17709 | int type) ; | |
17710 | static reg_errcode_t check_arrival_add_next_nodes (re_match_context_t *mctx, | |
17711 | int str_idx, | |
17712 | re_node_set *cur_nodes, | |
17713 | re_node_set *next_nodes) | |
17714 | ; | |
17715 | static reg_errcode_t check_arrival_expand_ecl (const re_dfa_t *dfa, | |
17716 | re_node_set *cur_nodes, | |
17717 | int ex_subexp, int type) | |
17718 | ; | |
17719 | static reg_errcode_t check_arrival_expand_ecl_sub (const re_dfa_t *dfa, | |
17720 | re_node_set *dst_nodes, | |
17721 | int target, int ex_subexp, | |
17722 | int type) ; | |
17723 | static reg_errcode_t expand_bkref_cache (re_match_context_t *mctx, | |
17724 | re_node_set *cur_nodes, int cur_str, | |
17725 | int subexp_num, int type) | |
17726 | ; | |
17727 | static int build_trtable (const re_dfa_t *dfa, | |
17728 | re_dfastate_t *state) ; | |
17729 | ||
17730 | static int check_node_accept_bytes (const re_dfa_t *dfa, int node_idx, | |
17731 | const re_string_t *input, int idx) | |
17732 | ; | |
17733 | ||
17734 | static unsigned int find_collation_sequence_value (const unsigned char *mbs, | |
17735 | size_t name_len) | |
17736 | ; | |
17737 | ||
17738 | ||
17739 | static int group_nodes_into_DFAstates (const re_dfa_t *dfa, | |
17740 | const re_dfastate_t *state, | |
17741 | re_node_set *states_node, | |
17742 | bitset_t *states_ch) ; | |
17743 | static int check_node_accept (const re_match_context_t *mctx, | |
17744 | const re_token_t *node, int idx) | |
17745 | ; | |
17746 | static reg_errcode_t extend_buffers (re_match_context_t *mctx) | |
17747 | ; | |
17748 | # 220 "regexec.c" | |
17749 | int | |
17750 | __regexec (preg, string, nmatch, pmatch, eflags) | |
17751 | const regex_t *__restrict preg; | |
17752 | const char *__restrict string; | |
17753 | size_t nmatch; | |
17754 | regmatch_t pmatch[]; | |
17755 | int eflags; | |
17756 | { | |
17757 | reg_errcode_t err; | |
17758 | int start, length; | |
17759 | re_dfa_t *dfa = (re_dfa_t *) preg->buffer; | |
17760 | ||
17761 | if (eflags & ~(1 | (1 << 1) | (1 << 2))) | |
17762 | return REG_BADPAT; | |
17763 | ||
17764 | if (eflags & (1 << 2)) | |
17765 | { | |
17766 | start = pmatch[0].rm_so; | |
17767 | length = pmatch[0].rm_eo; | |
17768 | } | |
17769 | else | |
17770 | { | |
17771 | start = 0; | |
17772 | length = strlen (string); | |
17773 | } | |
17774 | ||
17775 | ({ __lll_mutex_lock (&(dfa->lock)); 0; }); | |
17776 | if (preg->no_sub) | |
17777 | err = re_search_internal (preg, string, length, start, length - start, | |
17778 | length, 0, ((void *)0), eflags); | |
17779 | else | |
17780 | err = re_search_internal (preg, string, length, start, length - start, | |
17781 | length, nmatch, pmatch, eflags); | |
17782 | __lll_mutex_unlock(&(dfa->lock)); | |
17783 | return err != REG_NOERROR; | |
17784 | } | |
17785 | ||
17786 | ||
17787 | # 1 "../include/shlib-compat.h" 1 | |
17788 | # 26 "../include/shlib-compat.h" | |
17789 | # 1 "/var/tmp/portage/glibc-2.5/work/build-default-hppa2.0-unknown-linux-gnu-nptl/abi-versions.h" 1 | |
17790 | # 27 "../include/shlib-compat.h" 2 | |
17791 | # 259 "regexec.c" 2 | |
17792 | extern __typeof (__regexec) regexec __attribute__ ((weak, alias ("__regexec")));; | |
17793 | # 306 "regexec.c" | |
17794 | int | |
17795 | __re_match (bufp, string, length, start, regs) | |
17796 | struct re_pattern_buffer *bufp; | |
17797 | const char *string; | |
17798 | int length, start; | |
17799 | struct re_registers *regs; | |
17800 | { | |
17801 | return re_search_stub (bufp, string, length, start, 0, length, regs, 1); | |
17802 | } | |
17803 | ||
17804 | extern __typeof (__re_match) re_match __attribute__ ((weak, alias ("__re_match"))); | |
17805 | ||
17806 | ||
17807 | int | |
17808 | __re_search (bufp, string, length, start, range, regs) | |
17809 | struct re_pattern_buffer *bufp; | |
17810 | const char *string; | |
17811 | int length, start, range; | |
17812 | struct re_registers *regs; | |
17813 | { | |
17814 | return re_search_stub (bufp, string, length, start, range, length, regs, 0); | |
17815 | } | |
17816 | ||
17817 | extern __typeof (__re_search) re_search __attribute__ ((weak, alias ("__re_search"))); | |
17818 | ||
17819 | ||
17820 | int | |
17821 | __re_match_2 (bufp, string1, length1, string2, length2, start, regs, stop) | |
17822 | struct re_pattern_buffer *bufp; | |
17823 | const char *string1, *string2; | |
17824 | int length1, length2, start, stop; | |
17825 | struct re_registers *regs; | |
17826 | { | |
17827 | return re_search_2_stub (bufp, string1, length1, string2, length2, | |
17828 | start, 0, regs, stop, 1); | |
17829 | } | |
17830 | ||
17831 | extern __typeof (__re_match_2) re_match_2 __attribute__ ((weak, alias ("__re_match_2"))); | |
17832 | ||
17833 | ||
17834 | int | |
17835 | __re_search_2 (bufp, string1, length1, string2, length2, start, range, regs, stop) | |
17836 | struct re_pattern_buffer *bufp; | |
17837 | const char *string1, *string2; | |
17838 | int length1, length2, start, range, stop; | |
17839 | struct re_registers *regs; | |
17840 | { | |
17841 | return re_search_2_stub (bufp, string1, length1, string2, length2, | |
17842 | start, range, regs, stop, 0); | |
17843 | } | |
17844 | ||
17845 | extern __typeof (__re_search_2) re_search_2 __attribute__ ((weak, alias ("__re_search_2"))); | |
17846 | ||
17847 | ||
17848 | static int | |
17849 | re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs, | |
17850 | stop, ret_len) | |
17851 | struct re_pattern_buffer *bufp; | |
17852 | const char *string1, *string2; | |
17853 | int length1, length2, start, range, stop, ret_len; | |
17854 | struct re_registers *regs; | |
17855 | { | |
17856 | const char *str; | |
17857 | int rval; | |
17858 | int len = length1 + length2; | |
17859 | int free_str = 0; | |
17860 | ||
17861 | if (__builtin_expect (length1 < 0 || length2 < 0 || stop < 0, 0)) | |
17862 | return -2; | |
17863 | ||
17864 | ||
17865 | if (length2 > 0) | |
17866 | if (length1 > 0) | |
17867 | { | |
17868 | char *s = ((char *) malloc ((len) * sizeof (char))); | |
17869 | ||
17870 | if (__builtin_expect (s == ((void *)0), 0)) | |
17871 | return -2; | |
17872 | ||
17873 | memcpy (__builtin_mempcpy (s, string1, length1), string2, length2); | |
17874 | ||
17875 | ||
17876 | ||
17877 | ||
17878 | str = s; | |
17879 | free_str = 1; | |
17880 | } | |
17881 | else | |
17882 | str = string2; | |
17883 | else | |
17884 | str = string1; | |
17885 | ||
17886 | rval = re_search_stub (bufp, str, len, start, range, stop, regs, | |
17887 | ret_len); | |
17888 | if (free_str) | |
17889 | free ((char *) str); | |
17890 | return rval; | |
17891 | } | |
17892 | ||
17893 | ||
17894 | ||
17895 | ||
17896 | ||
17897 | ||
17898 | static int | |
17899 | re_search_stub (bufp, string, length, start, range, stop, regs, ret_len) | |
17900 | struct re_pattern_buffer *bufp; | |
17901 | const char *string; | |
17902 | int length, start, range, stop, ret_len; | |
17903 | struct re_registers *regs; | |
17904 | { | |
17905 | reg_errcode_t result; | |
17906 | regmatch_t *pmatch; | |
17907 | int nregs, rval; | |
17908 | int eflags = 0; | |
17909 | re_dfa_t *dfa = (re_dfa_t *) bufp->buffer; | |
17910 | ||
17911 | ||
17912 | if (__builtin_expect (start < 0 || start > length, 0)) | |
17913 | return -1; | |
17914 | if (__builtin_expect (start + range > length, 0)) | |
17915 | range = length - start; | |
17916 | else if (__builtin_expect (start + range < 0, 0)) | |
17917 | range = -start; | |
17918 | ||
17919 | ({ __lll_mutex_lock (&(dfa->lock)); 0; }); | |
17920 | ||
17921 | eflags |= (bufp->not_bol) ? 1 : 0; | |
17922 | eflags |= (bufp->not_eol) ? (1 << 1) : 0; | |
17923 | ||
17924 | ||
17925 | if (range > 0 && bufp->fastmap != ((void *)0) && !bufp->fastmap_accurate) | |
17926 | __re_compile_fastmap (bufp); | |
17927 | ||
17928 | if (__builtin_expect (bufp->no_sub, 0)) | |
17929 | regs = ((void *)0); | |
17930 | ||
17931 | ||
17932 | if (regs == ((void *)0)) | |
17933 | nregs = 1; | |
17934 | else if (__builtin_expect (bufp->regs_allocated == 2 && regs->num_regs < bufp->re_nsub + 1, 0)) | |
17935 | ||
17936 | { | |
17937 | nregs = regs->num_regs; | |
17938 | if (__builtin_expect (nregs < 1, 0)) | |
17939 | { | |
17940 | ||
17941 | regs = ((void *)0); | |
17942 | nregs = 1; | |
17943 | } | |
17944 | } | |
17945 | else | |
17946 | nregs = bufp->re_nsub + 1; | |
17947 | pmatch = ((regmatch_t *) malloc ((nregs) * sizeof (regmatch_t))); | |
17948 | if (__builtin_expect (pmatch == ((void *)0), 0)) | |
17949 | { | |
17950 | rval = -2; | |
17951 | goto out; | |
17952 | } | |
17953 | ||
17954 | result = re_search_internal (bufp, string, length, start, range, stop, | |
17955 | nregs, pmatch, eflags); | |
17956 | ||
17957 | rval = 0; | |
17958 | ||
17959 | ||
17960 | if (result != REG_NOERROR) | |
17961 | rval = -1; | |
17962 | else if (regs != ((void *)0)) | |
17963 | { | |
17964 | ||
17965 | bufp->regs_allocated = re_copy_regs (regs, pmatch, nregs, | |
17966 | bufp->regs_allocated); | |
17967 | if (__builtin_expect (bufp->regs_allocated == 0, 0)) | |
17968 | rval = -2; | |
17969 | } | |
17970 | ||
17971 | if (__builtin_expect (rval == 0, 1)) | |
17972 | { | |
17973 | if (ret_len) | |
17974 | { | |
17975 | ((pmatch[0].rm_so == start) ? (void) (0) : (__assert_fail ("pmatch[0].rm_so == start", "regexec.c", 487, __PRETTY_FUNCTION__), (void) (0))); | |
17976 | rval = pmatch[0].rm_eo - start; | |
17977 | } | |
17978 | else | |
17979 | rval = pmatch[0].rm_so; | |
17980 | } | |
17981 | free (pmatch); | |
17982 | out: | |
17983 | __lll_mutex_unlock(&(dfa->lock)); | |
17984 | return rval; | |
17985 | } | |
17986 | ||
17987 | static unsigned | |
17988 | re_copy_regs (regs, pmatch, nregs, regs_allocated) | |
17989 | struct re_registers *regs; | |
17990 | regmatch_t *pmatch; | |
17991 | int nregs, regs_allocated; | |
17992 | { | |
17993 | int rval = 1; | |
17994 | int i; | |
17995 | int need_regs = nregs + 1; | |
17996 | ||
17997 | ||
17998 | ||
17999 | ||
18000 | if (regs_allocated == 0) | |
18001 | { | |
18002 | regs->start = ((regoff_t *) malloc ((need_regs) * sizeof (regoff_t))); | |
18003 | regs->end = ((regoff_t *) malloc ((need_regs) * sizeof (regoff_t))); | |
18004 | if (__builtin_expect (regs->start == ((void *)0), 0) || __builtin_expect (regs->end == ((void *)0), 0)) | |
18005 | return 0; | |
18006 | regs->num_regs = need_regs; | |
18007 | } | |
18008 | else if (regs_allocated == 1) | |
18009 | { | |
18010 | ||
18011 | ||
18012 | if (__builtin_expect (need_regs > regs->num_regs, 0)) | |
18013 | { | |
18014 | regoff_t *new_start = ((regoff_t *) realloc (regs->start, (need_regs) * sizeof (regoff_t))); | |
18015 | regoff_t *new_end = ((regoff_t *) realloc (regs->end, (need_regs) * sizeof (regoff_t))); | |
18016 | if (__builtin_expect (new_start == ((void *)0), 0) || __builtin_expect (new_end == ((void *)0), 0)) | |
18017 | return 0; | |
18018 | regs->start = new_start; | |
18019 | regs->end = new_end; | |
18020 | regs->num_regs = need_regs; | |
18021 | } | |
18022 | } | |
18023 | else | |
18024 | { | |
18025 | ((regs_allocated == 2) ? (void) (0) : (__assert_fail ("regs_allocated == 2", "regexec.c", 537, __PRETTY_FUNCTION__), (void) (0))); | |
18026 | ||
18027 | ((regs->num_regs >= nregs) ? (void) (0) : (__assert_fail ("regs->num_regs >= nregs", "regexec.c", 539, __PRETTY_FUNCTION__), (void) (0))); | |
18028 | rval = 2; | |
18029 | } | |
18030 | ||
18031 | ||
18032 | for (i = 0; i < nregs; ++i) | |
18033 | { | |
18034 | regs->start[i] = pmatch[i].rm_so; | |
18035 | regs->end[i] = pmatch[i].rm_eo; | |
18036 | } | |
18037 | for ( ; i < regs->num_regs; ++i) | |
18038 | regs->start[i] = regs->end[i] = -1; | |
18039 | ||
18040 | return rval; | |
18041 | } | |
18042 | # 568 "regexec.c" | |
18043 | void | |
18044 | __re_set_registers (bufp, regs, num_regs, starts, ends) | |
18045 | struct re_pattern_buffer *bufp; | |
18046 | struct re_registers *regs; | |
18047 | unsigned num_regs; | |
18048 | regoff_t *starts, *ends; | |
18049 | { | |
18050 | if (num_regs) | |
18051 | { | |
18052 | bufp->regs_allocated = 1; | |
18053 | regs->num_regs = num_regs; | |
18054 | regs->start = starts; | |
18055 | regs->end = ends; | |
18056 | } | |
18057 | else | |
18058 | { | |
18059 | bufp->regs_allocated = 0; | |
18060 | regs->num_regs = 0; | |
18061 | regs->start = regs->end = (regoff_t *) 0; | |
18062 | } | |
18063 | } | |
18064 | ||
18065 | extern __typeof (__re_set_registers) re_set_registers __attribute__ ((weak, alias ("__re_set_registers"))); | |
18066 | ||
18067 | ||
18068 | ||
18069 | ||
18070 | ||
18071 | ||
18072 | int | |
18073 | ||
18074 | __attribute__ ((weak)) | |
18075 | ||
18076 | re_exec (s) | |
18077 | const char *s; | |
18078 | { | |
18079 | return 0 == __regexec (&re_comp_buf, s, 0, ((void *)0), 0); | |
18080 | } | |
18081 | # 619 "regexec.c" | |
18082 | static reg_errcode_t | |
18083 | re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch, | |
18084 | eflags) | |
18085 | const regex_t *preg; | |
18086 | const char *string; | |
18087 | int length, start, range, stop, eflags; | |
18088 | size_t nmatch; | |
18089 | regmatch_t pmatch[]; | |
18090 | { | |
18091 | reg_errcode_t err; | |
18092 | const re_dfa_t *dfa = (const re_dfa_t *) preg->buffer; | |
18093 | int left_lim, right_lim, incr; | |
18094 | int fl_longest_match, match_first, match_kind, match_last = -1; | |
18095 | int extra_nmatch; | |
18096 | int sb, ch; | |
18097 | ||
18098 | re_match_context_t mctx = { .dfa = dfa }; | |
18099 | ||
18100 | ||
18101 | ||
18102 | char *fastmap = (preg->fastmap != ((void *)0) && preg->fastmap_accurate | |
18103 | && range && !preg->can_be_null) ? preg->fastmap : ((void *)0); | |
18104 | unsigned char * t = preg->translate; | |
18105 | ||
18106 | ||
18107 | ||
18108 | ||
18109 | ||
18110 | ||
18111 | extra_nmatch = (nmatch > preg->re_nsub) ? nmatch - (preg->re_nsub + 1) : 0; | |
18112 | nmatch -= extra_nmatch; | |
18113 | ||
18114 | ||
18115 | if (__builtin_expect (preg->used == 0 || dfa->init_state == ((void *)0) || dfa->init_state_word == ((void *)0) || dfa->init_state_nl == ((void *)0) || dfa->init_state_begbuf == ((void *)0), 0)) | |
18116 | ||
18117 | ||
18118 | return REG_NOMATCH; | |
18119 | # 665 "regexec.c" | |
18120 | if (dfa->init_state->nodes.nelem == 0 | |
18121 | && dfa->init_state_word->nodes.nelem == 0 | |
18122 | && (dfa->init_state_nl->nodes.nelem == 0 | |
18123 | || !preg->newline_anchor)) | |
18124 | { | |
18125 | if (start != 0 && start + range != 0) | |
18126 | return REG_NOMATCH; | |
18127 | start = range = 0; | |
18128 | } | |
18129 | ||
18130 | ||
18131 | fl_longest_match = (nmatch != 0 || dfa->nbackref); | |
18132 | ||
18133 | err = re_string_allocate (&mctx.input, string, length, dfa->nodes_len + 1, | |
18134 | preg->translate, preg->syntax & ((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1), dfa); | |
18135 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
18136 | goto free_return; | |
18137 | mctx.input.stop = stop; | |
18138 | mctx.input.raw_stop = stop; | |
18139 | mctx.input.newline_anchor = preg->newline_anchor; | |
18140 | ||
18141 | err = match_ctx_init (&mctx, eflags, dfa->nbackref * 2); | |
18142 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
18143 | goto free_return; | |
18144 | ||
18145 | ||
18146 | ||
18147 | ||
18148 | ||
18149 | if (nmatch > 1 || dfa->has_mb_node) | |
18150 | { | |
18151 | mctx.state_log = ((re_dfastate_t * *) malloc ((mctx.input.bufs_len + 1) * sizeof (re_dfastate_t *))); | |
18152 | if (__builtin_expect (mctx.state_log == ((void *)0), 0)) | |
18153 | { | |
18154 | err = REG_ESPACE; | |
18155 | goto free_return; | |
18156 | } | |
18157 | } | |
18158 | else | |
18159 | mctx.state_log = ((void *)0); | |
18160 | ||
18161 | match_first = start; | |
18162 | mctx.input.tip_context = (eflags & 1) ? ((1 << 1) << 1) | |
18163 | : (1 << 1) | ((1 << 1) << 1); | |
18164 | ||
18165 | ||
18166 | incr = (range < 0) ? -1 : 1; | |
18167 | left_lim = (range < 0) ? start + range : start; | |
18168 | right_lim = (range < 0) ? start : start + range; | |
18169 | sb = dfa->mb_cur_max == 1; | |
18170 | match_kind = | |
18171 | (fastmap | |
18172 | ? ((sb || !(preg->syntax & ((((((((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) || t) ? 4 : 0) | |
18173 | | (range >= 0 ? 2 : 0) | |
18174 | | (t != ((void *)0) ? 1 : 0)) | |
18175 | : 8); | |
18176 | ||
18177 | for (;; match_first += incr) | |
18178 | { | |
18179 | err = REG_NOMATCH; | |
18180 | if (match_first < left_lim || right_lim < match_first) | |
18181 | goto free_return; | |
18182 | ||
18183 | ||
18184 | ||
18185 | ||
18186 | ||
18187 | ||
18188 | switch (match_kind) | |
18189 | { | |
18190 | case 8: | |
18191 | ||
18192 | break; | |
18193 | ||
18194 | case 7: | |
18195 | ||
18196 | while (__builtin_expect (match_first < right_lim, 1) | |
18197 | && !fastmap[t[(unsigned char) string[match_first]]]) | |
18198 | ++match_first; | |
18199 | goto forward_match_found_start_or_reached_end; | |
18200 | ||
18201 | case 6: | |
18202 | ||
18203 | while (__builtin_expect (match_first < right_lim, 1) | |
18204 | && !fastmap[(unsigned char) string[match_first]]) | |
18205 | ++match_first; | |
18206 | ||
18207 | forward_match_found_start_or_reached_end: | |
18208 | if (__builtin_expect (match_first == right_lim, 0)) | |
18209 | { | |
18210 | ch = match_first >= length | |
18211 | ? 0 : (unsigned char) string[match_first]; | |
18212 | if (!fastmap[t ? t[ch] : ch]) | |
18213 | goto free_return; | |
18214 | } | |
18215 | break; | |
18216 | ||
18217 | case 4: | |
18218 | case 5: | |
18219 | ||
18220 | while (match_first >= left_lim) | |
18221 | { | |
18222 | ch = match_first >= length | |
18223 | ? 0 : (unsigned char) string[match_first]; | |
18224 | if (fastmap[t ? t[ch] : ch]) | |
18225 | break; | |
18226 | --match_first; | |
18227 | } | |
18228 | if (match_first < left_lim) | |
18229 | goto free_return; | |
18230 | break; | |
18231 | ||
18232 | default: | |
18233 | ||
18234 | ||
18235 | ||
18236 | for (;;) | |
18237 | { | |
18238 | ||
18239 | ||
18240 | unsigned int offset = match_first - mctx.input.raw_mbs_idx; | |
18241 | if (__builtin_expect (offset >= (unsigned int) mctx.input.valid_raw_len, 0)) | |
18242 | { | |
18243 | err = re_string_reconstruct (&mctx.input, match_first, | |
18244 | eflags); | |
18245 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
18246 | goto free_return; | |
18247 | ||
18248 | offset = match_first - mctx.input.raw_mbs_idx; | |
18249 | } | |
18250 | ||
18251 | ||
18252 | ch = (match_first >= length | |
18253 | ? 0 : ((&mctx.input)->mbs[offset])); | |
18254 | if (fastmap[ch]) | |
18255 | break; | |
18256 | match_first += incr; | |
18257 | if (match_first < left_lim || match_first > right_lim) | |
18258 | { | |
18259 | err = REG_NOMATCH; | |
18260 | goto free_return; | |
18261 | } | |
18262 | } | |
18263 | break; | |
18264 | } | |
18265 | ||
18266 | ||
18267 | ||
18268 | err = re_string_reconstruct (&mctx.input, match_first, eflags); | |
18269 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
18270 | goto free_return; | |
18271 | ||
18272 | ||
18273 | ||
18274 | ||
18275 | if (!sb && !((0) == (&mctx.input)->valid_len || (&mctx.input)->wcs[0] != (0xffffffffu))) | |
18276 | continue; | |
18277 | ||
18278 | ||
18279 | ||
18280 | ||
18281 | mctx.state_log_top = mctx.nbkref_ents = mctx.max_mb_elem_len = 0; | |
18282 | match_last = check_matching (&mctx, fl_longest_match, | |
18283 | range >= 0 ? &match_first : ((void *)0)); | |
18284 | if (match_last != -1) | |
18285 | { | |
18286 | if (__builtin_expect (match_last == -2, 0)) | |
18287 | { | |
18288 | err = REG_ESPACE; | |
18289 | goto free_return; | |
18290 | } | |
18291 | else | |
18292 | { | |
18293 | mctx.match_last = match_last; | |
18294 | if ((!preg->no_sub && nmatch > 1) || dfa->nbackref) | |
18295 | { | |
18296 | re_dfastate_t *pstate = mctx.state_log[match_last]; | |
18297 | mctx.last_node = check_halt_state_context (&mctx, pstate, | |
18298 | match_last); | |
18299 | } | |
18300 | if ((!preg->no_sub && nmatch > 1 && dfa->has_plural_match) | |
18301 | || dfa->nbackref) | |
18302 | { | |
18303 | err = prune_impossible_nodes (&mctx); | |
18304 | if (err == REG_NOERROR) | |
18305 | break; | |
18306 | if (__builtin_expect (err != REG_NOMATCH, 0)) | |
18307 | goto free_return; | |
18308 | match_last = -1; | |
18309 | } | |
18310 | else | |
18311 | break; | |
18312 | } | |
18313 | } | |
18314 | ||
18315 | match_ctx_clean (&mctx); | |
18316 | } | |
18317 | ||
18318 | ||
18319 | ||
18320 | ||
18321 | ||
18322 | ||
18323 | ||
18324 | if (nmatch > 0) | |
18325 | { | |
18326 | int reg_idx; | |
18327 | ||
18328 | ||
18329 | for (reg_idx = 1; reg_idx < nmatch; ++reg_idx) | |
18330 | pmatch[reg_idx].rm_so = pmatch[reg_idx].rm_eo = -1; | |
18331 | ||
18332 | ||
18333 | pmatch[0].rm_so = 0; | |
18334 | pmatch[0].rm_eo = mctx.match_last; | |
18335 | ||
18336 | if (!preg->no_sub && nmatch > 1) | |
18337 | { | |
18338 | err = set_regs (preg, &mctx, nmatch, pmatch, | |
18339 | dfa->has_plural_match && dfa->nbackref > 0); | |
18340 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
18341 | goto free_return; | |
18342 | } | |
18343 | ||
18344 | ||
18345 | ||
18346 | ||
18347 | for (reg_idx = 0; reg_idx < nmatch; ++reg_idx) | |
18348 | if (pmatch[reg_idx].rm_so != -1) | |
18349 | { | |
18350 | ||
18351 | if (__builtin_expect (mctx.input.offsets_needed != 0, 0)) | |
18352 | { | |
18353 | pmatch[reg_idx].rm_so = | |
18354 | (pmatch[reg_idx].rm_so == mctx.input.valid_len | |
18355 | ? mctx.input.valid_raw_len | |
18356 | : mctx.input.offsets[pmatch[reg_idx].rm_so]); | |
18357 | pmatch[reg_idx].rm_eo = | |
18358 | (pmatch[reg_idx].rm_eo == mctx.input.valid_len | |
18359 | ? mctx.input.valid_raw_len | |
18360 | : mctx.input.offsets[pmatch[reg_idx].rm_eo]); | |
18361 | } | |
18362 | ||
18363 | ||
18364 | ||
18365 | pmatch[reg_idx].rm_so += match_first; | |
18366 | pmatch[reg_idx].rm_eo += match_first; | |
18367 | } | |
18368 | for (reg_idx = 0; reg_idx < extra_nmatch; ++reg_idx) | |
18369 | { | |
18370 | pmatch[nmatch + reg_idx].rm_so = -1; | |
18371 | pmatch[nmatch + reg_idx].rm_eo = -1; | |
18372 | } | |
18373 | ||
18374 | if (dfa->subexp_map) | |
18375 | for (reg_idx = 0; reg_idx + 1 < nmatch; reg_idx++) | |
18376 | if (dfa->subexp_map[reg_idx] != reg_idx) | |
18377 | { | |
18378 | pmatch[reg_idx + 1].rm_so | |
18379 | = pmatch[dfa->subexp_map[reg_idx] + 1].rm_so; | |
18380 | pmatch[reg_idx + 1].rm_eo | |
18381 | = pmatch[dfa->subexp_map[reg_idx] + 1].rm_eo; | |
18382 | } | |
18383 | } | |
18384 | ||
18385 | free_return: | |
18386 | free (mctx.state_log); | |
18387 | if (dfa->nbackref) | |
18388 | match_ctx_free (&mctx); | |
18389 | re_string_destruct (&mctx.input); | |
18390 | return err; | |
18391 | } | |
18392 | ||
18393 | static reg_errcode_t | |
18394 | prune_impossible_nodes (mctx) | |
18395 | re_match_context_t *mctx; | |
18396 | { | |
18397 | const re_dfa_t *const dfa = mctx->dfa; | |
18398 | int halt_node, match_last; | |
18399 | reg_errcode_t ret; | |
18400 | re_dfastate_t **sifted_states; | |
18401 | re_dfastate_t **lim_states = ((void *)0); | |
18402 | re_sift_context_t sctx; | |
18403 | ||
18404 | ||
18405 | ||
18406 | match_last = mctx->match_last; | |
18407 | halt_node = mctx->last_node; | |
18408 | sifted_states = ((re_dfastate_t * *) malloc ((match_last + 1) * sizeof (re_dfastate_t *))); | |
18409 | if (__builtin_expect (sifted_states == ((void *)0), 0)) | |
18410 | { | |
18411 | ret = REG_ESPACE; | |
18412 | goto free_return; | |
18413 | } | |
18414 | if (dfa->nbackref) | |
18415 | { | |
18416 | lim_states = ((re_dfastate_t * *) malloc ((match_last + 1) * sizeof (re_dfastate_t *))); | |
18417 | if (__builtin_expect (lim_states == ((void *)0), 0)) | |
18418 | { | |
18419 | ret = REG_ESPACE; | |
18420 | goto free_return; | |
18421 | } | |
18422 | while (1) | |
18423 | { | |
18424 | memset (lim_states, '\0', | |
18425 | sizeof (re_dfastate_t *) * (match_last + 1)); | |
18426 | sift_ctx_init (&sctx, sifted_states, lim_states, halt_node, | |
18427 | match_last); | |
18428 | ret = sift_states_backward (mctx, &sctx); | |
18429 | free ((&sctx.limits)->elems); | |
18430 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
18431 | goto free_return; | |
18432 | if (sifted_states[0] != ((void *)0) || lim_states[0] != ((void *)0)) | |
18433 | break; | |
18434 | do | |
18435 | { | |
18436 | --match_last; | |
18437 | if (match_last < 0) | |
18438 | { | |
18439 | ret = REG_NOMATCH; | |
18440 | goto free_return; | |
18441 | } | |
18442 | } while (mctx->state_log[match_last] == ((void *)0) | |
18443 | || !mctx->state_log[match_last]->halt); | |
18444 | halt_node = check_halt_state_context (mctx, | |
18445 | mctx->state_log[match_last], | |
18446 | match_last); | |
18447 | } | |
18448 | ret = merge_state_array (dfa, sifted_states, lim_states, | |
18449 | match_last + 1); | |
18450 | free (lim_states); | |
18451 | lim_states = ((void *)0); | |
18452 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
18453 | goto free_return; | |
18454 | } | |
18455 | else | |
18456 | { | |
18457 | sift_ctx_init (&sctx, sifted_states, lim_states, halt_node, match_last); | |
18458 | ret = sift_states_backward (mctx, &sctx); | |
18459 | free ((&sctx.limits)->elems); | |
18460 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
18461 | goto free_return; | |
18462 | } | |
18463 | free (mctx->state_log); | |
18464 | mctx->state_log = sifted_states; | |
18465 | sifted_states = ((void *)0); | |
18466 | mctx->last_node = halt_node; | |
18467 | mctx->match_last = match_last; | |
18468 | ret = REG_NOERROR; | |
18469 | free_return: | |
18470 | free (sifted_states); | |
18471 | free (lim_states); | |
18472 | return ret; | |
18473 | } | |
18474 | ||
18475 | ||
18476 | ||
18477 | ||
18478 | ||
18479 | static inline re_dfastate_t * | |
18480 | __attribute__ ((always_inline)) | |
18481 | acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx, | |
18482 | int idx) | |
18483 | { | |
18484 | const re_dfa_t *const dfa = mctx->dfa; | |
18485 | if (dfa->init_state->has_constraint) | |
18486 | { | |
18487 | unsigned int context; | |
18488 | context = re_string_context_at (&mctx->input, idx - 1, mctx->eflags); | |
18489 | if (((context) & 1)) | |
18490 | return dfa->init_state_word; | |
18491 | else if (((context) == 0)) | |
18492 | return dfa->init_state; | |
18493 | else if (((context) & ((1 << 1) << 1)) && ((context) & (1 << 1))) | |
18494 | return dfa->init_state_begbuf; | |
18495 | else if (((context) & (1 << 1))) | |
18496 | return dfa->init_state_nl; | |
18497 | else if (((context) & ((1 << 1) << 1))) | |
18498 | { | |
18499 | ||
18500 | return re_acquire_state_context (err, dfa, | |
18501 | dfa->init_state->entrance_nodes, | |
18502 | context); | |
18503 | } | |
18504 | else | |
18505 | ||
18506 | return dfa->init_state; | |
18507 | } | |
18508 | else | |
18509 | return dfa->init_state; | |
18510 | } | |
18511 | # 1066 "regexec.c" | |
18512 | static int | |
18513 | ||
18514 | check_matching (re_match_context_t *mctx, int fl_longest_match, | |
18515 | int *p_match_first) | |
18516 | { | |
18517 | const re_dfa_t *const dfa = mctx->dfa; | |
18518 | reg_errcode_t err; | |
18519 | int match = 0; | |
18520 | int match_last = -1; | |
18521 | int cur_str_idx = ((&mctx->input)->cur_idx); | |
18522 | re_dfastate_t *cur_state; | |
18523 | int at_init_state = p_match_first != ((void *)0); | |
18524 | int next_start_idx = cur_str_idx; | |
18525 | ||
18526 | err = REG_NOERROR; | |
18527 | cur_state = acquire_init_state_context (&err, mctx, cur_str_idx); | |
18528 | ||
18529 | if (__builtin_expect (cur_state == ((void *)0), 0)) | |
18530 | { | |
18531 | ((err == REG_ESPACE) ? (void) (0) : (__assert_fail ("err == REG_ESPACE", "regexec.c", 1085, __PRETTY_FUNCTION__), (void) (0))); | |
18532 | return -2; | |
18533 | } | |
18534 | ||
18535 | if (mctx->state_log != ((void *)0)) | |
18536 | { | |
18537 | mctx->state_log[cur_str_idx] = cur_state; | |
18538 | ||
18539 | ||
18540 | ||
18541 | if (__builtin_expect (dfa->nbackref, 0)) | |
18542 | { | |
18543 | at_init_state = 0; | |
18544 | err = check_subexp_matching_top (mctx, &cur_state->nodes, 0); | |
18545 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
18546 | return err; | |
18547 | ||
18548 | if (cur_state->has_backref) | |
18549 | { | |
18550 | err = transit_state_bkref (mctx, &cur_state->nodes); | |
18551 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
18552 | return err; | |
18553 | } | |
18554 | } | |
18555 | } | |
18556 | ||
18557 | ||
18558 | if (__builtin_expect (cur_state->halt, 0)) | |
18559 | { | |
18560 | if (!cur_state->has_constraint | |
18561 | || check_halt_state_context (mctx, cur_state, cur_str_idx)) | |
18562 | { | |
18563 | if (!fl_longest_match) | |
18564 | return cur_str_idx; | |
18565 | else | |
18566 | { | |
18567 | match_last = cur_str_idx; | |
18568 | match = 1; | |
18569 | } | |
18570 | } | |
18571 | } | |
18572 | ||
18573 | while (!((&mctx->input)->stop <= (&mctx->input)->cur_idx)) | |
18574 | { | |
18575 | re_dfastate_t *old_state = cur_state; | |
18576 | int next_char_idx = ((&mctx->input)->cur_idx) + 1; | |
18577 | ||
18578 | if (__builtin_expect (next_char_idx >= mctx->input.bufs_len, 0) | |
18579 | || (__builtin_expect (next_char_idx >= mctx->input.valid_len, 0) | |
18580 | && mctx->input.valid_len < mctx->input.len)) | |
18581 | { | |
18582 | err = extend_buffers (mctx); | |
18583 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
18584 | { | |
18585 | ((err == REG_ESPACE) ? (void) (0) : (__assert_fail ("err == REG_ESPACE", "regexec.c", 1139, __PRETTY_FUNCTION__), (void) (0))); | |
18586 | return -2; | |
18587 | } | |
18588 | } | |
18589 | ||
18590 | cur_state = transit_state (&err, mctx, cur_state); | |
18591 | if (mctx->state_log != ((void *)0)) | |
18592 | cur_state = merge_state_with_log (&err, mctx, cur_state); | |
18593 | ||
18594 | if (cur_state == ((void *)0)) | |
18595 | { | |
18596 | ||
18597 | ||
18598 | ||
18599 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
18600 | return -2; | |
18601 | ||
18602 | if (mctx->state_log == ((void *)0) | |
18603 | || (match && !fl_longest_match) | |
18604 | || (cur_state = find_recover_state (&err, mctx)) == ((void *)0)) | |
18605 | break; | |
18606 | } | |
18607 | ||
18608 | if (__builtin_expect (at_init_state, 0)) | |
18609 | { | |
18610 | if (old_state == cur_state) | |
18611 | next_start_idx = next_char_idx; | |
18612 | else | |
18613 | at_init_state = 0; | |
18614 | } | |
18615 | ||
18616 | if (cur_state->halt) | |
18617 | { | |
18618 | ||
18619 | ||
18620 | if (!cur_state->has_constraint | |
18621 | || check_halt_state_context (mctx, cur_state, | |
18622 | ((&mctx->input)->cur_idx))) | |
18623 | { | |
18624 | ||
18625 | match_last = ((&mctx->input)->cur_idx); | |
18626 | match = 1; | |
18627 | ||
18628 | ||
18629 | p_match_first = ((void *)0); | |
18630 | if (!fl_longest_match) | |
18631 | break; | |
18632 | } | |
18633 | } | |
18634 | } | |
18635 | ||
18636 | if (p_match_first) | |
18637 | *p_match_first += next_start_idx; | |
18638 | ||
18639 | return match_last; | |
18640 | } | |
18641 | ||
18642 | ||
18643 | ||
18644 | static int | |
18645 | ||
18646 | check_halt_node_context (const re_dfa_t *dfa, int node, unsigned int context) | |
18647 | { | |
18648 | re_token_type_t type = dfa->nodes[node].type; | |
18649 | unsigned int constraint = dfa->nodes[node].constraint; | |
18650 | if (type != END_OF_RE) | |
18651 | return 0; | |
18652 | if (!constraint) | |
18653 | return 1; | |
18654 | if (((((constraint) & 0x0004) && !((context) & 1)) || (((constraint) & 0x0008) && ((context) & 1)) || (((constraint) & 0x0020) && !((context) & (1 << 1))) || (((constraint) & 0x0080) && !((context) & (((1 << 1) << 1) << 1))))) | |
18655 | return 0; | |
18656 | return 1; | |
18657 | } | |
18658 | ||
18659 | ||
18660 | ||
18661 | ||
18662 | ||
18663 | static int | |
18664 | ||
18665 | check_halt_state_context (const re_match_context_t *mctx, | |
18666 | const re_dfastate_t *state, int idx) | |
18667 | { | |
18668 | int i; | |
18669 | unsigned int context; | |
18670 | ||
18671 | ||
18672 | ||
18673 | context = re_string_context_at (&mctx->input, idx, mctx->eflags); | |
18674 | for (i = 0; i < state->nodes.nelem; ++i) | |
18675 | if (check_halt_node_context (mctx->dfa, state->nodes.elems[i], context)) | |
18676 | return state->nodes.elems[i]; | |
18677 | return 0; | |
18678 | } | |
18679 | ||
18680 | ||
18681 | ||
18682 | ||
18683 | ||
18684 | ||
18685 | static int | |
18686 | ||
18687 | proceed_next_node (const re_match_context_t *mctx, int nregs, regmatch_t *regs, | |
18688 | int *pidx, int node, re_node_set *eps_via_nodes, | |
18689 | struct re_fail_stack_t *fs) | |
18690 | { | |
18691 | const re_dfa_t *const dfa = mctx->dfa; | |
18692 | int i, err; | |
18693 | if (((dfa->nodes[node].type) & 8)) | |
18694 | { | |
18695 | re_node_set *cur_nodes = &mctx->state_log[*pidx]->nodes; | |
18696 | re_node_set *edests = &dfa->edests[node]; | |
18697 | int dest_node; | |
18698 | err = re_node_set_insert (eps_via_nodes, node); | |
18699 | if (__builtin_expect (err < 0, 0)) | |
18700 | return -2; | |
18701 | ||
18702 | for (dest_node = -1, i = 0; i < edests->nelem; ++i) | |
18703 | { | |
18704 | int candidate = edests->elems[i]; | |
18705 | if (!re_node_set_contains (cur_nodes, candidate)) | |
18706 | continue; | |
18707 | if (dest_node == -1) | |
18708 | dest_node = candidate; | |
18709 | ||
18710 | else | |
18711 | { | |
18712 | ||
18713 | ||
18714 | if (re_node_set_contains (eps_via_nodes, dest_node)) | |
18715 | return candidate; | |
18716 | ||
18717 | ||
18718 | else if (fs != ((void *)0) | |
18719 | && push_fail_stack (fs, *pidx, candidate, nregs, regs, | |
18720 | eps_via_nodes)) | |
18721 | return -2; | |
18722 | ||
18723 | ||
18724 | break; | |
18725 | } | |
18726 | } | |
18727 | return dest_node; | |
18728 | } | |
18729 | else | |
18730 | { | |
18731 | int naccepted = 0; | |
18732 | re_token_type_t type = dfa->nodes[node].type; | |
18733 | ||
18734 | ||
18735 | if (dfa->nodes[node].accept_mb) | |
18736 | naccepted = check_node_accept_bytes (dfa, node, &mctx->input, *pidx); | |
18737 | else | |
18738 | ||
18739 | if (type == OP_BACK_REF) | |
18740 | { | |
18741 | int subexp_idx = dfa->nodes[node].opr.idx + 1; | |
18742 | naccepted = regs[subexp_idx].rm_eo - regs[subexp_idx].rm_so; | |
18743 | if (fs != ((void *)0)) | |
18744 | { | |
18745 | if (regs[subexp_idx].rm_so == -1 || regs[subexp_idx].rm_eo == -1) | |
18746 | return -1; | |
18747 | else if (naccepted) | |
18748 | { | |
18749 | char *buf = (char *) ((&mctx->input)->mbs); | |
18750 | if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, | |
18751 | naccepted) != 0) | |
18752 | return -1; | |
18753 | } | |
18754 | } | |
18755 | ||
18756 | if (naccepted == 0) | |
18757 | { | |
18758 | int dest_node; | |
18759 | err = re_node_set_insert (eps_via_nodes, node); | |
18760 | if (__builtin_expect (err < 0, 0)) | |
18761 | return -2; | |
18762 | dest_node = dfa->edests[node].elems[0]; | |
18763 | if (re_node_set_contains (&mctx->state_log[*pidx]->nodes, | |
18764 | dest_node)) | |
18765 | return dest_node; | |
18766 | } | |
18767 | } | |
18768 | ||
18769 | if (naccepted != 0 | |
18770 | || check_node_accept (mctx, dfa->nodes + node, *pidx)) | |
18771 | { | |
18772 | int dest_node = dfa->nexts[node]; | |
18773 | *pidx = (naccepted == 0) ? *pidx + 1 : *pidx + naccepted; | |
18774 | if (fs && (*pidx > mctx->match_last || mctx->state_log[*pidx] == ((void *)0) | |
18775 | || !re_node_set_contains (&mctx->state_log[*pidx]->nodes, | |
18776 | dest_node))) | |
18777 | return -1; | |
18778 | ((eps_via_nodes)->nelem = 0); | |
18779 | return dest_node; | |
18780 | } | |
18781 | } | |
18782 | return -1; | |
18783 | } | |
18784 | ||
18785 | static reg_errcode_t | |
18786 | ||
18787 | push_fail_stack (struct re_fail_stack_t *fs, int str_idx, int dest_node, | |
18788 | int nregs, regmatch_t *regs, re_node_set *eps_via_nodes) | |
18789 | { | |
18790 | reg_errcode_t err; | |
18791 | int num = fs->num++; | |
18792 | if (fs->num == fs->alloc) | |
18793 | { | |
18794 | struct re_fail_stack_ent_t *new_array; | |
18795 | new_array = realloc (fs->stack, (sizeof (struct re_fail_stack_ent_t) | |
18796 | * fs->alloc * 2)); | |
18797 | if (new_array == ((void *)0)) | |
18798 | return REG_ESPACE; | |
18799 | fs->alloc *= 2; | |
18800 | fs->stack = new_array; | |
18801 | } | |
18802 | fs->stack[num].idx = str_idx; | |
18803 | fs->stack[num].node = dest_node; | |
18804 | fs->stack[num].regs = ((regmatch_t *) malloc ((nregs) * sizeof (regmatch_t))); | |
18805 | if (fs->stack[num].regs == ((void *)0)) | |
18806 | return REG_ESPACE; | |
18807 | memcpy (fs->stack[num].regs, regs, sizeof (regmatch_t) * nregs); | |
18808 | err = re_node_set_init_copy (&fs->stack[num].eps_via_nodes, eps_via_nodes); | |
18809 | return err; | |
18810 | } | |
18811 | ||
18812 | static int | |
18813 | ||
18814 | pop_fail_stack (struct re_fail_stack_t *fs, int *pidx, int nregs, | |
18815 | regmatch_t *regs, re_node_set *eps_via_nodes) | |
18816 | { | |
18817 | int num = --fs->num; | |
18818 | ((num >= 0) ? (void) (0) : (__assert_fail ("num >= 0", "regexec.c", 1372, __PRETTY_FUNCTION__), (void) (0))); | |
18819 | *pidx = fs->stack[num].idx; | |
18820 | memcpy (regs, fs->stack[num].regs, sizeof (regmatch_t) * nregs); | |
18821 | free ((eps_via_nodes)->elems); | |
18822 | free (fs->stack[num].regs); | |
18823 | *eps_via_nodes = fs->stack[num].eps_via_nodes; | |
18824 | return fs->stack[num].node; | |
18825 | } | |
18826 | ||
18827 | ||
18828 | ||
18829 | ||
18830 | ||
18831 | ||
18832 | static reg_errcode_t | |
18833 | ||
18834 | set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch, | |
18835 | regmatch_t *pmatch, int fl_backtrack) | |
18836 | { | |
18837 | const re_dfa_t *dfa = (const re_dfa_t *) preg->buffer; | |
18838 | int idx, cur_node; | |
18839 | re_node_set eps_via_nodes; | |
18840 | struct re_fail_stack_t *fs; | |
18841 | struct re_fail_stack_t fs_body = { 0, 2, ((void *)0) }; | |
18842 | regmatch_t *prev_idx_match; | |
18843 | int prev_idx_match_malloced = 0; | |
18844 | ||
18845 | ||
18846 | ||
18847 | ||
18848 | ||
18849 | if (fl_backtrack) | |
18850 | { | |
18851 | fs = &fs_body; | |
18852 | fs->stack = ((struct re_fail_stack_ent_t *) malloc ((fs->alloc) * sizeof (struct re_fail_stack_ent_t))); | |
18853 | if (fs->stack == ((void *)0)) | |
18854 | return REG_ESPACE; | |
18855 | } | |
18856 | else | |
18857 | fs = ((void *)0); | |
18858 | ||
18859 | cur_node = dfa->init_node; | |
18860 | memset (&eps_via_nodes, '\0', sizeof (re_node_set)); | |
18861 | ||
18862 | if (__libc_use_alloca (nmatch * sizeof (regmatch_t))) | |
18863 | prev_idx_match = (regmatch_t *) __builtin_alloca (nmatch * sizeof (regmatch_t)); | |
18864 | else | |
18865 | { | |
18866 | prev_idx_match = ((regmatch_t *) malloc ((nmatch) * sizeof (regmatch_t))); | |
18867 | if (prev_idx_match == ((void *)0)) | |
18868 | { | |
18869 | free_fail_stack_return (fs); | |
18870 | return REG_ESPACE; | |
18871 | } | |
18872 | prev_idx_match_malloced = 1; | |
18873 | } | |
18874 | memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch); | |
18875 | ||
18876 | for (idx = pmatch[0].rm_so; idx <= pmatch[0].rm_eo ;) | |
18877 | { | |
18878 | update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch); | |
18879 | ||
18880 | if (idx == pmatch[0].rm_eo && cur_node == mctx->last_node) | |
18881 | { | |
18882 | int reg_idx; | |
18883 | if (fs) | |
18884 | { | |
18885 | for (reg_idx = 0; reg_idx < nmatch; ++reg_idx) | |
18886 | if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1) | |
18887 | break; | |
18888 | if (reg_idx == nmatch) | |
18889 | { | |
18890 | free ((&eps_via_nodes)->elems); | |
18891 | if (prev_idx_match_malloced) | |
18892 | free (prev_idx_match); | |
18893 | return free_fail_stack_return (fs); | |
18894 | } | |
18895 | cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch, | |
18896 | &eps_via_nodes); | |
18897 | } | |
18898 | else | |
18899 | { | |
18900 | free ((&eps_via_nodes)->elems); | |
18901 | if (prev_idx_match_malloced) | |
18902 | free (prev_idx_match); | |
18903 | return REG_NOERROR; | |
18904 | } | |
18905 | } | |
18906 | ||
18907 | ||
18908 | cur_node = proceed_next_node (mctx, nmatch, pmatch, &idx, cur_node, | |
18909 | &eps_via_nodes, fs); | |
18910 | ||
18911 | if (__builtin_expect (cur_node < 0, 0)) | |
18912 | { | |
18913 | if (__builtin_expect (cur_node == -2, 0)) | |
18914 | { | |
18915 | free ((&eps_via_nodes)->elems); | |
18916 | if (prev_idx_match_malloced) | |
18917 | free (prev_idx_match); | |
18918 | free_fail_stack_return (fs); | |
18919 | return REG_ESPACE; | |
18920 | } | |
18921 | if (fs) | |
18922 | cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch, | |
18923 | &eps_via_nodes); | |
18924 | else | |
18925 | { | |
18926 | free ((&eps_via_nodes)->elems); | |
18927 | if (prev_idx_match_malloced) | |
18928 | free (prev_idx_match); | |
18929 | return REG_NOMATCH; | |
18930 | } | |
18931 | } | |
18932 | } | |
18933 | free ((&eps_via_nodes)->elems); | |
18934 | if (prev_idx_match_malloced) | |
18935 | free (prev_idx_match); | |
18936 | return free_fail_stack_return (fs); | |
18937 | } | |
18938 | ||
18939 | static reg_errcode_t | |
18940 | ||
18941 | free_fail_stack_return (struct re_fail_stack_t *fs) | |
18942 | { | |
18943 | if (fs) | |
18944 | { | |
18945 | int fs_idx; | |
18946 | for (fs_idx = 0; fs_idx < fs->num; ++fs_idx) | |
18947 | { | |
18948 | free ((&fs->stack[fs_idx].eps_via_nodes)->elems); | |
18949 | free (fs->stack[fs_idx].regs); | |
18950 | } | |
18951 | free (fs->stack); | |
18952 | } | |
18953 | return REG_NOERROR; | |
18954 | } | |
18955 | ||
18956 | static void | |
18957 | ||
18958 | update_regs (const re_dfa_t *dfa, regmatch_t *pmatch, | |
18959 | regmatch_t *prev_idx_match, int cur_node, int cur_idx, int nmatch) | |
18960 | { | |
18961 | int type = dfa->nodes[cur_node].type; | |
18962 | if (type == OP_OPEN_SUBEXP) | |
18963 | { | |
18964 | int reg_num = dfa->nodes[cur_node].opr.idx + 1; | |
18965 | ||
18966 | ||
18967 | if (reg_num < nmatch) | |
18968 | { | |
18969 | pmatch[reg_num].rm_so = cur_idx; | |
18970 | pmatch[reg_num].rm_eo = -1; | |
18971 | } | |
18972 | } | |
18973 | else if (type == OP_CLOSE_SUBEXP) | |
18974 | { | |
18975 | int reg_num = dfa->nodes[cur_node].opr.idx + 1; | |
18976 | if (reg_num < nmatch) | |
18977 | { | |
18978 | ||
18979 | if (pmatch[reg_num].rm_so < cur_idx) | |
18980 | { | |
18981 | pmatch[reg_num].rm_eo = cur_idx; | |
18982 | ||
18983 | ||
18984 | memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch); | |
18985 | } | |
18986 | else | |
18987 | { | |
18988 | if (dfa->nodes[cur_node].opt_subexp | |
18989 | && prev_idx_match[reg_num].rm_so != -1) | |
18990 | ||
18991 | ||
18992 | ||
18993 | ||
18994 | ||
18995 | memcpy (pmatch, prev_idx_match, sizeof (regmatch_t) * nmatch); | |
18996 | else | |
18997 | ||
18998 | ||
18999 | pmatch[reg_num].rm_eo = cur_idx; | |
19000 | } | |
19001 | } | |
19002 | } | |
19003 | } | |
19004 | # 1582 "regexec.c" | |
19005 | static reg_errcode_t | |
19006 | ||
19007 | sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx) | |
19008 | { | |
19009 | reg_errcode_t err; | |
19010 | int null_cnt = 0; | |
19011 | int str_idx = sctx->last_str_idx; | |
19012 | re_node_set cur_dest; | |
19013 | ||
19014 | ||
19015 | ||
19016 | ||
19017 | ||
19018 | ||
19019 | ||
19020 | err = re_node_set_init_1 (&cur_dest, sctx->last_node); | |
19021 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19022 | return err; | |
19023 | err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest); | |
19024 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19025 | goto free_return; | |
19026 | ||
19027 | ||
19028 | while (str_idx > 0) | |
19029 | { | |
19030 | ||
19031 | null_cnt = (sctx->sifted_states[str_idx] == ((void *)0)) ? null_cnt + 1 : 0; | |
19032 | if (null_cnt > mctx->max_mb_elem_len) | |
19033 | { | |
19034 | memset (sctx->sifted_states, '\0', | |
19035 | sizeof (re_dfastate_t *) * str_idx); | |
19036 | free ((&cur_dest)->elems); | |
19037 | return REG_NOERROR; | |
19038 | } | |
19039 | ((&cur_dest)->nelem = 0); | |
19040 | --str_idx; | |
19041 | ||
19042 | if (mctx->state_log[str_idx]) | |
19043 | { | |
19044 | err = build_sifted_states (mctx, sctx, str_idx, &cur_dest); | |
19045 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19046 | goto free_return; | |
19047 | } | |
19048 | ||
19049 | ||
19050 | ||
19051 | ||
19052 | ||
19053 | err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest); | |
19054 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19055 | goto free_return; | |
19056 | } | |
19057 | err = REG_NOERROR; | |
19058 | free_return: | |
19059 | free ((&cur_dest)->elems); | |
19060 | return err; | |
19061 | } | |
19062 | ||
19063 | static reg_errcode_t | |
19064 | ||
19065 | build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx, | |
19066 | int str_idx, re_node_set *cur_dest) | |
19067 | { | |
19068 | const re_dfa_t *const dfa = mctx->dfa; | |
19069 | const re_node_set *cur_src = &mctx->state_log[str_idx]->non_eps_nodes; | |
19070 | int i; | |
19071 | # 1656 "regexec.c" | |
19072 | for (i = 0; i < cur_src->nelem; i++) | |
19073 | { | |
19074 | int prev_node = cur_src->elems[i]; | |
19075 | int naccepted = 0; | |
19076 | int ret; | |
19077 | ||
19078 | ||
19079 | ||
19080 | ||
19081 | ||
19082 | ||
19083 | ||
19084 | if (dfa->nodes[prev_node].accept_mb) | |
19085 | naccepted = sift_states_iter_mb (mctx, sctx, prev_node, | |
19086 | str_idx, sctx->last_str_idx); | |
19087 | ||
19088 | ||
19089 | ||
19090 | ||
19091 | if (!naccepted | |
19092 | && check_node_accept (mctx, dfa->nodes + prev_node, str_idx) | |
19093 | && ((sctx->sifted_states[str_idx + 1]) != ((void *)0) && re_node_set_contains (&(sctx->sifted_states[str_idx + 1])->nodes, dfa->nexts[prev_node]))) | |
19094 | ||
19095 | naccepted = 1; | |
19096 | ||
19097 | if (naccepted == 0) | |
19098 | continue; | |
19099 | ||
19100 | if (sctx->limits.nelem) | |
19101 | { | |
19102 | int to_idx = str_idx + naccepted; | |
19103 | if (check_dst_limits (mctx, &sctx->limits, | |
19104 | dfa->nexts[prev_node], to_idx, | |
19105 | prev_node, str_idx)) | |
19106 | continue; | |
19107 | } | |
19108 | ret = re_node_set_insert (cur_dest, prev_node); | |
19109 | if (__builtin_expect (ret == -1, 0)) | |
19110 | return REG_ESPACE; | |
19111 | } | |
19112 | ||
19113 | return REG_NOERROR; | |
19114 | } | |
19115 | ||
19116 | ||
19117 | ||
19118 | static reg_errcode_t | |
19119 | ||
19120 | clean_state_log_if_needed (re_match_context_t *mctx, int next_state_log_idx) | |
19121 | { | |
19122 | int top = mctx->state_log_top; | |
19123 | ||
19124 | if (next_state_log_idx >= mctx->input.bufs_len | |
19125 | || (next_state_log_idx >= mctx->input.valid_len | |
19126 | && mctx->input.valid_len < mctx->input.len)) | |
19127 | { | |
19128 | reg_errcode_t err; | |
19129 | err = extend_buffers (mctx); | |
19130 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19131 | return err; | |
19132 | } | |
19133 | ||
19134 | if (top < next_state_log_idx) | |
19135 | { | |
19136 | memset (mctx->state_log + top + 1, '\0', | |
19137 | sizeof (re_dfastate_t *) * (next_state_log_idx - top)); | |
19138 | mctx->state_log_top = next_state_log_idx; | |
19139 | } | |
19140 | return REG_NOERROR; | |
19141 | } | |
19142 | ||
19143 | static reg_errcode_t | |
19144 | ||
19145 | merge_state_array (const re_dfa_t *dfa, re_dfastate_t **dst, | |
19146 | re_dfastate_t **src, int num) | |
19147 | { | |
19148 | int st_idx; | |
19149 | reg_errcode_t err; | |
19150 | for (st_idx = 0; st_idx < num; ++st_idx) | |
19151 | { | |
19152 | if (dst[st_idx] == ((void *)0)) | |
19153 | dst[st_idx] = src[st_idx]; | |
19154 | else if (src[st_idx] != ((void *)0)) | |
19155 | { | |
19156 | re_node_set merged_set; | |
19157 | err = re_node_set_init_union (&merged_set, &dst[st_idx]->nodes, | |
19158 | &src[st_idx]->nodes); | |
19159 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19160 | return err; | |
19161 | dst[st_idx] = re_acquire_state (&err, dfa, &merged_set); | |
19162 | free ((&merged_set)->elems); | |
19163 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19164 | return err; | |
19165 | } | |
19166 | } | |
19167 | return REG_NOERROR; | |
19168 | } | |
19169 | ||
19170 | static reg_errcode_t | |
19171 | ||
19172 | update_cur_sifted_state (const re_match_context_t *mctx, | |
19173 | re_sift_context_t *sctx, int str_idx, | |
19174 | re_node_set *dest_nodes) | |
19175 | { | |
19176 | const re_dfa_t *const dfa = mctx->dfa; | |
19177 | reg_errcode_t err = REG_NOERROR; | |
19178 | const re_node_set *candidates; | |
19179 | candidates = ((mctx->state_log[str_idx] == ((void *)0)) ? ((void *)0) | |
19180 | : &mctx->state_log[str_idx]->nodes); | |
19181 | ||
19182 | if (dest_nodes->nelem == 0) | |
19183 | sctx->sifted_states[str_idx] = ((void *)0); | |
19184 | else | |
19185 | { | |
19186 | if (candidates) | |
19187 | { | |
19188 | ||
19189 | ||
19190 | err = add_epsilon_src_nodes (dfa, dest_nodes, candidates); | |
19191 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19192 | return err; | |
19193 | ||
19194 | ||
19195 | if (sctx->limits.nelem) | |
19196 | { | |
19197 | err = check_subexp_limits (dfa, dest_nodes, candidates, &sctx->limits, | |
19198 | mctx->bkref_ents, str_idx); | |
19199 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19200 | return err; | |
19201 | } | |
19202 | } | |
19203 | ||
19204 | sctx->sifted_states[str_idx] = re_acquire_state (&err, dfa, dest_nodes); | |
19205 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19206 | return err; | |
19207 | } | |
19208 | ||
19209 | if (candidates && mctx->state_log[str_idx]->has_backref) | |
19210 | { | |
19211 | err = sift_states_bkref (mctx, sctx, str_idx, candidates); | |
19212 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19213 | return err; | |
19214 | } | |
19215 | return REG_NOERROR; | |
19216 | } | |
19217 | ||
19218 | static reg_errcode_t | |
19219 | ||
19220 | add_epsilon_src_nodes (const re_dfa_t *dfa, re_node_set *dest_nodes, | |
19221 | const re_node_set *candidates) | |
19222 | { | |
19223 | reg_errcode_t err = REG_NOERROR; | |
19224 | int i; | |
19225 | ||
19226 | re_dfastate_t *state = re_acquire_state (&err, dfa, dest_nodes); | |
19227 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19228 | return err; | |
19229 | ||
19230 | if (!state->inveclosure.alloc) | |
19231 | { | |
19232 | err = re_node_set_alloc (&state->inveclosure, dest_nodes->nelem); | |
19233 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19234 | return REG_ESPACE; | |
19235 | for (i = 0; i < dest_nodes->nelem; i++) | |
19236 | re_node_set_merge (&state->inveclosure, | |
19237 | dfa->inveclosures + dest_nodes->elems[i]); | |
19238 | } | |
19239 | return re_node_set_add_intersect (dest_nodes, candidates, | |
19240 | &state->inveclosure); | |
19241 | } | |
19242 | ||
19243 | static reg_errcode_t | |
19244 | ||
19245 | sub_epsilon_src_nodes (const re_dfa_t *dfa, int node, re_node_set *dest_nodes, | |
19246 | const re_node_set *candidates) | |
19247 | { | |
19248 | int ecl_idx; | |
19249 | reg_errcode_t err; | |
19250 | re_node_set *inv_eclosure = dfa->inveclosures + node; | |
19251 | re_node_set except_nodes; | |
19252 | memset (&except_nodes, '\0', sizeof (re_node_set)); | |
19253 | for (ecl_idx = 0; ecl_idx < inv_eclosure->nelem; ++ecl_idx) | |
19254 | { | |
19255 | int cur_node = inv_eclosure->elems[ecl_idx]; | |
19256 | if (cur_node == node) | |
19257 | continue; | |
19258 | if (((dfa->nodes[cur_node].type) & 8)) | |
19259 | { | |
19260 | int edst1 = dfa->edests[cur_node].elems[0]; | |
19261 | int edst2 = ((dfa->edests[cur_node].nelem > 1) | |
19262 | ? dfa->edests[cur_node].elems[1] : -1); | |
19263 | if ((!re_node_set_contains (inv_eclosure, edst1) | |
19264 | && re_node_set_contains (dest_nodes, edst1)) | |
19265 | || (edst2 > 0 | |
19266 | && !re_node_set_contains (inv_eclosure, edst2) | |
19267 | && re_node_set_contains (dest_nodes, edst2))) | |
19268 | { | |
19269 | err = re_node_set_add_intersect (&except_nodes, candidates, | |
19270 | dfa->inveclosures + cur_node); | |
19271 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19272 | { | |
19273 | free ((&except_nodes)->elems); | |
19274 | return err; | |
19275 | } | |
19276 | } | |
19277 | } | |
19278 | } | |
19279 | for (ecl_idx = 0; ecl_idx < inv_eclosure->nelem; ++ecl_idx) | |
19280 | { | |
19281 | int cur_node = inv_eclosure->elems[ecl_idx]; | |
19282 | if (!re_node_set_contains (&except_nodes, cur_node)) | |
19283 | { | |
19284 | int idx = re_node_set_contains (dest_nodes, cur_node) - 1; | |
19285 | re_node_set_remove_at (dest_nodes, idx); | |
19286 | } | |
19287 | } | |
19288 | free ((&except_nodes)->elems); | |
19289 | return REG_NOERROR; | |
19290 | } | |
19291 | ||
19292 | static int | |
19293 | ||
19294 | check_dst_limits (const re_match_context_t *mctx, re_node_set *limits, | |
19295 | int dst_node, int dst_idx, int src_node, int src_idx) | |
19296 | { | |
19297 | const re_dfa_t *const dfa = mctx->dfa; | |
19298 | int lim_idx, src_pos, dst_pos; | |
19299 | ||
19300 | int dst_bkref_idx = search_cur_bkref_entry (mctx, dst_idx); | |
19301 | int src_bkref_idx = search_cur_bkref_entry (mctx, src_idx); | |
19302 | for (lim_idx = 0; lim_idx < limits->nelem; ++lim_idx) | |
19303 | { | |
19304 | int subexp_idx; | |
19305 | struct re_backref_cache_entry *ent; | |
19306 | ent = mctx->bkref_ents + limits->elems[lim_idx]; | |
19307 | subexp_idx = dfa->nodes[ent->node].opr.idx; | |
19308 | ||
19309 | dst_pos = check_dst_limits_calc_pos (mctx, limits->elems[lim_idx], | |
19310 | subexp_idx, dst_node, dst_idx, | |
19311 | dst_bkref_idx); | |
19312 | src_pos = check_dst_limits_calc_pos (mctx, limits->elems[lim_idx], | |
19313 | subexp_idx, src_node, src_idx, | |
19314 | src_bkref_idx); | |
19315 | ||
19316 | ||
19317 | ||
19318 | ||
19319 | ||
19320 | if (src_pos == dst_pos) | |
19321 | continue; | |
19322 | else | |
19323 | return 1; | |
19324 | } | |
19325 | return 0; | |
19326 | } | |
19327 | ||
19328 | static int | |
19329 | ||
19330 | check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries, | |
19331 | int subexp_idx, int from_node, int bkref_idx) | |
19332 | { | |
19333 | const re_dfa_t *const dfa = mctx->dfa; | |
19334 | const re_node_set *eclosures = dfa->eclosures + from_node; | |
19335 | int node_idx; | |
19336 | ||
19337 | ||
19338 | ||
19339 | for (node_idx = 0; node_idx < eclosures->nelem; ++node_idx) | |
19340 | { | |
19341 | int node = eclosures->elems[node_idx]; | |
19342 | switch (dfa->nodes[node].type) | |
19343 | { | |
19344 | case OP_BACK_REF: | |
19345 | if (bkref_idx != -1) | |
19346 | { | |
19347 | struct re_backref_cache_entry *ent = mctx->bkref_ents + bkref_idx; | |
19348 | do | |
19349 | { | |
19350 | int dst, cpos; | |
19351 | ||
19352 | if (ent->node != node) | |
19353 | continue; | |
19354 | ||
19355 | if (subexp_idx < (sizeof (bitset_word_t) * 8) | |
19356 | && !(ent->eps_reachable_subexps_map | |
19357 | & ((bitset_word_t) 1 << subexp_idx))) | |
19358 | continue; | |
19359 | ||
19360 | ||
19361 | ||
19362 | ||
19363 | ||
19364 | ||
19365 | ||
19366 | dst = dfa->edests[node].elems[0]; | |
19367 | if (dst == from_node) | |
19368 | { | |
19369 | if (boundaries & 1) | |
19370 | return -1; | |
19371 | else | |
19372 | return 0; | |
19373 | } | |
19374 | ||
19375 | cpos = | |
19376 | check_dst_limits_calc_pos_1 (mctx, boundaries, subexp_idx, | |
19377 | dst, bkref_idx); | |
19378 | if (cpos == -1 ) | |
19379 | return -1; | |
19380 | if (cpos == 0 && (boundaries & 2)) | |
19381 | return 0; | |
19382 | ||
19383 | if (subexp_idx < (sizeof (bitset_word_t) * 8)) | |
19384 | ent->eps_reachable_subexps_map | |
19385 | &= ~((bitset_word_t) 1 << subexp_idx); | |
19386 | } | |
19387 | while (ent++->more); | |
19388 | } | |
19389 | break; | |
19390 | ||
19391 | case OP_OPEN_SUBEXP: | |
19392 | if ((boundaries & 1) && subexp_idx == dfa->nodes[node].opr.idx) | |
19393 | return -1; | |
19394 | break; | |
19395 | ||
19396 | case OP_CLOSE_SUBEXP: | |
19397 | if ((boundaries & 2) && subexp_idx == dfa->nodes[node].opr.idx) | |
19398 | return 0; | |
19399 | break; | |
19400 | ||
19401 | default: | |
19402 | break; | |
19403 | } | |
19404 | } | |
19405 | ||
19406 | return (boundaries & 2) ? 1 : 0; | |
19407 | } | |
19408 | ||
19409 | static int | |
19410 | ||
19411 | check_dst_limits_calc_pos (const re_match_context_t *mctx, int limit, | |
19412 | int subexp_idx, int from_node, int str_idx, | |
19413 | int bkref_idx) | |
19414 | { | |
19415 | struct re_backref_cache_entry *lim = mctx->bkref_ents + limit; | |
19416 | int boundaries; | |
19417 | ||
19418 | ||
19419 | if (str_idx < lim->subexp_from) | |
19420 | return -1; | |
19421 | ||
19422 | if (lim->subexp_to < str_idx) | |
19423 | return 1; | |
19424 | ||
19425 | ||
19426 | boundaries = (str_idx == lim->subexp_from); | |
19427 | boundaries |= (str_idx == lim->subexp_to) << 1; | |
19428 | if (boundaries == 0) | |
19429 | return 0; | |
19430 | ||
19431 | ||
19432 | return check_dst_limits_calc_pos_1 (mctx, boundaries, subexp_idx, | |
19433 | from_node, bkref_idx); | |
19434 | } | |
19435 | ||
19436 | ||
19437 | ||
19438 | ||
19439 | static reg_errcode_t | |
19440 | ||
19441 | check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes, | |
19442 | const re_node_set *candidates, re_node_set *limits, | |
19443 | struct re_backref_cache_entry *bkref_ents, int str_idx) | |
19444 | { | |
19445 | reg_errcode_t err; | |
19446 | int node_idx, lim_idx; | |
19447 | ||
19448 | for (lim_idx = 0; lim_idx < limits->nelem; ++lim_idx) | |
19449 | { | |
19450 | int subexp_idx; | |
19451 | struct re_backref_cache_entry *ent; | |
19452 | ent = bkref_ents + limits->elems[lim_idx]; | |
19453 | ||
19454 | if (str_idx <= ent->subexp_from || ent->str_idx < str_idx) | |
19455 | continue; | |
19456 | ||
19457 | subexp_idx = dfa->nodes[ent->node].opr.idx; | |
19458 | if (ent->subexp_to == str_idx) | |
19459 | { | |
19460 | int ops_node = -1; | |
19461 | int cls_node = -1; | |
19462 | for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx) | |
19463 | { | |
19464 | int node = dest_nodes->elems[node_idx]; | |
19465 | re_token_type_t type = dfa->nodes[node].type; | |
19466 | if (type == OP_OPEN_SUBEXP | |
19467 | && subexp_idx == dfa->nodes[node].opr.idx) | |
19468 | ops_node = node; | |
19469 | else if (type == OP_CLOSE_SUBEXP | |
19470 | && subexp_idx == dfa->nodes[node].opr.idx) | |
19471 | cls_node = node; | |
19472 | } | |
19473 | ||
19474 | ||
19475 | ||
19476 | if (ops_node >= 0) | |
19477 | { | |
19478 | err = sub_epsilon_src_nodes (dfa, ops_node, dest_nodes, | |
19479 | candidates); | |
19480 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19481 | return err; | |
19482 | } | |
19483 | ||
19484 | ||
19485 | if (cls_node >= 0) | |
19486 | for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx) | |
19487 | { | |
19488 | int node = dest_nodes->elems[node_idx]; | |
19489 | if (!re_node_set_contains (dfa->inveclosures + node, | |
19490 | cls_node) | |
19491 | && !re_node_set_contains (dfa->eclosures + node, | |
19492 | cls_node)) | |
19493 | { | |
19494 | ||
19495 | ||
19496 | err = sub_epsilon_src_nodes (dfa, node, dest_nodes, | |
19497 | candidates); | |
19498 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19499 | return err; | |
19500 | --node_idx; | |
19501 | } | |
19502 | } | |
19503 | } | |
19504 | else | |
19505 | { | |
19506 | for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx) | |
19507 | { | |
19508 | int node = dest_nodes->elems[node_idx]; | |
19509 | re_token_type_t type = dfa->nodes[node].type; | |
19510 | if (type == OP_CLOSE_SUBEXP || type == OP_OPEN_SUBEXP) | |
19511 | { | |
19512 | if (subexp_idx != dfa->nodes[node].opr.idx) | |
19513 | continue; | |
19514 | ||
19515 | ||
19516 | err = sub_epsilon_src_nodes (dfa, node, dest_nodes, | |
19517 | candidates); | |
19518 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19519 | return err; | |
19520 | } | |
19521 | } | |
19522 | } | |
19523 | } | |
19524 | return REG_NOERROR; | |
19525 | } | |
19526 | ||
19527 | static reg_errcode_t | |
19528 | ||
19529 | sift_states_bkref (const re_match_context_t *mctx, re_sift_context_t *sctx, | |
19530 | int str_idx, const re_node_set *candidates) | |
19531 | { | |
19532 | const re_dfa_t *const dfa = mctx->dfa; | |
19533 | reg_errcode_t err; | |
19534 | int node_idx, node; | |
19535 | re_sift_context_t local_sctx; | |
19536 | int first_idx = search_cur_bkref_entry (mctx, str_idx); | |
19537 | ||
19538 | if (first_idx == -1) | |
19539 | return REG_NOERROR; | |
19540 | ||
19541 | local_sctx.sifted_states = ((void *)0); | |
19542 | ||
19543 | for (node_idx = 0; node_idx < candidates->nelem; ++node_idx) | |
19544 | { | |
19545 | int enabled_idx; | |
19546 | re_token_type_t type; | |
19547 | struct re_backref_cache_entry *entry; | |
19548 | node = candidates->elems[node_idx]; | |
19549 | type = dfa->nodes[node].type; | |
19550 | ||
19551 | if (node == sctx->last_node && str_idx == sctx->last_str_idx) | |
19552 | continue; | |
19553 | if (type != OP_BACK_REF) | |
19554 | continue; | |
19555 | ||
19556 | entry = mctx->bkref_ents + first_idx; | |
19557 | enabled_idx = first_idx; | |
19558 | do | |
19559 | { | |
19560 | int subexp_len; | |
19561 | int to_idx; | |
19562 | int dst_node; | |
19563 | int ret; | |
19564 | re_dfastate_t *cur_state; | |
19565 | ||
19566 | if (entry->node != node) | |
19567 | continue; | |
19568 | subexp_len = entry->subexp_to - entry->subexp_from; | |
19569 | to_idx = str_idx + subexp_len; | |
19570 | dst_node = (subexp_len ? dfa->nexts[node] | |
19571 | : dfa->edests[node].elems[0]); | |
19572 | ||
19573 | if (to_idx > sctx->last_str_idx | |
19574 | || sctx->sifted_states[to_idx] == ((void *)0) | |
19575 | || !((sctx->sifted_states[to_idx]) != ((void *)0) && re_node_set_contains (&(sctx->sifted_states[to_idx])->nodes, dst_node)) | |
19576 | || check_dst_limits (mctx, &sctx->limits, node, | |
19577 | str_idx, dst_node, to_idx)) | |
19578 | continue; | |
19579 | ||
19580 | if (local_sctx.sifted_states == ((void *)0)) | |
19581 | { | |
19582 | local_sctx = *sctx; | |
19583 | err = re_node_set_init_copy (&local_sctx.limits, &sctx->limits); | |
19584 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19585 | goto free_return; | |
19586 | } | |
19587 | local_sctx.last_node = node; | |
19588 | local_sctx.last_str_idx = str_idx; | |
19589 | ret = re_node_set_insert (&local_sctx.limits, enabled_idx); | |
19590 | if (__builtin_expect (ret < 0, 0)) | |
19591 | { | |
19592 | err = REG_ESPACE; | |
19593 | goto free_return; | |
19594 | } | |
19595 | cur_state = local_sctx.sifted_states[str_idx]; | |
19596 | err = sift_states_backward (mctx, &local_sctx); | |
19597 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19598 | goto free_return; | |
19599 | if (sctx->limited_states != ((void *)0)) | |
19600 | { | |
19601 | err = merge_state_array (dfa, sctx->limited_states, | |
19602 | local_sctx.sifted_states, | |
19603 | str_idx + 1); | |
19604 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19605 | goto free_return; | |
19606 | } | |
19607 | local_sctx.sifted_states[str_idx] = cur_state; | |
19608 | (re_node_set_remove_at (&local_sctx.limits, re_node_set_contains (&local_sctx.limits, enabled_idx) - 1)); | |
19609 | ||
19610 | ||
19611 | entry = mctx->bkref_ents + enabled_idx; | |
19612 | } | |
19613 | while (enabled_idx++, entry++->more); | |
19614 | } | |
19615 | err = REG_NOERROR; | |
19616 | free_return: | |
19617 | if (local_sctx.sifted_states != ((void *)0)) | |
19618 | { | |
19619 | free ((&local_sctx.limits)->elems); | |
19620 | } | |
19621 | ||
19622 | return err; | |
19623 | } | |
19624 | ||
19625 | ||
19626 | ||
19627 | static int | |
19628 | ||
19629 | sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx, | |
19630 | int node_idx, int str_idx, int max_str_idx) | |
19631 | { | |
19632 | const re_dfa_t *const dfa = mctx->dfa; | |
19633 | int naccepted; | |
19634 | ||
19635 | naccepted = check_node_accept_bytes (dfa, node_idx, &mctx->input, str_idx); | |
19636 | if (naccepted > 0 && str_idx + naccepted <= max_str_idx && | |
19637 | !((sctx->sifted_states[str_idx + naccepted]) != ((void *)0) && re_node_set_contains (&(sctx->sifted_states[str_idx + naccepted])->nodes, dfa->nexts[node_idx]))) | |
19638 | ||
19639 | ||
19640 | ||
19641 | ||
19642 | naccepted = 0; | |
19643 | ||
19644 | ||
19645 | return naccepted; | |
19646 | } | |
19647 | # 2241 "regexec.c" | |
19648 | static re_dfastate_t * | |
19649 | ||
19650 | transit_state (reg_errcode_t *err, re_match_context_t *mctx, | |
19651 | re_dfastate_t *state) | |
19652 | { | |
19653 | re_dfastate_t **trtable; | |
19654 | unsigned char ch; | |
19655 | ||
19656 | ||
19657 | ||
19658 | if (__builtin_expect (state->accept_mb, 0)) | |
19659 | { | |
19660 | *err = transit_state_mb (mctx, state); | |
19661 | if (__builtin_expect (*err != REG_NOERROR, 0)) | |
19662 | return ((void *)0); | |
19663 | } | |
19664 | # 2267 "regexec.c" | |
19665 | ch = ((&mctx->input)->mbs[(&mctx->input)->cur_idx++]); | |
19666 | for (;;) | |
19667 | { | |
19668 | trtable = state->trtable; | |
19669 | if (__builtin_expect (trtable != ((void *)0), 1)) | |
19670 | return trtable[ch]; | |
19671 | ||
19672 | trtable = state->word_trtable; | |
19673 | if (__builtin_expect (trtable != ((void *)0), 1)) | |
19674 | { | |
19675 | unsigned int context; | |
19676 | context | |
19677 | = re_string_context_at (&mctx->input, | |
19678 | ((&mctx->input)->cur_idx) - 1, | |
19679 | mctx->eflags); | |
19680 | if (((context) & 1)) | |
19681 | return trtable[ch + 256]; | |
19682 | else | |
19683 | return trtable[ch]; | |
19684 | } | |
19685 | ||
19686 | if (!build_trtable (mctx->dfa, state)) | |
19687 | { | |
19688 | *err = REG_ESPACE; | |
19689 | return ((void *)0); | |
19690 | } | |
19691 | ||
19692 | ||
19693 | } | |
19694 | } | |
19695 | ||
19696 | ||
19697 | re_dfastate_t * | |
19698 | ||
19699 | merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx, | |
19700 | re_dfastate_t *next_state) | |
19701 | { | |
19702 | const re_dfa_t *const dfa = mctx->dfa; | |
19703 | int cur_idx = ((&mctx->input)->cur_idx); | |
19704 | ||
19705 | if (cur_idx > mctx->state_log_top) | |
19706 | { | |
19707 | mctx->state_log[cur_idx] = next_state; | |
19708 | mctx->state_log_top = cur_idx; | |
19709 | } | |
19710 | else if (mctx->state_log[cur_idx] == 0) | |
19711 | { | |
19712 | mctx->state_log[cur_idx] = next_state; | |
19713 | } | |
19714 | else | |
19715 | { | |
19716 | re_dfastate_t *pstate; | |
19717 | unsigned int context; | |
19718 | re_node_set next_nodes, *log_nodes, *table_nodes = ((void *)0); | |
19719 | ||
19720 | ||
19721 | ||
19722 | ||
19723 | pstate = mctx->state_log[cur_idx]; | |
19724 | log_nodes = pstate->entrance_nodes; | |
19725 | if (next_state != ((void *)0)) | |
19726 | { | |
19727 | table_nodes = next_state->entrance_nodes; | |
19728 | *err = re_node_set_init_union (&next_nodes, table_nodes, | |
19729 | log_nodes); | |
19730 | if (__builtin_expect (*err != REG_NOERROR, 0)) | |
19731 | return ((void *)0); | |
19732 | } | |
19733 | else | |
19734 | next_nodes = *log_nodes; | |
19735 | ||
19736 | ||
19737 | ||
19738 | context = re_string_context_at (&mctx->input, | |
19739 | ((&mctx->input)->cur_idx) - 1, | |
19740 | mctx->eflags); | |
19741 | next_state = mctx->state_log[cur_idx] | |
19742 | = re_acquire_state_context (err, dfa, &next_nodes, context); | |
19743 | ||
19744 | ||
19745 | ||
19746 | if (table_nodes != ((void *)0)) | |
19747 | free ((&next_nodes)->elems); | |
19748 | } | |
19749 | ||
19750 | if (__builtin_expect (dfa->nbackref, 0) && next_state != ((void *)0)) | |
19751 | { | |
19752 | ||
19753 | ||
19754 | ||
19755 | *err = check_subexp_matching_top (mctx, &next_state->nodes, | |
19756 | cur_idx); | |
19757 | if (__builtin_expect (*err != REG_NOERROR, 0)) | |
19758 | return ((void *)0); | |
19759 | ||
19760 | ||
19761 | if (next_state->has_backref) | |
19762 | { | |
19763 | *err = transit_state_bkref (mctx, &next_state->nodes); | |
19764 | if (__builtin_expect (*err != REG_NOERROR, 0)) | |
19765 | return ((void *)0); | |
19766 | next_state = mctx->state_log[cur_idx]; | |
19767 | } | |
19768 | } | |
19769 | ||
19770 | return next_state; | |
19771 | } | |
19772 | ||
19773 | ||
19774 | ||
19775 | ||
19776 | re_dfastate_t * | |
19777 | ||
19778 | find_recover_state (reg_errcode_t *err, re_match_context_t *mctx) | |
19779 | { | |
19780 | re_dfastate_t *cur_state; | |
19781 | do | |
19782 | { | |
19783 | int max = mctx->state_log_top; | |
19784 | int cur_str_idx = ((&mctx->input)->cur_idx); | |
19785 | ||
19786 | do | |
19787 | { | |
19788 | if (++cur_str_idx > max) | |
19789 | return ((void *)0); | |
19790 | ((&mctx->input)->cur_idx += (1)); | |
19791 | } | |
19792 | while (mctx->state_log[cur_str_idx] == ((void *)0)); | |
19793 | ||
19794 | cur_state = merge_state_with_log (err, mctx, ((void *)0)); | |
19795 | } | |
19796 | while (*err == REG_NOERROR && cur_state == ((void *)0)); | |
19797 | return cur_state; | |
19798 | } | |
19799 | # 2409 "regexec.c" | |
19800 | static reg_errcode_t | |
19801 | ||
19802 | check_subexp_matching_top (re_match_context_t *mctx, re_node_set *cur_nodes, | |
19803 | int str_idx) | |
19804 | { | |
19805 | const re_dfa_t *const dfa = mctx->dfa; | |
19806 | int node_idx; | |
19807 | reg_errcode_t err; | |
19808 | ||
19809 | ||
19810 | ||
19811 | ||
19812 | ||
19813 | ||
19814 | for (node_idx = 0; node_idx < cur_nodes->nelem; ++node_idx) | |
19815 | { | |
19816 | int node = cur_nodes->elems[node_idx]; | |
19817 | if (dfa->nodes[node].type == OP_OPEN_SUBEXP | |
19818 | && dfa->nodes[node].opr.idx < (sizeof (bitset_word_t) * 8) | |
19819 | && (dfa->used_bkref_map | |
19820 | & ((bitset_word_t) 1 << dfa->nodes[node].opr.idx))) | |
19821 | { | |
19822 | err = match_ctx_add_subtop (mctx, node, str_idx); | |
19823 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19824 | return err; | |
19825 | } | |
19826 | } | |
19827 | return REG_NOERROR; | |
19828 | } | |
19829 | # 2482 "regexec.c" | |
19830 | static reg_errcode_t | |
19831 | ||
19832 | transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate) | |
19833 | { | |
19834 | const re_dfa_t *const dfa = mctx->dfa; | |
19835 | reg_errcode_t err; | |
19836 | int i; | |
19837 | ||
19838 | for (i = 0; i < pstate->nodes.nelem; ++i) | |
19839 | { | |
19840 | re_node_set dest_nodes, *new_nodes; | |
19841 | int cur_node_idx = pstate->nodes.elems[i]; | |
19842 | int naccepted, dest_idx; | |
19843 | unsigned int context; | |
19844 | re_dfastate_t *dest_state; | |
19845 | ||
19846 | if (!dfa->nodes[cur_node_idx].accept_mb) | |
19847 | continue; | |
19848 | ||
19849 | if (dfa->nodes[cur_node_idx].constraint) | |
19850 | { | |
19851 | context = re_string_context_at (&mctx->input, | |
19852 | ((&mctx->input)->cur_idx), | |
19853 | mctx->eflags); | |
19854 | if (((((dfa->nodes[cur_node_idx].constraint) & 0x0004) && !((context) & 1)) || (((dfa->nodes[cur_node_idx].constraint) & 0x0008) && ((context) & 1)) || (((dfa->nodes[cur_node_idx].constraint) & 0x0020) && !((context) & (1 << 1))) || (((dfa->nodes[cur_node_idx].constraint) & 0x0080) && !((context) & (((1 << 1) << 1) << 1))))) | |
19855 | ||
19856 | continue; | |
19857 | } | |
19858 | ||
19859 | ||
19860 | naccepted = check_node_accept_bytes (dfa, cur_node_idx, &mctx->input, | |
19861 | ((&mctx->input)->cur_idx)); | |
19862 | if (naccepted == 0) | |
19863 | continue; | |
19864 | ||
19865 | ||
19866 | dest_idx = ((&mctx->input)->cur_idx) + naccepted; | |
19867 | mctx->max_mb_elem_len = ((mctx->max_mb_elem_len < naccepted) ? naccepted | |
19868 | : mctx->max_mb_elem_len); | |
19869 | err = clean_state_log_if_needed (mctx, dest_idx); | |
19870 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19871 | return err; | |
19872 | ||
19873 | ||
19874 | ||
19875 | new_nodes = dfa->eclosures + dfa->nexts[cur_node_idx]; | |
19876 | ||
19877 | dest_state = mctx->state_log[dest_idx]; | |
19878 | if (dest_state == ((void *)0)) | |
19879 | dest_nodes = *new_nodes; | |
19880 | else | |
19881 | { | |
19882 | err = re_node_set_init_union (&dest_nodes, | |
19883 | dest_state->entrance_nodes, new_nodes); | |
19884 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19885 | return err; | |
19886 | } | |
19887 | context = re_string_context_at (&mctx->input, dest_idx - 1, | |
19888 | mctx->eflags); | |
19889 | mctx->state_log[dest_idx] | |
19890 | = re_acquire_state_context (&err, dfa, &dest_nodes, context); | |
19891 | if (dest_state != ((void *)0)) | |
19892 | free ((&dest_nodes)->elems); | |
19893 | if (__builtin_expect (mctx->state_log[dest_idx] == ((void *)0) && err != REG_NOERROR, 0)) | |
19894 | return err; | |
19895 | } | |
19896 | return REG_NOERROR; | |
19897 | } | |
19898 | ||
19899 | ||
19900 | static reg_errcode_t | |
19901 | ||
19902 | transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes) | |
19903 | { | |
19904 | const re_dfa_t *const dfa = mctx->dfa; | |
19905 | reg_errcode_t err; | |
19906 | int i; | |
19907 | int cur_str_idx = ((&mctx->input)->cur_idx); | |
19908 | ||
19909 | for (i = 0; i < nodes->nelem; ++i) | |
19910 | { | |
19911 | int dest_str_idx, prev_nelem, bkc_idx; | |
19912 | int node_idx = nodes->elems[i]; | |
19913 | unsigned int context; | |
19914 | const re_token_t *node = dfa->nodes + node_idx; | |
19915 | re_node_set *new_dest_nodes; | |
19916 | ||
19917 | ||
19918 | if (node->type != OP_BACK_REF) | |
19919 | continue; | |
19920 | ||
19921 | if (node->constraint) | |
19922 | { | |
19923 | context = re_string_context_at (&mctx->input, cur_str_idx, | |
19924 | mctx->eflags); | |
19925 | if (((((node->constraint) & 0x0004) && !((context) & 1)) || (((node->constraint) & 0x0008) && ((context) & 1)) || (((node->constraint) & 0x0020) && !((context) & (1 << 1))) || (((node->constraint) & 0x0080) && !((context) & (((1 << 1) << 1) << 1))))) | |
19926 | continue; | |
19927 | } | |
19928 | ||
19929 | ||
19930 | ||
19931 | bkc_idx = mctx->nbkref_ents; | |
19932 | err = get_subexp (mctx, node_idx, cur_str_idx); | |
19933 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19934 | goto free_return; | |
19935 | ||
19936 | ||
19937 | ||
19938 | ||
19939 | ||
19940 | ||
19941 | for (; bkc_idx < mctx->nbkref_ents; ++bkc_idx) | |
19942 | { | |
19943 | int subexp_len; | |
19944 | re_dfastate_t *dest_state; | |
19945 | struct re_backref_cache_entry *bkref_ent; | |
19946 | bkref_ent = mctx->bkref_ents + bkc_idx; | |
19947 | if (bkref_ent->node != node_idx || bkref_ent->str_idx != cur_str_idx) | |
19948 | continue; | |
19949 | subexp_len = bkref_ent->subexp_to - bkref_ent->subexp_from; | |
19950 | new_dest_nodes = (subexp_len == 0 | |
19951 | ? dfa->eclosures + dfa->edests[node_idx].elems[0] | |
19952 | : dfa->eclosures + dfa->nexts[node_idx]); | |
19953 | dest_str_idx = (cur_str_idx + bkref_ent->subexp_to | |
19954 | - bkref_ent->subexp_from); | |
19955 | context = re_string_context_at (&mctx->input, dest_str_idx - 1, | |
19956 | mctx->eflags); | |
19957 | dest_state = mctx->state_log[dest_str_idx]; | |
19958 | prev_nelem = ((mctx->state_log[cur_str_idx] == ((void *)0)) ? 0 | |
19959 | : mctx->state_log[cur_str_idx]->nodes.nelem); | |
19960 | ||
19961 | if (dest_state == ((void *)0)) | |
19962 | { | |
19963 | mctx->state_log[dest_str_idx] | |
19964 | = re_acquire_state_context (&err, dfa, new_dest_nodes, | |
19965 | context); | |
19966 | if (__builtin_expect (mctx->state_log[dest_str_idx] == ((void *)0) && err != REG_NOERROR, 0)) | |
19967 | ||
19968 | goto free_return; | |
19969 | } | |
19970 | else | |
19971 | { | |
19972 | re_node_set dest_nodes; | |
19973 | err = re_node_set_init_union (&dest_nodes, | |
19974 | dest_state->entrance_nodes, | |
19975 | new_dest_nodes); | |
19976 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19977 | { | |
19978 | free ((&dest_nodes)->elems); | |
19979 | goto free_return; | |
19980 | } | |
19981 | mctx->state_log[dest_str_idx] | |
19982 | = re_acquire_state_context (&err, dfa, &dest_nodes, context); | |
19983 | free ((&dest_nodes)->elems); | |
19984 | if (__builtin_expect (mctx->state_log[dest_str_idx] == ((void *)0) && err != REG_NOERROR, 0)) | |
19985 | ||
19986 | goto free_return; | |
19987 | } | |
19988 | ||
19989 | ||
19990 | if (subexp_len == 0 | |
19991 | && mctx->state_log[cur_str_idx]->nodes.nelem > prev_nelem) | |
19992 | { | |
19993 | err = check_subexp_matching_top (mctx, new_dest_nodes, | |
19994 | cur_str_idx); | |
19995 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19996 | goto free_return; | |
19997 | err = transit_state_bkref (mctx, new_dest_nodes); | |
19998 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
19999 | goto free_return; | |
20000 | } | |
20001 | } | |
20002 | } | |
20003 | err = REG_NOERROR; | |
20004 | free_return: | |
20005 | return err; | |
20006 | } | |
20007 | ||
20008 | ||
20009 | ||
20010 | ||
20011 | ||
20012 | ||
20013 | ||
20014 | static reg_errcode_t | |
20015 | ||
20016 | get_subexp (re_match_context_t *mctx, int bkref_node, int bkref_str_idx) | |
20017 | { | |
20018 | const re_dfa_t *const dfa = mctx->dfa; | |
20019 | int subexp_num, sub_top_idx; | |
20020 | const char *buf = (const char *) ((&mctx->input)->mbs); | |
20021 | ||
20022 | int cache_idx = search_cur_bkref_entry (mctx, bkref_str_idx); | |
20023 | if (cache_idx != -1) | |
20024 | { | |
20025 | const struct re_backref_cache_entry *entry | |
20026 | = mctx->bkref_ents + cache_idx; | |
20027 | do | |
20028 | if (entry->node == bkref_node) | |
20029 | return REG_NOERROR; | |
20030 | while (entry++->more); | |
20031 | } | |
20032 | ||
20033 | subexp_num = dfa->nodes[bkref_node].opr.idx; | |
20034 | ||
20035 | ||
20036 | for (sub_top_idx = 0; sub_top_idx < mctx->nsub_tops; ++sub_top_idx) | |
20037 | { | |
20038 | reg_errcode_t err; | |
20039 | re_sub_match_top_t *sub_top = mctx->sub_tops[sub_top_idx]; | |
20040 | re_sub_match_last_t *sub_last; | |
20041 | int sub_last_idx, sl_str, bkref_str_off; | |
20042 | ||
20043 | if (dfa->nodes[sub_top->node].opr.idx != subexp_num) | |
20044 | continue; | |
20045 | ||
20046 | sl_str = sub_top->str_idx; | |
20047 | bkref_str_off = bkref_str_idx; | |
20048 | ||
20049 | ||
20050 | for (sub_last_idx = 0; sub_last_idx < sub_top->nlasts; ++sub_last_idx) | |
20051 | { | |
20052 | int sl_str_diff; | |
20053 | sub_last = sub_top->lasts[sub_last_idx]; | |
20054 | sl_str_diff = sub_last->str_idx - sl_str; | |
20055 | ||
20056 | ||
20057 | if (sl_str_diff > 0) | |
20058 | { | |
20059 | if (__builtin_expect (bkref_str_off + sl_str_diff > mctx->input.valid_len, 0)) | |
20060 | { | |
20061 | ||
20062 | if (bkref_str_off + sl_str_diff > mctx->input.len) | |
20063 | break; | |
20064 | ||
20065 | err = clean_state_log_if_needed (mctx, | |
20066 | bkref_str_off | |
20067 | + sl_str_diff); | |
20068 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20069 | return err; | |
20070 | buf = (const char *) ((&mctx->input)->mbs); | |
20071 | } | |
20072 | if (memcmp (buf + bkref_str_off, buf + sl_str, sl_str_diff) != 0) | |
20073 | ||
20074 | break; | |
20075 | } | |
20076 | bkref_str_off += sl_str_diff; | |
20077 | sl_str += sl_str_diff; | |
20078 | err = get_subexp_sub (mctx, sub_top, sub_last, bkref_node, | |
20079 | bkref_str_idx); | |
20080 | ||
20081 | ||
20082 | ||
20083 | buf = (const char *) ((&mctx->input)->mbs); | |
20084 | ||
20085 | if (err == REG_NOMATCH) | |
20086 | continue; | |
20087 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20088 | return err; | |
20089 | } | |
20090 | ||
20091 | if (sub_last_idx < sub_top->nlasts) | |
20092 | continue; | |
20093 | if (sub_last_idx > 0) | |
20094 | ++sl_str; | |
20095 | ||
20096 | for (; sl_str <= bkref_str_idx; ++sl_str) | |
20097 | { | |
20098 | int cls_node, sl_str_off; | |
20099 | const re_node_set *nodes; | |
20100 | sl_str_off = sl_str - sub_top->str_idx; | |
20101 | ||
20102 | ||
20103 | if (sl_str_off > 0) | |
20104 | { | |
20105 | if (__builtin_expect (bkref_str_off >= mctx->input.valid_len, 0)) | |
20106 | { | |
20107 | ||
20108 | if (bkref_str_off >= mctx->input.len) | |
20109 | break; | |
20110 | ||
20111 | err = extend_buffers (mctx); | |
20112 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20113 | return err; | |
20114 | ||
20115 | buf = (const char *) ((&mctx->input)->mbs); | |
20116 | } | |
20117 | if (buf [bkref_str_off++] != buf[sl_str - 1]) | |
20118 | break; | |
20119 | ||
20120 | } | |
20121 | if (mctx->state_log[sl_str] == ((void *)0)) | |
20122 | continue; | |
20123 | ||
20124 | nodes = &mctx->state_log[sl_str]->nodes; | |
20125 | cls_node = find_subexp_node (dfa, nodes, subexp_num, | |
20126 | OP_CLOSE_SUBEXP); | |
20127 | if (cls_node == -1) | |
20128 | continue; | |
20129 | if (sub_top->path == ((void *)0)) | |
20130 | { | |
20131 | sub_top->path = calloc (sizeof (state_array_t), | |
20132 | sl_str - sub_top->str_idx + 1); | |
20133 | if (sub_top->path == ((void *)0)) | |
20134 | return REG_ESPACE; | |
20135 | } | |
20136 | ||
20137 | ||
20138 | err = check_arrival (mctx, sub_top->path, sub_top->node, | |
20139 | sub_top->str_idx, cls_node, sl_str, | |
20140 | OP_CLOSE_SUBEXP); | |
20141 | if (err == REG_NOMATCH) | |
20142 | continue; | |
20143 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20144 | return err; | |
20145 | sub_last = match_ctx_add_sublast (sub_top, cls_node, sl_str); | |
20146 | if (__builtin_expect (sub_last == ((void *)0), 0)) | |
20147 | return REG_ESPACE; | |
20148 | err = get_subexp_sub (mctx, sub_top, sub_last, bkref_node, | |
20149 | bkref_str_idx); | |
20150 | if (err == REG_NOMATCH) | |
20151 | continue; | |
20152 | } | |
20153 | } | |
20154 | return REG_NOERROR; | |
20155 | } | |
20156 | ||
20157 | ||
20158 | ||
20159 | ||
20160 | ||
20161 | ||
20162 | ||
20163 | static reg_errcode_t | |
20164 | ||
20165 | get_subexp_sub (re_match_context_t *mctx, const re_sub_match_top_t *sub_top, | |
20166 | re_sub_match_last_t *sub_last, int bkref_node, int bkref_str) | |
20167 | { | |
20168 | reg_errcode_t err; | |
20169 | int to_idx; | |
20170 | ||
20171 | err = check_arrival (mctx, &sub_last->path, sub_last->node, | |
20172 | sub_last->str_idx, bkref_node, bkref_str, | |
20173 | OP_OPEN_SUBEXP); | |
20174 | if (err != REG_NOERROR) | |
20175 | return err; | |
20176 | err = match_ctx_add_entry (mctx, bkref_node, bkref_str, sub_top->str_idx, | |
20177 | sub_last->str_idx); | |
20178 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20179 | return err; | |
20180 | to_idx = bkref_str + sub_last->str_idx - sub_top->str_idx; | |
20181 | return clean_state_log_if_needed (mctx, to_idx); | |
20182 | } | |
20183 | # 2844 "regexec.c" | |
20184 | static int | |
20185 | ||
20186 | find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes, | |
20187 | int subexp_idx, int type) | |
20188 | { | |
20189 | int cls_idx; | |
20190 | for (cls_idx = 0; cls_idx < nodes->nelem; ++cls_idx) | |
20191 | { | |
20192 | int cls_node = nodes->elems[cls_idx]; | |
20193 | const re_token_t *node = dfa->nodes + cls_node; | |
20194 | if (node->type == type | |
20195 | && node->opr.idx == subexp_idx) | |
20196 | return cls_node; | |
20197 | } | |
20198 | return -1; | |
20199 | } | |
20200 | ||
20201 | ||
20202 | ||
20203 | ||
20204 | ||
20205 | ||
20206 | static reg_errcode_t | |
20207 | ||
20208 | check_arrival (re_match_context_t *mctx, state_array_t *path, int top_node, | |
20209 | int top_str, int last_node, int last_str, int type) | |
20210 | { | |
20211 | const re_dfa_t *const dfa = mctx->dfa; | |
20212 | reg_errcode_t err = REG_NOERROR; | |
20213 | int subexp_num, backup_cur_idx, str_idx, null_cnt; | |
20214 | re_dfastate_t *cur_state = ((void *)0); | |
20215 | re_node_set *cur_nodes, next_nodes; | |
20216 | re_dfastate_t **backup_state_log; | |
20217 | unsigned int context; | |
20218 | ||
20219 | subexp_num = dfa->nodes[top_node].opr.idx; | |
20220 | ||
20221 | if (__builtin_expect (path->alloc < last_str + mctx->max_mb_elem_len + 1, 0)) | |
20222 | { | |
20223 | re_dfastate_t **new_array; | |
20224 | int old_alloc = path->alloc; | |
20225 | path->alloc += last_str + mctx->max_mb_elem_len + 1; | |
20226 | new_array = ((re_dfastate_t * *) realloc (path->array, (path->alloc) * sizeof (re_dfastate_t *))); | |
20227 | if (__builtin_expect (new_array == ((void *)0), 0)) | |
20228 | { | |
20229 | path->alloc = old_alloc; | |
20230 | return REG_ESPACE; | |
20231 | } | |
20232 | path->array = new_array; | |
20233 | memset (new_array + old_alloc, '\0', | |
20234 | sizeof (re_dfastate_t *) * (path->alloc - old_alloc)); | |
20235 | } | |
20236 | ||
20237 | str_idx = path->next_idx ?: top_str; | |
20238 | ||
20239 | ||
20240 | backup_state_log = mctx->state_log; | |
20241 | backup_cur_idx = mctx->input.cur_idx; | |
20242 | mctx->state_log = path->array; | |
20243 | mctx->input.cur_idx = str_idx; | |
20244 | ||
20245 | ||
20246 | context = re_string_context_at (&mctx->input, str_idx - 1, mctx->eflags); | |
20247 | if (str_idx == top_str) | |
20248 | { | |
20249 | err = re_node_set_init_1 (&next_nodes, top_node); | |
20250 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20251 | return err; | |
20252 | err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num, type); | |
20253 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20254 | { | |
20255 | free ((&next_nodes)->elems); | |
20256 | return err; | |
20257 | } | |
20258 | } | |
20259 | else | |
20260 | { | |
20261 | cur_state = mctx->state_log[str_idx]; | |
20262 | if (cur_state && cur_state->has_backref) | |
20263 | { | |
20264 | err = re_node_set_init_copy (&next_nodes, &cur_state->nodes); | |
20265 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20266 | return err; | |
20267 | } | |
20268 | else | |
20269 | memset (&next_nodes, '\0', sizeof (re_node_set)); | |
20270 | } | |
20271 | if (str_idx == top_str || (cur_state && cur_state->has_backref)) | |
20272 | { | |
20273 | if (next_nodes.nelem) | |
20274 | { | |
20275 | err = expand_bkref_cache (mctx, &next_nodes, str_idx, | |
20276 | subexp_num, type); | |
20277 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20278 | { | |
20279 | free ((&next_nodes)->elems); | |
20280 | return err; | |
20281 | } | |
20282 | } | |
20283 | cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context); | |
20284 | if (__builtin_expect (cur_state == ((void *)0) && err != REG_NOERROR, 0)) | |
20285 | { | |
20286 | free ((&next_nodes)->elems); | |
20287 | return err; | |
20288 | } | |
20289 | mctx->state_log[str_idx] = cur_state; | |
20290 | } | |
20291 | ||
20292 | for (null_cnt = 0; str_idx < last_str && null_cnt <= mctx->max_mb_elem_len;) | |
20293 | { | |
20294 | ((&next_nodes)->nelem = 0); | |
20295 | if (mctx->state_log[str_idx + 1]) | |
20296 | { | |
20297 | err = re_node_set_merge (&next_nodes, | |
20298 | &mctx->state_log[str_idx + 1]->nodes); | |
20299 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20300 | { | |
20301 | free ((&next_nodes)->elems); | |
20302 | return err; | |
20303 | } | |
20304 | } | |
20305 | if (cur_state) | |
20306 | { | |
20307 | err = check_arrival_add_next_nodes (mctx, str_idx, | |
20308 | &cur_state->non_eps_nodes, | |
20309 | &next_nodes); | |
20310 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20311 | { | |
20312 | free ((&next_nodes)->elems); | |
20313 | return err; | |
20314 | } | |
20315 | } | |
20316 | ++str_idx; | |
20317 | if (next_nodes.nelem) | |
20318 | { | |
20319 | err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num, type); | |
20320 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20321 | { | |
20322 | free ((&next_nodes)->elems); | |
20323 | return err; | |
20324 | } | |
20325 | err = expand_bkref_cache (mctx, &next_nodes, str_idx, | |
20326 | subexp_num, type); | |
20327 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20328 | { | |
20329 | free ((&next_nodes)->elems); | |
20330 | return err; | |
20331 | } | |
20332 | } | |
20333 | context = re_string_context_at (&mctx->input, str_idx - 1, mctx->eflags); | |
20334 | cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context); | |
20335 | if (__builtin_expect (cur_state == ((void *)0) && err != REG_NOERROR, 0)) | |
20336 | { | |
20337 | free ((&next_nodes)->elems); | |
20338 | return err; | |
20339 | } | |
20340 | mctx->state_log[str_idx] = cur_state; | |
20341 | null_cnt = cur_state == ((void *)0) ? null_cnt + 1 : 0; | |
20342 | } | |
20343 | free ((&next_nodes)->elems); | |
20344 | cur_nodes = (mctx->state_log[last_str] == ((void *)0) ? ((void *)0) | |
20345 | : &mctx->state_log[last_str]->nodes); | |
20346 | path->next_idx = str_idx; | |
20347 | ||
20348 | ||
20349 | mctx->state_log = backup_state_log; | |
20350 | mctx->input.cur_idx = backup_cur_idx; | |
20351 | ||
20352 | ||
20353 | if (cur_nodes != ((void *)0) && re_node_set_contains (cur_nodes, last_node)) | |
20354 | return REG_NOERROR; | |
20355 | ||
20356 | return REG_NOMATCH; | |
20357 | } | |
20358 | # 3027 "regexec.c" | |
20359 | static reg_errcode_t | |
20360 | ||
20361 | check_arrival_add_next_nodes (re_match_context_t *mctx, int str_idx, | |
20362 | re_node_set *cur_nodes, re_node_set *next_nodes) | |
20363 | { | |
20364 | const re_dfa_t *const dfa = mctx->dfa; | |
20365 | int result; | |
20366 | int cur_idx; | |
20367 | reg_errcode_t err = REG_NOERROR; | |
20368 | re_node_set union_set; | |
20369 | memset (&union_set, '\0', sizeof (re_node_set)); | |
20370 | for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx) | |
20371 | { | |
20372 | int naccepted = 0; | |
20373 | int cur_node = cur_nodes->elems[cur_idx]; | |
20374 | ||
20375 | ||
20376 | ||
20377 | ||
20378 | ||
20379 | ||
20380 | if (dfa->nodes[cur_node].accept_mb) | |
20381 | { | |
20382 | naccepted = check_node_accept_bytes (dfa, cur_node, &mctx->input, | |
20383 | str_idx); | |
20384 | if (naccepted > 1) | |
20385 | { | |
20386 | re_dfastate_t *dest_state; | |
20387 | int next_node = dfa->nexts[cur_node]; | |
20388 | int next_idx = str_idx + naccepted; | |
20389 | dest_state = mctx->state_log[next_idx]; | |
20390 | ((&union_set)->nelem = 0); | |
20391 | if (dest_state) | |
20392 | { | |
20393 | err = re_node_set_merge (&union_set, &dest_state->nodes); | |
20394 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20395 | { | |
20396 | free ((&union_set)->elems); | |
20397 | return err; | |
20398 | } | |
20399 | } | |
20400 | result = re_node_set_insert (&union_set, next_node); | |
20401 | if (__builtin_expect (result < 0, 0)) | |
20402 | { | |
20403 | free ((&union_set)->elems); | |
20404 | return REG_ESPACE; | |
20405 | } | |
20406 | mctx->state_log[next_idx] = re_acquire_state (&err, dfa, | |
20407 | &union_set); | |
20408 | if (__builtin_expect (mctx->state_log[next_idx] == ((void *)0) && err != REG_NOERROR, 0)) | |
20409 | ||
20410 | { | |
20411 | free ((&union_set)->elems); | |
20412 | return err; | |
20413 | } | |
20414 | } | |
20415 | } | |
20416 | ||
20417 | if (naccepted | |
20418 | || check_node_accept (mctx, dfa->nodes + cur_node, str_idx)) | |
20419 | { | |
20420 | result = re_node_set_insert (next_nodes, dfa->nexts[cur_node]); | |
20421 | if (__builtin_expect (result < 0, 0)) | |
20422 | { | |
20423 | free ((&union_set)->elems); | |
20424 | return REG_ESPACE; | |
20425 | } | |
20426 | } | |
20427 | } | |
20428 | free ((&union_set)->elems); | |
20429 | return REG_NOERROR; | |
20430 | } | |
20431 | ||
20432 | ||
20433 | ||
20434 | ||
20435 | ||
20436 | ||
20437 | ||
20438 | static reg_errcode_t | |
20439 | ||
20440 | check_arrival_expand_ecl (const re_dfa_t *dfa, re_node_set *cur_nodes, | |
20441 | int ex_subexp, int type) | |
20442 | { | |
20443 | reg_errcode_t err; | |
20444 | int idx, outside_node; | |
20445 | re_node_set new_nodes; | |
20446 | ||
20447 | ||
20448 | ||
20449 | err = re_node_set_alloc (&new_nodes, cur_nodes->nelem); | |
20450 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20451 | return err; | |
20452 | ||
20453 | ||
20454 | ||
20455 | for (idx = 0; idx < cur_nodes->nelem; ++idx) | |
20456 | { | |
20457 | int cur_node = cur_nodes->elems[idx]; | |
20458 | const re_node_set *eclosure = dfa->eclosures + cur_node; | |
20459 | outside_node = find_subexp_node (dfa, eclosure, ex_subexp, type); | |
20460 | if (outside_node == -1) | |
20461 | { | |
20462 | ||
20463 | err = re_node_set_merge (&new_nodes, eclosure); | |
20464 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20465 | { | |
20466 | free ((&new_nodes)->elems); | |
20467 | return err; | |
20468 | } | |
20469 | } | |
20470 | else | |
20471 | { | |
20472 | ||
20473 | err = check_arrival_expand_ecl_sub (dfa, &new_nodes, cur_node, | |
20474 | ex_subexp, type); | |
20475 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20476 | { | |
20477 | free ((&new_nodes)->elems); | |
20478 | return err; | |
20479 | } | |
20480 | } | |
20481 | } | |
20482 | free ((cur_nodes)->elems); | |
20483 | *cur_nodes = new_nodes; | |
20484 | return REG_NOERROR; | |
20485 | } | |
20486 | ||
20487 | ||
20488 | ||
20489 | ||
20490 | ||
20491 | static reg_errcode_t | |
20492 | ||
20493 | check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes, | |
20494 | int target, int ex_subexp, int type) | |
20495 | { | |
20496 | int cur_node; | |
20497 | for (cur_node = target; !re_node_set_contains (dst_nodes, cur_node);) | |
20498 | { | |
20499 | int err; | |
20500 | ||
20501 | if (dfa->nodes[cur_node].type == type | |
20502 | && dfa->nodes[cur_node].opr.idx == ex_subexp) | |
20503 | { | |
20504 | if (type == OP_CLOSE_SUBEXP) | |
20505 | { | |
20506 | err = re_node_set_insert (dst_nodes, cur_node); | |
20507 | if (__builtin_expect (err == -1, 0)) | |
20508 | return REG_ESPACE; | |
20509 | } | |
20510 | break; | |
20511 | } | |
20512 | err = re_node_set_insert (dst_nodes, cur_node); | |
20513 | if (__builtin_expect (err == -1, 0)) | |
20514 | return REG_ESPACE; | |
20515 | if (dfa->edests[cur_node].nelem == 0) | |
20516 | break; | |
20517 | if (dfa->edests[cur_node].nelem == 2) | |
20518 | { | |
20519 | err = check_arrival_expand_ecl_sub (dfa, dst_nodes, | |
20520 | dfa->edests[cur_node].elems[1], | |
20521 | ex_subexp, type); | |
20522 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20523 | return err; | |
20524 | } | |
20525 | cur_node = dfa->edests[cur_node].elems[0]; | |
20526 | } | |
20527 | return REG_NOERROR; | |
20528 | } | |
20529 | ||
20530 | ||
20531 | ||
20532 | ||
20533 | ||
20534 | ||
20535 | static reg_errcode_t | |
20536 | ||
20537 | expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes, | |
20538 | int cur_str, int subexp_num, int type) | |
20539 | { | |
20540 | const re_dfa_t *const dfa = mctx->dfa; | |
20541 | reg_errcode_t err; | |
20542 | int cache_idx_start = search_cur_bkref_entry (mctx, cur_str); | |
20543 | struct re_backref_cache_entry *ent; | |
20544 | ||
20545 | if (cache_idx_start == -1) | |
20546 | return REG_NOERROR; | |
20547 | ||
20548 | restart: | |
20549 | ent = mctx->bkref_ents + cache_idx_start; | |
20550 | do | |
20551 | { | |
20552 | int to_idx, next_node; | |
20553 | ||
20554 | ||
20555 | if (!re_node_set_contains (cur_nodes, ent->node)) | |
20556 | continue; | |
20557 | ||
20558 | to_idx = cur_str + ent->subexp_to - ent->subexp_from; | |
20559 | ||
20560 | ||
20561 | if (to_idx == cur_str) | |
20562 | { | |
20563 | ||
20564 | ||
20565 | re_node_set new_dests; | |
20566 | reg_errcode_t err2, err3; | |
20567 | next_node = dfa->edests[ent->node].elems[0]; | |
20568 | if (re_node_set_contains (cur_nodes, next_node)) | |
20569 | continue; | |
20570 | err = re_node_set_init_1 (&new_dests, next_node); | |
20571 | err2 = check_arrival_expand_ecl (dfa, &new_dests, subexp_num, type); | |
20572 | err3 = re_node_set_merge (cur_nodes, &new_dests); | |
20573 | free ((&new_dests)->elems); | |
20574 | if (__builtin_expect (err != REG_NOERROR || err2 != REG_NOERROR || err3 != REG_NOERROR, 0)) | |
20575 | ||
20576 | { | |
20577 | err = (err != REG_NOERROR ? err | |
20578 | : (err2 != REG_NOERROR ? err2 : err3)); | |
20579 | return err; | |
20580 | } | |
20581 | ||
20582 | goto restart; | |
20583 | } | |
20584 | else | |
20585 | { | |
20586 | re_node_set union_set; | |
20587 | next_node = dfa->nexts[ent->node]; | |
20588 | if (mctx->state_log[to_idx]) | |
20589 | { | |
20590 | int ret; | |
20591 | if (re_node_set_contains (&mctx->state_log[to_idx]->nodes, | |
20592 | next_node)) | |
20593 | continue; | |
20594 | err = re_node_set_init_copy (&union_set, | |
20595 | &mctx->state_log[to_idx]->nodes); | |
20596 | ret = re_node_set_insert (&union_set, next_node); | |
20597 | if (__builtin_expect (err != REG_NOERROR || ret < 0, 0)) | |
20598 | { | |
20599 | free ((&union_set)->elems); | |
20600 | err = err != REG_NOERROR ? err : REG_ESPACE; | |
20601 | return err; | |
20602 | } | |
20603 | } | |
20604 | else | |
20605 | { | |
20606 | err = re_node_set_init_1 (&union_set, next_node); | |
20607 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20608 | return err; | |
20609 | } | |
20610 | mctx->state_log[to_idx] = re_acquire_state (&err, dfa, &union_set); | |
20611 | free ((&union_set)->elems); | |
20612 | if (__builtin_expect (mctx->state_log[to_idx] == ((void *)0) && err != REG_NOERROR, 0)) | |
20613 | ||
20614 | return err; | |
20615 | } | |
20616 | } | |
20617 | while (ent++->more); | |
20618 | return REG_NOERROR; | |
20619 | } | |
20620 | ||
20621 | ||
20622 | ||
20623 | ||
20624 | static int | |
20625 | ||
20626 | build_trtable (const re_dfa_t *dfa, re_dfastate_t *state) | |
20627 | { | |
20628 | reg_errcode_t err; | |
20629 | int i, j, ch, need_word_trtable = 0; | |
20630 | bitset_word_t elem, mask; | |
20631 | _Bool dests_node_malloced = 0; | |
20632 | _Bool dest_states_malloced = 0; | |
20633 | int ndests; | |
20634 | re_dfastate_t **trtable; | |
20635 | re_dfastate_t **dest_states = ((void *)0), **dest_states_word, **dest_states_nl; | |
20636 | re_node_set follows, *dests_node; | |
20637 | bitset_t *dests_ch; | |
20638 | bitset_t acceptable; | |
20639 | ||
20640 | struct dests_alloc | |
20641 | { | |
20642 | re_node_set dests_node[256]; | |
20643 | bitset_t dests_ch[256]; | |
20644 | } *dests_alloc; | |
20645 | ||
20646 | ||
20647 | ||
20648 | ||
20649 | ||
20650 | if (__libc_use_alloca (sizeof (struct dests_alloc))) | |
20651 | dests_alloc = (struct dests_alloc *) __builtin_alloca (sizeof (struct dests_alloc)); | |
20652 | else | |
20653 | { | |
20654 | dests_alloc = ((struct dests_alloc *) malloc ((1) * sizeof (struct dests_alloc))); | |
20655 | if (__builtin_expect (dests_alloc == ((void *)0), 0)) | |
20656 | return 0; | |
20657 | dests_node_malloced = 1; | |
20658 | } | |
20659 | dests_node = dests_alloc->dests_node; | |
20660 | dests_ch = dests_alloc->dests_ch; | |
20661 | ||
20662 | ||
20663 | state->word_trtable = state->trtable = ((void *)0); | |
20664 | ||
20665 | ||
20666 | ||
20667 | ndests = group_nodes_into_DFAstates (dfa, state, dests_node, dests_ch); | |
20668 | if (__builtin_expect (ndests <= 0, 0)) | |
20669 | { | |
20670 | if (dests_node_malloced) | |
20671 | free (dests_alloc); | |
20672 | ||
20673 | if (ndests == 0) | |
20674 | { | |
20675 | state->trtable = (re_dfastate_t **) | |
20676 | calloc (sizeof (re_dfastate_t *), 256); | |
20677 | return 1; | |
20678 | } | |
20679 | return 0; | |
20680 | } | |
20681 | ||
20682 | err = re_node_set_alloc (&follows, ndests + 1); | |
20683 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20684 | goto out_free; | |
20685 | ||
20686 | if (__libc_use_alloca ((sizeof (re_node_set) + sizeof (bitset_t)) * 256 | |
20687 | + ndests * 3 * sizeof (re_dfastate_t *))) | |
20688 | dest_states = (re_dfastate_t **) | |
20689 | __builtin_alloca (ndests * 3 * sizeof (re_dfastate_t *)); | |
20690 | else | |
20691 | { | |
20692 | dest_states = (re_dfastate_t **) | |
20693 | malloc (ndests * 3 * sizeof (re_dfastate_t *)); | |
20694 | if (__builtin_expect (dest_states == ((void *)0), 0)) | |
20695 | { | |
20696 | out_free: | |
20697 | if (dest_states_malloced) | |
20698 | free (dest_states); | |
20699 | free ((&follows)->elems); | |
20700 | for (i = 0; i < ndests; ++i) | |
20701 | free ((dests_node + i)->elems); | |
20702 | if (dests_node_malloced) | |
20703 | free (dests_alloc); | |
20704 | return 0; | |
20705 | } | |
20706 | dest_states_malloced = 1; | |
20707 | } | |
20708 | dest_states_word = dest_states + ndests; | |
20709 | dest_states_nl = dest_states_word + ndests; | |
20710 | memset (acceptable, '\0', sizeof (bitset_t)); | |
20711 | ||
20712 | ||
20713 | for (i = 0; i < ndests; ++i) | |
20714 | { | |
20715 | int next_node; | |
20716 | ((&follows)->nelem = 0); | |
20717 | ||
20718 | for (j = 0; j < dests_node[i].nelem; ++j) | |
20719 | { | |
20720 | next_node = dfa->nexts[dests_node[i].elems[j]]; | |
20721 | if (next_node != -1) | |
20722 | { | |
20723 | err = re_node_set_merge (&follows, dfa->eclosures + next_node); | |
20724 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
20725 | goto out_free; | |
20726 | } | |
20727 | } | |
20728 | dest_states[i] = re_acquire_state_context (&err, dfa, &follows, 0); | |
20729 | if (__builtin_expect (dest_states[i] == ((void *)0) && err != REG_NOERROR, 0)) | |
20730 | goto out_free; | |
20731 | ||
20732 | ||
20733 | if (dest_states[i]->has_constraint) | |
20734 | { | |
20735 | dest_states_word[i] = re_acquire_state_context (&err, dfa, &follows, | |
20736 | 1); | |
20737 | if (__builtin_expect (dest_states_word[i] == ((void *)0) && err != REG_NOERROR, 0)) | |
20738 | goto out_free; | |
20739 | ||
20740 | if (dest_states[i] != dest_states_word[i] && dfa->mb_cur_max > 1) | |
20741 | need_word_trtable = 1; | |
20742 | ||
20743 | dest_states_nl[i] = re_acquire_state_context (&err, dfa, &follows, | |
20744 | (1 << 1)); | |
20745 | if (__builtin_expect (dest_states_nl[i] == ((void *)0) && err != REG_NOERROR, 0)) | |
20746 | goto out_free; | |
20747 | } | |
20748 | else | |
20749 | { | |
20750 | dest_states_word[i] = dest_states[i]; | |
20751 | dest_states_nl[i] = dest_states[i]; | |
20752 | } | |
20753 | bitset_merge (acceptable, dests_ch[i]); | |
20754 | } | |
20755 | ||
20756 | if (!__builtin_expect (need_word_trtable, 0)) | |
20757 | { | |
20758 | ||
20759 | ||
20760 | ||
20761 | ||
20762 | trtable = state->trtable = | |
20763 | (re_dfastate_t **) calloc (sizeof (re_dfastate_t *), 256); | |
20764 | if (__builtin_expect (trtable == ((void *)0), 0)) | |
20765 | goto out_free; | |
20766 | ||
20767 | ||
20768 | for (i = 0; i < (256 / (sizeof (bitset_word_t) * 8)); ++i) | |
20769 | for (ch = i * (sizeof (bitset_word_t) * 8), elem = acceptable[i], mask = 1; | |
20770 | elem; | |
20771 | mask <<= 1, elem >>= 1, ++ch) | |
20772 | if (__builtin_expect (elem & 1, 0)) | |
20773 | { | |
20774 | ||
20775 | ||
20776 | for (j = 0; (dests_ch[j][i] & mask) == 0; ++j) | |
20777 | ; | |
20778 | ||
20779 | ||
20780 | if (dfa->word_char[i] & mask) | |
20781 | trtable[ch] = dest_states_word[j]; | |
20782 | else | |
20783 | trtable[ch] = dest_states[j]; | |
20784 | } | |
20785 | } | |
20786 | else | |
20787 | { | |
20788 | ||
20789 | ||
20790 | ||
20791 | ||
20792 | ||
20793 | trtable = state->word_trtable = | |
20794 | (re_dfastate_t **) calloc (sizeof (re_dfastate_t *), 2 * 256); | |
20795 | if (__builtin_expect (trtable == ((void *)0), 0)) | |
20796 | goto out_free; | |
20797 | ||
20798 | ||
20799 | for (i = 0; i < (256 / (sizeof (bitset_word_t) * 8)); ++i) | |
20800 | for (ch = i * (sizeof (bitset_word_t) * 8), elem = acceptable[i], mask = 1; | |
20801 | elem; | |
20802 | mask <<= 1, elem >>= 1, ++ch) | |
20803 | if (__builtin_expect (elem & 1, 0)) | |
20804 | { | |
20805 | ||
20806 | ||
20807 | for (j = 0; (dests_ch[j][i] & mask) == 0; ++j) | |
20808 | ; | |
20809 | ||
20810 | ||
20811 | trtable[ch] = dest_states[j]; | |
20812 | trtable[ch + 256] = dest_states_word[j]; | |
20813 | } | |
20814 | } | |
20815 | ||
20816 | ||
20817 | if ((acceptable['\n' / (sizeof (bitset_word_t) * 8)] & ((bitset_word_t) 1 << '\n' % (sizeof (bitset_word_t) * 8)))) | |
20818 | { | |
20819 | ||
20820 | for (j = 0; j < ndests; ++j) | |
20821 | if ((dests_ch[j]['\n' / (sizeof (bitset_word_t) * 8)] & ((bitset_word_t) 1 << '\n' % (sizeof (bitset_word_t) * 8)))) | |
20822 | { | |
20823 | ||
20824 | trtable['\n'] = dest_states_nl[j]; | |
20825 | if (need_word_trtable) | |
20826 | trtable['\n' + 256] = dest_states_nl[j]; | |
20827 | ||
20828 | ||
20829 | break; | |
20830 | } | |
20831 | } | |
20832 | ||
20833 | if (dest_states_malloced) | |
20834 | free (dest_states); | |
20835 | ||
20836 | free ((&follows)->elems); | |
20837 | for (i = 0; i < ndests; ++i) | |
20838 | free ((dests_node + i)->elems); | |
20839 | ||
20840 | if (dests_node_malloced) | |
20841 | free (dests_alloc); | |
20842 | ||
20843 | return 1; | |
20844 | } | |
20845 | ||
20846 | ||
20847 | ||
20848 | ||
20849 | ||
20850 | ||
20851 | static int | |
20852 | ||
20853 | group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state, | |
20854 | re_node_set *dests_node, bitset_t *dests_ch) | |
20855 | { | |
20856 | reg_errcode_t err; | |
20857 | int result; | |
20858 | int i, j, k; | |
20859 | int ndests; | |
20860 | bitset_t accepts; | |
20861 | const re_node_set *cur_nodes = &state->nodes; | |
20862 | memset (accepts, '\0', sizeof (bitset_t)); | |
20863 | ndests = 0; | |
20864 | ||
20865 | ||
20866 | for (i = 0; i < cur_nodes->nelem; ++i) | |
20867 | { | |
20868 | re_token_t *node = &dfa->nodes[cur_nodes->elems[i]]; | |
20869 | re_token_type_t type = node->type; | |
20870 | unsigned int constraint = node->constraint; | |
20871 | ||
20872 | ||
20873 | if (type == CHARACTER) | |
20874 | (accepts[node->opr.c / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << node->opr.c % (sizeof (bitset_word_t) * 8)); | |
20875 | else if (type == SIMPLE_BRACKET) | |
20876 | { | |
20877 | bitset_merge (accepts, node->opr.sbcset); | |
20878 | } | |
20879 | else if (type == OP_PERIOD) | |
20880 | { | |
20881 | ||
20882 | if (dfa->mb_cur_max > 1) | |
20883 | bitset_merge (accepts, dfa->sb_char); | |
20884 | else | |
20885 | ||
20886 | memset (accepts, '\xff', sizeof (bitset_t)); | |
20887 | if (!(dfa->syntax & ((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
20888 | (accepts['\n' / (sizeof (bitset_word_t) * 8)] &= ~((bitset_word_t) 1 << '\n' % (sizeof (bitset_word_t) * 8))); | |
20889 | if (dfa->syntax & (((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | |
20890 | (accepts['\0' / (sizeof (bitset_word_t) * 8)] &= ~((bitset_word_t) 1 << '\0' % (sizeof (bitset_word_t) * 8))); | |
20891 | } | |
20892 | ||
20893 | else if (type == OP_UTF8_PERIOD) | |
20894 | { | |
20895 | memset (accepts, '\xff', sizeof (bitset_t) / 2); | |
20896 | if (!(dfa->syntax & ((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
20897 | (accepts['\n' / (sizeof (bitset_word_t) * 8)] &= ~((bitset_word_t) 1 << '\n' % (sizeof (bitset_word_t) * 8))); | |
20898 | if (dfa->syntax & (((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) | |
20899 | (accepts['\0' / (sizeof (bitset_word_t) * 8)] &= ~((bitset_word_t) 1 << '\0' % (sizeof (bitset_word_t) * 8))); | |
20900 | } | |
20901 | ||
20902 | else | |
20903 | continue; | |
20904 | ||
20905 | ||
20906 | ||
20907 | if (constraint) | |
20908 | { | |
20909 | if (constraint & 0x0020) | |
20910 | { | |
20911 | _Bool accepts_newline = (accepts['\n' / (sizeof (bitset_word_t) * 8)] & ((bitset_word_t) 1 << '\n' % (sizeof (bitset_word_t) * 8))); | |
20912 | memset (accepts, '\0', sizeof (bitset_t)); | |
20913 | if (accepts_newline) | |
20914 | (accepts['\n' / (sizeof (bitset_word_t) * 8)] |= (bitset_word_t) 1 << '\n' % (sizeof (bitset_word_t) * 8)); | |
20915 | else | |
20916 | continue; | |
20917 | } | |
20918 | if (constraint & 0x0080) | |
20919 | { | |
20920 | memset (accepts, '\0', sizeof (bitset_t)); | |
20921 | continue; | |
20922 | } | |
20923 | ||
20924 | if (constraint & 0x0004) | |
20925 | { | |
20926 | bitset_word_t any_set = 0; | |
20927 | if (type == CHARACTER && !node->word_char) | |
20928 | { | |
20929 | memset (accepts, '\0', sizeof (bitset_t)); | |
20930 | continue; | |
20931 | } | |
20932 | ||
20933 | if (dfa->mb_cur_max > 1) | |
20934 | for (j = 0; j < (256 / (sizeof (bitset_word_t) * 8)); ++j) | |
20935 | any_set |= (accepts[j] &= (dfa->word_char[j] | ~dfa->sb_char[j])); | |
20936 | else | |
20937 | ||
20938 | for (j = 0; j < (256 / (sizeof (bitset_word_t) * 8)); ++j) | |
20939 | any_set |= (accepts[j] &= dfa->word_char[j]); | |
20940 | if (!any_set) | |
20941 | continue; | |
20942 | } | |
20943 | if (constraint & 0x0008) | |
20944 | { | |
20945 | bitset_word_t any_set = 0; | |
20946 | if (type == CHARACTER && node->word_char) | |
20947 | { | |
20948 | memset (accepts, '\0', sizeof (bitset_t)); | |
20949 | continue; | |
20950 | } | |
20951 | ||
20952 | if (dfa->mb_cur_max > 1) | |
20953 | for (j = 0; j < (256 / (sizeof (bitset_word_t) * 8)); ++j) | |
20954 | any_set |= (accepts[j] &= ~(dfa->word_char[j] & dfa->sb_char[j])); | |
20955 | else | |
20956 | ||
20957 | for (j = 0; j < (256 / (sizeof (bitset_word_t) * 8)); ++j) | |
20958 | any_set |= (accepts[j] &= ~dfa->word_char[j]); | |
20959 | if (!any_set) | |
20960 | continue; | |
20961 | } | |
20962 | } | |
20963 | ||
20964 | ||
20965 | ||
20966 | for (j = 0; j < ndests; ++j) | |
20967 | { | |
20968 | bitset_t intersec; | |
20969 | bitset_t remains; | |
20970 | ||
20971 | bitset_word_t has_intersec, not_subset, not_consumed; | |
20972 | ||
20973 | ||
20974 | if (type == CHARACTER && !(dests_ch[j][node->opr.c / (sizeof (bitset_word_t) * 8)] & ((bitset_word_t) 1 << node->opr.c % (sizeof (bitset_word_t) * 8)))) | |
20975 | continue; | |
20976 | ||
20977 | ||
20978 | has_intersec = 0; | |
20979 | for (k = 0; k < (256 / (sizeof (bitset_word_t) * 8)); ++k) | |
20980 | has_intersec |= intersec[k] = accepts[k] & dests_ch[j][k]; | |
20981 | ||
20982 | if (!has_intersec) | |
20983 | continue; | |
20984 | ||
20985 | ||
20986 | not_subset = not_consumed = 0; | |
20987 | for (k = 0; k < (256 / (sizeof (bitset_word_t) * 8)); ++k) | |
20988 | { | |
20989 | not_subset |= remains[k] = ~accepts[k] & dests_ch[j][k]; | |
20990 | not_consumed |= accepts[k] = accepts[k] & ~dests_ch[j][k]; | |
20991 | } | |
20992 | ||
20993 | ||
20994 | ||
20995 | if (not_subset) | |
20996 | { | |
20997 | memcpy (dests_ch[ndests], remains, sizeof (bitset_t)); | |
20998 | memcpy (dests_ch[j], intersec, sizeof (bitset_t)); | |
20999 | err = re_node_set_init_copy (dests_node + ndests, &dests_node[j]); | |
21000 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
21001 | goto error_return; | |
21002 | ++ndests; | |
21003 | } | |
21004 | ||
21005 | ||
21006 | result = re_node_set_insert (&dests_node[j], cur_nodes->elems[i]); | |
21007 | if (__builtin_expect (result < 0, 0)) | |
21008 | goto error_return; | |
21009 | ||
21010 | ||
21011 | if (!not_consumed) | |
21012 | break; | |
21013 | } | |
21014 | ||
21015 | if (j == ndests) | |
21016 | { | |
21017 | memcpy (dests_ch[ndests], accepts, sizeof (bitset_t)); | |
21018 | err = re_node_set_init_1 (dests_node + ndests, cur_nodes->elems[i]); | |
21019 | if (__builtin_expect (err != REG_NOERROR, 0)) | |
21020 | goto error_return; | |
21021 | ++ndests; | |
21022 | memset (accepts, '\0', sizeof (bitset_t)); | |
21023 | } | |
21024 | } | |
21025 | return ndests; | |
21026 | error_return: | |
21027 | for (j = 0; j < ndests; ++j) | |
21028 | free ((dests_node + j)->elems); | |
21029 | return -1; | |
21030 | } | |
21031 | # 3709 "regexec.c" | |
21032 | static int | |
21033 | ||
21034 | check_node_accept_bytes (const re_dfa_t *dfa, int node_idx, | |
21035 | const re_string_t *input, int str_idx) | |
21036 | { | |
21037 | const re_token_t *node = dfa->nodes + node_idx; | |
21038 | int char_len, elem_len; | |
21039 | int i; | |
21040 | ||
21041 | if (__builtin_expect (node->type == OP_UTF8_PERIOD, 0)) | |
21042 | { | |
21043 | unsigned char c = ((input)->mbs[str_idx]), d; | |
21044 | if (__builtin_expect (c < 0xc2, 1)) | |
21045 | return 0; | |
21046 | ||
21047 | if (str_idx + 2 > input->len) | |
21048 | return 0; | |
21049 | ||
21050 | d = ((input)->mbs[str_idx + 1]); | |
21051 | if (c < 0xe0) | |
21052 | return (d < 0x80 || d > 0xbf) ? 0 : 2; | |
21053 | else if (c < 0xf0) | |
21054 | { | |
21055 | char_len = 3; | |
21056 | if (c == 0xe0 && d < 0xa0) | |
21057 | return 0; | |
21058 | } | |
21059 | else if (c < 0xf8) | |
21060 | { | |
21061 | char_len = 4; | |
21062 | if (c == 0xf0 && d < 0x90) | |
21063 | return 0; | |
21064 | } | |
21065 | else if (c < 0xfc) | |
21066 | { | |
21067 | char_len = 5; | |
21068 | if (c == 0xf8 && d < 0x88) | |
21069 | return 0; | |
21070 | } | |
21071 | else if (c < 0xfe) | |
21072 | { | |
21073 | char_len = 6; | |
21074 | if (c == 0xfc && d < 0x84) | |
21075 | return 0; | |
21076 | } | |
21077 | else | |
21078 | return 0; | |
21079 | ||
21080 | if (str_idx + char_len > input->len) | |
21081 | return 0; | |
21082 | ||
21083 | for (i = 1; i < char_len; ++i) | |
21084 | { | |
21085 | d = ((input)->mbs[str_idx + i]); | |
21086 | if (d < 0x80 || d > 0xbf) | |
21087 | return 0; | |
21088 | } | |
21089 | return char_len; | |
21090 | } | |
21091 | ||
21092 | char_len = re_string_char_size_at (input, str_idx); | |
21093 | if (node->type == OP_PERIOD) | |
21094 | { | |
21095 | if (char_len <= 1) | |
21096 | return 0; | |
21097 | ||
21098 | ||
21099 | ||
21100 | if ((!(dfa->syntax & ((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1)) && | |
21101 | ((input)->mbs[str_idx]) == '\n') || | |
21102 | ((dfa->syntax & (((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)) && | |
21103 | ((input)->mbs[str_idx]) == '\0')) | |
21104 | return 0; | |
21105 | return char_len; | |
21106 | } | |
21107 | ||
21108 | elem_len = re_string_elem_size_at (input, str_idx); | |
21109 | if ((elem_len <= 1 && char_len <= 1) || char_len == 0) | |
21110 | return 0; | |
21111 | ||
21112 | if (node->type == COMPLEX_BRACKET) | |
21113 | { | |
21114 | const re_charset_t *cset = node->opr.mbcset; | |
21115 | ||
21116 | const unsigned char *pin | |
21117 | = ((const unsigned char *) ((input)->mbs) + str_idx); | |
21118 | int j; | |
21119 | uint32_t nrules; | |
21120 | ||
21121 | int match_len = 0; | |
21122 | wchar_t wc = ((cset->nranges || cset->nchar_classes || cset->nmbchars) | |
21123 | ? re_string_wchar_at (input, str_idx) : 0); | |
21124 | ||
21125 | ||
21126 | for (i = 0; i < cset->nmbchars; ++i) | |
21127 | if (wc == cset->mbchars[i]) | |
21128 | { | |
21129 | match_len = char_len; | |
21130 | goto check_node_accept_bytes_match; | |
21131 | } | |
21132 | ||
21133 | for (i = 0; i < cset->nchar_classes; ++i) | |
21134 | { | |
21135 | wctype_t wt = cset->char_classes[i]; | |
21136 | if (__iswctype (wc, wt)) | |
21137 | { | |
21138 | match_len = char_len; | |
21139 | goto check_node_accept_bytes_match; | |
21140 | } | |
21141 | } | |
21142 | ||
21143 | ||
21144 | nrules = ((uint32_t) (*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_NRULES) & 0xffff)].word); | |
21145 | if (nrules != 0) | |
21146 | { | |
21147 | unsigned int in_collseq = 0; | |
21148 | const int32_t *table, *indirect; | |
21149 | const unsigned char *weights, *extra; | |
21150 | const char *collseqwc; | |
21151 | int32_t idx; | |
21152 | ||
21153 | # 1 "../locale/weight.h" 1 | |
21154 | # 21 "../locale/weight.h" | |
21155 | auto inline int32_t | |
21156 | __attribute__ ((always_inline)) | |
21157 | findidx (const unsigned char **cpp) | |
21158 | { | |
21159 | int_fast32_t i = table[*(*cpp)++]; | |
21160 | const unsigned char *cp; | |
21161 | const unsigned char *usrc; | |
21162 | ||
21163 | if (i >= 0) | |
21164 | ||
21165 | return i; | |
21166 | ||
21167 | ||
21168 | ||
21169 | cp = &extra[-i]; | |
21170 | usrc = *cpp; | |
21171 | while (1) | |
21172 | { | |
21173 | size_t nhere; | |
21174 | ||
21175 | ||
21176 | i = *((const int32_t *) cp); | |
21177 | cp += sizeof (int32_t); | |
21178 | ||
21179 | ||
21180 | ||
21181 | ||
21182 | nhere = *cp++; | |
21183 | ||
21184 | if (i >= 0) | |
21185 | { | |
21186 | ||
21187 | ||
21188 | ||
21189 | ||
21190 | ||
21191 | size_t cnt; | |
21192 | ||
21193 | for (cnt = 0; cnt < nhere; ++cnt) | |
21194 | if (cp[cnt] != usrc[cnt]) | |
21195 | break; | |
21196 | ||
21197 | if (cnt == nhere) | |
21198 | { | |
21199 | ||
21200 | *cpp += nhere; | |
21201 | return i; | |
21202 | } | |
21203 | ||
21204 | ||
21205 | cp += nhere; | |
21206 | if ((1 + nhere) % __alignof__ (int32_t) != 0) | |
21207 | cp += __alignof__ (int32_t) - (1 + nhere) % __alignof__ (int32_t); | |
21208 | } | |
21209 | else | |
21210 | { | |
21211 | ||
21212 | ||
21213 | size_t cnt; | |
21214 | size_t offset = 0; | |
21215 | ||
21216 | for (cnt = 0; cnt < nhere; ++cnt) | |
21217 | if (cp[cnt] != usrc[cnt]) | |
21218 | break; | |
21219 | ||
21220 | if (cnt != nhere) | |
21221 | { | |
21222 | if (cp[cnt] > usrc[cnt]) | |
21223 | { | |
21224 | ||
21225 | cp += 2 * nhere; | |
21226 | if ((1 + 2 * nhere) % __alignof__ (int32_t) != 0) | |
21227 | cp += (__alignof__ (int32_t) | |
21228 | - (1 + 2 * nhere) % __alignof__ (int32_t)); | |
21229 | continue; | |
21230 | } | |
21231 | ||
21232 | ||
21233 | for (cnt = 0; cnt < nhere; ++cnt) | |
21234 | if (cp[nhere + cnt] != usrc[cnt]) | |
21235 | break; | |
21236 | ||
21237 | if (cnt != nhere && cp[nhere + cnt] < usrc[cnt]) | |
21238 | { | |
21239 | ||
21240 | cp += 2 * nhere; | |
21241 | if ((1 + 2 * nhere) % __alignof__ (int32_t) != 0) | |
21242 | cp += (__alignof__ (int32_t) | |
21243 | - (1 + 2 * nhere) % __alignof__ (int32_t)); | |
21244 | continue; | |
21245 | } | |
21246 | ||
21247 | ||
21248 | ||
21249 | for (cnt = 0; cp[cnt] == usrc[cnt]; ++cnt); | |
21250 | ||
21251 | do | |
21252 | { | |
21253 | offset <<= 8; | |
21254 | offset += usrc[cnt] - cp[cnt]; | |
21255 | } | |
21256 | while (++cnt < nhere); | |
21257 | } | |
21258 | ||
21259 | *cpp += nhere; | |
21260 | return indirect[-i + offset]; | |
21261 | } | |
21262 | } | |
21263 | ||
21264 | ||
21265 | return 0x43219876; | |
21266 | } | |
21267 | # 3831 "regexec.c" 2 | |
21268 | ||
21269 | ||
21270 | if (cset->ncoll_syms) | |
21271 | extra = (const unsigned char *) | |
21272 | ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_SYMB_EXTRAMB) & 0xffff)].string); | |
21273 | for (i = 0; i < cset->ncoll_syms; ++i) | |
21274 | { | |
21275 | const unsigned char *coll_sym = extra + cset->coll_syms[i]; | |
21276 | ||
21277 | ||
21278 | if (*coll_sym != elem_len) | |
21279 | continue; | |
21280 | ||
21281 | for (j = 0; j < *coll_sym; j++) | |
21282 | if (pin[j] != coll_sym[1 + j]) | |
21283 | break; | |
21284 | if (j == *coll_sym) | |
21285 | { | |
21286 | ||
21287 | match_len = j; | |
21288 | goto check_node_accept_bytes_match; | |
21289 | } | |
21290 | } | |
21291 | ||
21292 | if (cset->nranges) | |
21293 | { | |
21294 | if (elem_len <= char_len) | |
21295 | { | |
21296 | collseqwc = ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_COLLSEQWC) & 0xffff)].string); | |
21297 | in_collseq = __collseq_table_lookup (collseqwc, wc); | |
21298 | } | |
21299 | else | |
21300 | in_collseq = find_collation_sequence_value (pin, elem_len); | |
21301 | } | |
21302 | ||
21303 | for (i = 0; i < cset->nranges; ++i) | |
21304 | if (cset->range_starts[i] <= in_collseq | |
21305 | && in_collseq <= cset->range_ends[i]) | |
21306 | { | |
21307 | match_len = elem_len; | |
21308 | goto check_node_accept_bytes_match; | |
21309 | } | |
21310 | ||
21311 | ||
21312 | if (cset->nequiv_classes) | |
21313 | { | |
21314 | const unsigned char *cp = pin; | |
21315 | table = (const int32_t *) | |
21316 | ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_TABLEMB) & 0xffff)].string); | |
21317 | weights = (const unsigned char *) | |
21318 | ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_WEIGHTMB) & 0xffff)].string); | |
21319 | extra = (const unsigned char *) | |
21320 | ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_EXTRAMB) & 0xffff)].string); | |
21321 | indirect = (const int32_t *) | |
21322 | ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_INDIRECTMB) & 0xffff)].string); | |
21323 | idx = findidx (&cp); | |
21324 | if (idx > 0) | |
21325 | for (i = 0; i < cset->nequiv_classes; ++i) | |
21326 | { | |
21327 | int32_t equiv_class_idx = cset->equiv_classes[i]; | |
21328 | size_t weight_len = weights[idx]; | |
21329 | if (weight_len == weights[equiv_class_idx]) | |
21330 | { | |
21331 | int cnt = 0; | |
21332 | while (cnt <= weight_len | |
21333 | && (weights[equiv_class_idx + 1 + cnt] | |
21334 | == weights[idx + 1 + cnt])) | |
21335 | ++cnt; | |
21336 | if (cnt > weight_len) | |
21337 | { | |
21338 | match_len = elem_len; | |
21339 | goto check_node_accept_bytes_match; | |
21340 | } | |
21341 | } | |
21342 | } | |
21343 | } | |
21344 | } | |
21345 | else | |
21346 | ||
21347 | { | |
21348 | ||
21349 | ||
21350 | wchar_t cmp_buf[] = {L'\0', L'\0', wc, L'\0', L'\0', L'\0'}; | |
21351 | ||
21352 | ||
21353 | ||
21354 | ||
21355 | for (i = 0; i < cset->nranges; ++i) | |
21356 | { | |
21357 | cmp_buf[0] = cset->range_starts[i]; | |
21358 | cmp_buf[4] = cset->range_ends[i]; | |
21359 | if (wcscoll (cmp_buf, cmp_buf + 2) <= 0 | |
21360 | && wcscoll (cmp_buf + 2, cmp_buf + 4) <= 0) | |
21361 | { | |
21362 | match_len = char_len; | |
21363 | goto check_node_accept_bytes_match; | |
21364 | } | |
21365 | } | |
21366 | } | |
21367 | check_node_accept_bytes_match: | |
21368 | if (!cset->non_match) | |
21369 | return match_len; | |
21370 | else | |
21371 | { | |
21372 | if (match_len > 0) | |
21373 | return 0; | |
21374 | else | |
21375 | return (elem_len > char_len) ? elem_len : char_len; | |
21376 | } | |
21377 | } | |
21378 | return 0; | |
21379 | } | |
21380 | ||
21381 | ||
21382 | static unsigned int | |
21383 | ||
21384 | find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len) | |
21385 | { | |
21386 | uint32_t nrules = ((uint32_t) (*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_NRULES) & 0xffff)].word); | |
21387 | if (nrules == 0) | |
21388 | { | |
21389 | if (mbs_len == 1) | |
21390 | { | |
21391 | ||
21392 | const unsigned char *collseq = (const unsigned char *) | |
21393 | ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_COLLSEQMB) & 0xffff)].string); | |
21394 | return collseq[mbs[0]]; | |
21395 | } | |
21396 | return (2147483647 * 2U + 1U); | |
21397 | } | |
21398 | else | |
21399 | { | |
21400 | int32_t idx; | |
21401 | const unsigned char *extra = (const unsigned char *) | |
21402 | ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_SYMB_EXTRAMB) & 0xffff)].string); | |
21403 | int32_t extrasize = (const unsigned char *) | |
21404 | ((*_nl_current_LC_COLLATE)->values[((int) (_NL_COLLATE_SYMB_EXTRAMB + 1) & 0xffff)].string) - extra; | |
21405 | ||
21406 | for (idx = 0; idx < extrasize;) | |
21407 | { | |
21408 | int mbs_cnt, found = 0; | |
21409 | int32_t elem_mbs_len; | |
21410 | ||
21411 | idx = idx + extra[idx] + 1; | |
21412 | elem_mbs_len = extra[idx++]; | |
21413 | if (mbs_len == elem_mbs_len) | |
21414 | { | |
21415 | for (mbs_cnt = 0; mbs_cnt < elem_mbs_len; ++mbs_cnt) | |
21416 | if (extra[idx + mbs_cnt] != mbs[mbs_cnt]) | |
21417 | break; | |
21418 | if (mbs_cnt == elem_mbs_len) | |
21419 | ||
21420 | found = 1; | |
21421 | } | |
21422 | ||
21423 | idx += elem_mbs_len; | |
21424 | ||
21425 | idx = (idx + 3) & ~3; | |
21426 | ||
21427 | idx += sizeof (uint32_t); | |
21428 | ||
21429 | idx = idx + sizeof (uint32_t) * (extra[idx] + 1); | |
21430 | ||
21431 | if (found) | |
21432 | return *(uint32_t *) (extra + idx); | |
21433 | ||
21434 | idx += sizeof (uint32_t); | |
21435 | } | |
21436 | return (2147483647 * 2U + 1U); | |
21437 | } | |
21438 | } | |
21439 | ||
21440 | ||
21441 | ||
21442 | ||
21443 | ||
21444 | ||
21445 | static int | |
21446 | ||
21447 | check_node_accept (const re_match_context_t *mctx, const re_token_t *node, | |
21448 | int idx) | |
21449 | { | |
21450 | unsigned char ch; | |
21451 | ch = ((&mctx->input)->mbs[idx]); | |
21452 | switch (node->type) | |
21453 | { | |
21454 | case CHARACTER: | |
21455 | if (node->opr.c != ch) | |
21456 | return 0; | |
21457 | break; | |
21458 | ||
21459 | case SIMPLE_BRACKET: | |
21460 | if (!(node->opr.sbcset[ch / (sizeof (bitset_word_t) * 8)] & ((bitset_word_t) 1 << ch % (sizeof (bitset_word_t) * 8)))) | |
21461 | return 0; | |
21462 | break; | |
21463 | ||
21464 | ||
21465 | case OP_UTF8_PERIOD: | |
21466 | if (ch >= 0x80) | |
21467 | return 0; | |
21468 | ||
21469 | ||
21470 | case OP_PERIOD: | |
21471 | if ((ch == '\n' && !(mctx->dfa->syntax & ((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1))) | |
21472 | || (ch == '\0' && (mctx->dfa->syntax & (((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1)))) | |
21473 | return 0; | |
21474 | break; | |
21475 | ||
21476 | default: | |
21477 | return 0; | |
21478 | } | |
21479 | ||
21480 | if (node->constraint) | |
21481 | { | |
21482 | ||
21483 | ||
21484 | unsigned int context = re_string_context_at (&mctx->input, idx, | |
21485 | mctx->eflags); | |
21486 | if (((((node->constraint) & 0x0004) && !((context) & 1)) || (((node->constraint) & 0x0008) && ((context) & 1)) || (((node->constraint) & 0x0020) && !((context) & (1 << 1))) || (((node->constraint) & 0x0080) && !((context) & (((1 << 1) << 1) << 1))))) | |
21487 | return 0; | |
21488 | } | |
21489 | ||
21490 | return 1; | |
21491 | } | |
21492 | ||
21493 | ||
21494 | ||
21495 | static reg_errcode_t | |
21496 | ||
21497 | extend_buffers (re_match_context_t *mctx) | |
21498 | { | |
21499 | reg_errcode_t ret; | |
21500 | re_string_t *pstr = &mctx->input; | |
21501 | ||
21502 | ||
21503 | ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2); | |
21504 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
21505 | return ret; | |
21506 | ||
21507 | if (mctx->state_log != ((void *)0)) | |
21508 | { | |
21509 | ||
21510 | ||
21511 | ||
21512 | ||
21513 | re_dfastate_t **new_array = ((re_dfastate_t * *) realloc (mctx->state_log, (pstr->bufs_len + 1) * sizeof (re_dfastate_t *))); | |
21514 | ||
21515 | if (__builtin_expect (new_array == ((void *)0), 0)) | |
21516 | return REG_ESPACE; | |
21517 | mctx->state_log = new_array; | |
21518 | } | |
21519 | ||
21520 | ||
21521 | if (pstr->icase) | |
21522 | { | |
21523 | ||
21524 | if (pstr->mb_cur_max > 1) | |
21525 | { | |
21526 | ret = build_wcs_upper_buffer (pstr); | |
21527 | if (__builtin_expect (ret != REG_NOERROR, 0)) | |
21528 | return ret; | |
21529 | } | |
21530 | else | |
21531 | ||
21532 | build_upper_buffer (pstr); | |
21533 | } | |
21534 | else | |
21535 | { | |
21536 | ||
21537 | if (pstr->mb_cur_max > 1) | |
21538 | build_wcs_buffer (pstr); | |
21539 | else | |
21540 | ||
21541 | { | |
21542 | if (pstr->trans != ((void *)0)) | |
21543 | re_string_translate_buffer (pstr); | |
21544 | } | |
21545 | } | |
21546 | return REG_NOERROR; | |
21547 | } | |
21548 | ||
21549 | ||
21550 | ||
21551 | ||
21552 | ||
21553 | ||
21554 | static reg_errcode_t | |
21555 | ||
21556 | match_ctx_init (re_match_context_t *mctx, int eflags, int n) | |
21557 | { | |
21558 | mctx->eflags = eflags; | |
21559 | mctx->match_last = -1; | |
21560 | if (n > 0) | |
21561 | { | |
21562 | mctx->bkref_ents = ((struct re_backref_cache_entry *) malloc ((n) * sizeof (struct re_backref_cache_entry))); | |
21563 | mctx->sub_tops = ((re_sub_match_top_t * *) malloc ((n) * sizeof (re_sub_match_top_t *))); | |
21564 | if (__builtin_expect (mctx->bkref_ents == ((void *)0) || mctx->sub_tops == ((void *)0), 0)) | |
21565 | return REG_ESPACE; | |
21566 | } | |
21567 | ||
21568 | ||
21569 | ||
21570 | ||
21571 | ||
21572 | mctx->abkref_ents = n; | |
21573 | mctx->max_mb_elem_len = 1; | |
21574 | mctx->asub_tops = n; | |
21575 | return REG_NOERROR; | |
21576 | } | |
21577 | ||
21578 | ||
21579 | ||
21580 | ||
21581 | ||
21582 | static void | |
21583 | ||
21584 | match_ctx_clean (re_match_context_t *mctx) | |
21585 | { | |
21586 | int st_idx; | |
21587 | for (st_idx = 0; st_idx < mctx->nsub_tops; ++st_idx) | |
21588 | { | |
21589 | int sl_idx; | |
21590 | re_sub_match_top_t *top = mctx->sub_tops[st_idx]; | |
21591 | for (sl_idx = 0; sl_idx < top->nlasts; ++sl_idx) | |
21592 | { | |
21593 | re_sub_match_last_t *last = top->lasts[sl_idx]; | |
21594 | free (last->path.array); | |
21595 | free (last); | |
21596 | } | |
21597 | free (top->lasts); | |
21598 | if (top->path) | |
21599 | { | |
21600 | free (top->path->array); | |
21601 | free (top->path); | |
21602 | } | |
21603 | free (top); | |
21604 | } | |
21605 | ||
21606 | mctx->nsub_tops = 0; | |
21607 | mctx->nbkref_ents = 0; | |
21608 | } | |
21609 | ||
21610 | ||
21611 | ||
21612 | static void | |
21613 | ||
21614 | match_ctx_free (re_match_context_t *mctx) | |
21615 | { | |
21616 | ||
21617 | match_ctx_clean (mctx); | |
21618 | free (mctx->sub_tops); | |
21619 | free (mctx->bkref_ents); | |
21620 | } | |
21621 | ||
21622 | ||
21623 | ||
21624 | ||
21625 | ||
21626 | ||
21627 | static reg_errcode_t | |
21628 | ||
21629 | match_ctx_add_entry (re_match_context_t *mctx, int node, int str_idx, int from, | |
21630 | int to) | |
21631 | { | |
21632 | if (mctx->nbkref_ents >= mctx->abkref_ents) | |
21633 | { | |
21634 | struct re_backref_cache_entry* new_entry; | |
21635 | new_entry = ((struct re_backref_cache_entry *) realloc (mctx->bkref_ents, (mctx->abkref_ents * 2) * sizeof (struct re_backref_cache_entry))); | |
21636 | ||
21637 | if (__builtin_expect (new_entry == ((void *)0), 0)) | |
21638 | { | |
21639 | free (mctx->bkref_ents); | |
21640 | return REG_ESPACE; | |
21641 | } | |
21642 | mctx->bkref_ents = new_entry; | |
21643 | memset (mctx->bkref_ents + mctx->nbkref_ents, '\0', | |
21644 | sizeof (struct re_backref_cache_entry) * mctx->abkref_ents); | |
21645 | mctx->abkref_ents *= 2; | |
21646 | } | |
21647 | if (mctx->nbkref_ents > 0 | |
21648 | && mctx->bkref_ents[mctx->nbkref_ents - 1].str_idx == str_idx) | |
21649 | mctx->bkref_ents[mctx->nbkref_ents - 1].more = 1; | |
21650 | ||
21651 | mctx->bkref_ents[mctx->nbkref_ents].node = node; | |
21652 | mctx->bkref_ents[mctx->nbkref_ents].str_idx = str_idx; | |
21653 | mctx->bkref_ents[mctx->nbkref_ents].subexp_from = from; | |
21654 | mctx->bkref_ents[mctx->nbkref_ents].subexp_to = to; | |
21655 | # 4227 "regexec.c" | |
21656 | mctx->bkref_ents[mctx->nbkref_ents].eps_reachable_subexps_map | |
21657 | = (from == to ? ~0 : 0); | |
21658 | ||
21659 | mctx->bkref_ents[mctx->nbkref_ents++].more = 0; | |
21660 | if (mctx->max_mb_elem_len < to - from) | |
21661 | mctx->max_mb_elem_len = to - from; | |
21662 | return REG_NOERROR; | |
21663 | } | |
21664 | ||
21665 | ||
21666 | ||
21667 | ||
21668 | static int | |
21669 | ||
21670 | search_cur_bkref_entry (const re_match_context_t *mctx, int str_idx) | |
21671 | { | |
21672 | int left, right, mid, last; | |
21673 | last = right = mctx->nbkref_ents; | |
21674 | for (left = 0; left < right;) | |
21675 | { | |
21676 | mid = (left + right) / 2; | |
21677 | if (mctx->bkref_ents[mid].str_idx < str_idx) | |
21678 | left = mid + 1; | |
21679 | else | |
21680 | right = mid; | |
21681 | } | |
21682 | if (left < last && mctx->bkref_ents[left].str_idx == str_idx) | |
21683 | return left; | |
21684 | else | |
21685 | return -1; | |
21686 | } | |
21687 | ||
21688 | ||
21689 | ||
21690 | ||
21691 | static reg_errcode_t | |
21692 | ||
21693 | match_ctx_add_subtop (re_match_context_t *mctx, int node, int str_idx) | |
21694 | { | |
21695 | ||
21696 | ||
21697 | ||
21698 | ||
21699 | if (__builtin_expect (mctx->nsub_tops == mctx->asub_tops, 0)) | |
21700 | { | |
21701 | int new_asub_tops = mctx->asub_tops * 2; | |
21702 | re_sub_match_top_t **new_array = ((re_sub_match_top_t * *) realloc (mctx->sub_tops, (new_asub_tops) * sizeof (re_sub_match_top_t *))); | |
21703 | ||
21704 | ||
21705 | if (__builtin_expect (new_array == ((void *)0), 0)) | |
21706 | return REG_ESPACE; | |
21707 | mctx->sub_tops = new_array; | |
21708 | mctx->asub_tops = new_asub_tops; | |
21709 | } | |
21710 | mctx->sub_tops[mctx->nsub_tops] = calloc (1, sizeof (re_sub_match_top_t)); | |
21711 | if (__builtin_expect (mctx->sub_tops[mctx->nsub_tops] == ((void *)0), 0)) | |
21712 | return REG_ESPACE; | |
21713 | mctx->sub_tops[mctx->nsub_tops]->node = node; | |
21714 | mctx->sub_tops[mctx->nsub_tops++]->str_idx = str_idx; | |
21715 | return REG_NOERROR; | |
21716 | } | |
21717 | ||
21718 | ||
21719 | ||
21720 | ||
21721 | static re_sub_match_last_t * | |
21722 | ||
21723 | match_ctx_add_sublast (re_sub_match_top_t *subtop, int node, int str_idx) | |
21724 | { | |
21725 | re_sub_match_last_t *new_entry; | |
21726 | if (__builtin_expect (subtop->nlasts == subtop->alasts, 0)) | |
21727 | { | |
21728 | int new_alasts = 2 * subtop->alasts + 1; | |
21729 | re_sub_match_last_t **new_array = ((re_sub_match_last_t * *) realloc (subtop->lasts, (new_alasts) * sizeof (re_sub_match_last_t *))); | |
21730 | ||
21731 | ||
21732 | if (__builtin_expect (new_array == ((void *)0), 0)) | |
21733 | return ((void *)0); | |
21734 | subtop->lasts = new_array; | |
21735 | subtop->alasts = new_alasts; | |
21736 | } | |
21737 | new_entry = calloc (1, sizeof (re_sub_match_last_t)); | |
21738 | if (__builtin_expect (new_entry != ((void *)0), 1)) | |
21739 | { | |
21740 | subtop->lasts[subtop->nlasts] = new_entry; | |
21741 | new_entry->node = node; | |
21742 | new_entry->str_idx = str_idx; | |
21743 | ++subtop->nlasts; | |
21744 | } | |
21745 | return new_entry; | |
21746 | } | |
21747 | ||
21748 | static void | |
21749 | ||
21750 | sift_ctx_init (re_sift_context_t *sctx, re_dfastate_t **sifted_sts, | |
21751 | re_dfastate_t **limited_sts, int last_node, int last_str_idx) | |
21752 | { | |
21753 | sctx->sifted_states = sifted_sts; | |
21754 | sctx->limited_states = limited_sts; | |
21755 | sctx->last_node = last_node; | |
21756 | sctx->last_str_idx = last_str_idx; | |
21757 | memset (&sctx->limits, '\0', sizeof (re_node_set)); | |
21758 | } | |
21759 | # 66 "regex.c" 2 |