]>
Commit | Line | Data |
---|---|---|
45516216 | 1 | |
2 | ||
3 | ||
4 | ||
5 | ||
6 | ||
7 | typedef long unsigned int size_t; | |
8 | ||
9 | ||
10 | ||
11 | typedef unsigned short __kernel_dev_t; | |
12 | typedef unsigned long __kernel_ino_t; | |
13 | typedef unsigned short __kernel_mode_t; | |
14 | typedef unsigned short __kernel_nlink_t; | |
15 | typedef long __kernel_off_t; | |
16 | typedef int __kernel_pid_t; | |
17 | typedef unsigned int __kernel_ipc_pid_t; | |
18 | typedef unsigned int __kernel_uid_t; | |
19 | typedef unsigned int __kernel_gid_t; | |
20 | typedef unsigned int __kernel_size_t; | |
21 | typedef int __kernel_ssize_t; | |
22 | typedef int __kernel_ptrdiff_t; | |
23 | typedef long __kernel_time_t; | |
24 | typedef long __kernel_suseconds_t; | |
25 | typedef long __kernel_clock_t; | |
26 | typedef int __kernel_daddr_t; | |
27 | typedef char * __kernel_caddr_t; | |
28 | typedef unsigned short __kernel_uid16_t; | |
29 | typedef unsigned short __kernel_gid16_t; | |
30 | typedef unsigned int __kernel_uid32_t; | |
31 | typedef unsigned int __kernel_gid32_t; | |
32 | typedef unsigned short __kernel_old_uid_t; | |
33 | typedef unsigned short __kernel_old_gid_t; | |
34 | typedef long long __kernel_loff_t; | |
35 | typedef __kernel_dev_t __kernel_old_dev_t; | |
36 | ||
37 | typedef struct { | |
38 | ||
39 | ||
40 | ||
41 | int __val[2]; | |
42 | ||
43 | } __kernel_fsid_t; | |
44 | ||
45 | ||
46 | typedef unsigned char __u_char; | |
47 | typedef unsigned short int __u_short; | |
48 | typedef unsigned int __u_int; | |
49 | typedef unsigned long int __u_long; | |
50 | ||
51 | ||
52 | typedef signed char __int8_t; | |
53 | typedef unsigned char __uint8_t; | |
54 | typedef signed short int __int16_t; | |
55 | typedef unsigned short int __uint16_t; | |
56 | typedef signed int __int32_t; | |
57 | typedef unsigned int __uint32_t; | |
58 | ||
59 | ||
60 | ||
61 | ||
62 | __extension__ typedef signed long long int __int64_t; | |
63 | __extension__ typedef unsigned long long int __uint64_t; | |
64 | ||
65 | ||
66 | ||
67 | ||
68 | ||
69 | ||
70 | ||
71 | __extension__ typedef long long int __quad_t; | |
72 | __extension__ typedef unsigned long long int __u_quad_t; | |
73 | ||
74 | ||
75 | __extension__ typedef __u_quad_t __dev_t; | |
76 | __extension__ typedef unsigned int __uid_t; | |
77 | __extension__ typedef unsigned int __gid_t; | |
78 | __extension__ typedef unsigned long int __ino_t; | |
79 | __extension__ typedef __u_quad_t __ino64_t; | |
80 | __extension__ typedef unsigned int __mode_t; | |
81 | __extension__ typedef unsigned int __nlink_t; | |
82 | __extension__ typedef long int __off_t; | |
83 | __extension__ typedef __quad_t __off64_t; | |
84 | __extension__ typedef int __pid_t; | |
85 | __extension__ typedef struct { int __val[2]; } __fsid_t; | |
86 | __extension__ typedef long int __clock_t; | |
87 | __extension__ typedef unsigned long int __rlim_t; | |
88 | __extension__ typedef __u_quad_t __rlim64_t; | |
89 | __extension__ typedef unsigned int __id_t; | |
90 | __extension__ typedef long int __time_t; | |
91 | __extension__ typedef unsigned int __useconds_t; | |
92 | __extension__ typedef long int __suseconds_t; | |
93 | ||
94 | __extension__ typedef int __daddr_t; | |
95 | __extension__ typedef long int __swblk_t; | |
96 | __extension__ typedef int __key_t; | |
97 | ||
98 | ||
99 | __extension__ typedef int __clockid_t; | |
100 | ||
101 | ||
102 | __extension__ typedef void * __timer_t; | |
103 | ||
104 | ||
105 | __extension__ typedef long int __blksize_t; | |
106 | ||
107 | ||
108 | ||
109 | ||
110 | __extension__ typedef long int __blkcnt_t; | |
111 | __extension__ typedef __quad_t __blkcnt64_t; | |
112 | ||
113 | ||
114 | __extension__ typedef unsigned long int __fsblkcnt_t; | |
115 | __extension__ typedef __u_quad_t __fsblkcnt64_t; | |
116 | ||
117 | ||
118 | __extension__ typedef unsigned long int __fsfilcnt_t; | |
119 | __extension__ typedef __u_quad_t __fsfilcnt64_t; | |
120 | ||
121 | __extension__ typedef long int __ssize_t; | |
122 | ||
123 | ||
124 | ||
125 | typedef __off64_t __loff_t; | |
126 | typedef __quad_t *__qaddr_t; | |
127 | typedef char *__caddr_t; | |
128 | ||
129 | ||
130 | __extension__ typedef int __intptr_t; | |
131 | ||
132 | ||
133 | __extension__ typedef unsigned int __socklen_t; | |
134 | ||
135 | ||
136 | ||
137 | ||
138 | ||
139 | typedef __kernel_ipc_pid_t __ipc_pid_t; | |
140 | ||
141 | ||
142 | ||
143 | struct __sched_param | |
144 | { | |
145 | int __sched_priority; | |
146 | }; | |
147 | ||
148 | ||
149 | struct _pthread_fastlock | |
150 | { | |
151 | long int __status; | |
152 | int __spinlock; | |
153 | ||
154 | }; | |
155 | ||
156 | ||
157 | ||
158 | typedef struct _pthread_descr_struct *_pthread_descr; | |
159 | ||
160 | ||
161 | ||
162 | ||
163 | ||
164 | typedef struct __pthread_attr_s | |
165 | { | |
166 | int __detachstate; | |
167 | int __schedpolicy; | |
168 | struct __sched_param __schedparam; | |
169 | int __inheritsched; | |
170 | int __scope; | |
171 | size_t __guardsize; | |
172 | int __stackaddr_set; | |
173 | void *__stackaddr; | |
174 | size_t __stacksize; | |
175 | } pthread_attr_t; | |
176 | ||
177 | ||
178 | ||
179 | typedef struct | |
180 | { | |
181 | struct _pthread_fastlock __c_lock; | |
182 | _pthread_descr __c_waiting; | |
183 | } pthread_cond_t; | |
184 | ||
185 | ||
186 | ||
187 | typedef struct | |
188 | { | |
189 | int __dummy; | |
190 | } pthread_condattr_t; | |
191 | ||
192 | ||
193 | typedef unsigned int pthread_key_t; | |
194 | ||
195 | ||
196 | ||
197 | ||
198 | ||
199 | typedef struct | |
200 | { | |
201 | int __m_reserved; | |
202 | int __m_count; | |
203 | _pthread_descr __m_owner; | |
204 | int __m_kind; | |
205 | struct _pthread_fastlock __m_lock; | |
206 | } pthread_mutex_t; | |
207 | ||
208 | ||
209 | ||
210 | typedef struct | |
211 | { | |
212 | int __mutexkind; | |
213 | } pthread_mutexattr_t; | |
214 | ||
215 | ||
216 | ||
217 | typedef int pthread_once_t; | |
218 | typedef unsigned long int pthread_t; | |
219 | ||
220 | ||
221 | ||
222 | ||
223 | ||
224 | ||
225 | ||
226 | ||
227 | ||
228 | typedef struct __STDIO_FILE_STRUCT FILE; | |
229 | ||
230 | ||
231 | ||
232 | ||
233 | ||
234 | typedef struct __STDIO_FILE_STRUCT __FILE; | |
235 | struct timespec | |
236 | { | |
237 | __time_t tv_sec; | |
238 | long int tv_nsec; | |
239 | }; | |
240 | ||
241 | ||
242 | struct sched_param | |
243 | { | |
244 | int __sched_priority; | |
245 | }; | |
246 | ||
247 | ||
248 | ||
249 | ||
250 | ||
251 | extern int clone (int (*__fn) (void *__arg), void *__child_stack, | |
252 | int __flags, void *__arg, ...) __attribute__ ((__nothrow__)); | |
253 | ||
254 | ||
255 | ||
256 | ||
257 | ||
258 | ||
259 | ||
260 | ||
261 | typedef unsigned long int __cpu_mask; | |
262 | ||
263 | ||
264 | ||
265 | ||
266 | ||
267 | ||
268 | typedef struct | |
269 | { | |
270 | __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))]; | |
271 | } cpu_set_t; | |
272 | ||
273 | ||
274 | ||
275 | ||
276 | ||
277 | ||
278 | ||
279 | extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param) | |
280 | __attribute__ ((__nothrow__)); | |
281 | ||
282 | ||
283 | extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__)); | |
284 | ||
285 | ||
286 | extern int sched_setscheduler (__pid_t __pid, int __policy, | |
287 | __const struct sched_param *__param) __attribute__ ((__nothrow__)); | |
288 | ||
289 | ||
290 | extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__)); | |
291 | ||
292 | ||
293 | extern int sched_yield (void) __attribute__ ((__nothrow__)); | |
294 | ||
295 | ||
296 | extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__)); | |
297 | ||
298 | ||
299 | extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__)); | |
300 | ||
301 | ||
302 | extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__)); | |
303 | ||
304 | ||
305 | ||
306 | ||
307 | ||
308 | ||
309 | ||
310 | ||
311 | ||
312 | ||
313 | ||
314 | ||
315 | ||
316 | ||
317 | typedef __clock_t clock_t; | |
318 | ||
319 | ||
320 | ||
321 | ||
322 | ||
323 | typedef __time_t time_t; | |
324 | ||
325 | ||
326 | ||
327 | typedef __clockid_t clockid_t; | |
328 | typedef __timer_t timer_t; | |
329 | ||
330 | ||
331 | struct tm | |
332 | { | |
333 | int tm_sec; | |
334 | int tm_min; | |
335 | int tm_hour; | |
336 | int tm_mday; | |
337 | int tm_mon; | |
338 | int tm_year; | |
339 | int tm_wday; | |
340 | int tm_yday; | |
341 | int tm_isdst; | |
342 | ||
343 | ||
344 | ||
345 | long int tm_gmtoff; | |
346 | __const char *tm_zone; | |
347 | ||
348 | ||
349 | ||
350 | ||
351 | ||
352 | }; | |
353 | ||
354 | ||
355 | ||
356 | ||
357 | ||
358 | ||
359 | ||
360 | ||
361 | struct itimerspec | |
362 | { | |
363 | struct timespec it_interval; | |
364 | struct timespec it_value; | |
365 | }; | |
366 | ||
367 | ||
368 | struct sigevent; | |
369 | ||
370 | ||
371 | ||
372 | extern clock_t clock (void) __attribute__ ((__nothrow__)); | |
373 | ||
374 | ||
375 | extern time_t time (time_t *__timer) __attribute__ ((__nothrow__)); | |
376 | ||
377 | ||
378 | ||
379 | extern double difftime (time_t __time1, time_t __time0) | |
380 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
381 | ||
382 | ||
383 | ||
384 | extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__)); | |
385 | ||
386 | ||
387 | ||
388 | ||
389 | ||
390 | extern size_t strftime (char *__restrict __s, size_t __maxsize, | |
391 | __const char *__restrict __format, | |
392 | __const struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
393 | ||
394 | ||
395 | ||
396 | ||
397 | extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__)); | |
398 | ||
399 | ||
400 | ||
401 | extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__)); | |
402 | ||
403 | ||
404 | ||
405 | ||
406 | ||
407 | extern struct tm *gmtime_r (__const time_t *__restrict __timer, | |
408 | struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
409 | ||
410 | ||
411 | ||
412 | extern struct tm *localtime_r (__const time_t *__restrict __timer, | |
413 | struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
414 | ||
415 | ||
416 | ||
417 | ||
418 | ||
419 | extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__)); | |
420 | ||
421 | ||
422 | extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__)); | |
423 | ||
424 | ||
425 | ||
426 | ||
427 | ||
428 | ||
429 | ||
430 | extern char *asctime_r (__const struct tm *__restrict __tp, | |
431 | char *__restrict __buf) __attribute__ ((__nothrow__)); | |
432 | ||
433 | ||
434 | extern char *ctime_r (__const time_t *__restrict __timer, | |
435 | char *__restrict __buf) __attribute__ ((__nothrow__)); | |
436 | extern char *tzname[2]; | |
437 | ||
438 | ||
439 | ||
440 | extern void tzset (void) __attribute__ ((__nothrow__)); | |
441 | ||
442 | ||
443 | ||
444 | extern int daylight; | |
445 | extern long int timezone; | |
446 | ||
447 | ||
448 | ||
449 | ||
450 | ||
451 | extern int stime (__const time_t *__when) __attribute__ ((__nothrow__)); | |
452 | extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__)); | |
453 | ||
454 | ||
455 | extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__)); | |
456 | ||
457 | ||
458 | extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
459 | extern int nanosleep (__const struct timespec *__requested_time, | |
460 | struct timespec *__remaining); | |
461 | ||
462 | ||
463 | ||
464 | extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__)); | |
465 | ||
466 | ||
467 | extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__)); | |
468 | ||
469 | ||
470 | extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp) | |
471 | __attribute__ ((__nothrow__)); | |
472 | extern int timer_create (clockid_t __clock_id, | |
473 | struct sigevent *__restrict __evp, | |
474 | timer_t *__restrict __timerid) __attribute__ ((__nothrow__)); | |
475 | ||
476 | ||
477 | extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__)); | |
478 | ||
479 | ||
480 | extern int timer_settime (timer_t __timerid, int __flags, | |
481 | __const struct itimerspec *__restrict __value, | |
482 | struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__)); | |
483 | ||
484 | ||
485 | extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) | |
486 | __attribute__ ((__nothrow__)); | |
487 | ||
488 | ||
489 | extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__)); | |
490 | ||
491 | ||
492 | ||
493 | ||
494 | ||
495 | typedef int __sig_atomic_t; | |
496 | ||
497 | ||
498 | ||
499 | ||
500 | typedef struct | |
501 | { | |
502 | unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; | |
503 | } __sigset_t; | |
504 | typedef __sigset_t sigset_t; | |
505 | ||
506 | ||
507 | ||
508 | ||
509 | enum | |
510 | { | |
511 | PTHREAD_CREATE_JOINABLE, | |
512 | ||
513 | PTHREAD_CREATE_DETACHED | |
514 | ||
515 | }; | |
516 | ||
517 | enum | |
518 | { | |
519 | PTHREAD_INHERIT_SCHED, | |
520 | ||
521 | PTHREAD_EXPLICIT_SCHED | |
522 | ||
523 | }; | |
524 | ||
525 | enum | |
526 | { | |
527 | PTHREAD_SCOPE_SYSTEM, | |
528 | ||
529 | PTHREAD_SCOPE_PROCESS | |
530 | ||
531 | }; | |
532 | ||
533 | enum | |
534 | { | |
535 | PTHREAD_MUTEX_ADAPTIVE_NP, | |
536 | PTHREAD_MUTEX_RECURSIVE_NP, | |
537 | PTHREAD_MUTEX_ERRORCHECK_NP, | |
538 | PTHREAD_MUTEX_TIMED_NP | |
539 | }; | |
540 | ||
541 | enum | |
542 | { | |
543 | PTHREAD_PROCESS_PRIVATE, | |
544 | ||
545 | PTHREAD_PROCESS_SHARED | |
546 | ||
547 | }; | |
548 | struct _pthread_cleanup_buffer | |
549 | { | |
550 | void (*__routine) (void *); | |
551 | void *__arg; | |
552 | int __canceltype; | |
553 | struct _pthread_cleanup_buffer *__prev; | |
554 | }; | |
555 | ||
556 | ||
557 | ||
558 | enum | |
559 | { | |
560 | PTHREAD_CANCEL_ENABLE, | |
561 | ||
562 | PTHREAD_CANCEL_DISABLE | |
563 | ||
564 | }; | |
565 | enum | |
566 | { | |
567 | PTHREAD_CANCEL_DEFERRED, | |
568 | ||
569 | PTHREAD_CANCEL_ASYNCHRONOUS | |
570 | ||
571 | }; | |
572 | extern int pthread_create (pthread_t *__restrict __threadp, | |
573 | __const pthread_attr_t *__restrict __attr, | |
574 | void *(*__start_routine) (void *), | |
575 | void *__restrict __arg) __attribute__ ((__nothrow__)); | |
576 | ||
577 | ||
578 | extern pthread_t pthread_self (void) __attribute__ ((__nothrow__)); | |
579 | ||
580 | ||
581 | extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __attribute__ ((__nothrow__)); | |
582 | ||
583 | ||
584 | extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); | |
585 | ||
586 | ||
587 | ||
588 | ||
589 | extern int pthread_join (pthread_t __th, void **__thread_return); | |
590 | ||
591 | ||
592 | ||
593 | ||
594 | ||
595 | extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__)); | |
596 | ||
597 | ||
598 | ||
599 | ||
600 | ||
601 | ||
602 | ||
603 | extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__)); | |
604 | ||
605 | ||
606 | extern int pthread_attr_destroy (pthread_attr_t *__attr) __attribute__ ((__nothrow__)); | |
607 | ||
608 | ||
609 | extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, | |
610 | int __detachstate) __attribute__ ((__nothrow__)); | |
611 | ||
612 | ||
613 | extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr, | |
614 | int *__detachstate) __attribute__ ((__nothrow__)); | |
615 | ||
616 | ||
617 | extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, | |
618 | __const struct sched_param *__restrict | |
619 | __param) __attribute__ ((__nothrow__)); | |
620 | ||
621 | ||
622 | extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict | |
623 | __attr, | |
624 | struct sched_param *__restrict __param) | |
625 | __attribute__ ((__nothrow__)); | |
626 | ||
627 | ||
628 | extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) | |
629 | __attribute__ ((__nothrow__)); | |
630 | ||
631 | ||
632 | extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict | |
633 | __attr, int *__restrict __policy) | |
634 | __attribute__ ((__nothrow__)); | |
635 | ||
636 | ||
637 | extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, | |
638 | int __inherit) __attribute__ ((__nothrow__)); | |
639 | ||
640 | ||
641 | extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict | |
642 | __attr, int *__restrict __inherit) | |
643 | __attribute__ ((__nothrow__)); | |
644 | ||
645 | ||
646 | extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) | |
647 | __attribute__ ((__nothrow__)); | |
648 | ||
649 | ||
650 | extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr, | |
651 | int *__restrict __scope) __attribute__ ((__nothrow__)); | |
652 | extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, | |
653 | void *__stackaddr) __attribute__ ((__nothrow__)); | |
654 | ||
655 | ||
656 | extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict | |
657 | __attr, void **__restrict __stackaddr) | |
658 | __attribute__ ((__nothrow__)); | |
659 | extern int pthread_attr_setstacksize (pthread_attr_t *__attr, | |
660 | size_t __stacksize) __attribute__ ((__nothrow__)); | |
661 | ||
662 | ||
663 | extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict | |
664 | __attr, size_t *__restrict __stacksize) | |
665 | __attribute__ ((__nothrow__)); | |
666 | extern int pthread_setschedparam (pthread_t __target_thread, int __policy, | |
667 | __const struct sched_param *__param) | |
668 | __attribute__ ((__nothrow__)); | |
669 | ||
670 | ||
671 | extern int pthread_getschedparam (pthread_t __target_thread, | |
672 | int *__restrict __policy, | |
673 | struct sched_param *__restrict __param) | |
674 | __attribute__ ((__nothrow__)); | |
675 | extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex, | |
676 | __const pthread_mutexattr_t *__restrict | |
677 | __mutex_attr) __attribute__ ((__nothrow__)); | |
678 | ||
679 | ||
680 | extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__)); | |
681 | ||
682 | ||
683 | extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__)); | |
684 | ||
685 | ||
686 | extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__)); | |
687 | extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__)); | |
688 | ||
689 | ||
690 | ||
691 | ||
692 | ||
693 | ||
694 | extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) __attribute__ ((__nothrow__)); | |
695 | ||
696 | ||
697 | extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) __attribute__ ((__nothrow__)); | |
698 | ||
699 | ||
700 | extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t * | |
701 | __restrict __attr, | |
702 | int *__restrict __pshared) __attribute__ ((__nothrow__)); | |
703 | ||
704 | ||
705 | extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, | |
706 | int __pshared) __attribute__ ((__nothrow__)); | |
707 | extern int pthread_cond_init (pthread_cond_t *__restrict __cond, | |
708 | __const pthread_condattr_t *__restrict | |
709 | __cond_attr) __attribute__ ((__nothrow__)); | |
710 | ||
711 | ||
712 | extern int pthread_cond_destroy (pthread_cond_t *__cond) __attribute__ ((__nothrow__)); | |
713 | ||
714 | ||
715 | extern int pthread_cond_signal (pthread_cond_t *__cond) __attribute__ ((__nothrow__)); | |
716 | ||
717 | ||
718 | extern int pthread_cond_broadcast (pthread_cond_t *__cond) __attribute__ ((__nothrow__)); | |
719 | ||
720 | ||
721 | ||
722 | extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, | |
723 | pthread_mutex_t *__restrict __mutex); | |
724 | ||
725 | ||
726 | ||
727 | ||
728 | ||
729 | extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, | |
730 | pthread_mutex_t *__restrict __mutex, | |
731 | __const struct timespec *__restrict | |
732 | __abstime); | |
733 | ||
734 | ||
735 | ||
736 | ||
737 | extern int pthread_condattr_init (pthread_condattr_t *__attr) __attribute__ ((__nothrow__)); | |
738 | ||
739 | ||
740 | extern int pthread_condattr_destroy (pthread_condattr_t *__attr) __attribute__ ((__nothrow__)); | |
741 | ||
742 | ||
743 | extern int pthread_condattr_getpshared (__const pthread_condattr_t * | |
744 | __restrict __attr, | |
745 | int *__restrict __pshared) __attribute__ ((__nothrow__)); | |
746 | ||
747 | ||
748 | extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, | |
749 | int __pshared) __attribute__ ((__nothrow__)); | |
750 | extern int pthread_key_create (pthread_key_t *__key, | |
751 | void (*__destr_function) (void *)) __attribute__ ((__nothrow__)); | |
752 | ||
753 | ||
754 | extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__)); | |
755 | ||
756 | ||
757 | extern int pthread_setspecific (pthread_key_t __key, | |
758 | __const void *__pointer) __attribute__ ((__nothrow__)); | |
759 | ||
760 | ||
761 | extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__)); | |
762 | extern int pthread_once (pthread_once_t *__once_control, | |
763 | void (*__init_routine) (void)); | |
764 | ||
765 | ||
766 | ||
767 | ||
768 | ||
769 | ||
770 | extern int pthread_setcancelstate (int __state, int *__oldstate); | |
771 | ||
772 | ||
773 | ||
774 | extern int pthread_setcanceltype (int __type, int *__oldtype); | |
775 | ||
776 | ||
777 | extern int pthread_cancel (pthread_t __cancelthread); | |
778 | ||
779 | ||
780 | ||
781 | ||
782 | extern void pthread_testcancel (void); | |
783 | extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer, | |
784 | void (*__routine) (void *), | |
785 | void *__arg) __attribute__ ((__nothrow__)); | |
786 | ||
787 | ||
788 | ||
789 | ||
790 | ||
791 | ||
792 | ||
793 | extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer, | |
794 | int __execute) __attribute__ ((__nothrow__)); | |
795 | extern int pthread_sigmask (int __how, | |
796 | __const __sigset_t *__restrict __newmask, | |
797 | __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__)); | |
798 | ||
799 | ||
800 | extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__)); | |
801 | extern int pthread_atfork (void (*__prepare) (void), | |
802 | void (*__parent) (void), | |
803 | void (*__child) (void)) __attribute__ ((__nothrow__)); | |
804 | ||
805 | ||
806 | ||
807 | ||
808 | extern void pthread_kill_other_threads_np (void) __attribute__ ((__nothrow__)); | |
809 | ||
810 | ||
811 | typedef struct { | |
812 | __off_t __pos; | |
813 | ||
814 | ||
815 | ||
816 | ||
817 | ||
818 | ||
819 | } __STDIO_fpos_t; | |
820 | ||
821 | ||
822 | typedef struct { | |
823 | __off64_t __pos; | |
824 | ||
825 | ||
826 | ||
827 | ||
828 | ||
829 | ||
830 | } __STDIO_fpos64_t; | |
831 | ||
832 | ||
833 | ||
834 | ||
835 | typedef __off64_t __offmax_t; | |
836 | struct __STDIO_FILE_STRUCT { | |
837 | unsigned short __modeflags; | |
838 | ||
839 | ||
840 | ||
841 | ||
842 | ||
843 | ||
844 | ||
845 | unsigned char __ungot[2]; | |
846 | ||
847 | int __filedes; | |
848 | ||
849 | unsigned char *__bufstart; | |
850 | unsigned char *__bufend; | |
851 | unsigned char *__bufpos; | |
852 | unsigned char *__bufread; | |
853 | ||
854 | ||
855 | unsigned char *__bufgetc_u; | |
856 | ||
857 | ||
858 | unsigned char *__bufputc_u; | |
859 | ||
860 | ||
861 | ||
862 | ||
863 | ||
864 | struct __STDIO_FILE_STRUCT *__nextopen; | |
865 | int __user_locking; | |
866 | pthread_mutex_t __lock; | |
867 | ||
868 | ||
869 | ||
870 | ||
871 | ||
872 | }; | |
873 | extern int __fgetc_unlocked(FILE *__stream); | |
874 | extern int __fputc_unlocked(int __c, FILE *__stream); | |
875 | extern FILE *__stdin; | |
876 | extern FILE *__stdout; | |
877 | ||
878 | ||
879 | ||
880 | typedef __builtin_va_list __gnuc_va_list; | |
881 | ||
882 | ||
883 | ||
884 | ||
885 | typedef __STDIO_fpos_t fpos_t; | |
886 | ||
887 | ||
888 | ||
889 | ||
890 | ||
891 | ||
892 | ||
893 | extern FILE *stdin; | |
894 | extern FILE *stdout; | |
895 | extern FILE *stderr; | |
896 | ||
897 | ||
898 | ||
899 | ||
900 | ||
901 | ||
902 | ||
903 | extern int remove (__const char *__filename) __attribute__ ((__nothrow__)); | |
904 | ||
905 | extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__)); | |
906 | ||
907 | ||
908 | ||
909 | ||
910 | ||
911 | ||
912 | ||
913 | ||
914 | ||
915 | extern FILE *tmpfile (void); | |
916 | extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)); | |
917 | ||
918 | ||
919 | ||
920 | ||
921 | ||
922 | extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)); | |
923 | extern char *tempnam (__const char *__dir, __const char *__pfx) | |
924 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); | |
925 | ||
926 | ||
927 | ||
928 | ||
929 | ||
930 | ||
931 | ||
932 | ||
933 | extern int fclose (FILE *__stream); | |
934 | ||
935 | ||
936 | ||
937 | ||
938 | extern int fflush (FILE *__stream); | |
939 | ||
940 | extern int fflush_unlocked (FILE *__stream); | |
941 | ||
942 | ||
943 | ||
944 | ||
945 | ||
946 | ||
947 | extern FILE *fopen (__const char *__restrict __filename, | |
948 | __const char *__restrict __modes); | |
949 | ||
950 | ||
951 | ||
952 | ||
953 | extern FILE *freopen (__const char *__restrict __filename, | |
954 | __const char *__restrict __modes, | |
955 | FILE *__restrict __stream); | |
956 | ||
957 | extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)); | |
958 | ||
959 | ||
960 | ||
961 | extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__)); | |
962 | ||
963 | ||
964 | ||
965 | extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, | |
966 | int __modes, size_t __n) __attribute__ ((__nothrow__)); | |
967 | ||
968 | ||
969 | ||
970 | ||
971 | ||
972 | extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, | |
973 | size_t __size) __attribute__ ((__nothrow__)); | |
974 | ||
975 | ||
976 | extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__)); | |
977 | ||
978 | ||
979 | ||
980 | ||
981 | ||
982 | ||
983 | ||
984 | ||
985 | extern int fprintf (FILE *__restrict __stream, | |
986 | __const char *__restrict __format, ...); | |
987 | ||
988 | ||
989 | ||
990 | ||
991 | extern int printf (__const char *__restrict __format, ...); | |
992 | ||
993 | extern int sprintf (char *__restrict __s, | |
994 | __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); | |
995 | ||
996 | ||
997 | ||
998 | ||
999 | ||
1000 | extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, | |
1001 | __gnuc_va_list __arg); | |
1002 | ||
1003 | ||
1004 | ||
1005 | ||
1006 | extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg); | |
1007 | ||
1008 | extern int vsprintf (char *__restrict __s, __const char *__restrict __format, | |
1009 | __gnuc_va_list __arg) __attribute__ ((__nothrow__)); | |
1010 | ||
1011 | ||
1012 | ||
1013 | ||
1014 | ||
1015 | extern int snprintf (char *__restrict __s, size_t __maxlen, | |
1016 | __const char *__restrict __format, ...) | |
1017 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); | |
1018 | ||
1019 | extern int vsnprintf (char *__restrict __s, size_t __maxlen, | |
1020 | __const char *__restrict __format, __gnuc_va_list __arg) | |
1021 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); | |
1022 | ||
1023 | ||
1024 | ||
1025 | ||
1026 | ||
1027 | ||
1028 | extern int fscanf (FILE *__restrict __stream, | |
1029 | __const char *__restrict __format, ...); | |
1030 | ||
1031 | ||
1032 | ||
1033 | ||
1034 | extern int scanf (__const char *__restrict __format, ...); | |
1035 | ||
1036 | extern int sscanf (__const char *__restrict __s, | |
1037 | __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); | |
1038 | ||
1039 | ||
1040 | ||
1041 | ||
1042 | ||
1043 | ||
1044 | extern int fgetc (FILE *__stream); | |
1045 | extern int getc (FILE *__stream); | |
1046 | ||
1047 | ||
1048 | ||
1049 | ||
1050 | ||
1051 | extern int getchar (void); | |
1052 | ||
1053 | extern int getc_unlocked (FILE *__stream); | |
1054 | extern int getchar_unlocked (void); | |
1055 | extern int fgetc_unlocked (FILE *__stream); | |
1056 | ||
1057 | ||
1058 | ||
1059 | ||
1060 | ||
1061 | ||
1062 | ||
1063 | ||
1064 | ||
1065 | ||
1066 | ||
1067 | extern int fputc (int __c, FILE *__stream); | |
1068 | extern int putc (int __c, FILE *__stream); | |
1069 | ||
1070 | ||
1071 | ||
1072 | ||
1073 | ||
1074 | extern int putchar (int __c); | |
1075 | ||
1076 | extern int fputc_unlocked (int __c, FILE *__stream); | |
1077 | ||
1078 | ||
1079 | ||
1080 | ||
1081 | ||
1082 | ||
1083 | ||
1084 | extern int putc_unlocked (int __c, FILE *__stream); | |
1085 | extern int putchar_unlocked (int __c); | |
1086 | extern int getw (FILE *__stream); | |
1087 | ||
1088 | ||
1089 | extern int putw (int __w, FILE *__stream); | |
1090 | ||
1091 | ||
1092 | ||
1093 | ||
1094 | ||
1095 | ||
1096 | ||
1097 | ||
1098 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream); | |
1099 | ||
1100 | ||
1101 | ||
1102 | ||
1103 | ||
1104 | ||
1105 | extern char *gets (char *__s); | |
1106 | ||
1107 | ||
1108 | ||
1109 | ||
1110 | ||
1111 | ||
1112 | extern int fputs (__const char *__restrict __s, FILE *__restrict __stream); | |
1113 | ||
1114 | ||
1115 | ||
1116 | ||
1117 | ||
1118 | extern int puts (__const char *__s); | |
1119 | ||
1120 | ||
1121 | ||
1122 | ||
1123 | ||
1124 | ||
1125 | extern int ungetc (int __c, FILE *__stream); | |
1126 | ||
1127 | ||
1128 | ||
1129 | ||
1130 | ||
1131 | ||
1132 | extern size_t fread (void *__restrict __ptr, size_t __size, | |
1133 | size_t __n, FILE *__restrict __stream); | |
1134 | ||
1135 | ||
1136 | ||
1137 | ||
1138 | extern size_t fwrite (__const void *__restrict __ptr, size_t __size, | |
1139 | size_t __n, FILE *__restrict __s); | |
1140 | ||
1141 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, | |
1142 | size_t __n, FILE *__restrict __stream); | |
1143 | extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, | |
1144 | size_t __n, FILE *__restrict __stream); | |
1145 | ||
1146 | ||
1147 | ||
1148 | ||
1149 | ||
1150 | ||
1151 | ||
1152 | ||
1153 | extern int fseek (FILE *__stream, long int __off, int __whence); | |
1154 | ||
1155 | ||
1156 | ||
1157 | ||
1158 | extern long int ftell (FILE *__stream); | |
1159 | ||
1160 | ||
1161 | ||
1162 | ||
1163 | extern void rewind (FILE *__stream); | |
1164 | ||
1165 | ||
1166 | ||
1167 | ||
1168 | ||
1169 | ||
1170 | ||
1171 | extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); | |
1172 | ||
1173 | ||
1174 | ||
1175 | ||
1176 | extern int fsetpos (FILE *__stream, __const fpos_t *__pos); | |
1177 | ||
1178 | ||
1179 | ||
1180 | extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__)); | |
1181 | ||
1182 | extern int feof (FILE *__stream) __attribute__ ((__nothrow__)); | |
1183 | ||
1184 | extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)); | |
1185 | ||
1186 | ||
1187 | ||
1188 | ||
1189 | extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); | |
1190 | extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); | |
1191 | extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); | |
1192 | ||
1193 | ||
1194 | ||
1195 | ||
1196 | ||
1197 | ||
1198 | ||
1199 | ||
1200 | extern void perror (__const char *__s); | |
1201 | ||
1202 | extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)); | |
1203 | ||
1204 | ||
1205 | ||
1206 | ||
1207 | extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); | |
1208 | extern FILE *popen (__const char *__command, __const char *__modes); | |
1209 | ||
1210 | ||
1211 | ||
1212 | ||
1213 | ||
1214 | extern int pclose (FILE *__stream); | |
1215 | ||
1216 | ||
1217 | ||
1218 | ||
1219 | ||
1220 | extern char *ctermid (char *__s) __attribute__ ((__nothrow__)); | |
1221 | extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__)); | |
1222 | ||
1223 | ||
1224 | ||
1225 | extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)); | |
1226 | ||
1227 | ||
1228 | extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__)); | |
1229 | ||
1230 | ||
1231 | ||
1232 | ||
1233 | ||
1234 | ||
1235 | ||
1236 | ||
1237 | ||
1238 | ||
1239 | extern void *memcpy (void *__restrict __dest, | |
1240 | __const void *__restrict __src, size_t __n) | |
1241 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
1242 | ||
1243 | ||
1244 | extern void *memmove (void *__dest, __const void *__src, size_t __n) | |
1245 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
1246 | ||
1247 | ||
1248 | ||
1249 | ||
1250 | ||
1251 | ||
1252 | extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, | |
1253 | int __c, size_t __n) | |
1254 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
1255 | ||
1256 | ||
1257 | ||
1258 | ||
1259 | ||
1260 | extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
1261 | ||
1262 | ||
1263 | extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) | |
1264 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
1265 | ||
1266 | ||
1267 | extern void *memchr (__const void *__s, int __c, size_t __n) | |
1268 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
1269 | ||
1270 | ||
1271 | ||
1272 | extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) | |
1273 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
1274 | ||
1275 | extern char *strncpy (char *__restrict __dest, | |
1276 | __const char *__restrict __src, size_t __n) | |
1277 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
1278 | ||
1279 | ||
1280 | extern char *strcat (char *__restrict __dest, __const char *__restrict __src) | |
1281 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
1282 | ||
1283 | extern char *strncat (char *__restrict __dest, __const char *__restrict __src, | |
1284 | size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
1285 | ||
1286 | ||
1287 | extern int strcmp (__const char *__s1, __const char *__s2) | |
1288 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
1289 | ||
1290 | extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) | |
1291 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
1292 | ||
1293 | ||
1294 | extern int strcoll (__const char *__s1, __const char *__s2) | |
1295 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
1296 | ||
1297 | extern size_t strxfrm (char *__restrict __dest, | |
1298 | __const char *__restrict __src, size_t __n) | |
1299 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
1300 | ||
1301 | extern char *strdup (__const char *__s) | |
1302 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); | |
1303 | ||
1304 | ||
1305 | extern char *strchr (__const char *__s, int __c) | |
1306 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
1307 | ||
1308 | extern char *strrchr (__const char *__s, int __c) | |
1309 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
1310 | ||
1311 | ||
1312 | ||
1313 | ||
1314 | extern size_t strcspn (__const char *__s, __const char *__reject) | |
1315 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
1316 | ||
1317 | ||
1318 | extern size_t strspn (__const char *__s, __const char *__accept) | |
1319 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
1320 | ||
1321 | extern char *strpbrk (__const char *__s, __const char *__accept) | |
1322 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
1323 | ||
1324 | extern char *strstr (__const char *__haystack, __const char *__needle) | |
1325 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
1326 | ||
1327 | ||
1328 | ||
1329 | extern char *strtok (char *__restrict __s, __const char *__restrict __delim) | |
1330 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
1331 | ||
1332 | extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, | |
1333 | char **__restrict __save_ptr) | |
1334 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); | |
1335 | ||
1336 | ||
1337 | extern size_t strlen (__const char *__s) | |
1338 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
1339 | ||
1340 | ||
1341 | ||
1342 | extern char *strerror (int __errnum) __attribute__ ((__nothrow__)); | |
1343 | ||
1344 | extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen) | |
1345 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
1346 | ||
1347 | extern char * strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("_" "__glibc_strerror_r") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
1348 | extern void bcopy (__const void *__src, void *__dest, size_t __n) | |
1349 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
1350 | ||
1351 | ||
1352 | extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
1353 | ||
1354 | ||
1355 | extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) | |
1356 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
1357 | ||
1358 | ||
1359 | extern char *index (__const char *__s, int __c) | |
1360 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
1361 | ||
1362 | ||
1363 | extern char *rindex (__const char *__s, int __c) | |
1364 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
1365 | extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1366 | extern int strcasecmp (__const char *__s1, __const char *__s2) | |
1367 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
1368 | ||
1369 | ||
1370 | extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) | |
1371 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
1372 | extern char *strsep (char **__restrict __stringp, | |
1373 | __const char *__restrict __delim) | |
1374 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
1375 | extern size_t strlcat(char *__restrict dst, const char *__restrict src, | |
1376 | size_t n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
1377 | extern size_t strlcpy(char *__restrict dst, const char *__restrict src, | |
1378 | size_t n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
1379 | ||
1380 | ||
1381 | ||
1382 | ||
1383 | ||
1384 | ||
1385 | const char *it = "<UNSET>"; | |
1386 | size_t errors = 0; | |
1387 | ||
1388 | char one[50]; | |
1389 | char two[50]; | |
1390 | ||
1391 | static void | |
1392 | check (int thing, int number) | |
1393 | { | |
1394 | if (!thing) | |
1395 | { | |
1396 | printf("%s flunked test %d\n", it, number); | |
1397 | ++errors; | |
1398 | } | |
1399 | else if (0) | |
1400 | { | |
1401 | printf("%s test %d ok\n", it, number); | |
1402 | } | |
1403 | } | |
1404 | ||
1405 | ||
1406 | static void | |
1407 | equal (const char *a, const char *b, int number) | |
1408 | { | |
1409 | check(a != ((void *)0) && b != ((void *)0) && (strcmp((a), (b)) == 0), number); | |
1410 | } | |
1411 | ||
1412 | ||
1413 | int _strcmp(const char *cs, const char *ct) | |
1414 | { | |
1415 | ||
1416 | ||
1417 | ||
1418 | int __res1, __res2; | |
1419 | ||
1420 | __asm__ | |
1421 | ("1:\t%2 = B[%0++] (Z);\n\t" | |
1422 | "%3 = B[%1++] (Z);\n\t" | |
1423 | "CC = %2 == %3;\n\t" | |
1424 | "if ! cc jump 2f;\n\t" | |
1425 | "CC = %2;\n\t" | |
1426 | "if cc jump 1b (bp);\n\t" | |
1427 | "jump.s 3f;\n" | |
1428 | "2:\t%2 = %2 - %3;\n" | |
1429 | "3:\n" | |
1430 | : "+&a" (cs), "+&a" (ct), "=&d" (__res1), "=&d" (__res2) | |
1431 | : : "CC"); | |
1432 | ||
1433 | return __res1; | |
1434 | } | |
1435 | ||
1436 | void | |
1437 | test_strcmp (void) | |
1438 | { | |
1439 | it = "strcmp"; | |
1440 | { | |
1441 | char buf1[0x40], buf2[0x40]; | |
1442 | int i, j; | |
1443 | ||
1444 | j = i = 0; | |
1445 | ||
1446 | { | |
1447 | int k; | |
1448 | ||
1449 | ||
1450 | ||
1451 | ||
1452 | ||
1453 | ||
1454 | ||
1455 | buf1[i] = buf1[0x3f] = 0; | |
1456 | buf2[j] = buf2[0x3f] = 0; | |
1457 | ||
1458 | k = 0; | |
1459 | { | |
1460 | ||
1461 | ; | |
1462 | ; | |
1463 | ||
1464 | buf1[i+k] = 'A' + i + k; | |
1465 | buf1[i+k+1] = 0; | |
1466 | ; | |
1467 | ; | |
1468 | check (_strcmp (buf1+i,buf2+j) > 0, 2); | |
1469 | ||
1470 | return; | |
1471 | } | |
1472 | } | |
1473 | } | |
1474 | } | |
1475 | ||
1476 | int main(int argc, char *argv[]) | |
1477 | { | |
1478 | int status; | |
1479 | ||
1480 | test_strcmp (); | |
1481 | ||
1482 | if (errors == 0) | |
1483 | { | |
1484 | status = 0; | |
1485 | printf("TEST PASS.\n"); | |
1486 | } | |
1487 | else | |
1488 | { | |
1489 | status = 1; | |
1490 | printf("%Zd errors.\n", errors); | |
1491 | printf("TEST FAIL.\n"); | |
1492 | } | |
1493 | ||
1494 | return status; | |
1495 | } |