]>
Commit | Line | Data |
---|---|---|
1 | // /usr/libexec/gcc/powerpc64-unknown-linux-gnu/4.1.1/cc1 -quiet -I. -I. -I../../.. -I../../.. -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -MD scheme.d -MF .deps/scheme.Tpo -MP -MT scheme.o -MQ scheme.o -D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux -D__linux -Asystem=linux -Asystem=unix -Asystem=posix -DHAVE_CONFIG_H -DGIMP_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE -DSTANDALONE=0 -DUSE_INTERFACE=1 -DUSE_MATH=1 -DUSE_ASCII_NAMES=0 -DUSE_STRLWR=0 scheme.c -quiet -dumpbase scheme.c -mcpu=970 -mtune=970 -maltivec -mabi=altivec -mpowerpc64 -auxbase-strip scheme.o -O2 -Wall -Wdeclaration-after-statement -Wmissing-prototypes -Wmissing-declarations -Winit-self -Wpointer-arith -fno-strict-aliasing -fomit-frame-pointer -o - -frandom-seed=0 | |
2 | # 1 "scheme.c" | |
3 | # 1 "<built-in>" | |
4 | # 1 "<command line>" | |
5 | # 1 "scheme.c" | |
6 | # 25 "scheme.c" | |
7 | # 1 "../../../config.h" 1 | |
8 | # 26 "scheme.c" 2 | |
9 | ||
10 | ||
11 | ||
12 | # 1 "/usr/include/unistd.h" 1 3 4 | |
13 | ||
14 | ||
15 | ||
16 | ||
17 | ||
18 | ||
19 | ||
20 | # 1 "/usr/include/gentoo-multilib/ppc64/unistd.h" 1 3 4 | |
21 | # 26 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
22 | # 1 "/usr/include/features.h" 1 3 4 | |
23 | ||
24 | ||
25 | ||
26 | ||
27 | ||
28 | ||
29 | ||
30 | # 1 "/usr/include/gentoo-multilib/ppc64/features.h" 1 3 4 | |
31 | # 323 "/usr/include/gentoo-multilib/ppc64/features.h" 3 4 | |
32 | # 1 "/usr/include/sys/cdefs.h" 1 3 4 | |
33 | ||
34 | ||
35 | ||
36 | ||
37 | ||
38 | ||
39 | ||
40 | # 1 "/usr/include/gentoo-multilib/ppc64/sys/cdefs.h" 1 3 4 | |
41 | # 313 "/usr/include/gentoo-multilib/ppc64/sys/cdefs.h" 3 4 | |
42 | # 1 "/usr/include/bits/wordsize.h" 1 3 4 | |
43 | ||
44 | ||
45 | ||
46 | ||
47 | ||
48 | ||
49 | ||
50 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/wordsize.h" 1 3 4 | |
51 | # 9 "/usr/include/bits/wordsize.h" 2 3 4 | |
52 | # 314 "/usr/include/gentoo-multilib/ppc64/sys/cdefs.h" 2 3 4 | |
53 | # 9 "/usr/include/sys/cdefs.h" 2 3 4 | |
54 | # 324 "/usr/include/gentoo-multilib/ppc64/features.h" 2 3 4 | |
55 | # 346 "/usr/include/gentoo-multilib/ppc64/features.h" 3 4 | |
56 | # 1 "/usr/include/gnu/stubs.h" 1 3 4 | |
57 | ||
58 | ||
59 | ||
60 | ||
61 | ||
62 | ||
63 | ||
64 | # 1 "/usr/include/gentoo-multilib/ppc64/gnu/stubs.h" 1 3 4 | |
65 | ||
66 | ||
67 | ||
68 | # 1 "/usr/include/bits/wordsize.h" 1 3 4 | |
69 | ||
70 | ||
71 | ||
72 | ||
73 | ||
74 | ||
75 | ||
76 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/wordsize.h" 1 3 4 | |
77 | # 9 "/usr/include/bits/wordsize.h" 2 3 4 | |
78 | # 5 "/usr/include/gentoo-multilib/ppc64/gnu/stubs.h" 2 3 4 | |
79 | ||
80 | ||
81 | ||
82 | ||
83 | # 1 "/usr/include/gnu/stubs-64.h" 1 3 4 | |
84 | ||
85 | ||
86 | ||
87 | # 1 "/usr/include/gentoo-multilib/ppc64/gnu/stubs-64.h" 1 3 4 | |
88 | # 5 "/usr/include/gnu/stubs-64.h" 2 3 4 | |
89 | # 10 "/usr/include/gentoo-multilib/ppc64/gnu/stubs.h" 2 3 4 | |
90 | # 9 "/usr/include/gnu/stubs.h" 2 3 4 | |
91 | # 347 "/usr/include/gentoo-multilib/ppc64/features.h" 2 3 4 | |
92 | # 9 "/usr/include/features.h" 2 3 4 | |
93 | # 27 "/usr/include/gentoo-multilib/ppc64/unistd.h" 2 3 4 | |
94 | ||
95 | ||
96 | # 171 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
97 | # 1 "/usr/include/bits/posix_opt.h" 1 3 4 | |
98 | ||
99 | ||
100 | ||
101 | ||
102 | ||
103 | ||
104 | ||
105 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/posix_opt.h" 1 3 4 | |
106 | # 9 "/usr/include/bits/posix_opt.h" 2 3 4 | |
107 | # 172 "/usr/include/gentoo-multilib/ppc64/unistd.h" 2 3 4 | |
108 | # 186 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
109 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
110 | ||
111 | ||
112 | ||
113 | ||
114 | ||
115 | ||
116 | ||
117 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/types.h" 1 3 4 | |
118 | # 27 "/usr/include/gentoo-multilib/ppc64/bits/types.h" 3 4 | |
119 | # 1 "/usr/include/features.h" 1 3 4 | |
120 | # 28 "/usr/include/gentoo-multilib/ppc64/bits/types.h" 2 3 4 | |
121 | # 1 "/usr/include/bits/wordsize.h" 1 3 4 | |
122 | ||
123 | ||
124 | ||
125 | ||
126 | ||
127 | ||
128 | ||
129 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/wordsize.h" 1 3 4 | |
130 | # 9 "/usr/include/bits/wordsize.h" 2 3 4 | |
131 | # 29 "/usr/include/gentoo-multilib/ppc64/bits/types.h" 2 3 4 | |
132 | ||
133 | ||
134 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
135 | # 214 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 3 4 | |
136 | typedef long unsigned int size_t; | |
137 | # 32 "/usr/include/gentoo-multilib/ppc64/bits/types.h" 2 3 4 | |
138 | ||
139 | ||
140 | typedef unsigned char __u_char; | |
141 | typedef unsigned short int __u_short; | |
142 | typedef unsigned int __u_int; | |
143 | typedef unsigned long int __u_long; | |
144 | ||
145 | ||
146 | typedef signed char __int8_t; | |
147 | typedef unsigned char __uint8_t; | |
148 | typedef signed short int __int16_t; | |
149 | typedef unsigned short int __uint16_t; | |
150 | typedef signed int __int32_t; | |
151 | typedef unsigned int __uint32_t; | |
152 | ||
153 | typedef signed long int __int64_t; | |
154 | typedef unsigned long int __uint64_t; | |
155 | ||
156 | ||
157 | ||
158 | ||
159 | ||
160 | ||
161 | ||
162 | typedef long int __quad_t; | |
163 | typedef unsigned long int __u_quad_t; | |
164 | # 134 "/usr/include/gentoo-multilib/ppc64/bits/types.h" 3 4 | |
165 | # 1 "/usr/include/bits/typesizes.h" 1 3 4 | |
166 | ||
167 | ||
168 | ||
169 | ||
170 | ||
171 | ||
172 | ||
173 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/typesizes.h" 1 3 4 | |
174 | # 9 "/usr/include/bits/typesizes.h" 2 3 4 | |
175 | # 135 "/usr/include/gentoo-multilib/ppc64/bits/types.h" 2 3 4 | |
176 | ||
177 | ||
178 | typedef unsigned long int __dev_t; | |
179 | typedef unsigned int __uid_t; | |
180 | typedef unsigned int __gid_t; | |
181 | typedef unsigned long int __ino_t; | |
182 | typedef unsigned long int __ino64_t; | |
183 | typedef unsigned int __mode_t; | |
184 | typedef unsigned long int __nlink_t; | |
185 | typedef long int __off_t; | |
186 | typedef long int __off64_t; | |
187 | typedef int __pid_t; | |
188 | typedef struct { int __val[2]; } __fsid_t; | |
189 | typedef long int __clock_t; | |
190 | typedef unsigned long int __rlim_t; | |
191 | typedef unsigned long int __rlim64_t; | |
192 | typedef unsigned int __id_t; | |
193 | typedef long int __time_t; | |
194 | typedef unsigned int __useconds_t; | |
195 | typedef long int __suseconds_t; | |
196 | ||
197 | typedef int __daddr_t; | |
198 | typedef long int __swblk_t; | |
199 | typedef int __key_t; | |
200 | ||
201 | ||
202 | typedef int __clockid_t; | |
203 | ||
204 | ||
205 | typedef void * __timer_t; | |
206 | ||
207 | ||
208 | typedef long int __blksize_t; | |
209 | ||
210 | ||
211 | ||
212 | ||
213 | typedef long int __blkcnt_t; | |
214 | typedef long int __blkcnt64_t; | |
215 | ||
216 | ||
217 | typedef unsigned long int __fsblkcnt_t; | |
218 | typedef unsigned long int __fsblkcnt64_t; | |
219 | ||
220 | ||
221 | typedef unsigned long int __fsfilcnt_t; | |
222 | typedef unsigned long int __fsfilcnt64_t; | |
223 | ||
224 | typedef long int __ssize_t; | |
225 | ||
226 | ||
227 | ||
228 | typedef __off64_t __loff_t; | |
229 | typedef __quad_t *__qaddr_t; | |
230 | typedef char *__caddr_t; | |
231 | ||
232 | ||
233 | typedef long int __intptr_t; | |
234 | ||
235 | ||
236 | typedef unsigned int __socklen_t; | |
237 | # 9 "/usr/include/bits/types.h" 2 3 4 | |
238 | # 187 "/usr/include/gentoo-multilib/ppc64/unistd.h" 2 3 4 | |
239 | ||
240 | ||
241 | typedef __ssize_t ssize_t; | |
242 | ||
243 | ||
244 | ||
245 | ||
246 | ||
247 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
248 | # 196 "/usr/include/gentoo-multilib/ppc64/unistd.h" 2 3 4 | |
249 | ||
250 | ||
251 | ||
252 | ||
253 | ||
254 | typedef __gid_t gid_t; | |
255 | ||
256 | ||
257 | ||
258 | ||
259 | typedef __uid_t uid_t; | |
260 | ||
261 | ||
262 | ||
263 | ||
264 | ||
265 | typedef __off_t off_t; | |
266 | # 224 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
267 | typedef __useconds_t useconds_t; | |
268 | ||
269 | ||
270 | ||
271 | ||
272 | typedef __pid_t pid_t; | |
273 | ||
274 | ||
275 | ||
276 | ||
277 | ||
278 | ||
279 | typedef __intptr_t intptr_t; | |
280 | ||
281 | ||
282 | ||
283 | ||
284 | ||
285 | ||
286 | typedef __socklen_t socklen_t; | |
287 | # 256 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
288 | extern int access (__const char *__name, int __type) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
289 | # 299 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
290 | extern __off_t lseek (int __fd, __off_t __offset, int __whence) __attribute__ ((__nothrow__)); | |
291 | # 318 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
292 | extern int close (int __fd); | |
293 | ||
294 | ||
295 | ||
296 | ||
297 | ||
298 | ||
299 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ; | |
300 | ||
301 | ||
302 | ||
303 | ||
304 | ||
305 | extern ssize_t write (int __fd, __const void *__buf, size_t __n) ; | |
306 | # 382 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
307 | extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__)) ; | |
308 | # 391 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
309 | extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__)); | |
310 | # 403 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
311 | extern unsigned int sleep (unsigned int __seconds); | |
312 | ||
313 | ||
314 | ||
315 | ||
316 | ||
317 | ||
318 | extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval) | |
319 | __attribute__ ((__nothrow__)); | |
320 | ||
321 | ||
322 | ||
323 | ||
324 | ||
325 | ||
326 | extern int usleep (__useconds_t __useconds); | |
327 | # 427 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
328 | extern int pause (void); | |
329 | ||
330 | ||
331 | ||
332 | extern int chown (__const char *__file, __uid_t __owner, __gid_t __group) | |
333 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
334 | ||
335 | ||
336 | ||
337 | extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__)) ; | |
338 | ||
339 | ||
340 | ||
341 | ||
342 | extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group) | |
343 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
344 | # 455 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
345 | extern int chdir (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
346 | ||
347 | ||
348 | ||
349 | extern int fchdir (int __fd) __attribute__ ((__nothrow__)) ; | |
350 | # 469 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
351 | extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__)) ; | |
352 | # 482 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
353 | extern char *getwd (char *__buf) | |
354 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) ; | |
355 | ||
356 | ||
357 | ||
358 | ||
359 | extern int dup (int __fd) __attribute__ ((__nothrow__)) ; | |
360 | ||
361 | ||
362 | extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__)); | |
363 | ||
364 | ||
365 | extern char **__environ; | |
366 | ||
367 | ||
368 | ||
369 | ||
370 | ||
371 | ||
372 | ||
373 | extern int execve (__const char *__path, char *__const __argv[], | |
374 | char *__const __envp[]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
375 | # 514 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
376 | extern int execv (__const char *__path, char *__const __argv[]) | |
377 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
378 | ||
379 | ||
380 | ||
381 | extern int execle (__const char *__path, __const char *__arg, ...) | |
382 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
383 | ||
384 | ||
385 | ||
386 | extern int execl (__const char *__path, __const char *__arg, ...) | |
387 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
388 | ||
389 | ||
390 | ||
391 | extern int execvp (__const char *__file, char *__const __argv[]) | |
392 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
393 | ||
394 | ||
395 | ||
396 | ||
397 | extern int execlp (__const char *__file, __const char *__arg, ...) | |
398 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
399 | ||
400 | ||
401 | ||
402 | ||
403 | extern int nice (int __inc) __attribute__ ((__nothrow__)) ; | |
404 | ||
405 | ||
406 | ||
407 | ||
408 | extern void _exit (int __status) __attribute__ ((__noreturn__)); | |
409 | ||
410 | ||
411 | ||
412 | ||
413 | ||
414 | # 1 "/usr/include/bits/confname.h" 1 3 4 | |
415 | ||
416 | ||
417 | ||
418 | ||
419 | ||
420 | ||
421 | ||
422 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/confname.h" 1 3 4 | |
423 | # 26 "/usr/include/gentoo-multilib/ppc64/bits/confname.h" 3 4 | |
424 | enum | |
425 | { | |
426 | _PC_LINK_MAX, | |
427 | ||
428 | _PC_MAX_CANON, | |
429 | ||
430 | _PC_MAX_INPUT, | |
431 | ||
432 | _PC_NAME_MAX, | |
433 | ||
434 | _PC_PATH_MAX, | |
435 | ||
436 | _PC_PIPE_BUF, | |
437 | ||
438 | _PC_CHOWN_RESTRICTED, | |
439 | ||
440 | _PC_NO_TRUNC, | |
441 | ||
442 | _PC_VDISABLE, | |
443 | ||
444 | _PC_SYNC_IO, | |
445 | ||
446 | _PC_ASYNC_IO, | |
447 | ||
448 | _PC_PRIO_IO, | |
449 | ||
450 | _PC_SOCK_MAXBUF, | |
451 | ||
452 | _PC_FILESIZEBITS, | |
453 | ||
454 | _PC_REC_INCR_XFER_SIZE, | |
455 | ||
456 | _PC_REC_MAX_XFER_SIZE, | |
457 | ||
458 | _PC_REC_MIN_XFER_SIZE, | |
459 | ||
460 | _PC_REC_XFER_ALIGN, | |
461 | ||
462 | _PC_ALLOC_SIZE_MIN, | |
463 | ||
464 | _PC_SYMLINK_MAX, | |
465 | ||
466 | _PC_2_SYMLINKS | |
467 | ||
468 | }; | |
469 | ||
470 | ||
471 | enum | |
472 | { | |
473 | _SC_ARG_MAX, | |
474 | ||
475 | _SC_CHILD_MAX, | |
476 | ||
477 | _SC_CLK_TCK, | |
478 | ||
479 | _SC_NGROUPS_MAX, | |
480 | ||
481 | _SC_OPEN_MAX, | |
482 | ||
483 | _SC_STREAM_MAX, | |
484 | ||
485 | _SC_TZNAME_MAX, | |
486 | ||
487 | _SC_JOB_CONTROL, | |
488 | ||
489 | _SC_SAVED_IDS, | |
490 | ||
491 | _SC_REALTIME_SIGNALS, | |
492 | ||
493 | _SC_PRIORITY_SCHEDULING, | |
494 | ||
495 | _SC_TIMERS, | |
496 | ||
497 | _SC_ASYNCHRONOUS_IO, | |
498 | ||
499 | _SC_PRIORITIZED_IO, | |
500 | ||
501 | _SC_SYNCHRONIZED_IO, | |
502 | ||
503 | _SC_FSYNC, | |
504 | ||
505 | _SC_MAPPED_FILES, | |
506 | ||
507 | _SC_MEMLOCK, | |
508 | ||
509 | _SC_MEMLOCK_RANGE, | |
510 | ||
511 | _SC_MEMORY_PROTECTION, | |
512 | ||
513 | _SC_MESSAGE_PASSING, | |
514 | ||
515 | _SC_SEMAPHORES, | |
516 | ||
517 | _SC_SHARED_MEMORY_OBJECTS, | |
518 | ||
519 | _SC_AIO_LISTIO_MAX, | |
520 | ||
521 | _SC_AIO_MAX, | |
522 | ||
523 | _SC_AIO_PRIO_DELTA_MAX, | |
524 | ||
525 | _SC_DELAYTIMER_MAX, | |
526 | ||
527 | _SC_MQ_OPEN_MAX, | |
528 | ||
529 | _SC_MQ_PRIO_MAX, | |
530 | ||
531 | _SC_VERSION, | |
532 | ||
533 | _SC_PAGESIZE, | |
534 | ||
535 | ||
536 | _SC_RTSIG_MAX, | |
537 | ||
538 | _SC_SEM_NSEMS_MAX, | |
539 | ||
540 | _SC_SEM_VALUE_MAX, | |
541 | ||
542 | _SC_SIGQUEUE_MAX, | |
543 | ||
544 | _SC_TIMER_MAX, | |
545 | ||
546 | ||
547 | ||
548 | ||
549 | _SC_BC_BASE_MAX, | |
550 | ||
551 | _SC_BC_DIM_MAX, | |
552 | ||
553 | _SC_BC_SCALE_MAX, | |
554 | ||
555 | _SC_BC_STRING_MAX, | |
556 | ||
557 | _SC_COLL_WEIGHTS_MAX, | |
558 | ||
559 | _SC_EQUIV_CLASS_MAX, | |
560 | ||
561 | _SC_EXPR_NEST_MAX, | |
562 | ||
563 | _SC_LINE_MAX, | |
564 | ||
565 | _SC_RE_DUP_MAX, | |
566 | ||
567 | _SC_CHARCLASS_NAME_MAX, | |
568 | ||
569 | ||
570 | _SC_2_VERSION, | |
571 | ||
572 | _SC_2_C_BIND, | |
573 | ||
574 | _SC_2_C_DEV, | |
575 | ||
576 | _SC_2_FORT_DEV, | |
577 | ||
578 | _SC_2_FORT_RUN, | |
579 | ||
580 | _SC_2_SW_DEV, | |
581 | ||
582 | _SC_2_LOCALEDEF, | |
583 | ||
584 | ||
585 | _SC_PII, | |
586 | ||
587 | _SC_PII_XTI, | |
588 | ||
589 | _SC_PII_SOCKET, | |
590 | ||
591 | _SC_PII_INTERNET, | |
592 | ||
593 | _SC_PII_OSI, | |
594 | ||
595 | _SC_POLL, | |
596 | ||
597 | _SC_SELECT, | |
598 | ||
599 | _SC_UIO_MAXIOV, | |
600 | ||
601 | _SC_IOV_MAX = _SC_UIO_MAXIOV, | |
602 | ||
603 | _SC_PII_INTERNET_STREAM, | |
604 | ||
605 | _SC_PII_INTERNET_DGRAM, | |
606 | ||
607 | _SC_PII_OSI_COTS, | |
608 | ||
609 | _SC_PII_OSI_CLTS, | |
610 | ||
611 | _SC_PII_OSI_M, | |
612 | ||
613 | _SC_T_IOV_MAX, | |
614 | ||
615 | ||
616 | ||
617 | _SC_THREADS, | |
618 | ||
619 | _SC_THREAD_SAFE_FUNCTIONS, | |
620 | ||
621 | _SC_GETGR_R_SIZE_MAX, | |
622 | ||
623 | _SC_GETPW_R_SIZE_MAX, | |
624 | ||
625 | _SC_LOGIN_NAME_MAX, | |
626 | ||
627 | _SC_TTY_NAME_MAX, | |
628 | ||
629 | _SC_THREAD_DESTRUCTOR_ITERATIONS, | |
630 | ||
631 | _SC_THREAD_KEYS_MAX, | |
632 | ||
633 | _SC_THREAD_STACK_MIN, | |
634 | ||
635 | _SC_THREAD_THREADS_MAX, | |
636 | ||
637 | _SC_THREAD_ATTR_STACKADDR, | |
638 | ||
639 | _SC_THREAD_ATTR_STACKSIZE, | |
640 | ||
641 | _SC_THREAD_PRIORITY_SCHEDULING, | |
642 | ||
643 | _SC_THREAD_PRIO_INHERIT, | |
644 | ||
645 | _SC_THREAD_PRIO_PROTECT, | |
646 | ||
647 | _SC_THREAD_PROCESS_SHARED, | |
648 | ||
649 | ||
650 | _SC_NPROCESSORS_CONF, | |
651 | ||
652 | _SC_NPROCESSORS_ONLN, | |
653 | ||
654 | _SC_PHYS_PAGES, | |
655 | ||
656 | _SC_AVPHYS_PAGES, | |
657 | ||
658 | _SC_ATEXIT_MAX, | |
659 | ||
660 | _SC_PASS_MAX, | |
661 | ||
662 | ||
663 | _SC_XOPEN_VERSION, | |
664 | ||
665 | _SC_XOPEN_XCU_VERSION, | |
666 | ||
667 | _SC_XOPEN_UNIX, | |
668 | ||
669 | _SC_XOPEN_CRYPT, | |
670 | ||
671 | _SC_XOPEN_ENH_I18N, | |
672 | ||
673 | _SC_XOPEN_SHM, | |
674 | ||
675 | ||
676 | _SC_2_CHAR_TERM, | |
677 | ||
678 | _SC_2_C_VERSION, | |
679 | ||
680 | _SC_2_UPE, | |
681 | ||
682 | ||
683 | _SC_XOPEN_XPG2, | |
684 | ||
685 | _SC_XOPEN_XPG3, | |
686 | ||
687 | _SC_XOPEN_XPG4, | |
688 | ||
689 | ||
690 | _SC_CHAR_BIT, | |
691 | ||
692 | _SC_CHAR_MAX, | |
693 | ||
694 | _SC_CHAR_MIN, | |
695 | ||
696 | _SC_INT_MAX, | |
697 | ||
698 | _SC_INT_MIN, | |
699 | ||
700 | _SC_LONG_BIT, | |
701 | ||
702 | _SC_WORD_BIT, | |
703 | ||
704 | _SC_MB_LEN_MAX, | |
705 | ||
706 | _SC_NZERO, | |
707 | ||
708 | _SC_SSIZE_MAX, | |
709 | ||
710 | _SC_SCHAR_MAX, | |
711 | ||
712 | _SC_SCHAR_MIN, | |
713 | ||
714 | _SC_SHRT_MAX, | |
715 | ||
716 | _SC_SHRT_MIN, | |
717 | ||
718 | _SC_UCHAR_MAX, | |
719 | ||
720 | _SC_UINT_MAX, | |
721 | ||
722 | _SC_ULONG_MAX, | |
723 | ||
724 | _SC_USHRT_MAX, | |
725 | ||
726 | ||
727 | _SC_NL_ARGMAX, | |
728 | ||
729 | _SC_NL_LANGMAX, | |
730 | ||
731 | _SC_NL_MSGMAX, | |
732 | ||
733 | _SC_NL_NMAX, | |
734 | ||
735 | _SC_NL_SETMAX, | |
736 | ||
737 | _SC_NL_TEXTMAX, | |
738 | ||
739 | ||
740 | _SC_XBS5_ILP32_OFF32, | |
741 | ||
742 | _SC_XBS5_ILP32_OFFBIG, | |
743 | ||
744 | _SC_XBS5_LP64_OFF64, | |
745 | ||
746 | _SC_XBS5_LPBIG_OFFBIG, | |
747 | ||
748 | ||
749 | _SC_XOPEN_LEGACY, | |
750 | ||
751 | _SC_XOPEN_REALTIME, | |
752 | ||
753 | _SC_XOPEN_REALTIME_THREADS, | |
754 | ||
755 | ||
756 | _SC_ADVISORY_INFO, | |
757 | ||
758 | _SC_BARRIERS, | |
759 | ||
760 | _SC_BASE, | |
761 | ||
762 | _SC_C_LANG_SUPPORT, | |
763 | ||
764 | _SC_C_LANG_SUPPORT_R, | |
765 | ||
766 | _SC_CLOCK_SELECTION, | |
767 | ||
768 | _SC_CPUTIME, | |
769 | ||
770 | _SC_THREAD_CPUTIME, | |
771 | ||
772 | _SC_DEVICE_IO, | |
773 | ||
774 | _SC_DEVICE_SPECIFIC, | |
775 | ||
776 | _SC_DEVICE_SPECIFIC_R, | |
777 | ||
778 | _SC_FD_MGMT, | |
779 | ||
780 | _SC_FIFO, | |
781 | ||
782 | _SC_PIPE, | |
783 | ||
784 | _SC_FILE_ATTRIBUTES, | |
785 | ||
786 | _SC_FILE_LOCKING, | |
787 | ||
788 | _SC_FILE_SYSTEM, | |
789 | ||
790 | _SC_MONOTONIC_CLOCK, | |
791 | ||
792 | _SC_MULTI_PROCESS, | |
793 | ||
794 | _SC_SINGLE_PROCESS, | |
795 | ||
796 | _SC_NETWORKING, | |
797 | ||
798 | _SC_READER_WRITER_LOCKS, | |
799 | ||
800 | _SC_SPIN_LOCKS, | |
801 | ||
802 | _SC_REGEXP, | |
803 | ||
804 | _SC_REGEX_VERSION, | |
805 | ||
806 | _SC_SHELL, | |
807 | ||
808 | _SC_SIGNALS, | |
809 | ||
810 | _SC_SPAWN, | |
811 | ||
812 | _SC_SPORADIC_SERVER, | |
813 | ||
814 | _SC_THREAD_SPORADIC_SERVER, | |
815 | ||
816 | _SC_SYSTEM_DATABASE, | |
817 | ||
818 | _SC_SYSTEM_DATABASE_R, | |
819 | ||
820 | _SC_TIMEOUTS, | |
821 | ||
822 | _SC_TYPED_MEMORY_OBJECTS, | |
823 | ||
824 | _SC_USER_GROUPS, | |
825 | ||
826 | _SC_USER_GROUPS_R, | |
827 | ||
828 | _SC_2_PBS, | |
829 | ||
830 | _SC_2_PBS_ACCOUNTING, | |
831 | ||
832 | _SC_2_PBS_LOCATE, | |
833 | ||
834 | _SC_2_PBS_MESSAGE, | |
835 | ||
836 | _SC_2_PBS_TRACK, | |
837 | ||
838 | _SC_SYMLOOP_MAX, | |
839 | ||
840 | _SC_STREAMS, | |
841 | ||
842 | _SC_2_PBS_CHECKPOINT, | |
843 | ||
844 | ||
845 | _SC_V6_ILP32_OFF32, | |
846 | ||
847 | _SC_V6_ILP32_OFFBIG, | |
848 | ||
849 | _SC_V6_LP64_OFF64, | |
850 | ||
851 | _SC_V6_LPBIG_OFFBIG, | |
852 | ||
853 | ||
854 | _SC_HOST_NAME_MAX, | |
855 | ||
856 | _SC_TRACE, | |
857 | ||
858 | _SC_TRACE_EVENT_FILTER, | |
859 | ||
860 | _SC_TRACE_INHERIT, | |
861 | ||
862 | _SC_TRACE_LOG, | |
863 | ||
864 | ||
865 | _SC_LEVEL1_ICACHE_SIZE, | |
866 | ||
867 | _SC_LEVEL1_ICACHE_ASSOC, | |
868 | ||
869 | _SC_LEVEL1_ICACHE_LINESIZE, | |
870 | ||
871 | _SC_LEVEL1_DCACHE_SIZE, | |
872 | ||
873 | _SC_LEVEL1_DCACHE_ASSOC, | |
874 | ||
875 | _SC_LEVEL1_DCACHE_LINESIZE, | |
876 | ||
877 | _SC_LEVEL2_CACHE_SIZE, | |
878 | ||
879 | _SC_LEVEL2_CACHE_ASSOC, | |
880 | ||
881 | _SC_LEVEL2_CACHE_LINESIZE, | |
882 | ||
883 | _SC_LEVEL3_CACHE_SIZE, | |
884 | ||
885 | _SC_LEVEL3_CACHE_ASSOC, | |
886 | ||
887 | _SC_LEVEL3_CACHE_LINESIZE, | |
888 | ||
889 | _SC_LEVEL4_CACHE_SIZE, | |
890 | ||
891 | _SC_LEVEL4_CACHE_ASSOC, | |
892 | ||
893 | _SC_LEVEL4_CACHE_LINESIZE, | |
894 | ||
895 | ||
896 | ||
897 | _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, | |
898 | ||
899 | _SC_RAW_SOCKETS | |
900 | ||
901 | }; | |
902 | ||
903 | ||
904 | enum | |
905 | { | |
906 | _CS_PATH, | |
907 | ||
908 | ||
909 | _CS_V6_WIDTH_RESTRICTED_ENVS, | |
910 | ||
911 | ||
912 | _CS_GNU_LIBC_VERSION, | |
913 | ||
914 | _CS_GNU_LIBPTHREAD_VERSION, | |
915 | ||
916 | ||
917 | _CS_LFS_CFLAGS = 1000, | |
918 | ||
919 | _CS_LFS_LDFLAGS, | |
920 | ||
921 | _CS_LFS_LIBS, | |
922 | ||
923 | _CS_LFS_LINTFLAGS, | |
924 | ||
925 | _CS_LFS64_CFLAGS, | |
926 | ||
927 | _CS_LFS64_LDFLAGS, | |
928 | ||
929 | _CS_LFS64_LIBS, | |
930 | ||
931 | _CS_LFS64_LINTFLAGS, | |
932 | ||
933 | ||
934 | _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, | |
935 | ||
936 | _CS_XBS5_ILP32_OFF32_LDFLAGS, | |
937 | ||
938 | _CS_XBS5_ILP32_OFF32_LIBS, | |
939 | ||
940 | _CS_XBS5_ILP32_OFF32_LINTFLAGS, | |
941 | ||
942 | _CS_XBS5_ILP32_OFFBIG_CFLAGS, | |
943 | ||
944 | _CS_XBS5_ILP32_OFFBIG_LDFLAGS, | |
945 | ||
946 | _CS_XBS5_ILP32_OFFBIG_LIBS, | |
947 | ||
948 | _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, | |
949 | ||
950 | _CS_XBS5_LP64_OFF64_CFLAGS, | |
951 | ||
952 | _CS_XBS5_LP64_OFF64_LDFLAGS, | |
953 | ||
954 | _CS_XBS5_LP64_OFF64_LIBS, | |
955 | ||
956 | _CS_XBS5_LP64_OFF64_LINTFLAGS, | |
957 | ||
958 | _CS_XBS5_LPBIG_OFFBIG_CFLAGS, | |
959 | ||
960 | _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, | |
961 | ||
962 | _CS_XBS5_LPBIG_OFFBIG_LIBS, | |
963 | ||
964 | _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, | |
965 | ||
966 | ||
967 | _CS_POSIX_V6_ILP32_OFF32_CFLAGS, | |
968 | ||
969 | _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, | |
970 | ||
971 | _CS_POSIX_V6_ILP32_OFF32_LIBS, | |
972 | ||
973 | _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, | |
974 | ||
975 | _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, | |
976 | ||
977 | _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, | |
978 | ||
979 | _CS_POSIX_V6_ILP32_OFFBIG_LIBS, | |
980 | ||
981 | _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, | |
982 | ||
983 | _CS_POSIX_V6_LP64_OFF64_CFLAGS, | |
984 | ||
985 | _CS_POSIX_V6_LP64_OFF64_LDFLAGS, | |
986 | ||
987 | _CS_POSIX_V6_LP64_OFF64_LIBS, | |
988 | ||
989 | _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, | |
990 | ||
991 | _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, | |
992 | ||
993 | _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, | |
994 | ||
995 | _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, | |
996 | ||
997 | _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS | |
998 | ||
999 | }; | |
1000 | # 9 "/usr/include/bits/confname.h" 2 3 4 | |
1001 | # 553 "/usr/include/gentoo-multilib/ppc64/unistd.h" 2 3 4 | |
1002 | ||
1003 | ||
1004 | extern long int pathconf (__const char *__path, int __name) | |
1005 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
1006 | ||
1007 | ||
1008 | extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__)); | |
1009 | ||
1010 | ||
1011 | extern long int sysconf (int __name) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1012 | ||
1013 | ||
1014 | ||
1015 | extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__)); | |
1016 | ||
1017 | ||
1018 | ||
1019 | ||
1020 | extern __pid_t getpid (void) __attribute__ ((__nothrow__)); | |
1021 | ||
1022 | ||
1023 | extern __pid_t getppid (void) __attribute__ ((__nothrow__)); | |
1024 | ||
1025 | ||
1026 | ||
1027 | ||
1028 | extern __pid_t getpgrp (void) __attribute__ ((__nothrow__)); | |
1029 | # 589 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1030 | extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__)); | |
1031 | # 598 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1032 | extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__)); | |
1033 | # 615 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1034 | extern int setpgrp (void) __attribute__ ((__nothrow__)); | |
1035 | # 632 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1036 | extern __pid_t setsid (void) __attribute__ ((__nothrow__)); | |
1037 | ||
1038 | ||
1039 | ||
1040 | ||
1041 | ||
1042 | ||
1043 | ||
1044 | extern __uid_t getuid (void) __attribute__ ((__nothrow__)); | |
1045 | ||
1046 | ||
1047 | extern __uid_t geteuid (void) __attribute__ ((__nothrow__)); | |
1048 | ||
1049 | ||
1050 | extern __gid_t getgid (void) __attribute__ ((__nothrow__)); | |
1051 | ||
1052 | ||
1053 | extern __gid_t getegid (void) __attribute__ ((__nothrow__)); | |
1054 | ||
1055 | ||
1056 | ||
1057 | ||
1058 | extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__)) ; | |
1059 | # 665 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1060 | extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__)); | |
1061 | ||
1062 | ||
1063 | ||
1064 | ||
1065 | extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__)); | |
1066 | ||
1067 | ||
1068 | ||
1069 | ||
1070 | extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__)); | |
1071 | ||
1072 | ||
1073 | ||
1074 | ||
1075 | ||
1076 | ||
1077 | extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__)); | |
1078 | ||
1079 | ||
1080 | ||
1081 | ||
1082 | extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__)); | |
1083 | ||
1084 | ||
1085 | ||
1086 | ||
1087 | extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__)); | |
1088 | # 721 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1089 | extern __pid_t fork (void) __attribute__ ((__nothrow__)); | |
1090 | ||
1091 | ||
1092 | ||
1093 | ||
1094 | ||
1095 | ||
1096 | extern __pid_t vfork (void) __attribute__ ((__nothrow__)); | |
1097 | ||
1098 | ||
1099 | ||
1100 | ||
1101 | ||
1102 | extern char *ttyname (int __fd) __attribute__ ((__nothrow__)); | |
1103 | ||
1104 | ||
1105 | ||
1106 | extern int ttyname_r (int __fd, char *__buf, size_t __buflen) | |
1107 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) ; | |
1108 | ||
1109 | ||
1110 | ||
1111 | extern int isatty (int __fd) __attribute__ ((__nothrow__)); | |
1112 | ||
1113 | ||
1114 | ||
1115 | ||
1116 | ||
1117 | extern int ttyslot (void) __attribute__ ((__nothrow__)); | |
1118 | ||
1119 | ||
1120 | ||
1121 | ||
1122 | extern int link (__const char *__from, __const char *__to) | |
1123 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) ; | |
1124 | # 767 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1125 | extern int symlink (__const char *__from, __const char *__to) | |
1126 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) ; | |
1127 | ||
1128 | ||
1129 | ||
1130 | ||
1131 | extern ssize_t readlink (__const char *__restrict __path, | |
1132 | char *__restrict __buf, size_t __len) | |
1133 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) ; | |
1134 | # 790 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1135 | extern int unlink (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
1136 | # 799 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1137 | extern int rmdir (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
1138 | ||
1139 | ||
1140 | ||
1141 | extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__)); | |
1142 | ||
1143 | ||
1144 | extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__)); | |
1145 | ||
1146 | ||
1147 | ||
1148 | ||
1149 | ||
1150 | ||
1151 | extern char *getlogin (void); | |
1152 | ||
1153 | ||
1154 | ||
1155 | ||
1156 | ||
1157 | ||
1158 | ||
1159 | extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1))); | |
1160 | ||
1161 | ||
1162 | ||
1163 | ||
1164 | extern int setlogin (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
1165 | # 835 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1166 | # 1 "/usr/include/getopt.h" 1 3 4 | |
1167 | ||
1168 | ||
1169 | ||
1170 | ||
1171 | ||
1172 | ||
1173 | ||
1174 | # 1 "/usr/include/gentoo-multilib/ppc64/getopt.h" 1 3 4 | |
1175 | # 59 "/usr/include/gentoo-multilib/ppc64/getopt.h" 3 4 | |
1176 | extern char *optarg; | |
1177 | # 73 "/usr/include/gentoo-multilib/ppc64/getopt.h" 3 4 | |
1178 | extern int optind; | |
1179 | ||
1180 | ||
1181 | ||
1182 | ||
1183 | extern int opterr; | |
1184 | ||
1185 | ||
1186 | ||
1187 | extern int optopt; | |
1188 | # 152 "/usr/include/gentoo-multilib/ppc64/getopt.h" 3 4 | |
1189 | extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) | |
1190 | __attribute__ ((__nothrow__)); | |
1191 | # 9 "/usr/include/getopt.h" 2 3 4 | |
1192 | # 836 "/usr/include/gentoo-multilib/ppc64/unistd.h" 2 3 4 | |
1193 | ||
1194 | ||
1195 | ||
1196 | ||
1197 | ||
1198 | ||
1199 | ||
1200 | extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
1201 | ||
1202 | ||
1203 | ||
1204 | ||
1205 | ||
1206 | ||
1207 | extern int sethostname (__const char *__name, size_t __len) | |
1208 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
1209 | ||
1210 | ||
1211 | ||
1212 | extern int sethostid (long int __id) __attribute__ ((__nothrow__)) ; | |
1213 | ||
1214 | ||
1215 | ||
1216 | ||
1217 | ||
1218 | extern int getdomainname (char *__name, size_t __len) | |
1219 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
1220 | extern int setdomainname (__const char *__name, size_t __len) | |
1221 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
1222 | ||
1223 | ||
1224 | ||
1225 | ||
1226 | ||
1227 | extern int vhangup (void) __attribute__ ((__nothrow__)); | |
1228 | ||
1229 | ||
1230 | extern int revoke (__const char *__file) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
1231 | ||
1232 | ||
1233 | ||
1234 | ||
1235 | ||
1236 | ||
1237 | ||
1238 | extern int profil (unsigned short int *__sample_buffer, size_t __size, | |
1239 | size_t __offset, unsigned int __scale) | |
1240 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
1241 | ||
1242 | ||
1243 | ||
1244 | ||
1245 | ||
1246 | extern int acct (__const char *__name) __attribute__ ((__nothrow__)); | |
1247 | ||
1248 | ||
1249 | ||
1250 | extern char *getusershell (void) __attribute__ ((__nothrow__)); | |
1251 | extern void endusershell (void) __attribute__ ((__nothrow__)); | |
1252 | extern void setusershell (void) __attribute__ ((__nothrow__)); | |
1253 | ||
1254 | ||
1255 | ||
1256 | ||
1257 | ||
1258 | extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__)) ; | |
1259 | ||
1260 | ||
1261 | ||
1262 | ||
1263 | ||
1264 | ||
1265 | extern int chroot (__const char *__path) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
1266 | ||
1267 | ||
1268 | ||
1269 | extern char *getpass (__const char *__prompt) __attribute__ ((__nonnull__ (1))); | |
1270 | # 921 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1271 | extern int fsync (int __fd); | |
1272 | ||
1273 | ||
1274 | ||
1275 | ||
1276 | ||
1277 | ||
1278 | extern long int gethostid (void); | |
1279 | ||
1280 | ||
1281 | extern void sync (void) __attribute__ ((__nothrow__)); | |
1282 | ||
1283 | ||
1284 | ||
1285 | ||
1286 | extern int getpagesize (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1287 | ||
1288 | ||
1289 | ||
1290 | ||
1291 | extern int getdtablesize (void) __attribute__ ((__nothrow__)); | |
1292 | ||
1293 | ||
1294 | ||
1295 | ||
1296 | extern int truncate (__const char *__file, __off_t __length) | |
1297 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
1298 | # 968 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1299 | extern int ftruncate (int __fd, __off_t __length) __attribute__ ((__nothrow__)) ; | |
1300 | # 988 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1301 | extern int brk (void *__addr) __attribute__ ((__nothrow__)) ; | |
1302 | ||
1303 | ||
1304 | ||
1305 | ||
1306 | ||
1307 | extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__)); | |
1308 | # 1009 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1309 | extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__)); | |
1310 | # 1032 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1311 | extern int lockf (int __fd, int __cmd, __off_t __len) ; | |
1312 | # 1063 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1313 | extern int fdatasync (int __fildes) __attribute__ ((__nothrow__)); | |
1314 | # 1101 "/usr/include/gentoo-multilib/ppc64/unistd.h" 3 4 | |
1315 | ||
1316 | # 9 "/usr/include/unistd.h" 2 3 4 | |
1317 | # 30 "scheme.c" 2 | |
1318 | # 39 "scheme.c" | |
1319 | # 1 "/usr/include/math.h" 1 3 4 | |
1320 | ||
1321 | ||
1322 | ||
1323 | ||
1324 | ||
1325 | ||
1326 | ||
1327 | # 1 "/usr/include/gentoo-multilib/ppc64/math.h" 1 3 4 | |
1328 | # 28 "/usr/include/gentoo-multilib/ppc64/math.h" 3 4 | |
1329 | # 1 "/usr/include/features.h" 1 3 4 | |
1330 | # 29 "/usr/include/gentoo-multilib/ppc64/math.h" 2 3 4 | |
1331 | ||
1332 | ||
1333 | ||
1334 | ||
1335 | ||
1336 | # 1 "/usr/include/bits/huge_val.h" 1 3 4 | |
1337 | ||
1338 | ||
1339 | ||
1340 | ||
1341 | ||
1342 | ||
1343 | ||
1344 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/huge_val.h" 1 3 4 | |
1345 | # 9 "/usr/include/bits/huge_val.h" 2 3 4 | |
1346 | # 35 "/usr/include/gentoo-multilib/ppc64/math.h" 2 3 4 | |
1347 | # 47 "/usr/include/gentoo-multilib/ppc64/math.h" 3 4 | |
1348 | # 1 "/usr/include/bits/mathdef.h" 1 3 4 | |
1349 | ||
1350 | ||
1351 | ||
1352 | ||
1353 | ||
1354 | ||
1355 | ||
1356 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/mathdef.h" 1 3 4 | |
1357 | # 9 "/usr/include/bits/mathdef.h" 2 3 4 | |
1358 | # 48 "/usr/include/gentoo-multilib/ppc64/math.h" 2 3 4 | |
1359 | # 71 "/usr/include/gentoo-multilib/ppc64/math.h" 3 4 | |
1360 | # 1 "/usr/include/bits/mathcalls.h" 1 3 4 | |
1361 | ||
1362 | ||
1363 | ||
1364 | ||
1365 | ||
1366 | ||
1367 | ||
1368 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 1 3 4 | |
1369 | # 53 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1370 | ||
1371 | ||
1372 | extern double acos (double __x) __attribute__ ((__nothrow__)); extern double __acos (double __x) __attribute__ ((__nothrow__)); | |
1373 | ||
1374 | extern double asin (double __x) __attribute__ ((__nothrow__)); extern double __asin (double __x) __attribute__ ((__nothrow__)); | |
1375 | ||
1376 | extern double atan (double __x) __attribute__ ((__nothrow__)); extern double __atan (double __x) __attribute__ ((__nothrow__)); | |
1377 | ||
1378 | extern double atan2 (double __y, double __x) __attribute__ ((__nothrow__)); extern double __atan2 (double __y, double __x) __attribute__ ((__nothrow__)); | |
1379 | ||
1380 | ||
1381 | extern double cos (double __x) __attribute__ ((__nothrow__)); extern double __cos (double __x) __attribute__ ((__nothrow__)); | |
1382 | ||
1383 | extern double sin (double __x) __attribute__ ((__nothrow__)); extern double __sin (double __x) __attribute__ ((__nothrow__)); | |
1384 | ||
1385 | extern double tan (double __x) __attribute__ ((__nothrow__)); extern double __tan (double __x) __attribute__ ((__nothrow__)); | |
1386 | ||
1387 | ||
1388 | ||
1389 | ||
1390 | extern double cosh (double __x) __attribute__ ((__nothrow__)); extern double __cosh (double __x) __attribute__ ((__nothrow__)); | |
1391 | ||
1392 | extern double sinh (double __x) __attribute__ ((__nothrow__)); extern double __sinh (double __x) __attribute__ ((__nothrow__)); | |
1393 | ||
1394 | extern double tanh (double __x) __attribute__ ((__nothrow__)); extern double __tanh (double __x) __attribute__ ((__nothrow__)); | |
1395 | ||
1396 | # 87 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1397 | ||
1398 | ||
1399 | extern double acosh (double __x) __attribute__ ((__nothrow__)); extern double __acosh (double __x) __attribute__ ((__nothrow__)); | |
1400 | ||
1401 | extern double asinh (double __x) __attribute__ ((__nothrow__)); extern double __asinh (double __x) __attribute__ ((__nothrow__)); | |
1402 | ||
1403 | extern double atanh (double __x) __attribute__ ((__nothrow__)); extern double __atanh (double __x) __attribute__ ((__nothrow__)); | |
1404 | ||
1405 | ||
1406 | ||
1407 | ||
1408 | ||
1409 | ||
1410 | ||
1411 | extern double exp (double __x) __attribute__ ((__nothrow__)); extern double __exp (double __x) __attribute__ ((__nothrow__)); | |
1412 | ||
1413 | ||
1414 | extern double frexp (double __x, int *__exponent) __attribute__ ((__nothrow__)); extern double __frexp (double __x, int *__exponent) __attribute__ ((__nothrow__)); | |
1415 | ||
1416 | ||
1417 | extern double ldexp (double __x, int __exponent) __attribute__ ((__nothrow__)); extern double __ldexp (double __x, int __exponent) __attribute__ ((__nothrow__)); | |
1418 | ||
1419 | ||
1420 | extern double log (double __x) __attribute__ ((__nothrow__)); extern double __log (double __x) __attribute__ ((__nothrow__)); | |
1421 | ||
1422 | ||
1423 | extern double log10 (double __x) __attribute__ ((__nothrow__)); extern double __log10 (double __x) __attribute__ ((__nothrow__)); | |
1424 | ||
1425 | ||
1426 | extern double modf (double __x, double *__iptr) __attribute__ ((__nothrow__)); extern double __modf (double __x, double *__iptr) __attribute__ ((__nothrow__)); | |
1427 | ||
1428 | # 127 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1429 | ||
1430 | ||
1431 | extern double expm1 (double __x) __attribute__ ((__nothrow__)); extern double __expm1 (double __x) __attribute__ ((__nothrow__)); | |
1432 | ||
1433 | ||
1434 | extern double log1p (double __x) __attribute__ ((__nothrow__)); extern double __log1p (double __x) __attribute__ ((__nothrow__)); | |
1435 | ||
1436 | ||
1437 | extern double logb (double __x) __attribute__ ((__nothrow__)); extern double __logb (double __x) __attribute__ ((__nothrow__)); | |
1438 | ||
1439 | # 152 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1440 | ||
1441 | ||
1442 | extern double pow (double __x, double __y) __attribute__ ((__nothrow__)); extern double __pow (double __x, double __y) __attribute__ ((__nothrow__)); | |
1443 | ||
1444 | ||
1445 | extern double sqrt (double __x) __attribute__ ((__nothrow__)); extern double __sqrt (double __x) __attribute__ ((__nothrow__)); | |
1446 | ||
1447 | ||
1448 | ||
1449 | ||
1450 | ||
1451 | extern double hypot (double __x, double __y) __attribute__ ((__nothrow__)); extern double __hypot (double __x, double __y) __attribute__ ((__nothrow__)); | |
1452 | ||
1453 | ||
1454 | ||
1455 | ||
1456 | ||
1457 | ||
1458 | extern double cbrt (double __x) __attribute__ ((__nothrow__)); extern double __cbrt (double __x) __attribute__ ((__nothrow__)); | |
1459 | ||
1460 | ||
1461 | ||
1462 | ||
1463 | ||
1464 | ||
1465 | ||
1466 | ||
1467 | extern double ceil (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __ceil (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1468 | ||
1469 | ||
1470 | extern double fabs (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __fabs (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1471 | ||
1472 | ||
1473 | extern double floor (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __floor (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1474 | ||
1475 | ||
1476 | extern double fmod (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fmod (double __x, double __y) __attribute__ ((__nothrow__)); | |
1477 | ||
1478 | ||
1479 | ||
1480 | ||
1481 | extern int __isinf (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1482 | ||
1483 | ||
1484 | extern int __finite (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1485 | ||
1486 | ||
1487 | ||
1488 | ||
1489 | ||
1490 | extern int isinf (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1491 | ||
1492 | ||
1493 | extern int finite (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1494 | ||
1495 | ||
1496 | extern double drem (double __x, double __y) __attribute__ ((__nothrow__)); extern double __drem (double __x, double __y) __attribute__ ((__nothrow__)); | |
1497 | ||
1498 | ||
1499 | ||
1500 | extern double significand (double __x) __attribute__ ((__nothrow__)); extern double __significand (double __x) __attribute__ ((__nothrow__)); | |
1501 | ||
1502 | ||
1503 | ||
1504 | ||
1505 | ||
1506 | extern double copysign (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __copysign (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1507 | ||
1508 | # 231 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1509 | extern int __isnan (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1510 | ||
1511 | ||
1512 | ||
1513 | extern int isnan (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1514 | ||
1515 | ||
1516 | extern double j0 (double) __attribute__ ((__nothrow__)); extern double __j0 (double) __attribute__ ((__nothrow__)); | |
1517 | extern double j1 (double) __attribute__ ((__nothrow__)); extern double __j1 (double) __attribute__ ((__nothrow__)); | |
1518 | extern double jn (int, double) __attribute__ ((__nothrow__)); extern double __jn (int, double) __attribute__ ((__nothrow__)); | |
1519 | extern double y0 (double) __attribute__ ((__nothrow__)); extern double __y0 (double) __attribute__ ((__nothrow__)); | |
1520 | extern double y1 (double) __attribute__ ((__nothrow__)); extern double __y1 (double) __attribute__ ((__nothrow__)); | |
1521 | extern double yn (int, double) __attribute__ ((__nothrow__)); extern double __yn (int, double) __attribute__ ((__nothrow__)); | |
1522 | ||
1523 | ||
1524 | ||
1525 | ||
1526 | ||
1527 | ||
1528 | extern double erf (double) __attribute__ ((__nothrow__)); extern double __erf (double) __attribute__ ((__nothrow__)); | |
1529 | extern double erfc (double) __attribute__ ((__nothrow__)); extern double __erfc (double) __attribute__ ((__nothrow__)); | |
1530 | extern double lgamma (double) __attribute__ ((__nothrow__)); extern double __lgamma (double) __attribute__ ((__nothrow__)); | |
1531 | ||
1532 | # 265 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1533 | extern double gamma (double) __attribute__ ((__nothrow__)); extern double __gamma (double) __attribute__ ((__nothrow__)); | |
1534 | ||
1535 | ||
1536 | ||
1537 | ||
1538 | ||
1539 | ||
1540 | extern double lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__)); extern double __lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__)); | |
1541 | ||
1542 | ||
1543 | ||
1544 | ||
1545 | ||
1546 | ||
1547 | ||
1548 | extern double rint (double __x) __attribute__ ((__nothrow__)); extern double __rint (double __x) __attribute__ ((__nothrow__)); | |
1549 | ||
1550 | ||
1551 | extern double nextafter (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1552 | ||
1553 | ||
1554 | ||
1555 | ||
1556 | ||
1557 | extern double remainder (double __x, double __y) __attribute__ ((__nothrow__)); extern double __remainder (double __x, double __y) __attribute__ ((__nothrow__)); | |
1558 | ||
1559 | ||
1560 | ||
1561 | extern double scalbn (double __x, int __n) __attribute__ ((__nothrow__)); extern double __scalbn (double __x, int __n) __attribute__ ((__nothrow__)); | |
1562 | ||
1563 | ||
1564 | ||
1565 | extern int ilogb (double __x) __attribute__ ((__nothrow__)); extern int __ilogb (double __x) __attribute__ ((__nothrow__)); | |
1566 | # 359 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1567 | ||
1568 | ||
1569 | ||
1570 | ||
1571 | ||
1572 | extern double scalb (double __x, double __n) __attribute__ ((__nothrow__)); extern double __scalb (double __x, double __n) __attribute__ ((__nothrow__)); | |
1573 | # 9 "/usr/include/bits/mathcalls.h" 2 3 4 | |
1574 | # 72 "/usr/include/gentoo-multilib/ppc64/math.h" 2 3 4 | |
1575 | # 94 "/usr/include/gentoo-multilib/ppc64/math.h" 3 4 | |
1576 | # 1 "/usr/include/bits/mathcalls.h" 1 3 4 | |
1577 | ||
1578 | ||
1579 | ||
1580 | ||
1581 | ||
1582 | ||
1583 | ||
1584 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 1 3 4 | |
1585 | # 53 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1586 | ||
1587 | ||
1588 | extern float acosf (float __x) __attribute__ ((__nothrow__)); extern float __acosf (float __x) __attribute__ ((__nothrow__)); | |
1589 | ||
1590 | extern float asinf (float __x) __attribute__ ((__nothrow__)); extern float __asinf (float __x) __attribute__ ((__nothrow__)); | |
1591 | ||
1592 | extern float atanf (float __x) __attribute__ ((__nothrow__)); extern float __atanf (float __x) __attribute__ ((__nothrow__)); | |
1593 | ||
1594 | extern float atan2f (float __y, float __x) __attribute__ ((__nothrow__)); extern float __atan2f (float __y, float __x) __attribute__ ((__nothrow__)); | |
1595 | ||
1596 | ||
1597 | extern float cosf (float __x) __attribute__ ((__nothrow__)); extern float __cosf (float __x) __attribute__ ((__nothrow__)); | |
1598 | ||
1599 | extern float sinf (float __x) __attribute__ ((__nothrow__)); extern float __sinf (float __x) __attribute__ ((__nothrow__)); | |
1600 | ||
1601 | extern float tanf (float __x) __attribute__ ((__nothrow__)); extern float __tanf (float __x) __attribute__ ((__nothrow__)); | |
1602 | ||
1603 | ||
1604 | ||
1605 | ||
1606 | extern float coshf (float __x) __attribute__ ((__nothrow__)); extern float __coshf (float __x) __attribute__ ((__nothrow__)); | |
1607 | ||
1608 | extern float sinhf (float __x) __attribute__ ((__nothrow__)); extern float __sinhf (float __x) __attribute__ ((__nothrow__)); | |
1609 | ||
1610 | extern float tanhf (float __x) __attribute__ ((__nothrow__)); extern float __tanhf (float __x) __attribute__ ((__nothrow__)); | |
1611 | ||
1612 | # 87 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1613 | ||
1614 | ||
1615 | extern float acoshf (float __x) __attribute__ ((__nothrow__)); extern float __acoshf (float __x) __attribute__ ((__nothrow__)); | |
1616 | ||
1617 | extern float asinhf (float __x) __attribute__ ((__nothrow__)); extern float __asinhf (float __x) __attribute__ ((__nothrow__)); | |
1618 | ||
1619 | extern float atanhf (float __x) __attribute__ ((__nothrow__)); extern float __atanhf (float __x) __attribute__ ((__nothrow__)); | |
1620 | ||
1621 | ||
1622 | ||
1623 | ||
1624 | ||
1625 | ||
1626 | ||
1627 | extern float expf (float __x) __attribute__ ((__nothrow__)); extern float __expf (float __x) __attribute__ ((__nothrow__)); | |
1628 | ||
1629 | ||
1630 | extern float frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__)); extern float __frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__)); | |
1631 | ||
1632 | ||
1633 | extern float ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__)); extern float __ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__)); | |
1634 | ||
1635 | ||
1636 | extern float logf (float __x) __attribute__ ((__nothrow__)); extern float __logf (float __x) __attribute__ ((__nothrow__)); | |
1637 | ||
1638 | ||
1639 | extern float log10f (float __x) __attribute__ ((__nothrow__)); extern float __log10f (float __x) __attribute__ ((__nothrow__)); | |
1640 | ||
1641 | ||
1642 | extern float modff (float __x, float *__iptr) __attribute__ ((__nothrow__)); extern float __modff (float __x, float *__iptr) __attribute__ ((__nothrow__)); | |
1643 | ||
1644 | # 127 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1645 | ||
1646 | ||
1647 | extern float expm1f (float __x) __attribute__ ((__nothrow__)); extern float __expm1f (float __x) __attribute__ ((__nothrow__)); | |
1648 | ||
1649 | ||
1650 | extern float log1pf (float __x) __attribute__ ((__nothrow__)); extern float __log1pf (float __x) __attribute__ ((__nothrow__)); | |
1651 | ||
1652 | ||
1653 | extern float logbf (float __x) __attribute__ ((__nothrow__)); extern float __logbf (float __x) __attribute__ ((__nothrow__)); | |
1654 | ||
1655 | # 152 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1656 | ||
1657 | ||
1658 | extern float powf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __powf (float __x, float __y) __attribute__ ((__nothrow__)); | |
1659 | ||
1660 | ||
1661 | extern float sqrtf (float __x) __attribute__ ((__nothrow__)); extern float __sqrtf (float __x) __attribute__ ((__nothrow__)); | |
1662 | ||
1663 | ||
1664 | ||
1665 | ||
1666 | ||
1667 | extern float hypotf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __hypotf (float __x, float __y) __attribute__ ((__nothrow__)); | |
1668 | ||
1669 | ||
1670 | ||
1671 | ||
1672 | ||
1673 | ||
1674 | extern float cbrtf (float __x) __attribute__ ((__nothrow__)); extern float __cbrtf (float __x) __attribute__ ((__nothrow__)); | |
1675 | ||
1676 | ||
1677 | ||
1678 | ||
1679 | ||
1680 | ||
1681 | ||
1682 | ||
1683 | extern float ceilf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __ceilf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1684 | ||
1685 | ||
1686 | extern float fabsf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __fabsf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1687 | ||
1688 | ||
1689 | extern float floorf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __floorf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1690 | ||
1691 | ||
1692 | extern float fmodf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fmodf (float __x, float __y) __attribute__ ((__nothrow__)); | |
1693 | ||
1694 | ||
1695 | ||
1696 | ||
1697 | extern int __isinff (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1698 | ||
1699 | ||
1700 | extern int __finitef (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1701 | ||
1702 | ||
1703 | ||
1704 | ||
1705 | ||
1706 | extern int isinff (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1707 | ||
1708 | ||
1709 | extern int finitef (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1710 | ||
1711 | ||
1712 | extern float dremf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __dremf (float __x, float __y) __attribute__ ((__nothrow__)); | |
1713 | ||
1714 | ||
1715 | ||
1716 | extern float significandf (float __x) __attribute__ ((__nothrow__)); extern float __significandf (float __x) __attribute__ ((__nothrow__)); | |
1717 | ||
1718 | ||
1719 | ||
1720 | ||
1721 | ||
1722 | extern float copysignf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1723 | ||
1724 | # 231 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1725 | extern int __isnanf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1726 | ||
1727 | ||
1728 | ||
1729 | extern int isnanf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1730 | ||
1731 | ||
1732 | extern float j0f (float) __attribute__ ((__nothrow__)); extern float __j0f (float) __attribute__ ((__nothrow__)); | |
1733 | extern float j1f (float) __attribute__ ((__nothrow__)); extern float __j1f (float) __attribute__ ((__nothrow__)); | |
1734 | extern float jnf (int, float) __attribute__ ((__nothrow__)); extern float __jnf (int, float) __attribute__ ((__nothrow__)); | |
1735 | extern float y0f (float) __attribute__ ((__nothrow__)); extern float __y0f (float) __attribute__ ((__nothrow__)); | |
1736 | extern float y1f (float) __attribute__ ((__nothrow__)); extern float __y1f (float) __attribute__ ((__nothrow__)); | |
1737 | extern float ynf (int, float) __attribute__ ((__nothrow__)); extern float __ynf (int, float) __attribute__ ((__nothrow__)); | |
1738 | ||
1739 | ||
1740 | ||
1741 | ||
1742 | ||
1743 | ||
1744 | extern float erff (float) __attribute__ ((__nothrow__)); extern float __erff (float) __attribute__ ((__nothrow__)); | |
1745 | extern float erfcf (float) __attribute__ ((__nothrow__)); extern float __erfcf (float) __attribute__ ((__nothrow__)); | |
1746 | extern float lgammaf (float) __attribute__ ((__nothrow__)); extern float __lgammaf (float) __attribute__ ((__nothrow__)); | |
1747 | ||
1748 | # 265 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1749 | extern float gammaf (float) __attribute__ ((__nothrow__)); extern float __gammaf (float) __attribute__ ((__nothrow__)); | |
1750 | ||
1751 | ||
1752 | ||
1753 | ||
1754 | ||
1755 | ||
1756 | extern float lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__)); extern float __lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__)); | |
1757 | ||
1758 | ||
1759 | ||
1760 | ||
1761 | ||
1762 | ||
1763 | ||
1764 | extern float rintf (float __x) __attribute__ ((__nothrow__)); extern float __rintf (float __x) __attribute__ ((__nothrow__)); | |
1765 | ||
1766 | ||
1767 | extern float nextafterf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1768 | ||
1769 | ||
1770 | ||
1771 | ||
1772 | ||
1773 | extern float remainderf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __remainderf (float __x, float __y) __attribute__ ((__nothrow__)); | |
1774 | ||
1775 | ||
1776 | ||
1777 | extern float scalbnf (float __x, int __n) __attribute__ ((__nothrow__)); extern float __scalbnf (float __x, int __n) __attribute__ ((__nothrow__)); | |
1778 | ||
1779 | ||
1780 | ||
1781 | extern int ilogbf (float __x) __attribute__ ((__nothrow__)); extern int __ilogbf (float __x) __attribute__ ((__nothrow__)); | |
1782 | # 359 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1783 | ||
1784 | ||
1785 | ||
1786 | ||
1787 | ||
1788 | extern float scalbf (float __x, float __n) __attribute__ ((__nothrow__)); extern float __scalbf (float __x, float __n) __attribute__ ((__nothrow__)); | |
1789 | # 9 "/usr/include/bits/mathcalls.h" 2 3 4 | |
1790 | # 95 "/usr/include/gentoo-multilib/ppc64/math.h" 2 3 4 | |
1791 | # 141 "/usr/include/gentoo-multilib/ppc64/math.h" 3 4 | |
1792 | # 1 "/usr/include/bits/mathcalls.h" 1 3 4 | |
1793 | ||
1794 | ||
1795 | ||
1796 | ||
1797 | ||
1798 | ||
1799 | ||
1800 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 1 3 4 | |
1801 | # 53 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1802 | ||
1803 | ||
1804 | extern long double acosl (long double __x) __asm__ ("" "acos") __attribute__ ((__nothrow__)); extern long double __acosl (long double __x) __asm__ ("" "__acos") __attribute__ ((__nothrow__)); | |
1805 | ||
1806 | extern long double asinl (long double __x) __asm__ ("" "asin") __attribute__ ((__nothrow__)); extern long double __asinl (long double __x) __asm__ ("" "__asin") __attribute__ ((__nothrow__)); | |
1807 | ||
1808 | extern long double atanl (long double __x) __asm__ ("" "atan") __attribute__ ((__nothrow__)); extern long double __atanl (long double __x) __asm__ ("" "__atan") __attribute__ ((__nothrow__)); | |
1809 | ||
1810 | extern long double atan2l (long double __y, long double __x) __asm__ ("" "atan2") __attribute__ ((__nothrow__)); extern long double __atan2l (long double __y, long double __x) __asm__ ("" "__atan2") __attribute__ ((__nothrow__)); | |
1811 | ||
1812 | ||
1813 | extern long double cosl (long double __x) __asm__ ("" "cos") __attribute__ ((__nothrow__)); extern long double __cosl (long double __x) __asm__ ("" "__cos") __attribute__ ((__nothrow__)); | |
1814 | ||
1815 | extern long double sinl (long double __x) __asm__ ("" "sin") __attribute__ ((__nothrow__)); extern long double __sinl (long double __x) __asm__ ("" "__sin") __attribute__ ((__nothrow__)); | |
1816 | ||
1817 | extern long double tanl (long double __x) __asm__ ("" "tan") __attribute__ ((__nothrow__)); extern long double __tanl (long double __x) __asm__ ("" "__tan") __attribute__ ((__nothrow__)); | |
1818 | ||
1819 | ||
1820 | ||
1821 | ||
1822 | extern long double coshl (long double __x) __asm__ ("" "cosh") __attribute__ ((__nothrow__)); extern long double __coshl (long double __x) __asm__ ("" "__cosh") __attribute__ ((__nothrow__)); | |
1823 | ||
1824 | extern long double sinhl (long double __x) __asm__ ("" "sinh") __attribute__ ((__nothrow__)); extern long double __sinhl (long double __x) __asm__ ("" "__sinh") __attribute__ ((__nothrow__)); | |
1825 | ||
1826 | extern long double tanhl (long double __x) __asm__ ("" "tanh") __attribute__ ((__nothrow__)); extern long double __tanhl (long double __x) __asm__ ("" "__tanh") __attribute__ ((__nothrow__)); | |
1827 | ||
1828 | # 87 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1829 | ||
1830 | ||
1831 | extern long double acoshl (long double __x) __asm__ ("" "acosh") __attribute__ ((__nothrow__)); extern long double __acoshl (long double __x) __asm__ ("" "__acosh") __attribute__ ((__nothrow__)); | |
1832 | ||
1833 | extern long double asinhl (long double __x) __asm__ ("" "asinh") __attribute__ ((__nothrow__)); extern long double __asinhl (long double __x) __asm__ ("" "__asinh") __attribute__ ((__nothrow__)); | |
1834 | ||
1835 | extern long double atanhl (long double __x) __asm__ ("" "atanh") __attribute__ ((__nothrow__)); extern long double __atanhl (long double __x) __asm__ ("" "__atanh") __attribute__ ((__nothrow__)); | |
1836 | ||
1837 | ||
1838 | ||
1839 | ||
1840 | ||
1841 | ||
1842 | ||
1843 | extern long double expl (long double __x) __asm__ ("" "exp") __attribute__ ((__nothrow__)); extern long double __expl (long double __x) __asm__ ("" "__exp") __attribute__ ((__nothrow__)); | |
1844 | ||
1845 | ||
1846 | extern long double frexpl (long double __x, int *__exponent) __asm__ ("" "frexp") __attribute__ ((__nothrow__)); extern long double __frexpl (long double __x, int *__exponent) __asm__ ("" "__frexp") __attribute__ ((__nothrow__)); | |
1847 | ||
1848 | ||
1849 | extern long double ldexpl (long double __x, int __exponent) __asm__ ("" "ldexp") __attribute__ ((__nothrow__)); extern long double __ldexpl (long double __x, int __exponent) __asm__ ("" "__ldexp") __attribute__ ((__nothrow__)); | |
1850 | ||
1851 | ||
1852 | extern long double logl (long double __x) __asm__ ("" "log") __attribute__ ((__nothrow__)); extern long double __logl (long double __x) __asm__ ("" "__log") __attribute__ ((__nothrow__)); | |
1853 | ||
1854 | ||
1855 | extern long double log10l (long double __x) __asm__ ("" "log10") __attribute__ ((__nothrow__)); extern long double __log10l (long double __x) __asm__ ("" "__log10") __attribute__ ((__nothrow__)); | |
1856 | ||
1857 | ||
1858 | extern long double modfl (long double __x, long double *__iptr) __asm__ ("" "modf") __attribute__ ((__nothrow__)); extern long double __modfl (long double __x, long double *__iptr) __asm__ ("" "__modf") __attribute__ ((__nothrow__)); | |
1859 | ||
1860 | # 127 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1861 | ||
1862 | ||
1863 | extern long double expm1l (long double __x) __asm__ ("" "expm1") __attribute__ ((__nothrow__)); extern long double __expm1l (long double __x) __asm__ ("" "__expm1") __attribute__ ((__nothrow__)); | |
1864 | ||
1865 | ||
1866 | extern long double log1pl (long double __x) __asm__ ("" "log1p") __attribute__ ((__nothrow__)); extern long double __log1pl (long double __x) __asm__ ("" "__log1p") __attribute__ ((__nothrow__)); | |
1867 | ||
1868 | ||
1869 | extern long double logbl (long double __x) __asm__ ("" "logb") __attribute__ ((__nothrow__)); extern long double __logbl (long double __x) __asm__ ("" "__logb") __attribute__ ((__nothrow__)); | |
1870 | ||
1871 | # 152 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1872 | ||
1873 | ||
1874 | extern long double powl (long double __x, long double __y) __asm__ ("" "pow") __attribute__ ((__nothrow__)); extern long double __powl (long double __x, long double __y) __asm__ ("" "__pow") __attribute__ ((__nothrow__)); | |
1875 | ||
1876 | ||
1877 | extern long double sqrtl (long double __x) __asm__ ("" "sqrt") __attribute__ ((__nothrow__)); extern long double __sqrtl (long double __x) __asm__ ("" "__sqrt") __attribute__ ((__nothrow__)); | |
1878 | ||
1879 | ||
1880 | ||
1881 | ||
1882 | ||
1883 | extern long double hypotl (long double __x, long double __y) __asm__ ("" "hypot") __attribute__ ((__nothrow__)); extern long double __hypotl (long double __x, long double __y) __asm__ ("" "__hypot") __attribute__ ((__nothrow__)); | |
1884 | ||
1885 | ||
1886 | ||
1887 | ||
1888 | ||
1889 | ||
1890 | extern long double cbrtl (long double __x) __asm__ ("" "cbrt") __attribute__ ((__nothrow__)); extern long double __cbrtl (long double __x) __asm__ ("" "__cbrt") __attribute__ ((__nothrow__)); | |
1891 | ||
1892 | ||
1893 | ||
1894 | ||
1895 | ||
1896 | ||
1897 | ||
1898 | ||
1899 | extern long double ceill (long double __x) __asm__ ("" "ceil") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __ceill (long double __x) __asm__ ("" "__ceil") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1900 | ||
1901 | ||
1902 | extern long double fabsl (long double __x) __asm__ ("" "fabs") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __fabsl (long double __x) __asm__ ("" "__fabs") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1903 | ||
1904 | ||
1905 | extern long double floorl (long double __x) __asm__ ("" "floor") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __floorl (long double __x) __asm__ ("" "__floor") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1906 | ||
1907 | ||
1908 | extern long double fmodl (long double __x, long double __y) __asm__ ("" "fmod") __attribute__ ((__nothrow__)); extern long double __fmodl (long double __x, long double __y) __asm__ ("" "__fmod") __attribute__ ((__nothrow__)); | |
1909 | ||
1910 | ||
1911 | ||
1912 | ||
1913 | extern int __isinfl (long double __value) __asm__ ("" "__isinf") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1914 | ||
1915 | ||
1916 | extern int __finitel (long double __value) __asm__ ("" "__finite") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1917 | ||
1918 | ||
1919 | ||
1920 | ||
1921 | ||
1922 | extern int isinfl (long double __value) __asm__ ("" "isinf") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1923 | ||
1924 | ||
1925 | extern int finitel (long double __value) __asm__ ("" "finite") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1926 | ||
1927 | ||
1928 | extern long double dreml (long double __x, long double __y) __asm__ ("" "drem") __attribute__ ((__nothrow__)); extern long double __dreml (long double __x, long double __y) __asm__ ("" "__drem") __attribute__ ((__nothrow__)); | |
1929 | ||
1930 | ||
1931 | ||
1932 | extern long double significandl (long double __x) __asm__ ("" "significand") __attribute__ ((__nothrow__)); extern long double __significandl (long double __x) __asm__ ("" "__significand") __attribute__ ((__nothrow__)); | |
1933 | ||
1934 | ||
1935 | ||
1936 | ||
1937 | ||
1938 | extern long double copysignl (long double __x, long double __y) __asm__ ("" "copysign") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) __asm__ ("" "__copysign") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1939 | ||
1940 | # 231 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1941 | extern int __isnanl (long double __value) __asm__ ("" "__isnan") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1942 | ||
1943 | ||
1944 | ||
1945 | extern int isnanl (long double __value) __asm__ ("" "isnan") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1946 | ||
1947 | ||
1948 | extern long double j0l (long double) __asm__ ("" "j0") __attribute__ ((__nothrow__)); extern long double __j0l (long double) __asm__ ("" "__j0") __attribute__ ((__nothrow__)); | |
1949 | extern long double j1l (long double) __asm__ ("" "j1") __attribute__ ((__nothrow__)); extern long double __j1l (long double) __asm__ ("" "__j1") __attribute__ ((__nothrow__)); | |
1950 | extern long double jnl (int, long double) __asm__ ("" "jn") __attribute__ ((__nothrow__)); extern long double __jnl (int, long double) __asm__ ("" "__jn") __attribute__ ((__nothrow__)); | |
1951 | extern long double y0l (long double) __asm__ ("" "y0") __attribute__ ((__nothrow__)); extern long double __y0l (long double) __asm__ ("" "__y0") __attribute__ ((__nothrow__)); | |
1952 | extern long double y1l (long double) __asm__ ("" "y1") __attribute__ ((__nothrow__)); extern long double __y1l (long double) __asm__ ("" "__y1") __attribute__ ((__nothrow__)); | |
1953 | extern long double ynl (int, long double) __asm__ ("" "yn") __attribute__ ((__nothrow__)); extern long double __ynl (int, long double) __asm__ ("" "__yn") __attribute__ ((__nothrow__)); | |
1954 | ||
1955 | ||
1956 | ||
1957 | ||
1958 | ||
1959 | ||
1960 | extern long double erfl (long double) __asm__ ("" "erf") __attribute__ ((__nothrow__)); extern long double __erfl (long double) __asm__ ("" "__erf") __attribute__ ((__nothrow__)); | |
1961 | extern long double erfcl (long double) __asm__ ("" "erfc") __attribute__ ((__nothrow__)); extern long double __erfcl (long double) __asm__ ("" "__erfc") __attribute__ ((__nothrow__)); | |
1962 | extern long double lgammal (long double) __asm__ ("" "lgamma") __attribute__ ((__nothrow__)); extern long double __lgammal (long double) __asm__ ("" "__lgamma") __attribute__ ((__nothrow__)); | |
1963 | ||
1964 | # 265 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1965 | extern long double gammal (long double) __asm__ ("" "gamma") __attribute__ ((__nothrow__)); extern long double __gammal (long double) __asm__ ("" "__gamma") __attribute__ ((__nothrow__)); | |
1966 | ||
1967 | ||
1968 | ||
1969 | ||
1970 | ||
1971 | ||
1972 | extern long double lgammal_r (long double, int *__signgamp) __asm__ ("" "lgamma_r") __attribute__ ((__nothrow__)); extern long double __lgammal_r (long double, int *__signgamp) __asm__ ("" "__lgamma_r") __attribute__ ((__nothrow__)); | |
1973 | ||
1974 | ||
1975 | ||
1976 | ||
1977 | ||
1978 | ||
1979 | ||
1980 | extern long double rintl (long double __x) __asm__ ("" "rint") __attribute__ ((__nothrow__)); extern long double __rintl (long double __x) __asm__ ("" "__rint") __attribute__ ((__nothrow__)); | |
1981 | ||
1982 | ||
1983 | extern long double nextafterl (long double __x, long double __y) __asm__ ("" "nextafter") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) __asm__ ("" "__nextafter") __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
1984 | ||
1985 | ||
1986 | ||
1987 | ||
1988 | ||
1989 | extern long double remainderl (long double __x, long double __y) __asm__ ("" "remainder") __attribute__ ((__nothrow__)); extern long double __remainderl (long double __x, long double __y) __asm__ ("" "__remainder") __attribute__ ((__nothrow__)); | |
1990 | ||
1991 | ||
1992 | ||
1993 | extern long double scalbnl (long double __x, int __n) __asm__ ("" "scalbn") __attribute__ ((__nothrow__)); extern long double __scalbnl (long double __x, int __n) __asm__ ("" "__scalbn") __attribute__ ((__nothrow__)); | |
1994 | ||
1995 | ||
1996 | ||
1997 | extern int ilogbl (long double __x) __asm__ ("" "ilogb") __attribute__ ((__nothrow__)); extern int __ilogbl (long double __x) __asm__ ("" "__ilogb") __attribute__ ((__nothrow__)); | |
1998 | # 359 "/usr/include/gentoo-multilib/ppc64/bits/mathcalls.h" 3 4 | |
1999 | ||
2000 | ||
2001 | ||
2002 | ||
2003 | ||
2004 | extern long double scalbl (long double __x, long double __n) __asm__ ("" "scalb") __attribute__ ((__nothrow__)); extern long double __scalbl (long double __x, long double __n) __asm__ ("" "__scalb") __attribute__ ((__nothrow__)); | |
2005 | # 9 "/usr/include/bits/mathcalls.h" 2 3 4 | |
2006 | # 142 "/usr/include/gentoo-multilib/ppc64/math.h" 2 3 4 | |
2007 | # 157 "/usr/include/gentoo-multilib/ppc64/math.h" 3 4 | |
2008 | extern int signgam; | |
2009 | # 284 "/usr/include/gentoo-multilib/ppc64/math.h" 3 4 | |
2010 | typedef enum | |
2011 | { | |
2012 | _IEEE_ = -1, | |
2013 | _SVID_, | |
2014 | _XOPEN_, | |
2015 | _POSIX_, | |
2016 | _ISOC_ | |
2017 | } _LIB_VERSION_TYPE; | |
2018 | ||
2019 | ||
2020 | ||
2021 | ||
2022 | extern _LIB_VERSION_TYPE _LIB_VERSION; | |
2023 | # 309 "/usr/include/gentoo-multilib/ppc64/math.h" 3 4 | |
2024 | struct exception | |
2025 | ||
2026 | { | |
2027 | int type; | |
2028 | char *name; | |
2029 | double arg1; | |
2030 | double arg2; | |
2031 | double retval; | |
2032 | }; | |
2033 | ||
2034 | ||
2035 | ||
2036 | ||
2037 | extern int matherr (struct exception *__exc); | |
2038 | # 409 "/usr/include/gentoo-multilib/ppc64/math.h" 3 4 | |
2039 | # 1 "/usr/include/bits/mathinline.h" 1 3 4 | |
2040 | ||
2041 | ||
2042 | ||
2043 | ||
2044 | ||
2045 | ||
2046 | ||
2047 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/mathinline.h" 1 3 4 | |
2048 | # 9 "/usr/include/bits/mathinline.h" 2 3 4 | |
2049 | # 410 "/usr/include/gentoo-multilib/ppc64/math.h" 2 3 4 | |
2050 | # 465 "/usr/include/gentoo-multilib/ppc64/math.h" 3 4 | |
2051 | ||
2052 | # 9 "/usr/include/math.h" 2 3 4 | |
2053 | # 40 "scheme.c" 2 | |
2054 | ||
2055 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/limits.h" 1 3 4 | |
2056 | # 11 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/limits.h" 3 4 | |
2057 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/syslimits.h" 1 3 4 | |
2058 | ||
2059 | ||
2060 | ||
2061 | ||
2062 | ||
2063 | ||
2064 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/limits.h" 1 3 4 | |
2065 | # 122 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/limits.h" 3 4 | |
2066 | # 1 "/usr/include/limits.h" 1 3 4 | |
2067 | ||
2068 | ||
2069 | ||
2070 | ||
2071 | ||
2072 | ||
2073 | ||
2074 | # 1 "/usr/include/gentoo-multilib/ppc64/limits.h" 1 3 4 | |
2075 | # 27 "/usr/include/gentoo-multilib/ppc64/limits.h" 3 4 | |
2076 | # 1 "/usr/include/features.h" 1 3 4 | |
2077 | # 28 "/usr/include/gentoo-multilib/ppc64/limits.h" 2 3 4 | |
2078 | # 145 "/usr/include/gentoo-multilib/ppc64/limits.h" 3 4 | |
2079 | # 1 "/usr/include/bits/posix1_lim.h" 1 3 4 | |
2080 | ||
2081 | ||
2082 | ||
2083 | ||
2084 | ||
2085 | ||
2086 | ||
2087 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/posix1_lim.h" 1 3 4 | |
2088 | # 153 "/usr/include/gentoo-multilib/ppc64/bits/posix1_lim.h" 3 4 | |
2089 | # 1 "/usr/include/bits/local_lim.h" 1 3 4 | |
2090 | ||
2091 | ||
2092 | ||
2093 | ||
2094 | ||
2095 | ||
2096 | ||
2097 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/local_lim.h" 1 3 4 | |
2098 | # 36 "/usr/include/gentoo-multilib/ppc64/bits/local_lim.h" 3 4 | |
2099 | # 1 "/usr/include/linux/limits.h" 1 3 4 | |
2100 | # 37 "/usr/include/gentoo-multilib/ppc64/bits/local_lim.h" 2 3 4 | |
2101 | # 9 "/usr/include/bits/local_lim.h" 2 3 4 | |
2102 | # 154 "/usr/include/gentoo-multilib/ppc64/bits/posix1_lim.h" 2 3 4 | |
2103 | # 9 "/usr/include/bits/posix1_lim.h" 2 3 4 | |
2104 | # 146 "/usr/include/gentoo-multilib/ppc64/limits.h" 2 3 4 | |
2105 | ||
2106 | ||
2107 | ||
2108 | # 1 "/usr/include/bits/posix2_lim.h" 1 3 4 | |
2109 | ||
2110 | ||
2111 | ||
2112 | ||
2113 | ||
2114 | ||
2115 | ||
2116 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/posix2_lim.h" 1 3 4 | |
2117 | # 9 "/usr/include/bits/posix2_lim.h" 2 3 4 | |
2118 | # 150 "/usr/include/gentoo-multilib/ppc64/limits.h" 2 3 4 | |
2119 | # 9 "/usr/include/limits.h" 2 3 4 | |
2120 | # 123 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/limits.h" 2 3 4 | |
2121 | # 8 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/syslimits.h" 2 3 4 | |
2122 | # 12 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/limits.h" 2 3 4 | |
2123 | # 42 "scheme.c" 2 | |
2124 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/float.h" 1 3 4 | |
2125 | # 43 "scheme.c" 2 | |
2126 | # 1 "/usr/include/ctype.h" 1 3 4 | |
2127 | ||
2128 | ||
2129 | ||
2130 | ||
2131 | ||
2132 | ||
2133 | ||
2134 | # 1 "/usr/include/gentoo-multilib/ppc64/ctype.h" 1 3 4 | |
2135 | # 27 "/usr/include/gentoo-multilib/ppc64/ctype.h" 3 4 | |
2136 | # 1 "/usr/include/features.h" 1 3 4 | |
2137 | # 28 "/usr/include/gentoo-multilib/ppc64/ctype.h" 2 3 4 | |
2138 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
2139 | # 29 "/usr/include/gentoo-multilib/ppc64/ctype.h" 2 3 4 | |
2140 | ||
2141 | ||
2142 | # 41 "/usr/include/gentoo-multilib/ppc64/ctype.h" 3 4 | |
2143 | # 1 "/usr/include/endian.h" 1 3 4 | |
2144 | ||
2145 | ||
2146 | ||
2147 | ||
2148 | ||
2149 | ||
2150 | ||
2151 | # 1 "/usr/include/gentoo-multilib/ppc64/endian.h" 1 3 4 | |
2152 | # 22 "/usr/include/gentoo-multilib/ppc64/endian.h" 3 4 | |
2153 | # 1 "/usr/include/features.h" 1 3 4 | |
2154 | # 23 "/usr/include/gentoo-multilib/ppc64/endian.h" 2 3 4 | |
2155 | # 37 "/usr/include/gentoo-multilib/ppc64/endian.h" 3 4 | |
2156 | # 1 "/usr/include/bits/endian.h" 1 3 4 | |
2157 | ||
2158 | ||
2159 | ||
2160 | ||
2161 | ||
2162 | ||
2163 | ||
2164 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/endian.h" 1 3 4 | |
2165 | # 9 "/usr/include/bits/endian.h" 2 3 4 | |
2166 | # 38 "/usr/include/gentoo-multilib/ppc64/endian.h" 2 3 4 | |
2167 | # 9 "/usr/include/endian.h" 2 3 4 | |
2168 | # 42 "/usr/include/gentoo-multilib/ppc64/ctype.h" 2 3 4 | |
2169 | ||
2170 | ||
2171 | ||
2172 | ||
2173 | ||
2174 | ||
2175 | enum | |
2176 | { | |
2177 | _ISupper = (1 << (0)), | |
2178 | _ISlower = (1 << (1)), | |
2179 | _ISalpha = (1 << (2)), | |
2180 | _ISdigit = (1 << (3)), | |
2181 | _ISxdigit = (1 << (4)), | |
2182 | _ISspace = (1 << (5)), | |
2183 | _ISprint = (1 << (6)), | |
2184 | _ISgraph = (1 << (7)), | |
2185 | _ISblank = (1 << (8)), | |
2186 | _IScntrl = (1 << (9)), | |
2187 | _ISpunct = (1 << (10)), | |
2188 | _ISalnum = (1 << (11)) | |
2189 | }; | |
2190 | # 81 "/usr/include/gentoo-multilib/ppc64/ctype.h" 3 4 | |
2191 | extern __const unsigned short int **__ctype_b_loc (void) | |
2192 | __attribute__ ((__const)); | |
2193 | extern __const __int32_t **__ctype_tolower_loc (void) | |
2194 | __attribute__ ((__const)); | |
2195 | extern __const __int32_t **__ctype_toupper_loc (void) | |
2196 | __attribute__ ((__const)); | |
2197 | # 96 "/usr/include/gentoo-multilib/ppc64/ctype.h" 3 4 | |
2198 | ||
2199 | ||
2200 | ||
2201 | ||
2202 | ||
2203 | ||
2204 | extern int isalnum (int) __attribute__ ((__nothrow__)); | |
2205 | extern int isalpha (int) __attribute__ ((__nothrow__)); | |
2206 | extern int iscntrl (int) __attribute__ ((__nothrow__)); | |
2207 | extern int isdigit (int) __attribute__ ((__nothrow__)); | |
2208 | extern int islower (int) __attribute__ ((__nothrow__)); | |
2209 | extern int isgraph (int) __attribute__ ((__nothrow__)); | |
2210 | extern int isprint (int) __attribute__ ((__nothrow__)); | |
2211 | extern int ispunct (int) __attribute__ ((__nothrow__)); | |
2212 | extern int isspace (int) __attribute__ ((__nothrow__)); | |
2213 | extern int isupper (int) __attribute__ ((__nothrow__)); | |
2214 | extern int isxdigit (int) __attribute__ ((__nothrow__)); | |
2215 | ||
2216 | ||
2217 | ||
2218 | extern int tolower (int __c) __attribute__ ((__nothrow__)); | |
2219 | ||
2220 | ||
2221 | extern int toupper (int __c) __attribute__ ((__nothrow__)); | |
2222 | ||
2223 | ||
2224 | # 142 "/usr/include/gentoo-multilib/ppc64/ctype.h" 3 4 | |
2225 | extern int isascii (int __c) __attribute__ ((__nothrow__)); | |
2226 | ||
2227 | ||
2228 | ||
2229 | extern int toascii (int __c) __attribute__ ((__nothrow__)); | |
2230 | ||
2231 | ||
2232 | ||
2233 | extern int _toupper (int) __attribute__ ((__nothrow__)); | |
2234 | extern int _tolower (int) __attribute__ ((__nothrow__)); | |
2235 | # 190 "/usr/include/gentoo-multilib/ppc64/ctype.h" 3 4 | |
2236 | extern __inline int | |
2237 | __attribute__ ((__nothrow__)) tolower (int __c) | |
2238 | { | |
2239 | return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c; | |
2240 | } | |
2241 | ||
2242 | extern __inline int | |
2243 | __attribute__ ((__nothrow__)) toupper (int __c) | |
2244 | { | |
2245 | return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c; | |
2246 | } | |
2247 | # 323 "/usr/include/gentoo-multilib/ppc64/ctype.h" 3 4 | |
2248 | ||
2249 | # 9 "/usr/include/ctype.h" 2 3 4 | |
2250 | # 44 "scheme.c" 2 | |
2251 | ||
2252 | # 1 "/usr/include/libintl.h" 1 3 4 | |
2253 | ||
2254 | ||
2255 | ||
2256 | ||
2257 | ||
2258 | ||
2259 | ||
2260 | # 1 "/usr/include/gentoo-multilib/ppc64/libintl.h" 1 3 4 | |
2261 | # 24 "/usr/include/gentoo-multilib/ppc64/libintl.h" 3 4 | |
2262 | # 1 "/usr/include/features.h" 1 3 4 | |
2263 | # 25 "/usr/include/gentoo-multilib/ppc64/libintl.h" 2 3 4 | |
2264 | # 35 "/usr/include/gentoo-multilib/ppc64/libintl.h" 3 4 | |
2265 | ||
2266 | ||
2267 | ||
2268 | ||
2269 | ||
2270 | extern char *gettext (__const char *__msgid) | |
2271 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (1))); | |
2272 | ||
2273 | ||
2274 | ||
2275 | extern char *dgettext (__const char *__domainname, __const char *__msgid) | |
2276 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); | |
2277 | extern char *__dgettext (__const char *__domainname, __const char *__msgid) | |
2278 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); | |
2279 | ||
2280 | ||
2281 | ||
2282 | extern char *dcgettext (__const char *__domainname, | |
2283 | __const char *__msgid, int __category) | |
2284 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); | |
2285 | extern char *__dcgettext (__const char *__domainname, | |
2286 | __const char *__msgid, int __category) | |
2287 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))); | |
2288 | ||
2289 | ||
2290 | ||
2291 | ||
2292 | extern char *ngettext (__const char *__msgid1, __const char *__msgid2, | |
2293 | unsigned long int __n) | |
2294 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2))); | |
2295 | ||
2296 | ||
2297 | ||
2298 | extern char *dngettext (__const char *__domainname, __const char *__msgid1, | |
2299 | __const char *__msgid2, unsigned long int __n) | |
2300 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3))); | |
2301 | ||
2302 | ||
2303 | ||
2304 | extern char *dcngettext (__const char *__domainname, __const char *__msgid1, | |
2305 | __const char *__msgid2, unsigned long int __n, | |
2306 | int __category) | |
2307 | __attribute__ ((__nothrow__)) __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3))); | |
2308 | ||
2309 | ||
2310 | ||
2311 | ||
2312 | ||
2313 | extern char *textdomain (__const char *__domainname) __attribute__ ((__nothrow__)); | |
2314 | ||
2315 | ||
2316 | ||
2317 | extern char *bindtextdomain (__const char *__domainname, | |
2318 | __const char *__dirname) __attribute__ ((__nothrow__)); | |
2319 | ||
2320 | ||
2321 | ||
2322 | extern char *bind_textdomain_codeset (__const char *__domainname, | |
2323 | __const char *__codeset) __attribute__ ((__nothrow__)); | |
2324 | ||
2325 | ||
2326 | ||
2327 | ||
2328 | ||
2329 | ||
2330 | ||
2331 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
2332 | # 102 "/usr/include/gentoo-multilib/ppc64/libintl.h" 2 3 4 | |
2333 | ||
2334 | ||
2335 | # 1 "/usr/include/locale.h" 1 3 4 | |
2336 | ||
2337 | ||
2338 | ||
2339 | ||
2340 | ||
2341 | ||
2342 | ||
2343 | # 1 "/usr/include/gentoo-multilib/ppc64/locale.h" 1 3 4 | |
2344 | # 26 "/usr/include/gentoo-multilib/ppc64/locale.h" 3 4 | |
2345 | # 1 "/usr/include/features.h" 1 3 4 | |
2346 | # 27 "/usr/include/gentoo-multilib/ppc64/locale.h" 2 3 4 | |
2347 | ||
2348 | ||
2349 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
2350 | # 30 "/usr/include/gentoo-multilib/ppc64/locale.h" 2 3 4 | |
2351 | # 1 "/usr/include/bits/locale.h" 1 3 4 | |
2352 | ||
2353 | ||
2354 | ||
2355 | ||
2356 | ||
2357 | ||
2358 | ||
2359 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/locale.h" 1 3 4 | |
2360 | # 27 "/usr/include/gentoo-multilib/ppc64/bits/locale.h" 3 4 | |
2361 | enum | |
2362 | { | |
2363 | __LC_CTYPE = 0, | |
2364 | __LC_NUMERIC = 1, | |
2365 | __LC_TIME = 2, | |
2366 | __LC_COLLATE = 3, | |
2367 | __LC_MONETARY = 4, | |
2368 | __LC_MESSAGES = 5, | |
2369 | __LC_ALL = 6, | |
2370 | __LC_PAPER = 7, | |
2371 | __LC_NAME = 8, | |
2372 | __LC_ADDRESS = 9, | |
2373 | __LC_TELEPHONE = 10, | |
2374 | __LC_MEASUREMENT = 11, | |
2375 | __LC_IDENTIFICATION = 12 | |
2376 | }; | |
2377 | # 9 "/usr/include/bits/locale.h" 2 3 4 | |
2378 | # 31 "/usr/include/gentoo-multilib/ppc64/locale.h" 2 3 4 | |
2379 | ||
2380 | ||
2381 | # 52 "/usr/include/gentoo-multilib/ppc64/locale.h" 3 4 | |
2382 | struct lconv | |
2383 | { | |
2384 | ||
2385 | ||
2386 | char *decimal_point; | |
2387 | char *thousands_sep; | |
2388 | ||
2389 | ||
2390 | ||
2391 | ||
2392 | ||
2393 | char *grouping; | |
2394 | ||
2395 | ||
2396 | ||
2397 | ||
2398 | ||
2399 | char *int_curr_symbol; | |
2400 | char *currency_symbol; | |
2401 | char *mon_decimal_point; | |
2402 | char *mon_thousands_sep; | |
2403 | char *mon_grouping; | |
2404 | char *positive_sign; | |
2405 | char *negative_sign; | |
2406 | char int_frac_digits; | |
2407 | char frac_digits; | |
2408 | ||
2409 | char p_cs_precedes; | |
2410 | ||
2411 | char p_sep_by_space; | |
2412 | ||
2413 | char n_cs_precedes; | |
2414 | ||
2415 | char n_sep_by_space; | |
2416 | ||
2417 | ||
2418 | ||
2419 | ||
2420 | ||
2421 | ||
2422 | char p_sign_posn; | |
2423 | char n_sign_posn; | |
2424 | # 112 "/usr/include/gentoo-multilib/ppc64/locale.h" 3 4 | |
2425 | char __int_p_cs_precedes; | |
2426 | char __int_p_sep_by_space; | |
2427 | char __int_n_cs_precedes; | |
2428 | char __int_n_sep_by_space; | |
2429 | char __int_p_sign_posn; | |
2430 | char __int_n_sign_posn; | |
2431 | ||
2432 | }; | |
2433 | ||
2434 | ||
2435 | ||
2436 | ||
2437 | ||
2438 | extern char *setlocale (int __category, __const char *__locale) __attribute__ ((__nothrow__)); | |
2439 | ||
2440 | ||
2441 | extern struct lconv *localeconv (void) __attribute__ ((__nothrow__)); | |
2442 | ||
2443 | ||
2444 | # 208 "/usr/include/gentoo-multilib/ppc64/locale.h" 3 4 | |
2445 | ||
2446 | # 9 "/usr/include/locale.h" 2 3 4 | |
2447 | # 105 "/usr/include/gentoo-multilib/ppc64/libintl.h" 2 3 4 | |
2448 | # 122 "/usr/include/gentoo-multilib/ppc64/libintl.h" 3 4 | |
2449 | ||
2450 | # 9 "/usr/include/libintl.h" 2 3 4 | |
2451 | # 46 "scheme.c" 2 | |
2452 | ||
2453 | # 1 "scheme-private.h" 1 | |
2454 | ||
2455 | ||
2456 | ||
2457 | ||
2458 | ||
2459 | # 1 "scheme.h" 1 | |
2460 | ||
2461 | ||
2462 | ||
2463 | ||
2464 | ||
2465 | # 1 "/usr/include/stdio.h" 1 3 4 | |
2466 | ||
2467 | ||
2468 | ||
2469 | ||
2470 | ||
2471 | ||
2472 | ||
2473 | # 1 "/usr/include/gentoo-multilib/ppc64/stdio.h" 1 3 4 | |
2474 | # 28 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
2475 | # 1 "/usr/include/features.h" 1 3 4 | |
2476 | # 29 "/usr/include/gentoo-multilib/ppc64/stdio.h" 2 3 4 | |
2477 | ||
2478 | ||
2479 | ||
2480 | ||
2481 | ||
2482 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
2483 | # 35 "/usr/include/gentoo-multilib/ppc64/stdio.h" 2 3 4 | |
2484 | ||
2485 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
2486 | # 37 "/usr/include/gentoo-multilib/ppc64/stdio.h" 2 3 4 | |
2487 | ||
2488 | ||
2489 | ||
2490 | ||
2491 | ||
2492 | ||
2493 | ||
2494 | ||
2495 | ||
2496 | typedef struct _IO_FILE FILE; | |
2497 | ||
2498 | ||
2499 | ||
2500 | ||
2501 | ||
2502 | # 62 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
2503 | typedef struct _IO_FILE __FILE; | |
2504 | # 72 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
2505 | # 1 "/usr/include/libio.h" 1 3 4 | |
2506 | ||
2507 | ||
2508 | ||
2509 | ||
2510 | ||
2511 | ||
2512 | ||
2513 | # 1 "/usr/include/gentoo-multilib/ppc64/libio.h" 1 3 4 | |
2514 | # 32 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2515 | # 1 "/usr/include/_G_config.h" 1 3 4 | |
2516 | ||
2517 | ||
2518 | ||
2519 | ||
2520 | ||
2521 | ||
2522 | ||
2523 | # 1 "/usr/include/gentoo-multilib/ppc64/_G_config.h" 1 3 4 | |
2524 | # 9 "/usr/include/gentoo-multilib/ppc64/_G_config.h" 3 4 | |
2525 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
2526 | # 10 "/usr/include/gentoo-multilib/ppc64/_G_config.h" 2 3 4 | |
2527 | ||
2528 | ||
2529 | ||
2530 | ||
2531 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
2532 | # 326 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 3 4 | |
2533 | typedef int wchar_t; | |
2534 | # 355 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 3 4 | |
2535 | typedef unsigned int wint_t; | |
2536 | # 15 "/usr/include/gentoo-multilib/ppc64/_G_config.h" 2 3 4 | |
2537 | # 24 "/usr/include/gentoo-multilib/ppc64/_G_config.h" 3 4 | |
2538 | # 1 "/usr/include/wchar.h" 1 3 4 | |
2539 | ||
2540 | ||
2541 | ||
2542 | ||
2543 | ||
2544 | ||
2545 | ||
2546 | # 1 "/usr/include/gentoo-multilib/ppc64/wchar.h" 1 3 4 | |
2547 | # 48 "/usr/include/gentoo-multilib/ppc64/wchar.h" 3 4 | |
2548 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
2549 | # 49 "/usr/include/gentoo-multilib/ppc64/wchar.h" 2 3 4 | |
2550 | ||
2551 | # 1 "/usr/include/bits/wchar.h" 1 3 4 | |
2552 | ||
2553 | ||
2554 | ||
2555 | ||
2556 | ||
2557 | ||
2558 | ||
2559 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/wchar.h" 1 3 4 | |
2560 | # 9 "/usr/include/bits/wchar.h" 2 3 4 | |
2561 | # 51 "/usr/include/gentoo-multilib/ppc64/wchar.h" 2 3 4 | |
2562 | # 76 "/usr/include/gentoo-multilib/ppc64/wchar.h" 3 4 | |
2563 | typedef struct | |
2564 | { | |
2565 | int __count; | |
2566 | union | |
2567 | { | |
2568 | wint_t __wch; | |
2569 | char __wchb[4]; | |
2570 | } __value; | |
2571 | } __mbstate_t; | |
2572 | # 9 "/usr/include/wchar.h" 2 3 4 | |
2573 | # 25 "/usr/include/gentoo-multilib/ppc64/_G_config.h" 2 3 4 | |
2574 | ||
2575 | typedef struct | |
2576 | { | |
2577 | __off_t __pos; | |
2578 | __mbstate_t __state; | |
2579 | } _G_fpos_t; | |
2580 | typedef struct | |
2581 | { | |
2582 | __off64_t __pos; | |
2583 | __mbstate_t __state; | |
2584 | } _G_fpos64_t; | |
2585 | # 44 "/usr/include/gentoo-multilib/ppc64/_G_config.h" 3 4 | |
2586 | # 1 "/usr/include/gconv.h" 1 3 4 | |
2587 | ||
2588 | ||
2589 | ||
2590 | ||
2591 | ||
2592 | ||
2593 | ||
2594 | # 1 "/usr/include/gentoo-multilib/ppc64/gconv.h" 1 3 4 | |
2595 | # 26 "/usr/include/gentoo-multilib/ppc64/gconv.h" 3 4 | |
2596 | # 1 "/usr/include/features.h" 1 3 4 | |
2597 | # 27 "/usr/include/gentoo-multilib/ppc64/gconv.h" 2 3 4 | |
2598 | ||
2599 | # 1 "/usr/include/wchar.h" 1 3 4 | |
2600 | ||
2601 | ||
2602 | ||
2603 | ||
2604 | ||
2605 | ||
2606 | ||
2607 | # 1 "/usr/include/gentoo-multilib/ppc64/wchar.h" 1 3 4 | |
2608 | # 48 "/usr/include/gentoo-multilib/ppc64/wchar.h" 3 4 | |
2609 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
2610 | # 49 "/usr/include/gentoo-multilib/ppc64/wchar.h" 2 3 4 | |
2611 | ||
2612 | # 1 "/usr/include/bits/wchar.h" 1 3 4 | |
2613 | # 51 "/usr/include/gentoo-multilib/ppc64/wchar.h" 2 3 4 | |
2614 | # 9 "/usr/include/wchar.h" 2 3 4 | |
2615 | # 29 "/usr/include/gentoo-multilib/ppc64/gconv.h" 2 3 4 | |
2616 | ||
2617 | ||
2618 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
2619 | # 32 "/usr/include/gentoo-multilib/ppc64/gconv.h" 2 3 4 | |
2620 | ||
2621 | ||
2622 | ||
2623 | ||
2624 | ||
2625 | enum | |
2626 | { | |
2627 | __GCONV_OK = 0, | |
2628 | __GCONV_NOCONV, | |
2629 | __GCONV_NODB, | |
2630 | __GCONV_NOMEM, | |
2631 | ||
2632 | __GCONV_EMPTY_INPUT, | |
2633 | __GCONV_FULL_OUTPUT, | |
2634 | __GCONV_ILLEGAL_INPUT, | |
2635 | __GCONV_INCOMPLETE_INPUT, | |
2636 | ||
2637 | __GCONV_ILLEGAL_DESCRIPTOR, | |
2638 | __GCONV_INTERNAL_ERROR | |
2639 | }; | |
2640 | ||
2641 | ||
2642 | ||
2643 | enum | |
2644 | { | |
2645 | __GCONV_IS_LAST = 0x0001, | |
2646 | __GCONV_IGNORE_ERRORS = 0x0002 | |
2647 | }; | |
2648 | ||
2649 | ||
2650 | ||
2651 | struct __gconv_step; | |
2652 | struct __gconv_step_data; | |
2653 | struct __gconv_loaded_object; | |
2654 | struct __gconv_trans_data; | |
2655 | ||
2656 | ||
2657 | ||
2658 | typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *, | |
2659 | __const unsigned char **, __const unsigned char *, | |
2660 | unsigned char **, size_t *, int, int); | |
2661 | ||
2662 | ||
2663 | typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char); | |
2664 | ||
2665 | ||
2666 | typedef int (*__gconv_init_fct) (struct __gconv_step *); | |
2667 | typedef void (*__gconv_end_fct) (struct __gconv_step *); | |
2668 | ||
2669 | ||
2670 | ||
2671 | typedef int (*__gconv_trans_fct) (struct __gconv_step *, | |
2672 | struct __gconv_step_data *, void *, | |
2673 | __const unsigned char *, | |
2674 | __const unsigned char **, | |
2675 | __const unsigned char *, unsigned char **, | |
2676 | size_t *); | |
2677 | ||
2678 | ||
2679 | typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *, | |
2680 | __const unsigned char *, | |
2681 | unsigned char *, unsigned char *); | |
2682 | ||
2683 | ||
2684 | typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***, | |
2685 | size_t *); | |
2686 | ||
2687 | ||
2688 | typedef int (*__gconv_trans_init_fct) (void **, const char *); | |
2689 | typedef void (*__gconv_trans_end_fct) (void *); | |
2690 | ||
2691 | struct __gconv_trans_data | |
2692 | { | |
2693 | ||
2694 | __gconv_trans_fct __trans_fct; | |
2695 | __gconv_trans_context_fct __trans_context_fct; | |
2696 | __gconv_trans_end_fct __trans_end_fct; | |
2697 | void *__data; | |
2698 | struct __gconv_trans_data *__next; | |
2699 | }; | |
2700 | ||
2701 | ||
2702 | ||
2703 | struct __gconv_step | |
2704 | { | |
2705 | struct __gconv_loaded_object *__shlib_handle; | |
2706 | __const char *__modname; | |
2707 | ||
2708 | int __counter; | |
2709 | ||
2710 | char *__from_name; | |
2711 | char *__to_name; | |
2712 | ||
2713 | __gconv_fct __fct; | |
2714 | __gconv_btowc_fct __btowc_fct; | |
2715 | __gconv_init_fct __init_fct; | |
2716 | __gconv_end_fct __end_fct; | |
2717 | ||
2718 | ||
2719 | ||
2720 | int __min_needed_from; | |
2721 | int __max_needed_from; | |
2722 | int __min_needed_to; | |
2723 | int __max_needed_to; | |
2724 | ||
2725 | ||
2726 | int __stateful; | |
2727 | ||
2728 | void *__data; | |
2729 | }; | |
2730 | ||
2731 | ||
2732 | ||
2733 | struct __gconv_step_data | |
2734 | { | |
2735 | unsigned char *__outbuf; | |
2736 | unsigned char *__outbufend; | |
2737 | ||
2738 | ||
2739 | ||
2740 | int __flags; | |
2741 | ||
2742 | ||
2743 | ||
2744 | int __invocation_counter; | |
2745 | ||
2746 | ||
2747 | ||
2748 | int __internal_use; | |
2749 | ||
2750 | __mbstate_t *__statep; | |
2751 | __mbstate_t __state; | |
2752 | ||
2753 | ||
2754 | ||
2755 | struct __gconv_trans_data *__trans; | |
2756 | }; | |
2757 | ||
2758 | ||
2759 | ||
2760 | typedef struct __gconv_info | |
2761 | { | |
2762 | size_t __nsteps; | |
2763 | struct __gconv_step *__steps; | |
2764 | __extension__ struct __gconv_step_data __data []; | |
2765 | } *__gconv_t; | |
2766 | # 9 "/usr/include/gconv.h" 2 3 4 | |
2767 | # 45 "/usr/include/gentoo-multilib/ppc64/_G_config.h" 2 3 4 | |
2768 | typedef union | |
2769 | { | |
2770 | struct __gconv_info __cd; | |
2771 | struct | |
2772 | { | |
2773 | struct __gconv_info __cd; | |
2774 | struct __gconv_step_data __data; | |
2775 | } __combined; | |
2776 | } _G_iconv_t; | |
2777 | ||
2778 | typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); | |
2779 | typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); | |
2780 | typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); | |
2781 | typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); | |
2782 | # 9 "/usr/include/_G_config.h" 2 3 4 | |
2783 | # 33 "/usr/include/gentoo-multilib/ppc64/libio.h" 2 3 4 | |
2784 | # 53 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2785 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stdarg.h" 1 3 4 | |
2786 | # 43 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stdarg.h" 3 4 | |
2787 | typedef __builtin_va_list __gnuc_va_list; | |
2788 | # 54 "/usr/include/gentoo-multilib/ppc64/libio.h" 2 3 4 | |
2789 | # 166 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2790 | struct _IO_jump_t; struct _IO_FILE; | |
2791 | # 176 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2792 | typedef void _IO_lock_t; | |
2793 | ||
2794 | ||
2795 | ||
2796 | ||
2797 | ||
2798 | struct _IO_marker { | |
2799 | struct _IO_marker *_next; | |
2800 | struct _IO_FILE *_sbuf; | |
2801 | ||
2802 | ||
2803 | ||
2804 | int _pos; | |
2805 | # 199 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2806 | }; | |
2807 | ||
2808 | ||
2809 | enum __codecvt_result | |
2810 | { | |
2811 | __codecvt_ok, | |
2812 | __codecvt_partial, | |
2813 | __codecvt_error, | |
2814 | __codecvt_noconv | |
2815 | }; | |
2816 | # 267 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2817 | struct _IO_FILE { | |
2818 | int _flags; | |
2819 | ||
2820 | ||
2821 | ||
2822 | ||
2823 | char* _IO_read_ptr; | |
2824 | char* _IO_read_end; | |
2825 | char* _IO_read_base; | |
2826 | char* _IO_write_base; | |
2827 | char* _IO_write_ptr; | |
2828 | char* _IO_write_end; | |
2829 | char* _IO_buf_base; | |
2830 | char* _IO_buf_end; | |
2831 | ||
2832 | char *_IO_save_base; | |
2833 | char *_IO_backup_base; | |
2834 | char *_IO_save_end; | |
2835 | ||
2836 | struct _IO_marker *_markers; | |
2837 | ||
2838 | struct _IO_FILE *_chain; | |
2839 | ||
2840 | int _fileno; | |
2841 | ||
2842 | ||
2843 | ||
2844 | int _flags2; | |
2845 | ||
2846 | __off_t _old_offset; | |
2847 | ||
2848 | ||
2849 | ||
2850 | unsigned short _cur_column; | |
2851 | signed char _vtable_offset; | |
2852 | char _shortbuf[1]; | |
2853 | ||
2854 | ||
2855 | ||
2856 | _IO_lock_t *_lock; | |
2857 | # 315 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2858 | __off64_t _offset; | |
2859 | # 324 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2860 | void *__pad1; | |
2861 | void *__pad2; | |
2862 | void *__pad3; | |
2863 | void *__pad4; | |
2864 | size_t __pad5; | |
2865 | ||
2866 | int _mode; | |
2867 | ||
2868 | char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; | |
2869 | ||
2870 | }; | |
2871 | ||
2872 | ||
2873 | typedef struct _IO_FILE _IO_FILE; | |
2874 | ||
2875 | ||
2876 | struct _IO_FILE_plus; | |
2877 | ||
2878 | extern struct _IO_FILE_plus _IO_2_1_stdin_; | |
2879 | extern struct _IO_FILE_plus _IO_2_1_stdout_; | |
2880 | extern struct _IO_FILE_plus _IO_2_1_stderr_; | |
2881 | # 360 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2882 | typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); | |
2883 | ||
2884 | ||
2885 | ||
2886 | ||
2887 | ||
2888 | ||
2889 | ||
2890 | typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, | |
2891 | size_t __n); | |
2892 | ||
2893 | ||
2894 | ||
2895 | ||
2896 | ||
2897 | ||
2898 | ||
2899 | typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); | |
2900 | ||
2901 | ||
2902 | typedef int __io_close_fn (void *__cookie); | |
2903 | # 412 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2904 | extern int __underflow (_IO_FILE *) __attribute__ ((__nothrow__)); | |
2905 | extern int __uflow (_IO_FILE *) __attribute__ ((__nothrow__)); | |
2906 | extern int __overflow (_IO_FILE *, int) __attribute__ ((__nothrow__)); | |
2907 | extern wint_t __wunderflow (_IO_FILE *) __attribute__ ((__nothrow__)); | |
2908 | extern wint_t __wuflow (_IO_FILE *) __attribute__ ((__nothrow__)); | |
2909 | extern wint_t __woverflow (_IO_FILE *, wint_t) __attribute__ ((__nothrow__)); | |
2910 | # 450 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2911 | extern int _IO_getc (_IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
2912 | extern int _IO_putc (int __c, _IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
2913 | extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
2914 | extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
2915 | ||
2916 | extern int _IO_peekc_locked (_IO_FILE *__fp) __attribute__ ((__nothrow__)); | |
2917 | ||
2918 | ||
2919 | ||
2920 | ||
2921 | ||
2922 | extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__)); | |
2923 | extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__)); | |
2924 | extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__)); | |
2925 | # 480 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2926 | extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, | |
2927 | __gnuc_va_list, int *__restrict); | |
2928 | extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, | |
2929 | __gnuc_va_list); | |
2930 | extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) __attribute__ ((__nothrow__)); | |
2931 | extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) __attribute__ ((__nothrow__)); | |
2932 | ||
2933 | extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) __attribute__ ((__nothrow__)); | |
2934 | extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) __attribute__ ((__nothrow__)); | |
2935 | ||
2936 | extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__)); | |
2937 | # 538 "/usr/include/gentoo-multilib/ppc64/libio.h" 3 4 | |
2938 | # 1 "/usr/include/bits/libio-ldbl.h" 1 3 4 | |
2939 | ||
2940 | ||
2941 | ||
2942 | ||
2943 | ||
2944 | ||
2945 | ||
2946 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/libio-ldbl.h" 1 3 4 | |
2947 | # 24 "/usr/include/gentoo-multilib/ppc64/bits/libio-ldbl.h" 3 4 | |
2948 | extern __typeof (_IO_vfscanf) _IO_vfscanf __asm ("" "__nldbl_" "_IO_vfscanf"); | |
2949 | extern __typeof (_IO_vfprintf) _IO_vfprintf __asm ("" "__nldbl_" "_IO_vfprintf"); | |
2950 | # 9 "/usr/include/bits/libio-ldbl.h" 2 3 4 | |
2951 | # 539 "/usr/include/gentoo-multilib/ppc64/libio.h" 2 3 4 | |
2952 | # 9 "/usr/include/libio.h" 2 3 4 | |
2953 | # 73 "/usr/include/gentoo-multilib/ppc64/stdio.h" 2 3 4 | |
2954 | # 86 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
2955 | ||
2956 | ||
2957 | typedef _G_fpos_t fpos_t; | |
2958 | ||
2959 | ||
2960 | ||
2961 | ||
2962 | # 138 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
2963 | # 1 "/usr/include/bits/stdio_lim.h" 1 3 4 | |
2964 | ||
2965 | ||
2966 | ||
2967 | ||
2968 | ||
2969 | ||
2970 | ||
2971 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/stdio_lim.h" 1 3 4 | |
2972 | # 9 "/usr/include/bits/stdio_lim.h" 2 3 4 | |
2973 | # 139 "/usr/include/gentoo-multilib/ppc64/stdio.h" 2 3 4 | |
2974 | ||
2975 | ||
2976 | ||
2977 | extern struct _IO_FILE *stdin; | |
2978 | extern struct _IO_FILE *stdout; | |
2979 | extern struct _IO_FILE *stderr; | |
2980 | ||
2981 | ||
2982 | ||
2983 | ||
2984 | ||
2985 | ||
2986 | ||
2987 | extern int remove (__const char *__filename) __attribute__ ((__nothrow__)); | |
2988 | ||
2989 | extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__)); | |
2990 | ||
2991 | ||
2992 | ||
2993 | ||
2994 | ||
2995 | ||
2996 | ||
2997 | ||
2998 | ||
2999 | ||
3000 | ||
3001 | ||
3002 | ||
3003 | ||
3004 | extern FILE *tmpfile (void); | |
3005 | # 183 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3006 | extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)); | |
3007 | ||
3008 | ||
3009 | ||
3010 | ||
3011 | ||
3012 | extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)); | |
3013 | # 201 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3014 | extern char *tempnam (__const char *__dir, __const char *__pfx) | |
3015 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); | |
3016 | ||
3017 | ||
3018 | ||
3019 | ||
3020 | ||
3021 | ||
3022 | ||
3023 | ||
3024 | extern int fclose (FILE *__stream); | |
3025 | ||
3026 | ||
3027 | ||
3028 | ||
3029 | extern int fflush (FILE *__stream); | |
3030 | ||
3031 | # 226 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3032 | extern int fflush_unlocked (FILE *__stream); | |
3033 | # 240 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3034 | ||
3035 | ||
3036 | ||
3037 | ||
3038 | ||
3039 | ||
3040 | extern FILE *fopen (__const char *__restrict __filename, | |
3041 | __const char *__restrict __modes); | |
3042 | ||
3043 | ||
3044 | ||
3045 | ||
3046 | extern FILE *freopen (__const char *__restrict __filename, | |
3047 | __const char *__restrict __modes, | |
3048 | FILE *__restrict __stream); | |
3049 | # 267 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3050 | ||
3051 | # 278 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3052 | extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)); | |
3053 | # 298 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3054 | ||
3055 | ||
3056 | ||
3057 | extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__)); | |
3058 | ||
3059 | ||
3060 | ||
3061 | extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, | |
3062 | int __modes, size_t __n) __attribute__ ((__nothrow__)); | |
3063 | ||
3064 | ||
3065 | ||
3066 | ||
3067 | ||
3068 | extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, | |
3069 | size_t __size) __attribute__ ((__nothrow__)); | |
3070 | ||
3071 | ||
3072 | extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__)); | |
3073 | ||
3074 | ||
3075 | ||
3076 | ||
3077 | ||
3078 | ||
3079 | ||
3080 | ||
3081 | extern int fprintf (FILE *__restrict __stream, | |
3082 | __const char *__restrict __format, ...); | |
3083 | ||
3084 | ||
3085 | ||
3086 | ||
3087 | extern int printf (__const char *__restrict __format, ...); | |
3088 | ||
3089 | extern int sprintf (char *__restrict __s, | |
3090 | __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); | |
3091 | ||
3092 | ||
3093 | ||
3094 | ||
3095 | ||
3096 | extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, | |
3097 | __gnuc_va_list __arg); | |
3098 | ||
3099 | ||
3100 | ||
3101 | ||
3102 | extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg); | |
3103 | ||
3104 | extern int vsprintf (char *__restrict __s, __const char *__restrict __format, | |
3105 | __gnuc_va_list __arg) __attribute__ ((__nothrow__)); | |
3106 | ||
3107 | ||
3108 | ||
3109 | ||
3110 | ||
3111 | extern int snprintf (char *__restrict __s, size_t __maxlen, | |
3112 | __const char *__restrict __format, ...) | |
3113 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); | |
3114 | ||
3115 | extern int vsnprintf (char *__restrict __s, size_t __maxlen, | |
3116 | __const char *__restrict __format, __gnuc_va_list __arg) | |
3117 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); | |
3118 | ||
3119 | # 392 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3120 | ||
3121 | ||
3122 | ||
3123 | ||
3124 | ||
3125 | extern int fscanf (FILE *__restrict __stream, | |
3126 | __const char *__restrict __format, ...) ; | |
3127 | ||
3128 | ||
3129 | ||
3130 | ||
3131 | extern int scanf (__const char *__restrict __format, ...) ; | |
3132 | ||
3133 | extern int sscanf (__const char *__restrict __s, | |
3134 | __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); | |
3135 | ||
3136 | # 434 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3137 | ||
3138 | ||
3139 | ||
3140 | ||
3141 | ||
3142 | extern int fgetc (FILE *__stream); | |
3143 | extern int getc (FILE *__stream); | |
3144 | ||
3145 | ||
3146 | ||
3147 | ||
3148 | ||
3149 | extern int getchar (void); | |
3150 | ||
3151 | # 458 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3152 | extern int getc_unlocked (FILE *__stream); | |
3153 | extern int getchar_unlocked (void); | |
3154 | # 469 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3155 | extern int fgetc_unlocked (FILE *__stream); | |
3156 | ||
3157 | ||
3158 | ||
3159 | ||
3160 | ||
3161 | ||
3162 | ||
3163 | ||
3164 | ||
3165 | ||
3166 | ||
3167 | extern int fputc (int __c, FILE *__stream); | |
3168 | extern int putc (int __c, FILE *__stream); | |
3169 | ||
3170 | ||
3171 | ||
3172 | ||
3173 | ||
3174 | extern int putchar (int __c); | |
3175 | ||
3176 | # 502 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3177 | extern int fputc_unlocked (int __c, FILE *__stream); | |
3178 | ||
3179 | ||
3180 | ||
3181 | ||
3182 | ||
3183 | ||
3184 | ||
3185 | extern int putc_unlocked (int __c, FILE *__stream); | |
3186 | extern int putchar_unlocked (int __c); | |
3187 | ||
3188 | ||
3189 | ||
3190 | ||
3191 | ||
3192 | ||
3193 | extern int getw (FILE *__stream); | |
3194 | ||
3195 | ||
3196 | extern int putw (int __w, FILE *__stream); | |
3197 | ||
3198 | ||
3199 | ||
3200 | ||
3201 | ||
3202 | ||
3203 | ||
3204 | ||
3205 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) | |
3206 | ; | |
3207 | ||
3208 | ||
3209 | ||
3210 | ||
3211 | ||
3212 | ||
3213 | extern char *gets (char *__s) ; | |
3214 | ||
3215 | # 583 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3216 | ||
3217 | ||
3218 | ||
3219 | ||
3220 | ||
3221 | extern int fputs (__const char *__restrict __s, FILE *__restrict __stream); | |
3222 | ||
3223 | ||
3224 | ||
3225 | ||
3226 | ||
3227 | extern int puts (__const char *__s); | |
3228 | ||
3229 | ||
3230 | ||
3231 | ||
3232 | ||
3233 | ||
3234 | extern int ungetc (int __c, FILE *__stream); | |
3235 | ||
3236 | ||
3237 | ||
3238 | ||
3239 | ||
3240 | ||
3241 | extern size_t fread (void *__restrict __ptr, size_t __size, | |
3242 | size_t __n, FILE *__restrict __stream) ; | |
3243 | ||
3244 | ||
3245 | ||
3246 | ||
3247 | extern size_t fwrite (__const void *__restrict __ptr, size_t __size, | |
3248 | size_t __n, FILE *__restrict __s) ; | |
3249 | ||
3250 | # 636 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3251 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, | |
3252 | size_t __n, FILE *__restrict __stream) ; | |
3253 | extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, | |
3254 | size_t __n, FILE *__restrict __stream) ; | |
3255 | ||
3256 | ||
3257 | ||
3258 | ||
3259 | ||
3260 | ||
3261 | ||
3262 | ||
3263 | extern int fseek (FILE *__stream, long int __off, int __whence); | |
3264 | ||
3265 | ||
3266 | ||
3267 | ||
3268 | extern long int ftell (FILE *__stream) ; | |
3269 | ||
3270 | ||
3271 | ||
3272 | ||
3273 | extern void rewind (FILE *__stream); | |
3274 | ||
3275 | # 672 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3276 | extern int fseeko (FILE *__stream, __off_t __off, int __whence); | |
3277 | ||
3278 | ||
3279 | ||
3280 | ||
3281 | extern __off_t ftello (FILE *__stream) ; | |
3282 | # 691 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3283 | ||
3284 | ||
3285 | ||
3286 | ||
3287 | ||
3288 | ||
3289 | extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); | |
3290 | ||
3291 | ||
3292 | ||
3293 | ||
3294 | extern int fsetpos (FILE *__stream, __const fpos_t *__pos); | |
3295 | # 714 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3296 | ||
3297 | # 723 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3298 | ||
3299 | ||
3300 | extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__)); | |
3301 | ||
3302 | extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
3303 | ||
3304 | extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
3305 | ||
3306 | ||
3307 | ||
3308 | ||
3309 | extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); | |
3310 | extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
3311 | extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
3312 | ||
3313 | ||
3314 | ||
3315 | ||
3316 | ||
3317 | ||
3318 | ||
3319 | ||
3320 | extern void perror (__const char *__s); | |
3321 | ||
3322 | ||
3323 | ||
3324 | ||
3325 | ||
3326 | ||
3327 | # 1 "/usr/include/bits/sys_errlist.h" 1 3 4 | |
3328 | ||
3329 | ||
3330 | ||
3331 | ||
3332 | ||
3333 | ||
3334 | ||
3335 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/sys_errlist.h" 1 3 4 | |
3336 | # 27 "/usr/include/gentoo-multilib/ppc64/bits/sys_errlist.h" 3 4 | |
3337 | extern int sys_nerr; | |
3338 | extern __const char *__const sys_errlist[]; | |
3339 | # 9 "/usr/include/bits/sys_errlist.h" 2 3 4 | |
3340 | # 753 "/usr/include/gentoo-multilib/ppc64/stdio.h" 2 3 4 | |
3341 | ||
3342 | ||
3343 | ||
3344 | ||
3345 | extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
3346 | ||
3347 | ||
3348 | ||
3349 | ||
3350 | extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
3351 | # 772 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3352 | extern FILE *popen (__const char *__command, __const char *__modes) ; | |
3353 | ||
3354 | ||
3355 | ||
3356 | ||
3357 | ||
3358 | extern int pclose (FILE *__stream); | |
3359 | ||
3360 | ||
3361 | ||
3362 | ||
3363 | ||
3364 | extern char *ctermid (char *__s) __attribute__ ((__nothrow__)); | |
3365 | # 812 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3366 | extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__)); | |
3367 | ||
3368 | ||
3369 | ||
3370 | extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ; | |
3371 | ||
3372 | ||
3373 | extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__)); | |
3374 | # 833 "/usr/include/gentoo-multilib/ppc64/stdio.h" 3 4 | |
3375 | # 1 "/usr/include/bits/stdio.h" 1 3 4 | |
3376 | ||
3377 | ||
3378 | ||
3379 | ||
3380 | ||
3381 | ||
3382 | ||
3383 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/stdio.h" 1 3 4 | |
3384 | # 33 "/usr/include/gentoo-multilib/ppc64/bits/stdio.h" 3 4 | |
3385 | extern __inline int | |
3386 | vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg) | |
3387 | { | |
3388 | return vfprintf (stdout, __fmt, __arg); | |
3389 | } | |
3390 | ||
3391 | ||
3392 | extern __inline int | |
3393 | getchar (void) | |
3394 | { | |
3395 | return _IO_getc (stdin); | |
3396 | } | |
3397 | ||
3398 | ||
3399 | ||
3400 | ||
3401 | extern __inline int | |
3402 | getc_unlocked (FILE *__fp) | |
3403 | { | |
3404 | return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); | |
3405 | } | |
3406 | ||
3407 | ||
3408 | extern __inline int | |
3409 | getchar_unlocked (void) | |
3410 | { | |
3411 | return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); | |
3412 | } | |
3413 | ||
3414 | ||
3415 | ||
3416 | ||
3417 | extern __inline int | |
3418 | putchar (int __c) | |
3419 | { | |
3420 | return _IO_putc (__c, stdout); | |
3421 | } | |
3422 | ||
3423 | ||
3424 | ||
3425 | ||
3426 | extern __inline int | |
3427 | fputc_unlocked (int __c, FILE *__stream) | |
3428 | { | |
3429 | return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); | |
3430 | } | |
3431 | ||
3432 | ||
3433 | ||
3434 | ||
3435 | ||
3436 | extern __inline int | |
3437 | putc_unlocked (int __c, FILE *__stream) | |
3438 | { | |
3439 | return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); | |
3440 | } | |
3441 | ||
3442 | ||
3443 | extern __inline int | |
3444 | putchar_unlocked (int __c) | |
3445 | { | |
3446 | return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); | |
3447 | } | |
3448 | # 111 "/usr/include/gentoo-multilib/ppc64/bits/stdio.h" 3 4 | |
3449 | extern __inline int | |
3450 | __attribute__ ((__nothrow__)) feof_unlocked (FILE *__stream) | |
3451 | { | |
3452 | return (((__stream)->_flags & 0x10) != 0); | |
3453 | } | |
3454 | ||
3455 | ||
3456 | extern __inline int | |
3457 | __attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream) | |
3458 | { | |
3459 | return (((__stream)->_flags & 0x20) != 0); | |
3460 | } | |
3461 | # 9 "/usr/include/bits/stdio.h" 2 3 4 | |
3462 | # 834 "/usr/include/gentoo-multilib/ppc64/stdio.h" 2 3 4 | |
3463 | ||
3464 | ||
3465 | ||
3466 | ||
3467 | ||
3468 | # 1 "/usr/include/bits/stdio-ldbl.h" 1 3 4 | |
3469 | ||
3470 | ||
3471 | ||
3472 | ||
3473 | ||
3474 | ||
3475 | ||
3476 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/stdio-ldbl.h" 1 3 4 | |
3477 | # 24 "/usr/include/gentoo-multilib/ppc64/bits/stdio-ldbl.h" 3 4 | |
3478 | ||
3479 | extern __typeof (fprintf) fprintf __asm ("" "__nldbl_" "fprintf"); | |
3480 | extern __typeof (printf) printf __asm ("" "__nldbl_" "printf"); | |
3481 | extern __typeof (sprintf) sprintf __asm ("" "__nldbl_" "sprintf"); | |
3482 | extern __typeof (vfprintf) vfprintf __asm ("" "__nldbl_" "vfprintf"); | |
3483 | extern __typeof (vprintf) vprintf __asm ("" "__nldbl_" "vprintf"); | |
3484 | extern __typeof (vsprintf) vsprintf __asm ("" "__nldbl_" "vsprintf"); | |
3485 | extern __typeof (fscanf) fscanf __asm ("" "__nldbl_" "fscanf"); | |
3486 | extern __typeof (scanf) scanf __asm ("" "__nldbl_" "scanf"); | |
3487 | extern __typeof (sscanf) sscanf __asm ("" "__nldbl_" "sscanf"); | |
3488 | ||
3489 | ||
3490 | ||
3491 | ||
3492 | extern __typeof (snprintf) snprintf __asm ("" "__nldbl_" "snprintf"); | |
3493 | extern __typeof (vsnprintf) vsnprintf __asm ("" "__nldbl_" "vsnprintf"); | |
3494 | ||
3495 | # 9 "/usr/include/bits/stdio-ldbl.h" 2 3 4 | |
3496 | # 840 "/usr/include/gentoo-multilib/ppc64/stdio.h" 2 3 4 | |
3497 | ||
3498 | ||
3499 | ||
3500 | # 9 "/usr/include/stdio.h" 2 3 4 | |
3501 | # 7 "scheme.h" 2 | |
3502 | # 1 "/usr/include/glib-2.0/glib.h" 1 | |
3503 | # 30 "/usr/include/glib-2.0/glib.h" | |
3504 | # 1 "/usr/include/glib-2.0/glib/galloca.h" 1 | |
3505 | # 30 "/usr/include/glib-2.0/glib/galloca.h" | |
3506 | # 1 "/usr/include/glib-2.0/glib/gtypes.h" 1 | |
3507 | # 30 "/usr/include/glib-2.0/glib/gtypes.h" | |
3508 | # 1 "/usr/lib64/glib-2.0/include/glibconfig.h" 1 | |
3509 | # 9 "/usr/lib64/glib-2.0/include/glibconfig.h" | |
3510 | # 1 "/usr/include/glib-2.0/glib/gmacros.h" 1 | |
3511 | # 36 "/usr/include/glib-2.0/glib/gmacros.h" | |
3512 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
3513 | # 152 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 3 4 | |
3514 | typedef long int ptrdiff_t; | |
3515 | # 37 "/usr/include/glib-2.0/glib/gmacros.h" 2 | |
3516 | # 10 "/usr/lib64/glib-2.0/include/glibconfig.h" 2 | |
3517 | ||
3518 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/limits.h" 1 3 4 | |
3519 | # 12 "/usr/lib64/glib-2.0/include/glibconfig.h" 2 | |
3520 | ||
3521 | ||
3522 | ||
3523 | ||
3524 | ||
3525 | # 32 "/usr/lib64/glib-2.0/include/glibconfig.h" | |
3526 | typedef signed char gint8; | |
3527 | typedef unsigned char guint8; | |
3528 | typedef signed short gint16; | |
3529 | typedef unsigned short guint16; | |
3530 | ||
3531 | ||
3532 | ||
3533 | typedef signed int gint32; | |
3534 | typedef unsigned int guint32; | |
3535 | ||
3536 | ||
3537 | ||
3538 | ||
3539 | ||
3540 | typedef signed long gint64; | |
3541 | typedef unsigned long guint64; | |
3542 | # 59 "/usr/lib64/glib-2.0/include/glibconfig.h" | |
3543 | typedef signed long gssize; | |
3544 | typedef unsigned long gsize; | |
3545 | # 126 "/usr/lib64/glib-2.0/include/glibconfig.h" | |
3546 | typedef struct _GStaticMutex GStaticMutex; | |
3547 | struct _GStaticMutex | |
3548 | { | |
3549 | struct _GMutex *runtime_mutex; | |
3550 | union { | |
3551 | char pad[40]; | |
3552 | double dummy_double; | |
3553 | void *dummy_pointer; | |
3554 | long dummy_long; | |
3555 | } static_mutex; | |
3556 | }; | |
3557 | # 145 "/usr/lib64/glib-2.0/include/glibconfig.h" | |
3558 | typedef union _GSystemThread GSystemThread; | |
3559 | union _GSystemThread | |
3560 | { | |
3561 | char data[8]; | |
3562 | double dummy_double; | |
3563 | void *dummy_pointer; | |
3564 | long dummy_long; | |
3565 | }; | |
3566 | # 187 "/usr/lib64/glib-2.0/include/glibconfig.h" | |
3567 | typedef int GPid; | |
3568 | ||
3569 | ||
3570 | # 31 "/usr/include/glib-2.0/glib/gtypes.h" 2 | |
3571 | ||
3572 | ||
3573 | # 41 "/usr/include/glib-2.0/glib/gtypes.h" | |
3574 | typedef char gchar; | |
3575 | typedef short gshort; | |
3576 | typedef long glong; | |
3577 | typedef int gint; | |
3578 | typedef gint gboolean; | |
3579 | ||
3580 | typedef unsigned char guchar; | |
3581 | typedef unsigned short gushort; | |
3582 | typedef unsigned long gulong; | |
3583 | typedef unsigned int guint; | |
3584 | ||
3585 | typedef float gfloat; | |
3586 | typedef double gdouble; | |
3587 | # 72 "/usr/include/glib-2.0/glib/gtypes.h" | |
3588 | typedef void* gpointer; | |
3589 | typedef const void *gconstpointer; | |
3590 | ||
3591 | typedef gint (*GCompareFunc) (gconstpointer a, | |
3592 | gconstpointer b); | |
3593 | typedef gint (*GCompareDataFunc) (gconstpointer a, | |
3594 | gconstpointer b, | |
3595 | gpointer user_data); | |
3596 | typedef gboolean (*GEqualFunc) (gconstpointer a, | |
3597 | gconstpointer b); | |
3598 | typedef void (*GDestroyNotify) (gpointer data); | |
3599 | typedef void (*GFunc) (gpointer data, | |
3600 | gpointer user_data); | |
3601 | typedef guint (*GHashFunc) (gconstpointer key); | |
3602 | typedef void (*GHFunc) (gpointer key, | |
3603 | gpointer value, | |
3604 | gpointer user_data); | |
3605 | typedef void (*GFreeFunc) (gpointer data); | |
3606 | typedef const gchar * (*GTranslateFunc) (const gchar *str, | |
3607 | gpointer data); | |
3608 | # 338 "/usr/include/glib-2.0/glib/gtypes.h" | |
3609 | typedef union _GDoubleIEEE754 GDoubleIEEE754; | |
3610 | typedef union _GFloatIEEE754 GFloatIEEE754; | |
3611 | # 365 "/usr/include/glib-2.0/glib/gtypes.h" | |
3612 | union _GFloatIEEE754 | |
3613 | { | |
3614 | gfloat v_float; | |
3615 | struct { | |
3616 | guint sign : 1; | |
3617 | guint biased_exponent : 8; | |
3618 | guint mantissa : 23; | |
3619 | } mpn; | |
3620 | }; | |
3621 | union _GDoubleIEEE754 | |
3622 | { | |
3623 | gdouble v_double; | |
3624 | struct { | |
3625 | guint sign : 1; | |
3626 | guint biased_exponent : 11; | |
3627 | guint mantissa_high : 20; | |
3628 | guint mantissa_low : 32; | |
3629 | } mpn; | |
3630 | }; | |
3631 | ||
3632 | ||
3633 | ||
3634 | ||
3635 | typedef struct _GTimeVal GTimeVal; | |
3636 | ||
3637 | struct _GTimeVal | |
3638 | { | |
3639 | glong tv_sec; | |
3640 | glong tv_usec; | |
3641 | }; | |
3642 | ||
3643 | ||
3644 | # 31 "/usr/include/glib-2.0/glib/galloca.h" 2 | |
3645 | # 31 "/usr/include/glib-2.0/glib.h" 2 | |
3646 | # 1 "/usr/include/glib-2.0/glib/garray.h" 1 | |
3647 | # 32 "/usr/include/glib-2.0/glib/garray.h" | |
3648 | ||
3649 | ||
3650 | typedef struct _GArray GArray; | |
3651 | typedef struct _GByteArray GByteArray; | |
3652 | typedef struct _GPtrArray GPtrArray; | |
3653 | ||
3654 | struct _GArray | |
3655 | { | |
3656 | gchar *data; | |
3657 | guint len; | |
3658 | }; | |
3659 | ||
3660 | struct _GByteArray | |
3661 | { | |
3662 | guint8 *data; | |
3663 | guint len; | |
3664 | }; | |
3665 | ||
3666 | struct _GPtrArray | |
3667 | { | |
3668 | gpointer *pdata; | |
3669 | guint len; | |
3670 | }; | |
3671 | # 66 "/usr/include/glib-2.0/glib/garray.h" | |
3672 | GArray* g_array_new (gboolean zero_terminated, | |
3673 | gboolean clear_, | |
3674 | guint element_size); | |
3675 | GArray* g_array_sized_new (gboolean zero_terminated, | |
3676 | gboolean clear_, | |
3677 | guint element_size, | |
3678 | guint reserved_size); | |
3679 | gchar* g_array_free (GArray *array, | |
3680 | gboolean free_segment); | |
3681 | GArray* g_array_append_vals (GArray *array, | |
3682 | gconstpointer data, | |
3683 | guint len); | |
3684 | GArray* g_array_prepend_vals (GArray *array, | |
3685 | gconstpointer data, | |
3686 | guint len); | |
3687 | GArray* g_array_insert_vals (GArray *array, | |
3688 | guint index_, | |
3689 | gconstpointer data, | |
3690 | guint len); | |
3691 | GArray* g_array_set_size (GArray *array, | |
3692 | guint length); | |
3693 | GArray* g_array_remove_index (GArray *array, | |
3694 | guint index_); | |
3695 | GArray* g_array_remove_index_fast (GArray *array, | |
3696 | guint index_); | |
3697 | GArray* g_array_remove_range (GArray *array, | |
3698 | guint index_, | |
3699 | guint length); | |
3700 | void g_array_sort (GArray *array, | |
3701 | GCompareFunc compare_func); | |
3702 | void g_array_sort_with_data (GArray *array, | |
3703 | GCompareDataFunc compare_func, | |
3704 | gpointer user_data); | |
3705 | ||
3706 | ||
3707 | ||
3708 | ||
3709 | ||
3710 | ||
3711 | GPtrArray* g_ptr_array_new (void); | |
3712 | GPtrArray* g_ptr_array_sized_new (guint reserved_size); | |
3713 | gpointer* g_ptr_array_free (GPtrArray *array, | |
3714 | gboolean free_seg); | |
3715 | void g_ptr_array_set_size (GPtrArray *array, | |
3716 | gint length); | |
3717 | gpointer g_ptr_array_remove_index (GPtrArray *array, | |
3718 | guint index_); | |
3719 | gpointer g_ptr_array_remove_index_fast (GPtrArray *array, | |
3720 | guint index_); | |
3721 | gboolean g_ptr_array_remove (GPtrArray *array, | |
3722 | gpointer data); | |
3723 | gboolean g_ptr_array_remove_fast (GPtrArray *array, | |
3724 | gpointer data); | |
3725 | void g_ptr_array_remove_range (GPtrArray *array, | |
3726 | guint index_, | |
3727 | guint length); | |
3728 | void g_ptr_array_add (GPtrArray *array, | |
3729 | gpointer data); | |
3730 | void g_ptr_array_sort (GPtrArray *array, | |
3731 | GCompareFunc compare_func); | |
3732 | void g_ptr_array_sort_with_data (GPtrArray *array, | |
3733 | GCompareDataFunc compare_func, | |
3734 | gpointer user_data); | |
3735 | void g_ptr_array_foreach (GPtrArray *array, | |
3736 | GFunc func, | |
3737 | gpointer user_data); | |
3738 | ||
3739 | ||
3740 | ||
3741 | ||
3742 | ||
3743 | ||
3744 | GByteArray* g_byte_array_new (void); | |
3745 | GByteArray* g_byte_array_sized_new (guint reserved_size); | |
3746 | guint8* g_byte_array_free (GByteArray *array, | |
3747 | gboolean free_segment); | |
3748 | GByteArray* g_byte_array_append (GByteArray *array, | |
3749 | const guint8 *data, | |
3750 | guint len); | |
3751 | GByteArray* g_byte_array_prepend (GByteArray *array, | |
3752 | const guint8 *data, | |
3753 | guint len); | |
3754 | GByteArray* g_byte_array_set_size (GByteArray *array, | |
3755 | guint length); | |
3756 | GByteArray* g_byte_array_remove_index (GByteArray *array, | |
3757 | guint index_); | |
3758 | GByteArray* g_byte_array_remove_index_fast (GByteArray *array, | |
3759 | guint index_); | |
3760 | GByteArray* g_byte_array_remove_range (GByteArray *array, | |
3761 | guint index_, | |
3762 | guint length); | |
3763 | void g_byte_array_sort (GByteArray *array, | |
3764 | GCompareFunc compare_func); | |
3765 | void g_byte_array_sort_with_data (GByteArray *array, | |
3766 | GCompareDataFunc compare_func, | |
3767 | gpointer user_data); | |
3768 | ||
3769 | ||
3770 | ||
3771 | # 32 "/usr/include/glib-2.0/glib.h" 2 | |
3772 | # 1 "/usr/include/glib-2.0/glib/gasyncqueue.h" 1 | |
3773 | # 30 "/usr/include/glib-2.0/glib/gasyncqueue.h" | |
3774 | # 1 "/usr/include/glib-2.0/glib/gthread.h" 1 | |
3775 | # 30 "/usr/include/glib-2.0/glib/gthread.h" | |
3776 | # 1 "/usr/include/glib-2.0/glib/gerror.h" 1 | |
3777 | # 24 "/usr/include/glib-2.0/glib/gerror.h" | |
3778 | # 1 "/usr/include/glib-2.0/glib/gquark.h" 1 | |
3779 | # 32 "/usr/include/glib-2.0/glib/gquark.h" | |
3780 | ||
3781 | ||
3782 | typedef guint32 GQuark; | |
3783 | ||
3784 | ||
3785 | ||
3786 | GQuark g_quark_try_string (const gchar *string); | |
3787 | GQuark g_quark_from_static_string (const gchar *string); | |
3788 | GQuark g_quark_from_string (const gchar *string); | |
3789 | const gchar* g_quark_to_string (GQuark quark) __attribute__((__const__)); | |
3790 | ||
3791 | const gchar* g_intern_string (const gchar *string); | |
3792 | const gchar* g_intern_static_string (const gchar *string); | |
3793 | ||
3794 | ||
3795 | ||
3796 | # 25 "/usr/include/glib-2.0/glib/gerror.h" 2 | |
3797 | ||
3798 | ||
3799 | ||
3800 | typedef struct _GError GError; | |
3801 | ||
3802 | struct _GError | |
3803 | { | |
3804 | GQuark domain; | |
3805 | gint code; | |
3806 | gchar *message; | |
3807 | }; | |
3808 | ||
3809 | GError* g_error_new (GQuark domain, | |
3810 | gint code, | |
3811 | const gchar *format, | |
3812 | ...) __attribute__((__format__ (__printf__, 3, 4))); | |
3813 | ||
3814 | GError* g_error_new_literal (GQuark domain, | |
3815 | gint code, | |
3816 | const gchar *message); | |
3817 | ||
3818 | void g_error_free (GError *error); | |
3819 | GError* g_error_copy (const GError *error); | |
3820 | ||
3821 | gboolean g_error_matches (const GError *error, | |
3822 | GQuark domain, | |
3823 | gint code); | |
3824 | ||
3825 | ||
3826 | ||
3827 | ||
3828 | void g_set_error (GError **err, | |
3829 | GQuark domain, | |
3830 | gint code, | |
3831 | const gchar *format, | |
3832 | ...) __attribute__((__format__ (__printf__, 4, 5))); | |
3833 | ||
3834 | ||
3835 | ||
3836 | void g_propagate_error (GError **dest, | |
3837 | GError *src); | |
3838 | ||
3839 | ||
3840 | void g_clear_error (GError **err); | |
3841 | ||
3842 | ||
3843 | ||
3844 | # 31 "/usr/include/glib-2.0/glib/gthread.h" 2 | |
3845 | ||
3846 | # 1 "/usr/include/glib-2.0/glib/gatomic.h" 1 | |
3847 | # 35 "/usr/include/glib-2.0/glib/gatomic.h" | |
3848 | ||
3849 | ||
3850 | gint g_atomic_int_exchange_and_add (volatile gint *atomic, | |
3851 | gint val); | |
3852 | void g_atomic_int_add (volatile gint *atomic, | |
3853 | gint val); | |
3854 | gboolean g_atomic_int_compare_and_exchange (volatile gint *atomic, | |
3855 | gint oldval, | |
3856 | gint newval); | |
3857 | gboolean g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic, | |
3858 | gpointer oldval, | |
3859 | gpointer newval); | |
3860 | ||
3861 | gint g_atomic_int_get (volatile gint *atomic); | |
3862 | void g_atomic_int_set (volatile gint *atomic, | |
3863 | gint newval); | |
3864 | gpointer g_atomic_pointer_get (volatile gpointer *atomic); | |
3865 | void g_atomic_pointer_set (volatile gpointer *atomic, | |
3866 | gpointer newval); | |
3867 | # 66 "/usr/include/glib-2.0/glib/gatomic.h" | |
3868 | ||
3869 | # 33 "/usr/include/glib-2.0/glib/gthread.h" 2 | |
3870 | ||
3871 | ||
3872 | ||
3873 | ||
3874 | ||
3875 | ||
3876 | extern GQuark g_thread_error_quark (void); | |
3877 | ||
3878 | ||
3879 | typedef enum | |
3880 | { | |
3881 | G_THREAD_ERROR_AGAIN | |
3882 | } GThreadError; | |
3883 | ||
3884 | typedef gpointer (*GThreadFunc) (gpointer data); | |
3885 | ||
3886 | typedef enum | |
3887 | { | |
3888 | G_THREAD_PRIORITY_LOW, | |
3889 | G_THREAD_PRIORITY_NORMAL, | |
3890 | G_THREAD_PRIORITY_HIGH, | |
3891 | G_THREAD_PRIORITY_URGENT | |
3892 | } GThreadPriority; | |
3893 | ||
3894 | typedef struct _GThread GThread; | |
3895 | struct _GThread | |
3896 | { | |
3897 | ||
3898 | GThreadFunc func; | |
3899 | gpointer data; | |
3900 | gboolean joinable; | |
3901 | GThreadPriority priority; | |
3902 | }; | |
3903 | ||
3904 | typedef struct _GMutex GMutex; | |
3905 | typedef struct _GCond GCond; | |
3906 | typedef struct _GPrivate GPrivate; | |
3907 | typedef struct _GStaticPrivate GStaticPrivate; | |
3908 | ||
3909 | typedef struct _GThreadFunctions GThreadFunctions; | |
3910 | struct _GThreadFunctions | |
3911 | { | |
3912 | GMutex* (*mutex_new) (void); | |
3913 | void (*mutex_lock) (GMutex *mutex); | |
3914 | gboolean (*mutex_trylock) (GMutex *mutex); | |
3915 | void (*mutex_unlock) (GMutex *mutex); | |
3916 | void (*mutex_free) (GMutex *mutex); | |
3917 | GCond* (*cond_new) (void); | |
3918 | void (*cond_signal) (GCond *cond); | |
3919 | void (*cond_broadcast) (GCond *cond); | |
3920 | void (*cond_wait) (GCond *cond, | |
3921 | GMutex *mutex); | |
3922 | gboolean (*cond_timed_wait) (GCond *cond, | |
3923 | GMutex *mutex, | |
3924 | GTimeVal *end_time); | |
3925 | void (*cond_free) (GCond *cond); | |
3926 | GPrivate* (*private_new) (GDestroyNotify destructor); | |
3927 | gpointer (*private_get) (GPrivate *private_key); | |
3928 | void (*private_set) (GPrivate *private_key, | |
3929 | gpointer data); | |
3930 | void (*thread_create) (GThreadFunc func, | |
3931 | gpointer data, | |
3932 | gulong stack_size, | |
3933 | gboolean joinable, | |
3934 | gboolean bound, | |
3935 | GThreadPriority priority, | |
3936 | gpointer thread, | |
3937 | GError **error); | |
3938 | void (*thread_yield) (void); | |
3939 | void (*thread_join) (gpointer thread); | |
3940 | void (*thread_exit) (void); | |
3941 | void (*thread_set_priority)(gpointer thread, | |
3942 | GThreadPriority priority); | |
3943 | void (*thread_self) (gpointer thread); | |
3944 | gboolean (*thread_equal) (gpointer thread1, | |
3945 | gpointer thread2); | |
3946 | }; | |
3947 | ||
3948 | extern GThreadFunctions g_thread_functions_for_glib_use; | |
3949 | extern gboolean g_thread_use_default_impl; | |
3950 | extern gboolean g_threads_got_initialized; | |
3951 | ||
3952 | ||
3953 | ||
3954 | ||
3955 | ||
3956 | void g_thread_init (GThreadFunctions *vtable); | |
3957 | # 128 "/usr/include/glib-2.0/glib/gthread.h" | |
3958 | void g_thread_init_with_errorcheck_mutexes (GThreadFunctions* vtable); | |
3959 | # 138 "/usr/include/glib-2.0/glib/gthread.h" | |
3960 | GMutex* g_static_mutex_get_mutex_impl (GMutex **mutex); | |
3961 | # 209 "/usr/include/glib-2.0/glib/gthread.h" | |
3962 | GThread* g_thread_create_full (GThreadFunc func, | |
3963 | gpointer data, | |
3964 | gulong stack_size, | |
3965 | gboolean joinable, | |
3966 | gboolean bound, | |
3967 | GThreadPriority priority, | |
3968 | GError **error); | |
3969 | GThread* g_thread_self (void); | |
3970 | void g_thread_exit (gpointer retval); | |
3971 | gpointer g_thread_join (GThread *thread); | |
3972 | ||
3973 | void g_thread_set_priority (GThread *thread, | |
3974 | GThreadPriority priority); | |
3975 | # 234 "/usr/include/glib-2.0/glib/gthread.h" | |
3976 | void g_static_mutex_init (GStaticMutex *mutex); | |
3977 | void g_static_mutex_free (GStaticMutex *mutex); | |
3978 | ||
3979 | struct _GStaticPrivate | |
3980 | { | |
3981 | ||
3982 | guint index; | |
3983 | }; | |
3984 | ||
3985 | void g_static_private_init (GStaticPrivate *private_key); | |
3986 | gpointer g_static_private_get (GStaticPrivate *private_key); | |
3987 | void g_static_private_set (GStaticPrivate *private_key, | |
3988 | gpointer data, | |
3989 | GDestroyNotify notify); | |
3990 | void g_static_private_free (GStaticPrivate *private_key); | |
3991 | ||
3992 | typedef struct _GStaticRecMutex GStaticRecMutex; | |
3993 | struct _GStaticRecMutex | |
3994 | { | |
3995 | ||
3996 | GStaticMutex mutex; | |
3997 | guint depth; | |
3998 | GSystemThread owner; | |
3999 | }; | |
4000 | ||
4001 | ||
4002 | void g_static_rec_mutex_init (GStaticRecMutex *mutex); | |
4003 | void g_static_rec_mutex_lock (GStaticRecMutex *mutex); | |
4004 | gboolean g_static_rec_mutex_trylock (GStaticRecMutex *mutex); | |
4005 | void g_static_rec_mutex_unlock (GStaticRecMutex *mutex); | |
4006 | void g_static_rec_mutex_lock_full (GStaticRecMutex *mutex, | |
4007 | guint depth); | |
4008 | guint g_static_rec_mutex_unlock_full (GStaticRecMutex *mutex); | |
4009 | void g_static_rec_mutex_free (GStaticRecMutex *mutex); | |
4010 | ||
4011 | typedef struct _GStaticRWLock GStaticRWLock; | |
4012 | struct _GStaticRWLock | |
4013 | { | |
4014 | ||
4015 | GStaticMutex mutex; | |
4016 | GCond *read_cond; | |
4017 | GCond *write_cond; | |
4018 | guint read_counter; | |
4019 | gboolean have_writer; | |
4020 | guint want_to_read; | |
4021 | guint want_to_write; | |
4022 | }; | |
4023 | ||
4024 | ||
4025 | ||
4026 | void g_static_rw_lock_init (GStaticRWLock* lock); | |
4027 | void g_static_rw_lock_reader_lock (GStaticRWLock* lock); | |
4028 | gboolean g_static_rw_lock_reader_trylock (GStaticRWLock* lock); | |
4029 | void g_static_rw_lock_reader_unlock (GStaticRWLock* lock); | |
4030 | void g_static_rw_lock_writer_lock (GStaticRWLock* lock); | |
4031 | gboolean g_static_rw_lock_writer_trylock (GStaticRWLock* lock); | |
4032 | void g_static_rw_lock_writer_unlock (GStaticRWLock* lock); | |
4033 | void g_static_rw_lock_free (GStaticRWLock* lock); | |
4034 | ||
4035 | void g_thread_foreach (GFunc thread_func, | |
4036 | gpointer user_data); | |
4037 | ||
4038 | typedef enum | |
4039 | { | |
4040 | G_ONCE_STATUS_NOTCALLED, | |
4041 | G_ONCE_STATUS_PROGRESS, | |
4042 | G_ONCE_STATUS_READY | |
4043 | } GOnceStatus; | |
4044 | ||
4045 | typedef struct _GOnce GOnce; | |
4046 | struct _GOnce | |
4047 | { | |
4048 | volatile GOnceStatus status; | |
4049 | volatile gpointer retval; | |
4050 | }; | |
4051 | ||
4052 | ||
4053 | ||
4054 | gpointer g_once_impl (GOnce *once, GThreadFunc func, gpointer arg); | |
4055 | # 332 "/usr/include/glib-2.0/glib/gthread.h" | |
4056 | extern void glib_dummy_decl (void); | |
4057 | # 375 "/usr/include/glib-2.0/glib/gthread.h" | |
4058 | ||
4059 | # 31 "/usr/include/glib-2.0/glib/gasyncqueue.h" 2 | |
4060 | ||
4061 | ||
4062 | ||
4063 | typedef struct _GAsyncQueue GAsyncQueue; | |
4064 | ||
4065 | ||
4066 | ||
4067 | ||
4068 | GAsyncQueue* g_async_queue_new (void); | |
4069 | ||
4070 | ||
4071 | ||
4072 | ||
4073 | ||
4074 | void g_async_queue_lock (GAsyncQueue *queue); | |
4075 | void g_async_queue_unlock (GAsyncQueue *queue); | |
4076 | ||
4077 | ||
4078 | GAsyncQueue* g_async_queue_ref (GAsyncQueue *queue); | |
4079 | void g_async_queue_unref (GAsyncQueue *queue); | |
4080 | # 59 "/usr/include/glib-2.0/glib/gasyncqueue.h" | |
4081 | void g_async_queue_push (GAsyncQueue *queue, | |
4082 | gpointer data); | |
4083 | void g_async_queue_push_unlocked (GAsyncQueue *queue, | |
4084 | gpointer data); | |
4085 | ||
4086 | void g_async_queue_push_sorted (GAsyncQueue *queue, | |
4087 | gpointer data, | |
4088 | GCompareDataFunc func, | |
4089 | gpointer user_data); | |
4090 | void g_async_queue_push_sorted_unlocked (GAsyncQueue *queue, | |
4091 | gpointer data, | |
4092 | GCompareDataFunc func, | |
4093 | gpointer user_data); | |
4094 | ||
4095 | ||
4096 | ||
4097 | ||
4098 | gpointer g_async_queue_pop (GAsyncQueue *queue); | |
4099 | gpointer g_async_queue_pop_unlocked (GAsyncQueue *queue); | |
4100 | ||
4101 | ||
4102 | gpointer g_async_queue_try_pop (GAsyncQueue *queue); | |
4103 | gpointer g_async_queue_try_pop_unlocked (GAsyncQueue *queue); | |
4104 | ||
4105 | ||
4106 | ||
4107 | ||
4108 | ||
4109 | ||
4110 | gpointer g_async_queue_timed_pop (GAsyncQueue *queue, | |
4111 | GTimeVal *end_time); | |
4112 | gpointer g_async_queue_timed_pop_unlocked (GAsyncQueue *queue, | |
4113 | GTimeVal *end_time); | |
4114 | # 100 "/usr/include/glib-2.0/glib/gasyncqueue.h" | |
4115 | gint g_async_queue_length (GAsyncQueue *queue); | |
4116 | gint g_async_queue_length_unlocked (GAsyncQueue *queue); | |
4117 | void g_async_queue_sort (GAsyncQueue *queue, | |
4118 | GCompareDataFunc func, | |
4119 | gpointer user_data); | |
4120 | void g_async_queue_sort_unlocked (GAsyncQueue *queue, | |
4121 | GCompareDataFunc func, | |
4122 | gpointer user_data); | |
4123 | ||
4124 | ||
4125 | GMutex* _g_async_queue_get_mutex (GAsyncQueue *queue); | |
4126 | ||
4127 | ||
4128 | # 33 "/usr/include/glib-2.0/glib.h" 2 | |
4129 | ||
4130 | # 1 "/usr/include/glib-2.0/glib/gbacktrace.h" 1 | |
4131 | # 32 "/usr/include/glib-2.0/glib/gbacktrace.h" | |
4132 | ||
4133 | # 43 "/usr/include/glib-2.0/glib/gbacktrace.h" | |
4134 | void g_on_error_query (const gchar *prg_name); | |
4135 | void g_on_error_stack_trace (const gchar *prg_name); | |
4136 | # 59 "/usr/include/glib-2.0/glib/gbacktrace.h" | |
4137 | ||
4138 | # 35 "/usr/include/glib-2.0/glib.h" 2 | |
4139 | # 1 "/usr/include/glib-2.0/glib/gbase64.h" 1 | |
4140 | # 26 "/usr/include/glib-2.0/glib/gbase64.h" | |
4141 | ||
4142 | ||
4143 | gsize g_base64_encode_step (const guchar *in, | |
4144 | gsize len, | |
4145 | gboolean break_lines, | |
4146 | gchar *out, | |
4147 | gint *state, | |
4148 | gint *save); | |
4149 | gsize g_base64_encode_close (gboolean break_lines, | |
4150 | gchar *out, | |
4151 | gint *state, | |
4152 | gint *save); | |
4153 | gchar* g_base64_encode (const guchar *data, | |
4154 | gsize len) __attribute__((__malloc__)); | |
4155 | gsize g_base64_decode_step (const gchar *in, | |
4156 | gsize len, | |
4157 | guchar *out, | |
4158 | gint *state, | |
4159 | guint *save); | |
4160 | guchar *g_base64_decode (const gchar *text, | |
4161 | gsize *out_len) __attribute__((__malloc__)); | |
4162 | ||
4163 | ||
4164 | # 36 "/usr/include/glib-2.0/glib.h" 2 | |
4165 | # 1 "/usr/include/glib-2.0/glib/gbookmarkfile.h" 1 | |
4166 | # 24 "/usr/include/glib-2.0/glib/gbookmarkfile.h" | |
4167 | # 1 "/usr/include/time.h" 1 3 4 | |
4168 | ||
4169 | ||
4170 | ||
4171 | ||
4172 | ||
4173 | ||
4174 | ||
4175 | # 1 "/usr/include/gentoo-multilib/ppc64/time.h" 1 3 4 | |
4176 | # 29 "/usr/include/gentoo-multilib/ppc64/time.h" 3 4 | |
4177 | # 1 "/usr/include/features.h" 1 3 4 | |
4178 | # 30 "/usr/include/gentoo-multilib/ppc64/time.h" 2 3 4 | |
4179 | ||
4180 | ||
4181 | ||
4182 | ||
4183 | ||
4184 | ||
4185 | ||
4186 | ||
4187 | ||
4188 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
4189 | # 40 "/usr/include/gentoo-multilib/ppc64/time.h" 2 3 4 | |
4190 | ||
4191 | ||
4192 | ||
4193 | # 1 "/usr/include/bits/time.h" 1 3 4 | |
4194 | ||
4195 | ||
4196 | ||
4197 | ||
4198 | ||
4199 | ||
4200 | ||
4201 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/time.h" 1 3 4 | |
4202 | # 9 "/usr/include/bits/time.h" 2 3 4 | |
4203 | # 44 "/usr/include/gentoo-multilib/ppc64/time.h" 2 3 4 | |
4204 | # 57 "/usr/include/gentoo-multilib/ppc64/time.h" 3 4 | |
4205 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
4206 | # 58 "/usr/include/gentoo-multilib/ppc64/time.h" 2 3 4 | |
4207 | ||
4208 | ||
4209 | ||
4210 | typedef __clock_t clock_t; | |
4211 | ||
4212 | ||
4213 | ||
4214 | # 73 "/usr/include/gentoo-multilib/ppc64/time.h" 3 4 | |
4215 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
4216 | # 74 "/usr/include/gentoo-multilib/ppc64/time.h" 2 3 4 | |
4217 | ||
4218 | ||
4219 | ||
4220 | typedef __time_t time_t; | |
4221 | ||
4222 | ||
4223 | ||
4224 | # 90 "/usr/include/gentoo-multilib/ppc64/time.h" 3 4 | |
4225 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
4226 | # 91 "/usr/include/gentoo-multilib/ppc64/time.h" 2 3 4 | |
4227 | ||
4228 | ||
4229 | typedef __clockid_t clockid_t; | |
4230 | # 102 "/usr/include/gentoo-multilib/ppc64/time.h" 3 4 | |
4231 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
4232 | # 103 "/usr/include/gentoo-multilib/ppc64/time.h" 2 3 4 | |
4233 | ||
4234 | ||
4235 | typedef __timer_t timer_t; | |
4236 | # 117 "/usr/include/gentoo-multilib/ppc64/time.h" 3 4 | |
4237 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
4238 | # 118 "/usr/include/gentoo-multilib/ppc64/time.h" 2 3 4 | |
4239 | ||
4240 | ||
4241 | ||
4242 | struct timespec | |
4243 | { | |
4244 | __time_t tv_sec; | |
4245 | long int tv_nsec; | |
4246 | }; | |
4247 | ||
4248 | ||
4249 | ||
4250 | ||
4251 | ||
4252 | ||
4253 | ||
4254 | ||
4255 | struct tm | |
4256 | { | |
4257 | int tm_sec; | |
4258 | int tm_min; | |
4259 | int tm_hour; | |
4260 | int tm_mday; | |
4261 | int tm_mon; | |
4262 | int tm_year; | |
4263 | int tm_wday; | |
4264 | int tm_yday; | |
4265 | int tm_isdst; | |
4266 | ||
4267 | ||
4268 | long int tm_gmtoff; | |
4269 | __const char *tm_zone; | |
4270 | ||
4271 | ||
4272 | ||
4273 | ||
4274 | }; | |
4275 | ||
4276 | ||
4277 | ||
4278 | ||
4279 | ||
4280 | ||
4281 | ||
4282 | ||
4283 | struct itimerspec | |
4284 | { | |
4285 | struct timespec it_interval; | |
4286 | struct timespec it_value; | |
4287 | }; | |
4288 | ||
4289 | ||
4290 | struct sigevent; | |
4291 | # 181 "/usr/include/gentoo-multilib/ppc64/time.h" 3 4 | |
4292 | ||
4293 | ||
4294 | ||
4295 | extern clock_t clock (void) __attribute__ ((__nothrow__)); | |
4296 | ||
4297 | ||
4298 | extern time_t time (time_t *__timer) __attribute__ ((__nothrow__)); | |
4299 | ||
4300 | ||
4301 | extern double difftime (time_t __time1, time_t __time0) | |
4302 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
4303 | ||
4304 | ||
4305 | extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__)); | |
4306 | ||
4307 | ||
4308 | ||
4309 | ||
4310 | ||
4311 | extern size_t strftime (char *__restrict __s, size_t __maxsize, | |
4312 | __const char *__restrict __format, | |
4313 | __const struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
4314 | ||
4315 | # 229 "/usr/include/gentoo-multilib/ppc64/time.h" 3 4 | |
4316 | ||
4317 | ||
4318 | ||
4319 | extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__)); | |
4320 | ||
4321 | ||
4322 | ||
4323 | extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__)); | |
4324 | ||
4325 | ||
4326 | ||
4327 | ||
4328 | ||
4329 | extern struct tm *gmtime_r (__const time_t *__restrict __timer, | |
4330 | struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
4331 | ||
4332 | ||
4333 | ||
4334 | extern struct tm *localtime_r (__const time_t *__restrict __timer, | |
4335 | struct tm *__restrict __tp) __attribute__ ((__nothrow__)); | |
4336 | ||
4337 | ||
4338 | ||
4339 | ||
4340 | ||
4341 | extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__)); | |
4342 | ||
4343 | ||
4344 | extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__)); | |
4345 | ||
4346 | ||
4347 | ||
4348 | ||
4349 | ||
4350 | ||
4351 | ||
4352 | extern char *asctime_r (__const struct tm *__restrict __tp, | |
4353 | char *__restrict __buf) __attribute__ ((__nothrow__)); | |
4354 | ||
4355 | ||
4356 | extern char *ctime_r (__const time_t *__restrict __timer, | |
4357 | char *__restrict __buf) __attribute__ ((__nothrow__)); | |
4358 | ||
4359 | ||
4360 | ||
4361 | ||
4362 | extern char *__tzname[2]; | |
4363 | extern int __daylight; | |
4364 | extern long int __timezone; | |
4365 | ||
4366 | ||
4367 | ||
4368 | ||
4369 | extern char *tzname[2]; | |
4370 | ||
4371 | ||
4372 | ||
4373 | extern void tzset (void) __attribute__ ((__nothrow__)); | |
4374 | ||
4375 | ||
4376 | ||
4377 | extern int daylight; | |
4378 | extern long int timezone; | |
4379 | ||
4380 | ||
4381 | ||
4382 | ||
4383 | ||
4384 | extern int stime (__const time_t *__when) __attribute__ ((__nothrow__)); | |
4385 | # 312 "/usr/include/gentoo-multilib/ppc64/time.h" 3 4 | |
4386 | extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__)); | |
4387 | ||
4388 | ||
4389 | extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__)); | |
4390 | ||
4391 | ||
4392 | extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
4393 | # 327 "/usr/include/gentoo-multilib/ppc64/time.h" 3 4 | |
4394 | extern int nanosleep (__const struct timespec *__requested_time, | |
4395 | struct timespec *__remaining); | |
4396 | ||
4397 | ||
4398 | ||
4399 | extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__)); | |
4400 | ||
4401 | ||
4402 | extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__)); | |
4403 | ||
4404 | ||
4405 | extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp) | |
4406 | __attribute__ ((__nothrow__)); | |
4407 | ||
4408 | ||
4409 | ||
4410 | ||
4411 | ||
4412 | ||
4413 | extern int clock_nanosleep (clockid_t __clock_id, int __flags, | |
4414 | __const struct timespec *__req, | |
4415 | struct timespec *__rem); | |
4416 | ||
4417 | ||
4418 | extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__)); | |
4419 | ||
4420 | ||
4421 | ||
4422 | ||
4423 | extern int timer_create (clockid_t __clock_id, | |
4424 | struct sigevent *__restrict __evp, | |
4425 | timer_t *__restrict __timerid) __attribute__ ((__nothrow__)); | |
4426 | ||
4427 | ||
4428 | extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__)); | |
4429 | ||
4430 | ||
4431 | extern int timer_settime (timer_t __timerid, int __flags, | |
4432 | __const struct itimerspec *__restrict __value, | |
4433 | struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__)); | |
4434 | ||
4435 | ||
4436 | extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) | |
4437 | __attribute__ ((__nothrow__)); | |
4438 | ||
4439 | ||
4440 | extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__)); | |
4441 | # 416 "/usr/include/gentoo-multilib/ppc64/time.h" 3 4 | |
4442 | ||
4443 | # 9 "/usr/include/time.h" 2 3 4 | |
4444 | # 25 "/usr/include/glib-2.0/glib/gbookmarkfile.h" 2 | |
4445 | ||
4446 | ||
4447 | ||
4448 | ||
4449 | ||
4450 | ||
4451 | ||
4452 | typedef enum | |
4453 | { | |
4454 | G_BOOKMARK_FILE_ERROR_INVALID_URI, | |
4455 | G_BOOKMARK_FILE_ERROR_INVALID_VALUE, | |
4456 | G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED, | |
4457 | G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND, | |
4458 | G_BOOKMARK_FILE_ERROR_READ, | |
4459 | G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING, | |
4460 | G_BOOKMARK_FILE_ERROR_WRITE, | |
4461 | G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND | |
4462 | } GBookmarkFileError; | |
4463 | ||
4464 | GQuark g_bookmark_file_error_quark (void); | |
4465 | ||
4466 | ||
4467 | ||
4468 | ||
4469 | typedef struct _GBookmarkFile GBookmarkFile; | |
4470 | ||
4471 | GBookmarkFile *g_bookmark_file_new (void); | |
4472 | void g_bookmark_file_free (GBookmarkFile *bookmark); | |
4473 | ||
4474 | gboolean g_bookmark_file_load_from_file (GBookmarkFile *bookmark, | |
4475 | const gchar *filename, | |
4476 | GError **error); | |
4477 | gboolean g_bookmark_file_load_from_data (GBookmarkFile *bookmark, | |
4478 | const gchar *data, | |
4479 | gsize length, | |
4480 | GError **error); | |
4481 | gboolean g_bookmark_file_load_from_data_dirs (GBookmarkFile *bookmark, | |
4482 | const gchar *file, | |
4483 | gchar **full_path, | |
4484 | GError **error); | |
4485 | gchar * g_bookmark_file_to_data (GBookmarkFile *bookmark, | |
4486 | gsize *length, | |
4487 | GError **error) __attribute__((__malloc__)); | |
4488 | gboolean g_bookmark_file_to_file (GBookmarkFile *bookmark, | |
4489 | const gchar *filename, | |
4490 | GError **error); | |
4491 | ||
4492 | void g_bookmark_file_set_title (GBookmarkFile *bookmark, | |
4493 | const gchar *uri, | |
4494 | const gchar *title); | |
4495 | gchar * g_bookmark_file_get_title (GBookmarkFile *bookmark, | |
4496 | const gchar *uri, | |
4497 | GError **error) __attribute__((__malloc__)); | |
4498 | void g_bookmark_file_set_description (GBookmarkFile *bookmark, | |
4499 | const gchar *uri, | |
4500 | const gchar *description); | |
4501 | gchar * g_bookmark_file_get_description (GBookmarkFile *bookmark, | |
4502 | const gchar *uri, | |
4503 | GError **error) __attribute__((__malloc__)); | |
4504 | void g_bookmark_file_set_mime_type (GBookmarkFile *bookmark, | |
4505 | const gchar *uri, | |
4506 | const gchar *mime_type); | |
4507 | gchar * g_bookmark_file_get_mime_type (GBookmarkFile *bookmark, | |
4508 | const gchar *uri, | |
4509 | GError **error) __attribute__((__malloc__)); | |
4510 | void g_bookmark_file_set_groups (GBookmarkFile *bookmark, | |
4511 | const gchar *uri, | |
4512 | const gchar **groups, | |
4513 | gsize length); | |
4514 | void g_bookmark_file_add_group (GBookmarkFile *bookmark, | |
4515 | const gchar *uri, | |
4516 | const gchar *group); | |
4517 | gboolean g_bookmark_file_has_group (GBookmarkFile *bookmark, | |
4518 | const gchar *uri, | |
4519 | const gchar *group, | |
4520 | GError **error); | |
4521 | gchar ** g_bookmark_file_get_groups (GBookmarkFile *bookmark, | |
4522 | const gchar *uri, | |
4523 | gsize *length, | |
4524 | GError **error) __attribute__((__malloc__)); | |
4525 | void g_bookmark_file_add_application (GBookmarkFile *bookmark, | |
4526 | const gchar *uri, | |
4527 | const gchar *name, | |
4528 | const gchar *exec); | |
4529 | gboolean g_bookmark_file_has_application (GBookmarkFile *bookmark, | |
4530 | const gchar *uri, | |
4531 | const gchar *name, | |
4532 | GError **error); | |
4533 | gchar ** g_bookmark_file_get_applications (GBookmarkFile *bookmark, | |
4534 | const gchar *uri, | |
4535 | gsize *length, | |
4536 | GError **error) __attribute__((__malloc__)); | |
4537 | gboolean g_bookmark_file_set_app_info (GBookmarkFile *bookmark, | |
4538 | const gchar *uri, | |
4539 | const gchar *name, | |
4540 | const gchar *exec, | |
4541 | gint count, | |
4542 | time_t stamp, | |
4543 | GError **error); | |
4544 | gboolean g_bookmark_file_get_app_info (GBookmarkFile *bookmark, | |
4545 | const gchar *uri, | |
4546 | const gchar *name, | |
4547 | gchar **exec, | |
4548 | guint *count, | |
4549 | time_t *stamp, | |
4550 | GError **error); | |
4551 | void g_bookmark_file_set_is_private (GBookmarkFile *bookmark, | |
4552 | const gchar *uri, | |
4553 | gboolean is_private); | |
4554 | gboolean g_bookmark_file_get_is_private (GBookmarkFile *bookmark, | |
4555 | const gchar *uri, | |
4556 | GError **error); | |
4557 | void g_bookmark_file_set_icon (GBookmarkFile *bookmark, | |
4558 | const gchar *uri, | |
4559 | const gchar *href, | |
4560 | const gchar *mime_type); | |
4561 | gboolean g_bookmark_file_get_icon (GBookmarkFile *bookmark, | |
4562 | const gchar *uri, | |
4563 | gchar **href, | |
4564 | gchar **mime_type, | |
4565 | GError **error); | |
4566 | void g_bookmark_file_set_added (GBookmarkFile *bookmark, | |
4567 | const gchar *uri, | |
4568 | time_t added); | |
4569 | time_t g_bookmark_file_get_added (GBookmarkFile *bookmark, | |
4570 | const gchar *uri, | |
4571 | GError **error); | |
4572 | void g_bookmark_file_set_modified (GBookmarkFile *bookmark, | |
4573 | const gchar *uri, | |
4574 | time_t modified); | |
4575 | time_t g_bookmark_file_get_modified (GBookmarkFile *bookmark, | |
4576 | const gchar *uri, | |
4577 | GError **error); | |
4578 | void g_bookmark_file_set_visited (GBookmarkFile *bookmark, | |
4579 | const gchar *uri, | |
4580 | time_t visited); | |
4581 | time_t g_bookmark_file_get_visited (GBookmarkFile *bookmark, | |
4582 | const gchar *uri, | |
4583 | GError **error); | |
4584 | gboolean g_bookmark_file_has_item (GBookmarkFile *bookmark, | |
4585 | const gchar *uri); | |
4586 | gint g_bookmark_file_get_size (GBookmarkFile *bookmark); | |
4587 | gchar ** g_bookmark_file_get_uris (GBookmarkFile *bookmark, | |
4588 | gsize *length) __attribute__((__malloc__)); | |
4589 | gboolean g_bookmark_file_remove_group (GBookmarkFile *bookmark, | |
4590 | const gchar *uri, | |
4591 | const gchar *group, | |
4592 | GError **error); | |
4593 | gboolean g_bookmark_file_remove_application (GBookmarkFile *bookmark, | |
4594 | const gchar *uri, | |
4595 | const gchar *name, | |
4596 | GError **error); | |
4597 | gboolean g_bookmark_file_remove_item (GBookmarkFile *bookmark, | |
4598 | const gchar *uri, | |
4599 | GError **error); | |
4600 | gboolean g_bookmark_file_move_item (GBookmarkFile *bookmark, | |
4601 | const gchar *old_uri, | |
4602 | const gchar *new_uri, | |
4603 | GError **error); | |
4604 | ||
4605 | ||
4606 | # 37 "/usr/include/glib-2.0/glib.h" 2 | |
4607 | # 1 "/usr/include/glib-2.0/glib/gcache.h" 1 | |
4608 | # 30 "/usr/include/glib-2.0/glib/gcache.h" | |
4609 | # 1 "/usr/include/glib-2.0/glib/glist.h" 1 | |
4610 | # 30 "/usr/include/glib-2.0/glib/glist.h" | |
4611 | # 1 "/usr/include/glib-2.0/glib/gmem.h" 1 | |
4612 | # 30 "/usr/include/glib-2.0/glib/gmem.h" | |
4613 | # 1 "/usr/include/glib-2.0/glib/gslice.h" 1 | |
4614 | # 28 "/usr/include/glib-2.0/glib/gslice.h" | |
4615 | ||
4616 | ||
4617 | ||
4618 | ||
4619 | gpointer g_slice_alloc (gsize block_size) __attribute__((__malloc__)); | |
4620 | gpointer g_slice_alloc0 (gsize block_size) __attribute__((__malloc__)); | |
4621 | void g_slice_free1 (gsize block_size, | |
4622 | gpointer mem_block); | |
4623 | void g_slice_free_chain_with_offset (gsize block_size, | |
4624 | gpointer mem_chain, | |
4625 | gsize next_offset); | |
4626 | # 63 "/usr/include/glib-2.0/glib/gslice.h" | |
4627 | typedef enum { | |
4628 | G_SLICE_CONFIG_ALWAYS_MALLOC = 1, | |
4629 | G_SLICE_CONFIG_BYPASS_MAGAZINES, | |
4630 | G_SLICE_CONFIG_WORKING_SET_MSECS, | |
4631 | G_SLICE_CONFIG_COLOR_INCREMENT, | |
4632 | G_SLICE_CONFIG_CHUNK_SIZES, | |
4633 | G_SLICE_CONFIG_CONTENTION_COUNTER | |
4634 | } GSliceConfig; | |
4635 | void g_slice_set_config (GSliceConfig ckey, gint64 value); | |
4636 | gint64 g_slice_get_config (GSliceConfig ckey); | |
4637 | gint64* g_slice_get_config_state (GSliceConfig ckey, gint64 address, guint *n_values); | |
4638 | ||
4639 | ||
4640 | # 31 "/usr/include/glib-2.0/glib/gmem.h" 2 | |
4641 | ||
4642 | ||
4643 | ||
4644 | ||
4645 | typedef struct _GMemVTable GMemVTable; | |
4646 | # 47 "/usr/include/glib-2.0/glib/gmem.h" | |
4647 | gpointer g_malloc (gulong n_bytes) __attribute__((__malloc__)); | |
4648 | gpointer g_malloc0 (gulong n_bytes) __attribute__((__malloc__)); | |
4649 | gpointer g_realloc (gpointer mem, | |
4650 | gulong n_bytes) __attribute__((warn_unused_result)); | |
4651 | void g_free (gpointer mem); | |
4652 | gpointer g_try_malloc (gulong n_bytes) __attribute__((__malloc__)); | |
4653 | gpointer g_try_malloc0 (gulong n_bytes) __attribute__((__malloc__)); | |
4654 | gpointer g_try_realloc (gpointer mem, | |
4655 | gulong n_bytes) __attribute__((warn_unused_result)); | |
4656 | # 79 "/usr/include/glib-2.0/glib/gmem.h" | |
4657 | struct _GMemVTable | |
4658 | { | |
4659 | gpointer (*malloc) (gsize n_bytes); | |
4660 | gpointer (*realloc) (gpointer mem, | |
4661 | gsize n_bytes); | |
4662 | void (*free) (gpointer mem); | |
4663 | ||
4664 | gpointer (*calloc) (gsize n_blocks, | |
4665 | gsize n_block_bytes); | |
4666 | gpointer (*try_malloc) (gsize n_bytes); | |
4667 | gpointer (*try_realloc) (gpointer mem, | |
4668 | gsize n_bytes); | |
4669 | }; | |
4670 | void g_mem_set_vtable (GMemVTable *vtable); | |
4671 | gboolean g_mem_is_system_malloc (void); | |
4672 | ||
4673 | extern gboolean g_mem_gc_friendly; | |
4674 | ||
4675 | ||
4676 | ||
4677 | extern GMemVTable *glib_mem_profiler_table; | |
4678 | void g_mem_profile (void); | |
4679 | # 146 "/usr/include/glib-2.0/glib/gmem.h" | |
4680 | ||
4681 | # 31 "/usr/include/glib-2.0/glib/glist.h" 2 | |
4682 | ||
4683 | ||
4684 | ||
4685 | typedef struct _GList GList; | |
4686 | ||
4687 | struct _GList | |
4688 | { | |
4689 | gpointer data; | |
4690 | GList *next; | |
4691 | GList *prev; | |
4692 | }; | |
4693 | ||
4694 | ||
4695 | ||
4696 | GList* g_list_alloc (void) __attribute__((warn_unused_result)); | |
4697 | void g_list_free (GList *list); | |
4698 | void g_list_free_1 (GList *list); | |
4699 | ||
4700 | GList* g_list_append (GList *list, | |
4701 | gpointer data) __attribute__((warn_unused_result)); | |
4702 | GList* g_list_prepend (GList *list, | |
4703 | gpointer data) __attribute__((warn_unused_result)); | |
4704 | GList* g_list_insert (GList *list, | |
4705 | gpointer data, | |
4706 | gint position) __attribute__((warn_unused_result)); | |
4707 | GList* g_list_insert_sorted (GList *list, | |
4708 | gpointer data, | |
4709 | GCompareFunc func) __attribute__((warn_unused_result)); | |
4710 | GList* g_list_insert_sorted_with_data (GList *list, | |
4711 | gpointer data, | |
4712 | GCompareDataFunc func, | |
4713 | gpointer user_data) __attribute__((warn_unused_result)); | |
4714 | GList* g_list_insert_before (GList *list, | |
4715 | GList *sibling, | |
4716 | gpointer data) __attribute__((warn_unused_result)); | |
4717 | GList* g_list_concat (GList *list1, | |
4718 | GList *list2) __attribute__((warn_unused_result)); | |
4719 | GList* g_list_remove (GList *list, | |
4720 | gconstpointer data) __attribute__((warn_unused_result)); | |
4721 | GList* g_list_remove_all (GList *list, | |
4722 | gconstpointer data) __attribute__((warn_unused_result)); | |
4723 | GList* g_list_remove_link (GList *list, | |
4724 | GList *llink) __attribute__((warn_unused_result)); | |
4725 | GList* g_list_delete_link (GList *list, | |
4726 | GList *link_) __attribute__((warn_unused_result)); | |
4727 | GList* g_list_reverse (GList *list) __attribute__((warn_unused_result)); | |
4728 | GList* g_list_copy (GList *list) __attribute__((warn_unused_result)); | |
4729 | GList* g_list_nth (GList *list, | |
4730 | guint n); | |
4731 | GList* g_list_nth_prev (GList *list, | |
4732 | guint n); | |
4733 | GList* g_list_find (GList *list, | |
4734 | gconstpointer data); | |
4735 | GList* g_list_find_custom (GList *list, | |
4736 | gconstpointer data, | |
4737 | GCompareFunc func); | |
4738 | gint g_list_position (GList *list, | |
4739 | GList *llink); | |
4740 | gint g_list_index (GList *list, | |
4741 | gconstpointer data); | |
4742 | GList* g_list_last (GList *list); | |
4743 | GList* g_list_first (GList *list); | |
4744 | guint g_list_length (GList *list); | |
4745 | void g_list_foreach (GList *list, | |
4746 | GFunc func, | |
4747 | gpointer user_data); | |
4748 | GList* g_list_sort (GList *list, | |
4749 | GCompareFunc compare_func) __attribute__((warn_unused_result)); | |
4750 | GList* g_list_sort_with_data (GList *list, | |
4751 | GCompareDataFunc compare_func, | |
4752 | gpointer user_data) __attribute__((warn_unused_result)); | |
4753 | gpointer g_list_nth_data (GList *list, | |
4754 | guint n); | |
4755 | # 113 "/usr/include/glib-2.0/glib/glist.h" | |
4756 | ||
4757 | # 31 "/usr/include/glib-2.0/glib/gcache.h" 2 | |
4758 | ||
4759 | ||
4760 | ||
4761 | typedef struct _GCache GCache; | |
4762 | ||
4763 | typedef gpointer (*GCacheNewFunc) (gpointer key); | |
4764 | typedef gpointer (*GCacheDupFunc) (gpointer value); | |
4765 | typedef void (*GCacheDestroyFunc) (gpointer value); | |
4766 | ||
4767 | ||
4768 | ||
4769 | GCache* g_cache_new (GCacheNewFunc value_new_func, | |
4770 | GCacheDestroyFunc value_destroy_func, | |
4771 | GCacheDupFunc key_dup_func, | |
4772 | GCacheDestroyFunc key_destroy_func, | |
4773 | GHashFunc hash_key_func, | |
4774 | GHashFunc hash_value_func, | |
4775 | GEqualFunc key_equal_func); | |
4776 | void g_cache_destroy (GCache *cache); | |
4777 | gpointer g_cache_insert (GCache *cache, | |
4778 | gpointer key); | |
4779 | void g_cache_remove (GCache *cache, | |
4780 | gconstpointer value); | |
4781 | void g_cache_key_foreach (GCache *cache, | |
4782 | GHFunc func, | |
4783 | gpointer user_data); | |
4784 | ||
4785 | ||
4786 | ||
4787 | ||
4788 | ||
4789 | ||
4790 | ||
4791 | # 38 "/usr/include/glib-2.0/glib.h" 2 | |
4792 | # 1 "/usr/include/glib-2.0/glib/gcompletion.h" 1 | |
4793 | # 32 "/usr/include/glib-2.0/glib/gcompletion.h" | |
4794 | ||
4795 | ||
4796 | typedef struct _GCompletion GCompletion; | |
4797 | ||
4798 | typedef gchar* (*GCompletionFunc) (gpointer); | |
4799 | ||
4800 | ||
4801 | ||
4802 | ||
4803 | typedef gint (*GCompletionStrncmpFunc) (const gchar *s1, | |
4804 | const gchar *s2, | |
4805 | gsize n); | |
4806 | ||
4807 | struct _GCompletion | |
4808 | { | |
4809 | GList* items; | |
4810 | GCompletionFunc func; | |
4811 | ||
4812 | gchar* prefix; | |
4813 | GList* cache; | |
4814 | GCompletionStrncmpFunc strncmp_func; | |
4815 | }; | |
4816 | ||
4817 | GCompletion* g_completion_new (GCompletionFunc func); | |
4818 | void g_completion_add_items (GCompletion* cmp, | |
4819 | GList* items); | |
4820 | void g_completion_remove_items (GCompletion* cmp, | |
4821 | GList* items); | |
4822 | void g_completion_clear_items (GCompletion* cmp); | |
4823 | GList* g_completion_complete (GCompletion* cmp, | |
4824 | const gchar* prefix, | |
4825 | gchar** new_prefix); | |
4826 | GList* g_completion_complete_utf8 (GCompletion *cmp, | |
4827 | const gchar* prefix, | |
4828 | gchar** new_prefix); | |
4829 | void g_completion_set_compare (GCompletion *cmp, | |
4830 | GCompletionStrncmpFunc strncmp_func); | |
4831 | void g_completion_free (GCompletion* cmp); | |
4832 | ||
4833 | ||
4834 | # 39 "/usr/include/glib-2.0/glib.h" 2 | |
4835 | # 1 "/usr/include/glib-2.0/glib/gconvert.h" 1 | |
4836 | # 30 "/usr/include/glib-2.0/glib/gconvert.h" | |
4837 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
4838 | # 31 "/usr/include/glib-2.0/glib/gconvert.h" 2 | |
4839 | ||
4840 | ||
4841 | ||
4842 | ||
4843 | typedef enum | |
4844 | { | |
4845 | G_CONVERT_ERROR_NO_CONVERSION, | |
4846 | G_CONVERT_ERROR_ILLEGAL_SEQUENCE, | |
4847 | G_CONVERT_ERROR_FAILED, | |
4848 | G_CONVERT_ERROR_PARTIAL_INPUT, | |
4849 | G_CONVERT_ERROR_BAD_URI, | |
4850 | G_CONVERT_ERROR_NOT_ABSOLUTE_PATH | |
4851 | } GConvertError; | |
4852 | ||
4853 | ||
4854 | GQuark g_convert_error_quark (void); | |
4855 | ||
4856 | ||
4857 | ||
4858 | typedef struct _GIConv *GIConv; | |
4859 | ||
4860 | GIConv g_iconv_open (const gchar *to_codeset, | |
4861 | const gchar *from_codeset); | |
4862 | size_t g_iconv (GIConv converter, | |
4863 | gchar **inbuf, | |
4864 | gsize *inbytes_left, | |
4865 | gchar **outbuf, | |
4866 | gsize *outbytes_left); | |
4867 | gint g_iconv_close (GIConv converter); | |
4868 | ||
4869 | ||
4870 | gchar* g_convert (const gchar *str, | |
4871 | gssize len, | |
4872 | const gchar *to_codeset, | |
4873 | const gchar *from_codeset, | |
4874 | gsize *bytes_read, | |
4875 | gsize *bytes_written, | |
4876 | GError **error) __attribute__((__malloc__)); | |
4877 | gchar* g_convert_with_iconv (const gchar *str, | |
4878 | gssize len, | |
4879 | GIConv converter, | |
4880 | gsize *bytes_read, | |
4881 | gsize *bytes_written, | |
4882 | GError **error) __attribute__((__malloc__)); | |
4883 | gchar* g_convert_with_fallback (const gchar *str, | |
4884 | gssize len, | |
4885 | const gchar *to_codeset, | |
4886 | const gchar *from_codeset, | |
4887 | gchar *fallback, | |
4888 | gsize *bytes_read, | |
4889 | gsize *bytes_written, | |
4890 | GError **error) __attribute__((__malloc__)); | |
4891 | ||
4892 | ||
4893 | ||
4894 | ||
4895 | gchar* g_locale_to_utf8 (const gchar *opsysstring, | |
4896 | gssize len, | |
4897 | gsize *bytes_read, | |
4898 | gsize *bytes_written, | |
4899 | GError **error) __attribute__((__malloc__)); | |
4900 | gchar* g_locale_from_utf8 (const gchar *utf8string, | |
4901 | gssize len, | |
4902 | gsize *bytes_read, | |
4903 | gsize *bytes_written, | |
4904 | GError **error) __attribute__((__malloc__)); | |
4905 | # 108 "/usr/include/glib-2.0/glib/gconvert.h" | |
4906 | gchar* g_filename_to_utf8 (const gchar *opsysstring, | |
4907 | gssize len, | |
4908 | gsize *bytes_read, | |
4909 | gsize *bytes_written, | |
4910 | GError **error) __attribute__((__malloc__)); | |
4911 | gchar* g_filename_from_utf8 (const gchar *utf8string, | |
4912 | gssize len, | |
4913 | gsize *bytes_read, | |
4914 | gsize *bytes_written, | |
4915 | GError **error) __attribute__((__malloc__)); | |
4916 | ||
4917 | gchar *g_filename_from_uri (const gchar *uri, | |
4918 | gchar **hostname, | |
4919 | GError **error) __attribute__((__malloc__)); | |
4920 | ||
4921 | gchar *g_filename_to_uri (const gchar *filename, | |
4922 | const gchar *hostname, | |
4923 | GError **error) __attribute__((__malloc__)); | |
4924 | gchar *g_filename_display_name (const gchar *filename) __attribute__((__malloc__)); | |
4925 | gboolean g_get_filename_charsets (const gchar ***charsets); | |
4926 | ||
4927 | gchar *g_filename_display_basename (const gchar *filename) __attribute__((__malloc__)); | |
4928 | ||
4929 | gchar **g_uri_list_extract_uris (const gchar *uri_list) __attribute__((__malloc__)); | |
4930 | ||
4931 | ||
4932 | # 40 "/usr/include/glib-2.0/glib.h" 2 | |
4933 | # 1 "/usr/include/glib-2.0/glib/gdataset.h" 1 | |
4934 | # 32 "/usr/include/glib-2.0/glib/gdataset.h" | |
4935 | ||
4936 | ||
4937 | typedef struct _GData GData; | |
4938 | ||
4939 | typedef void (*GDataForeachFunc) (GQuark key_id, | |
4940 | gpointer data, | |
4941 | gpointer user_data); | |
4942 | ||
4943 | ||
4944 | ||
4945 | void g_datalist_init (GData **datalist); | |
4946 | void g_datalist_clear (GData **datalist); | |
4947 | gpointer g_datalist_id_get_data (GData **datalist, | |
4948 | GQuark key_id); | |
4949 | void g_datalist_id_set_data_full (GData **datalist, | |
4950 | GQuark key_id, | |
4951 | gpointer data, | |
4952 | GDestroyNotify destroy_func); | |
4953 | gpointer g_datalist_id_remove_no_notify (GData **datalist, | |
4954 | GQuark key_id); | |
4955 | void g_datalist_foreach (GData **datalist, | |
4956 | GDataForeachFunc func, | |
4957 | gpointer user_data); | |
4958 | # 65 "/usr/include/glib-2.0/glib/gdataset.h" | |
4959 | void g_datalist_set_flags (GData **datalist, | |
4960 | guint flags); | |
4961 | void g_datalist_unset_flags (GData **datalist, | |
4962 | guint flags); | |
4963 | guint g_datalist_get_flags (GData **datalist); | |
4964 | # 89 "/usr/include/glib-2.0/glib/gdataset.h" | |
4965 | void g_dataset_destroy (gconstpointer dataset_location); | |
4966 | gpointer g_dataset_id_get_data (gconstpointer dataset_location, | |
4967 | GQuark key_id); | |
4968 | void g_dataset_id_set_data_full (gconstpointer dataset_location, | |
4969 | GQuark key_id, | |
4970 | gpointer data, | |
4971 | GDestroyNotify destroy_func); | |
4972 | gpointer g_dataset_id_remove_no_notify (gconstpointer dataset_location, | |
4973 | GQuark key_id); | |
4974 | void g_dataset_foreach (gconstpointer dataset_location, | |
4975 | GDataForeachFunc func, | |
4976 | gpointer user_data); | |
4977 | # 116 "/usr/include/glib-2.0/glib/gdataset.h" | |
4978 | ||
4979 | # 41 "/usr/include/glib-2.0/glib.h" 2 | |
4980 | # 1 "/usr/include/glib-2.0/glib/gdate.h" 1 | |
4981 | # 30 "/usr/include/glib-2.0/glib/gdate.h" | |
4982 | # 1 "/usr/include/time.h" 1 3 4 | |
4983 | # 31 "/usr/include/glib-2.0/glib/gdate.h" 2 | |
4984 | ||
4985 | ||
4986 | ||
4987 | ||
4988 | ||
4989 | # 46 "/usr/include/glib-2.0/glib/gdate.h" | |
4990 | typedef gint32 GTime; | |
4991 | typedef guint16 GDateYear; | |
4992 | typedef guint8 GDateDay; | |
4993 | typedef struct _GDate GDate; | |
4994 | ||
4995 | struct tm; | |
4996 | ||
4997 | ||
4998 | typedef enum | |
4999 | { | |
5000 | G_DATE_DAY = 0, | |
5001 | G_DATE_MONTH = 1, | |
5002 | G_DATE_YEAR = 2 | |
5003 | } GDateDMY; | |
5004 | ||
5005 | ||
5006 | typedef enum | |
5007 | { | |
5008 | G_DATE_BAD_WEEKDAY = 0, | |
5009 | G_DATE_MONDAY = 1, | |
5010 | G_DATE_TUESDAY = 2, | |
5011 | G_DATE_WEDNESDAY = 3, | |
5012 | G_DATE_THURSDAY = 4, | |
5013 | G_DATE_FRIDAY = 5, | |
5014 | G_DATE_SATURDAY = 6, | |
5015 | G_DATE_SUNDAY = 7 | |
5016 | } GDateWeekday; | |
5017 | typedef enum | |
5018 | { | |
5019 | G_DATE_BAD_MONTH = 0, | |
5020 | G_DATE_JANUARY = 1, | |
5021 | G_DATE_FEBRUARY = 2, | |
5022 | G_DATE_MARCH = 3, | |
5023 | G_DATE_APRIL = 4, | |
5024 | G_DATE_MAY = 5, | |
5025 | G_DATE_JUNE = 6, | |
5026 | G_DATE_JULY = 7, | |
5027 | G_DATE_AUGUST = 8, | |
5028 | G_DATE_SEPTEMBER = 9, | |
5029 | G_DATE_OCTOBER = 10, | |
5030 | G_DATE_NOVEMBER = 11, | |
5031 | G_DATE_DECEMBER = 12 | |
5032 | } GDateMonth; | |
5033 | # 99 "/usr/include/glib-2.0/glib/gdate.h" | |
5034 | struct _GDate | |
5035 | { | |
5036 | guint julian_days : 32; | |
5037 | ||
5038 | ||
5039 | ||
5040 | ||
5041 | ||
5042 | guint julian : 1; | |
5043 | guint dmy : 1; | |
5044 | ||
5045 | ||
5046 | guint day : 6; | |
5047 | guint month : 4; | |
5048 | guint year : 16; | |
5049 | }; | |
5050 | ||
5051 | ||
5052 | ||
5053 | ||
5054 | ||
5055 | GDate* g_date_new (void); | |
5056 | GDate* g_date_new_dmy (GDateDay day, | |
5057 | GDateMonth month, | |
5058 | GDateYear year); | |
5059 | GDate* g_date_new_julian (guint32 julian_day); | |
5060 | void g_date_free (GDate *date); | |
5061 | ||
5062 | ||
5063 | ||
5064 | ||
5065 | ||
5066 | ||
5067 | gboolean g_date_valid (const GDate *date); | |
5068 | gboolean g_date_valid_day (GDateDay day) __attribute__((__const__)); | |
5069 | gboolean g_date_valid_month (GDateMonth month) __attribute__((__const__)); | |
5070 | gboolean g_date_valid_year (GDateYear year) __attribute__((__const__)); | |
5071 | gboolean g_date_valid_weekday (GDateWeekday weekday) __attribute__((__const__)); | |
5072 | gboolean g_date_valid_julian (guint32 julian_date) __attribute__((__const__)); | |
5073 | gboolean g_date_valid_dmy (GDateDay day, | |
5074 | GDateMonth month, | |
5075 | GDateYear year) __attribute__((__const__)); | |
5076 | ||
5077 | GDateWeekday g_date_get_weekday (const GDate *date); | |
5078 | GDateMonth g_date_get_month (const GDate *date); | |
5079 | GDateYear g_date_get_year (const GDate *date); | |
5080 | GDateDay g_date_get_day (const GDate *date); | |
5081 | guint32 g_date_get_julian (const GDate *date); | |
5082 | guint g_date_get_day_of_year (const GDate *date); | |
5083 | ||
5084 | ||
5085 | ||
5086 | ||
5087 | ||
5088 | ||
5089 | guint g_date_get_monday_week_of_year (const GDate *date); | |
5090 | guint g_date_get_sunday_week_of_year (const GDate *date); | |
5091 | guint g_date_get_iso8601_week_of_year (const GDate *date); | |
5092 | ||
5093 | ||
5094 | ||
5095 | ||
5096 | ||
5097 | void g_date_clear (GDate *date, | |
5098 | guint n_dates); | |
5099 | ||
5100 | ||
5101 | ||
5102 | ||
5103 | ||
5104 | void g_date_set_parse (GDate *date, | |
5105 | const gchar *str); | |
5106 | void g_date_set_time_t (GDate *date, | |
5107 | time_t timet); | |
5108 | void g_date_set_time_val (GDate *date, | |
5109 | GTimeVal *timeval); | |
5110 | ||
5111 | ||
5112 | ||
5113 | ||
5114 | void g_date_set_month (GDate *date, | |
5115 | GDateMonth month); | |
5116 | void g_date_set_day (GDate *date, | |
5117 | GDateDay day); | |
5118 | void g_date_set_year (GDate *date, | |
5119 | GDateYear year); | |
5120 | void g_date_set_dmy (GDate *date, | |
5121 | GDateDay day, | |
5122 | GDateMonth month, | |
5123 | GDateYear y); | |
5124 | void g_date_set_julian (GDate *date, | |
5125 | guint32 julian_date); | |
5126 | gboolean g_date_is_first_of_month (const GDate *date); | |
5127 | gboolean g_date_is_last_of_month (const GDate *date); | |
5128 | ||
5129 | ||
5130 | void g_date_add_days (GDate *date, | |
5131 | guint n_days); | |
5132 | void g_date_subtract_days (GDate *date, | |
5133 | guint n_days); | |
5134 | ||
5135 | ||
5136 | void g_date_add_months (GDate *date, | |
5137 | guint n_months); | |
5138 | void g_date_subtract_months (GDate *date, | |
5139 | guint n_months); | |
5140 | ||
5141 | ||
5142 | void g_date_add_years (GDate *date, | |
5143 | guint n_years); | |
5144 | void g_date_subtract_years (GDate *date, | |
5145 | guint n_years); | |
5146 | gboolean g_date_is_leap_year (GDateYear year) __attribute__((__const__)); | |
5147 | guint8 g_date_get_days_in_month (GDateMonth month, | |
5148 | GDateYear year) __attribute__((__const__)); | |
5149 | guint8 g_date_get_monday_weeks_in_year (GDateYear year) __attribute__((__const__)); | |
5150 | guint8 g_date_get_sunday_weeks_in_year (GDateYear year) __attribute__((__const__)); | |
5151 | ||
5152 | ||
5153 | ||
5154 | gint g_date_days_between (const GDate *date1, | |
5155 | const GDate *date2); | |
5156 | ||
5157 | ||
5158 | gint g_date_compare (const GDate *lhs, | |
5159 | const GDate *rhs); | |
5160 | void g_date_to_struct_tm (const GDate *date, | |
5161 | struct tm *tm); | |
5162 | ||
5163 | void g_date_clamp (GDate *date, | |
5164 | const GDate *min_date, | |
5165 | const GDate *max_date); | |
5166 | ||
5167 | ||
5168 | void g_date_order (GDate *date1, GDate *date2); | |
5169 | ||
5170 | ||
5171 | ||
5172 | ||
5173 | gsize g_date_strftime (gchar *s, | |
5174 | gsize slen, | |
5175 | const gchar *format, | |
5176 | const GDate *date); | |
5177 | # 259 "/usr/include/glib-2.0/glib/gdate.h" | |
5178 | ||
5179 | # 42 "/usr/include/glib-2.0/glib.h" 2 | |
5180 | # 1 "/usr/include/glib-2.0/glib/gdir.h" 1 | |
5181 | # 28 "/usr/include/glib-2.0/glib/gdir.h" | |
5182 | ||
5183 | ||
5184 | typedef struct _GDir GDir; | |
5185 | ||
5186 | ||
5187 | ||
5188 | ||
5189 | ||
5190 | ||
5191 | ||
5192 | GDir * g_dir_open (const gchar *path, | |
5193 | guint flags, | |
5194 | GError **error); | |
5195 | const gchar *g_dir_read_name (GDir *dir); | |
5196 | void g_dir_rewind (GDir *dir); | |
5197 | void g_dir_close (GDir *dir); | |
5198 | ||
5199 | ||
5200 | # 43 "/usr/include/glib-2.0/glib.h" 2 | |
5201 | ||
5202 | # 1 "/usr/include/glib-2.0/glib/gfileutils.h" 1 | |
5203 | # 26 "/usr/include/glib-2.0/glib/gfileutils.h" | |
5204 | ||
5205 | ||
5206 | ||
5207 | ||
5208 | typedef enum | |
5209 | { | |
5210 | G_FILE_ERROR_EXIST, | |
5211 | G_FILE_ERROR_ISDIR, | |
5212 | G_FILE_ERROR_ACCES, | |
5213 | G_FILE_ERROR_NAMETOOLONG, | |
5214 | G_FILE_ERROR_NOENT, | |
5215 | G_FILE_ERROR_NOTDIR, | |
5216 | G_FILE_ERROR_NXIO, | |
5217 | G_FILE_ERROR_NODEV, | |
5218 | G_FILE_ERROR_ROFS, | |
5219 | G_FILE_ERROR_TXTBSY, | |
5220 | G_FILE_ERROR_FAULT, | |
5221 | G_FILE_ERROR_LOOP, | |
5222 | G_FILE_ERROR_NOSPC, | |
5223 | G_FILE_ERROR_NOMEM, | |
5224 | G_FILE_ERROR_MFILE, | |
5225 | G_FILE_ERROR_NFILE, | |
5226 | G_FILE_ERROR_BADF, | |
5227 | G_FILE_ERROR_INVAL, | |
5228 | G_FILE_ERROR_PIPE, | |
5229 | G_FILE_ERROR_AGAIN, | |
5230 | G_FILE_ERROR_INTR, | |
5231 | G_FILE_ERROR_IO, | |
5232 | G_FILE_ERROR_PERM, | |
5233 | G_FILE_ERROR_NOSYS, | |
5234 | G_FILE_ERROR_FAILED | |
5235 | } GFileError; | |
5236 | ||
5237 | ||
5238 | ||
5239 | ||
5240 | ||
5241 | typedef enum | |
5242 | { | |
5243 | G_FILE_TEST_IS_REGULAR = 1 << 0, | |
5244 | G_FILE_TEST_IS_SYMLINK = 1 << 1, | |
5245 | G_FILE_TEST_IS_DIR = 1 << 2, | |
5246 | G_FILE_TEST_IS_EXECUTABLE = 1 << 3, | |
5247 | G_FILE_TEST_EXISTS = 1 << 4 | |
5248 | } GFileTest; | |
5249 | ||
5250 | GQuark g_file_error_quark (void); | |
5251 | ||
5252 | GFileError g_file_error_from_errno (gint err_no); | |
5253 | # 83 "/usr/include/glib-2.0/glib/gfileutils.h" | |
5254 | gboolean g_file_test (const gchar *filename, | |
5255 | GFileTest test); | |
5256 | gboolean g_file_get_contents (const gchar *filename, | |
5257 | gchar **contents, | |
5258 | gsize *length, | |
5259 | GError **error); | |
5260 | gboolean g_file_set_contents (const gchar *filename, | |
5261 | const gchar *contents, | |
5262 | gssize length, | |
5263 | GError **error); | |
5264 | gchar *g_file_read_link (const gchar *filename, | |
5265 | GError **error); | |
5266 | ||
5267 | ||
5268 | gint g_mkstemp (gchar *tmpl); | |
5269 | ||
5270 | ||
5271 | gint g_file_open_tmp (const gchar *tmpl, | |
5272 | gchar **name_used, | |
5273 | GError **error); | |
5274 | ||
5275 | gchar *g_build_path (const gchar *separator, | |
5276 | const gchar *first_element, | |
5277 | ...) __attribute__((__malloc__)) __attribute__((__sentinel__)); | |
5278 | gchar *g_build_pathv (const gchar *separator, | |
5279 | gchar **args) __attribute__((__malloc__)); | |
5280 | ||
5281 | gchar *g_build_filename (const gchar *first_element, | |
5282 | ...) __attribute__((__malloc__)) __attribute__((__sentinel__)); | |
5283 | gchar *g_build_filenamev (gchar **args) __attribute__((__malloc__)); | |
5284 | ||
5285 | int g_mkdir_with_parents (const gchar *pathname, | |
5286 | int mode); | |
5287 | ||
5288 | ||
5289 | # 45 "/usr/include/glib-2.0/glib.h" 2 | |
5290 | # 1 "/usr/include/glib-2.0/glib/ghash.h" 1 | |
5291 | # 32 "/usr/include/glib-2.0/glib/ghash.h" | |
5292 | ||
5293 | ||
5294 | typedef struct _GHashTable GHashTable; | |
5295 | ||
5296 | typedef gboolean (*GHRFunc) (gpointer key, | |
5297 | gpointer value, | |
5298 | gpointer user_data); | |
5299 | ||
5300 | ||
5301 | ||
5302 | GHashTable* g_hash_table_new (GHashFunc hash_func, | |
5303 | GEqualFunc key_equal_func); | |
5304 | GHashTable* g_hash_table_new_full (GHashFunc hash_func, | |
5305 | GEqualFunc key_equal_func, | |
5306 | GDestroyNotify key_destroy_func, | |
5307 | GDestroyNotify value_destroy_func); | |
5308 | void g_hash_table_destroy (GHashTable *hash_table); | |
5309 | void g_hash_table_insert (GHashTable *hash_table, | |
5310 | gpointer key, | |
5311 | gpointer value); | |
5312 | void g_hash_table_replace (GHashTable *hash_table, | |
5313 | gpointer key, | |
5314 | gpointer value); | |
5315 | gboolean g_hash_table_remove (GHashTable *hash_table, | |
5316 | gconstpointer key); | |
5317 | void g_hash_table_remove_all (GHashTable *hash_table); | |
5318 | gboolean g_hash_table_steal (GHashTable *hash_table, | |
5319 | gconstpointer key); | |
5320 | void g_hash_table_steal_all (GHashTable *hash_table); | |
5321 | gpointer g_hash_table_lookup (GHashTable *hash_table, | |
5322 | gconstpointer key); | |
5323 | gboolean g_hash_table_lookup_extended (GHashTable *hash_table, | |
5324 | gconstpointer lookup_key, | |
5325 | gpointer *orig_key, | |
5326 | gpointer *value); | |
5327 | void g_hash_table_foreach (GHashTable *hash_table, | |
5328 | GHFunc func, | |
5329 | gpointer user_data); | |
5330 | gpointer g_hash_table_find (GHashTable *hash_table, | |
5331 | GHRFunc predicate, | |
5332 | gpointer user_data); | |
5333 | guint g_hash_table_foreach_remove (GHashTable *hash_table, | |
5334 | GHRFunc func, | |
5335 | gpointer user_data); | |
5336 | guint g_hash_table_foreach_steal (GHashTable *hash_table, | |
5337 | GHRFunc func, | |
5338 | gpointer user_data); | |
5339 | guint g_hash_table_size (GHashTable *hash_table); | |
5340 | ||
5341 | ||
5342 | GHashTable* g_hash_table_ref (GHashTable *hash_table); | |
5343 | void g_hash_table_unref (GHashTable *hash_table); | |
5344 | # 96 "/usr/include/glib-2.0/glib/ghash.h" | |
5345 | gboolean g_str_equal (gconstpointer v1, | |
5346 | gconstpointer v2); | |
5347 | guint g_str_hash (gconstpointer v); | |
5348 | ||
5349 | gboolean g_int_equal (gconstpointer v1, | |
5350 | gconstpointer v2); | |
5351 | guint g_int_hash (gconstpointer v); | |
5352 | ||
5353 | ||
5354 | ||
5355 | ||
5356 | ||
5357 | ||
5358 | ||
5359 | guint g_direct_hash (gconstpointer v) __attribute__((__const__)); | |
5360 | gboolean g_direct_equal (gconstpointer v1, | |
5361 | gconstpointer v2) __attribute__((__const__)); | |
5362 | ||
5363 | ||
5364 | # 46 "/usr/include/glib-2.0/glib.h" 2 | |
5365 | # 1 "/usr/include/glib-2.0/glib/ghook.h" 1 | |
5366 | # 32 "/usr/include/glib-2.0/glib/ghook.h" | |
5367 | ||
5368 | ||
5369 | ||
5370 | ||
5371 | typedef struct _GHook GHook; | |
5372 | typedef struct _GHookList GHookList; | |
5373 | ||
5374 | typedef gint (*GHookCompareFunc) (GHook *new_hook, | |
5375 | GHook *sibling); | |
5376 | typedef gboolean (*GHookFindFunc) (GHook *hook, | |
5377 | gpointer data); | |
5378 | typedef void (*GHookMarshaller) (GHook *hook, | |
5379 | gpointer marshal_data); | |
5380 | typedef gboolean (*GHookCheckMarshaller) (GHook *hook, | |
5381 | gpointer marshal_data); | |
5382 | typedef void (*GHookFunc) (gpointer data); | |
5383 | typedef gboolean (*GHookCheckFunc) (gpointer data); | |
5384 | typedef void (*GHookFinalizeFunc) (GHookList *hook_list, | |
5385 | GHook *hook); | |
5386 | typedef enum | |
5387 | { | |
5388 | G_HOOK_FLAG_ACTIVE = 1 << 0, | |
5389 | G_HOOK_FLAG_IN_CALL = 1 << 1, | |
5390 | G_HOOK_FLAG_MASK = 0x0f | |
5391 | } GHookFlagMask; | |
5392 | ||
5393 | ||
5394 | ||
5395 | ||
5396 | struct _GHookList | |
5397 | { | |
5398 | gulong seq_id; | |
5399 | guint hook_size : 16; | |
5400 | guint is_setup : 1; | |
5401 | GHook *hooks; | |
5402 | gpointer dummy3; | |
5403 | GHookFinalizeFunc finalize_hook; | |
5404 | gpointer dummy[2]; | |
5405 | }; | |
5406 | struct _GHook | |
5407 | { | |
5408 | gpointer data; | |
5409 | GHook *next; | |
5410 | GHook *prev; | |
5411 | guint ref_count; | |
5412 | gulong hook_id; | |
5413 | guint flags; | |
5414 | gpointer func; | |
5415 | GDestroyNotify destroy; | |
5416 | }; | |
5417 | # 102 "/usr/include/glib-2.0/glib/ghook.h" | |
5418 | void g_hook_list_init (GHookList *hook_list, | |
5419 | guint hook_size); | |
5420 | void g_hook_list_clear (GHookList *hook_list); | |
5421 | GHook* g_hook_alloc (GHookList *hook_list); | |
5422 | void g_hook_free (GHookList *hook_list, | |
5423 | GHook *hook); | |
5424 | GHook * g_hook_ref (GHookList *hook_list, | |
5425 | GHook *hook); | |
5426 | void g_hook_unref (GHookList *hook_list, | |
5427 | GHook *hook); | |
5428 | gboolean g_hook_destroy (GHookList *hook_list, | |
5429 | gulong hook_id); | |
5430 | void g_hook_destroy_link (GHookList *hook_list, | |
5431 | GHook *hook); | |
5432 | void g_hook_prepend (GHookList *hook_list, | |
5433 | GHook *hook); | |
5434 | void g_hook_insert_before (GHookList *hook_list, | |
5435 | GHook *sibling, | |
5436 | GHook *hook); | |
5437 | void g_hook_insert_sorted (GHookList *hook_list, | |
5438 | GHook *hook, | |
5439 | GHookCompareFunc func); | |
5440 | GHook* g_hook_get (GHookList *hook_list, | |
5441 | gulong hook_id); | |
5442 | GHook* g_hook_find (GHookList *hook_list, | |
5443 | gboolean need_valids, | |
5444 | GHookFindFunc func, | |
5445 | gpointer data); | |
5446 | GHook* g_hook_find_data (GHookList *hook_list, | |
5447 | gboolean need_valids, | |
5448 | gpointer data); | |
5449 | GHook* g_hook_find_func (GHookList *hook_list, | |
5450 | gboolean need_valids, | |
5451 | gpointer func); | |
5452 | GHook* g_hook_find_func_data (GHookList *hook_list, | |
5453 | gboolean need_valids, | |
5454 | gpointer func, | |
5455 | gpointer data); | |
5456 | ||
5457 | GHook* g_hook_first_valid (GHookList *hook_list, | |
5458 | gboolean may_be_in_call); | |
5459 | ||
5460 | ||
5461 | ||
5462 | GHook* g_hook_next_valid (GHookList *hook_list, | |
5463 | GHook *hook, | |
5464 | gboolean may_be_in_call); | |
5465 | ||
5466 | gint g_hook_compare_ids (GHook *new_hook, | |
5467 | GHook *sibling); | |
5468 | ||
5469 | ||
5470 | ||
5471 | ||
5472 | ||
5473 | void g_hook_list_invoke (GHookList *hook_list, | |
5474 | gboolean may_recurse); | |
5475 | ||
5476 | ||
5477 | ||
5478 | void g_hook_list_invoke_check (GHookList *hook_list, | |
5479 | gboolean may_recurse); | |
5480 | ||
5481 | ||
5482 | void g_hook_list_marshal (GHookList *hook_list, | |
5483 | gboolean may_recurse, | |
5484 | GHookMarshaller marshaller, | |
5485 | gpointer marshal_data); | |
5486 | void g_hook_list_marshal_check (GHookList *hook_list, | |
5487 | gboolean may_recurse, | |
5488 | GHookCheckMarshaller marshaller, | |
5489 | gpointer marshal_data); | |
5490 | ||
5491 | ||
5492 | # 47 "/usr/include/glib-2.0/glib.h" 2 | |
5493 | # 1 "/usr/include/glib-2.0/glib/giochannel.h" 1 | |
5494 | # 31 "/usr/include/glib-2.0/glib/giochannel.h" | |
5495 | # 1 "/usr/include/glib-2.0/glib/gmain.h" 1 | |
5496 | # 23 "/usr/include/glib-2.0/glib/gmain.h" | |
5497 | # 1 "/usr/include/glib-2.0/glib/gslist.h" 1 | |
5498 | # 32 "/usr/include/glib-2.0/glib/gslist.h" | |
5499 | ||
5500 | ||
5501 | typedef struct _GSList GSList; | |
5502 | ||
5503 | struct _GSList | |
5504 | { | |
5505 | gpointer data; | |
5506 | GSList *next; | |
5507 | }; | |
5508 | ||
5509 | ||
5510 | ||
5511 | GSList* g_slist_alloc (void) __attribute__((warn_unused_result)); | |
5512 | void g_slist_free (GSList *list); | |
5513 | void g_slist_free_1 (GSList *list); | |
5514 | ||
5515 | GSList* g_slist_append (GSList *list, | |
5516 | gpointer data) __attribute__((warn_unused_result)); | |
5517 | GSList* g_slist_prepend (GSList *list, | |
5518 | gpointer data) __attribute__((warn_unused_result)); | |
5519 | GSList* g_slist_insert (GSList *list, | |
5520 | gpointer data, | |
5521 | gint position) __attribute__((warn_unused_result)); | |
5522 | GSList* g_slist_insert_sorted (GSList *list, | |
5523 | gpointer data, | |
5524 | GCompareFunc func) __attribute__((warn_unused_result)); | |
5525 | GSList* g_slist_insert_sorted_with_data (GSList *list, | |
5526 | gpointer data, | |
5527 | GCompareDataFunc func, | |
5528 | gpointer user_data) __attribute__((warn_unused_result)); | |
5529 | GSList* g_slist_insert_before (GSList *slist, | |
5530 | GSList *sibling, | |
5531 | gpointer data) __attribute__((warn_unused_result)); | |
5532 | GSList* g_slist_concat (GSList *list1, | |
5533 | GSList *list2) __attribute__((warn_unused_result)); | |
5534 | GSList* g_slist_remove (GSList *list, | |
5535 | gconstpointer data) __attribute__((warn_unused_result)); | |
5536 | GSList* g_slist_remove_all (GSList *list, | |
5537 | gconstpointer data) __attribute__((warn_unused_result)); | |
5538 | GSList* g_slist_remove_link (GSList *list, | |
5539 | GSList *link_) __attribute__((warn_unused_result)); | |
5540 | GSList* g_slist_delete_link (GSList *list, | |
5541 | GSList *link_) __attribute__((warn_unused_result)); | |
5542 | GSList* g_slist_reverse (GSList *list) __attribute__((warn_unused_result)); | |
5543 | GSList* g_slist_copy (GSList *list) __attribute__((warn_unused_result)); | |
5544 | GSList* g_slist_nth (GSList *list, | |
5545 | guint n); | |
5546 | GSList* g_slist_find (GSList *list, | |
5547 | gconstpointer data); | |
5548 | GSList* g_slist_find_custom (GSList *list, | |
5549 | gconstpointer data, | |
5550 | GCompareFunc func); | |
5551 | gint g_slist_position (GSList *list, | |
5552 | GSList *llink); | |
5553 | gint g_slist_index (GSList *list, | |
5554 | gconstpointer data); | |
5555 | GSList* g_slist_last (GSList *list); | |
5556 | guint g_slist_length (GSList *list); | |
5557 | void g_slist_foreach (GSList *list, | |
5558 | GFunc func, | |
5559 | gpointer user_data); | |
5560 | GSList* g_slist_sort (GSList *list, | |
5561 | GCompareFunc compare_func) __attribute__((warn_unused_result)); | |
5562 | GSList* g_slist_sort_with_data (GSList *list, | |
5563 | GCompareDataFunc compare_func, | |
5564 | gpointer user_data) __attribute__((warn_unused_result)); | |
5565 | gpointer g_slist_nth_data (GSList *list, | |
5566 | guint n); | |
5567 | ||
5568 | ||
5569 | ||
5570 | ||
5571 | ||
5572 | ||
5573 | ||
5574 | ||
5575 | # 24 "/usr/include/glib-2.0/glib/gmain.h" 2 | |
5576 | ||
5577 | ||
5578 | ||
5579 | ||
5580 | typedef struct _GMainContext GMainContext; | |
5581 | typedef struct _GMainLoop GMainLoop; | |
5582 | typedef struct _GSource GSource; | |
5583 | typedef struct _GSourceCallbackFuncs GSourceCallbackFuncs; | |
5584 | typedef struct _GSourceFuncs GSourceFuncs; | |
5585 | ||
5586 | typedef gboolean (*GSourceFunc) (gpointer data); | |
5587 | typedef void (*GChildWatchFunc) (GPid pid, | |
5588 | gint status, | |
5589 | gpointer data); | |
5590 | struct _GSource | |
5591 | { | |
5592 | ||
5593 | gpointer callback_data; | |
5594 | GSourceCallbackFuncs *callback_funcs; | |
5595 | ||
5596 | GSourceFuncs *source_funcs; | |
5597 | guint ref_count; | |
5598 | ||
5599 | GMainContext *context; | |
5600 | ||
5601 | gint priority; | |
5602 | guint flags; | |
5603 | guint source_id; | |
5604 | ||
5605 | GSList *poll_fds; | |
5606 | ||
5607 | GSource *prev; | |
5608 | GSource *next; | |
5609 | ||
5610 | gpointer reserved1; | |
5611 | gpointer reserved2; | |
5612 | }; | |
5613 | ||
5614 | struct _GSourceCallbackFuncs | |
5615 | { | |
5616 | void (*ref) (gpointer cb_data); | |
5617 | void (*unref) (gpointer cb_data); | |
5618 | void (*get) (gpointer cb_data, | |
5619 | GSource *source, | |
5620 | GSourceFunc *func, | |
5621 | gpointer *data); | |
5622 | }; | |
5623 | ||
5624 | typedef void (*GSourceDummyMarshal) (void); | |
5625 | ||
5626 | struct _GSourceFuncs | |
5627 | { | |
5628 | gboolean (*prepare) (GSource *source, | |
5629 | gint *timeout_); | |
5630 | gboolean (*check) (GSource *source); | |
5631 | gboolean (*dispatch) (GSource *source, | |
5632 | GSourceFunc callback, | |
5633 | gpointer user_data); | |
5634 | void (*finalize) (GSource *source); | |
5635 | ||
5636 | ||
5637 | GSourceFunc closure_callback; | |
5638 | GSourceDummyMarshal closure_marshal; | |
5639 | }; | |
5640 | # 116 "/usr/include/glib-2.0/glib/gmain.h" | |
5641 | typedef struct _GPollFD GPollFD; | |
5642 | typedef gint (*GPollFunc) (GPollFD *ufds, | |
5643 | guint nfsd, | |
5644 | gint timeout_); | |
5645 | ||
5646 | struct _GPollFD | |
5647 | { | |
5648 | gint fd; | |
5649 | gushort events; | |
5650 | gushort revents; | |
5651 | }; | |
5652 | # 138 "/usr/include/glib-2.0/glib/gmain.h" | |
5653 | GMainContext *g_main_context_new (void); | |
5654 | GMainContext *g_main_context_ref (GMainContext *context); | |
5655 | void g_main_context_unref (GMainContext *context); | |
5656 | GMainContext *g_main_context_default (void); | |
5657 | ||
5658 | gboolean g_main_context_iteration (GMainContext *context, | |
5659 | gboolean may_block); | |
5660 | gboolean g_main_context_pending (GMainContext *context); | |
5661 | ||
5662 | ||
5663 | ||
5664 | GSource *g_main_context_find_source_by_id (GMainContext *context, | |
5665 | guint source_id); | |
5666 | GSource *g_main_context_find_source_by_user_data (GMainContext *context, | |
5667 | gpointer user_data); | |
5668 | GSource *g_main_context_find_source_by_funcs_user_data (GMainContext *context, | |
5669 | GSourceFuncs *funcs, | |
5670 | gpointer user_data); | |
5671 | ||
5672 | ||
5673 | ||
5674 | void g_main_context_wakeup (GMainContext *context); | |
5675 | gboolean g_main_context_acquire (GMainContext *context); | |
5676 | void g_main_context_release (GMainContext *context); | |
5677 | gboolean g_main_context_is_owner (GMainContext *context); | |
5678 | gboolean g_main_context_wait (GMainContext *context, | |
5679 | GCond *cond, | |
5680 | GMutex *mutex); | |
5681 | ||
5682 | gboolean g_main_context_prepare (GMainContext *context, | |
5683 | gint *priority); | |
5684 | gint g_main_context_query (GMainContext *context, | |
5685 | gint max_priority, | |
5686 | gint *timeout_, | |
5687 | GPollFD *fds, | |
5688 | gint n_fds); | |
5689 | gint g_main_context_check (GMainContext *context, | |
5690 | gint max_priority, | |
5691 | GPollFD *fds, | |
5692 | gint n_fds); | |
5693 | void g_main_context_dispatch (GMainContext *context); | |
5694 | ||
5695 | void g_main_context_set_poll_func (GMainContext *context, | |
5696 | GPollFunc func); | |
5697 | GPollFunc g_main_context_get_poll_func (GMainContext *context); | |
5698 | ||
5699 | ||
5700 | ||
5701 | void g_main_context_add_poll (GMainContext *context, | |
5702 | GPollFD *fd, | |
5703 | gint priority); | |
5704 | void g_main_context_remove_poll (GMainContext *context, | |
5705 | GPollFD *fd); | |
5706 | ||
5707 | gint g_main_depth (void); | |
5708 | GSource *g_main_current_source (void); | |
5709 | ||
5710 | ||
5711 | ||
5712 | ||
5713 | GMainLoop *g_main_loop_new (GMainContext *context, | |
5714 | gboolean is_running); | |
5715 | void g_main_loop_run (GMainLoop *loop); | |
5716 | void g_main_loop_quit (GMainLoop *loop); | |
5717 | GMainLoop *g_main_loop_ref (GMainLoop *loop); | |
5718 | void g_main_loop_unref (GMainLoop *loop); | |
5719 | gboolean g_main_loop_is_running (GMainLoop *loop); | |
5720 | GMainContext *g_main_loop_get_context (GMainLoop *loop); | |
5721 | ||
5722 | ||
5723 | ||
5724 | GSource *g_source_new (GSourceFuncs *source_funcs, | |
5725 | guint struct_size); | |
5726 | GSource *g_source_ref (GSource *source); | |
5727 | void g_source_unref (GSource *source); | |
5728 | ||
5729 | guint g_source_attach (GSource *source, | |
5730 | GMainContext *context); | |
5731 | void g_source_destroy (GSource *source); | |
5732 | ||
5733 | void g_source_set_priority (GSource *source, | |
5734 | gint priority); | |
5735 | gint g_source_get_priority (GSource *source); | |
5736 | void g_source_set_can_recurse (GSource *source, | |
5737 | gboolean can_recurse); | |
5738 | gboolean g_source_get_can_recurse (GSource *source); | |
5739 | guint g_source_get_id (GSource *source); | |
5740 | ||
5741 | GMainContext *g_source_get_context (GSource *source); | |
5742 | ||
5743 | void g_source_set_callback (GSource *source, | |
5744 | GSourceFunc func, | |
5745 | gpointer data, | |
5746 | GDestroyNotify notify); | |
5747 | ||
5748 | void g_source_set_funcs (GSource *source, | |
5749 | GSourceFuncs *funcs); | |
5750 | gboolean g_source_is_destroyed (GSource *source); | |
5751 | ||
5752 | ||
5753 | void g_source_set_callback_indirect (GSource *source, | |
5754 | gpointer callback_data, | |
5755 | GSourceCallbackFuncs *callback_funcs); | |
5756 | ||
5757 | void g_source_add_poll (GSource *source, | |
5758 | GPollFD *fd); | |
5759 | void g_source_remove_poll (GSource *source, | |
5760 | GPollFD *fd); | |
5761 | ||
5762 | void g_source_get_current_time (GSource *source, | |
5763 | GTimeVal *timeval); | |
5764 | ||
5765 | ||
5766 | ||
5767 | ||
5768 | ||
5769 | ||
5770 | ||
5771 | GSource *g_idle_source_new (void); | |
5772 | GSource *g_child_watch_source_new (GPid pid); | |
5773 | GSource *g_timeout_source_new (guint interval); | |
5774 | ||
5775 | ||
5776 | ||
5777 | void g_get_current_time (GTimeVal *result); | |
5778 | # 287 "/usr/include/glib-2.0/glib/gmain.h" | |
5779 | gboolean g_source_remove (guint tag); | |
5780 | gboolean g_source_remove_by_user_data (gpointer user_data); | |
5781 | gboolean g_source_remove_by_funcs_user_data (GSourceFuncs *funcs, | |
5782 | gpointer user_data); | |
5783 | ||
5784 | ||
5785 | guint g_timeout_add_full (gint priority, | |
5786 | guint interval, | |
5787 | GSourceFunc function, | |
5788 | gpointer data, | |
5789 | GDestroyNotify notify); | |
5790 | guint g_timeout_add (guint interval, | |
5791 | GSourceFunc function, | |
5792 | gpointer data); | |
5793 | guint g_child_watch_add_full (gint priority, | |
5794 | GPid pid, | |
5795 | GChildWatchFunc function, | |
5796 | gpointer data, | |
5797 | GDestroyNotify notify); | |
5798 | guint g_child_watch_add (GPid pid, | |
5799 | GChildWatchFunc function, | |
5800 | gpointer data); | |
5801 | guint g_idle_add (GSourceFunc function, | |
5802 | gpointer data); | |
5803 | guint g_idle_add_full (gint priority, | |
5804 | GSourceFunc function, | |
5805 | gpointer data, | |
5806 | GDestroyNotify notify); | |
5807 | gboolean g_idle_remove_by_data (gpointer data); | |
5808 | ||
5809 | ||
5810 | extern GSourceFuncs g_timeout_funcs; | |
5811 | extern GSourceFuncs g_child_watch_funcs; | |
5812 | extern GSourceFuncs g_idle_funcs; | |
5813 | ||
5814 | ||
5815 | # 32 "/usr/include/glib-2.0/glib/giochannel.h" 2 | |
5816 | # 1 "/usr/include/glib-2.0/glib/gstring.h" 1 | |
5817 | # 31 "/usr/include/glib-2.0/glib/gstring.h" | |
5818 | # 1 "/usr/include/glib-2.0/glib/gunicode.h" 1 | |
5819 | # 28 "/usr/include/glib-2.0/glib/gunicode.h" | |
5820 | ||
5821 | ||
5822 | typedef guint32 gunichar; | |
5823 | typedef guint16 gunichar2; | |
5824 | ||
5825 | ||
5826 | ||
5827 | ||
5828 | typedef enum | |
5829 | { | |
5830 | G_UNICODE_CONTROL, | |
5831 | G_UNICODE_FORMAT, | |
5832 | G_UNICODE_UNASSIGNED, | |
5833 | G_UNICODE_PRIVATE_USE, | |
5834 | G_UNICODE_SURROGATE, | |
5835 | G_UNICODE_LOWERCASE_LETTER, | |
5836 | G_UNICODE_MODIFIER_LETTER, | |
5837 | G_UNICODE_OTHER_LETTER, | |
5838 | G_UNICODE_TITLECASE_LETTER, | |
5839 | G_UNICODE_UPPERCASE_LETTER, | |
5840 | G_UNICODE_COMBINING_MARK, | |
5841 | G_UNICODE_ENCLOSING_MARK, | |
5842 | G_UNICODE_NON_SPACING_MARK, | |
5843 | G_UNICODE_DECIMAL_NUMBER, | |
5844 | G_UNICODE_LETTER_NUMBER, | |
5845 | G_UNICODE_OTHER_NUMBER, | |
5846 | G_UNICODE_CONNECT_PUNCTUATION, | |
5847 | G_UNICODE_DASH_PUNCTUATION, | |
5848 | G_UNICODE_CLOSE_PUNCTUATION, | |
5849 | G_UNICODE_FINAL_PUNCTUATION, | |
5850 | G_UNICODE_INITIAL_PUNCTUATION, | |
5851 | G_UNICODE_OTHER_PUNCTUATION, | |
5852 | G_UNICODE_OPEN_PUNCTUATION, | |
5853 | G_UNICODE_CURRENCY_SYMBOL, | |
5854 | G_UNICODE_MODIFIER_SYMBOL, | |
5855 | G_UNICODE_MATH_SYMBOL, | |
5856 | G_UNICODE_OTHER_SYMBOL, | |
5857 | G_UNICODE_LINE_SEPARATOR, | |
5858 | G_UNICODE_PARAGRAPH_SEPARATOR, | |
5859 | G_UNICODE_SPACE_SEPARATOR | |
5860 | } GUnicodeType; | |
5861 | ||
5862 | ||
5863 | ||
5864 | ||
5865 | ||
5866 | ||
5867 | typedef enum | |
5868 | { | |
5869 | G_UNICODE_BREAK_MANDATORY, | |
5870 | G_UNICODE_BREAK_CARRIAGE_RETURN, | |
5871 | G_UNICODE_BREAK_LINE_FEED, | |
5872 | G_UNICODE_BREAK_COMBINING_MARK, | |
5873 | G_UNICODE_BREAK_SURROGATE, | |
5874 | G_UNICODE_BREAK_ZERO_WIDTH_SPACE, | |
5875 | G_UNICODE_BREAK_INSEPARABLE, | |
5876 | G_UNICODE_BREAK_NON_BREAKING_GLUE, | |
5877 | G_UNICODE_BREAK_CONTINGENT, | |
5878 | G_UNICODE_BREAK_SPACE, | |
5879 | G_UNICODE_BREAK_AFTER, | |
5880 | G_UNICODE_BREAK_BEFORE, | |
5881 | G_UNICODE_BREAK_BEFORE_AND_AFTER, | |
5882 | G_UNICODE_BREAK_HYPHEN, | |
5883 | G_UNICODE_BREAK_NON_STARTER, | |
5884 | G_UNICODE_BREAK_OPEN_PUNCTUATION, | |
5885 | G_UNICODE_BREAK_CLOSE_PUNCTUATION, | |
5886 | G_UNICODE_BREAK_QUOTATION, | |
5887 | G_UNICODE_BREAK_EXCLAMATION, | |
5888 | G_UNICODE_BREAK_IDEOGRAPHIC, | |
5889 | G_UNICODE_BREAK_NUMERIC, | |
5890 | G_UNICODE_BREAK_INFIX_SEPARATOR, | |
5891 | G_UNICODE_BREAK_SYMBOL, | |
5892 | G_UNICODE_BREAK_ALPHABETIC, | |
5893 | G_UNICODE_BREAK_PREFIX, | |
5894 | G_UNICODE_BREAK_POSTFIX, | |
5895 | G_UNICODE_BREAK_COMPLEX_CONTEXT, | |
5896 | G_UNICODE_BREAK_AMBIGUOUS, | |
5897 | G_UNICODE_BREAK_UNKNOWN, | |
5898 | G_UNICODE_BREAK_NEXT_LINE, | |
5899 | G_UNICODE_BREAK_WORD_JOINER, | |
5900 | G_UNICODE_BREAK_HANGUL_L_JAMO, | |
5901 | G_UNICODE_BREAK_HANGUL_V_JAMO, | |
5902 | G_UNICODE_BREAK_HANGUL_T_JAMO, | |
5903 | G_UNICODE_BREAK_HANGUL_LV_SYLLABLE, | |
5904 | G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE | |
5905 | } GUnicodeBreakType; | |
5906 | ||
5907 | ||
5908 | ||
5909 | ||
5910 | ||
5911 | ||
5912 | ||
5913 | gboolean g_get_charset (const char **charset); | |
5914 | ||
5915 | ||
5916 | ||
5917 | gboolean g_unichar_isalnum (gunichar c) __attribute__((__const__)); | |
5918 | gboolean g_unichar_isalpha (gunichar c) __attribute__((__const__)); | |
5919 | gboolean g_unichar_iscntrl (gunichar c) __attribute__((__const__)); | |
5920 | gboolean g_unichar_isdigit (gunichar c) __attribute__((__const__)); | |
5921 | gboolean g_unichar_isgraph (gunichar c) __attribute__((__const__)); | |
5922 | gboolean g_unichar_islower (gunichar c) __attribute__((__const__)); | |
5923 | gboolean g_unichar_isprint (gunichar c) __attribute__((__const__)); | |
5924 | gboolean g_unichar_ispunct (gunichar c) __attribute__((__const__)); | |
5925 | gboolean g_unichar_isspace (gunichar c) __attribute__((__const__)); | |
5926 | gboolean g_unichar_isupper (gunichar c) __attribute__((__const__)); | |
5927 | gboolean g_unichar_isxdigit (gunichar c) __attribute__((__const__)); | |
5928 | gboolean g_unichar_istitle (gunichar c) __attribute__((__const__)); | |
5929 | gboolean g_unichar_isdefined (gunichar c) __attribute__((__const__)); | |
5930 | gboolean g_unichar_iswide (gunichar c) __attribute__((__const__)); | |
5931 | gboolean g_unichar_iswide_cjk(gunichar c) __attribute__((__const__)); | |
5932 | ||
5933 | ||
5934 | ||
5935 | gunichar g_unichar_toupper (gunichar c) __attribute__((__const__)); | |
5936 | gunichar g_unichar_tolower (gunichar c) __attribute__((__const__)); | |
5937 | gunichar g_unichar_totitle (gunichar c) __attribute__((__const__)); | |
5938 | ||
5939 | ||
5940 | ||
5941 | gint g_unichar_digit_value (gunichar c) __attribute__((__const__)); | |
5942 | ||
5943 | gint g_unichar_xdigit_value (gunichar c) __attribute__((__const__)); | |
5944 | ||
5945 | ||
5946 | GUnicodeType g_unichar_type (gunichar c) __attribute__((__const__)); | |
5947 | ||
5948 | ||
5949 | GUnicodeBreakType g_unichar_break_type (gunichar c) __attribute__((__const__)); | |
5950 | ||
5951 | ||
5952 | ||
5953 | ||
5954 | ||
5955 | void g_unicode_canonical_ordering (gunichar *string, | |
5956 | gsize len); | |
5957 | ||
5958 | ||
5959 | ||
5960 | ||
5961 | gunichar *g_unicode_canonical_decomposition (gunichar ch, | |
5962 | gsize *result_len) __attribute__((__malloc__)); | |
5963 | ||
5964 | ||
5965 | ||
5966 | extern const gchar * const g_utf8_skip; | |
5967 | ||
5968 | ||
5969 | ||
5970 | gunichar g_utf8_get_char (const gchar *p); | |
5971 | gunichar g_utf8_get_char_validated (const gchar *p, | |
5972 | gssize max_len); | |
5973 | ||
5974 | gchar* g_utf8_offset_to_pointer (const gchar *str, | |
5975 | glong offset); | |
5976 | glong g_utf8_pointer_to_offset (const gchar *str, | |
5977 | const gchar *pos); | |
5978 | gchar* g_utf8_prev_char (const gchar *p); | |
5979 | gchar* g_utf8_find_next_char (const gchar *p, | |
5980 | const gchar *end); | |
5981 | gchar* g_utf8_find_prev_char (const gchar *str, | |
5982 | const gchar *p); | |
5983 | ||
5984 | glong g_utf8_strlen (const gchar *p, | |
5985 | gssize max); | |
5986 | ||
5987 | ||
5988 | gchar* g_utf8_strncpy (gchar *dest, | |
5989 | const gchar *src, | |
5990 | gsize n); | |
5991 | ||
5992 | ||
5993 | ||
5994 | gchar* g_utf8_strchr (const gchar *p, | |
5995 | gssize len, | |
5996 | gunichar c); | |
5997 | gchar* g_utf8_strrchr (const gchar *p, | |
5998 | gssize len, | |
5999 | gunichar c); | |
6000 | gchar* g_utf8_strreverse (const gchar *str, | |
6001 | gssize len); | |
6002 | ||
6003 | gunichar2 *g_utf8_to_utf16 (const gchar *str, | |
6004 | glong len, | |
6005 | glong *items_read, | |
6006 | glong *items_written, | |
6007 | GError **error) __attribute__((__malloc__)); | |
6008 | gunichar * g_utf8_to_ucs4 (const gchar *str, | |
6009 | glong len, | |
6010 | glong *items_read, | |
6011 | glong *items_written, | |
6012 | GError **error) __attribute__((__malloc__)); | |
6013 | gunichar * g_utf8_to_ucs4_fast (const gchar *str, | |
6014 | glong len, | |
6015 | glong *items_written) __attribute__((__malloc__)); | |
6016 | gunichar * g_utf16_to_ucs4 (const gunichar2 *str, | |
6017 | glong len, | |
6018 | glong *items_read, | |
6019 | glong *items_written, | |
6020 | GError **error) __attribute__((__malloc__)); | |
6021 | gchar* g_utf16_to_utf8 (const gunichar2 *str, | |
6022 | glong len, | |
6023 | glong *items_read, | |
6024 | glong *items_written, | |
6025 | GError **error) __attribute__((__malloc__)); | |
6026 | gunichar2 *g_ucs4_to_utf16 (const gunichar *str, | |
6027 | glong len, | |
6028 | glong *items_read, | |
6029 | glong *items_written, | |
6030 | GError **error) __attribute__((__malloc__)); | |
6031 | gchar* g_ucs4_to_utf8 (const gunichar *str, | |
6032 | glong len, | |
6033 | glong *items_read, | |
6034 | glong *items_written, | |
6035 | GError **error) __attribute__((__malloc__)); | |
6036 | ||
6037 | ||
6038 | ||
6039 | ||
6040 | ||
6041 | gint g_unichar_to_utf8 (gunichar c, | |
6042 | gchar *outbuf); | |
6043 | ||
6044 | ||
6045 | ||
6046 | ||
6047 | ||
6048 | gboolean g_utf8_validate (const gchar *str, | |
6049 | gssize max_len, | |
6050 | const gchar **end); | |
6051 | ||
6052 | ||
6053 | gboolean g_unichar_validate (gunichar ch); | |
6054 | ||
6055 | gchar *g_utf8_strup (const gchar *str, | |
6056 | gssize len) __attribute__((__malloc__)); | |
6057 | gchar *g_utf8_strdown (const gchar *str, | |
6058 | gssize len) __attribute__((__malloc__)); | |
6059 | gchar *g_utf8_casefold (const gchar *str, | |
6060 | gssize len) __attribute__((__malloc__)); | |
6061 | ||
6062 | typedef enum { | |
6063 | G_NORMALIZE_DEFAULT, | |
6064 | G_NORMALIZE_NFD = G_NORMALIZE_DEFAULT, | |
6065 | G_NORMALIZE_DEFAULT_COMPOSE, | |
6066 | G_NORMALIZE_NFC = G_NORMALIZE_DEFAULT_COMPOSE, | |
6067 | G_NORMALIZE_ALL, | |
6068 | G_NORMALIZE_NFKD = G_NORMALIZE_ALL, | |
6069 | G_NORMALIZE_ALL_COMPOSE, | |
6070 | G_NORMALIZE_NFKC = G_NORMALIZE_ALL_COMPOSE | |
6071 | } GNormalizeMode; | |
6072 | ||
6073 | gchar *g_utf8_normalize (const gchar *str, | |
6074 | gssize len, | |
6075 | GNormalizeMode mode) __attribute__((__malloc__)); | |
6076 | ||
6077 | gint g_utf8_collate (const gchar *str1, | |
6078 | const gchar *str2); | |
6079 | gchar *g_utf8_collate_key (const gchar *str, | |
6080 | gssize len) __attribute__((__malloc__)); | |
6081 | gchar *g_utf8_collate_key_for_filename (const gchar *str, | |
6082 | gssize len) __attribute__((__malloc__)); | |
6083 | ||
6084 | gboolean g_unichar_get_mirror_char (gunichar ch, | |
6085 | gunichar *mirrored_ch); | |
6086 | ||
6087 | ||
6088 | ||
6089 | gchar *_g_utf8_make_valid (const gchar *name); | |
6090 | ||
6091 | ||
6092 | ||
6093 | # 32 "/usr/include/glib-2.0/glib/gstring.h" 2 | |
6094 | # 1 "/usr/include/glib-2.0/glib/gutils.h" 1 | |
6095 | # 31 "/usr/include/glib-2.0/glib/gutils.h" | |
6096 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stdarg.h" 1 3 4 | |
6097 | # 105 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stdarg.h" 3 4 | |
6098 | typedef __gnuc_va_list va_list; | |
6099 | # 32 "/usr/include/glib-2.0/glib/gutils.h" 2 | |
6100 | ||
6101 | ||
6102 | # 116 "/usr/include/glib-2.0/glib/gutils.h" | |
6103 | const gchar* g_get_user_name (void); | |
6104 | const gchar* g_get_real_name (void); | |
6105 | const gchar* g_get_home_dir (void); | |
6106 | const gchar* g_get_tmp_dir (void); | |
6107 | const gchar* g_get_host_name (void); | |
6108 | gchar* g_get_prgname (void); | |
6109 | void g_set_prgname (const gchar *prgname); | |
6110 | const gchar* g_get_application_name (void); | |
6111 | void g_set_application_name (const gchar *application_name); | |
6112 | ||
6113 | const gchar* g_get_user_data_dir (void); | |
6114 | const gchar* g_get_user_config_dir (void); | |
6115 | const gchar* g_get_user_cache_dir (void); | |
6116 | const gchar* const * g_get_system_data_dirs (void); | |
6117 | # 144 "/usr/include/glib-2.0/glib/gutils.h" | |
6118 | const gchar* const * g_get_system_config_dirs (void); | |
6119 | ||
6120 | const gchar* const * g_get_language_names (void); | |
6121 | ||
6122 | typedef struct _GDebugKey GDebugKey; | |
6123 | struct _GDebugKey | |
6124 | { | |
6125 | gchar *key; | |
6126 | guint value; | |
6127 | }; | |
6128 | ||
6129 | ||
6130 | ||
6131 | guint g_parse_debug_string (const gchar *string, | |
6132 | const GDebugKey *keys, | |
6133 | guint nkeys); | |
6134 | ||
6135 | gint g_snprintf (gchar *string, | |
6136 | gulong n, | |
6137 | gchar const *format, | |
6138 | ...) __attribute__((__format__ (__printf__, 3, 4))); | |
6139 | gint g_vsnprintf (gchar *string, | |
6140 | gulong n, | |
6141 | gchar const *format, | |
6142 | va_list args); | |
6143 | ||
6144 | ||
6145 | gboolean g_path_is_absolute (const gchar *file_name); | |
6146 | ||
6147 | ||
6148 | const gchar* g_path_skip_root (const gchar *file_name); | |
6149 | # 192 "/usr/include/glib-2.0/glib/gutils.h" | |
6150 | gchar* g_get_current_dir (void); | |
6151 | gchar* g_path_get_basename (const gchar *file_name) __attribute__((__malloc__)); | |
6152 | gchar* g_path_get_dirname (const gchar *file_name) __attribute__((__malloc__)); | |
6153 | ||
6154 | ||
6155 | void g_nullify_pointer (gpointer *nullify_location); | |
6156 | # 208 "/usr/include/glib-2.0/glib/gutils.h" | |
6157 | const gchar* g_getenv (const gchar *variable); | |
6158 | gboolean g_setenv (const gchar *variable, | |
6159 | const gchar *value, | |
6160 | gboolean overwrite); | |
6161 | void g_unsetenv (const gchar *variable); | |
6162 | gchar** g_listenv (void); | |
6163 | const gchar* _g_getenv_nomalloc (const gchar *variable, | |
6164 | gchar buffer[1024]); | |
6165 | ||
6166 | ||
6167 | ||
6168 | ||
6169 | ||
6170 | typedef void (*GVoidFunc) (void); | |
6171 | # 232 "/usr/include/glib-2.0/glib/gutils.h" | |
6172 | void g_atexit (GVoidFunc func); | |
6173 | # 246 "/usr/include/glib-2.0/glib/gutils.h" | |
6174 | gchar* g_find_program_in_path (const gchar *program); | |
6175 | ||
6176 | ||
6177 | ||
6178 | extern inline gint g_bit_nth_lsf (gulong mask, | |
6179 | gint nth_bit); | |
6180 | extern inline gint g_bit_nth_msf (gulong mask, | |
6181 | gint nth_bit); | |
6182 | extern inline guint g_bit_storage (gulong number); | |
6183 | ||
6184 | ||
6185 | ||
6186 | ||
6187 | typedef struct _GTrashStack GTrashStack; | |
6188 | struct _GTrashStack | |
6189 | { | |
6190 | GTrashStack *next; | |
6191 | }; | |
6192 | ||
6193 | extern inline void g_trash_stack_push (GTrashStack **stack_p, | |
6194 | gpointer data_p); | |
6195 | extern inline gpointer g_trash_stack_pop (GTrashStack **stack_p); | |
6196 | extern inline gpointer g_trash_stack_peek (GTrashStack **stack_p); | |
6197 | extern inline guint g_trash_stack_height (GTrashStack **stack_p); | |
6198 | ||
6199 | ||
6200 | ||
6201 | ||
6202 | extern inline gint | |
6203 | g_bit_nth_lsf (gulong mask, | |
6204 | gint nth_bit) | |
6205 | { | |
6206 | do | |
6207 | { | |
6208 | nth_bit++; | |
6209 | if (mask & (1UL << nth_bit)) | |
6210 | return nth_bit; | |
6211 | } | |
6212 | while (nth_bit < ((8 * 8) - 1)); | |
6213 | return -1; | |
6214 | } | |
6215 | extern inline gint | |
6216 | g_bit_nth_msf (gulong mask, | |
6217 | gint nth_bit) | |
6218 | { | |
6219 | if (nth_bit < 0) | |
6220 | nth_bit = 8 * 8; | |
6221 | do | |
6222 | { | |
6223 | nth_bit--; | |
6224 | if (mask & (1UL << nth_bit)) | |
6225 | return nth_bit; | |
6226 | } | |
6227 | while (nth_bit > 0); | |
6228 | return -1; | |
6229 | } | |
6230 | extern inline guint | |
6231 | g_bit_storage (gulong number) | |
6232 | { | |
6233 | register guint n_bits = 0; | |
6234 | ||
6235 | do | |
6236 | { | |
6237 | n_bits++; | |
6238 | number >>= 1; | |
6239 | } | |
6240 | while (number); | |
6241 | return n_bits; | |
6242 | } | |
6243 | extern inline void | |
6244 | g_trash_stack_push (GTrashStack **stack_p, | |
6245 | gpointer data_p) | |
6246 | { | |
6247 | GTrashStack *data = (GTrashStack *) data_p; | |
6248 | ||
6249 | data->next = *stack_p; | |
6250 | *stack_p = data; | |
6251 | } | |
6252 | extern inline gpointer | |
6253 | g_trash_stack_pop (GTrashStack **stack_p) | |
6254 | { | |
6255 | GTrashStack *data; | |
6256 | ||
6257 | data = *stack_p; | |
6258 | if (data) | |
6259 | { | |
6260 | *stack_p = data->next; | |
6261 | ||
6262 | ||
6263 | ||
6264 | data->next = ((void *)0); | |
6265 | } | |
6266 | ||
6267 | return data; | |
6268 | } | |
6269 | extern inline gpointer | |
6270 | g_trash_stack_peek (GTrashStack **stack_p) | |
6271 | { | |
6272 | GTrashStack *data; | |
6273 | ||
6274 | data = *stack_p; | |
6275 | ||
6276 | return data; | |
6277 | } | |
6278 | extern inline guint | |
6279 | g_trash_stack_height (GTrashStack **stack_p) | |
6280 | { | |
6281 | GTrashStack *data; | |
6282 | guint i = 0; | |
6283 | ||
6284 | for (data = *stack_p; data; data = data->next) | |
6285 | i++; | |
6286 | ||
6287 | return i; | |
6288 | } | |
6289 | ||
6290 | ||
6291 | ||
6292 | ||
6293 | ||
6294 | ||
6295 | extern const guint glib_major_version; | |
6296 | extern const guint glib_minor_version; | |
6297 | extern const guint glib_micro_version; | |
6298 | extern const guint glib_interface_age; | |
6299 | extern const guint glib_binary_age; | |
6300 | ||
6301 | const gchar * glib_check_version (guint required_major, | |
6302 | guint required_minor, | |
6303 | guint required_micro); | |
6304 | ||
6305 | ||
6306 | ||
6307 | ||
6308 | ||
6309 | ||
6310 | ||
6311 | ||
6312 | # 33 "/usr/include/glib-2.0/glib/gstring.h" 2 | |
6313 | ||
6314 | ||
6315 | ||
6316 | typedef struct _GString GString; | |
6317 | typedef struct _GStringChunk GStringChunk; | |
6318 | ||
6319 | struct _GString | |
6320 | { | |
6321 | gchar *str; | |
6322 | gsize len; | |
6323 | gsize allocated_len; | |
6324 | }; | |
6325 | ||
6326 | ||
6327 | ||
6328 | GStringChunk* g_string_chunk_new (gsize size); | |
6329 | void g_string_chunk_free (GStringChunk *chunk); | |
6330 | gchar* g_string_chunk_insert (GStringChunk *chunk, | |
6331 | const gchar *string); | |
6332 | gchar* g_string_chunk_insert_len (GStringChunk *chunk, | |
6333 | const gchar *string, | |
6334 | gssize len); | |
6335 | gchar* g_string_chunk_insert_const (GStringChunk *chunk, | |
6336 | const gchar *string); | |
6337 | ||
6338 | ||
6339 | ||
6340 | ||
6341 | GString* g_string_new (const gchar *init); | |
6342 | GString* g_string_new_len (const gchar *init, | |
6343 | gssize len); | |
6344 | GString* g_string_sized_new (gsize dfl_size); | |
6345 | gchar* g_string_free (GString *string, | |
6346 | gboolean free_segment); | |
6347 | gboolean g_string_equal (const GString *v, | |
6348 | const GString *v2); | |
6349 | guint g_string_hash (const GString *str); | |
6350 | GString* g_string_assign (GString *string, | |
6351 | const gchar *rval); | |
6352 | GString* g_string_truncate (GString *string, | |
6353 | gsize len); | |
6354 | GString* g_string_set_size (GString *string, | |
6355 | gsize len); | |
6356 | GString* g_string_insert_len (GString *string, | |
6357 | gssize pos, | |
6358 | const gchar *val, | |
6359 | gssize len); | |
6360 | GString* g_string_append (GString *string, | |
6361 | const gchar *val); | |
6362 | GString* g_string_append_len (GString *string, | |
6363 | const gchar *val, | |
6364 | gssize len); | |
6365 | GString* g_string_append_c (GString *string, | |
6366 | gchar c); | |
6367 | GString* g_string_append_unichar (GString *string, | |
6368 | gunichar wc); | |
6369 | GString* g_string_prepend (GString *string, | |
6370 | const gchar *val); | |
6371 | GString* g_string_prepend_c (GString *string, | |
6372 | gchar c); | |
6373 | GString* g_string_prepend_unichar (GString *string, | |
6374 | gunichar wc); | |
6375 | GString* g_string_prepend_len (GString *string, | |
6376 | const gchar *val, | |
6377 | gssize len); | |
6378 | GString* g_string_insert (GString *string, | |
6379 | gssize pos, | |
6380 | const gchar *val); | |
6381 | GString* g_string_insert_c (GString *string, | |
6382 | gssize pos, | |
6383 | gchar c); | |
6384 | GString* g_string_insert_unichar (GString *string, | |
6385 | gssize pos, | |
6386 | gunichar wc); | |
6387 | GString* g_string_erase (GString *string, | |
6388 | gssize pos, | |
6389 | gssize len); | |
6390 | GString* g_string_ascii_down (GString *string); | |
6391 | GString* g_string_ascii_up (GString *string); | |
6392 | void g_string_printf (GString *string, | |
6393 | const gchar *format, | |
6394 | ...) __attribute__((__format__ (__printf__, 2, 3))); | |
6395 | void g_string_append_printf (GString *string, | |
6396 | const gchar *format, | |
6397 | ...) __attribute__((__format__ (__printf__, 2, 3))); | |
6398 | ||
6399 | ||
6400 | ||
6401 | static inline GString* | |
6402 | g_string_append_c_inline (GString *gstring, | |
6403 | gchar c) | |
6404 | { | |
6405 | if (gstring->len + 1 < gstring->allocated_len) | |
6406 | { | |
6407 | gstring->str[gstring->len++] = c; | |
6408 | gstring->str[gstring->len] = 0; | |
6409 | } | |
6410 | else | |
6411 | g_string_insert_c (gstring, -1, c); | |
6412 | return gstring; | |
6413 | } | |
6414 | # 154 "/usr/include/glib-2.0/glib/gstring.h" | |
6415 | ||
6416 | # 33 "/usr/include/glib-2.0/glib/giochannel.h" 2 | |
6417 | ||
6418 | ||
6419 | ||
6420 | ||
6421 | ||
6422 | ||
6423 | typedef struct _GIOChannel GIOChannel; | |
6424 | typedef struct _GIOFuncs GIOFuncs; | |
6425 | ||
6426 | typedef enum | |
6427 | { | |
6428 | G_IO_ERROR_NONE, | |
6429 | G_IO_ERROR_AGAIN, | |
6430 | G_IO_ERROR_INVAL, | |
6431 | G_IO_ERROR_UNKNOWN | |
6432 | } GIOError; | |
6433 | ||
6434 | ||
6435 | ||
6436 | typedef enum | |
6437 | { | |
6438 | ||
6439 | G_IO_CHANNEL_ERROR_FBIG, | |
6440 | G_IO_CHANNEL_ERROR_INVAL, | |
6441 | G_IO_CHANNEL_ERROR_IO, | |
6442 | G_IO_CHANNEL_ERROR_ISDIR, | |
6443 | G_IO_CHANNEL_ERROR_NOSPC, | |
6444 | G_IO_CHANNEL_ERROR_NXIO, | |
6445 | G_IO_CHANNEL_ERROR_OVERFLOW, | |
6446 | G_IO_CHANNEL_ERROR_PIPE, | |
6447 | ||
6448 | G_IO_CHANNEL_ERROR_FAILED | |
6449 | } GIOChannelError; | |
6450 | ||
6451 | typedef enum | |
6452 | { | |
6453 | G_IO_STATUS_ERROR, | |
6454 | G_IO_STATUS_NORMAL, | |
6455 | G_IO_STATUS_EOF, | |
6456 | G_IO_STATUS_AGAIN | |
6457 | } GIOStatus; | |
6458 | ||
6459 | typedef enum | |
6460 | { | |
6461 | G_SEEK_CUR, | |
6462 | G_SEEK_SET, | |
6463 | G_SEEK_END | |
6464 | } GSeekType; | |
6465 | ||
6466 | typedef enum | |
6467 | { | |
6468 | G_IO_IN =1, | |
6469 | G_IO_OUT =4, | |
6470 | G_IO_PRI =2, | |
6471 | G_IO_ERR =8, | |
6472 | G_IO_HUP =16, | |
6473 | G_IO_NVAL =32 | |
6474 | } GIOCondition; | |
6475 | ||
6476 | typedef enum | |
6477 | { | |
6478 | G_IO_FLAG_APPEND = 1 << 0, | |
6479 | G_IO_FLAG_NONBLOCK = 1 << 1, | |
6480 | G_IO_FLAG_IS_READABLE = 1 << 2, | |
6481 | G_IO_FLAG_IS_WRITEABLE = 1 << 3, | |
6482 | G_IO_FLAG_IS_SEEKABLE = 1 << 4, | |
6483 | G_IO_FLAG_MASK = (1 << 5) - 1, | |
6484 | G_IO_FLAG_GET_MASK = G_IO_FLAG_MASK, | |
6485 | G_IO_FLAG_SET_MASK = G_IO_FLAG_APPEND | G_IO_FLAG_NONBLOCK | |
6486 | } GIOFlags; | |
6487 | ||
6488 | struct _GIOChannel | |
6489 | { | |
6490 | ||
6491 | guint ref_count; | |
6492 | GIOFuncs *funcs; | |
6493 | ||
6494 | gchar *encoding; | |
6495 | GIConv read_cd; | |
6496 | GIConv write_cd; | |
6497 | gchar *line_term; | |
6498 | guint line_term_len; | |
6499 | ||
6500 | gsize buf_size; | |
6501 | GString *read_buf; | |
6502 | GString *encoded_read_buf; | |
6503 | GString *write_buf; | |
6504 | gchar partial_write_buf[6]; | |
6505 | ||
6506 | ||
6507 | ||
6508 | guint use_buffer : 1; | |
6509 | guint do_encode : 1; | |
6510 | guint close_on_unref : 1; | |
6511 | guint is_readable : 1; | |
6512 | guint is_writeable : 1; | |
6513 | guint is_seekable : 1; | |
6514 | ||
6515 | gpointer reserved1; | |
6516 | gpointer reserved2; | |
6517 | }; | |
6518 | ||
6519 | typedef gboolean (*GIOFunc) (GIOChannel *source, | |
6520 | GIOCondition condition, | |
6521 | gpointer data); | |
6522 | struct _GIOFuncs | |
6523 | { | |
6524 | GIOStatus (*io_read) (GIOChannel *channel, | |
6525 | gchar *buf, | |
6526 | gsize count, | |
6527 | gsize *bytes_read, | |
6528 | GError **err); | |
6529 | GIOStatus (*io_write) (GIOChannel *channel, | |
6530 | const gchar *buf, | |
6531 | gsize count, | |
6532 | gsize *bytes_written, | |
6533 | GError **err); | |
6534 | GIOStatus (*io_seek) (GIOChannel *channel, | |
6535 | gint64 offset, | |
6536 | GSeekType type, | |
6537 | GError **err); | |
6538 | GIOStatus (*io_close) (GIOChannel *channel, | |
6539 | GError **err); | |
6540 | GSource* (*io_create_watch) (GIOChannel *channel, | |
6541 | GIOCondition condition); | |
6542 | void (*io_free) (GIOChannel *channel); | |
6543 | GIOStatus (*io_set_flags) (GIOChannel *channel, | |
6544 | GIOFlags flags, | |
6545 | GError **err); | |
6546 | GIOFlags (*io_get_flags) (GIOChannel *channel); | |
6547 | }; | |
6548 | ||
6549 | void g_io_channel_init (GIOChannel *channel); | |
6550 | GIOChannel *g_io_channel_ref (GIOChannel *channel); | |
6551 | void g_io_channel_unref (GIOChannel *channel); | |
6552 | # 184 "/usr/include/glib-2.0/glib/giochannel.h" | |
6553 | GIOStatus g_io_channel_shutdown (GIOChannel *channel, | |
6554 | gboolean flush, | |
6555 | GError **err); | |
6556 | guint g_io_add_watch_full (GIOChannel *channel, | |
6557 | gint priority, | |
6558 | GIOCondition condition, | |
6559 | GIOFunc func, | |
6560 | gpointer user_data, | |
6561 | GDestroyNotify notify); | |
6562 | GSource * g_io_create_watch (GIOChannel *channel, | |
6563 | GIOCondition condition); | |
6564 | guint g_io_add_watch (GIOChannel *channel, | |
6565 | GIOCondition condition, | |
6566 | GIOFunc func, | |
6567 | gpointer user_data); | |
6568 | ||
6569 | ||
6570 | ||
6571 | ||
6572 | void g_io_channel_set_buffer_size (GIOChannel *channel, | |
6573 | gsize size); | |
6574 | gsize g_io_channel_get_buffer_size (GIOChannel *channel); | |
6575 | GIOCondition g_io_channel_get_buffer_condition (GIOChannel *channel); | |
6576 | GIOStatus g_io_channel_set_flags (GIOChannel *channel, | |
6577 | GIOFlags flags, | |
6578 | GError **error); | |
6579 | GIOFlags g_io_channel_get_flags (GIOChannel *channel); | |
6580 | void g_io_channel_set_line_term (GIOChannel *channel, | |
6581 | const gchar *line_term, | |
6582 | gint length); | |
6583 | const gchar* g_io_channel_get_line_term (GIOChannel *channel, | |
6584 | gint *length); | |
6585 | void g_io_channel_set_buffered (GIOChannel *channel, | |
6586 | gboolean buffered); | |
6587 | gboolean g_io_channel_get_buffered (GIOChannel *channel); | |
6588 | GIOStatus g_io_channel_set_encoding (GIOChannel *channel, | |
6589 | const gchar *encoding, | |
6590 | GError **error); | |
6591 | const gchar* g_io_channel_get_encoding (GIOChannel *channel); | |
6592 | void g_io_channel_set_close_on_unref (GIOChannel *channel, | |
6593 | gboolean do_close); | |
6594 | gboolean g_io_channel_get_close_on_unref (GIOChannel *channel); | |
6595 | ||
6596 | ||
6597 | GIOStatus g_io_channel_flush (GIOChannel *channel, | |
6598 | GError **error); | |
6599 | GIOStatus g_io_channel_read_line (GIOChannel *channel, | |
6600 | gchar **str_return, | |
6601 | gsize *length, | |
6602 | gsize *terminator_pos, | |
6603 | GError **error); | |
6604 | GIOStatus g_io_channel_read_line_string (GIOChannel *channel, | |
6605 | GString *buffer, | |
6606 | gsize *terminator_pos, | |
6607 | GError **error); | |
6608 | GIOStatus g_io_channel_read_to_end (GIOChannel *channel, | |
6609 | gchar **str_return, | |
6610 | gsize *length, | |
6611 | GError **error); | |
6612 | GIOStatus g_io_channel_read_chars (GIOChannel *channel, | |
6613 | gchar *buf, | |
6614 | gsize count, | |
6615 | gsize *bytes_read, | |
6616 | GError **error); | |
6617 | GIOStatus g_io_channel_read_unichar (GIOChannel *channel, | |
6618 | gunichar *thechar, | |
6619 | GError **error); | |
6620 | GIOStatus g_io_channel_write_chars (GIOChannel *channel, | |
6621 | const gchar *buf, | |
6622 | gssize count, | |
6623 | gsize *bytes_written, | |
6624 | GError **error); | |
6625 | GIOStatus g_io_channel_write_unichar (GIOChannel *channel, | |
6626 | gunichar thechar, | |
6627 | GError **error); | |
6628 | GIOStatus g_io_channel_seek_position (GIOChannel *channel, | |
6629 | gint64 offset, | |
6630 | GSeekType type, | |
6631 | GError **error); | |
6632 | ||
6633 | ||
6634 | ||
6635 | ||
6636 | GIOChannel* g_io_channel_new_file (const gchar *filename, | |
6637 | const gchar *mode, | |
6638 | GError **error); | |
6639 | ||
6640 | ||
6641 | ||
6642 | GQuark g_io_channel_error_quark (void); | |
6643 | GIOChannelError g_io_channel_error_from_errno (gint en); | |
6644 | # 294 "/usr/include/glib-2.0/glib/giochannel.h" | |
6645 | GIOChannel* g_io_channel_unix_new (int fd); | |
6646 | gint g_io_channel_unix_get_fd (GIOChannel *channel); | |
6647 | ||
6648 | ||
6649 | ||
6650 | extern GSourceFuncs g_io_watch_funcs; | |
6651 | # 352 "/usr/include/glib-2.0/glib/giochannel.h" | |
6652 | ||
6653 | # 48 "/usr/include/glib-2.0/glib.h" 2 | |
6654 | # 1 "/usr/include/glib-2.0/glib/gkeyfile.h" 1 | |
6655 | # 28 "/usr/include/glib-2.0/glib/gkeyfile.h" | |
6656 | ||
6657 | ||
6658 | typedef enum | |
6659 | { | |
6660 | G_KEY_FILE_ERROR_UNKNOWN_ENCODING, | |
6661 | G_KEY_FILE_ERROR_PARSE, | |
6662 | G_KEY_FILE_ERROR_NOT_FOUND, | |
6663 | G_KEY_FILE_ERROR_KEY_NOT_FOUND, | |
6664 | G_KEY_FILE_ERROR_GROUP_NOT_FOUND, | |
6665 | G_KEY_FILE_ERROR_INVALID_VALUE | |
6666 | } GKeyFileError; | |
6667 | ||
6668 | ||
6669 | ||
6670 | GQuark g_key_file_error_quark (void); | |
6671 | ||
6672 | typedef struct _GKeyFile GKeyFile; | |
6673 | ||
6674 | typedef enum | |
6675 | { | |
6676 | G_KEY_FILE_NONE = 0, | |
6677 | G_KEY_FILE_KEEP_COMMENTS = 1 << 0, | |
6678 | G_KEY_FILE_KEEP_TRANSLATIONS = 1 << 1 | |
6679 | } GKeyFileFlags; | |
6680 | ||
6681 | GKeyFile *g_key_file_new (void); | |
6682 | void g_key_file_free (GKeyFile *key_file); | |
6683 | void g_key_file_set_list_separator (GKeyFile *key_file, | |
6684 | gchar separator); | |
6685 | gboolean g_key_file_load_from_file (GKeyFile *key_file, | |
6686 | const gchar *file, | |
6687 | GKeyFileFlags flags, | |
6688 | GError **error); | |
6689 | gboolean g_key_file_load_from_data (GKeyFile *key_file, | |
6690 | const gchar *data, | |
6691 | gsize length, | |
6692 | GKeyFileFlags flags, | |
6693 | GError **error); | |
6694 | gboolean g_key_file_load_from_data_dirs (GKeyFile *key_file, | |
6695 | const gchar *file, | |
6696 | gchar **full_path, | |
6697 | GKeyFileFlags flags, | |
6698 | GError **error); | |
6699 | gchar *g_key_file_to_data (GKeyFile *key_file, | |
6700 | gsize *length, | |
6701 | GError **error) __attribute__((__malloc__)); | |
6702 | gchar *g_key_file_get_start_group (GKeyFile *key_file) __attribute__((__malloc__)); | |
6703 | gchar **g_key_file_get_groups (GKeyFile *key_file, | |
6704 | gsize *length) __attribute__((__malloc__)); | |
6705 | gchar **g_key_file_get_keys (GKeyFile *key_file, | |
6706 | const gchar *group_name, | |
6707 | gsize *length, | |
6708 | GError **error) __attribute__((__malloc__)); | |
6709 | gboolean g_key_file_has_group (GKeyFile *key_file, | |
6710 | const gchar *group_name); | |
6711 | gboolean g_key_file_has_key (GKeyFile *key_file, | |
6712 | const gchar *group_name, | |
6713 | const gchar *key, | |
6714 | GError **error); | |
6715 | gchar *g_key_file_get_value (GKeyFile *key_file, | |
6716 | const gchar *group_name, | |
6717 | const gchar *key, | |
6718 | GError **error) __attribute__((__malloc__)); | |
6719 | void g_key_file_set_value (GKeyFile *key_file, | |
6720 | const gchar *group_name, | |
6721 | const gchar *key, | |
6722 | const gchar *value); | |
6723 | gchar *g_key_file_get_string (GKeyFile *key_file, | |
6724 | const gchar *group_name, | |
6725 | const gchar *key, | |
6726 | GError **error) __attribute__((__malloc__)); | |
6727 | void g_key_file_set_string (GKeyFile *key_file, | |
6728 | const gchar *group_name, | |
6729 | const gchar *key, | |
6730 | const gchar *string); | |
6731 | gchar *g_key_file_get_locale_string (GKeyFile *key_file, | |
6732 | const gchar *group_name, | |
6733 | const gchar *key, | |
6734 | const gchar *locale, | |
6735 | GError **error) __attribute__((__malloc__)); | |
6736 | void g_key_file_set_locale_string (GKeyFile *key_file, | |
6737 | const gchar *group_name, | |
6738 | const gchar *key, | |
6739 | const gchar *locale, | |
6740 | const gchar *string); | |
6741 | gboolean g_key_file_get_boolean (GKeyFile *key_file, | |
6742 | const gchar *group_name, | |
6743 | const gchar *key, | |
6744 | GError **error); | |
6745 | void g_key_file_set_boolean (GKeyFile *key_file, | |
6746 | const gchar *group_name, | |
6747 | const gchar *key, | |
6748 | gboolean value); | |
6749 | gint g_key_file_get_integer (GKeyFile *key_file, | |
6750 | const gchar *group_name, | |
6751 | const gchar *key, | |
6752 | GError **error); | |
6753 | void g_key_file_set_integer (GKeyFile *key_file, | |
6754 | const gchar *group_name, | |
6755 | const gchar *key, | |
6756 | gint value); | |
6757 | gdouble g_key_file_get_double (GKeyFile *key_file, | |
6758 | const gchar *group_name, | |
6759 | const gchar *key, | |
6760 | GError **error); | |
6761 | void g_key_file_set_double (GKeyFile *key_file, | |
6762 | const gchar *group_name, | |
6763 | const gchar *key, | |
6764 | gdouble value); | |
6765 | gchar **g_key_file_get_string_list (GKeyFile *key_file, | |
6766 | const gchar *group_name, | |
6767 | const gchar *key, | |
6768 | gsize *length, | |
6769 | GError **error) __attribute__((__malloc__)); | |
6770 | void g_key_file_set_string_list (GKeyFile *key_file, | |
6771 | const gchar *group_name, | |
6772 | const gchar *key, | |
6773 | const gchar * const list[], | |
6774 | gsize length); | |
6775 | gchar **g_key_file_get_locale_string_list (GKeyFile *key_file, | |
6776 | const gchar *group_name, | |
6777 | const gchar *key, | |
6778 | const gchar *locale, | |
6779 | gsize *length, | |
6780 | GError **error) __attribute__((__malloc__)); | |
6781 | void g_key_file_set_locale_string_list (GKeyFile *key_file, | |
6782 | const gchar *group_name, | |
6783 | const gchar *key, | |
6784 | const gchar *locale, | |
6785 | const gchar * const list[], | |
6786 | gsize length); | |
6787 | gboolean *g_key_file_get_boolean_list (GKeyFile *key_file, | |
6788 | const gchar *group_name, | |
6789 | const gchar *key, | |
6790 | gsize *length, | |
6791 | GError **error) __attribute__((__malloc__)); | |
6792 | void g_key_file_set_boolean_list (GKeyFile *key_file, | |
6793 | const gchar *group_name, | |
6794 | const gchar *key, | |
6795 | gboolean list[], | |
6796 | gsize length); | |
6797 | gint *g_key_file_get_integer_list (GKeyFile *key_file, | |
6798 | const gchar *group_name, | |
6799 | const gchar *key, | |
6800 | gsize *length, | |
6801 | GError **error) __attribute__((__malloc__)); | |
6802 | void g_key_file_set_double_list (GKeyFile *key_file, | |
6803 | const gchar *group_name, | |
6804 | const gchar *key, | |
6805 | gdouble list[], | |
6806 | gsize length); | |
6807 | gdouble *g_key_file_get_double_list (GKeyFile *key_file, | |
6808 | const gchar *group_name, | |
6809 | const gchar *key, | |
6810 | gsize *length, | |
6811 | GError **error) __attribute__((__malloc__)); | |
6812 | void g_key_file_set_integer_list (GKeyFile *key_file, | |
6813 | const gchar *group_name, | |
6814 | const gchar *key, | |
6815 | gint list[], | |
6816 | gsize length); | |
6817 | void g_key_file_set_comment (GKeyFile *key_file, | |
6818 | const gchar *group_name, | |
6819 | const gchar *key, | |
6820 | const gchar *comment, | |
6821 | GError **error); | |
6822 | gchar *g_key_file_get_comment (GKeyFile *key_file, | |
6823 | const gchar *group_name, | |
6824 | const gchar *key, | |
6825 | GError **error) __attribute__((__malloc__)); | |
6826 | ||
6827 | void g_key_file_remove_comment (GKeyFile *key_file, | |
6828 | const gchar *group_name, | |
6829 | const gchar *key, | |
6830 | GError **error); | |
6831 | void g_key_file_remove_key (GKeyFile *key_file, | |
6832 | const gchar *group_name, | |
6833 | const gchar *key, | |
6834 | GError **error); | |
6835 | void g_key_file_remove_group (GKeyFile *key_file, | |
6836 | const gchar *group_name, | |
6837 | GError **error); | |
6838 | ||
6839 | ||
6840 | # 49 "/usr/include/glib-2.0/glib.h" 2 | |
6841 | ||
6842 | ||
6843 | ||
6844 | # 1 "/usr/include/glib-2.0/glib/gmappedfile.h" 1 | |
6845 | # 26 "/usr/include/glib-2.0/glib/gmappedfile.h" | |
6846 | ||
6847 | ||
6848 | typedef struct _GMappedFile GMappedFile; | |
6849 | ||
6850 | GMappedFile *g_mapped_file_new (const gchar *filename, | |
6851 | gboolean writable, | |
6852 | GError **error) __attribute__((__malloc__)); | |
6853 | gsize g_mapped_file_get_length (GMappedFile *file); | |
6854 | gchar *g_mapped_file_get_contents (GMappedFile *file); | |
6855 | void g_mapped_file_free (GMappedFile *file); | |
6856 | ||
6857 | ||
6858 | # 53 "/usr/include/glib-2.0/glib.h" 2 | |
6859 | # 1 "/usr/include/glib-2.0/glib/gmarkup.h" 1 | |
6860 | # 28 "/usr/include/glib-2.0/glib/gmarkup.h" | |
6861 | ||
6862 | ||
6863 | typedef enum | |
6864 | { | |
6865 | G_MARKUP_ERROR_BAD_UTF8, | |
6866 | G_MARKUP_ERROR_EMPTY, | |
6867 | G_MARKUP_ERROR_PARSE, | |
6868 | ||
6869 | ||
6870 | ||
6871 | G_MARKUP_ERROR_UNKNOWN_ELEMENT, | |
6872 | G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, | |
6873 | G_MARKUP_ERROR_INVALID_CONTENT | |
6874 | } GMarkupError; | |
6875 | ||
6876 | ||
6877 | ||
6878 | GQuark g_markup_error_quark (void); | |
6879 | ||
6880 | typedef enum | |
6881 | { | |
6882 | G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0, | |
6883 | G_MARKUP_TREAT_CDATA_AS_TEXT = 1 << 1 | |
6884 | } GMarkupParseFlags; | |
6885 | ||
6886 | typedef struct _GMarkupParseContext GMarkupParseContext; | |
6887 | typedef struct _GMarkupParser GMarkupParser; | |
6888 | ||
6889 | struct _GMarkupParser | |
6890 | { | |
6891 | ||
6892 | void (*start_element) (GMarkupParseContext *context, | |
6893 | const gchar *element_name, | |
6894 | const gchar **attribute_names, | |
6895 | const gchar **attribute_values, | |
6896 | gpointer user_data, | |
6897 | GError **error); | |
6898 | ||
6899 | ||
6900 | void (*end_element) (GMarkupParseContext *context, | |
6901 | const gchar *element_name, | |
6902 | gpointer user_data, | |
6903 | GError **error); | |
6904 | ||
6905 | ||
6906 | ||
6907 | void (*text) (GMarkupParseContext *context, | |
6908 | const gchar *text, | |
6909 | gsize text_len, | |
6910 | gpointer user_data, | |
6911 | GError **error); | |
6912 | ||
6913 | ||
6914 | ||
6915 | ||
6916 | ||
6917 | ||
6918 | void (*passthrough) (GMarkupParseContext *context, | |
6919 | const gchar *passthrough_text, | |
6920 | gsize text_len, | |
6921 | gpointer user_data, | |
6922 | GError **error); | |
6923 | ||
6924 | ||
6925 | ||
6926 | ||
6927 | void (*error) (GMarkupParseContext *context, | |
6928 | GError *error, | |
6929 | gpointer user_data); | |
6930 | }; | |
6931 | ||
6932 | GMarkupParseContext *g_markup_parse_context_new (const GMarkupParser *parser, | |
6933 | GMarkupParseFlags flags, | |
6934 | gpointer user_data, | |
6935 | GDestroyNotify user_data_dnotify); | |
6936 | void g_markup_parse_context_free (GMarkupParseContext *context); | |
6937 | gboolean g_markup_parse_context_parse (GMarkupParseContext *context, | |
6938 | const gchar *text, | |
6939 | gssize text_len, | |
6940 | GError **error); | |
6941 | ||
6942 | gboolean g_markup_parse_context_end_parse (GMarkupParseContext *context, | |
6943 | GError **error); | |
6944 | const gchar *g_markup_parse_context_get_element (GMarkupParseContext *context); | |
6945 | ||
6946 | ||
6947 | void g_markup_parse_context_get_position (GMarkupParseContext *context, | |
6948 | gint *line_number, | |
6949 | gint *char_number); | |
6950 | ||
6951 | ||
6952 | gchar* g_markup_escape_text (const gchar *text, | |
6953 | gssize length); | |
6954 | ||
6955 | gchar *g_markup_printf_escaped (const char *format, | |
6956 | ...) __attribute__((__format__ (__printf__, 1, 2))); | |
6957 | gchar *g_markup_vprintf_escaped (const char *format, | |
6958 | va_list args); | |
6959 | ||
6960 | ||
6961 | # 54 "/usr/include/glib-2.0/glib.h" 2 | |
6962 | ||
6963 | # 1 "/usr/include/glib-2.0/glib/gmessages.h" 1 | |
6964 | # 37 "/usr/include/glib-2.0/glib/gmessages.h" | |
6965 | ||
6966 | # 38 "/usr/include/glib-2.0/glib/gmessages.h" 3 | |
6967 | ||
6968 | ||
6969 | ||
6970 | ||
6971 | ||
6972 | ||
6973 | gsize g_printf_string_upper_bound (const gchar* format, | |
6974 | va_list args); | |
6975 | # 54 "/usr/include/glib-2.0/glib/gmessages.h" 3 | |
6976 | typedef enum | |
6977 | { | |
6978 | ||
6979 | G_LOG_FLAG_RECURSION = 1 << 0, | |
6980 | G_LOG_FLAG_FATAL = 1 << 1, | |
6981 | ||
6982 | ||
6983 | G_LOG_LEVEL_ERROR = 1 << 2, | |
6984 | G_LOG_LEVEL_CRITICAL = 1 << 3, | |
6985 | G_LOG_LEVEL_WARNING = 1 << 4, | |
6986 | G_LOG_LEVEL_MESSAGE = 1 << 5, | |
6987 | G_LOG_LEVEL_INFO = 1 << 6, | |
6988 | G_LOG_LEVEL_DEBUG = 1 << 7, | |
6989 | ||
6990 | G_LOG_LEVEL_MASK = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL) | |
6991 | } GLogLevelFlags; | |
6992 | ||
6993 | ||
6994 | ||
6995 | ||
6996 | typedef void (*GLogFunc) (const gchar *log_domain, | |
6997 | GLogLevelFlags log_level, | |
6998 | const gchar *message, | |
6999 | gpointer user_data); | |
7000 | ||
7001 | ||
7002 | ||
7003 | guint g_log_set_handler (const gchar *log_domain, | |
7004 | GLogLevelFlags log_levels, | |
7005 | GLogFunc log_func, | |
7006 | gpointer user_data); | |
7007 | void g_log_remove_handler (const gchar *log_domain, | |
7008 | guint handler_id); | |
7009 | void g_log_default_handler (const gchar *log_domain, | |
7010 | GLogLevelFlags log_level, | |
7011 | const gchar *message, | |
7012 | gpointer unused_data); | |
7013 | GLogFunc g_log_set_default_handler (GLogFunc log_func, | |
7014 | gpointer user_data); | |
7015 | void g_log (const gchar *log_domain, | |
7016 | GLogLevelFlags log_level, | |
7017 | const gchar *format, | |
7018 | ...) __attribute__((__format__ (__printf__, 3, 4))); | |
7019 | void g_logv (const gchar *log_domain, | |
7020 | GLogLevelFlags log_level, | |
7021 | const gchar *format, | |
7022 | va_list args); | |
7023 | GLogLevelFlags g_log_set_fatal_mask (const gchar *log_domain, | |
7024 | GLogLevelFlags fatal_mask); | |
7025 | GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask); | |
7026 | ||
7027 | ||
7028 | void _g_log_fallback_handler (const gchar *log_domain, | |
7029 | GLogLevelFlags log_level, | |
7030 | const gchar *message, | |
7031 | gpointer unused_data) __attribute__((visibility("hidden"))); | |
7032 | ||
7033 | ||
7034 | void g_return_if_fail_warning (const char *log_domain, | |
7035 | const char *pretty_function, | |
7036 | const char *expression); | |
7037 | void g_assert_warning (const char *log_domain, | |
7038 | const char *file, | |
7039 | const int line, | |
7040 | const char *pretty_function, | |
7041 | const char *expression) __attribute__((__noreturn__)); | |
7042 | # 205 "/usr/include/glib-2.0/glib/gmessages.h" 3 | |
7043 | typedef void (*GPrintFunc) (const gchar *string); | |
7044 | void g_print (const gchar *format, | |
7045 | ...) __attribute__((__format__ (__printf__, 1, 2))); | |
7046 | GPrintFunc g_set_print_handler (GPrintFunc func); | |
7047 | void g_printerr (const gchar *format, | |
7048 | ...) __attribute__((__format__ (__printf__, 1, 2))); | |
7049 | GPrintFunc g_set_printerr_handler (GPrintFunc func); | |
7050 | # 361 "/usr/include/glib-2.0/glib/gmessages.h" 3 | |
7051 | ||
7052 | # 56 "/usr/include/glib-2.0/glib.h" 2 | |
7053 | # 1 "/usr/include/glib-2.0/glib/gnode.h" 1 | |
7054 | # 32 "/usr/include/glib-2.0/glib/gnode.h" | |
7055 | ||
7056 | ||
7057 | typedef struct _GNode GNode; | |
7058 | ||
7059 | ||
7060 | typedef enum | |
7061 | { | |
7062 | G_TRAVERSE_LEAVES = 1 << 0, | |
7063 | G_TRAVERSE_NON_LEAVES = 1 << 1, | |
7064 | G_TRAVERSE_ALL = G_TRAVERSE_LEAVES | G_TRAVERSE_NON_LEAVES, | |
7065 | G_TRAVERSE_MASK = 0x03, | |
7066 | G_TRAVERSE_LEAFS = G_TRAVERSE_LEAVES, | |
7067 | G_TRAVERSE_NON_LEAFS = G_TRAVERSE_NON_LEAVES | |
7068 | } GTraverseFlags; | |
7069 | ||
7070 | ||
7071 | typedef enum | |
7072 | { | |
7073 | G_IN_ORDER, | |
7074 | G_PRE_ORDER, | |
7075 | G_POST_ORDER, | |
7076 | G_LEVEL_ORDER | |
7077 | } GTraverseType; | |
7078 | ||
7079 | typedef gboolean (*GNodeTraverseFunc) (GNode *node, | |
7080 | gpointer data); | |
7081 | typedef void (*GNodeForeachFunc) (GNode *node, | |
7082 | gpointer data); | |
7083 | typedef gpointer (*GCopyFunc) (gconstpointer src, | |
7084 | gpointer data); | |
7085 | ||
7086 | ||
7087 | ||
7088 | struct _GNode | |
7089 | { | |
7090 | gpointer data; | |
7091 | GNode *next; | |
7092 | GNode *prev; | |
7093 | GNode *parent; | |
7094 | GNode *children; | |
7095 | }; | |
7096 | ||
7097 | ||
7098 | ||
7099 | ||
7100 | ||
7101 | ||
7102 | GNode* g_node_new (gpointer data); | |
7103 | void g_node_destroy (GNode *root); | |
7104 | void g_node_unlink (GNode *node); | |
7105 | GNode* g_node_copy_deep (GNode *node, | |
7106 | GCopyFunc copy_func, | |
7107 | gpointer data); | |
7108 | GNode* g_node_copy (GNode *node); | |
7109 | GNode* g_node_insert (GNode *parent, | |
7110 | gint position, | |
7111 | GNode *node); | |
7112 | GNode* g_node_insert_before (GNode *parent, | |
7113 | GNode *sibling, | |
7114 | GNode *node); | |
7115 | GNode* g_node_insert_after (GNode *parent, | |
7116 | GNode *sibling, | |
7117 | GNode *node); | |
7118 | GNode* g_node_prepend (GNode *parent, | |
7119 | GNode *node); | |
7120 | guint g_node_n_nodes (GNode *root, | |
7121 | GTraverseFlags flags); | |
7122 | GNode* g_node_get_root (GNode *node); | |
7123 | gboolean g_node_is_ancestor (GNode *node, | |
7124 | GNode *descendant); | |
7125 | guint g_node_depth (GNode *node); | |
7126 | GNode* g_node_find (GNode *root, | |
7127 | GTraverseType order, | |
7128 | GTraverseFlags flags, | |
7129 | gpointer data); | |
7130 | # 125 "/usr/include/glib-2.0/glib/gnode.h" | |
7131 | void g_node_traverse (GNode *root, | |
7132 | GTraverseType order, | |
7133 | GTraverseFlags flags, | |
7134 | gint max_depth, | |
7135 | GNodeTraverseFunc func, | |
7136 | gpointer data); | |
7137 | ||
7138 | ||
7139 | ||
7140 | ||
7141 | ||
7142 | ||
7143 | guint g_node_max_height (GNode *root); | |
7144 | ||
7145 | void g_node_children_foreach (GNode *node, | |
7146 | GTraverseFlags flags, | |
7147 | GNodeForeachFunc func, | |
7148 | gpointer data); | |
7149 | void g_node_reverse_children (GNode *node); | |
7150 | guint g_node_n_children (GNode *node); | |
7151 | GNode* g_node_nth_child (GNode *node, | |
7152 | guint n); | |
7153 | GNode* g_node_last_child (GNode *node); | |
7154 | GNode* g_node_find_child (GNode *node, | |
7155 | GTraverseFlags flags, | |
7156 | gpointer data); | |
7157 | gint g_node_child_position (GNode *node, | |
7158 | GNode *child); | |
7159 | gint g_node_child_index (GNode *node, | |
7160 | gpointer data); | |
7161 | ||
7162 | GNode* g_node_first_sibling (GNode *node); | |
7163 | GNode* g_node_last_sibling (GNode *node); | |
7164 | # 170 "/usr/include/glib-2.0/glib/gnode.h" | |
7165 | ||
7166 | # 57 "/usr/include/glib-2.0/glib.h" 2 | |
7167 | # 1 "/usr/include/glib-2.0/glib/goption.h" 1 | |
7168 | # 27 "/usr/include/glib-2.0/glib/goption.h" | |
7169 | ||
7170 | ||
7171 | typedef struct _GOptionContext GOptionContext; | |
7172 | typedef struct _GOptionGroup GOptionGroup; | |
7173 | typedef struct _GOptionEntry GOptionEntry; | |
7174 | ||
7175 | typedef enum | |
7176 | { | |
7177 | G_OPTION_FLAG_HIDDEN = 1 << 0, | |
7178 | G_OPTION_FLAG_IN_MAIN = 1 << 1, | |
7179 | G_OPTION_FLAG_REVERSE = 1 << 2, | |
7180 | G_OPTION_FLAG_NO_ARG = 1 << 3, | |
7181 | G_OPTION_FLAG_FILENAME = 1 << 4, | |
7182 | G_OPTION_FLAG_OPTIONAL_ARG = 1 << 5, | |
7183 | G_OPTION_FLAG_NOALIAS = 1 << 6 | |
7184 | } GOptionFlags; | |
7185 | ||
7186 | typedef enum | |
7187 | { | |
7188 | G_OPTION_ARG_NONE, | |
7189 | G_OPTION_ARG_STRING, | |
7190 | G_OPTION_ARG_INT, | |
7191 | G_OPTION_ARG_CALLBACK, | |
7192 | G_OPTION_ARG_FILENAME, | |
7193 | G_OPTION_ARG_STRING_ARRAY, | |
7194 | G_OPTION_ARG_FILENAME_ARRAY, | |
7195 | G_OPTION_ARG_DOUBLE, | |
7196 | G_OPTION_ARG_INT64 | |
7197 | } GOptionArg; | |
7198 | ||
7199 | typedef gboolean (*GOptionArgFunc) (const gchar *option_name, | |
7200 | const gchar *value, | |
7201 | gpointer data, | |
7202 | GError **error); | |
7203 | ||
7204 | typedef gboolean (*GOptionParseFunc) (GOptionContext *context, | |
7205 | GOptionGroup *group, | |
7206 | gpointer data, | |
7207 | GError **error); | |
7208 | ||
7209 | typedef void (*GOptionErrorFunc) (GOptionContext *context, | |
7210 | GOptionGroup *group, | |
7211 | gpointer data, | |
7212 | GError **error); | |
7213 | ||
7214 | ||
7215 | ||
7216 | typedef enum | |
7217 | { | |
7218 | G_OPTION_ERROR_UNKNOWN_OPTION, | |
7219 | G_OPTION_ERROR_BAD_VALUE, | |
7220 | G_OPTION_ERROR_FAILED | |
7221 | } GOptionError; | |
7222 | ||
7223 | GQuark g_option_error_quark (void); | |
7224 | ||
7225 | ||
7226 | struct _GOptionEntry | |
7227 | { | |
7228 | const gchar *long_name; | |
7229 | gchar short_name; | |
7230 | gint flags; | |
7231 | ||
7232 | GOptionArg arg; | |
7233 | gpointer arg_data; | |
7234 | ||
7235 | const gchar *description; | |
7236 | const gchar *arg_description; | |
7237 | }; | |
7238 | ||
7239 | ||
7240 | ||
7241 | GOptionContext *g_option_context_new (const gchar *parameter_string); | |
7242 | void g_option_context_set_summary (GOptionContext *context, | |
7243 | const gchar *summary); | |
7244 | const gchar *g_option_context_get_summary (GOptionContext *context); | |
7245 | void g_option_context_set_description (GOptionContext *context, | |
7246 | const gchar *description); | |
7247 | const gchar *g_option_context_get_description (GOptionContext *context); | |
7248 | void g_option_context_free (GOptionContext *context); | |
7249 | void g_option_context_set_help_enabled (GOptionContext *context, | |
7250 | gboolean help_enabled); | |
7251 | gboolean g_option_context_get_help_enabled (GOptionContext *context); | |
7252 | void g_option_context_set_ignore_unknown_options (GOptionContext *context, | |
7253 | gboolean ignore_unknown); | |
7254 | gboolean g_option_context_get_ignore_unknown_options (GOptionContext *context); | |
7255 | ||
7256 | void g_option_context_add_main_entries (GOptionContext *context, | |
7257 | const GOptionEntry *entries, | |
7258 | const gchar *translation_domain); | |
7259 | gboolean g_option_context_parse (GOptionContext *context, | |
7260 | gint *argc, | |
7261 | gchar ***argv, | |
7262 | GError **error); | |
7263 | void g_option_context_set_translate_func (GOptionContext *context, | |
7264 | GTranslateFunc func, | |
7265 | gpointer data, | |
7266 | GDestroyNotify destroy_notify); | |
7267 | void g_option_context_set_translation_domain (GOptionContext *context, | |
7268 | const gchar *domain); | |
7269 | ||
7270 | void g_option_context_add_group (GOptionContext *context, | |
7271 | GOptionGroup *group); | |
7272 | void g_option_context_set_main_group (GOptionContext *context, | |
7273 | GOptionGroup *group); | |
7274 | GOptionGroup *g_option_context_get_main_group (GOptionContext *context); | |
7275 | ||
7276 | ||
7277 | GOptionGroup *g_option_group_new (const gchar *name, | |
7278 | const gchar *description, | |
7279 | const gchar *help_description, | |
7280 | gpointer user_data, | |
7281 | GDestroyNotify destroy); | |
7282 | void g_option_group_set_parse_hooks (GOptionGroup *group, | |
7283 | GOptionParseFunc pre_parse_func, | |
7284 | GOptionParseFunc post_parse_func); | |
7285 | void g_option_group_set_error_hook (GOptionGroup *group, | |
7286 | GOptionErrorFunc error_func); | |
7287 | void g_option_group_free (GOptionGroup *group); | |
7288 | void g_option_group_add_entries (GOptionGroup *group, | |
7289 | const GOptionEntry *entries); | |
7290 | void g_option_group_set_translate_func (GOptionGroup *group, | |
7291 | GTranslateFunc func, | |
7292 | gpointer data, | |
7293 | GDestroyNotify destroy_notify); | |
7294 | void g_option_group_set_translation_domain (GOptionGroup *group, | |
7295 | const gchar *domain); | |
7296 | ||
7297 | ||
7298 | ||
7299 | # 58 "/usr/include/glib-2.0/glib.h" 2 | |
7300 | # 1 "/usr/include/glib-2.0/glib/gpattern.h" 1 | |
7301 | # 24 "/usr/include/glib-2.0/glib/gpattern.h" | |
7302 | ||
7303 | ||
7304 | ||
7305 | typedef struct _GPatternSpec GPatternSpec; | |
7306 | ||
7307 | GPatternSpec* g_pattern_spec_new (const gchar *pattern); | |
7308 | void g_pattern_spec_free (GPatternSpec *pspec); | |
7309 | gboolean g_pattern_spec_equal (GPatternSpec *pspec1, | |
7310 | GPatternSpec *pspec2); | |
7311 | gboolean g_pattern_match (GPatternSpec *pspec, | |
7312 | guint string_length, | |
7313 | const gchar *string, | |
7314 | const gchar *string_reversed); | |
7315 | gboolean g_pattern_match_string (GPatternSpec *pspec, | |
7316 | const gchar *string); | |
7317 | gboolean g_pattern_match_simple (const gchar *pattern, | |
7318 | const gchar *string); | |
7319 | ||
7320 | ||
7321 | # 59 "/usr/include/glib-2.0/glib.h" 2 | |
7322 | # 1 "/usr/include/glib-2.0/glib/gprimes.h" 1 | |
7323 | # 32 "/usr/include/glib-2.0/glib/gprimes.h" | |
7324 | ||
7325 | # 43 "/usr/include/glib-2.0/glib/gprimes.h" | |
7326 | guint g_spaced_primes_closest (guint num) __attribute__((__const__)); | |
7327 | ||
7328 | ||
7329 | # 60 "/usr/include/glib-2.0/glib.h" 2 | |
7330 | # 1 "/usr/include/glib-2.0/glib/gqsort.h" 1 | |
7331 | # 33 "/usr/include/glib-2.0/glib/gqsort.h" | |
7332 | ||
7333 | ||
7334 | void g_qsort_with_data (gconstpointer pbase, | |
7335 | gint total_elems, | |
7336 | gsize size, | |
7337 | GCompareDataFunc compare_func, | |
7338 | gpointer user_data); | |
7339 | ||
7340 | ||
7341 | # 61 "/usr/include/glib-2.0/glib.h" 2 | |
7342 | ||
7343 | # 1 "/usr/include/glib-2.0/glib/gqueue.h" 1 | |
7344 | # 32 "/usr/include/glib-2.0/glib/gqueue.h" | |
7345 | ||
7346 | ||
7347 | typedef struct _GQueue GQueue; | |
7348 | ||
7349 | struct _GQueue | |
7350 | { | |
7351 | GList *head; | |
7352 | GList *tail; | |
7353 | guint length; | |
7354 | }; | |
7355 | ||
7356 | ||
7357 | ||
7358 | GQueue* g_queue_new (void); | |
7359 | void g_queue_free (GQueue *queue); | |
7360 | gboolean g_queue_is_empty (GQueue *queue); | |
7361 | guint g_queue_get_length (GQueue *queue); | |
7362 | void g_queue_reverse (GQueue *queue); | |
7363 | GQueue * g_queue_copy (GQueue *queue); | |
7364 | void g_queue_foreach (GQueue *queue, | |
7365 | GFunc func, | |
7366 | gpointer user_data); | |
7367 | GList * g_queue_find (GQueue *queue, | |
7368 | gconstpointer data); | |
7369 | GList * g_queue_find_custom (GQueue *queue, | |
7370 | gconstpointer data, | |
7371 | GCompareFunc func); | |
7372 | void g_queue_sort (GQueue *queue, | |
7373 | GCompareDataFunc compare_func, | |
7374 | gpointer user_data); | |
7375 | ||
7376 | void g_queue_push_head (GQueue *queue, | |
7377 | gpointer data); | |
7378 | void g_queue_push_tail (GQueue *queue, | |
7379 | gpointer data); | |
7380 | void g_queue_push_nth (GQueue *queue, | |
7381 | gpointer data, | |
7382 | gint n); | |
7383 | gpointer g_queue_pop_head (GQueue *queue); | |
7384 | gpointer g_queue_pop_tail (GQueue *queue); | |
7385 | gpointer g_queue_pop_nth (GQueue *queue, | |
7386 | guint n); | |
7387 | gpointer g_queue_peek_head (GQueue *queue); | |
7388 | gpointer g_queue_peek_tail (GQueue *queue); | |
7389 | gpointer g_queue_peek_nth (GQueue *queue, | |
7390 | guint n); | |
7391 | gint g_queue_index (GQueue *queue, | |
7392 | gconstpointer data); | |
7393 | void g_queue_remove (GQueue *queue, | |
7394 | gconstpointer data); | |
7395 | void g_queue_remove_all (GQueue *queue, | |
7396 | gconstpointer data); | |
7397 | void g_queue_insert_before (GQueue *queue, | |
7398 | GList *sibling, | |
7399 | gpointer data); | |
7400 | void g_queue_insert_after (GQueue *queue, | |
7401 | GList *sibling, | |
7402 | gpointer data); | |
7403 | void g_queue_insert_sorted (GQueue *queue, | |
7404 | gpointer data, | |
7405 | GCompareDataFunc func, | |
7406 | gpointer user_data); | |
7407 | ||
7408 | void g_queue_push_head_link (GQueue *queue, | |
7409 | GList *link_); | |
7410 | void g_queue_push_tail_link (GQueue *queue, | |
7411 | GList *link_); | |
7412 | void g_queue_push_nth_link (GQueue *queue, | |
7413 | gint n, | |
7414 | GList *link_); | |
7415 | GList* g_queue_pop_head_link (GQueue *queue); | |
7416 | GList* g_queue_pop_tail_link (GQueue *queue); | |
7417 | GList* g_queue_pop_nth_link (GQueue *queue, | |
7418 | guint n); | |
7419 | GList* g_queue_peek_head_link (GQueue *queue); | |
7420 | GList* g_queue_peek_tail_link (GQueue *queue); | |
7421 | GList* g_queue_peek_nth_link (GQueue *queue, | |
7422 | guint n); | |
7423 | gint g_queue_link_index (GQueue *queue, | |
7424 | GList *link_); | |
7425 | void g_queue_unlink (GQueue *queue, | |
7426 | GList *link_); | |
7427 | void g_queue_delete_link (GQueue *queue, | |
7428 | GList *link_); | |
7429 | ||
7430 | ||
7431 | # 63 "/usr/include/glib-2.0/glib.h" 2 | |
7432 | # 1 "/usr/include/glib-2.0/glib/grand.h" 1 | |
7433 | # 32 "/usr/include/glib-2.0/glib/grand.h" | |
7434 | ||
7435 | ||
7436 | typedef struct _GRand GRand; | |
7437 | # 45 "/usr/include/glib-2.0/glib/grand.h" | |
7438 | GRand* g_rand_new_with_seed (guint32 seed); | |
7439 | GRand* g_rand_new_with_seed_array (const guint32 *seed, | |
7440 | guint seed_length); | |
7441 | GRand* g_rand_new (void); | |
7442 | void g_rand_free (GRand *rand_); | |
7443 | GRand* g_rand_copy (GRand *rand_); | |
7444 | void g_rand_set_seed (GRand *rand_, | |
7445 | guint32 seed); | |
7446 | void g_rand_set_seed_array (GRand *rand_, | |
7447 | const guint32 *seed, | |
7448 | guint seed_length); | |
7449 | ||
7450 | ||
7451 | ||
7452 | guint32 g_rand_int (GRand *rand_); | |
7453 | gint32 g_rand_int_range (GRand *rand_, | |
7454 | gint32 begin, | |
7455 | gint32 end); | |
7456 | gdouble g_rand_double (GRand *rand_); | |
7457 | gdouble g_rand_double_range (GRand *rand_, | |
7458 | gdouble begin, | |
7459 | gdouble end); | |
7460 | void g_random_set_seed (guint32 seed); | |
7461 | ||
7462 | ||
7463 | ||
7464 | guint32 g_random_int (void); | |
7465 | gint32 g_random_int_range (gint32 begin, | |
7466 | gint32 end); | |
7467 | gdouble g_random_double (void); | |
7468 | gdouble g_random_double_range (gdouble begin, | |
7469 | gdouble end); | |
7470 | ||
7471 | ||
7472 | ||
7473 | # 64 "/usr/include/glib-2.0/glib.h" 2 | |
7474 | # 1 "/usr/include/glib-2.0/glib/grel.h" 1 | |
7475 | # 32 "/usr/include/glib-2.0/glib/grel.h" | |
7476 | ||
7477 | ||
7478 | typedef struct _GRelation GRelation; | |
7479 | typedef struct _GTuples GTuples; | |
7480 | ||
7481 | struct _GTuples | |
7482 | { | |
7483 | guint len; | |
7484 | }; | |
7485 | # 65 "/usr/include/glib-2.0/glib/grel.h" | |
7486 | GRelation* g_relation_new (gint fields); | |
7487 | void g_relation_destroy (GRelation *relation); | |
7488 | void g_relation_index (GRelation *relation, | |
7489 | gint field, | |
7490 | GHashFunc hash_func, | |
7491 | GEqualFunc key_equal_func); | |
7492 | void g_relation_insert (GRelation *relation, | |
7493 | ...); | |
7494 | gint g_relation_delete (GRelation *relation, | |
7495 | gconstpointer key, | |
7496 | gint field); | |
7497 | GTuples* g_relation_select (GRelation *relation, | |
7498 | gconstpointer key, | |
7499 | gint field); | |
7500 | gint g_relation_count (GRelation *relation, | |
7501 | gconstpointer key, | |
7502 | gint field); | |
7503 | gboolean g_relation_exists (GRelation *relation, | |
7504 | ...); | |
7505 | void g_relation_print (GRelation *relation); | |
7506 | ||
7507 | void g_tuples_destroy (GTuples *tuples); | |
7508 | gpointer g_tuples_index (GTuples *tuples, | |
7509 | gint index_, | |
7510 | gint field); | |
7511 | ||
7512 | ||
7513 | # 65 "/usr/include/glib-2.0/glib.h" 2 | |
7514 | # 1 "/usr/include/glib-2.0/glib/gscanner.h" 1 | |
7515 | # 33 "/usr/include/glib-2.0/glib/gscanner.h" | |
7516 | ||
7517 | ||
7518 | typedef struct _GScanner GScanner; | |
7519 | typedef struct _GScannerConfig GScannerConfig; | |
7520 | typedef union _GTokenValue GTokenValue; | |
7521 | ||
7522 | typedef void (*GScannerMsgFunc) (GScanner *scanner, | |
7523 | gchar *message, | |
7524 | gboolean error); | |
7525 | # 60 "/usr/include/glib-2.0/glib/gscanner.h" | |
7526 | typedef enum | |
7527 | { | |
7528 | G_ERR_UNKNOWN, | |
7529 | G_ERR_UNEXP_EOF, | |
7530 | G_ERR_UNEXP_EOF_IN_STRING, | |
7531 | G_ERR_UNEXP_EOF_IN_COMMENT, | |
7532 | G_ERR_NON_DIGIT_IN_CONST, | |
7533 | G_ERR_DIGIT_RADIX, | |
7534 | G_ERR_FLOAT_RADIX, | |
7535 | G_ERR_FLOAT_MALFORMED | |
7536 | } GErrorType; | |
7537 | ||
7538 | ||
7539 | typedef enum | |
7540 | { | |
7541 | G_TOKEN_EOF = 0, | |
7542 | ||
7543 | G_TOKEN_LEFT_PAREN = '(', | |
7544 | G_TOKEN_RIGHT_PAREN = ')', | |
7545 | G_TOKEN_LEFT_CURLY = '{', | |
7546 | G_TOKEN_RIGHT_CURLY = '}', | |
7547 | G_TOKEN_LEFT_BRACE = '[', | |
7548 | G_TOKEN_RIGHT_BRACE = ']', | |
7549 | G_TOKEN_EQUAL_SIGN = '=', | |
7550 | G_TOKEN_COMMA = ',', | |
7551 | ||
7552 | G_TOKEN_NONE = 256, | |
7553 | ||
7554 | G_TOKEN_ERROR, | |
7555 | ||
7556 | G_TOKEN_CHAR, | |
7557 | G_TOKEN_BINARY, | |
7558 | G_TOKEN_OCTAL, | |
7559 | G_TOKEN_INT, | |
7560 | G_TOKEN_HEX, | |
7561 | G_TOKEN_FLOAT, | |
7562 | G_TOKEN_STRING, | |
7563 | ||
7564 | G_TOKEN_SYMBOL, | |
7565 | G_TOKEN_IDENTIFIER, | |
7566 | G_TOKEN_IDENTIFIER_NULL, | |
7567 | ||
7568 | G_TOKEN_COMMENT_SINGLE, | |
7569 | G_TOKEN_COMMENT_MULTI, | |
7570 | G_TOKEN_LAST | |
7571 | } GTokenType; | |
7572 | ||
7573 | union _GTokenValue | |
7574 | { | |
7575 | gpointer v_symbol; | |
7576 | gchar *v_identifier; | |
7577 | gulong v_binary; | |
7578 | gulong v_octal; | |
7579 | gulong v_int; | |
7580 | guint64 v_int64; | |
7581 | gdouble v_float; | |
7582 | gulong v_hex; | |
7583 | gchar *v_string; | |
7584 | gchar *v_comment; | |
7585 | guchar v_char; | |
7586 | guint v_error; | |
7587 | }; | |
7588 | ||
7589 | struct _GScannerConfig | |
7590 | { | |
7591 | ||
7592 | ||
7593 | gchar *cset_skip_characters; | |
7594 | gchar *cset_identifier_first; | |
7595 | gchar *cset_identifier_nth; | |
7596 | gchar *cpair_comment_single; | |
7597 | ||
7598 | ||
7599 | ||
7600 | guint case_sensitive : 1; | |
7601 | ||
7602 | ||
7603 | ||
7604 | ||
7605 | guint skip_comment_multi : 1; | |
7606 | guint skip_comment_single : 1; | |
7607 | guint scan_comment_multi : 1; | |
7608 | guint scan_identifier : 1; | |
7609 | guint scan_identifier_1char : 1; | |
7610 | guint scan_identifier_NULL : 1; | |
7611 | guint scan_symbols : 1; | |
7612 | guint scan_binary : 1; | |
7613 | guint scan_octal : 1; | |
7614 | guint scan_float : 1; | |
7615 | guint scan_hex : 1; | |
7616 | guint scan_hex_dollar : 1; | |
7617 | guint scan_string_sq : 1; | |
7618 | guint scan_string_dq : 1; | |
7619 | guint numbers_2_int : 1; | |
7620 | guint int_2_float : 1; | |
7621 | guint identifier_2_string : 1; | |
7622 | guint char_2_token : 1; | |
7623 | guint symbol_2_token : 1; | |
7624 | guint scope_0_fallback : 1; | |
7625 | guint store_int64 : 1; | |
7626 | guint padding_dummy; | |
7627 | }; | |
7628 | ||
7629 | struct _GScanner | |
7630 | { | |
7631 | ||
7632 | gpointer user_data; | |
7633 | guint max_parse_errors; | |
7634 | ||
7635 | ||
7636 | guint parse_errors; | |
7637 | ||
7638 | ||
7639 | const gchar *input_name; | |
7640 | ||
7641 | ||
7642 | GData *qdata; | |
7643 | ||
7644 | ||
7645 | GScannerConfig *config; | |
7646 | ||
7647 | ||
7648 | GTokenType token; | |
7649 | GTokenValue value; | |
7650 | guint line; | |
7651 | guint position; | |
7652 | ||
7653 | ||
7654 | GTokenType next_token; | |
7655 | GTokenValue next_value; | |
7656 | guint next_line; | |
7657 | guint next_position; | |
7658 | ||
7659 | ||
7660 | GHashTable *symbol_table; | |
7661 | gint input_fd; | |
7662 | const gchar *text; | |
7663 | const gchar *text_end; | |
7664 | gchar *buffer; | |
7665 | guint scope_id; | |
7666 | ||
7667 | ||
7668 | GScannerMsgFunc msg_handler; | |
7669 | }; | |
7670 | ||
7671 | GScanner* g_scanner_new (const GScannerConfig *config_templ); | |
7672 | void g_scanner_destroy (GScanner *scanner); | |
7673 | void g_scanner_input_file (GScanner *scanner, | |
7674 | gint input_fd); | |
7675 | void g_scanner_sync_file_offset (GScanner *scanner); | |
7676 | void g_scanner_input_text (GScanner *scanner, | |
7677 | const gchar *text, | |
7678 | guint text_len); | |
7679 | GTokenType g_scanner_get_next_token (GScanner *scanner); | |
7680 | GTokenType g_scanner_peek_next_token (GScanner *scanner); | |
7681 | GTokenType g_scanner_cur_token (GScanner *scanner); | |
7682 | GTokenValue g_scanner_cur_value (GScanner *scanner); | |
7683 | guint g_scanner_cur_line (GScanner *scanner); | |
7684 | guint g_scanner_cur_position (GScanner *scanner); | |
7685 | gboolean g_scanner_eof (GScanner *scanner); | |
7686 | guint g_scanner_set_scope (GScanner *scanner, | |
7687 | guint scope_id); | |
7688 | void g_scanner_scope_add_symbol (GScanner *scanner, | |
7689 | guint scope_id, | |
7690 | const gchar *symbol, | |
7691 | gpointer value); | |
7692 | void g_scanner_scope_remove_symbol (GScanner *scanner, | |
7693 | guint scope_id, | |
7694 | const gchar *symbol); | |
7695 | gpointer g_scanner_scope_lookup_symbol (GScanner *scanner, | |
7696 | guint scope_id, | |
7697 | const gchar *symbol); | |
7698 | void g_scanner_scope_foreach_symbol (GScanner *scanner, | |
7699 | guint scope_id, | |
7700 | GHFunc func, | |
7701 | gpointer user_data); | |
7702 | gpointer g_scanner_lookup_symbol (GScanner *scanner, | |
7703 | const gchar *symbol); | |
7704 | void g_scanner_unexp_token (GScanner *scanner, | |
7705 | GTokenType expected_token, | |
7706 | const gchar *identifier_spec, | |
7707 | const gchar *symbol_spec, | |
7708 | const gchar *symbol_name, | |
7709 | const gchar *message, | |
7710 | gint is_error); | |
7711 | void g_scanner_error (GScanner *scanner, | |
7712 | const gchar *format, | |
7713 | ...) __attribute__((__format__ (__printf__, 2, 3))); | |
7714 | void g_scanner_warn (GScanner *scanner, | |
7715 | const gchar *format, | |
7716 | ...) __attribute__((__format__ (__printf__, 2, 3))); | |
7717 | # 272 "/usr/include/glib-2.0/glib/gscanner.h" | |
7718 | ||
7719 | # 66 "/usr/include/glib-2.0/glib.h" 2 | |
7720 | # 1 "/usr/include/glib-2.0/glib/gshell.h" 1 | |
7721 | # 26 "/usr/include/glib-2.0/glib/gshell.h" | |
7722 | ||
7723 | ||
7724 | ||
7725 | ||
7726 | typedef enum | |
7727 | { | |
7728 | ||
7729 | G_SHELL_ERROR_BAD_QUOTING, | |
7730 | ||
7731 | G_SHELL_ERROR_EMPTY_STRING, | |
7732 | G_SHELL_ERROR_FAILED | |
7733 | } GShellError; | |
7734 | ||
7735 | GQuark g_shell_error_quark (void); | |
7736 | ||
7737 | gchar* g_shell_quote (const gchar *unquoted_string); | |
7738 | gchar* g_shell_unquote (const gchar *quoted_string, | |
7739 | GError **error); | |
7740 | gboolean g_shell_parse_argv (const gchar *command_line, | |
7741 | gint *argcp, | |
7742 | gchar ***argvp, | |
7743 | GError **error); | |
7744 | ||
7745 | ||
7746 | # 67 "/usr/include/glib-2.0/glib.h" 2 | |
7747 | ||
7748 | # 1 "/usr/include/glib-2.0/glib/gspawn.h" 1 | |
7749 | # 26 "/usr/include/glib-2.0/glib/gspawn.h" | |
7750 | ||
7751 | ||
7752 | ||
7753 | ||
7754 | ||
7755 | typedef enum | |
7756 | { | |
7757 | G_SPAWN_ERROR_FORK, | |
7758 | G_SPAWN_ERROR_READ, | |
7759 | G_SPAWN_ERROR_CHDIR, | |
7760 | G_SPAWN_ERROR_ACCES, | |
7761 | G_SPAWN_ERROR_PERM, | |
7762 | G_SPAWN_ERROR_2BIG, | |
7763 | G_SPAWN_ERROR_NOEXEC, | |
7764 | G_SPAWN_ERROR_NAMETOOLONG, | |
7765 | G_SPAWN_ERROR_NOENT, | |
7766 | G_SPAWN_ERROR_NOMEM, | |
7767 | G_SPAWN_ERROR_NOTDIR, | |
7768 | G_SPAWN_ERROR_LOOP, | |
7769 | G_SPAWN_ERROR_TXTBUSY, | |
7770 | G_SPAWN_ERROR_IO, | |
7771 | G_SPAWN_ERROR_NFILE, | |
7772 | G_SPAWN_ERROR_MFILE, | |
7773 | G_SPAWN_ERROR_INVAL, | |
7774 | G_SPAWN_ERROR_ISDIR, | |
7775 | G_SPAWN_ERROR_LIBBAD, | |
7776 | G_SPAWN_ERROR_FAILED | |
7777 | ||
7778 | ||
7779 | } GSpawnError; | |
7780 | ||
7781 | typedef void (* GSpawnChildSetupFunc) (gpointer user_data); | |
7782 | ||
7783 | typedef enum | |
7784 | { | |
7785 | G_SPAWN_LEAVE_DESCRIPTORS_OPEN = 1 << 0, | |
7786 | G_SPAWN_DO_NOT_REAP_CHILD = 1 << 1, | |
7787 | ||
7788 | G_SPAWN_SEARCH_PATH = 1 << 2, | |
7789 | ||
7790 | G_SPAWN_STDOUT_TO_DEV_NULL = 1 << 3, | |
7791 | G_SPAWN_STDERR_TO_DEV_NULL = 1 << 4, | |
7792 | G_SPAWN_CHILD_INHERITS_STDIN = 1 << 5, | |
7793 | G_SPAWN_FILE_AND_ARGV_ZERO = 1 << 6 | |
7794 | } GSpawnFlags; | |
7795 | ||
7796 | GQuark g_spawn_error_quark (void); | |
7797 | # 82 "/usr/include/glib-2.0/glib/gspawn.h" | |
7798 | gboolean g_spawn_async (const gchar *working_directory, | |
7799 | gchar **argv, | |
7800 | gchar **envp, | |
7801 | GSpawnFlags flags, | |
7802 | GSpawnChildSetupFunc child_setup, | |
7803 | gpointer user_data, | |
7804 | GPid *child_pid, | |
7805 | GError **error); | |
7806 | ||
7807 | ||
7808 | ||
7809 | ||
7810 | ||
7811 | gboolean g_spawn_async_with_pipes (const gchar *working_directory, | |
7812 | gchar **argv, | |
7813 | gchar **envp, | |
7814 | GSpawnFlags flags, | |
7815 | GSpawnChildSetupFunc child_setup, | |
7816 | gpointer user_data, | |
7817 | GPid *child_pid, | |
7818 | gint *standard_input, | |
7819 | gint *standard_output, | |
7820 | gint *standard_error, | |
7821 | GError **error); | |
7822 | ||
7823 | ||
7824 | ||
7825 | ||
7826 | ||
7827 | ||
7828 | gboolean g_spawn_sync (const gchar *working_directory, | |
7829 | gchar **argv, | |
7830 | gchar **envp, | |
7831 | GSpawnFlags flags, | |
7832 | GSpawnChildSetupFunc child_setup, | |
7833 | gpointer user_data, | |
7834 | gchar **standard_output, | |
7835 | gchar **standard_error, | |
7836 | gint *exit_status, | |
7837 | GError **error); | |
7838 | ||
7839 | gboolean g_spawn_command_line_sync (const gchar *command_line, | |
7840 | gchar **standard_output, | |
7841 | gchar **standard_error, | |
7842 | gint *exit_status, | |
7843 | GError **error); | |
7844 | gboolean g_spawn_command_line_async (const gchar *command_line, | |
7845 | GError **error); | |
7846 | ||
7847 | void g_spawn_close_pid (GPid pid); | |
7848 | ||
7849 | ||
7850 | ||
7851 | # 69 "/usr/include/glib-2.0/glib.h" 2 | |
7852 | # 1 "/usr/include/glib-2.0/glib/gstrfuncs.h" 1 | |
7853 | # 33 "/usr/include/glib-2.0/glib/gstrfuncs.h" | |
7854 | ||
7855 | ||
7856 | ||
7857 | typedef enum { | |
7858 | G_ASCII_ALNUM = 1 << 0, | |
7859 | G_ASCII_ALPHA = 1 << 1, | |
7860 | G_ASCII_CNTRL = 1 << 2, | |
7861 | G_ASCII_DIGIT = 1 << 3, | |
7862 | G_ASCII_GRAPH = 1 << 4, | |
7863 | G_ASCII_LOWER = 1 << 5, | |
7864 | G_ASCII_PRINT = 1 << 6, | |
7865 | G_ASCII_PUNCT = 1 << 7, | |
7866 | G_ASCII_SPACE = 1 << 8, | |
7867 | G_ASCII_UPPER = 1 << 9, | |
7868 | G_ASCII_XDIGIT = 1 << 10 | |
7869 | } GAsciiType; | |
7870 | ||
7871 | extern const guint16 * const g_ascii_table; | |
7872 | # 85 "/usr/include/glib-2.0/glib/gstrfuncs.h" | |
7873 | gchar g_ascii_tolower (gchar c) __attribute__((__const__)); | |
7874 | gchar g_ascii_toupper (gchar c) __attribute__((__const__)); | |
7875 | ||
7876 | gint g_ascii_digit_value (gchar c) __attribute__((__const__)); | |
7877 | gint g_ascii_xdigit_value (gchar c) __attribute__((__const__)); | |
7878 | ||
7879 | ||
7880 | ||
7881 | ||
7882 | ||
7883 | gchar* g_strdelimit (gchar *string, | |
7884 | const gchar *delimiters, | |
7885 | gchar new_delimiter); | |
7886 | gchar* g_strcanon (gchar *string, | |
7887 | const gchar *valid_chars, | |
7888 | gchar substitutor); | |
7889 | const gchar* g_strerror (gint errnum) __attribute__((__const__)); | |
7890 | const gchar* g_strsignal (gint signum) __attribute__((__const__)); | |
7891 | gchar* g_strreverse (gchar *string); | |
7892 | gsize g_strlcpy (gchar *dest, | |
7893 | const gchar *src, | |
7894 | gsize dest_size); | |
7895 | gsize g_strlcat (gchar *dest, | |
7896 | const gchar *src, | |
7897 | gsize dest_size); | |
7898 | gchar * g_strstr_len (const gchar *haystack, | |
7899 | gssize haystack_len, | |
7900 | const gchar *needle); | |
7901 | gchar * g_strrstr (const gchar *haystack, | |
7902 | const gchar *needle); | |
7903 | gchar * g_strrstr_len (const gchar *haystack, | |
7904 | gssize haystack_len, | |
7905 | const gchar *needle); | |
7906 | ||
7907 | gboolean g_str_has_suffix (const gchar *str, | |
7908 | const gchar *suffix); | |
7909 | gboolean g_str_has_prefix (const gchar *str, | |
7910 | const gchar *prefix); | |
7911 | ||
7912 | ||
7913 | ||
7914 | gdouble g_strtod (const gchar *nptr, | |
7915 | gchar **endptr); | |
7916 | gdouble g_ascii_strtod (const gchar *nptr, | |
7917 | gchar **endptr); | |
7918 | guint64 g_ascii_strtoull (const gchar *nptr, | |
7919 | gchar **endptr, | |
7920 | guint base); | |
7921 | gint64 g_ascii_strtoll (const gchar *nptr, | |
7922 | gchar **endptr, | |
7923 | guint base); | |
7924 | ||
7925 | ||
7926 | ||
7927 | ||
7928 | gchar * g_ascii_dtostr (gchar *buffer, | |
7929 | gint buf_len, | |
7930 | gdouble d); | |
7931 | gchar * g_ascii_formatd (gchar *buffer, | |
7932 | gint buf_len, | |
7933 | const gchar *format, | |
7934 | gdouble d); | |
7935 | ||
7936 | ||
7937 | gchar* g_strchug (gchar *string); | |
7938 | ||
7939 | gchar* g_strchomp (gchar *string); | |
7940 | ||
7941 | ||
7942 | ||
7943 | gint g_ascii_strcasecmp (const gchar *s1, | |
7944 | const gchar *s2); | |
7945 | gint g_ascii_strncasecmp (const gchar *s1, | |
7946 | const gchar *s2, | |
7947 | gsize n); | |
7948 | gchar* g_ascii_strdown (const gchar *str, | |
7949 | gssize len) __attribute__((__malloc__)); | |
7950 | gchar* g_ascii_strup (const gchar *str, | |
7951 | gssize len) __attribute__((__malloc__)); | |
7952 | # 185 "/usr/include/glib-2.0/glib/gstrfuncs.h" | |
7953 | gchar* g_strdup (const gchar *str) __attribute__((__malloc__)); | |
7954 | gchar* g_strdup_printf (const gchar *format, | |
7955 | ...) __attribute__((__format__ (__printf__, 1, 2))) __attribute__((__malloc__)); | |
7956 | gchar* g_strdup_vprintf (const gchar *format, | |
7957 | va_list args) __attribute__((__malloc__)); | |
7958 | gchar* g_strndup (const gchar *str, | |
7959 | gsize n) __attribute__((__malloc__)); | |
7960 | gchar* g_strnfill (gsize length, | |
7961 | gchar fill_char) __attribute__((__malloc__)); | |
7962 | gchar* g_strconcat (const gchar *string1, | |
7963 | ...) __attribute__((__malloc__)) __attribute__((__sentinel__)); | |
7964 | gchar* g_strjoin (const gchar *separator, | |
7965 | ...) __attribute__((__malloc__)) __attribute__((__sentinel__)); | |
7966 | ||
7967 | ||
7968 | ||
7969 | ||
7970 | ||
7971 | gchar* g_strcompress (const gchar *source) __attribute__((__malloc__)); | |
7972 | # 213 "/usr/include/glib-2.0/glib/gstrfuncs.h" | |
7973 | gchar* g_strescape (const gchar *source, | |
7974 | const gchar *exceptions) __attribute__((__malloc__)); | |
7975 | ||
7976 | gpointer g_memdup (gconstpointer mem, | |
7977 | guint byte_size) __attribute__((__malloc__)); | |
7978 | # 228 "/usr/include/glib-2.0/glib/gstrfuncs.h" | |
7979 | gchar** g_strsplit (const gchar *string, | |
7980 | const gchar *delimiter, | |
7981 | gint max_tokens) __attribute__((__malloc__)); | |
7982 | gchar ** g_strsplit_set (const gchar *string, | |
7983 | const gchar *delimiters, | |
7984 | gint max_tokens) __attribute__((__malloc__)); | |
7985 | gchar* g_strjoinv (const gchar *separator, | |
7986 | gchar **str_array) __attribute__((__malloc__)); | |
7987 | void g_strfreev (gchar **str_array); | |
7988 | gchar** g_strdupv (gchar **str_array) __attribute__((__malloc__)); | |
7989 | guint g_strv_length (gchar **str_array); | |
7990 | ||
7991 | gchar* g_stpcpy (gchar *dest, | |
7992 | const char *src); | |
7993 | ||
7994 | const gchar *g_strip_context (const gchar *msgid, | |
7995 | const gchar *msgval); | |
7996 | ||
7997 | ||
7998 | # 70 "/usr/include/glib-2.0/glib.h" 2 | |
7999 | ||
8000 | ||
8001 | # 1 "/usr/include/glib-2.0/glib/gthreadpool.h" 1 | |
8002 | # 32 "/usr/include/glib-2.0/glib/gthreadpool.h" | |
8003 | ||
8004 | ||
8005 | typedef struct _GThreadPool GThreadPool; | |
8006 | ||
8007 | ||
8008 | ||
8009 | ||
8010 | ||
8011 | ||
8012 | struct _GThreadPool | |
8013 | { | |
8014 | GFunc func; | |
8015 | gpointer user_data; | |
8016 | gboolean exclusive; | |
8017 | }; | |
8018 | ||
8019 | ||
8020 | ||
8021 | ||
8022 | ||
8023 | ||
8024 | GThreadPool* g_thread_pool_new (GFunc func, | |
8025 | gpointer user_data, | |
8026 | gint max_threads, | |
8027 | gboolean exclusive, | |
8028 | GError **error); | |
8029 | ||
8030 | ||
8031 | ||
8032 | ||
8033 | ||
8034 | void g_thread_pool_push (GThreadPool *pool, | |
8035 | gpointer data, | |
8036 | GError **error); | |
8037 | ||
8038 | ||
8039 | ||
8040 | ||
8041 | void g_thread_pool_set_max_threads (GThreadPool *pool, | |
8042 | gint max_threads, | |
8043 | GError **error); | |
8044 | gint g_thread_pool_get_max_threads (GThreadPool *pool); | |
8045 | ||
8046 | ||
8047 | ||
8048 | guint g_thread_pool_get_num_threads (GThreadPool *pool); | |
8049 | ||
8050 | ||
8051 | guint g_thread_pool_unprocessed (GThreadPool *pool); | |
8052 | ||
8053 | ||
8054 | ||
8055 | ||
8056 | ||
8057 | void g_thread_pool_free (GThreadPool *pool, | |
8058 | gboolean immediate, | |
8059 | gboolean wait); | |
8060 | ||
8061 | ||
8062 | ||
8063 | void g_thread_pool_set_max_unused_threads (gint max_threads); | |
8064 | gint g_thread_pool_get_max_unused_threads (void); | |
8065 | guint g_thread_pool_get_num_unused_threads (void); | |
8066 | ||
8067 | ||
8068 | void g_thread_pool_stop_unused_threads (void); | |
8069 | ||
8070 | ||
8071 | void g_thread_pool_set_sort_function (GThreadPool *pool, | |
8072 | GCompareDataFunc func, | |
8073 | gpointer user_data); | |
8074 | ||
8075 | ||
8076 | void g_thread_pool_set_max_idle_time (guint interval); | |
8077 | guint g_thread_pool_get_max_idle_time (void); | |
8078 | ||
8079 | ||
8080 | # 73 "/usr/include/glib-2.0/glib.h" 2 | |
8081 | # 1 "/usr/include/glib-2.0/glib/gtimer.h" 1 | |
8082 | # 32 "/usr/include/glib-2.0/glib/gtimer.h" | |
8083 | ||
8084 | ||
8085 | ||
8086 | ||
8087 | ||
8088 | ||
8089 | typedef struct _GTimer GTimer; | |
8090 | ||
8091 | ||
8092 | ||
8093 | GTimer* g_timer_new (void); | |
8094 | void g_timer_destroy (GTimer *timer); | |
8095 | void g_timer_start (GTimer *timer); | |
8096 | void g_timer_stop (GTimer *timer); | |
8097 | void g_timer_reset (GTimer *timer); | |
8098 | void g_timer_continue (GTimer *timer); | |
8099 | gdouble g_timer_elapsed (GTimer *timer, | |
8100 | gulong *microseconds); | |
8101 | ||
8102 | void g_usleep (gulong microseconds); | |
8103 | ||
8104 | void g_time_val_add (GTimeVal *time_, | |
8105 | glong microseconds); | |
8106 | gboolean g_time_val_from_iso8601 (const gchar *iso_date, | |
8107 | GTimeVal *time_); | |
8108 | gchar* g_time_val_to_iso8601 (GTimeVal *time_) __attribute__((__malloc__)); | |
8109 | ||
8110 | ||
8111 | # 74 "/usr/include/glib-2.0/glib.h" 2 | |
8112 | # 1 "/usr/include/glib-2.0/glib/gtree.h" 1 | |
8113 | # 32 "/usr/include/glib-2.0/glib/gtree.h" | |
8114 | ||
8115 | ||
8116 | typedef struct _GTree GTree; | |
8117 | ||
8118 | typedef gboolean (*GTraverseFunc) (gpointer key, | |
8119 | gpointer value, | |
8120 | gpointer data); | |
8121 | ||
8122 | ||
8123 | ||
8124 | GTree* g_tree_new (GCompareFunc key_compare_func); | |
8125 | GTree* g_tree_new_with_data (GCompareDataFunc key_compare_func, | |
8126 | gpointer key_compare_data); | |
8127 | GTree* g_tree_new_full (GCompareDataFunc key_compare_func, | |
8128 | gpointer key_compare_data, | |
8129 | GDestroyNotify key_destroy_func, | |
8130 | GDestroyNotify value_destroy_func); | |
8131 | void g_tree_destroy (GTree *tree); | |
8132 | void g_tree_insert (GTree *tree, | |
8133 | gpointer key, | |
8134 | gpointer value); | |
8135 | void g_tree_replace (GTree *tree, | |
8136 | gpointer key, | |
8137 | gpointer value); | |
8138 | gboolean g_tree_remove (GTree *tree, | |
8139 | gconstpointer key); | |
8140 | gboolean g_tree_steal (GTree *tree, | |
8141 | gconstpointer key); | |
8142 | gpointer g_tree_lookup (GTree *tree, | |
8143 | gconstpointer key); | |
8144 | gboolean g_tree_lookup_extended (GTree *tree, | |
8145 | gconstpointer lookup_key, | |
8146 | gpointer *orig_key, | |
8147 | gpointer *value); | |
8148 | void g_tree_foreach (GTree *tree, | |
8149 | GTraverseFunc func, | |
8150 | gpointer user_data); | |
8151 | # 77 "/usr/include/glib-2.0/glib/gtree.h" | |
8152 | gpointer g_tree_search (GTree *tree, | |
8153 | GCompareFunc search_func, | |
8154 | gconstpointer user_data); | |
8155 | gint g_tree_height (GTree *tree); | |
8156 | gint g_tree_nnodes (GTree *tree); | |
8157 | ||
8158 | ||
8159 | ||
8160 | ||
8161 | # 75 "/usr/include/glib-2.0/glib.h" 2 | |
8162 | # 8 "scheme.h" 2 | |
8163 | # 99 "scheme.h" | |
8164 | typedef struct scheme scheme; | |
8165 | typedef struct cell *pointer; | |
8166 | ||
8167 | typedef void * (*func_alloc)(size_t); | |
8168 | typedef void (*func_dealloc)(void *); | |
8169 | ||
8170 | ||
8171 | typedef struct num { | |
8172 | char is_fixnum; | |
8173 | union { | |
8174 | long ivalue; | |
8175 | double rvalue; | |
8176 | } value; | |
8177 | } num; | |
8178 | ||
8179 | scheme *scheme_init_new(); | |
8180 | scheme *scheme_init_new_custom_alloc(func_alloc malloc, func_dealloc free); | |
8181 | int scheme_init(scheme *sc); | |
8182 | int scheme_init_custom_alloc(scheme *sc, func_alloc, func_dealloc); | |
8183 | void scheme_deinit(scheme *sc); | |
8184 | void scheme_set_input_port_file(scheme *sc, FILE *fin); | |
8185 | void scheme_set_input_port_string(scheme *sc, char *start, char *past_the_end); | |
8186 | void scheme_set_output_port_file(scheme *sc, FILE *fin); | |
8187 | void scheme_set_output_port_string(scheme *sc, char *start, char *past_the_end); | |
8188 | void scheme_load_file(scheme *sc, FILE *fin); | |
8189 | void scheme_load_string(scheme *sc, const char *cmd); | |
8190 | void scheme_apply0(scheme *sc, const char *procname); | |
8191 | pointer scheme_apply1(scheme *sc, const char *procname, pointer); | |
8192 | void scheme_set_external_data(scheme *sc, void *p); | |
8193 | void scheme_define(scheme *sc, pointer env, pointer symbol, pointer value); | |
8194 | ||
8195 | typedef pointer (*foreign_func)(scheme *, pointer); | |
8196 | ||
8197 | pointer _cons(scheme *sc, pointer a, pointer b, int immutable); | |
8198 | pointer mk_integer(scheme *sc, long num); | |
8199 | pointer mk_real(scheme *sc, double num); | |
8200 | pointer mk_symbol(scheme *sc, const char *name); | |
8201 | pointer gensym(scheme *sc); | |
8202 | pointer mk_string(scheme *sc, const char *str); | |
8203 | pointer mk_counted_string(scheme *sc, const char *str, int len); | |
8204 | pointer mk_character(scheme *sc, gunichar c); | |
8205 | pointer mk_foreign_func(scheme *sc, foreign_func f); | |
8206 | void putstr(scheme *sc, const char *s); | |
8207 | ||
8208 | void set_safe_foreign (scheme *sc, pointer data); | |
8209 | ||
8210 | ||
8211 | struct scheme_interface { | |
8212 | void (*scheme_define)(scheme *sc, pointer env, pointer symbol, pointer value); | |
8213 | pointer (*cons)(scheme *sc, pointer a, pointer b); | |
8214 | pointer (*immutable_cons)(scheme *sc, pointer a, pointer b); | |
8215 | pointer (*reserve_cells)(scheme *sc, int n); | |
8216 | pointer (*mk_integer)(scheme *sc, long num); | |
8217 | pointer (*mk_real)(scheme *sc, double num); | |
8218 | pointer (*mk_symbol)(scheme *sc, const char *name); | |
8219 | pointer (*gensym)(scheme *sc); | |
8220 | pointer (*mk_string)(scheme *sc, const char *str); | |
8221 | pointer (*mk_counted_string)(scheme *sc, const char *str, int len); | |
8222 | pointer (*mk_character)(scheme *sc, gunichar c); | |
8223 | pointer (*mk_vector)(scheme *sc, int len); | |
8224 | pointer (*mk_foreign_func)(scheme *sc, foreign_func f); | |
8225 | pointer (*mk_closure)(scheme *sc, pointer c, pointer e); | |
8226 | void (*putstr)(scheme *sc, const char *s); | |
8227 | void (*putcharacter)(scheme *sc, gunichar c); | |
8228 | ||
8229 | int (*is_string)(pointer p); | |
8230 | int (*string_length)(pointer p); | |
8231 | char *(*string_value)(pointer p); | |
8232 | int (*is_number)(pointer p); | |
8233 | num (*nvalue)(pointer p); | |
8234 | long (*ivalue)(pointer p); | |
8235 | double (*rvalue)(pointer p); | |
8236 | int (*is_integer)(pointer p); | |
8237 | int (*is_real)(pointer p); | |
8238 | int (*is_character)(pointer p); | |
8239 | gunichar (*charvalue)(pointer p); | |
8240 | int (*is_list)(scheme *sc, pointer p); | |
8241 | int (*is_vector)(pointer p); | |
8242 | int (*list_length)(scheme *sc, pointer a); | |
8243 | long (*vector_length)(pointer vec); | |
8244 | void (*fill_vector)(pointer vec, pointer elem); | |
8245 | pointer (*vector_elem)(pointer vec, int ielem); | |
8246 | pointer (*set_vector_elem)(pointer vec, int ielem, pointer newel); | |
8247 | ||
8248 | int (*is_port)(pointer p); | |
8249 | ||
8250 | int (*is_pair)(pointer p); | |
8251 | pointer (*pair_car)(pointer p); | |
8252 | pointer (*pair_cdr)(pointer p); | |
8253 | pointer (*set_car)(pointer p, pointer q); | |
8254 | pointer (*set_cdr)(pointer p, pointer q); | |
8255 | ||
8256 | int (*is_symbol)(pointer p); | |
8257 | char *(*symname)(pointer p); | |
8258 | ||
8259 | int (*is_syntax)(pointer p); | |
8260 | int (*is_proc)(pointer p); | |
8261 | int (*is_foreign)(pointer p); | |
8262 | char *(*syntaxname)(pointer p); | |
8263 | int (*is_closure)(pointer p); | |
8264 | int (*is_macro)(pointer p); | |
8265 | pointer (*closure_code)(pointer p); | |
8266 | pointer (*closure_env)(pointer p); | |
8267 | ||
8268 | int (*is_continuation)(pointer p); | |
8269 | int (*is_promise)(pointer p); | |
8270 | int (*is_environment)(pointer p); | |
8271 | int (*is_immutable)(pointer p); | |
8272 | void (*setimmutable)(pointer p); | |
8273 | ||
8274 | void (*load_file)(scheme *sc, FILE *fin); | |
8275 | void (*load_string)(scheme *sc, const char *input); | |
8276 | }; | |
8277 | # 7 "scheme-private.h" 2 | |
8278 | ||
8279 | ||
8280 | ||
8281 | enum scheme_port_kind { | |
8282 | port_free=0, | |
8283 | port_file=1, | |
8284 | port_string=2, | |
8285 | port_input=16, | |
8286 | port_output=32 | |
8287 | }; | |
8288 | ||
8289 | typedef struct port { | |
8290 | unsigned char kind; | |
8291 | union { | |
8292 | struct { | |
8293 | FILE *file; | |
8294 | int closeit; | |
8295 | } stdio; | |
8296 | struct { | |
8297 | char *start; | |
8298 | char *past_the_end; | |
8299 | char *curr; | |
8300 | } string; | |
8301 | } rep; | |
8302 | } port; | |
8303 | ||
8304 | ||
8305 | struct cell { | |
8306 | unsigned int _flag; | |
8307 | union { | |
8308 | struct { | |
8309 | char *_svalue; | |
8310 | int _length; | |
8311 | } _string; | |
8312 | num _number; | |
8313 | port *_port; | |
8314 | foreign_func _ff; | |
8315 | struct { | |
8316 | struct cell *_car; | |
8317 | struct cell *_cdr; | |
8318 | } _cons; | |
8319 | } _object; | |
8320 | }; | |
8321 | ||
8322 | struct scheme { | |
8323 | ||
8324 | func_alloc malloc; | |
8325 | func_dealloc free; | |
8326 | ||
8327 | ||
8328 | int retcode; | |
8329 | int tracing; | |
8330 | ||
8331 | ||
8332 | ||
8333 | char *alloc_seg[20]; | |
8334 | pointer cell_seg[20]; | |
8335 | int last_cell_seg; | |
8336 | ||
8337 | ||
8338 | pointer args; | |
8339 | pointer envir; | |
8340 | pointer code; | |
8341 | pointer dump; | |
8342 | pointer safe_foreign; | |
8343 | ||
8344 | int interactive_repl; | |
8345 | int print_output; | |
8346 | int print_error; | |
8347 | ||
8348 | struct cell _sink; | |
8349 | pointer sink; | |
8350 | struct cell _NIL; | |
8351 | pointer NIL; | |
8352 | struct cell _HASHT; | |
8353 | pointer T; | |
8354 | struct cell _HASHF; | |
8355 | pointer F; | |
8356 | struct cell _EOF_OBJ; | |
8357 | pointer EOF_OBJ; | |
8358 | pointer oblist; | |
8359 | pointer global_env; | |
8360 | ||
8361 | ||
8362 | pointer LAMBDA; | |
8363 | pointer QUOTE; | |
8364 | ||
8365 | pointer QQUOTE; | |
8366 | pointer UNQUOTE; | |
8367 | pointer UNQUOTESP; | |
8368 | pointer FEED_TO; | |
8369 | pointer COLON_HOOK; | |
8370 | pointer ERROR_HOOK; | |
8371 | pointer SHARP_HOOK; | |
8372 | ||
8373 | pointer free_cell; | |
8374 | long fcells; | |
8375 | ||
8376 | pointer inport; | |
8377 | pointer outport; | |
8378 | pointer save_inport; | |
8379 | pointer loadport; | |
8380 | ||
8381 | ||
8382 | port load_stack[64]; | |
8383 | int nesting_stack[64]; | |
8384 | int file_i; | |
8385 | int nesting; | |
8386 | ||
8387 | char gc_verbose; | |
8388 | char no_memory; | |
8389 | ||
8390 | ||
8391 | char linebuff[1024]; | |
8392 | char strbuff[1024]; | |
8393 | ||
8394 | FILE *tmpfp; | |
8395 | int tok; | |
8396 | int print_flag; | |
8397 | pointer value; | |
8398 | int op; | |
8399 | ||
8400 | void *ext_data; | |
8401 | long gensym_cnt; | |
8402 | ||
8403 | struct scheme_interface *vptr; | |
8404 | void *dump_base; | |
8405 | int dump_size; | |
8406 | ||
8407 | gunichar backchar; | |
8408 | int bc_flag; | |
8409 | }; | |
8410 | ||
8411 | ||
8412 | enum scheme_opcodes { | |
8413 | ||
8414 | # 1 "opdefines.h" 1 | |
8415 | OP_LOAD, | |
8416 | OP_T0LVL, | |
8417 | OP_T1LVL, | |
8418 | OP_READ_INTERNAL, | |
8419 | OP_GENSYM, | |
8420 | OP_VALUEPRINT, | |
8421 | OP_EVAL, | |
8422 | ||
8423 | OP_REAL_EVAL, | |
8424 | ||
8425 | OP_E0ARGS, | |
8426 | OP_E1ARGS, | |
8427 | OP_APPLY, | |
8428 | ||
8429 | OP_REAL_APPLY, | |
8430 | OP_TRACING, | |
8431 | ||
8432 | OP_DOMACRO, | |
8433 | OP_LAMBDA, | |
8434 | OP_MKCLOSURE, | |
8435 | OP_QUOTE, | |
8436 | OP_DEF0, | |
8437 | OP_DEF1, | |
8438 | OP_DEFP, | |
8439 | OP_BEGIN, | |
8440 | OP_IF0, | |
8441 | OP_IF1, | |
8442 | OP_SET0, | |
8443 | OP_SET1, | |
8444 | OP_LET0, | |
8445 | OP_LET1, | |
8446 | OP_LET2, | |
8447 | OP_LET0AST, | |
8448 | OP_LET1AST, | |
8449 | OP_LET2AST, | |
8450 | OP_LET0REC, | |
8451 | OP_LET1REC, | |
8452 | OP_LET2REC, | |
8453 | OP_COND0, | |
8454 | OP_COND1, | |
8455 | OP_DELAY, | |
8456 | OP_AND0, | |
8457 | OP_AND1, | |
8458 | OP_OR0, | |
8459 | OP_OR1, | |
8460 | OP_C0STREAM, | |
8461 | OP_C1STREAM, | |
8462 | OP_MACRO0, | |
8463 | OP_MACRO1, | |
8464 | OP_CASE0, | |
8465 | OP_CASE1, | |
8466 | OP_CASE2, | |
8467 | OP_PEVAL, | |
8468 | OP_PAPPLY, | |
8469 | OP_CONTINUATION, | |
8470 | ||
8471 | OP_INEX2EX, | |
8472 | OP_EXP, | |
8473 | OP_LOG, | |
8474 | OP_SIN, | |
8475 | OP_COS, | |
8476 | OP_TAN, | |
8477 | OP_ASIN, | |
8478 | OP_ACOS, | |
8479 | OP_ATAN, | |
8480 | OP_SQRT, | |
8481 | OP_EXPT, | |
8482 | OP_FLOOR, | |
8483 | OP_CEILING, | |
8484 | OP_TRUNCATE, | |
8485 | OP_ROUND, | |
8486 | ||
8487 | OP_ADD, | |
8488 | OP_SUB, | |
8489 | OP_MUL, | |
8490 | OP_DIV, | |
8491 | OP_INTDIV, | |
8492 | OP_REM, | |
8493 | OP_MOD, | |
8494 | OP_CAR, | |
8495 | OP_CDR, | |
8496 | OP_CONS, | |
8497 | OP_SETCAR, | |
8498 | OP_SETCDR, | |
8499 | OP_CHAR2INT, | |
8500 | OP_INT2CHAR, | |
8501 | OP_CHARUPCASE, | |
8502 | OP_CHARDNCASE, | |
8503 | OP_SYM2STR, | |
8504 | OP_ATOM2STR, | |
8505 | OP_STR2SYM, | |
8506 | OP_STR2ATOM, | |
8507 | OP_MKSTRING, | |
8508 | OP_STRLEN, | |
8509 | OP_STRREF, | |
8510 | OP_STRSET, | |
8511 | OP_STRAPPEND, | |
8512 | OP_SUBSTR, | |
8513 | OP_VECTOR, | |
8514 | OP_MKVECTOR, | |
8515 | OP_VECLEN, | |
8516 | OP_VECREF, | |
8517 | OP_VECSET, | |
8518 | OP_NOT, | |
8519 | OP_BOOLP, | |
8520 | OP_EOFOBJP, | |
8521 | OP_NULLP, | |
8522 | OP_NUMEQ, | |
8523 | OP_LESS, | |
8524 | OP_GRE, | |
8525 | OP_LEQ, | |
8526 | OP_GEQ, | |
8527 | OP_SYMBOLP, | |
8528 | OP_NUMBERP, | |
8529 | OP_STRINGP, | |
8530 | OP_INTEGERP, | |
8531 | OP_REALP, | |
8532 | OP_CHARP, | |
8533 | ||
8534 | OP_CHARAP, | |
8535 | OP_CHARNP, | |
8536 | OP_CHARWP, | |
8537 | OP_CHARUP, | |
8538 | OP_CHARLP, | |
8539 | ||
8540 | OP_PORTP, | |
8541 | OP_INPORTP, | |
8542 | OP_OUTPORTP, | |
8543 | OP_PROCP, | |
8544 | OP_PAIRP, | |
8545 | OP_LISTP, | |
8546 | OP_ENVP, | |
8547 | OP_VECTORP, | |
8548 | OP_ARRAYP, | |
8549 | OP_EQ, | |
8550 | OP_EQV, | |
8551 | OP_FORCE, | |
8552 | OP_SAVE_FORCED, | |
8553 | OP_WRITE, | |
8554 | OP_WRITE_CHAR, | |
8555 | OP_DISPLAY, | |
8556 | OP_NEWLINE, | |
8557 | OP_ERR0, | |
8558 | OP_ERR1, | |
8559 | OP_REVERSE, | |
8560 | OP_LIST_STAR, | |
8561 | OP_APPEND, | |
8562 | OP_PUT, | |
8563 | OP_GET, | |
8564 | OP_QUIT, | |
8565 | OP_GC, | |
8566 | OP_GCVERB, | |
8567 | OP_NEWSEGMENT, | |
8568 | OP_OBLIST, | |
8569 | OP_CURR_INPORT, | |
8570 | OP_CURR_OUTPORT, | |
8571 | OP_OPEN_INFILE, | |
8572 | OP_OPEN_OUTFILE, | |
8573 | OP_OPEN_INOUTFILE, | |
8574 | ||
8575 | OP_OPEN_INSTRING, | |
8576 | OP_OPEN_OUTSTRING, | |
8577 | OP_OPEN_INOUTSTRING, | |
8578 | ||
8579 | OP_CLOSE_INPORT, | |
8580 | OP_CLOSE_OUTPORT, | |
8581 | OP_INT_ENV, | |
8582 | OP_CURR_ENV, | |
8583 | OP_READ, | |
8584 | OP_READ_CHAR, | |
8585 | OP_PEEK_CHAR, | |
8586 | OP_CHAR_READY, | |
8587 | OP_SET_INPORT, | |
8588 | OP_SET_OUTPORT, | |
8589 | OP_RDSEXPR, | |
8590 | OP_RDLIST, | |
8591 | OP_RDDOT, | |
8592 | OP_RDQUOTE, | |
8593 | OP_RDQQUOTE, | |
8594 | OP_RDQQUOTEVEC, | |
8595 | OP_RDUNQUOTE, | |
8596 | OP_RDUQTSP, | |
8597 | OP_RDVEC, | |
8598 | OP_P0LIST, | |
8599 | OP_P1LIST, | |
8600 | OP_PVECFROM, | |
8601 | OP_LIST_LENGTH, | |
8602 | OP_ASSQ, | |
8603 | OP_GET_CLOSURE, | |
8604 | OP_CLOSUREP, | |
8605 | OP_MACROP, | |
8606 | # 144 "scheme-private.h" 2 | |
8607 | OP_MAXDEFINED | |
8608 | }; | |
8609 | ||
8610 | ||
8611 | ||
8612 | ||
8613 | ||
8614 | int is_string(pointer p); | |
8615 | char *string_value(pointer p); | |
8616 | int is_number(pointer p); | |
8617 | num nvalue(pointer p); | |
8618 | long ivalue(pointer p); | |
8619 | double rvalue(pointer p); | |
8620 | int is_integer(pointer p); | |
8621 | int is_real(pointer p); | |
8622 | int is_character(pointer p); | |
8623 | int string_length(pointer p); | |
8624 | gunichar charvalue(pointer p); | |
8625 | int is_vector(pointer p); | |
8626 | ||
8627 | int is_port(pointer p); | |
8628 | ||
8629 | int is_pair(pointer p); | |
8630 | pointer pair_car(pointer p); | |
8631 | pointer pair_cdr(pointer p); | |
8632 | pointer set_car(pointer p, pointer q); | |
8633 | pointer set_cdr(pointer p, pointer q); | |
8634 | ||
8635 | int is_symbol(pointer p); | |
8636 | char *symname(pointer p); | |
8637 | int hasprop(pointer p); | |
8638 | ||
8639 | int is_syntax(pointer p); | |
8640 | int is_proc(pointer p); | |
8641 | int is_foreign(pointer p); | |
8642 | char *syntaxname(pointer p); | |
8643 | int is_closure(pointer p); | |
8644 | int is_macro(pointer p); | |
8645 | pointer closure_code(pointer p); | |
8646 | pointer closure_env(pointer p); | |
8647 | ||
8648 | int is_continuation(pointer p); | |
8649 | int is_promise(pointer p); | |
8650 | int is_environment(pointer p); | |
8651 | int is_immutable(pointer p); | |
8652 | void setimmutable(pointer p); | |
8653 | # 48 "scheme.c" 2 | |
8654 | # 75 "scheme.c" | |
8655 | # 1 "/usr/include/string.h" 1 3 4 | |
8656 | ||
8657 | ||
8658 | ||
8659 | ||
8660 | ||
8661 | ||
8662 | ||
8663 | # 1 "/usr/include/gentoo-multilib/ppc64/string.h" 1 3 4 | |
8664 | # 26 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
8665 | # 1 "/usr/include/features.h" 1 3 4 | |
8666 | # 27 "/usr/include/gentoo-multilib/ppc64/string.h" 2 3 4 | |
8667 | ||
8668 | ||
8669 | ||
8670 | ||
8671 | ||
8672 | ||
8673 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
8674 | # 34 "/usr/include/gentoo-multilib/ppc64/string.h" 2 3 4 | |
8675 | ||
8676 | ||
8677 | ||
8678 | ||
8679 | extern void *memcpy (void *__restrict __dest, | |
8680 | __const void *__restrict __src, size_t __n) | |
8681 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
8682 | ||
8683 | ||
8684 | extern void *memmove (void *__dest, __const void *__src, size_t __n) | |
8685 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
8686 | ||
8687 | ||
8688 | ||
8689 | ||
8690 | ||
8691 | ||
8692 | extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, | |
8693 | int __c, size_t __n) | |
8694 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
8695 | ||
8696 | ||
8697 | ||
8698 | ||
8699 | ||
8700 | extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
8701 | ||
8702 | ||
8703 | extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) | |
8704 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
8705 | ||
8706 | ||
8707 | extern void *memchr (__const void *__s, int __c, size_t __n) | |
8708 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
8709 | ||
8710 | # 82 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
8711 | ||
8712 | ||
8713 | extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) | |
8714 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
8715 | ||
8716 | extern char *strncpy (char *__restrict __dest, | |
8717 | __const char *__restrict __src, size_t __n) | |
8718 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
8719 | ||
8720 | ||
8721 | extern char *strcat (char *__restrict __dest, __const char *__restrict __src) | |
8722 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
8723 | ||
8724 | extern char *strncat (char *__restrict __dest, __const char *__restrict __src, | |
8725 | size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
8726 | ||
8727 | ||
8728 | extern int strcmp (__const char *__s1, __const char *__s2) | |
8729 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
8730 | ||
8731 | extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) | |
8732 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
8733 | ||
8734 | ||
8735 | extern int strcoll (__const char *__s1, __const char *__s2) | |
8736 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
8737 | ||
8738 | extern size_t strxfrm (char *__restrict __dest, | |
8739 | __const char *__restrict __src, size_t __n) | |
8740 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
8741 | ||
8742 | # 130 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
8743 | extern char *strdup (__const char *__s) | |
8744 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); | |
8745 | # 165 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
8746 | ||
8747 | ||
8748 | extern char *strchr (__const char *__s, int __c) | |
8749 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
8750 | ||
8751 | extern char *strrchr (__const char *__s, int __c) | |
8752 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
8753 | ||
8754 | # 181 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
8755 | ||
8756 | ||
8757 | ||
8758 | extern size_t strcspn (__const char *__s, __const char *__reject) | |
8759 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
8760 | ||
8761 | ||
8762 | extern size_t strspn (__const char *__s, __const char *__accept) | |
8763 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
8764 | ||
8765 | extern char *strpbrk (__const char *__s, __const char *__accept) | |
8766 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
8767 | ||
8768 | extern char *strstr (__const char *__haystack, __const char *__needle) | |
8769 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
8770 | ||
8771 | ||
8772 | ||
8773 | extern char *strtok (char *__restrict __s, __const char *__restrict __delim) | |
8774 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
8775 | ||
8776 | ||
8777 | ||
8778 | ||
8779 | extern char *__strtok_r (char *__restrict __s, | |
8780 | __const char *__restrict __delim, | |
8781 | char **__restrict __save_ptr) | |
8782 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); | |
8783 | ||
8784 | extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, | |
8785 | char **__restrict __save_ptr) | |
8786 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); | |
8787 | # 240 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
8788 | ||
8789 | ||
8790 | extern size_t strlen (__const char *__s) | |
8791 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
8792 | ||
8793 | # 254 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
8794 | ||
8795 | ||
8796 | extern char *strerror (int __errnum) __attribute__ ((__nothrow__)); | |
8797 | ||
8798 | # 270 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
8799 | extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
8800 | # 288 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
8801 | extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
8802 | ||
8803 | ||
8804 | ||
8805 | extern void bcopy (__const void *__src, void *__dest, size_t __n) | |
8806 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
8807 | ||
8808 | ||
8809 | extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
8810 | ||
8811 | ||
8812 | extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) | |
8813 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
8814 | ||
8815 | ||
8816 | extern char *index (__const char *__s, int __c) | |
8817 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
8818 | ||
8819 | ||
8820 | extern char *rindex (__const char *__s, int __c) | |
8821 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); | |
8822 | ||
8823 | ||
8824 | ||
8825 | extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); | |
8826 | # 325 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
8827 | extern int strcasecmp (__const char *__s1, __const char *__s2) | |
8828 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
8829 | ||
8830 | ||
8831 | extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) | |
8832 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); | |
8833 | # 348 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
8834 | extern char *strsep (char **__restrict __stringp, | |
8835 | __const char *__restrict __delim) | |
8836 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
8837 | # 414 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
8838 | # 1 "/usr/include/bits/string.h" 1 3 4 | |
8839 | ||
8840 | ||
8841 | ||
8842 | ||
8843 | ||
8844 | ||
8845 | ||
8846 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/string.h" 1 3 4 | |
8847 | # 9 "/usr/include/bits/string.h" 2 3 4 | |
8848 | # 415 "/usr/include/gentoo-multilib/ppc64/string.h" 2 3 4 | |
8849 | ||
8850 | ||
8851 | # 1 "/usr/include/bits/string2.h" 1 3 4 | |
8852 | ||
8853 | ||
8854 | ||
8855 | ||
8856 | ||
8857 | ||
8858 | ||
8859 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/string2.h" 1 3 4 | |
8860 | # 80 "/usr/include/gentoo-multilib/ppc64/bits/string2.h" 3 4 | |
8861 | typedef struct { unsigned char __arr[2]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR2; | |
8862 | typedef struct { unsigned char __arr[3]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR3; | |
8863 | typedef struct { unsigned char __arr[4]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR4; | |
8864 | typedef struct { unsigned char __arr[5]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR5; | |
8865 | typedef struct { unsigned char __arr[6]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR6; | |
8866 | typedef struct { unsigned char __arr[7]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR7; | |
8867 | typedef struct { unsigned char __arr[8]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR8; | |
8868 | # 394 "/usr/include/gentoo-multilib/ppc64/bits/string2.h" 3 4 | |
8869 | extern void *__rawmemchr (const void *__s, int __c); | |
8870 | # 969 "/usr/include/gentoo-multilib/ppc64/bits/string2.h" 3 4 | |
8871 | extern __inline size_t __strcspn_c1 (__const char *__s, int __reject); | |
8872 | extern __inline size_t | |
8873 | __strcspn_c1 (__const char *__s, int __reject) | |
8874 | { | |
8875 | register size_t __result = 0; | |
8876 | while (__s[__result] != '\0' && __s[__result] != __reject) | |
8877 | ++__result; | |
8878 | return __result; | |
8879 | } | |
8880 | ||
8881 | extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1, | |
8882 | int __reject2); | |
8883 | extern __inline size_t | |
8884 | __strcspn_c2 (__const char *__s, int __reject1, int __reject2) | |
8885 | { | |
8886 | register size_t __result = 0; | |
8887 | while (__s[__result] != '\0' && __s[__result] != __reject1 | |
8888 | && __s[__result] != __reject2) | |
8889 | ++__result; | |
8890 | return __result; | |
8891 | } | |
8892 | ||
8893 | extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1, | |
8894 | int __reject2, int __reject3); | |
8895 | extern __inline size_t | |
8896 | __strcspn_c3 (__const char *__s, int __reject1, int __reject2, | |
8897 | int __reject3) | |
8898 | { | |
8899 | register size_t __result = 0; | |
8900 | while (__s[__result] != '\0' && __s[__result] != __reject1 | |
8901 | && __s[__result] != __reject2 && __s[__result] != __reject3) | |
8902 | ++__result; | |
8903 | return __result; | |
8904 | } | |
8905 | # 1045 "/usr/include/gentoo-multilib/ppc64/bits/string2.h" 3 4 | |
8906 | extern __inline size_t __strspn_c1 (__const char *__s, int __accept); | |
8907 | extern __inline size_t | |
8908 | __strspn_c1 (__const char *__s, int __accept) | |
8909 | { | |
8910 | register size_t __result = 0; | |
8911 | ||
8912 | while (__s[__result] == __accept) | |
8913 | ++__result; | |
8914 | return __result; | |
8915 | } | |
8916 | ||
8917 | extern __inline size_t __strspn_c2 (__const char *__s, int __accept1, | |
8918 | int __accept2); | |
8919 | extern __inline size_t | |
8920 | __strspn_c2 (__const char *__s, int __accept1, int __accept2) | |
8921 | { | |
8922 | register size_t __result = 0; | |
8923 | ||
8924 | while (__s[__result] == __accept1 || __s[__result] == __accept2) | |
8925 | ++__result; | |
8926 | return __result; | |
8927 | } | |
8928 | ||
8929 | extern __inline size_t __strspn_c3 (__const char *__s, int __accept1, | |
8930 | int __accept2, int __accept3); | |
8931 | extern __inline size_t | |
8932 | __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) | |
8933 | { | |
8934 | register size_t __result = 0; | |
8935 | ||
8936 | while (__s[__result] == __accept1 || __s[__result] == __accept2 | |
8937 | || __s[__result] == __accept3) | |
8938 | ++__result; | |
8939 | return __result; | |
8940 | } | |
8941 | # 1121 "/usr/include/gentoo-multilib/ppc64/bits/string2.h" 3 4 | |
8942 | extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1, | |
8943 | int __accept2); | |
8944 | extern __inline char * | |
8945 | __strpbrk_c2 (__const char *__s, int __accept1, int __accept2) | |
8946 | { | |
8947 | ||
8948 | while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) | |
8949 | ++__s; | |
8950 | return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; | |
8951 | } | |
8952 | ||
8953 | extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1, | |
8954 | int __accept2, int __accept3); | |
8955 | extern __inline char * | |
8956 | __strpbrk_c3 (__const char *__s, int __accept1, int __accept2, | |
8957 | int __accept3) | |
8958 | { | |
8959 | ||
8960 | while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 | |
8961 | && *__s != __accept3) | |
8962 | ++__s; | |
8963 | return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; | |
8964 | } | |
8965 | # 1173 "/usr/include/gentoo-multilib/ppc64/bits/string2.h" 3 4 | |
8966 | extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp); | |
8967 | extern __inline char * | |
8968 | __strtok_r_1c (char *__s, char __sep, char **__nextp) | |
8969 | { | |
8970 | char *__result; | |
8971 | if (__s == ((void *)0)) | |
8972 | __s = *__nextp; | |
8973 | while (*__s == __sep) | |
8974 | ++__s; | |
8975 | __result = ((void *)0); | |
8976 | if (*__s != '\0') | |
8977 | { | |
8978 | __result = __s++; | |
8979 | while (*__s != '\0') | |
8980 | if (*__s++ == __sep) | |
8981 | { | |
8982 | __s[-1] = '\0'; | |
8983 | break; | |
8984 | } | |
8985 | *__nextp = __s; | |
8986 | } | |
8987 | return __result; | |
8988 | } | |
8989 | # 1205 "/usr/include/gentoo-multilib/ppc64/bits/string2.h" 3 4 | |
8990 | extern char *__strsep_g (char **__stringp, __const char *__delim); | |
8991 | # 1223 "/usr/include/gentoo-multilib/ppc64/bits/string2.h" 3 4 | |
8992 | extern __inline char *__strsep_1c (char **__s, char __reject); | |
8993 | extern __inline char * | |
8994 | __strsep_1c (char **__s, char __reject) | |
8995 | { | |
8996 | register char *__retval = *__s; | |
8997 | 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)) | |
8998 | *(*__s)++ = '\0'; | |
8999 | return __retval; | |
9000 | } | |
9001 | ||
9002 | extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2); | |
9003 | extern __inline char * | |
9004 | __strsep_2c (char **__s, char __reject1, char __reject2) | |
9005 | { | |
9006 | register char *__retval = *__s; | |
9007 | if (__retval != ((void *)0)) | |
9008 | { | |
9009 | register char *__cp = __retval; | |
9010 | while (1) | |
9011 | { | |
9012 | if (*__cp == '\0') | |
9013 | { | |
9014 | __cp = ((void *)0); | |
9015 | break; | |
9016 | } | |
9017 | if (*__cp == __reject1 || *__cp == __reject2) | |
9018 | { | |
9019 | *__cp++ = '\0'; | |
9020 | break; | |
9021 | } | |
9022 | ++__cp; | |
9023 | } | |
9024 | *__s = __cp; | |
9025 | } | |
9026 | return __retval; | |
9027 | } | |
9028 | ||
9029 | extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2, | |
9030 | char __reject3); | |
9031 | extern __inline char * | |
9032 | __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) | |
9033 | { | |
9034 | register char *__retval = *__s; | |
9035 | if (__retval != ((void *)0)) | |
9036 | { | |
9037 | register char *__cp = __retval; | |
9038 | while (1) | |
9039 | { | |
9040 | if (*__cp == '\0') | |
9041 | { | |
9042 | __cp = ((void *)0); | |
9043 | break; | |
9044 | } | |
9045 | if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3) | |
9046 | { | |
9047 | *__cp++ = '\0'; | |
9048 | break; | |
9049 | } | |
9050 | ++__cp; | |
9051 | } | |
9052 | *__s = __cp; | |
9053 | } | |
9054 | return __retval; | |
9055 | } | |
9056 | # 1299 "/usr/include/gentoo-multilib/ppc64/bits/string2.h" 3 4 | |
9057 | # 1 "/usr/include/stdlib.h" 1 3 4 | |
9058 | ||
9059 | ||
9060 | ||
9061 | ||
9062 | ||
9063 | ||
9064 | ||
9065 | # 1 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 1 3 4 | |
9066 | # 25 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
9067 | # 1 "/usr/include/features.h" 1 3 4 | |
9068 | # 26 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 2 3 4 | |
9069 | ||
9070 | ||
9071 | ||
9072 | ||
9073 | ||
9074 | ||
9075 | ||
9076 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
9077 | # 34 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 2 3 4 | |
9078 | ||
9079 | ||
9080 | # 587 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
9081 | ||
9082 | ||
9083 | extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; | |
9084 | ||
9085 | extern void *calloc (size_t __nmemb, size_t __size) | |
9086 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; | |
9087 | ||
9088 | # 978 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
9089 | ||
9090 | # 9 "/usr/include/stdlib.h" 2 3 4 | |
9091 | # 1300 "/usr/include/gentoo-multilib/ppc64/bits/string2.h" 2 3 4 | |
9092 | ||
9093 | ||
9094 | ||
9095 | ||
9096 | extern char *__strdup (__const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); | |
9097 | # 1323 "/usr/include/gentoo-multilib/ppc64/bits/string2.h" 3 4 | |
9098 | extern char *__strndup (__const char *__string, size_t __n) | |
9099 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); | |
9100 | # 9 "/usr/include/bits/string2.h" 2 3 4 | |
9101 | # 418 "/usr/include/gentoo-multilib/ppc64/string.h" 2 3 4 | |
9102 | # 426 "/usr/include/gentoo-multilib/ppc64/string.h" 3 4 | |
9103 | ||
9104 | # 9 "/usr/include/string.h" 2 3 4 | |
9105 | # 76 "scheme.c" 2 | |
9106 | # 1 "/usr/include/stdlib.h" 1 3 4 | |
9107 | ||
9108 | ||
9109 | ||
9110 | ||
9111 | ||
9112 | ||
9113 | ||
9114 | # 1 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 1 3 4 | |
9115 | # 25 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
9116 | # 1 "/usr/include/features.h" 1 3 4 | |
9117 | # 26 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 2 3 4 | |
9118 | ||
9119 | ||
9120 | ||
9121 | ||
9122 | ||
9123 | ||
9124 | ||
9125 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
9126 | # 34 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 2 3 4 | |
9127 | ||
9128 | ||
9129 | # 96 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
9130 | ||
9131 | ||
9132 | typedef struct | |
9133 | { | |
9134 | int quot; | |
9135 | int rem; | |
9136 | } div_t; | |
9137 | ||
9138 | ||
9139 | ||
9140 | typedef struct | |
9141 | { | |
9142 | long int quot; | |
9143 | long int rem; | |
9144 | } ldiv_t; | |
9145 | ||
9146 | ||
9147 | ||
9148 | # 140 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
9149 | extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) ; | |
9150 | ||
9151 | ||
9152 | ||
9153 | ||
9154 | extern double atof (__const char *__nptr) | |
9155 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
9156 | ||
9157 | extern int atoi (__const char *__nptr) | |
9158 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
9159 | ||
9160 | extern long int atol (__const char *__nptr) | |
9161 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
9162 | ||
9163 | ||
9164 | ||
9165 | ||
9166 | ||
9167 | __extension__ extern long long int atoll (__const char *__nptr) | |
9168 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
9169 | ||
9170 | ||
9171 | ||
9172 | ||
9173 | ||
9174 | extern double strtod (__const char *__restrict __nptr, | |
9175 | char **__restrict __endptr) | |
9176 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9177 | ||
9178 | # 182 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
9179 | ||
9180 | ||
9181 | extern long int strtol (__const char *__restrict __nptr, | |
9182 | char **__restrict __endptr, int __base) | |
9183 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9184 | ||
9185 | extern unsigned long int strtoul (__const char *__restrict __nptr, | |
9186 | char **__restrict __endptr, int __base) | |
9187 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9188 | ||
9189 | ||
9190 | ||
9191 | ||
9192 | __extension__ | |
9193 | extern long long int strtoq (__const char *__restrict __nptr, | |
9194 | char **__restrict __endptr, int __base) | |
9195 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9196 | ||
9197 | __extension__ | |
9198 | extern unsigned long long int strtouq (__const char *__restrict __nptr, | |
9199 | char **__restrict __endptr, int __base) | |
9200 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9201 | ||
9202 | ||
9203 | ||
9204 | ||
9205 | ||
9206 | __extension__ | |
9207 | extern long long int strtoll (__const char *__restrict __nptr, | |
9208 | char **__restrict __endptr, int __base) | |
9209 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9210 | ||
9211 | __extension__ | |
9212 | extern unsigned long long int strtoull (__const char *__restrict __nptr, | |
9213 | char **__restrict __endptr, int __base) | |
9214 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9215 | ||
9216 | # 279 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
9217 | extern double __strtod_internal (__const char *__restrict __nptr, | |
9218 | char **__restrict __endptr, int __group) | |
9219 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9220 | extern float __strtof_internal (__const char *__restrict __nptr, | |
9221 | char **__restrict __endptr, int __group) | |
9222 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9223 | extern long double __strtold_internal (__const char *__restrict __nptr, | |
9224 | char **__restrict __endptr, | |
9225 | int __group) | |
9226 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9227 | ||
9228 | extern long int __strtol_internal (__const char *__restrict __nptr, | |
9229 | char **__restrict __endptr, | |
9230 | int __base, int __group) | |
9231 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9232 | ||
9233 | ||
9234 | ||
9235 | extern unsigned long int __strtoul_internal (__const char *__restrict __nptr, | |
9236 | char **__restrict __endptr, | |
9237 | int __base, int __group) | |
9238 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9239 | ||
9240 | ||
9241 | ||
9242 | ||
9243 | __extension__ | |
9244 | extern long long int __strtoll_internal (__const char *__restrict __nptr, | |
9245 | char **__restrict __endptr, | |
9246 | int __base, int __group) | |
9247 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9248 | ||
9249 | ||
9250 | ||
9251 | __extension__ | |
9252 | extern unsigned long long int __strtoull_internal (__const char * | |
9253 | __restrict __nptr, | |
9254 | char **__restrict __endptr, | |
9255 | int __base, int __group) | |
9256 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9257 | ||
9258 | ||
9259 | ||
9260 | ||
9261 | ||
9262 | ||
9263 | ||
9264 | ||
9265 | extern __inline double | |
9266 | __attribute__ ((__nothrow__)) strtod (__const char *__restrict __nptr, char **__restrict __endptr) | |
9267 | { | |
9268 | return __strtod_internal (__nptr, __endptr, 0); | |
9269 | } | |
9270 | extern __inline long int | |
9271 | __attribute__ ((__nothrow__)) strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
9272 | ||
9273 | { | |
9274 | return __strtol_internal (__nptr, __endptr, __base, 0); | |
9275 | } | |
9276 | extern __inline unsigned long int | |
9277 | __attribute__ ((__nothrow__)) strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
9278 | ||
9279 | { | |
9280 | return __strtoul_internal (__nptr, __endptr, __base, 0); | |
9281 | } | |
9282 | ||
9283 | # 364 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
9284 | __extension__ extern __inline long long int | |
9285 | __attribute__ ((__nothrow__)) strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
9286 | ||
9287 | { | |
9288 | return __strtoll_internal (__nptr, __endptr, __base, 0); | |
9289 | } | |
9290 | __extension__ extern __inline unsigned long long int | |
9291 | __attribute__ ((__nothrow__)) strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
9292 | ||
9293 | { | |
9294 | return __strtoull_internal (__nptr, __endptr, __base, 0); | |
9295 | } | |
9296 | ||
9297 | ||
9298 | ||
9299 | ||
9300 | __extension__ extern __inline long long int | |
9301 | __attribute__ ((__nothrow__)) strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base) | |
9302 | ||
9303 | { | |
9304 | return __strtoll_internal (__nptr, __endptr, __base, 0); | |
9305 | } | |
9306 | __extension__ extern __inline unsigned long long int | |
9307 | __attribute__ ((__nothrow__)) strtoull (__const char * __restrict __nptr, char **__restrict __endptr, int __base) | |
9308 | ||
9309 | { | |
9310 | return __strtoull_internal (__nptr, __endptr, __base, 0); | |
9311 | } | |
9312 | ||
9313 | ||
9314 | ||
9315 | ||
9316 | extern __inline double | |
9317 | __attribute__ ((__nothrow__)) atof (__const char *__nptr) | |
9318 | { | |
9319 | return strtod (__nptr, (char **) ((void *)0)); | |
9320 | } | |
9321 | extern __inline int | |
9322 | __attribute__ ((__nothrow__)) atoi (__const char *__nptr) | |
9323 | { | |
9324 | return (int) strtol (__nptr, (char **) ((void *)0), 10); | |
9325 | } | |
9326 | extern __inline long int | |
9327 | __attribute__ ((__nothrow__)) atol (__const char *__nptr) | |
9328 | { | |
9329 | return strtol (__nptr, (char **) ((void *)0), 10); | |
9330 | } | |
9331 | ||
9332 | ||
9333 | ||
9334 | ||
9335 | __extension__ extern __inline long long int | |
9336 | __attribute__ ((__nothrow__)) atoll (__const char *__nptr) | |
9337 | { | |
9338 | return strtoll (__nptr, (char **) ((void *)0), 10); | |
9339 | } | |
9340 | ||
9341 | # 429 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
9342 | extern char *l64a (long int __n) __attribute__ ((__nothrow__)) ; | |
9343 | ||
9344 | ||
9345 | extern long int a64l (__const char *__s) | |
9346 | __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; | |
9347 | ||
9348 | ||
9349 | ||
9350 | ||
9351 | # 1 "/usr/include/sys/types.h" 1 3 4 | |
9352 | ||
9353 | ||
9354 | ||
9355 | ||
9356 | ||
9357 | ||
9358 | ||
9359 | # 1 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 1 3 4 | |
9360 | # 27 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 3 4 | |
9361 | # 1 "/usr/include/features.h" 1 3 4 | |
9362 | # 28 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 2 3 4 | |
9363 | ||
9364 | ||
9365 | ||
9366 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
9367 | # 32 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 2 3 4 | |
9368 | ||
9369 | ||
9370 | ||
9371 | typedef __u_char u_char; | |
9372 | typedef __u_short u_short; | |
9373 | typedef __u_int u_int; | |
9374 | typedef __u_long u_long; | |
9375 | typedef __quad_t quad_t; | |
9376 | typedef __u_quad_t u_quad_t; | |
9377 | typedef __fsid_t fsid_t; | |
9378 | ||
9379 | ||
9380 | ||
9381 | ||
9382 | typedef __loff_t loff_t; | |
9383 | ||
9384 | ||
9385 | ||
9386 | typedef __ino_t ino_t; | |
9387 | # 62 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 3 4 | |
9388 | typedef __dev_t dev_t; | |
9389 | # 72 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 3 4 | |
9390 | typedef __mode_t mode_t; | |
9391 | ||
9392 | ||
9393 | ||
9394 | ||
9395 | typedef __nlink_t nlink_t; | |
9396 | # 105 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 3 4 | |
9397 | typedef __id_t id_t; | |
9398 | # 116 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 3 4 | |
9399 | typedef __daddr_t daddr_t; | |
9400 | typedef __caddr_t caddr_t; | |
9401 | ||
9402 | ||
9403 | ||
9404 | ||
9405 | ||
9406 | typedef __key_t key_t; | |
9407 | # 133 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 3 4 | |
9408 | # 1 "/usr/include/time.h" 1 3 4 | |
9409 | # 134 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 2 3 4 | |
9410 | # 147 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 3 4 | |
9411 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
9412 | # 148 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 2 3 4 | |
9413 | ||
9414 | ||
9415 | ||
9416 | typedef unsigned long int ulong; | |
9417 | typedef unsigned short int ushort; | |
9418 | typedef unsigned int uint; | |
9419 | # 195 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 3 4 | |
9420 | typedef int int8_t __attribute__ ((__mode__ (__QI__))); | |
9421 | typedef int int16_t __attribute__ ((__mode__ (__HI__))); | |
9422 | typedef int int32_t __attribute__ ((__mode__ (__SI__))); | |
9423 | typedef int int64_t __attribute__ ((__mode__ (__DI__))); | |
9424 | ||
9425 | ||
9426 | typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); | |
9427 | typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); | |
9428 | typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); | |
9429 | typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); | |
9430 | ||
9431 | typedef int register_t __attribute__ ((__mode__ (__word__))); | |
9432 | # 217 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 3 4 | |
9433 | # 1 "/usr/include/endian.h" 1 3 4 | |
9434 | # 218 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 2 3 4 | |
9435 | ||
9436 | ||
9437 | # 1 "/usr/include/sys/select.h" 1 3 4 | |
9438 | ||
9439 | ||
9440 | ||
9441 | ||
9442 | ||
9443 | ||
9444 | ||
9445 | # 1 "/usr/include/gentoo-multilib/ppc64/sys/select.h" 1 3 4 | |
9446 | # 25 "/usr/include/gentoo-multilib/ppc64/sys/select.h" 3 4 | |
9447 | # 1 "/usr/include/features.h" 1 3 4 | |
9448 | # 26 "/usr/include/gentoo-multilib/ppc64/sys/select.h" 2 3 4 | |
9449 | ||
9450 | ||
9451 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
9452 | # 29 "/usr/include/gentoo-multilib/ppc64/sys/select.h" 2 3 4 | |
9453 | ||
9454 | ||
9455 | # 1 "/usr/include/bits/select.h" 1 3 4 | |
9456 | ||
9457 | ||
9458 | ||
9459 | ||
9460 | ||
9461 | ||
9462 | ||
9463 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/select.h" 1 3 4 | |
9464 | # 9 "/usr/include/bits/select.h" 2 3 4 | |
9465 | # 32 "/usr/include/gentoo-multilib/ppc64/sys/select.h" 2 3 4 | |
9466 | ||
9467 | ||
9468 | # 1 "/usr/include/bits/sigset.h" 1 3 4 | |
9469 | ||
9470 | ||
9471 | ||
9472 | ||
9473 | ||
9474 | ||
9475 | ||
9476 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/sigset.h" 1 3 4 | |
9477 | # 23 "/usr/include/gentoo-multilib/ppc64/bits/sigset.h" 3 4 | |
9478 | typedef int __sig_atomic_t; | |
9479 | ||
9480 | ||
9481 | ||
9482 | ||
9483 | typedef struct | |
9484 | { | |
9485 | unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; | |
9486 | } __sigset_t; | |
9487 | # 9 "/usr/include/bits/sigset.h" 2 3 4 | |
9488 | # 35 "/usr/include/gentoo-multilib/ppc64/sys/select.h" 2 3 4 | |
9489 | ||
9490 | ||
9491 | ||
9492 | typedef __sigset_t sigset_t; | |
9493 | ||
9494 | ||
9495 | ||
9496 | ||
9497 | ||
9498 | # 1 "/usr/include/time.h" 1 3 4 | |
9499 | # 45 "/usr/include/gentoo-multilib/ppc64/sys/select.h" 2 3 4 | |
9500 | ||
9501 | # 1 "/usr/include/bits/time.h" 1 3 4 | |
9502 | ||
9503 | ||
9504 | ||
9505 | ||
9506 | ||
9507 | ||
9508 | ||
9509 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/time.h" 1 3 4 | |
9510 | # 65 "/usr/include/gentoo-multilib/ppc64/bits/time.h" 3 4 | |
9511 | # 1 "/usr/include/bits/types.h" 1 3 4 | |
9512 | # 66 "/usr/include/gentoo-multilib/ppc64/bits/time.h" 2 3 4 | |
9513 | ||
9514 | ||
9515 | ||
9516 | struct timeval | |
9517 | { | |
9518 | __time_t tv_sec; | |
9519 | __suseconds_t tv_usec; | |
9520 | }; | |
9521 | # 9 "/usr/include/bits/time.h" 2 3 4 | |
9522 | # 47 "/usr/include/gentoo-multilib/ppc64/sys/select.h" 2 3 4 | |
9523 | ||
9524 | ||
9525 | typedef __suseconds_t suseconds_t; | |
9526 | ||
9527 | ||
9528 | ||
9529 | ||
9530 | ||
9531 | typedef long int __fd_mask; | |
9532 | # 67 "/usr/include/gentoo-multilib/ppc64/sys/select.h" 3 4 | |
9533 | typedef struct | |
9534 | { | |
9535 | ||
9536 | ||
9537 | ||
9538 | ||
9539 | ||
9540 | ||
9541 | __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))]; | |
9542 | ||
9543 | ||
9544 | } fd_set; | |
9545 | ||
9546 | ||
9547 | ||
9548 | ||
9549 | ||
9550 | ||
9551 | typedef __fd_mask fd_mask; | |
9552 | # 99 "/usr/include/gentoo-multilib/ppc64/sys/select.h" 3 4 | |
9553 | ||
9554 | # 109 "/usr/include/gentoo-multilib/ppc64/sys/select.h" 3 4 | |
9555 | extern int select (int __nfds, fd_set *__restrict __readfds, | |
9556 | fd_set *__restrict __writefds, | |
9557 | fd_set *__restrict __exceptfds, | |
9558 | struct timeval *__restrict __timeout); | |
9559 | # 121 "/usr/include/gentoo-multilib/ppc64/sys/select.h" 3 4 | |
9560 | extern int pselect (int __nfds, fd_set *__restrict __readfds, | |
9561 | fd_set *__restrict __writefds, | |
9562 | fd_set *__restrict __exceptfds, | |
9563 | const struct timespec *__restrict __timeout, | |
9564 | const __sigset_t *__restrict __sigmask); | |
9565 | ||
9566 | ||
9567 | ||
9568 | # 9 "/usr/include/sys/select.h" 2 3 4 | |
9569 | # 221 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 2 3 4 | |
9570 | ||
9571 | ||
9572 | # 1 "/usr/include/sys/sysmacros.h" 1 3 4 | |
9573 | ||
9574 | ||
9575 | ||
9576 | ||
9577 | ||
9578 | ||
9579 | ||
9580 | # 1 "/usr/include/gentoo-multilib/ppc64/sys/sysmacros.h" 1 3 4 | |
9581 | # 23 "/usr/include/gentoo-multilib/ppc64/sys/sysmacros.h" 3 4 | |
9582 | # 1 "/usr/include/features.h" 1 3 4 | |
9583 | # 24 "/usr/include/gentoo-multilib/ppc64/sys/sysmacros.h" 2 3 4 | |
9584 | ||
9585 | ||
9586 | ||
9587 | ||
9588 | ||
9589 | __extension__ | |
9590 | extern __inline unsigned int gnu_dev_major (unsigned long long int __dev) | |
9591 | __attribute__ ((__nothrow__)); | |
9592 | __extension__ | |
9593 | extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev) | |
9594 | __attribute__ ((__nothrow__)); | |
9595 | __extension__ | |
9596 | extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major, | |
9597 | unsigned int __minor) | |
9598 | __attribute__ ((__nothrow__)); | |
9599 | ||
9600 | ||
9601 | __extension__ extern __inline unsigned int | |
9602 | __attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev) | |
9603 | { | |
9604 | return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); | |
9605 | } | |
9606 | ||
9607 | __extension__ extern __inline unsigned int | |
9608 | __attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev) | |
9609 | { | |
9610 | return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); | |
9611 | } | |
9612 | ||
9613 | __extension__ extern __inline unsigned long long int | |
9614 | __attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor) | |
9615 | { | |
9616 | return ((__minor & 0xff) | ((__major & 0xfff) << 8) | |
9617 | | (((unsigned long long int) (__minor & ~0xff)) << 12) | |
9618 | | (((unsigned long long int) (__major & ~0xfff)) << 32)); | |
9619 | } | |
9620 | # 9 "/usr/include/sys/sysmacros.h" 2 3 4 | |
9621 | # 224 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 2 3 4 | |
9622 | # 235 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 3 4 | |
9623 | typedef __blkcnt_t blkcnt_t; | |
9624 | ||
9625 | ||
9626 | ||
9627 | typedef __fsblkcnt_t fsblkcnt_t; | |
9628 | ||
9629 | ||
9630 | ||
9631 | typedef __fsfilcnt_t fsfilcnt_t; | |
9632 | # 270 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 3 4 | |
9633 | # 1 "/usr/include/bits/pthreadtypes.h" 1 3 4 | |
9634 | ||
9635 | ||
9636 | ||
9637 | ||
9638 | ||
9639 | ||
9640 | ||
9641 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/pthreadtypes.h" 1 3 4 | |
9642 | # 24 "/usr/include/gentoo-multilib/ppc64/bits/pthreadtypes.h" 3 4 | |
9643 | # 1 "/usr/include/bits/wordsize.h" 1 3 4 | |
9644 | ||
9645 | ||
9646 | ||
9647 | ||
9648 | ||
9649 | ||
9650 | ||
9651 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/wordsize.h" 1 3 4 | |
9652 | # 9 "/usr/include/bits/wordsize.h" 2 3 4 | |
9653 | # 25 "/usr/include/gentoo-multilib/ppc64/bits/pthreadtypes.h" 2 3 4 | |
9654 | # 51 "/usr/include/gentoo-multilib/ppc64/bits/pthreadtypes.h" 3 4 | |
9655 | typedef unsigned long int pthread_t; | |
9656 | ||
9657 | ||
9658 | typedef union | |
9659 | { | |
9660 | char __size[56]; | |
9661 | long int __align; | |
9662 | } pthread_attr_t; | |
9663 | ||
9664 | ||
9665 | ||
9666 | typedef struct __pthread_internal_list | |
9667 | { | |
9668 | struct __pthread_internal_list *__prev; | |
9669 | struct __pthread_internal_list *__next; | |
9670 | } __pthread_list_t; | |
9671 | # 77 "/usr/include/gentoo-multilib/ppc64/bits/pthreadtypes.h" 3 4 | |
9672 | typedef union | |
9673 | { | |
9674 | struct __pthread_mutex_s | |
9675 | { | |
9676 | int __lock; | |
9677 | unsigned int __count; | |
9678 | int __owner; | |
9679 | ||
9680 | unsigned int __nusers; | |
9681 | ||
9682 | ||
9683 | ||
9684 | int __kind; | |
9685 | ||
9686 | int __spins; | |
9687 | __pthread_list_t __list; | |
9688 | # 102 "/usr/include/gentoo-multilib/ppc64/bits/pthreadtypes.h" 3 4 | |
9689 | } __data; | |
9690 | char __size[40]; | |
9691 | long int __align; | |
9692 | } pthread_mutex_t; | |
9693 | ||
9694 | typedef union | |
9695 | { | |
9696 | char __size[4]; | |
9697 | int __align; | |
9698 | } pthread_mutexattr_t; | |
9699 | ||
9700 | ||
9701 | ||
9702 | ||
9703 | typedef union | |
9704 | { | |
9705 | struct | |
9706 | { | |
9707 | int __lock; | |
9708 | unsigned int __futex; | |
9709 | __extension__ unsigned long long int __total_seq; | |
9710 | __extension__ unsigned long long int __wakeup_seq; | |
9711 | __extension__ unsigned long long int __woken_seq; | |
9712 | void *__mutex; | |
9713 | unsigned int __nwaiters; | |
9714 | unsigned int __broadcast_seq; | |
9715 | } __data; | |
9716 | char __size[48]; | |
9717 | __extension__ long long int __align; | |
9718 | } pthread_cond_t; | |
9719 | ||
9720 | typedef union | |
9721 | { | |
9722 | char __size[4]; | |
9723 | int __align; | |
9724 | } pthread_condattr_t; | |
9725 | ||
9726 | ||
9727 | ||
9728 | typedef unsigned int pthread_key_t; | |
9729 | ||
9730 | ||
9731 | ||
9732 | typedef int pthread_once_t; | |
9733 | ||
9734 | ||
9735 | ||
9736 | ||
9737 | ||
9738 | typedef union | |
9739 | { | |
9740 | ||
9741 | struct | |
9742 | { | |
9743 | int __lock; | |
9744 | unsigned int __nr_readers; | |
9745 | unsigned int __readers_wakeup; | |
9746 | unsigned int __writer_wakeup; | |
9747 | unsigned int __nr_readers_queued; | |
9748 | unsigned int __nr_writers_queued; | |
9749 | int __writer; | |
9750 | int __pad1; | |
9751 | unsigned long int __pad2; | |
9752 | unsigned long int __pad3; | |
9753 | ||
9754 | ||
9755 | unsigned int __flags; | |
9756 | } __data; | |
9757 | # 185 "/usr/include/gentoo-multilib/ppc64/bits/pthreadtypes.h" 3 4 | |
9758 | char __size[56]; | |
9759 | long int __align; | |
9760 | } pthread_rwlock_t; | |
9761 | ||
9762 | typedef union | |
9763 | { | |
9764 | char __size[8]; | |
9765 | long int __align; | |
9766 | } pthread_rwlockattr_t; | |
9767 | ||
9768 | ||
9769 | ||
9770 | ||
9771 | ||
9772 | typedef volatile int pthread_spinlock_t; | |
9773 | ||
9774 | ||
9775 | ||
9776 | ||
9777 | typedef union | |
9778 | { | |
9779 | char __size[32]; | |
9780 | long int __align; | |
9781 | } pthread_barrier_t; | |
9782 | ||
9783 | typedef union | |
9784 | { | |
9785 | char __size[4]; | |
9786 | int __align; | |
9787 | } pthread_barrierattr_t; | |
9788 | # 9 "/usr/include/bits/pthreadtypes.h" 2 3 4 | |
9789 | # 271 "/usr/include/gentoo-multilib/ppc64/sys/types.h" 2 3 4 | |
9790 | ||
9791 | ||
9792 | ||
9793 | # 9 "/usr/include/sys/types.h" 2 3 4 | |
9794 | # 439 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 2 3 4 | |
9795 | ||
9796 | ||
9797 | ||
9798 | ||
9799 | ||
9800 | ||
9801 | extern long int random (void) __attribute__ ((__nothrow__)); | |
9802 | ||
9803 | ||
9804 | extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__)); | |
9805 | ||
9806 | ||
9807 | ||
9808 | ||
9809 | ||
9810 | extern char *initstate (unsigned int __seed, char *__statebuf, | |
9811 | size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
9812 | ||
9813 | ||
9814 | ||
9815 | extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
9816 | ||
9817 | ||
9818 | ||
9819 | ||
9820 | ||
9821 | ||
9822 | ||
9823 | struct random_data | |
9824 | { | |
9825 | int32_t *fptr; | |
9826 | int32_t *rptr; | |
9827 | int32_t *state; | |
9828 | int rand_type; | |
9829 | int rand_deg; | |
9830 | int rand_sep; | |
9831 | int32_t *end_ptr; | |
9832 | }; | |
9833 | ||
9834 | extern int random_r (struct random_data *__restrict __buf, | |
9835 | int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9836 | ||
9837 | extern int srandom_r (unsigned int __seed, struct random_data *__buf) | |
9838 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
9839 | ||
9840 | extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, | |
9841 | size_t __statelen, | |
9842 | struct random_data *__restrict __buf) | |
9843 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); | |
9844 | ||
9845 | extern int setstate_r (char *__restrict __statebuf, | |
9846 | struct random_data *__restrict __buf) | |
9847 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9848 | ||
9849 | ||
9850 | ||
9851 | ||
9852 | ||
9853 | ||
9854 | extern int rand (void) __attribute__ ((__nothrow__)); | |
9855 | ||
9856 | extern void srand (unsigned int __seed) __attribute__ ((__nothrow__)); | |
9857 | ||
9858 | ||
9859 | ||
9860 | ||
9861 | extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__)); | |
9862 | ||
9863 | ||
9864 | ||
9865 | ||
9866 | ||
9867 | ||
9868 | ||
9869 | extern double drand48 (void) __attribute__ ((__nothrow__)); | |
9870 | extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
9871 | ||
9872 | ||
9873 | extern long int lrand48 (void) __attribute__ ((__nothrow__)); | |
9874 | extern long int nrand48 (unsigned short int __xsubi[3]) | |
9875 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
9876 | ||
9877 | ||
9878 | extern long int mrand48 (void) __attribute__ ((__nothrow__)); | |
9879 | extern long int jrand48 (unsigned short int __xsubi[3]) | |
9880 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
9881 | ||
9882 | ||
9883 | extern void srand48 (long int __seedval) __attribute__ ((__nothrow__)); | |
9884 | extern unsigned short int *seed48 (unsigned short int __seed16v[3]) | |
9885 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
9886 | extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
9887 | ||
9888 | ||
9889 | ||
9890 | ||
9891 | ||
9892 | struct drand48_data | |
9893 | { | |
9894 | unsigned short int __x[3]; | |
9895 | unsigned short int __old_x[3]; | |
9896 | unsigned short int __c; | |
9897 | unsigned short int __init; | |
9898 | unsigned long long int __a; | |
9899 | }; | |
9900 | ||
9901 | ||
9902 | extern int drand48_r (struct drand48_data *__restrict __buffer, | |
9903 | double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9904 | extern int erand48_r (unsigned short int __xsubi[3], | |
9905 | struct drand48_data *__restrict __buffer, | |
9906 | double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9907 | ||
9908 | ||
9909 | extern int lrand48_r (struct drand48_data *__restrict __buffer, | |
9910 | long int *__restrict __result) | |
9911 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9912 | extern int nrand48_r (unsigned short int __xsubi[3], | |
9913 | struct drand48_data *__restrict __buffer, | |
9914 | long int *__restrict __result) | |
9915 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9916 | ||
9917 | ||
9918 | extern int mrand48_r (struct drand48_data *__restrict __buffer, | |
9919 | long int *__restrict __result) | |
9920 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9921 | extern int jrand48_r (unsigned short int __xsubi[3], | |
9922 | struct drand48_data *__restrict __buffer, | |
9923 | long int *__restrict __result) | |
9924 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9925 | ||
9926 | ||
9927 | extern int srand48_r (long int __seedval, struct drand48_data *__buffer) | |
9928 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
9929 | ||
9930 | extern int seed48_r (unsigned short int __seed16v[3], | |
9931 | struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9932 | ||
9933 | extern int lcong48_r (unsigned short int __param[7], | |
9934 | struct drand48_data *__buffer) | |
9935 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); | |
9936 | # 597 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
9937 | ||
9938 | ||
9939 | ||
9940 | extern void *realloc (void *__ptr, size_t __size) | |
9941 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); | |
9942 | ||
9943 | extern void free (void *__ptr) __attribute__ ((__nothrow__)); | |
9944 | ||
9945 | ||
9946 | ||
9947 | ||
9948 | extern void cfree (void *__ptr) __attribute__ ((__nothrow__)); | |
9949 | ||
9950 | ||
9951 | ||
9952 | # 1 "/usr/include/alloca.h" 1 3 4 | |
9953 | ||
9954 | ||
9955 | ||
9956 | ||
9957 | ||
9958 | ||
9959 | ||
9960 | # 1 "/usr/include/gentoo-multilib/ppc64/alloca.h" 1 3 4 | |
9961 | # 22 "/usr/include/gentoo-multilib/ppc64/alloca.h" 3 4 | |
9962 | # 1 "/usr/include/features.h" 1 3 4 | |
9963 | # 23 "/usr/include/gentoo-multilib/ppc64/alloca.h" 2 3 4 | |
9964 | ||
9965 | ||
9966 | # 1 "/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.1/include/stddef.h" 1 3 4 | |
9967 | # 26 "/usr/include/gentoo-multilib/ppc64/alloca.h" 2 3 4 | |
9968 | ||
9969 | ||
9970 | ||
9971 | ||
9972 | ||
9973 | ||
9974 | ||
9975 | extern void *alloca (size_t __size) __attribute__ ((__nothrow__)); | |
9976 | ||
9977 | ||
9978 | ||
9979 | ||
9980 | ||
9981 | ||
9982 | # 9 "/usr/include/alloca.h" 2 3 4 | |
9983 | # 613 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 2 3 4 | |
9984 | ||
9985 | ||
9986 | ||
9987 | ||
9988 | extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; | |
9989 | ||
9990 | ||
9991 | ||
9992 | ||
9993 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) | |
9994 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
9995 | ||
9996 | ||
9997 | ||
9998 | ||
9999 | extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
10000 | ||
10001 | ||
10002 | ||
10003 | extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
10004 | ||
10005 | ||
10006 | ||
10007 | ||
10008 | ||
10009 | extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) | |
10010 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
10011 | ||
10012 | ||
10013 | ||
10014 | ||
10015 | ||
10016 | ||
10017 | extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); | |
10018 | ||
10019 | # 658 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
10020 | ||
10021 | ||
10022 | extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
10023 | ||
10024 | ||
10025 | ||
10026 | ||
10027 | extern char *__secure_getenv (__const char *__name) | |
10028 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
10029 | ||
10030 | ||
10031 | ||
10032 | ||
10033 | ||
10034 | extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
10035 | ||
10036 | ||
10037 | ||
10038 | ||
10039 | ||
10040 | extern int setenv (__const char *__name, __const char *__value, int __replace) | |
10041 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); | |
10042 | ||
10043 | ||
10044 | extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__)); | |
10045 | ||
10046 | ||
10047 | ||
10048 | ||
10049 | ||
10050 | ||
10051 | extern int clearenv (void) __attribute__ ((__nothrow__)); | |
10052 | # 698 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
10053 | extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
10054 | # 709 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
10055 | extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ; | |
10056 | # 729 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
10057 | extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
10058 | ||
10059 | ||
10060 | ||
10061 | ||
10062 | ||
10063 | ||
10064 | ||
10065 | ||
10066 | extern int system (__const char *__command) ; | |
10067 | ||
10068 | # 757 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
10069 | extern char *realpath (__const char *__restrict __name, | |
10070 | char *__restrict __resolved) __attribute__ ((__nothrow__)) ; | |
10071 | ||
10072 | ||
10073 | ||
10074 | ||
10075 | ||
10076 | ||
10077 | typedef int (*__compar_fn_t) (__const void *, __const void *); | |
10078 | ||
10079 | ||
10080 | ||
10081 | ||
10082 | ||
10083 | ||
10084 | ||
10085 | ||
10086 | ||
10087 | extern void *bsearch (__const void *__key, __const void *__base, | |
10088 | size_t __nmemb, size_t __size, __compar_fn_t __compar) | |
10089 | __attribute__ ((__nonnull__ (1, 2, 5))) ; | |
10090 | ||
10091 | ||
10092 | ||
10093 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | |
10094 | __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); | |
10095 | ||
10096 | ||
10097 | ||
10098 | extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
10099 | extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
10100 | ||
10101 | ||
10102 | ||
10103 | ||
10104 | ||
10105 | ||
10106 | ||
10107 | ||
10108 | ||
10109 | ||
10110 | ||
10111 | ||
10112 | extern div_t div (int __numer, int __denom) | |
10113 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
10114 | extern ldiv_t ldiv (long int __numer, long int __denom) | |
10115 | __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; | |
10116 | ||
10117 | # 822 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
10118 | extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, | |
10119 | int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; | |
10120 | ||
10121 | ||
10122 | ||
10123 | ||
10124 | extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, | |
10125 | int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; | |
10126 | ||
10127 | ||
10128 | ||
10129 | ||
10130 | extern char *gcvt (double __value, int __ndigit, char *__buf) | |
10131 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ; | |
10132 | ||
10133 | ||
10134 | ||
10135 | ||
10136 | extern char *qecvt (long double __value, int __ndigit, | |
10137 | int *__restrict __decpt, int *__restrict __sign) | |
10138 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; | |
10139 | extern char *qfcvt (long double __value, int __ndigit, | |
10140 | int *__restrict __decpt, int *__restrict __sign) | |
10141 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; | |
10142 | extern char *qgcvt (long double __value, int __ndigit, char *__buf) | |
10143 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ; | |
10144 | ||
10145 | ||
10146 | ||
10147 | ||
10148 | extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, | |
10149 | int *__restrict __sign, char *__restrict __buf, | |
10150 | size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); | |
10151 | extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, | |
10152 | int *__restrict __sign, char *__restrict __buf, | |
10153 | size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); | |
10154 | ||
10155 | extern int qecvt_r (long double __value, int __ndigit, | |
10156 | int *__restrict __decpt, int *__restrict __sign, | |
10157 | char *__restrict __buf, size_t __len) | |
10158 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); | |
10159 | extern int qfcvt_r (long double __value, int __ndigit, | |
10160 | int *__restrict __decpt, int *__restrict __sign, | |
10161 | char *__restrict __buf, size_t __len) | |
10162 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); | |
10163 | ||
10164 | ||
10165 | ||
10166 | ||
10167 | ||
10168 | ||
10169 | ||
10170 | extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) ; | |
10171 | ||
10172 | ||
10173 | extern int mbtowc (wchar_t *__restrict __pwc, | |
10174 | __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) ; | |
10175 | ||
10176 | ||
10177 | extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) ; | |
10178 | ||
10179 | ||
10180 | ||
10181 | extern size_t mbstowcs (wchar_t *__restrict __pwcs, | |
10182 | __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)); | |
10183 | ||
10184 | extern size_t wcstombs (char *__restrict __s, | |
10185 | __const wchar_t *__restrict __pwcs, size_t __n) | |
10186 | __attribute__ ((__nothrow__)); | |
10187 | ||
10188 | ||
10189 | ||
10190 | ||
10191 | ||
10192 | ||
10193 | ||
10194 | ||
10195 | extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; | |
10196 | # 927 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
10197 | extern int posix_openpt (int __oflag) ; | |
10198 | # 962 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
10199 | extern int getloadavg (double __loadavg[], int __nelem) | |
10200 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); | |
10201 | # 972 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 3 4 | |
10202 | # 1 "/usr/include/bits/stdlib-ldbl.h" 1 3 4 | |
10203 | ||
10204 | ||
10205 | ||
10206 | ||
10207 | ||
10208 | ||
10209 | ||
10210 | # 1 "/usr/include/gentoo-multilib/ppc64/bits/stdlib-ldbl.h" 1 3 4 | |
10211 | # 34 "/usr/include/gentoo-multilib/ppc64/bits/stdlib-ldbl.h" 3 4 | |
10212 | extern __typeof (__strtold_internal) __strtold_internal __asm ("" "__strtod_internal"); | |
10213 | ||
10214 | ||
10215 | ||
10216 | extern __typeof (qecvt) qecvt __asm ("" "ecvt"); | |
10217 | extern __typeof (qfcvt) qfcvt __asm ("" "fcvt"); | |
10218 | extern __typeof (qgcvt) qgcvt __asm ("" "gcvt"); | |
10219 | extern __typeof (qecvt_r) qecvt_r __asm ("" "ecvt_r"); | |
10220 | extern __typeof (qfcvt_r) qfcvt_r __asm ("" "fcvt_r"); | |
10221 | # 9 "/usr/include/bits/stdlib-ldbl.h" 2 3 4 | |
10222 | # 973 "/usr/include/gentoo-multilib/ppc64/stdlib.h" 2 3 4 | |
10223 | ||
10224 | ||
10225 | ||
10226 | ||
10227 | ||
10228 | ||
10229 | # 9 "/usr/include/stdlib.h" 2 3 4 | |
10230 | # 77 "scheme.c" 2 | |
10231 | ||
10232 | ||
10233 | ||
10234 | static int utf8_stricmp(const char *s1, const char *s2) | |
10235 | { | |
10236 | char *s1a, *s2a; | |
10237 | int result; | |
10238 | ||
10239 | s1a = g_utf8_casefold(s1, -1); | |
10240 | s2a = g_utf8_casefold(s2, -1); | |
10241 | ||
10242 | result = g_utf8_collate(s1a, s2a); | |
10243 | ||
10244 | g_free(s1a); | |
10245 | g_free(s2a); | |
10246 | return result; | |
10247 | } | |
10248 | # 118 "scheme.c" | |
10249 | enum scheme_types { | |
10250 | T_STRING=1, | |
10251 | T_NUMBER=2, | |
10252 | T_SYMBOL=3, | |
10253 | T_PROC=4, | |
10254 | T_PAIR=5, | |
10255 | T_CLOSURE=6, | |
10256 | T_CONTINUATION=7, | |
10257 | T_FOREIGN=8, | |
10258 | T_CHARACTER=9, | |
10259 | T_PORT=10, | |
10260 | T_VECTOR=11, | |
10261 | T_MACRO=12, | |
10262 | T_PROMISE=13, | |
10263 | T_ENVIRONMENT=14, | |
10264 | T_LAST_SYSTEM_TYPE=14 | |
10265 | }; | |
10266 | # 147 "scheme.c" | |
10267 | void (*ts_output_routine) (FILE *, char *, int); | |
10268 | ||
10269 | static num num_add(num a, num b); | |
10270 | static num num_mul(num a, num b); | |
10271 | static num num_div(num a, num b); | |
10272 | static num num_intdiv(num a, num b); | |
10273 | static num num_sub(num a, num b); | |
10274 | static num num_rem(num a, num b); | |
10275 | static num num_mod(num a, num b); | |
10276 | static int num_eq(num a, num b); | |
10277 | static int num_gt(num a, num b); | |
10278 | static int num_ge(num a, num b); | |
10279 | static int num_lt(num a, num b); | |
10280 | static int num_le(num a, num b); | |
10281 | ||
10282 | ||
10283 | static double round_per_R5RS(double x); | |
10284 | ||
10285 | static int is_zero_double(double x); | |
10286 | ||
10287 | static num num_zero; | |
10288 | static num num_one; | |
10289 | ||
10290 | ||
10291 | ||
10292 | ||
10293 | ||
10294 | int is_string(pointer p) { return ((((p)->_flag)&31)==T_STRING); } | |
10295 | ||
10296 | ||
10297 | ||
10298 | static int is_list(scheme *sc, pointer p); | |
10299 | int is_vector(pointer p) { return ((((p)->_flag)&31)==T_VECTOR); } | |
10300 | static void fill_vector(pointer vec, pointer obj); | |
10301 | static pointer vector_elem(pointer vec, int ielem); | |
10302 | static pointer set_vector_elem(pointer vec, int ielem, pointer a); | |
10303 | int is_number(pointer p) { return ((((p)->_flag)&31)==T_NUMBER); } | |
10304 | int is_integer(pointer p) { | |
10305 | return ((p)->_object._number.is_fixnum); | |
10306 | } | |
10307 | int is_real(pointer p) { | |
10308 | return (!(p)->_object._number.is_fixnum); | |
10309 | } | |
10310 | ||
10311 | int is_character(pointer p) { return ((((p)->_flag)&31)==T_CHARACTER); } | |
10312 | int string_length(pointer p) { return ((p)->_object._string._length); } | |
10313 | char *string_value(pointer p) { return ((p)->_object._string._svalue); } | |
10314 | num nvalue(pointer p) { return ((p)->_object._number); } | |
10315 | long ivalue(pointer p) { return (is_integer(p)?(p)->_object._number.value.ivalue:(long)(p)->_object._number.value.rvalue); } | |
10316 | double rvalue(pointer p) { return (!is_integer(p)?(p)->_object._number.value.rvalue:(double)(p)->_object._number.value.ivalue); } | |
10317 | ||
10318 | ||
10319 | ||
10320 | ||
10321 | gunichar charvalue(pointer p) { return (gunichar)((p)->_object._number.value.ivalue); } | |
10322 | ||
10323 | int is_port(pointer p) { return ((((p)->_flag)&31)==T_PORT); } | |
10324 | ||
10325 | ||
10326 | ||
10327 | int is_pair(pointer p) { return ((((p)->_flag)&31)==T_PAIR); } | |
10328 | ||
10329 | ||
10330 | pointer pair_car(pointer p) { return ((p)->_object._cons._car); } | |
10331 | pointer pair_cdr(pointer p) { return ((p)->_object._cons._cdr); } | |
10332 | pointer set_car(pointer p, pointer q) { return ((p)->_object._cons._car)=q; } | |
10333 | pointer set_cdr(pointer p, pointer q) { return ((p)->_object._cons._cdr)=q; } | |
10334 | ||
10335 | int is_symbol(pointer p) { return ((((p)->_flag)&31)==T_SYMBOL); } | |
10336 | char *symname(pointer p) { return ((((p)->_object._cons._car))->_object._string._svalue); } | |
10337 | ||
10338 | ||
10339 | ||
10340 | ||
10341 | ||
10342 | int is_syntax(pointer p) { return (((p)->_flag)&4096); } | |
10343 | int is_proc(pointer p) { return ((((p)->_flag)&31)==T_PROC); } | |
10344 | int is_foreign(pointer p) { return ((((p)->_flag)&31)==T_FOREIGN); } | |
10345 | char *syntaxname(pointer p) { return ((((p)->_object._cons._car))->_object._string._svalue); } | |
10346 | ||
10347 | static const char *procname(pointer x); | |
10348 | ||
10349 | int is_closure(pointer p) { return ((((p)->_flag)&31)==T_CLOSURE); } | |
10350 | int is_macro(pointer p) { return ((((p)->_flag)&31)==T_MACRO); } | |
10351 | pointer closure_code(pointer p) { return ((p)->_object._cons._car); } | |
10352 | pointer closure_env(pointer p) { return ((p)->_object._cons._cdr); } | |
10353 | ||
10354 | int is_continuation(pointer p) { return ((((p)->_flag)&31)==T_CONTINUATION); } | |
10355 | ||
10356 | ||
10357 | ||
10358 | int is_promise(pointer p) { return ((((p)->_flag)&31)==T_PROMISE); } | |
10359 | ||
10360 | int is_environment(pointer p) { return ((((p)->_flag)&31)==T_ENVIRONMENT); } | |
10361 | # 251 "scheme.c" | |
10362 | int is_immutable(pointer p) { return (((p)->_flag)&8192); } | |
10363 | ||
10364 | void setimmutable(pointer p) { ((p)->_flag) |= 8192; } | |
10365 | # 266 "scheme.c" | |
10366 | static int Cisalpha(gunichar c) { return g_unichar_isalpha(c); } | |
10367 | static int Cisdigit(gunichar c) { return g_unichar_isdigit(c); } | |
10368 | static int Cisspace(gunichar c) { return g_unichar_isspace(c); } | |
10369 | static int Cisupper(gunichar c) { return g_unichar_isupper(c); } | |
10370 | static int Cislower(gunichar c) { return g_unichar_islower(c); } | |
10371 | # 326 "scheme.c" | |
10372 | static const char utf8_length[128] = | |
10373 | { | |
10374 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |
10375 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |
10376 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |
10377 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |
10378 | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, | |
10379 | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, | |
10380 | 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, | |
10381 | 3,3,3,3,3,3,3,3,4,4,4,4,5,5,0,0 | |
10382 | }; | |
10383 | ||
10384 | static int file_push(scheme *sc, const char *fname); | |
10385 | static void file_pop(scheme *sc); | |
10386 | static int file_interactive(scheme *sc); | |
10387 | static int is_one_of(char *s, gunichar c); | |
10388 | static int alloc_cellseg(scheme *sc, int n); | |
10389 | static long binary_decode(const char *s); | |
10390 | static pointer get_cell(scheme *sc, pointer a, pointer b); | |
10391 | static pointer _get_cell(scheme *sc, pointer a, pointer b); | |
10392 | static pointer reserve_cells(scheme *sc, int n); | |
10393 | static pointer get_consecutive_cells(scheme *sc, int n); | |
10394 | static pointer find_consecutive_cells(scheme *sc, int n); | |
10395 | static void finalize_cell(scheme *sc, pointer a); | |
10396 | static int count_consecutive_cells(pointer x, int needed); | |
10397 | static pointer find_slot_in_env(scheme *sc, pointer env, pointer sym, int all); | |
10398 | static pointer mk_number(scheme *sc, num n); | |
10399 | static pointer mk_empty_string(scheme *sc, int len, gunichar fill); | |
10400 | static char *store_string(scheme *sc, int len, const char *str, gunichar fill); | |
10401 | static pointer mk_vector(scheme *sc, int len); | |
10402 | static pointer mk_atom(scheme *sc, char *q); | |
10403 | static pointer mk_sharp_const(scheme *sc, char *name); | |
10404 | static pointer mk_port(scheme *sc, port *p); | |
10405 | static pointer port_from_filename(scheme *sc, const char *fn, int prop); | |
10406 | static pointer port_from_file(scheme *sc, FILE *, int prop); | |
10407 | static pointer port_from_string(scheme *sc, char *start, char *past_the_end, int prop); | |
10408 | static port *port_rep_from_filename(scheme *sc, const char *fn, int prop); | |
10409 | static port *port_rep_from_file(scheme *sc, FILE *, int prop); | |
10410 | static port *port_rep_from_string(scheme *sc, char *start, char *past_the_end, int prop); | |
10411 | static void port_close(scheme *sc, pointer p, int flag); | |
10412 | static void mark(pointer a); | |
10413 | static void gc(scheme *sc, pointer a, pointer b); | |
10414 | static gunichar inchar(scheme *sc); | |
10415 | static void backchar(scheme *sc, gunichar c); | |
10416 | static char *readstr_upto(scheme *sc, char *delim); | |
10417 | static pointer readstrexp(scheme *sc); | |
10418 | static void skipspace(scheme *sc); | |
10419 | static int token(scheme *sc); | |
10420 | static void printslashstring(scheme *sc, char *s, int len); | |
10421 | static void atom2str(scheme *sc, pointer l, int f, char **pp, int *plen); | |
10422 | static void printatom(scheme *sc, pointer l, int f); | |
10423 | static pointer mk_proc(scheme *sc, enum scheme_opcodes op); | |
10424 | static pointer mk_closure(scheme *sc, pointer c, pointer e); | |
10425 | static pointer mk_continuation(scheme *sc, pointer d); | |
10426 | static pointer reverse(scheme *sc, pointer a); | |
10427 | static pointer reverse_in_place(scheme *sc, pointer term, pointer list); | |
10428 | static pointer append(scheme *sc, pointer a, pointer b); | |
10429 | static int list_length(scheme *sc, pointer a); | |
10430 | static int eqv(pointer a, pointer b); | |
10431 | static void dump_stack_mark(scheme *); | |
10432 | static pointer opexe_0(scheme *sc, enum scheme_opcodes op); | |
10433 | static pointer opexe_1(scheme *sc, enum scheme_opcodes op); | |
10434 | static pointer opexe_2(scheme *sc, enum scheme_opcodes op); | |
10435 | static pointer opexe_3(scheme *sc, enum scheme_opcodes op); | |
10436 | static pointer opexe_4(scheme *sc, enum scheme_opcodes op); | |
10437 | static pointer opexe_5(scheme *sc, enum scheme_opcodes op); | |
10438 | static pointer opexe_6(scheme *sc, enum scheme_opcodes op); | |
10439 | static void Eval_Cycle(scheme *sc, enum scheme_opcodes op); | |
10440 | static void assign_syntax(scheme *sc, char *name); | |
10441 | static int syntaxnum(pointer p); | |
10442 | static void assign_proc(scheme *sc, enum scheme_opcodes, char *name); | |
10443 | ||
10444 | ||
10445 | ||
10446 | ||
10447 | static num num_add(num a, num b) { | |
10448 | num ret; | |
10449 | ret.is_fixnum=a.is_fixnum && b.is_fixnum; | |
10450 | if(ret.is_fixnum) { | |
10451 | ret.value.ivalue= a.value.ivalue+b.value.ivalue; | |
10452 | } else { | |
10453 | ret.value.rvalue=(!a.is_fixnum?(a).value.rvalue:(double)(a).value.ivalue)+(!b.is_fixnum?(b).value.rvalue:(double)(b).value.ivalue); | |
10454 | } | |
10455 | return ret; | |
10456 | } | |
10457 | ||
10458 | static num num_mul(num a, num b) { | |
10459 | num ret; | |
10460 | ret.is_fixnum=a.is_fixnum && b.is_fixnum; | |
10461 | if(ret.is_fixnum) { | |
10462 | ret.value.ivalue= a.value.ivalue*b.value.ivalue; | |
10463 | } else { | |
10464 | ret.value.rvalue=(!a.is_fixnum?(a).value.rvalue:(double)(a).value.ivalue)*(!b.is_fixnum?(b).value.rvalue:(double)(b).value.ivalue); | |
10465 | } | |
10466 | return ret; | |
10467 | } | |
10468 | ||
10469 | static num num_div(num a, num b) { | |
10470 | num ret; | |
10471 | ret.is_fixnum=a.is_fixnum && b.is_fixnum && a.value.ivalue%b.value.ivalue==0; | |
10472 | if(ret.is_fixnum) { | |
10473 | ret.value.ivalue= a.value.ivalue/b.value.ivalue; | |
10474 | } else { | |
10475 | ret.value.rvalue=(!a.is_fixnum?(a).value.rvalue:(double)(a).value.ivalue)/(!b.is_fixnum?(b).value.rvalue:(double)(b).value.ivalue); | |
10476 | } | |
10477 | return ret; | |
10478 | } | |
10479 | ||
10480 | static num num_intdiv(num a, num b) { | |
10481 | num ret; | |
10482 | ret.is_fixnum=a.is_fixnum && b.is_fixnum; | |
10483 | if(ret.is_fixnum) { | |
10484 | ret.value.ivalue= a.value.ivalue/b.value.ivalue; | |
10485 | } else { | |
10486 | ret.value.rvalue=(!a.is_fixnum?(a).value.rvalue:(double)(a).value.ivalue)/(!b.is_fixnum?(b).value.rvalue:(double)(b).value.ivalue); | |
10487 | } | |
10488 | return ret; | |
10489 | } | |
10490 | ||
10491 | static num num_sub(num a, num b) { | |
10492 | num ret; | |
10493 | ret.is_fixnum=a.is_fixnum && b.is_fixnum; | |
10494 | if(ret.is_fixnum) { | |
10495 | ret.value.ivalue= a.value.ivalue-b.value.ivalue; | |
10496 | } else { | |
10497 | ret.value.rvalue=(!a.is_fixnum?(a).value.rvalue:(double)(a).value.ivalue)-(!b.is_fixnum?(b).value.rvalue:(double)(b).value.ivalue); | |
10498 | } | |
10499 | return ret; | |
10500 | } | |
10501 | ||
10502 | static num num_rem(num a, num b) { | |
10503 | num ret; | |
10504 | long e1, e2, res; | |
10505 | ret.is_fixnum=a.is_fixnum && b.is_fixnum; | |
10506 | e1=(a.is_fixnum?(a).value.ivalue:(long)(a).value.rvalue); | |
10507 | e2=(b.is_fixnum?(b).value.ivalue:(long)(b).value.rvalue); | |
10508 | res=e1%e2; | |
10509 | ||
10510 | if (res > 0) { | |
10511 | if (e1 < 0) { | |
10512 | res -= labs(e2); | |
10513 | } | |
10514 | } else if (res < 0) { | |
10515 | if (e1 > 0) { | |
10516 | res += labs(e2); | |
10517 | } | |
10518 | } | |
10519 | ret.value.ivalue=res; | |
10520 | return ret; | |
10521 | } | |
10522 | ||
10523 | static num num_mod(num a, num b) { | |
10524 | num ret; | |
10525 | long e1, e2, res; | |
10526 | ret.is_fixnum=a.is_fixnum && b.is_fixnum; | |
10527 | e1=(a.is_fixnum?(a).value.ivalue:(long)(a).value.rvalue); | |
10528 | e2=(b.is_fixnum?(b).value.ivalue:(long)(b).value.rvalue); | |
10529 | res=e1%e2; | |
10530 | if(res*e2<0) { | |
10531 | e2=labs(e2); | |
10532 | if(res>0) { | |
10533 | res-=e2; | |
10534 | } else { | |
10535 | res+=e2; | |
10536 | } | |
10537 | } | |
10538 | ret.value.ivalue=res; | |
10539 | return ret; | |
10540 | } | |
10541 | ||
10542 | static int num_eq(num a, num b) { | |
10543 | int ret; | |
10544 | int is_fixnum=a.is_fixnum && b.is_fixnum; | |
10545 | if(is_fixnum) { | |
10546 | ret= a.value.ivalue==b.value.ivalue; | |
10547 | } else { | |
10548 | ret=(!a.is_fixnum?(a).value.rvalue:(double)(a).value.ivalue)==(!b.is_fixnum?(b).value.rvalue:(double)(b).value.ivalue); | |
10549 | } | |
10550 | return ret; | |
10551 | } | |
10552 | ||
10553 | ||
10554 | static int num_gt(num a, num b) { | |
10555 | int ret; | |
10556 | int is_fixnum=a.is_fixnum && b.is_fixnum; | |
10557 | if(is_fixnum) { | |
10558 | ret= a.value.ivalue>b.value.ivalue; | |
10559 | } else { | |
10560 | ret=(!a.is_fixnum?(a).value.rvalue:(double)(a).value.ivalue)>(!b.is_fixnum?(b).value.rvalue:(double)(b).value.ivalue); | |
10561 | } | |
10562 | return ret; | |
10563 | } | |
10564 | ||
10565 | static int num_ge(num a, num b) { | |
10566 | return !num_lt(a,b); | |
10567 | } | |
10568 | ||
10569 | static int num_lt(num a, num b) { | |
10570 | int ret; | |
10571 | int is_fixnum=a.is_fixnum && b.is_fixnum; | |
10572 | if(is_fixnum) { | |
10573 | ret= a.value.ivalue<b.value.ivalue; | |
10574 | } else { | |
10575 | ret=(!a.is_fixnum?(a).value.rvalue:(double)(a).value.ivalue)<(!b.is_fixnum?(b).value.rvalue:(double)(b).value.ivalue); | |
10576 | } | |
10577 | return ret; | |
10578 | } | |
10579 | ||
10580 | static int num_le(num a, num b) { | |
10581 | return !num_gt(a,b); | |
10582 | } | |
10583 | ||
10584 | ||
10585 | ||
10586 | static double round_per_R5RS(double x) { | |
10587 | double fl=floor(x); | |
10588 | double ce=ceil(x); | |
10589 | double dfl=x-fl; | |
10590 | double dce=ce-x; | |
10591 | if(dfl>dce) { | |
10592 | return ce; | |
10593 | } else if(dfl<dce) { | |
10594 | return fl; | |
10595 | } else { | |
10596 | if(fmod(fl,2.0)==0.0) { | |
10597 | return fl; | |
10598 | } else { | |
10599 | return ce; | |
10600 | } | |
10601 | } | |
10602 | } | |
10603 | ||
10604 | ||
10605 | static int is_zero_double(double x) { | |
10606 | return x<2.2250738585072014e-308 && x>-2.2250738585072014e-308; | |
10607 | } | |
10608 | ||
10609 | static long binary_decode(const char *s) { | |
10610 | long x=0; | |
10611 | ||
10612 | while(*s!=0 && (*s=='1' || *s=='0')) { | |
10613 | x<<=1; | |
10614 | x+=*s-'0'; | |
10615 | s++; | |
10616 | } | |
10617 | ||
10618 | return x; | |
10619 | } | |
10620 | ||
10621 | ||
10622 | static int alloc_cellseg(scheme *sc, int n) { | |
10623 | pointer newp; | |
10624 | pointer last; | |
10625 | pointer p; | |
10626 | char *cp; | |
10627 | long i; | |
10628 | int k; | |
10629 | int adj=32; | |
10630 | ||
10631 | if(adj<sizeof(struct cell)) { | |
10632 | adj=sizeof(struct cell); | |
10633 | } | |
10634 | ||
10635 | for (k = 0; k < n; k++) { | |
10636 | if (sc->last_cell_seg >= 20 - 1) | |
10637 | return k; | |
10638 | cp = (char*) sc->malloc(5000 * sizeof(struct cell)+adj); | |
10639 | if (cp == 0) | |
10640 | return k; | |
10641 | i = ++sc->last_cell_seg ; | |
10642 | sc->alloc_seg[i] = cp; | |
10643 | ||
10644 | if(((unsigned)cp)%adj!=0) { | |
10645 | cp=(char*)(adj*((unsigned long)cp/adj+1)); | |
10646 | } | |
10647 | ||
10648 | newp=(pointer)cp; | |
10649 | sc->cell_seg[i] = newp; | |
10650 | while (i > 0 && sc->cell_seg[i - 1] > sc->cell_seg[i]) { | |
10651 | p = sc->cell_seg[i]; | |
10652 | sc->cell_seg[i] = sc->cell_seg[i - 1]; | |
10653 | sc->cell_seg[--i] = p; | |
10654 | } | |
10655 | sc->fcells += 5000; | |
10656 | last = newp + 5000 - 1; | |
10657 | for (p = newp; p <= last; p++) { | |
10658 | ((p)->_flag) = 0; | |
10659 | ((p)->_object._cons._cdr) = p + 1; | |
10660 | ((p)->_object._cons._car) = sc->NIL; | |
10661 | } | |
10662 | ||
10663 | if (sc->free_cell == sc->NIL || p < sc->free_cell) { | |
10664 | ((last)->_object._cons._cdr) = sc->free_cell; | |
10665 | sc->free_cell = newp; | |
10666 | } else { | |
10667 | p = sc->free_cell; | |
10668 | while (((p)->_object._cons._cdr) != sc->NIL && newp > ((p)->_object._cons._cdr)) | |
10669 | p = ((p)->_object._cons._cdr); | |
10670 | ((last)->_object._cons._cdr) = ((p)->_object._cons._cdr); | |
10671 | ((p)->_object._cons._cdr) = newp; | |
10672 | } | |
10673 | } | |
10674 | return n; | |
10675 | } | |
10676 | ||
10677 | static pointer get_cell(scheme *sc, pointer a, pointer b) { | |
10678 | if (sc->free_cell != sc->NIL) { | |
10679 | pointer x = sc->free_cell; | |
10680 | sc->free_cell = ((x)->_object._cons._cdr); | |
10681 | --sc->fcells; | |
10682 | return (x); | |
10683 | } | |
10684 | return _get_cell (sc, a, b); | |
10685 | } | |
10686 | ||
10687 | ||
10688 | ||
10689 | static pointer _get_cell(scheme *sc, pointer a, pointer b) { | |
10690 | pointer x; | |
10691 | ||
10692 | if(sc->no_memory) { | |
10693 | return sc->sink; | |
10694 | } | |
10695 | ||
10696 | if (sc->free_cell == sc->NIL) { | |
10697 | gc(sc,a, b); | |
10698 | if (sc->fcells < sc->last_cell_seg*8 | |
10699 | || sc->free_cell == sc->NIL) { | |
10700 | ||
10701 | if (!alloc_cellseg(sc,1) && sc->free_cell == sc->NIL) { | |
10702 | sc->no_memory=1; | |
10703 | return sc->sink; | |
10704 | } | |
10705 | } | |
10706 | } | |
10707 | x = sc->free_cell; | |
10708 | sc->free_cell = ((x)->_object._cons._cdr); | |
10709 | --sc->fcells; | |
10710 | return (x); | |
10711 | } | |
10712 | ||
10713 | ||
10714 | static pointer reserve_cells(scheme *sc, int n) { | |
10715 | if(sc->no_memory) { | |
10716 | return sc->NIL; | |
10717 | } | |
10718 | ||
10719 | ||
10720 | if (sc->fcells < n) { | |
10721 | ||
10722 | gc(sc, sc->NIL, sc->NIL); | |
10723 | if (sc->fcells < n) { | |
10724 | ||
10725 | if (!alloc_cellseg(sc,1)) { | |
10726 | sc->no_memory=1; | |
10727 | return sc->NIL; | |
10728 | } | |
10729 | } | |
10730 | if (sc->fcells < n) { | |
10731 | ||
10732 | sc->no_memory=1; | |
10733 | return sc->NIL; | |
10734 | } | |
10735 | } | |
10736 | return (sc->T); | |
10737 | } | |
10738 | ||
10739 | static pointer get_consecutive_cells(scheme *sc, int n) { | |
10740 | pointer x; | |
10741 | ||
10742 | if(sc->no_memory) { | |
10743 | return sc->sink; | |
10744 | } | |
10745 | ||
10746 | ||
10747 | x=find_consecutive_cells(sc,n); | |
10748 | if (x == sc->NIL) { | |
10749 | ||
10750 | gc(sc, sc->NIL, sc->NIL); | |
10751 | x=find_consecutive_cells(sc,n); | |
10752 | if (x == sc->NIL) { | |
10753 | ||
10754 | if (!alloc_cellseg(sc,1)) { | |
10755 | sc->no_memory=1; | |
10756 | return sc->sink; | |
10757 | } | |
10758 | } | |
10759 | x=find_consecutive_cells(sc,n); | |
10760 | if (x == sc->NIL) { | |
10761 | ||
10762 | sc->no_memory=1; | |
10763 | return sc->sink; | |
10764 | } | |
10765 | } | |
10766 | return (x); | |
10767 | } | |
10768 | ||
10769 | static int count_consecutive_cells(pointer x, int needed) { | |
10770 | int n=1; | |
10771 | while(((x)->_object._cons._cdr)==x+1) { | |
10772 | x=((x)->_object._cons._cdr); | |
10773 | n++; | |
10774 | if(n>needed) return n; | |
10775 | } | |
10776 | return n; | |
10777 | } | |
10778 | ||
10779 | static pointer find_consecutive_cells(scheme *sc, int n) { | |
10780 | pointer *pp; | |
10781 | int cnt; | |
10782 | ||
10783 | pp=&sc->free_cell; | |
10784 | while(*pp!=sc->NIL) { | |
10785 | cnt=count_consecutive_cells(*pp,n); | |
10786 | if(cnt>=n) { | |
10787 | pointer x=*pp; | |
10788 | *pp=((*pp+n-1)->_object._cons._cdr); | |
10789 | sc->fcells -= n; | |
10790 | return x; | |
10791 | } | |
10792 | pp=&((*pp+cnt-1)->_object._cons._cdr); | |
10793 | } | |
10794 | return sc->NIL; | |
10795 | } | |
10796 | ||
10797 | ||
10798 | pointer _cons(scheme *sc, pointer a, pointer b, int immutable) { | |
10799 | pointer x = get_cell(sc,a, b); | |
10800 | ||
10801 | ((x)->_flag) = T_PAIR; | |
10802 | if(immutable) { | |
10803 | setimmutable(x); | |
10804 | } | |
10805 | ((x)->_object._cons._car) = a; | |
10806 | ((x)->_object._cons._cdr) = b; | |
10807 | return (x); | |
10808 | } | |
10809 | ||
10810 | ||
10811 | ||
10812 | ||
10813 | ||
10814 | static int hash_fn(const char *key, int table_size); | |
10815 | ||
10816 | static pointer oblist_initial_value(scheme *sc) | |
10817 | { | |
10818 | return mk_vector(sc, 461); | |
10819 | } | |
10820 | ||
10821 | ||
10822 | static pointer oblist_add_by_name(scheme *sc, const char *name) | |
10823 | { | |
10824 | pointer x; | |
10825 | int location; | |
10826 | ||
10827 | x = _cons(sc,mk_string(sc, name),sc->NIL,1); | |
10828 | ((x)->_flag) = T_SYMBOL; | |
10829 | setimmutable(((x)->_object._cons._car)); | |
10830 | ||
10831 | location = hash_fn(name, ((sc->oblist)->_object._number.value.ivalue)); | |
10832 | set_vector_elem(sc->oblist, location, | |
10833 | _cons(sc,x,vector_elem(sc->oblist, location),1)); | |
10834 | return x; | |
10835 | } | |
10836 | ||
10837 | static pointer oblist_find_by_name(scheme *sc, const char *name) | |
10838 | { | |
10839 | int location; | |
10840 | pointer x; | |
10841 | char *s; | |
10842 | ||
10843 | location = hash_fn(name, ((sc->oblist)->_object._number.value.ivalue)); | |
10844 | for (x = vector_elem(sc->oblist, location); x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
10845 | s = symname(((x)->_object._cons._car)); | |
10846 | ||
10847 | if(utf8_stricmp(name, s) == 0) { | |
10848 | return ((x)->_object._cons._car); | |
10849 | } | |
10850 | } | |
10851 | return sc->NIL; | |
10852 | } | |
10853 | ||
10854 | static pointer oblist_all_symbols(scheme *sc) | |
10855 | { | |
10856 | int i; | |
10857 | pointer x; | |
10858 | pointer ob_list = sc->NIL; | |
10859 | ||
10860 | for (i = 0; i < ((sc->oblist)->_object._number.value.ivalue); i++) { | |
10861 | for (x = vector_elem(sc->oblist, i); x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
10862 | ob_list = _cons(sc,x,ob_list,0); | |
10863 | } | |
10864 | } | |
10865 | return ob_list; | |
10866 | } | |
10867 | # 863 "scheme.c" | |
10868 | static pointer mk_port(scheme *sc, port *p) { | |
10869 | pointer x = get_cell(sc, sc->NIL, sc->NIL); | |
10870 | ||
10871 | ((x)->_flag) = T_PORT|16384; | |
10872 | x->_object._port=p; | |
10873 | return (x); | |
10874 | } | |
10875 | ||
10876 | pointer mk_foreign_func(scheme *sc, foreign_func f) { | |
10877 | pointer x = get_cell(sc, sc->NIL, sc->NIL); | |
10878 | ||
10879 | ((x)->_flag) = (T_FOREIGN | 16384); | |
10880 | x->_object._ff=f; | |
10881 | return (x); | |
10882 | } | |
10883 | ||
10884 | pointer mk_character(scheme *sc, gunichar c) { | |
10885 | pointer x = get_cell(sc,sc->NIL, sc->NIL); | |
10886 | ||
10887 | ((x)->_flag) = (T_CHARACTER | 16384); | |
10888 | ((x)->_object._number.value.ivalue)= c; | |
10889 | (x)->_object._number.is_fixnum=1;; | |
10890 | return (x); | |
10891 | } | |
10892 | ||
10893 | ||
10894 | pointer mk_integer(scheme *sc, long num) { | |
10895 | pointer x = get_cell(sc,sc->NIL, sc->NIL); | |
10896 | ||
10897 | ((x)->_flag) = (T_NUMBER | 16384); | |
10898 | ((x)->_object._number.value.ivalue)= num; | |
10899 | (x)->_object._number.is_fixnum=1;; | |
10900 | return (x); | |
10901 | } | |
10902 | ||
10903 | pointer mk_real(scheme *sc, double n) { | |
10904 | pointer x = get_cell(sc,sc->NIL, sc->NIL); | |
10905 | ||
10906 | ((x)->_flag) = (T_NUMBER | 16384); | |
10907 | ((x)->_object._number.value.rvalue)= n; | |
10908 | (x)->_object._number.is_fixnum=0;; | |
10909 | return (x); | |
10910 | } | |
10911 | ||
10912 | static pointer mk_number(scheme *sc, num n) { | |
10913 | if(n.is_fixnum) { | |
10914 | return mk_integer(sc,n.value.ivalue); | |
10915 | } else { | |
10916 | return mk_real(sc,n.value.rvalue); | |
10917 | } | |
10918 | } | |
10919 | ||
10920 | void set_safe_foreign (scheme *sc, pointer data) { | |
10921 | if (sc->safe_foreign == sc->NIL) { | |
10922 | fprintf (stderr, "get_safe_foreign called outside a foreign function\n"); | |
10923 | } else { | |
10924 | ((sc->safe_foreign)->_object._cons._car) = data; | |
10925 | } | |
10926 | } | |
10927 | ||
10928 | ||
10929 | ||
10930 | ||
10931 | ||
10932 | static char *store_string(scheme *sc, int char_cnt, | |
10933 | const char *str, gunichar fill) { | |
10934 | int len; | |
10935 | int i; | |
10936 | gchar utf8[7]; | |
10937 | gchar *q; | |
10938 | gchar *q2; | |
10939 | ||
10940 | if(str!=0) { | |
10941 | q2 = g_utf8_offset_to_pointer(str, (long)char_cnt); | |
10942 | (void)g_utf8_validate(str, -1, (const gchar **)&q); | |
10943 | if (q <= q2) | |
10944 | len = q - str; | |
10945 | else | |
10946 | len = q2 - str; | |
10947 | q=(gchar*)sc->malloc(len+1); | |
10948 | } | |
10949 | else { | |
10950 | len = g_unichar_to_utf8(fill, utf8); | |
10951 | q=(gchar*)sc->malloc(char_cnt*len+1); | |
10952 | } | |
10953 | if(q==0) { | |
10954 | sc->no_memory=1; | |
10955 | return sc->strbuff; | |
10956 | } | |
10957 | if(str!=0) { | |
10958 | memcpy(q, str, len); | |
10959 | q[len]=0; | |
10960 | } else { | |
10961 | q2 = q; | |
10962 | for (i = 0; i < char_cnt; ++i) | |
10963 | { | |
10964 | memcpy(q2, utf8, len); | |
10965 | q2 += len; | |
10966 | } | |
10967 | *q2=0; | |
10968 | } | |
10969 | return (q); | |
10970 | } | |
10971 | ||
10972 | ||
10973 | pointer mk_string(scheme *sc, const char *str) { | |
10974 | return mk_counted_string(sc,str,g_utf8_strlen(str, -1)); | |
10975 | } | |
10976 | ||
10977 | ||
10978 | pointer mk_counted_string(scheme *sc, const char *str, int len) { | |
10979 | pointer x = get_cell(sc, sc->NIL, sc->NIL); | |
10980 | ||
10981 | ((x)->_object._string._svalue) = store_string(sc,len,str,0); | |
10982 | ((x)->_flag) = (T_STRING | 16384); | |
10983 | ((x)->_object._string._length) = len; | |
10984 | return (x); | |
10985 | } | |
10986 | ||
10987 | static pointer mk_empty_string(scheme *sc, int len, gunichar fill) { | |
10988 | pointer x = get_cell(sc, sc->NIL, sc->NIL); | |
10989 | ||
10990 | ((x)->_object._string._svalue) = store_string(sc,len,0,fill); | |
10991 | ((x)->_flag) = (T_STRING | 16384); | |
10992 | ((x)->_object._string._length) = len; | |
10993 | return (x); | |
10994 | } | |
10995 | ||
10996 | static pointer mk_vector(scheme *sc, int len) { | |
10997 | pointer x=get_consecutive_cells(sc,len/2+len%2+1); | |
10998 | ((x)->_flag) = (T_VECTOR | 16384); | |
10999 | ((x)->_object._number.value.ivalue)=len; | |
11000 | (x)->_object._number.is_fixnum=1;; | |
11001 | fill_vector(x,sc->NIL); | |
11002 | return x; | |
11003 | } | |
11004 | ||
11005 | static void fill_vector(pointer vec, pointer obj) { | |
11006 | int i; | |
11007 | int num=ivalue(vec)/2+ivalue(vec)%2; | |
11008 | for(i=0; i<num; i++) { | |
11009 | ((vec+1+i)->_flag) = T_PAIR; | |
11010 | setimmutable(vec+1+i); | |
11011 | ((vec+1+i)->_object._cons._car)=obj; | |
11012 | ((vec+1+i)->_object._cons._cdr)=obj; | |
11013 | } | |
11014 | } | |
11015 | ||
11016 | static pointer vector_elem(pointer vec, int ielem) { | |
11017 | int n=ielem/2; | |
11018 | if(ielem%2==0) { | |
11019 | return ((vec+1+n)->_object._cons._car); | |
11020 | } else { | |
11021 | return ((vec+1+n)->_object._cons._cdr); | |
11022 | } | |
11023 | } | |
11024 | ||
11025 | static pointer set_vector_elem(pointer vec, int ielem, pointer a) { | |
11026 | int n=ielem/2; | |
11027 | if(ielem%2==0) { | |
11028 | return ((vec+1+n)->_object._cons._car)=a; | |
11029 | } else { | |
11030 | return ((vec+1+n)->_object._cons._cdr)=a; | |
11031 | } | |
11032 | } | |
11033 | ||
11034 | ||
11035 | pointer mk_symbol(scheme *sc, const char *name) { | |
11036 | pointer x; | |
11037 | ||
11038 | ||
11039 | x = oblist_find_by_name(sc, name); | |
11040 | if (x != sc->NIL) { | |
11041 | return (x); | |
11042 | } else { | |
11043 | x = oblist_add_by_name(sc, name); | |
11044 | return (x); | |
11045 | } | |
11046 | } | |
11047 | ||
11048 | pointer gensym(scheme *sc) { | |
11049 | pointer x; | |
11050 | char name[40]; | |
11051 | ||
11052 | for(; sc->gensym_cnt<9223372036854775807L; sc->gensym_cnt++) { | |
11053 | sprintf(name,"gensym-%ld",sc->gensym_cnt); | |
11054 | ||
11055 | ||
11056 | x = oblist_find_by_name(sc, name); | |
11057 | ||
11058 | if (x != sc->NIL) { | |
11059 | continue; | |
11060 | } else { | |
11061 | x = oblist_add_by_name(sc, name); | |
11062 | return (x); | |
11063 | } | |
11064 | } | |
11065 | ||
11066 | return sc->NIL; | |
11067 | } | |
11068 | ||
11069 | ||
11070 | static pointer mk_atom(scheme *sc, char *q) { | |
11071 | char c, *p; | |
11072 | int has_dec_point=0; | |
11073 | int has_fp_exp = 0; | |
11074 | ||
11075 | ||
11076 | if((p=strstr(q,"::"))!=0) { | |
11077 | *p=0; | |
11078 | return _cons(sc,sc->COLON_HOOK,_cons(sc,_cons(sc,sc->QUOTE,_cons(sc,mk_atom(sc,p+2),sc->NIL,0),0),_cons(sc,mk_symbol(sc,q),sc->NIL,0),0),0); | |
11079 | ||
11080 | ||
11081 | ||
11082 | ||
11083 | ||
11084 | } | |
11085 | ||
11086 | ||
11087 | p = q; | |
11088 | c = *p++; | |
11089 | if ((c == '+') || (c == '-')) { | |
11090 | c = *p++; | |
11091 | if (c == '.') { | |
11092 | has_dec_point=1; | |
11093 | c = *p++; | |
11094 | } | |
11095 | if (!((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit)) { | |
11096 | return (mk_symbol(sc, q)); | |
11097 | } | |
11098 | } else if (c == '.') { | |
11099 | has_dec_point=1; | |
11100 | c = *p++; | |
11101 | if (!((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit)) { | |
11102 | return (mk_symbol(sc, q)); | |
11103 | } | |
11104 | } else if (!((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit)) { | |
11105 | return (mk_symbol(sc, q)); | |
11106 | } | |
11107 | ||
11108 | for ( ; (c = *p) != 0; ++p) { | |
11109 | if (!((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit)) { | |
11110 | if(c=='.') { | |
11111 | if(!has_dec_point) { | |
11112 | has_dec_point=1; | |
11113 | continue; | |
11114 | } | |
11115 | } | |
11116 | else if ((c == 'e') || (c == 'E')) { | |
11117 | if(!has_fp_exp) { | |
11118 | has_dec_point = 1; | |
11119 | ||
11120 | p++; | |
11121 | if ((*p == '-') || (*p == '+') || ((*__ctype_b_loc ())[(int) ((*p))] & (unsigned short int) _ISdigit)) { | |
11122 | continue; | |
11123 | } | |
11124 | } | |
11125 | } | |
11126 | return (mk_symbol(sc, q)); | |
11127 | } | |
11128 | } | |
11129 | if(has_dec_point) { | |
11130 | return mk_real(sc,atof(q)); | |
11131 | } | |
11132 | return (mk_integer(sc, atol(q))); | |
11133 | } | |
11134 | ||
11135 | ||
11136 | static pointer mk_sharp_const(scheme *sc, char *name) { | |
11137 | long x; | |
11138 | char tmp[256]; | |
11139 | ||
11140 | if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("t") && (__s1_len = strlen (name), __s2_len = strlen ("t"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("t") + 1) - (size_t)(const void *)("t") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "t") : (__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 ("t") && ((size_t)(const void *)(("t") + 1) - (size_t)(const void *)("t") == 1) ? __builtin_strcmp (name, "t") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("t"); 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 ("t") && ((size_t)(const void *)(("t") + 1) - (size_t)(const void *)("t") == 1) && (__s2_len = strlen ("t"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "t") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("t"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("t"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("t"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("t"))[3]); } } __result; }))) : __builtin_strcmp (name, "t")))); })) | |
11141 | return (sc->T); | |
11142 | else if (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (name) && __builtin_constant_p ("f") && (__s1_len = strlen (name), __s2_len = strlen ("f"), (!((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("f") + 1) - (size_t)(const void *)("f") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "f") : (__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 ("f") && ((size_t)(const void *)(("f") + 1) - (size_t)(const void *)("f") == 1) ? __builtin_strcmp (name, "f") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("f"); 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 ("f") && ((size_t)(const void *)(("f") + 1) - (size_t)(const void *)("f") == 1) && (__s2_len = strlen ("f"), __s2_len < 4) ? (__builtin_constant_p (name) && ((size_t)(const void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp (name, "f") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("f"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("f"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("f"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("f"))[3]); } } __result; }))) : __builtin_strcmp (name, "f")))); })) | |
11143 | return (sc->F); | |
11144 | else if (*name == 'o') { | |
11145 | sprintf(tmp, "0%s", name+1); | |
11146 | sscanf(tmp, "%lo", &x); | |
11147 | return (mk_integer(sc, x)); | |
11148 | } else if (*name == 'd') { | |
11149 | sscanf(name+1, "%ld", &x); | |
11150 | return (mk_integer(sc, x)); | |
11151 | } else if (*name == 'x') { | |
11152 | sprintf(tmp, "0x%s", name+1); | |
11153 | sscanf(tmp, "%lx", &x); | |
11154 | return (mk_integer(sc, x)); | |
11155 | } else if (*name == 'b') { | |
11156 | x = binary_decode(name+1); | |
11157 | return (mk_integer(sc, x)); | |
11158 | } else if (*name == '\\') { | |
11159 | gunichar c=0; | |
11160 | if(utf8_stricmp(name+1,"space")==0) { | |
11161 | c=' '; | |
11162 | } else if(utf8_stricmp(name+1,"newline")==0) { | |
11163 | c='\n'; | |
11164 | } else if(utf8_stricmp(name+1,"return")==0) { | |
11165 | c='\r'; | |
11166 | } else if(utf8_stricmp(name+1,"tab")==0) { | |
11167 | c='\t'; | |
11168 | } else if(name[1]=='x' && name[2]!=0) { | |
11169 | int c1=0; | |
11170 | if(sscanf(name+2,"%x",&c1)==1 && c1<256) { | |
11171 | c=c1; | |
11172 | } else { | |
11173 | return sc->NIL; | |
11174 | } | |
11175 | ||
11176 | ||
11177 | ||
11178 | ||
11179 | } else if(name[2]==0) { | |
11180 | c=name[1]; | |
11181 | } else { | |
11182 | return sc->NIL; | |
11183 | } | |
11184 | return mk_character(sc,c); | |
11185 | } else | |
11186 | return (sc->NIL); | |
11187 | } | |
11188 | # 1191 "scheme.c" | |
11189 | static void mark(pointer a) { | |
11190 | pointer t, q, p; | |
11191 | ||
11192 | t = (pointer) 0; | |
11193 | p = a; | |
11194 | E2: ((p)->_flag) |= 32768; | |
11195 | if(is_vector(p)) { | |
11196 | int i; | |
11197 | int num=((p)->_object._number.value.ivalue)/2+((p)->_object._number.value.ivalue)%2; | |
11198 | for(i=0; i<num; i++) { | |
11199 | ||
11200 | mark(p+1+i); | |
11201 | } | |
11202 | } | |
11203 | if ((((p)->_flag)&16384)) | |
11204 | goto E6; | |
11205 | ||
11206 | q = ((p)->_object._cons._car); | |
11207 | if (q && !(((q)->_flag)&32768)) { | |
11208 | ((p)->_flag) |= 16384; | |
11209 | ((p)->_object._cons._car) = t; | |
11210 | t = p; | |
11211 | p = q; | |
11212 | goto E2; | |
11213 | } | |
11214 | E5: q = ((p)->_object._cons._cdr); | |
11215 | if (q && !(((q)->_flag)&32768)) { | |
11216 | ((p)->_object._cons._cdr) = t; | |
11217 | t = p; | |
11218 | p = q; | |
11219 | goto E2; | |
11220 | } | |
11221 | E6: | |
11222 | if (!t) | |
11223 | return; | |
11224 | q = t; | |
11225 | if ((((q)->_flag)&16384)) { | |
11226 | ((q)->_flag) &= 49151; | |
11227 | t = ((q)->_object._cons._car); | |
11228 | ((q)->_object._cons._car) = p; | |
11229 | p = q; | |
11230 | goto E5; | |
11231 | } else { | |
11232 | t = ((q)->_object._cons._cdr); | |
11233 | ((q)->_object._cons._cdr) = p; | |
11234 | p = q; | |
11235 | goto E6; | |
11236 | } | |
11237 | } | |
11238 | ||
11239 | ||
11240 | static void gc(scheme *sc, pointer a, pointer b) { | |
11241 | pointer p; | |
11242 | int i; | |
11243 | ||
11244 | if(sc->gc_verbose) { | |
11245 | putstr(sc, "gc..."); | |
11246 | } | |
11247 | ||
11248 | ||
11249 | mark(sc->oblist); | |
11250 | mark(sc->global_env); | |
11251 | ||
11252 | ||
11253 | mark(sc->args); | |
11254 | mark(sc->envir); | |
11255 | mark(sc->code); | |
11256 | dump_stack_mark(sc); | |
11257 | mark(sc->value); | |
11258 | mark(sc->safe_foreign); | |
11259 | mark(sc->inport); | |
11260 | mark(sc->save_inport); | |
11261 | mark(sc->outport); | |
11262 | mark(sc->loadport); | |
11263 | ||
11264 | ||
11265 | mark(a); | |
11266 | mark(b); | |
11267 | ||
11268 | ||
11269 | ((sc->NIL)->_flag) &= 32767; | |
11270 | sc->fcells = 0; | |
11271 | sc->free_cell = sc->NIL; | |
11272 | ||
11273 | ||
11274 | ||
11275 | ||
11276 | ||
11277 | for (i = sc->last_cell_seg; i >= 0; i--) { | |
11278 | p = sc->cell_seg[i] + 5000; | |
11279 | while (--p >= sc->cell_seg[i]) { | |
11280 | if ((((p)->_flag)&32768)) { | |
11281 | ((p)->_flag) &= 32767; | |
11282 | } else { | |
11283 | ||
11284 | if (((p)->_flag) != 0) { | |
11285 | finalize_cell(sc, p); | |
11286 | ((p)->_flag) = 0; | |
11287 | ((p)->_object._cons._car) = sc->NIL; | |
11288 | } | |
11289 | ++sc->fcells; | |
11290 | ((p)->_object._cons._cdr) = sc->free_cell; | |
11291 | sc->free_cell = p; | |
11292 | } | |
11293 | } | |
11294 | } | |
11295 | ||
11296 | if (sc->gc_verbose) { | |
11297 | char msg[80]; | |
11298 | sprintf(msg,"done: %ld cells were recovered.\n", sc->fcells); | |
11299 | putstr(sc,msg); | |
11300 | } | |
11301 | } | |
11302 | ||
11303 | static void finalize_cell(scheme *sc, pointer a) { | |
11304 | if(is_string(a)) { | |
11305 | sc->free(((a)->_object._string._svalue)); | |
11306 | } else if(is_port(a)) { | |
11307 | if(a->_object._port->kind&port_file | |
11308 | && a->_object._port->rep.stdio.closeit) { | |
11309 | port_close(sc,a,port_input|port_output); | |
11310 | } | |
11311 | sc->free(a->_object._port); | |
11312 | } | |
11313 | } | |
11314 | ||
11315 | ||
11316 | ||
11317 | static int file_push(scheme *sc, const char *fname) { | |
11318 | FILE *fin=fopen(fname,"rb"); | |
11319 | if(fin!=0) { | |
11320 | sc->file_i++; | |
11321 | sc->load_stack[sc->file_i].kind=port_file|port_input; | |
11322 | sc->load_stack[sc->file_i].rep.stdio.file=fin; | |
11323 | sc->load_stack[sc->file_i].rep.stdio.closeit=1; | |
11324 | sc->nesting_stack[sc->file_i]=0; | |
11325 | sc->loadport->_object._port=sc->load_stack+sc->file_i; | |
11326 | } | |
11327 | return fin!=0; | |
11328 | } | |
11329 | ||
11330 | static void file_pop(scheme *sc) { | |
11331 | sc->nesting=sc->nesting_stack[sc->file_i]; | |
11332 | if(sc->file_i!=0) { | |
11333 | port_close(sc,sc->loadport,port_input); | |
11334 | sc->file_i--; | |
11335 | sc->loadport->_object._port=sc->load_stack+sc->file_i; | |
11336 | if(file_interactive(sc)) { | |
11337 | putstr(sc,"> "); | |
11338 | } | |
11339 | } | |
11340 | } | |
11341 | ||
11342 | static int file_interactive(scheme *sc) { | |
11343 | return sc->file_i==0 && sc->load_stack[0].rep.stdio.file==stdin | |
11344 | && sc->inport->_object._port->kind&port_file; | |
11345 | } | |
11346 | ||
11347 | static port *port_rep_from_filename(scheme *sc, const char *fn, int prop) { | |
11348 | FILE *f; | |
11349 | char *rw; | |
11350 | port *pt; | |
11351 | if(prop==(port_input|port_output)) { | |
11352 | rw="a+b"; | |
11353 | } else if(prop==port_output) { | |
11354 | rw="wb"; | |
11355 | } else { | |
11356 | rw="rb"; | |
11357 | } | |
11358 | f=fopen(fn,rw); | |
11359 | if(f==0) { | |
11360 | return 0; | |
11361 | } | |
11362 | pt=port_rep_from_file(sc,f,prop); | |
11363 | pt->rep.stdio.closeit=1; | |
11364 | return pt; | |
11365 | } | |
11366 | ||
11367 | static pointer port_from_filename(scheme *sc, const char *fn, int prop) { | |
11368 | port *pt; | |
11369 | pt=port_rep_from_filename(sc,fn,prop); | |
11370 | if(pt==0) { | |
11371 | return sc->NIL; | |
11372 | } | |
11373 | return mk_port(sc,pt); | |
11374 | } | |
11375 | ||
11376 | static port *port_rep_from_file(scheme *sc, FILE *f, int prop) { | |
11377 | char *rw; | |
11378 | port *pt; | |
11379 | pt=(port*)sc->malloc(sizeof(port)); | |
11380 | if(pt==0) { | |
11381 | return 0; | |
11382 | } | |
11383 | if(prop==(port_input|port_output)) { | |
11384 | rw="a+"; | |
11385 | } else if(prop==port_output) { | |
11386 | rw="w"; | |
11387 | } else { | |
11388 | rw="r"; | |
11389 | } | |
11390 | pt->kind=port_file|prop; | |
11391 | pt->rep.stdio.file=f; | |
11392 | pt->rep.stdio.closeit=0; | |
11393 | return pt; | |
11394 | } | |
11395 | ||
11396 | static pointer port_from_file(scheme *sc, FILE *f, int prop) { | |
11397 | port *pt; | |
11398 | pt=port_rep_from_file(sc,f,prop); | |
11399 | if(pt==0) { | |
11400 | return sc->NIL; | |
11401 | } | |
11402 | return mk_port(sc,pt); | |
11403 | } | |
11404 | ||
11405 | static port *port_rep_from_string(scheme *sc, char *start, char *past_the_end, int prop) { | |
11406 | port *pt; | |
11407 | pt=(port*)sc->malloc(sizeof(port)); | |
11408 | if(pt==0) { | |
11409 | return 0; | |
11410 | } | |
11411 | pt->kind=port_string|prop; | |
11412 | pt->rep.string.start=start; | |
11413 | pt->rep.string.curr=start; | |
11414 | pt->rep.string.past_the_end=past_the_end; | |
11415 | return pt; | |
11416 | } | |
11417 | ||
11418 | static pointer port_from_string(scheme *sc, char *start, char *past_the_end, int prop) { | |
11419 | port *pt; | |
11420 | pt=port_rep_from_string(sc,start,past_the_end,prop); | |
11421 | if(pt==0) { | |
11422 | return sc->NIL; | |
11423 | } | |
11424 | return mk_port(sc,pt); | |
11425 | } | |
11426 | ||
11427 | static void port_close(scheme *sc, pointer p, int flag) { | |
11428 | port *pt=p->_object._port; | |
11429 | pt->kind&=~flag; | |
11430 | if((pt->kind & (port_input|port_output))==0) { | |
11431 | if(pt->kind&port_file) { | |
11432 | fclose(pt->rep.stdio.file); | |
11433 | } | |
11434 | pt->kind=port_free; | |
11435 | } | |
11436 | } | |
11437 | ||
11438 | static gunichar basic_inchar(port *pt) { | |
11439 | int len; | |
11440 | ||
11441 | if(pt->kind&port_file) { | |
11442 | char utf8[7]; | |
11443 | char *s; | |
11444 | int i; | |
11445 | ||
11446 | utf8[0] = fgetc(pt->rep.stdio.file); | |
11447 | if (utf8[0] & 0x80) | |
11448 | { | |
11449 | len = utf8_length[ utf8[0]&0x7F ]; | |
11450 | s = &utf8[1]; | |
11451 | for (i = 0; i < len; ++i) | |
11452 | *s++ = fgetc(pt->rep.stdio.file); | |
11453 | return g_utf8_get_char_validated(utf8, len+1); | |
11454 | } | |
11455 | return (gunichar)utf8[0]; | |
11456 | } else { | |
11457 | if(*pt->rep.string.curr==0 | |
11458 | || pt->rep.string.curr==pt->rep.string.past_the_end) { | |
11459 | return (-1); | |
11460 | } else { | |
11461 | gunichar c; | |
11462 | ||
11463 | len = pt->rep.string.past_the_end - pt->rep.string.curr; | |
11464 | c = g_utf8_get_char_validated(pt->rep.string.curr, len); | |
11465 | len = g_unichar_to_utf8(c, ((void *)0)); | |
11466 | pt->rep.string.curr += len; | |
11467 | return c; | |
11468 | } | |
11469 | } | |
11470 | } | |
11471 | ||
11472 | ||
11473 | static gunichar inchar(scheme *sc) { | |
11474 | gunichar c; | |
11475 | port *pt; | |
11476 | again: | |
11477 | pt=sc->inport->_object._port; | |
11478 | if(pt->kind&port_file && pt->rep.stdio.file == stdin) | |
11479 | { | |
11480 | if (sc->bc_flag) | |
11481 | { | |
11482 | sc->bc_flag = 0; | |
11483 | c = sc->backchar; | |
11484 | } | |
11485 | else | |
11486 | c=basic_inchar(pt); | |
11487 | } | |
11488 | else | |
11489 | c=basic_inchar(pt); | |
11490 | if(c==(-1) && sc->inport==sc->loadport && sc->file_i!=0) { | |
11491 | file_pop(sc); | |
11492 | if(sc->nesting!=0) { | |
11493 | return (-1); | |
11494 | } | |
11495 | goto again; | |
11496 | } | |
11497 | return c; | |
11498 | } | |
11499 | ||
11500 | ||
11501 | static void backchar(scheme *sc, gunichar c) { | |
11502 | port *pt; | |
11503 | gint charlen; | |
11504 | ||
11505 | if(c==(-1)) return; | |
11506 | charlen = g_unichar_to_utf8(c, ((void *)0)); | |
11507 | pt=sc->inport->_object._port; | |
11508 | if(pt->kind&port_file) { | |
11509 | if (pt->rep.stdio.file == stdin) | |
11510 | { | |
11511 | sc->backchar = c; | |
11512 | sc->bc_flag = 1; | |
11513 | } | |
11514 | else { | |
11515 | if (ftell(pt->rep.stdio.file) >= (long)charlen) | |
11516 | fseek(pt->rep.stdio.file, 0L-(long)charlen, 1); | |
11517 | } | |
11518 | } else { | |
11519 | if(pt->rep.string.curr!=pt->rep.string.start) { | |
11520 | if(pt->rep.string.curr-pt->rep.string.start >= charlen) | |
11521 | pt->rep.string.curr -= charlen; | |
11522 | else | |
11523 | pt->rep.string.curr = pt->rep.string.start; | |
11524 | } | |
11525 | } | |
11526 | } | |
11527 | ||
11528 | ||
11529 | static void putchars(scheme *sc, const char *chars, int char_cnt) { | |
11530 | int l; | |
11531 | char *s; | |
11532 | port *pt=sc->outport->_object._port; | |
11533 | ||
11534 | if (char_cnt <= 0) | |
11535 | return; | |
11536 | ||
11537 | ||
11538 | ||
11539 | if (ts_output_routine != ((void *)0)) | |
11540 | (*ts_output_routine) (pt->rep.stdio.file, (char *)chars, char_cnt); | |
11541 | ||
11542 | ||
11543 | char_cnt = g_utf8_offset_to_pointer(chars, (long)char_cnt) - chars; | |
11544 | ||
11545 | if (sc->print_error) { | |
11546 | l = strlen(sc->linebuff); | |
11547 | s = &sc->linebuff[l]; | |
11548 | memcpy(s, chars, ((char_cnt <= 1024 -l-1) ? char_cnt : 1024 -l-1)); | |
11549 | return; | |
11550 | } | |
11551 | ||
11552 | if(pt->kind&port_file) { | |
11553 | fwrite(chars,1,char_cnt,pt->rep.stdio.file); | |
11554 | fflush(pt->rep.stdio.file); | |
11555 | } else { | |
11556 | l = pt->rep.string.past_the_end - pt->rep.string.curr; | |
11557 | if (l > 0) | |
11558 | memcpy(pt->rep.string.curr, chars, ((char_cnt <= l) ? char_cnt : l)); | |
11559 | } | |
11560 | } | |
11561 | ||
11562 | void putcharacter(scheme *sc, gunichar c) { | |
11563 | char utf8[7]; | |
11564 | ||
11565 | (void)g_unichar_to_utf8(c, utf8); | |
11566 | putchars(sc, utf8, 1); | |
11567 | } | |
11568 | ||
11569 | void putstr(scheme *sc, const char *s) { | |
11570 | putchars(sc, s, g_utf8_strlen(s, -1)); | |
11571 | } | |
11572 | ||
11573 | ||
11574 | static char *readstr_upto(scheme *sc, char *delim) { | |
11575 | char *p = sc->strbuff; | |
11576 | gunichar c = 0; | |
11577 | gunichar c_prev = 0; | |
11578 | int len = 0; | |
11579 | # 1592 "scheme.c" | |
11580 | do { | |
11581 | c_prev = c; | |
11582 | c = inchar(sc); | |
11583 | len = g_unichar_to_utf8(c, p); | |
11584 | p += len; | |
11585 | } while (c && !is_one_of(delim, c)); | |
11586 | ||
11587 | if(p==sc->strbuff+2 && c_prev=='\\') | |
11588 | *p = '\0'; | |
11589 | else | |
11590 | { | |
11591 | backchar(sc,c); | |
11592 | p[-len] = '\0'; | |
11593 | } | |
11594 | ||
11595 | return sc->strbuff; | |
11596 | } | |
11597 | ||
11598 | ||
11599 | static pointer readstrexp(scheme *sc) { | |
11600 | char *p = sc->strbuff; | |
11601 | gunichar c; | |
11602 | int c1=0; | |
11603 | int len; | |
11604 | enum { st_ok, st_bsl, st_x1, st_x2, st_oct1, st_oct2, st_oct3 } state=st_ok; | |
11605 | ||
11606 | for (;;) { | |
11607 | c=inchar(sc); | |
11608 | if(c==(-1) || p-sc->strbuff>sizeof(sc->strbuff)-1) { | |
11609 | return sc->F; | |
11610 | } | |
11611 | switch(state) { | |
11612 | case st_ok: | |
11613 | switch(c) { | |
11614 | case '\\': | |
11615 | state=st_bsl; | |
11616 | break; | |
11617 | case '"': | |
11618 | *p=0; | |
11619 | return mk_counted_string(sc,sc->strbuff,p-sc->strbuff); | |
11620 | default: | |
11621 | len = g_unichar_to_utf8(c, p); | |
11622 | p += len; | |
11623 | break; | |
11624 | } | |
11625 | break; | |
11626 | case st_bsl: | |
11627 | switch(c) { | |
11628 | case '0': | |
11629 | case '1': | |
11630 | case '2': | |
11631 | case '3': | |
11632 | case '4': | |
11633 | case '5': | |
11634 | case '6': | |
11635 | case '7': | |
11636 | state=st_oct1; | |
11637 | c1=g_unichar_digit_value(c); | |
11638 | break; | |
11639 | case 'x': | |
11640 | case 'X': | |
11641 | state=st_x1; | |
11642 | c1=0; | |
11643 | break; | |
11644 | case 'n': | |
11645 | *p++='\n'; | |
11646 | state=st_ok; | |
11647 | break; | |
11648 | case 't': | |
11649 | *p++='\t'; | |
11650 | state=st_ok; | |
11651 | break; | |
11652 | case 'r': | |
11653 | *p++='\r'; | |
11654 | state=st_ok; | |
11655 | break; | |
11656 | case '"': | |
11657 | *p++='"'; | |
11658 | state=st_ok; | |
11659 | break; | |
11660 | default: | |
11661 | len = g_unichar_to_utf8(c, p); | |
11662 | p += len; | |
11663 | state=st_ok; | |
11664 | break; | |
11665 | } | |
11666 | break; | |
11667 | case st_x1: | |
11668 | case st_x2: | |
11669 | if (!g_unichar_isxdigit(c)) | |
11670 | return sc->F; | |
11671 | c1=(c1<<4)+g_unichar_xdigit_value(c); | |
11672 | if(state==st_x1) | |
11673 | state=st_x2; | |
11674 | else { | |
11675 | *p++=c1; | |
11676 | state=st_ok; | |
11677 | } | |
11678 | break; | |
11679 | case st_oct1: | |
11680 | case st_oct2: | |
11681 | case st_oct3: | |
11682 | if (!g_unichar_isdigit(c) || g_unichar_digit_value(c) > 7) | |
11683 | { | |
11684 | if (state==st_oct1) | |
11685 | return sc->F; | |
11686 | ||
11687 | *p++=c1; | |
11688 | backchar(sc, c); | |
11689 | state=st_ok; | |
11690 | } | |
11691 | else | |
11692 | { | |
11693 | c1=(c1<<3)+g_unichar_digit_value(c); | |
11694 | switch (state) | |
11695 | { | |
11696 | case st_oct1: | |
11697 | state=st_oct2; | |
11698 | break; | |
11699 | case st_oct2: | |
11700 | state=st_oct3; | |
11701 | break; | |
11702 | default: | |
11703 | *p++=c1; | |
11704 | state=st_ok; | |
11705 | break; | |
11706 | } | |
11707 | } | |
11708 | break; | |
11709 | } | |
11710 | } | |
11711 | } | |
11712 | ||
11713 | ||
11714 | static int is_one_of(char *s, gunichar c) { | |
11715 | if (c==(-1)) | |
11716 | return 1; | |
11717 | ||
11718 | if (g_utf8_strchr(s, -1, c) != ((void *)0)) | |
11719 | return (1); | |
11720 | ||
11721 | return (0); | |
11722 | } | |
11723 | ||
11724 | ||
11725 | static void skipspace(scheme *sc) { | |
11726 | gunichar c; | |
11727 | while (g_unichar_isspace(c=inchar(sc))) | |
11728 | ; | |
11729 | if(c!=(-1)) { | |
11730 | backchar(sc,c); | |
11731 | } | |
11732 | } | |
11733 | ||
11734 | ||
11735 | static int token(scheme *sc) { | |
11736 | gunichar c; | |
11737 | skipspace(sc); | |
11738 | switch (c=inchar(sc)) { | |
11739 | case (-1): | |
11740 | return ((-1)); | |
11741 | case '(': | |
11742 | return (0); | |
11743 | case ')': | |
11744 | return (1); | |
11745 | case '.': | |
11746 | c=inchar(sc); | |
11747 | if(is_one_of(" \n\t",c)) { | |
11748 | return (2); | |
11749 | } else { | |
11750 | backchar(sc,c); | |
11751 | backchar(sc,'.'); | |
11752 | return 3; | |
11753 | } | |
11754 | case '\'': | |
11755 | return (4); | |
11756 | case ';': | |
11757 | while ((c=inchar(sc)) != '\n' && c!=(-1)) | |
11758 | ; | |
11759 | return (token(sc)); | |
11760 | case '"': | |
11761 | return (6); | |
11762 | case '_': | |
11763 | if ((c=inchar(sc)) == '"') | |
11764 | return (6); | |
11765 | backchar(sc,c); | |
11766 | return (3); | |
11767 | case '`': | |
11768 | return (7); | |
11769 | case ',': | |
11770 | if ((c=inchar(sc)) == '@') | |
11771 | return (9); | |
11772 | else { | |
11773 | backchar(sc,c); | |
11774 | return (8); | |
11775 | } | |
11776 | case '#': | |
11777 | c=inchar(sc); | |
11778 | if (c == '(') { | |
11779 | return (12); | |
11780 | } else if(c == '!') { | |
11781 | while ((c=inchar(sc)) != '\n' && c!=(-1)) | |
11782 | ; | |
11783 | return (token(sc)); | |
11784 | } else { | |
11785 | backchar(sc,c); | |
11786 | if(is_one_of(" tfodxb\\",c)) { | |
11787 | return 11; | |
11788 | } else { | |
11789 | return (10); | |
11790 | } | |
11791 | } | |
11792 | default: | |
11793 | backchar(sc,c); | |
11794 | return (3); | |
11795 | } | |
11796 | } | |
11797 | ||
11798 | ||
11799 | ||
11800 | ||
11801 | static void printslashstring(scheme *sc, char *p, int len) { | |
11802 | int i; | |
11803 | gunichar c; | |
11804 | char *s=(char*)p; | |
11805 | ||
11806 | putcharacter(sc,'"'); | |
11807 | for (i=0; i<len; i++) { | |
11808 | c = g_utf8_get_char(s); | |
11809 | ||
11810 | if(c==0xff || c=='"' || c<' ' || c=='\\') { | |
11811 | putcharacter(sc,'\\'); | |
11812 | switch(c) { | |
11813 | case '"': | |
11814 | putcharacter(sc,'"'); | |
11815 | break; | |
11816 | case '\n': | |
11817 | putcharacter(sc,'n'); | |
11818 | break; | |
11819 | case '\t': | |
11820 | putcharacter(sc,'t'); | |
11821 | break; | |
11822 | case '\r': | |
11823 | putcharacter(sc,'r'); | |
11824 | break; | |
11825 | case '\\': | |
11826 | putcharacter(sc,'\\'); | |
11827 | break; | |
11828 | default: { | |
11829 | ||
11830 | int d=c/16; | |
11831 | putcharacter(sc,'x'); | |
11832 | if(d<10) { | |
11833 | putcharacter(sc,d+'0'); | |
11834 | } else { | |
11835 | putcharacter(sc,d-10+'A'); | |
11836 | } | |
11837 | d=c%16; | |
11838 | if(d<10) { | |
11839 | putcharacter(sc,d+'0'); | |
11840 | } else { | |
11841 | putcharacter(sc,d-10+'A'); | |
11842 | } | |
11843 | } | |
11844 | } | |
11845 | } else { | |
11846 | putcharacter(sc,c); | |
11847 | } | |
11848 | s = (char *)((s) + g_utf8_skip[*(guchar *)(s)]); | |
11849 | } | |
11850 | putcharacter(sc,'"'); | |
11851 | } | |
11852 | ||
11853 | ||
11854 | ||
11855 | static void printatom(scheme *sc, pointer l, int f) { | |
11856 | char *p; | |
11857 | int len; | |
11858 | atom2str(sc,l,f,&p,&len); | |
11859 | putchars(sc,p,len); | |
11860 | } | |
11861 | ||
11862 | ||
11863 | ||
11864 | static void atom2str(scheme *sc, pointer l, int f, char **pp, int *plen) { | |
11865 | char *p; | |
11866 | ||
11867 | if (l == sc->NIL) { | |
11868 | p = "()"; | |
11869 | } else if (l == sc->T) { | |
11870 | p = "#t"; | |
11871 | } else if (l == sc->F) { | |
11872 | p = "#f"; | |
11873 | } else if (l == sc->EOF_OBJ) { | |
11874 | p = "#<EOF>"; | |
11875 | } else if (is_port(l)) { | |
11876 | p = sc->strbuff; | |
11877 | strcpy(p, "#<PORT>"); | |
11878 | } else if (is_number(l)) { | |
11879 | p = sc->strbuff; | |
11880 | if(is_integer(l)) { | |
11881 | sprintf(p, "%ld", ((l)->_object._number.value.ivalue)); | |
11882 | } else { | |
11883 | sprintf(p, "%.10g", ((l)->_object._number.value.rvalue)); | |
11884 | } | |
11885 | } else if (is_string(l)) { | |
11886 | if (!f) { | |
11887 | p = ((l)->_object._string._svalue); | |
11888 | } else { | |
11889 | *pp=sc->strbuff; | |
11890 | *plen=0; | |
11891 | printslashstring(sc, ((l)->_object._string._svalue), | |
11892 | g_utf8_strlen(((l)->_object._string._svalue), -1)); | |
11893 | return; | |
11894 | } | |
11895 | } else if (is_character(l)) { | |
11896 | gunichar c=charvalue(l); | |
11897 | p = sc->strbuff; | |
11898 | if (!f) { | |
11899 | int len = g_unichar_to_utf8(c, p); | |
11900 | p[len]=0; | |
11901 | } else { | |
11902 | switch(c) { | |
11903 | case ' ': | |
11904 | sprintf(p,"#\\space"); break; | |
11905 | case '\n': | |
11906 | sprintf(p,"#\\newline"); break; | |
11907 | case '\r': | |
11908 | sprintf(p,"#\\return"); break; | |
11909 | case '\t': | |
11910 | sprintf(p,"#\\tab"); break; | |
11911 | default: | |
11912 | ||
11913 | ||
11914 | ||
11915 | ||
11916 | ||
11917 | ||
11918 | ||
11919 | if(c<32) { | |
11920 | sprintf(p,"#\\x%x",c); break; | |
11921 | } | |
11922 | ||
11923 | sprintf(p,"#\\%c",c); break; | |
11924 | } | |
11925 | } | |
11926 | } else if (is_symbol(l)) { | |
11927 | p = symname(l); | |
11928 | } else if (is_proc(l)) { | |
11929 | p = sc->strbuff; | |
11930 | sprintf(p, "#<%s PROCEDURE %ld>", procname(l),ivalue(l)); | |
11931 | } else if (is_macro(l)) { | |
11932 | p = "#<MACRO>"; | |
11933 | } else if (is_closure(l)) { | |
11934 | p = "#<CLOSURE>"; | |
11935 | } else if (is_promise(l)) { | |
11936 | p = "#<PROMISE>"; | |
11937 | } else if (is_foreign(l)) { | |
11938 | p = sc->strbuff; | |
11939 | sprintf(p, "#<FOREIGN PROCEDURE %ld>", ivalue(l)); | |
11940 | } else if (is_continuation(l)) { | |
11941 | p = "#<CONTINUATION>"; | |
11942 | } else { | |
11943 | p = "#<ERROR>"; | |
11944 | } | |
11945 | *pp=p; | |
11946 | *plen=g_utf8_strlen(p, -1); | |
11947 | } | |
11948 | ||
11949 | ||
11950 | ||
11951 | static pointer mk_closure(scheme *sc, pointer c, pointer e) { | |
11952 | pointer x = get_cell(sc, c, e); | |
11953 | ||
11954 | ((x)->_flag) = T_CLOSURE; | |
11955 | ((x)->_object._cons._car) = c; | |
11956 | ((x)->_object._cons._cdr) = e; | |
11957 | return (x); | |
11958 | } | |
11959 | ||
11960 | ||
11961 | static pointer mk_continuation(scheme *sc, pointer d) { | |
11962 | pointer x = get_cell(sc, sc->NIL, d); | |
11963 | ||
11964 | ((x)->_flag) = T_CONTINUATION; | |
11965 | ((x)->_object._cons._cdr) = d; | |
11966 | return (x); | |
11967 | } | |
11968 | ||
11969 | static pointer list_star(scheme *sc, pointer d) { | |
11970 | pointer p, q; | |
11971 | if(((d)->_object._cons._cdr)==sc->NIL) { | |
11972 | return ((d)->_object._cons._car); | |
11973 | } | |
11974 | p=_cons(sc,((d)->_object._cons._car),((d)->_object._cons._cdr),0); | |
11975 | q=p; | |
11976 | while(((((p)->_object._cons._cdr))->_object._cons._cdr)!=sc->NIL) { | |
11977 | d=_cons(sc,((p)->_object._cons._car),((p)->_object._cons._cdr),0); | |
11978 | if(((((p)->_object._cons._cdr))->_object._cons._cdr)!=sc->NIL) { | |
11979 | p=((d)->_object._cons._cdr); | |
11980 | } | |
11981 | } | |
11982 | ((p)->_object._cons._cdr)=((((p)->_object._cons._cdr))->_object._cons._car); | |
11983 | return q; | |
11984 | } | |
11985 | ||
11986 | ||
11987 | static pointer reverse(scheme *sc, pointer a) { | |
11988 | ||
11989 | pointer p = sc->NIL; | |
11990 | ||
11991 | for ( ; is_pair(a); a = ((a)->_object._cons._cdr)) { | |
11992 | p = _cons(sc,((a)->_object._cons._car),p,0); | |
11993 | } | |
11994 | return (p); | |
11995 | } | |
11996 | ||
11997 | ||
11998 | static pointer reverse_in_place(scheme *sc, pointer term, pointer list) { | |
11999 | pointer p = list, result = term, q; | |
12000 | ||
12001 | while (p != sc->NIL) { | |
12002 | q = ((p)->_object._cons._cdr); | |
12003 | ((p)->_object._cons._cdr) = result; | |
12004 | result = p; | |
12005 | p = q; | |
12006 | } | |
12007 | return (result); | |
12008 | } | |
12009 | ||
12010 | ||
12011 | static pointer append(scheme *sc, pointer a, pointer b) { | |
12012 | pointer p = b, q; | |
12013 | ||
12014 | if (a != sc->NIL) { | |
12015 | a = reverse(sc, a); | |
12016 | while (a != sc->NIL) { | |
12017 | q = ((a)->_object._cons._cdr); | |
12018 | ((a)->_object._cons._cdr) = p; | |
12019 | p = a; | |
12020 | a = q; | |
12021 | } | |
12022 | } | |
12023 | return (p); | |
12024 | } | |
12025 | ||
12026 | ||
12027 | static int eqv(pointer a, pointer b) { | |
12028 | if (is_string(a)) { | |
12029 | if (is_string(b)) | |
12030 | return (((a)->_object._string._svalue) == ((b)->_object._string._svalue)); | |
12031 | else | |
12032 | return (0); | |
12033 | } else if (is_number(a)) { | |
12034 | if (is_number(b)) | |
12035 | return num_eq(nvalue(a),nvalue(b)); | |
12036 | else | |
12037 | return (0); | |
12038 | } else if (is_character(a)) { | |
12039 | if (is_character(b)) | |
12040 | return charvalue(a)==charvalue(b); | |
12041 | else | |
12042 | return (0); | |
12043 | } else if (is_port(a)) { | |
12044 | if (is_port(b)) | |
12045 | return a==b; | |
12046 | else | |
12047 | return (0); | |
12048 | } else if (is_proc(a)) { | |
12049 | if (is_proc(b)) | |
12050 | return ivalue(a)==ivalue(b); | |
12051 | else | |
12052 | return (0); | |
12053 | } else { | |
12054 | return (a == b); | |
12055 | } | |
12056 | } | |
12057 | # 2080 "scheme.c" | |
12058 | static int hash_fn(const char *key, int table_size) | |
12059 | { | |
12060 | unsigned int hashed = 0; | |
12061 | const char *c; | |
12062 | int bits_per_int = sizeof(unsigned int)*8; | |
12063 | ||
12064 | for (c = key; *c; c++) { | |
12065 | ||
12066 | hashed = (hashed<<5) | (hashed>>(bits_per_int-5)); | |
12067 | hashed ^= *c; | |
12068 | } | |
12069 | return hashed % table_size; | |
12070 | } | |
12071 | # 2105 "scheme.c" | |
12072 | static void new_frame_in_env(scheme *sc, pointer old_env) | |
12073 | { | |
12074 | pointer new_frame; | |
12075 | ||
12076 | ||
12077 | if (old_env == sc->NIL) { | |
12078 | new_frame = mk_vector(sc, 461); | |
12079 | } else { | |
12080 | new_frame = sc->NIL; | |
12081 | } | |
12082 | ||
12083 | sc->envir = _cons(sc,new_frame,old_env,1); | |
12084 | ((sc->envir)->_flag) = T_ENVIRONMENT; | |
12085 | } | |
12086 | ||
12087 | static void new_slot_spec_in_env(scheme *sc, pointer env, | |
12088 | pointer variable, pointer value) | |
12089 | { | |
12090 | pointer slot = _cons(sc,variable,value,1); | |
12091 | ||
12092 | if (is_vector(((env)->_object._cons._car))) { | |
12093 | int location = hash_fn(symname(variable), ((((env)->_object._cons._car))->_object._number.value.ivalue)); | |
12094 | ||
12095 | set_vector_elem(((env)->_object._cons._car), location, | |
12096 | _cons(sc,slot,vector_elem(((env)->_object._cons._car), location),1)); | |
12097 | } else { | |
12098 | ((env)->_object._cons._car) = _cons(sc,slot,((env)->_object._cons._car),1); | |
12099 | } | |
12100 | } | |
12101 | ||
12102 | static pointer find_slot_in_env(scheme *sc, pointer env, pointer hdl, int all) | |
12103 | { | |
12104 | pointer x,y; | |
12105 | int location; | |
12106 | ||
12107 | for (x = env; x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
12108 | if (is_vector(((x)->_object._cons._car))) { | |
12109 | location = hash_fn(symname(hdl), ((((x)->_object._cons._car))->_object._number.value.ivalue)); | |
12110 | y = vector_elem(((x)->_object._cons._car), location); | |
12111 | } else { | |
12112 | y = ((x)->_object._cons._car); | |
12113 | } | |
12114 | for ( ; y != sc->NIL; y = ((y)->_object._cons._cdr)) { | |
12115 | if (((((y)->_object._cons._car))->_object._cons._car) == hdl) { | |
12116 | break; | |
12117 | } | |
12118 | } | |
12119 | if (y != sc->NIL) { | |
12120 | break; | |
12121 | } | |
12122 | if(!all) { | |
12123 | return sc->NIL; | |
12124 | } | |
12125 | } | |
12126 | if (x != sc->NIL) { | |
12127 | return ((y)->_object._cons._car); | |
12128 | } | |
12129 | return sc->NIL; | |
12130 | } | |
12131 | # 2203 "scheme.c" | |
12132 | static void new_slot_in_env(scheme *sc, pointer variable, pointer value) | |
12133 | { | |
12134 | new_slot_spec_in_env(sc, sc->envir, variable, value); | |
12135 | } | |
12136 | ||
12137 | static void set_slot_in_env(scheme *sc, pointer slot, pointer value) | |
12138 | { | |
12139 | ((slot)->_object._cons._cdr) = value; | |
12140 | } | |
12141 | ||
12142 | static pointer slot_value_in_env(pointer slot) | |
12143 | { | |
12144 | return ((slot)->_object._cons._cdr); | |
12145 | } | |
12146 | ||
12147 | ||
12148 | ||
12149 | ||
12150 | static pointer _Error_1(scheme *sc, const char *s, pointer a) { | |
12151 | ||
12152 | pointer x; | |
12153 | pointer hdl=sc->ERROR_HOOK; | |
12154 | ||
12155 | x=find_slot_in_env(sc,sc->envir,hdl,1); | |
12156 | if (x != sc->NIL) { | |
12157 | if(a!=0) { | |
12158 | sc->code = _cons(sc,_cons(sc,sc->QUOTE,_cons(sc,(a),sc->NIL,0),0),sc->NIL,0); | |
12159 | } else { | |
12160 | sc->code = sc->NIL; | |
12161 | } | |
12162 | sc->code = _cons(sc,mk_string(sc, (s)),sc->code,0); | |
12163 | setimmutable(((sc->code)->_object._cons._car)); | |
12164 | sc->code = _cons(sc,slot_value_in_env(x),sc->code,0); | |
12165 | sc->op = (int)OP_EVAL; | |
12166 | return sc->T; | |
12167 | } | |
12168 | ||
12169 | ||
12170 | if(a!=0) { | |
12171 | sc->args = _cons(sc,(a),sc->NIL,0); | |
12172 | } else { | |
12173 | sc->args = sc->NIL; | |
12174 | } | |
12175 | sc->args = _cons(sc,mk_string(sc, (s)),sc->args,0); | |
12176 | setimmutable(((sc->args)->_object._cons._car)); | |
12177 | sc->op = (int)OP_ERR0; | |
12178 | return sc->T; | |
12179 | } | |
12180 | # 2350 "scheme.c" | |
12181 | static void dump_stack_reset(scheme *sc) | |
12182 | { | |
12183 | sc->dump = sc->NIL; | |
12184 | } | |
12185 | ||
12186 | static void dump_stack_initialize(scheme *sc) | |
12187 | { | |
12188 | dump_stack_reset(sc); | |
12189 | } | |
12190 | ||
12191 | static void dump_stack_free(scheme *sc) | |
12192 | { | |
12193 | sc->dump = sc->NIL; | |
12194 | } | |
12195 | ||
12196 | static pointer _s_return(scheme *sc, pointer a) { | |
12197 | sc->value = (a); | |
12198 | if(sc->dump==sc->NIL) return sc->NIL; | |
12199 | sc->op = ivalue(((sc->dump)->_object._cons._car)); | |
12200 | sc->args = ((((sc->dump)->_object._cons._cdr))->_object._cons._car); | |
12201 | sc->envir = ((((((sc->dump)->_object._cons._cdr))->_object._cons._cdr))->_object._cons._car); | |
12202 | sc->code = ((((((((sc->dump)->_object._cons._cdr))->_object._cons._cdr))->_object._cons._cdr))->_object._cons._car); | |
12203 | sc->dump = ((((((((sc->dump)->_object._cons._cdr))->_object._cons._cdr))->_object._cons._cdr))->_object._cons._cdr); | |
12204 | return sc->T; | |
12205 | } | |
12206 | ||
12207 | static void s_save(scheme *sc, enum scheme_opcodes op, pointer args, pointer code) { | |
12208 | sc->dump = _cons(sc,sc->envir,_cons(sc,(code),sc->dump,0),0); | |
12209 | sc->dump = _cons(sc,(args),sc->dump,0); | |
12210 | sc->dump = _cons(sc,mk_integer(sc, (long)(op)),sc->dump,0); | |
12211 | } | |
12212 | ||
12213 | static void dump_stack_mark(scheme *sc) | |
12214 | { | |
12215 | mark(sc->dump); | |
12216 | } | |
12217 | ||
12218 | ||
12219 | ||
12220 | ||
12221 | static pointer opexe_0(scheme *sc, enum scheme_opcodes op) { | |
12222 | pointer x, y; | |
12223 | ||
12224 | switch (op) { | |
12225 | case OP_LOAD: | |
12226 | if(file_interactive(sc)) { | |
12227 | fprintf(sc->outport->_object._port->rep.stdio.file, | |
12228 | "Loading %s\n", ((((sc->args)->_object._cons._car))->_object._string._svalue)); | |
12229 | } | |
12230 | if (!file_push(sc,((((sc->args)->_object._cons._car))->_object._string._svalue))) { | |
12231 | return _Error_1(sc,"unable to open",((sc->args)->_object._cons._car)); | |
12232 | } | |
12233 | do { sc->op = (int)(OP_T0LVL); return sc->T; } while (0); | |
12234 | ||
12235 | case OP_T0LVL: | |
12236 | if(file_interactive(sc)) { | |
12237 | putstr(sc,"\n"); | |
12238 | } | |
12239 | sc->nesting=0; | |
12240 | dump_stack_reset(sc); | |
12241 | sc->envir = sc->global_env; | |
12242 | sc->save_inport=sc->inport; | |
12243 | sc->inport = sc->loadport; | |
12244 | s_save(sc,OP_T0LVL, sc->NIL, sc->NIL); | |
12245 | s_save(sc,OP_VALUEPRINT, sc->NIL, sc->NIL); | |
12246 | s_save(sc,OP_T1LVL, sc->NIL, sc->NIL); | |
12247 | if (file_interactive(sc)) { | |
12248 | putstr(sc,"> "); | |
12249 | } | |
12250 | do { sc->op = (int)(OP_READ_INTERNAL); return sc->T; } while (0); | |
12251 | ||
12252 | case OP_T1LVL: | |
12253 | sc->code = sc->value; | |
12254 | sc->inport=sc->save_inport; | |
12255 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12256 | ||
12257 | case OP_READ_INTERNAL: | |
12258 | sc->tok = token(sc); | |
12259 | if(sc->tok==(-1)) { | |
12260 | if(sc->inport==sc->loadport) { | |
12261 | sc->args=sc->NIL; | |
12262 | do { sc->op = (int)(OP_QUIT); return sc->T; } while (0); | |
12263 | } else { | |
12264 | return _s_return(sc,sc->EOF_OBJ); | |
12265 | } | |
12266 | } | |
12267 | do { sc->op = (int)(OP_RDSEXPR); return sc->T; } while (0); | |
12268 | ||
12269 | case OP_GENSYM: | |
12270 | return _s_return(sc,gensym(sc)); | |
12271 | ||
12272 | case OP_VALUEPRINT: | |
12273 | ||
12274 | ||
12275 | ||
12276 | if(sc->tracing) { | |
12277 | putstr(sc,"\nGives: "); | |
12278 | } | |
12279 | if(file_interactive(sc) || sc->print_output) { | |
12280 | sc->print_flag = 1; | |
12281 | sc->args = sc->value; | |
12282 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
12283 | } else { | |
12284 | return _s_return(sc,sc->value); | |
12285 | } | |
12286 | ||
12287 | case OP_EVAL: | |
12288 | ||
12289 | if(sc->tracing) { | |
12290 | ||
12291 | s_save(sc,OP_REAL_EVAL,sc->args,sc->code); | |
12292 | sc->args=sc->code; | |
12293 | putstr(sc,"\nEval: "); | |
12294 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
12295 | } | |
12296 | ||
12297 | case OP_REAL_EVAL: | |
12298 | ||
12299 | if (is_symbol(sc->code)) { | |
12300 | x=find_slot_in_env(sc,sc->envir,sc->code,1); | |
12301 | if (x != sc->NIL) { | |
12302 | return _s_return(sc,slot_value_in_env(x)); | |
12303 | } else { | |
12304 | return _Error_1(sc,"eval: unbound variable:",sc->code); | |
12305 | } | |
12306 | } else if (is_pair(sc->code)) { | |
12307 | if (is_syntax(x = ((sc->code)->_object._cons._car))) { | |
12308 | sc->code = ((sc->code)->_object._cons._cdr); | |
12309 | do { sc->op = (int)(syntaxnum(x)); return sc->T; } while (0); | |
12310 | } else { | |
12311 | s_save(sc,OP_E0ARGS, sc->NIL, sc->code); | |
12312 | ||
12313 | sc->code = ((sc->code)->_object._cons._car); | |
12314 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12315 | } | |
12316 | } else { | |
12317 | return _s_return(sc,sc->code); | |
12318 | } | |
12319 | ||
12320 | case OP_E0ARGS: | |
12321 | if (is_macro(sc->value)) { | |
12322 | s_save(sc,OP_DOMACRO, sc->NIL, sc->NIL); | |
12323 | sc->args = _cons(sc,sc->code,sc->NIL,0); | |
12324 | sc->code = sc->value; | |
12325 | do { sc->op = (int)(OP_APPLY); return sc->T; } while (0); | |
12326 | } else { | |
12327 | sc->code = ((sc->code)->_object._cons._cdr); | |
12328 | do { sc->op = (int)(OP_E1ARGS); return sc->T; } while (0); | |
12329 | } | |
12330 | ||
12331 | case OP_E1ARGS: | |
12332 | sc->args = _cons(sc,sc->value,sc->args,0); | |
12333 | if (is_pair(sc->code)) { | |
12334 | s_save(sc,OP_E1ARGS, sc->args, ((sc->code)->_object._cons._cdr)); | |
12335 | sc->code = ((sc->code)->_object._cons._car); | |
12336 | sc->args = sc->NIL; | |
12337 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12338 | } else { | |
12339 | sc->args = reverse_in_place(sc, sc->NIL, sc->args); | |
12340 | sc->code = ((sc->args)->_object._cons._car); | |
12341 | sc->args = ((sc->args)->_object._cons._cdr); | |
12342 | do { sc->op = (int)(OP_APPLY); return sc->T; } while (0); | |
12343 | } | |
12344 | ||
12345 | ||
12346 | case OP_TRACING: { | |
12347 | int tr=sc->tracing; | |
12348 | sc->tracing=ivalue(((sc->args)->_object._cons._car)); | |
12349 | return _s_return(sc,mk_integer(sc,tr)); | |
12350 | } | |
12351 | ||
12352 | ||
12353 | case OP_APPLY: | |
12354 | ||
12355 | if(sc->tracing) { | |
12356 | s_save(sc,OP_REAL_APPLY,sc->args,sc->code); | |
12357 | sc->print_flag = 1; | |
12358 | ||
12359 | putstr(sc,"\nApply to: "); | |
12360 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
12361 | } | |
12362 | ||
12363 | case OP_REAL_APPLY: | |
12364 | ||
12365 | if (is_proc(sc->code)) { | |
12366 | do { sc->op = (int)(ivalue(sc->code)); return sc->T; } while (0); | |
12367 | } else if (is_foreign(sc->code)) { | |
12368 | sc->safe_foreign = _cons(sc,sc->NIL,sc->safe_foreign,0); | |
12369 | x=sc->code->_object._ff(sc,sc->args); | |
12370 | sc->safe_foreign = ((sc->safe_foreign)->_object._cons._cdr); | |
12371 | return _s_return(sc,x); | |
12372 | } else if (is_closure(sc->code) || is_macro(sc->code) | |
12373 | || is_promise(sc->code)) { | |
12374 | ||
12375 | ||
12376 | new_frame_in_env(sc, closure_env(sc->code)); | |
12377 | for (x = ((closure_code(sc->code))->_object._cons._car), y = sc->args; | |
12378 | is_pair(x); x = ((x)->_object._cons._cdr), y = ((y)->_object._cons._cdr)) { | |
12379 | if (y == sc->NIL) { | |
12380 | return _Error_1(sc,"not enough arguments",0); | |
12381 | } else { | |
12382 | new_slot_in_env(sc, ((x)->_object._cons._car), ((y)->_object._cons._car)); | |
12383 | } | |
12384 | } | |
12385 | if (x == sc->NIL) { | |
12386 | ||
12387 | ||
12388 | ||
12389 | ||
12390 | ||
12391 | } else if (is_symbol(x)) | |
12392 | new_slot_in_env(sc, x, y); | |
12393 | else { | |
12394 | return _Error_1(sc,"syntax error in closure: not a symbol:",x); | |
12395 | } | |
12396 | sc->code = ((closure_code(sc->code))->_object._cons._cdr); | |
12397 | sc->args = sc->NIL; | |
12398 | do { sc->op = (int)(OP_BEGIN); return sc->T; } while (0); | |
12399 | } else if (is_continuation(sc->code)) { | |
12400 | sc->dump = ((sc->code)->_object._cons._cdr); | |
12401 | return _s_return(sc,sc->args != sc->NIL ? ((sc->args)->_object._cons._car) : sc->NIL); | |
12402 | } else { | |
12403 | return _Error_1(sc,"illegal function",0); | |
12404 | } | |
12405 | ||
12406 | case OP_DOMACRO: | |
12407 | sc->code = sc->value; | |
12408 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12409 | ||
12410 | case OP_LAMBDA: | |
12411 | return _s_return(sc,mk_closure(sc, sc->code, sc->envir)); | |
12412 | ||
12413 | case OP_MKCLOSURE: | |
12414 | x=((sc->args)->_object._cons._car); | |
12415 | if(((x)->_object._cons._car)==sc->LAMBDA) { | |
12416 | x=((x)->_object._cons._cdr); | |
12417 | } | |
12418 | if(((sc->args)->_object._cons._cdr)==sc->NIL) { | |
12419 | y=sc->envir; | |
12420 | } else { | |
12421 | y=((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
12422 | } | |
12423 | return _s_return(sc,mk_closure(sc, x, y)); | |
12424 | ||
12425 | case OP_QUOTE: | |
12426 | x=((sc->code)->_object._cons._car); | |
12427 | return _s_return(sc,((sc->code)->_object._cons._car)); | |
12428 | ||
12429 | case OP_DEF0: | |
12430 | if(is_immutable(((sc->code)->_object._cons._car))) | |
12431 | return _Error_1(sc,"define: unable to alter immutable",((sc->code)->_object._cons._car)); | |
12432 | if (is_pair(((sc->code)->_object._cons._car))) { | |
12433 | x = ((((sc->code)->_object._cons._car))->_object._cons._car); | |
12434 | sc->code = _cons(sc,sc->LAMBDA,_cons(sc,((((sc->code)->_object._cons._car))->_object._cons._cdr),((sc->code)->_object._cons._cdr),0),0); | |
12435 | } else { | |
12436 | x = ((sc->code)->_object._cons._car); | |
12437 | sc->code = ((((sc->code)->_object._cons._cdr))->_object._cons._car); | |
12438 | } | |
12439 | if (!is_symbol(x)) { | |
12440 | return _Error_1(sc,"variable is not a symbol",0); | |
12441 | } | |
12442 | s_save(sc,OP_DEF1, sc->NIL, x); | |
12443 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12444 | ||
12445 | case OP_DEF1: | |
12446 | x=find_slot_in_env(sc,sc->envir,sc->code,0); | |
12447 | if (x != sc->NIL) { | |
12448 | set_slot_in_env(sc, x, sc->value); | |
12449 | } else { | |
12450 | new_slot_in_env(sc, sc->code, sc->value); | |
12451 | } | |
12452 | return _s_return(sc,sc->code); | |
12453 | ||
12454 | ||
12455 | case OP_DEFP: | |
12456 | x=sc->envir; | |
12457 | if(((sc->args)->_object._cons._cdr)!=sc->NIL) { | |
12458 | x=((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
12459 | } | |
12460 | return _s_return(sc,(find_slot_in_env(sc,x,((sc->args)->_object._cons._car),1)!=sc->NIL) ? sc->T : sc->F); | |
12461 | ||
12462 | case OP_SET0: | |
12463 | if(is_immutable(((sc->code)->_object._cons._car))) | |
12464 | return _Error_1(sc,"set!: unable to alter immutable variable",((sc->code)->_object._cons._car)); | |
12465 | s_save(sc,OP_SET1, sc->NIL, ((sc->code)->_object._cons._car)); | |
12466 | sc->code = ((((sc->code)->_object._cons._cdr))->_object._cons._car); | |
12467 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12468 | ||
12469 | case OP_SET1: | |
12470 | y=find_slot_in_env(sc,sc->envir,sc->code,1); | |
12471 | if (y != sc->NIL) { | |
12472 | set_slot_in_env(sc, y, sc->value); | |
12473 | return _s_return(sc,sc->value); | |
12474 | } else { | |
12475 | return _Error_1(sc,"set!: unbound variable:",sc->code); | |
12476 | } | |
12477 | ||
12478 | case OP_BEGIN: | |
12479 | if (!is_pair(sc->code)) { | |
12480 | return _s_return(sc,sc->code); | |
12481 | } | |
12482 | if (((sc->code)->_object._cons._cdr) != sc->NIL) { | |
12483 | s_save(sc,OP_BEGIN, sc->NIL, ((sc->code)->_object._cons._cdr)); | |
12484 | } | |
12485 | sc->code = ((sc->code)->_object._cons._car); | |
12486 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12487 | ||
12488 | case OP_IF0: | |
12489 | s_save(sc,OP_IF1, sc->NIL, ((sc->code)->_object._cons._cdr)); | |
12490 | sc->code = ((sc->code)->_object._cons._car); | |
12491 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12492 | ||
12493 | case OP_IF1: | |
12494 | if (((sc->value) != sc->F)) | |
12495 | sc->code = ((sc->code)->_object._cons._car); | |
12496 | else | |
12497 | sc->code = ((((sc->code)->_object._cons._cdr))->_object._cons._car); | |
12498 | ||
12499 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12500 | ||
12501 | case OP_LET0: | |
12502 | sc->args = sc->NIL; | |
12503 | sc->value = sc->code; | |
12504 | sc->code = is_symbol(((sc->code)->_object._cons._car)) ? ((((sc->code)->_object._cons._cdr))->_object._cons._car) : ((sc->code)->_object._cons._car); | |
12505 | do { sc->op = (int)(OP_LET1); return sc->T; } while (0); | |
12506 | ||
12507 | case OP_LET1: | |
12508 | sc->args = _cons(sc,sc->value,sc->args,0); | |
12509 | if (is_pair(sc->code)) { | |
12510 | s_save(sc,OP_LET1, sc->args, ((sc->code)->_object._cons._cdr)); | |
12511 | sc->code = ((((((sc->code)->_object._cons._car))->_object._cons._cdr))->_object._cons._car); | |
12512 | sc->args = sc->NIL; | |
12513 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12514 | } else { | |
12515 | sc->args = reverse_in_place(sc, sc->NIL, sc->args); | |
12516 | sc->code = ((sc->args)->_object._cons._car); | |
12517 | sc->args = ((sc->args)->_object._cons._cdr); | |
12518 | do { sc->op = (int)(OP_LET2); return sc->T; } while (0); | |
12519 | } | |
12520 | ||
12521 | case OP_LET2: | |
12522 | new_frame_in_env(sc, sc->envir); | |
12523 | for (x = is_symbol(((sc->code)->_object._cons._car)) ? ((((sc->code)->_object._cons._cdr))->_object._cons._car) : ((sc->code)->_object._cons._car), y = sc->args; | |
12524 | y != sc->NIL; x = ((x)->_object._cons._cdr), y = ((y)->_object._cons._cdr)) { | |
12525 | new_slot_in_env(sc, ((((x)->_object._cons._car))->_object._cons._car), ((y)->_object._cons._car)); | |
12526 | } | |
12527 | if (is_symbol(((sc->code)->_object._cons._car))) { | |
12528 | for (x = ((((sc->code)->_object._cons._cdr))->_object._cons._car), sc->args = sc->NIL; x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
12529 | ||
12530 | sc->args = _cons(sc,((((x)->_object._cons._car))->_object._cons._car),sc->args,0); | |
12531 | } | |
12532 | x = mk_closure(sc, _cons(sc,reverse_in_place(sc, sc->NIL, sc->args),((((sc->code)->_object._cons._cdr))->_object._cons._cdr),0), sc->envir); | |
12533 | new_slot_in_env(sc, ((sc->code)->_object._cons._car), x); | |
12534 | sc->code = ((((sc->code)->_object._cons._cdr))->_object._cons._cdr); | |
12535 | sc->args = sc->NIL; | |
12536 | } else { | |
12537 | sc->code = ((sc->code)->_object._cons._cdr); | |
12538 | sc->args = sc->NIL; | |
12539 | } | |
12540 | do { sc->op = (int)(OP_BEGIN); return sc->T; } while (0); | |
12541 | ||
12542 | case OP_LET0AST: | |
12543 | if (((sc->code)->_object._cons._car) == sc->NIL) { | |
12544 | new_frame_in_env(sc, sc->envir); | |
12545 | sc->code = ((sc->code)->_object._cons._cdr); | |
12546 | do { sc->op = (int)(OP_BEGIN); return sc->T; } while (0); | |
12547 | } | |
12548 | s_save(sc,OP_LET1AST, ((sc->code)->_object._cons._cdr), ((sc->code)->_object._cons._car)); | |
12549 | sc->code = ((((((((sc->code)->_object._cons._car))->_object._cons._car))->_object._cons._cdr))->_object._cons._car); | |
12550 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12551 | ||
12552 | case OP_LET1AST: | |
12553 | new_frame_in_env(sc, sc->envir); | |
12554 | do { sc->op = (int)(OP_LET2AST); return sc->T; } while (0); | |
12555 | ||
12556 | case OP_LET2AST: | |
12557 | new_slot_in_env(sc, ((((sc->code)->_object._cons._car))->_object._cons._car), sc->value); | |
12558 | sc->code = ((sc->code)->_object._cons._cdr); | |
12559 | if (is_pair(sc->code)) { | |
12560 | s_save(sc,OP_LET2AST, sc->args, sc->code); | |
12561 | sc->code = ((((((sc->code)->_object._cons._car))->_object._cons._cdr))->_object._cons._car); | |
12562 | sc->args = sc->NIL; | |
12563 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12564 | } else { | |
12565 | sc->code = sc->args; | |
12566 | sc->args = sc->NIL; | |
12567 | do { sc->op = (int)(OP_BEGIN); return sc->T; } while (0); | |
12568 | } | |
12569 | default: | |
12570 | sprintf(sc->strbuff, "%d: illegal operator", sc->op); | |
12571 | return _Error_1(sc,sc->strbuff,0); | |
12572 | } | |
12573 | return sc->T; | |
12574 | } | |
12575 | ||
12576 | static pointer opexe_1(scheme *sc, enum scheme_opcodes op) { | |
12577 | pointer x, y; | |
12578 | ||
12579 | switch (op) { | |
12580 | case OP_LET0REC: | |
12581 | new_frame_in_env(sc, sc->envir); | |
12582 | sc->args = sc->NIL; | |
12583 | sc->value = sc->code; | |
12584 | sc->code = ((sc->code)->_object._cons._car); | |
12585 | do { sc->op = (int)(OP_LET1REC); return sc->T; } while (0); | |
12586 | ||
12587 | case OP_LET1REC: | |
12588 | sc->args = _cons(sc,sc->value,sc->args,0); | |
12589 | if (is_pair(sc->code)) { | |
12590 | s_save(sc,OP_LET1REC, sc->args, ((sc->code)->_object._cons._cdr)); | |
12591 | sc->code = ((((((sc->code)->_object._cons._car))->_object._cons._cdr))->_object._cons._car); | |
12592 | sc->args = sc->NIL; | |
12593 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12594 | } else { | |
12595 | sc->args = reverse_in_place(sc, sc->NIL, sc->args); | |
12596 | sc->code = ((sc->args)->_object._cons._car); | |
12597 | sc->args = ((sc->args)->_object._cons._cdr); | |
12598 | do { sc->op = (int)(OP_LET2REC); return sc->T; } while (0); | |
12599 | } | |
12600 | ||
12601 | case OP_LET2REC: | |
12602 | for (x = ((sc->code)->_object._cons._car), y = sc->args; y != sc->NIL; x = ((x)->_object._cons._cdr), y = ((y)->_object._cons._cdr)) { | |
12603 | new_slot_in_env(sc, ((((x)->_object._cons._car))->_object._cons._car), ((y)->_object._cons._car)); | |
12604 | } | |
12605 | sc->code = ((sc->code)->_object._cons._cdr); | |
12606 | sc->args = sc->NIL; | |
12607 | do { sc->op = (int)(OP_BEGIN); return sc->T; } while (0); | |
12608 | ||
12609 | case OP_COND0: | |
12610 | if (!is_pair(sc->code)) { | |
12611 | return _Error_1(sc,"syntax error in cond",0); | |
12612 | } | |
12613 | s_save(sc,OP_COND1, sc->NIL, sc->code); | |
12614 | sc->code = ((((sc->code)->_object._cons._car))->_object._cons._car); | |
12615 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12616 | ||
12617 | case OP_COND1: | |
12618 | if (((sc->value) != sc->F)) { | |
12619 | if ((sc->code = ((((sc->code)->_object._cons._car))->_object._cons._cdr)) == sc->NIL) { | |
12620 | return _s_return(sc,sc->value); | |
12621 | } | |
12622 | if(((sc->code)->_object._cons._car)==sc->FEED_TO) { | |
12623 | if(!is_pair(((sc->code)->_object._cons._cdr))) { | |
12624 | return _Error_1(sc,"syntax error in cond",0); | |
12625 | } | |
12626 | x=_cons(sc,sc->QUOTE,_cons(sc,sc->value,sc->NIL,0),0); | |
12627 | sc->code=_cons(sc,((((sc->code)->_object._cons._cdr))->_object._cons._car),_cons(sc,x,sc->NIL,0),0); | |
12628 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12629 | } | |
12630 | do { sc->op = (int)(OP_BEGIN); return sc->T; } while (0); | |
12631 | } else { | |
12632 | if ((sc->code = ((sc->code)->_object._cons._cdr)) == sc->NIL) { | |
12633 | return _s_return(sc,sc->NIL); | |
12634 | } else { | |
12635 | s_save(sc,OP_COND1, sc->NIL, sc->code); | |
12636 | sc->code = ((((sc->code)->_object._cons._car))->_object._cons._car); | |
12637 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12638 | } | |
12639 | } | |
12640 | ||
12641 | case OP_DELAY: | |
12642 | x = mk_closure(sc, _cons(sc,sc->NIL,sc->code,0), sc->envir); | |
12643 | ((x)->_flag)=T_PROMISE; | |
12644 | return _s_return(sc,x); | |
12645 | ||
12646 | case OP_AND0: | |
12647 | if (sc->code == sc->NIL) { | |
12648 | return _s_return(sc,sc->T); | |
12649 | } | |
12650 | s_save(sc,OP_AND1, sc->NIL, ((sc->code)->_object._cons._cdr)); | |
12651 | sc->code = ((sc->code)->_object._cons._car); | |
12652 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12653 | ||
12654 | case OP_AND1: | |
12655 | if (((sc->value) == sc->F)) { | |
12656 | return _s_return(sc,sc->value); | |
12657 | } else if (sc->code == sc->NIL) { | |
12658 | return _s_return(sc,sc->value); | |
12659 | } else { | |
12660 | s_save(sc,OP_AND1, sc->NIL, ((sc->code)->_object._cons._cdr)); | |
12661 | sc->code = ((sc->code)->_object._cons._car); | |
12662 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12663 | } | |
12664 | ||
12665 | case OP_OR0: | |
12666 | if (sc->code == sc->NIL) { | |
12667 | return _s_return(sc,sc->F); | |
12668 | } | |
12669 | s_save(sc,OP_OR1, sc->NIL, ((sc->code)->_object._cons._cdr)); | |
12670 | sc->code = ((sc->code)->_object._cons._car); | |
12671 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12672 | ||
12673 | case OP_OR1: | |
12674 | if (((sc->value) != sc->F)) { | |
12675 | return _s_return(sc,sc->value); | |
12676 | } else if (sc->code == sc->NIL) { | |
12677 | return _s_return(sc,sc->value); | |
12678 | } else { | |
12679 | s_save(sc,OP_OR1, sc->NIL, ((sc->code)->_object._cons._cdr)); | |
12680 | sc->code = ((sc->code)->_object._cons._car); | |
12681 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12682 | } | |
12683 | ||
12684 | case OP_C0STREAM: | |
12685 | s_save(sc,OP_C1STREAM, sc->NIL, ((sc->code)->_object._cons._cdr)); | |
12686 | sc->code = ((sc->code)->_object._cons._car); | |
12687 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12688 | ||
12689 | case OP_C1STREAM: | |
12690 | sc->args = sc->value; | |
12691 | x = mk_closure(sc, _cons(sc,sc->NIL,sc->code,0), sc->envir); | |
12692 | ((x)->_flag)=T_PROMISE; | |
12693 | return _s_return(sc,_cons(sc,sc->args,x,0)); | |
12694 | ||
12695 | case OP_MACRO0: | |
12696 | if (is_pair(((sc->code)->_object._cons._car))) { | |
12697 | x = ((((sc->code)->_object._cons._car))->_object._cons._car); | |
12698 | sc->code = _cons(sc,sc->LAMBDA,_cons(sc,((((sc->code)->_object._cons._car))->_object._cons._cdr),((sc->code)->_object._cons._cdr),0),0); | |
12699 | } else { | |
12700 | x = ((sc->code)->_object._cons._car); | |
12701 | sc->code = ((((sc->code)->_object._cons._cdr))->_object._cons._car); | |
12702 | } | |
12703 | if (!is_symbol(x)) { | |
12704 | return _Error_1(sc,"variable is not a symbol",0); | |
12705 | } | |
12706 | s_save(sc,OP_MACRO1, sc->NIL, x); | |
12707 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12708 | ||
12709 | case OP_MACRO1: | |
12710 | ((sc->value)->_flag) = T_MACRO; | |
12711 | x = find_slot_in_env(sc, sc->envir, sc->code, 0); | |
12712 | if (x != sc->NIL) { | |
12713 | set_slot_in_env(sc, x, sc->value); | |
12714 | } else { | |
12715 | new_slot_in_env(sc, sc->code, sc->value); | |
12716 | } | |
12717 | return _s_return(sc,sc->code); | |
12718 | ||
12719 | case OP_CASE0: | |
12720 | s_save(sc,OP_CASE1, sc->NIL, ((sc->code)->_object._cons._cdr)); | |
12721 | sc->code = ((sc->code)->_object._cons._car); | |
12722 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12723 | ||
12724 | case OP_CASE1: | |
12725 | for (x = sc->code; x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
12726 | if (!is_pair(y = ((((x)->_object._cons._car))->_object._cons._car))) { | |
12727 | break; | |
12728 | } | |
12729 | for ( ; y != sc->NIL; y = ((y)->_object._cons._cdr)) { | |
12730 | if (eqv(((y)->_object._cons._car), sc->value)) { | |
12731 | break; | |
12732 | } | |
12733 | } | |
12734 | if (y != sc->NIL) { | |
12735 | break; | |
12736 | } | |
12737 | } | |
12738 | if (x != sc->NIL) { | |
12739 | if (is_pair(((((x)->_object._cons._car))->_object._cons._car))) { | |
12740 | sc->code = ((((x)->_object._cons._car))->_object._cons._cdr); | |
12741 | do { sc->op = (int)(OP_BEGIN); return sc->T; } while (0); | |
12742 | } else { | |
12743 | s_save(sc,OP_CASE2, sc->NIL, ((((x)->_object._cons._car))->_object._cons._cdr)); | |
12744 | sc->code = ((((x)->_object._cons._car))->_object._cons._car); | |
12745 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12746 | } | |
12747 | } else { | |
12748 | return _s_return(sc,sc->NIL); | |
12749 | } | |
12750 | ||
12751 | case OP_CASE2: | |
12752 | if (((sc->value) != sc->F)) { | |
12753 | do { sc->op = (int)(OP_BEGIN); return sc->T; } while (0); | |
12754 | } else { | |
12755 | return _s_return(sc,sc->NIL); | |
12756 | } | |
12757 | ||
12758 | case OP_PAPPLY: | |
12759 | sc->code = ((sc->args)->_object._cons._car); | |
12760 | sc->args = list_star(sc,((sc->args)->_object._cons._cdr)); | |
12761 | ||
12762 | do { sc->op = (int)(OP_APPLY); return sc->T; } while (0); | |
12763 | ||
12764 | case OP_PEVAL: | |
12765 | if(((sc->args)->_object._cons._cdr)!=sc->NIL) { | |
12766 | sc->envir=((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
12767 | } | |
12768 | sc->code = ((sc->args)->_object._cons._car); | |
12769 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
12770 | ||
12771 | case OP_CONTINUATION: | |
12772 | sc->code = ((sc->args)->_object._cons._car); | |
12773 | sc->args = _cons(sc,mk_continuation(sc, sc->dump),sc->NIL,0); | |
12774 | do { sc->op = (int)(OP_APPLY); return sc->T; } while (0); | |
12775 | ||
12776 | default: | |
12777 | sprintf(sc->strbuff, "%d: illegal operator", sc->op); | |
12778 | return _Error_1(sc,sc->strbuff,0); | |
12779 | } | |
12780 | return sc->T; | |
12781 | } | |
12782 | ||
12783 | static pointer opexe_2(scheme *sc, enum scheme_opcodes op) { | |
12784 | pointer x; | |
12785 | num v; | |
12786 | ||
12787 | double dd; | |
12788 | ||
12789 | ||
12790 | switch (op) { | |
12791 | ||
12792 | case OP_INEX2EX: | |
12793 | x=((sc->args)->_object._cons._car); | |
12794 | if(is_integer(x)) { | |
12795 | return _s_return(sc,x); | |
12796 | } else if(modf(((x)->_object._number.value.rvalue),&dd)==0.0) { | |
12797 | return _s_return(sc,mk_integer(sc,ivalue(x))); | |
12798 | } else { | |
12799 | return _Error_1(sc,"inexact->exact: not integral:",x); | |
12800 | } | |
12801 | ||
12802 | case OP_EXP: | |
12803 | x=((sc->args)->_object._cons._car); | |
12804 | return _s_return(sc,mk_real(sc, exp(rvalue(x)))); | |
12805 | ||
12806 | case OP_LOG: | |
12807 | x=((sc->args)->_object._cons._car); | |
12808 | return _s_return(sc,mk_real(sc, log(rvalue(x)))); | |
12809 | ||
12810 | case OP_SIN: | |
12811 | x=((sc->args)->_object._cons._car); | |
12812 | return _s_return(sc,mk_real(sc, sin(rvalue(x)))); | |
12813 | ||
12814 | case OP_COS: | |
12815 | x=((sc->args)->_object._cons._car); | |
12816 | return _s_return(sc,mk_real(sc, cos(rvalue(x)))); | |
12817 | ||
12818 | case OP_TAN: | |
12819 | x=((sc->args)->_object._cons._car); | |
12820 | return _s_return(sc,mk_real(sc, tan(rvalue(x)))); | |
12821 | ||
12822 | case OP_ASIN: | |
12823 | x=((sc->args)->_object._cons._car); | |
12824 | return _s_return(sc,mk_real(sc, asin(rvalue(x)))); | |
12825 | ||
12826 | case OP_ACOS: | |
12827 | x=((sc->args)->_object._cons._car); | |
12828 | return _s_return(sc,mk_real(sc, acos(rvalue(x)))); | |
12829 | ||
12830 | case OP_ATAN: | |
12831 | x=((sc->args)->_object._cons._car); | |
12832 | if(((sc->args)->_object._cons._cdr)==sc->NIL) { | |
12833 | return _s_return(sc,mk_real(sc, atan(rvalue(x)))); | |
12834 | } else { | |
12835 | pointer y=((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
12836 | return _s_return(sc,mk_real(sc, atan2(rvalue(x),rvalue(y)))); | |
12837 | } | |
12838 | ||
12839 | case OP_SQRT: | |
12840 | x=((sc->args)->_object._cons._car); | |
12841 | return _s_return(sc,mk_real(sc, sqrt(rvalue(x)))); | |
12842 | ||
12843 | case OP_EXPT: | |
12844 | x=((sc->args)->_object._cons._car); | |
12845 | if(((sc->args)->_object._cons._cdr)==sc->NIL) { | |
12846 | return _Error_1(sc,"expt: needs two arguments",0); | |
12847 | } else { | |
12848 | pointer y=((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
12849 | return _s_return(sc,mk_real(sc, pow(rvalue(x),rvalue(y)))); | |
12850 | } | |
12851 | ||
12852 | case OP_FLOOR: | |
12853 | x=((sc->args)->_object._cons._car); | |
12854 | return _s_return(sc,mk_real(sc, floor(rvalue(x)))); | |
12855 | ||
12856 | case OP_CEILING: | |
12857 | x=((sc->args)->_object._cons._car); | |
12858 | return _s_return(sc,mk_real(sc, ceil(rvalue(x)))); | |
12859 | ||
12860 | case OP_TRUNCATE : { | |
12861 | double rvalue_of_x ; | |
12862 | x=((sc->args)->_object._cons._car); | |
12863 | rvalue_of_x = rvalue(x) ; | |
12864 | if (rvalue_of_x > 0) { | |
12865 | return _s_return(sc,mk_real(sc, floor(rvalue_of_x))); | |
12866 | } else { | |
12867 | return _s_return(sc,mk_real(sc, ceil(rvalue_of_x))); | |
12868 | } | |
12869 | } | |
12870 | ||
12871 | case OP_ROUND: | |
12872 | x=((sc->args)->_object._cons._car); | |
12873 | return _s_return(sc,mk_real(sc, round_per_R5RS(rvalue(x)))); | |
12874 | ||
12875 | ||
12876 | case OP_ADD: | |
12877 | v=num_zero; | |
12878 | for (x = sc->args; x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
12879 | v=num_add(v,nvalue(((x)->_object._cons._car))); | |
12880 | } | |
12881 | return _s_return(sc,mk_number(sc, v)); | |
12882 | ||
12883 | case OP_MUL: | |
12884 | v=num_one; | |
12885 | for (x = sc->args; x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
12886 | v=num_mul(v,nvalue(((x)->_object._cons._car))); | |
12887 | } | |
12888 | return _s_return(sc,mk_number(sc, v)); | |
12889 | ||
12890 | case OP_SUB: | |
12891 | if(((sc->args)->_object._cons._cdr)==sc->NIL) { | |
12892 | x=sc->args; | |
12893 | v=num_zero; | |
12894 | } else { | |
12895 | x = ((sc->args)->_object._cons._cdr); | |
12896 | v = nvalue(((sc->args)->_object._cons._car)); | |
12897 | } | |
12898 | for (; x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
12899 | v=num_sub(v,nvalue(((x)->_object._cons._car))); | |
12900 | } | |
12901 | return _s_return(sc,mk_number(sc, v)); | |
12902 | ||
12903 | case OP_DIV: | |
12904 | if(((sc->args)->_object._cons._cdr)==sc->NIL) { | |
12905 | x=sc->args; | |
12906 | v=num_one; | |
12907 | } else { | |
12908 | x = ((sc->args)->_object._cons._cdr); | |
12909 | v = nvalue(((sc->args)->_object._cons._car)); | |
12910 | } | |
12911 | for (; x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
12912 | if (!is_zero_double(rvalue(((x)->_object._cons._car)))) | |
12913 | v=num_div(v,nvalue(((x)->_object._cons._car))); | |
12914 | else { | |
12915 | return _Error_1(sc,"/: division by zero",0); | |
12916 | } | |
12917 | } | |
12918 | return _s_return(sc,mk_number(sc, v)); | |
12919 | ||
12920 | case OP_INTDIV: | |
12921 | if(((sc->args)->_object._cons._cdr)==sc->NIL) { | |
12922 | x=sc->args; | |
12923 | v=num_one; | |
12924 | } else { | |
12925 | x = ((sc->args)->_object._cons._cdr); | |
12926 | v = nvalue(((sc->args)->_object._cons._car)); | |
12927 | } | |
12928 | for (; x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
12929 | if (ivalue(((x)->_object._cons._car)) != 0) | |
12930 | v=num_intdiv(v,nvalue(((x)->_object._cons._car))); | |
12931 | else { | |
12932 | return _Error_1(sc,"quotient: division by zero",0); | |
12933 | } | |
12934 | } | |
12935 | return _s_return(sc,mk_number(sc, v)); | |
12936 | ||
12937 | case OP_REM: | |
12938 | v = nvalue(((sc->args)->_object._cons._car)); | |
12939 | if (ivalue(((((sc->args)->_object._cons._cdr))->_object._cons._car)) != 0) | |
12940 | v=num_rem(v,nvalue(((((sc->args)->_object._cons._cdr))->_object._cons._car))); | |
12941 | else { | |
12942 | return _Error_1(sc,"remainder: division by zero",0); | |
12943 | } | |
12944 | return _s_return(sc,mk_number(sc, v)); | |
12945 | ||
12946 | case OP_MOD: | |
12947 | v = nvalue(((sc->args)->_object._cons._car)); | |
12948 | if (ivalue(((((sc->args)->_object._cons._cdr))->_object._cons._car)) != 0) | |
12949 | v=num_mod(v,nvalue(((((sc->args)->_object._cons._cdr))->_object._cons._car))); | |
12950 | else { | |
12951 | return _Error_1(sc,"modulo: division by zero",0); | |
12952 | } | |
12953 | return _s_return(sc,mk_number(sc, v)); | |
12954 | ||
12955 | case OP_CAR: | |
12956 | return _s_return(sc,((((sc->args)->_object._cons._car))->_object._cons._car)); | |
12957 | ||
12958 | case OP_CDR: | |
12959 | return _s_return(sc,((((sc->args)->_object._cons._car))->_object._cons._cdr)); | |
12960 | ||
12961 | case OP_CONS: | |
12962 | ((sc->args)->_object._cons._cdr) = ((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
12963 | return _s_return(sc,sc->args); | |
12964 | ||
12965 | case OP_SETCAR: | |
12966 | if(!is_immutable(((sc->args)->_object._cons._car))) { | |
12967 | ((((sc->args)->_object._cons._car))->_object._cons._car) = ((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
12968 | return _s_return(sc,((sc->args)->_object._cons._car)); | |
12969 | } else { | |
12970 | return _Error_1(sc,"set-car!: unable to alter immutable pair",0); | |
12971 | } | |
12972 | ||
12973 | case OP_SETCDR: | |
12974 | if(!is_immutable(((sc->args)->_object._cons._car))) { | |
12975 | ((((sc->args)->_object._cons._car))->_object._cons._cdr) = ((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
12976 | return _s_return(sc,((sc->args)->_object._cons._car)); | |
12977 | } else { | |
12978 | return _Error_1(sc,"set-cdr!: unable to alter immutable pair",0); | |
12979 | } | |
12980 | ||
12981 | case OP_CHAR2INT: { | |
12982 | gunichar c; | |
12983 | c=ivalue(((sc->args)->_object._cons._car)); | |
12984 | return _s_return(sc,mk_integer(sc,c)); | |
12985 | } | |
12986 | ||
12987 | case OP_INT2CHAR: { | |
12988 | gunichar c; | |
12989 | c=(gunichar)ivalue(((sc->args)->_object._cons._car)); | |
12990 | return _s_return(sc,mk_character(sc,c)); | |
12991 | } | |
12992 | ||
12993 | case OP_CHARUPCASE: { | |
12994 | gunichar c; | |
12995 | c=(gunichar)ivalue(((sc->args)->_object._cons._car)); | |
12996 | c=g_unichar_toupper(c); | |
12997 | return _s_return(sc,mk_character(sc,c)); | |
12998 | } | |
12999 | ||
13000 | case OP_CHARDNCASE: { | |
13001 | gunichar c; | |
13002 | c=(gunichar)ivalue(((sc->args)->_object._cons._car)); | |
13003 | c=g_unichar_tolower(c); | |
13004 | return _s_return(sc,mk_character(sc,c)); | |
13005 | } | |
13006 | ||
13007 | case OP_STR2SYM: | |
13008 | return _s_return(sc,mk_symbol(sc,((((sc->args)->_object._cons._car))->_object._string._svalue))); | |
13009 | ||
13010 | case OP_STR2ATOM: { | |
13011 | char *s=((((sc->args)->_object._cons._car))->_object._string._svalue); | |
13012 | if(*s=='#') { | |
13013 | return _s_return(sc,mk_sharp_const(sc, s+1)); | |
13014 | } else { | |
13015 | return _s_return(sc,mk_atom(sc, s)); | |
13016 | } | |
13017 | } | |
13018 | ||
13019 | case OP_SYM2STR: | |
13020 | x=mk_string(sc,symname(((sc->args)->_object._cons._car))); | |
13021 | setimmutable(x); | |
13022 | return _s_return(sc,x); | |
13023 | case OP_ATOM2STR: | |
13024 | x=((sc->args)->_object._cons._car); | |
13025 | if(is_number(x) || is_character(x) || is_string(x) || is_symbol(x)) { | |
13026 | char *p; | |
13027 | int len; | |
13028 | atom2str(sc,x,0,&p,&len); | |
13029 | return _s_return(sc,mk_counted_string(sc,p,len)); | |
13030 | } else { | |
13031 | return _Error_1(sc,"atom->string: not an atom:",x); | |
13032 | } | |
13033 | ||
13034 | case OP_MKSTRING: { | |
13035 | gunichar fill=' '; | |
13036 | int len; | |
13037 | ||
13038 | len=ivalue(((sc->args)->_object._cons._car)); | |
13039 | ||
13040 | if(((sc->args)->_object._cons._cdr)!=sc->NIL) { | |
13041 | fill=charvalue(((((sc->args)->_object._cons._cdr))->_object._cons._car)); | |
13042 | } | |
13043 | return _s_return(sc,mk_empty_string(sc,len,fill)); | |
13044 | } | |
13045 | ||
13046 | case OP_STRLEN: | |
13047 | return _s_return(sc,mk_integer(sc,g_utf8_strlen(((((sc->args)->_object._cons._car))->_object._string._svalue), -1))); | |
13048 | ||
13049 | case OP_STRREF: { | |
13050 | char *str; | |
13051 | int index; | |
13052 | ||
13053 | str=((((sc->args)->_object._cons._car))->_object._string._svalue); | |
13054 | ||
13055 | index=ivalue(((((sc->args)->_object._cons._cdr))->_object._cons._car)); | |
13056 | ||
13057 | if(index>=g_utf8_strlen(((((sc->args)->_object._cons._car))->_object._string._svalue), -1)) { | |
13058 | return _Error_1(sc,"string-ref: out of bounds:",((((sc->args)->_object._cons._cdr))->_object._cons._car)); | |
13059 | } | |
13060 | ||
13061 | str = g_utf8_offset_to_pointer(str, (long)index); | |
13062 | return _s_return(sc,mk_character(sc, g_utf8_get_char(str))); | |
13063 | } | |
13064 | ||
13065 | case OP_STRSET: { | |
13066 | pointer a; | |
13067 | char *str; | |
13068 | int index; | |
13069 | gunichar c; | |
13070 | char utf8[7]; | |
13071 | int utf8_len; | |
13072 | int newlen; | |
13073 | char *p1, *p2; | |
13074 | int p1_len; | |
13075 | int p2_len; | |
13076 | char *newstr; | |
13077 | ||
13078 | a=((sc->args)->_object._cons._car); | |
13079 | if(is_immutable(a)) { | |
13080 | return _Error_1(sc,"string-set!: unable to alter immutable string:",a); | |
13081 | } | |
13082 | ||
13083 | str=((a)->_object._string._svalue); | |
13084 | index=ivalue(((((sc->args)->_object._cons._cdr))->_object._cons._car)); | |
13085 | if(index>=g_utf8_strlen(str, -1)) { | |
13086 | return _Error_1(sc,"string-set!: out of bounds:",((((sc->args)->_object._cons._cdr))->_object._cons._car)); | |
13087 | } | |
13088 | ||
13089 | c=charvalue(((((((sc->args)->_object._cons._cdr))->_object._cons._cdr))->_object._cons._car)); | |
13090 | utf8_len = g_unichar_to_utf8(c, utf8); | |
13091 | ||
13092 | p1 = g_utf8_offset_to_pointer(str, (long)index); | |
13093 | p2 = g_utf8_offset_to_pointer(str, (long)index+1); | |
13094 | p1_len = p1-str; | |
13095 | p2_len = strlen(p2); | |
13096 | ||
13097 | newlen = p1_len+utf8_len+p2_len; | |
13098 | newstr = (char *)sc->malloc(newlen+1); | |
13099 | if (newstr == ((void *)0)) { | |
13100 | sc->no_memory=1; | |
13101 | return _Error_1(sc,"string-set!: No memory to alter string:",((sc->args)->_object._cons._car)); | |
13102 | } | |
13103 | ||
13104 | if (p1_len > 0) | |
13105 | memcpy(newstr, str, p1_len); | |
13106 | memcpy(newstr+p1_len, utf8, utf8_len); | |
13107 | if (p2_len > 0) | |
13108 | memcpy(newstr+p1_len+utf8_len, p2, p2_len); | |
13109 | newstr[newlen] = '\0'; | |
13110 | ||
13111 | free(((a)->_object._string._svalue)); | |
13112 | ((a)->_object._string._svalue)=newstr; | |
13113 | ((a)->_object._string._length)=newlen; | |
13114 | ||
13115 | return _s_return(sc,a); | |
13116 | } | |
13117 | ||
13118 | case OP_STRAPPEND: { | |
13119 | ||
13120 | int len = 0; | |
13121 | pointer newstr; | |
13122 | pointer car_x; | |
13123 | char *pos; | |
13124 | ||
13125 | ||
13126 | for (x = sc->args; x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
13127 | len += ((((x)->_object._cons._car))->_object._string._length); | |
13128 | } | |
13129 | newstr = mk_empty_string(sc, len, ' '); | |
13130 | ||
13131 | pos = ((newstr)->_object._string._svalue); | |
13132 | for (x = sc->args; x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
13133 | car_x = ((x)->_object._cons._car); | |
13134 | memcpy(pos, ((car_x)->_object._string._svalue), ((car_x)->_object._string._length)); | |
13135 | pos += ((car_x)->_object._string._length); | |
13136 | } | |
13137 | *pos = '\0'; | |
13138 | return _s_return(sc,newstr); | |
13139 | } | |
13140 | ||
13141 | case OP_SUBSTR: { | |
13142 | char *str; | |
13143 | char *beg; | |
13144 | char *end; | |
13145 | int index0; | |
13146 | int index1; | |
13147 | int len; | |
13148 | pointer x; | |
13149 | ||
13150 | str=((((sc->args)->_object._cons._car))->_object._string._svalue); | |
13151 | ||
13152 | index0=ivalue(((((sc->args)->_object._cons._cdr))->_object._cons._car)); | |
13153 | ||
13154 | if(index0>g_utf8_strlen(str, -1)) { | |
13155 | return _Error_1(sc,"substring: start out of bounds:",((((sc->args)->_object._cons._cdr))->_object._cons._car)); | |
13156 | } | |
13157 | ||
13158 | if(((((sc->args)->_object._cons._cdr))->_object._cons._cdr)!=sc->NIL) { | |
13159 | index1=ivalue(((((((sc->args)->_object._cons._cdr))->_object._cons._cdr))->_object._cons._car)); | |
13160 | if(index1>g_utf8_strlen(str, -1) || index1<index0) { | |
13161 | return _Error_1(sc,"substring: end out of bounds:",((((((sc->args)->_object._cons._cdr))->_object._cons._cdr))->_object._cons._car)); | |
13162 | } | |
13163 | } else { | |
13164 | index1=g_utf8_strlen(str, -1); | |
13165 | } | |
13166 | ||
13167 | beg = g_utf8_offset_to_pointer(str, (long)index0); | |
13168 | end = g_utf8_offset_to_pointer(str, (long)index1); | |
13169 | len=end-beg; | |
13170 | x=mk_empty_string(sc,len,' '); | |
13171 | memcpy(((x)->_object._string._svalue),beg,len); | |
13172 | ((x)->_object._string._svalue)[len] = '\0'; | |
13173 | ||
13174 | return _s_return(sc,x); | |
13175 | } | |
13176 | ||
13177 | case OP_VECTOR: { | |
13178 | int i; | |
13179 | pointer vec; | |
13180 | int len=list_length(sc,sc->args); | |
13181 | if(len<0) { | |
13182 | return _Error_1(sc,"vector: not a proper list:",sc->args); | |
13183 | } | |
13184 | vec=mk_vector(sc,len); | |
13185 | for (x = sc->args, i = 0; is_pair(x); x = ((x)->_object._cons._cdr), i++) { | |
13186 | set_vector_elem(vec,i,((x)->_object._cons._car)); | |
13187 | } | |
13188 | return _s_return(sc,vec); | |
13189 | } | |
13190 | ||
13191 | case OP_MKVECTOR: { | |
13192 | pointer fill=sc->NIL; | |
13193 | int len; | |
13194 | pointer vec; | |
13195 | ||
13196 | len=ivalue(((sc->args)->_object._cons._car)); | |
13197 | ||
13198 | if(((sc->args)->_object._cons._cdr)!=sc->NIL) { | |
13199 | fill=((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
13200 | } | |
13201 | vec=mk_vector(sc,len); | |
13202 | if(fill!=sc->NIL) { | |
13203 | fill_vector(vec,fill); | |
13204 | } | |
13205 | return _s_return(sc,vec); | |
13206 | } | |
13207 | ||
13208 | case OP_VECLEN: | |
13209 | return _s_return(sc,mk_integer(sc,ivalue(((sc->args)->_object._cons._car)))); | |
13210 | ||
13211 | case OP_VECREF: { | |
13212 | int index; | |
13213 | ||
13214 | index=ivalue(((((sc->args)->_object._cons._cdr))->_object._cons._car)); | |
13215 | ||
13216 | if(index>=ivalue(((sc->args)->_object._cons._car))) { | |
13217 | return _Error_1(sc,"vector-ref: out of bounds:",((((sc->args)->_object._cons._cdr))->_object._cons._car)); | |
13218 | } | |
13219 | ||
13220 | return _s_return(sc,vector_elem(((sc->args)->_object._cons._car),index)); | |
13221 | } | |
13222 | ||
13223 | case OP_VECSET: { | |
13224 | int index; | |
13225 | ||
13226 | if(is_immutable(((sc->args)->_object._cons._car))) { | |
13227 | return _Error_1(sc,"vector-set!: unable to alter immutable vector:",((sc->args)->_object._cons._car)); | |
13228 | } | |
13229 | ||
13230 | index=ivalue(((((sc->args)->_object._cons._cdr))->_object._cons._car)); | |
13231 | if(index>=ivalue(((sc->args)->_object._cons._car))) { | |
13232 | return _Error_1(sc,"vector-set!: out of bounds:",((((sc->args)->_object._cons._cdr))->_object._cons._car)); | |
13233 | } | |
13234 | ||
13235 | set_vector_elem(((sc->args)->_object._cons._car),index,((((((sc->args)->_object._cons._cdr))->_object._cons._cdr))->_object._cons._car)); | |
13236 | return _s_return(sc,((sc->args)->_object._cons._car)); | |
13237 | } | |
13238 | ||
13239 | default: | |
13240 | sprintf(sc->strbuff, "%d: illegal operator", sc->op); | |
13241 | return _Error_1(sc,sc->strbuff,0); | |
13242 | } | |
13243 | return sc->T; | |
13244 | } | |
13245 | ||
13246 | static int is_list(scheme *sc, pointer a) { | |
13247 | pointer slow, fast; | |
13248 | ||
13249 | slow = fast = a; | |
13250 | while (1) | |
13251 | { | |
13252 | if (fast == sc->NIL) | |
13253 | return 1; | |
13254 | if (!is_pair(fast)) | |
13255 | return 0; | |
13256 | fast = ((fast)->_object._cons._cdr); | |
13257 | if (fast == sc->NIL) | |
13258 | return 1; | |
13259 | if (!is_pair(fast)) | |
13260 | return 0; | |
13261 | fast = ((fast)->_object._cons._cdr); | |
13262 | ||
13263 | slow = ((slow)->_object._cons._cdr); | |
13264 | if (fast == slow) | |
13265 | { | |
13266 | ||
13267 | ||
13268 | ||
13269 | return 0; | |
13270 | } | |
13271 | } | |
13272 | } | |
13273 | ||
13274 | static int list_length(scheme *sc, pointer a) { | |
13275 | int i=0; | |
13276 | pointer slow, fast; | |
13277 | ||
13278 | slow = fast = a; | |
13279 | while (1) | |
13280 | { | |
13281 | if (fast == sc->NIL) | |
13282 | return i; | |
13283 | if (!is_pair(fast)) | |
13284 | return i; | |
13285 | fast = ((fast)->_object._cons._cdr); | |
13286 | ++i; | |
13287 | if (fast == sc->NIL) | |
13288 | return i; | |
13289 | if (!is_pair(fast)) | |
13290 | return i; | |
13291 | ++i; | |
13292 | fast = ((fast)->_object._cons._cdr); | |
13293 | ||
13294 | slow = ((slow)->_object._cons._cdr); | |
13295 | if (fast == slow) | |
13296 | { | |
13297 | ||
13298 | ||
13299 | ||
13300 | return -1; | |
13301 | } | |
13302 | } | |
13303 | } | |
13304 | ||
13305 | static pointer opexe_3(scheme *sc, enum scheme_opcodes op) { | |
13306 | pointer x; | |
13307 | num v; | |
13308 | int (*comp_func)(num,num)=0; | |
13309 | ||
13310 | switch (op) { | |
13311 | case OP_NOT: | |
13312 | return _s_return(sc,(((((sc->args)->_object._cons._car)) == sc->F)) ? sc->T : sc->F); | |
13313 | case OP_BOOLP: | |
13314 | return _s_return(sc,(((sc->args)->_object._cons._car) == sc->F || ((sc->args)->_object._cons._car) == sc->T) ? sc->T : sc->F); | |
13315 | case OP_EOFOBJP: | |
13316 | return _s_return(sc,(((sc->args)->_object._cons._car) == sc->EOF_OBJ) ? sc->T : sc->F); | |
13317 | case OP_NULLP: | |
13318 | return _s_return(sc,(((sc->args)->_object._cons._car) == sc->NIL) ? sc->T : sc->F); | |
13319 | case OP_NUMEQ: | |
13320 | case OP_LESS: | |
13321 | case OP_GRE: | |
13322 | case OP_LEQ: | |
13323 | case OP_GEQ: | |
13324 | switch(op) { | |
13325 | case OP_NUMEQ: comp_func=num_eq; break; | |
13326 | case OP_LESS: comp_func=num_lt; break; | |
13327 | case OP_GRE: comp_func=num_gt; break; | |
13328 | case OP_LEQ: comp_func=num_le; break; | |
13329 | case OP_GEQ: comp_func=num_ge; break; | |
13330 | default: break; | |
13331 | } | |
13332 | x=sc->args; | |
13333 | v=nvalue(((x)->_object._cons._car)); | |
13334 | x=((x)->_object._cons._cdr); | |
13335 | ||
13336 | for (; x != sc->NIL; x = ((x)->_object._cons._cdr)) { | |
13337 | if(!comp_func(v,nvalue(((x)->_object._cons._car)))) { | |
13338 | return _s_return(sc,(0) ? sc->T : sc->F); | |
13339 | } | |
13340 | v=nvalue(((x)->_object._cons._car)); | |
13341 | } | |
13342 | return _s_return(sc,(1) ? sc->T : sc->F); | |
13343 | case OP_SYMBOLP: | |
13344 | return _s_return(sc,(is_symbol(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13345 | case OP_NUMBERP: | |
13346 | return _s_return(sc,(is_number(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13347 | case OP_STRINGP: | |
13348 | return _s_return(sc,(is_string(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13349 | case OP_INTEGERP: | |
13350 | return _s_return(sc,(is_integer(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13351 | case OP_REALP: | |
13352 | return _s_return(sc,(is_number(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13353 | case OP_CHARP: | |
13354 | return _s_return(sc,(is_character(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13355 | ||
13356 | case OP_CHARAP: | |
13357 | return _s_return(sc,(Cisalpha(ivalue(((sc->args)->_object._cons._car)))) ? sc->T : sc->F); | |
13358 | case OP_CHARNP: | |
13359 | return _s_return(sc,(Cisdigit(ivalue(((sc->args)->_object._cons._car)))) ? sc->T : sc->F); | |
13360 | case OP_CHARWP: | |
13361 | return _s_return(sc,(Cisspace(ivalue(((sc->args)->_object._cons._car)))) ? sc->T : sc->F); | |
13362 | case OP_CHARUP: | |
13363 | return _s_return(sc,(Cisupper(ivalue(((sc->args)->_object._cons._car)))) ? sc->T : sc->F); | |
13364 | case OP_CHARLP: | |
13365 | return _s_return(sc,(Cislower(ivalue(((sc->args)->_object._cons._car)))) ? sc->T : sc->F); | |
13366 | ||
13367 | case OP_PORTP: | |
13368 | return _s_return(sc,(is_port(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13369 | case OP_INPORTP: | |
13370 | return _s_return(sc,(((((((sc->args)->_object._cons._car))->_flag)&31)==T_PORT && ((sc->args)->_object._cons._car)->_object._port->kind&port_input)) ? sc->T : sc->F); | |
13371 | case OP_OUTPORTP: | |
13372 | return _s_return(sc,(((((((sc->args)->_object._cons._car))->_flag)&31)==T_PORT && ((sc->args)->_object._cons._car)->_object._port->kind&port_output)) ? sc->T : sc->F); | |
13373 | case OP_PROCP: | |
13374 | ||
13375 | ||
13376 | ||
13377 | ||
13378 | ||
13379 | return _s_return(sc,(is_proc(((sc->args)->_object._cons._car)) || is_closure(((sc->args)->_object._cons._car)) || is_continuation(((sc->args)->_object._cons._car)) || is_foreign(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13380 | ||
13381 | case OP_PAIRP: | |
13382 | return _s_return(sc,(is_pair(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13383 | case OP_LISTP: | |
13384 | return _s_return(sc,(is_list(sc, ((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13385 | case OP_ENVP: | |
13386 | return _s_return(sc,(is_environment(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13387 | case OP_VECTORP: | |
13388 | return _s_return(sc,(is_vector(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13389 | case OP_EQ: | |
13390 | return _s_return(sc,(((sc->args)->_object._cons._car) == ((((sc->args)->_object._cons._cdr))->_object._cons._car)) ? sc->T : sc->F); | |
13391 | case OP_EQV: | |
13392 | return _s_return(sc,(eqv(((sc->args)->_object._cons._car), ((((sc->args)->_object._cons._cdr))->_object._cons._car))) ? sc->T : sc->F); | |
13393 | default: | |
13394 | sprintf(sc->strbuff, "%d: illegal operator", sc->op); | |
13395 | return _Error_1(sc,sc->strbuff,0); | |
13396 | } | |
13397 | return sc->T; | |
13398 | } | |
13399 | ||
13400 | static pointer opexe_4(scheme *sc, enum scheme_opcodes op) { | |
13401 | pointer x, y; | |
13402 | ||
13403 | switch (op) { | |
13404 | case OP_FORCE: | |
13405 | sc->code = ((sc->args)->_object._cons._car); | |
13406 | if (is_promise(sc->code)) { | |
13407 | ||
13408 | s_save(sc, OP_SAVE_FORCED, sc->NIL, sc->code); | |
13409 | sc->args = sc->NIL; | |
13410 | do { sc->op = (int)(OP_APPLY); return sc->T; } while (0); | |
13411 | } else { | |
13412 | return _s_return(sc,sc->code); | |
13413 | } | |
13414 | ||
13415 | case OP_SAVE_FORCED: | |
13416 | memcpy(sc->code,sc->value,sizeof(struct cell)); | |
13417 | return _s_return(sc,sc->value); | |
13418 | ||
13419 | case OP_WRITE: | |
13420 | case OP_DISPLAY: | |
13421 | case OP_WRITE_CHAR: | |
13422 | if(is_pair(((sc->args)->_object._cons._cdr))) { | |
13423 | if(((((sc->args)->_object._cons._cdr))->_object._cons._car)!=sc->outport) { | |
13424 | x=_cons(sc,sc->outport,sc->NIL,0); | |
13425 | s_save(sc,OP_SET_OUTPORT, x, sc->NIL); | |
13426 | sc->outport=((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
13427 | } | |
13428 | } | |
13429 | sc->args = ((sc->args)->_object._cons._car); | |
13430 | if(op==OP_WRITE) { | |
13431 | sc->print_flag = 1; | |
13432 | } else { | |
13433 | sc->print_flag = 0; | |
13434 | } | |
13435 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
13436 | ||
13437 | case OP_NEWLINE: | |
13438 | if(is_pair(sc->args)) { | |
13439 | if(((sc->args)->_object._cons._car)!=sc->outport) { | |
13440 | x=_cons(sc,sc->outport,sc->NIL,0); | |
13441 | s_save(sc,OP_SET_OUTPORT, x, sc->NIL); | |
13442 | sc->outport=((sc->args)->_object._cons._car); | |
13443 | } | |
13444 | } | |
13445 | putstr(sc, "\n"); | |
13446 | return _s_return(sc,sc->T); | |
13447 | ||
13448 | case OP_ERR0: | |
13449 | sc->retcode=-1; | |
13450 | if (!is_string(((sc->args)->_object._cons._car))) { | |
13451 | sc->args=_cons(sc,mk_string(sc," -- "),sc->args,0); | |
13452 | setimmutable(((sc->args)->_object._cons._car)); | |
13453 | } | |
13454 | if (sc->print_error == 0) | |
13455 | sc->linebuff[0] = '\0'; | |
13456 | sc->print_error = 1; | |
13457 | putstr(sc, "Error: "); | |
13458 | putstr(sc, ((((sc->args)->_object._cons._car))->_object._string._svalue)); | |
13459 | sc->args = ((sc->args)->_object._cons._cdr); | |
13460 | do { sc->op = (int)(OP_ERR1); return sc->T; } while (0); | |
13461 | ||
13462 | case OP_ERR1: | |
13463 | putstr(sc, " "); | |
13464 | if (sc->args != sc->NIL) { | |
13465 | s_save(sc,OP_ERR1, ((sc->args)->_object._cons._cdr), sc->NIL); | |
13466 | sc->args = ((sc->args)->_object._cons._car); | |
13467 | sc->print_flag = 1; | |
13468 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
13469 | } else { | |
13470 | putstr(sc, "\n"); | |
13471 | sc->print_error = 0; | |
13472 | if(sc->interactive_repl) { | |
13473 | do { sc->op = (int)(OP_T0LVL); return sc->T; } while (0); | |
13474 | } else { | |
13475 | return sc->NIL; | |
13476 | } | |
13477 | } | |
13478 | ||
13479 | case OP_REVERSE: | |
13480 | return _s_return(sc,reverse(sc, ((sc->args)->_object._cons._car))); | |
13481 | ||
13482 | case OP_LIST_STAR: | |
13483 | return _s_return(sc,list_star(sc,sc->args)); | |
13484 | ||
13485 | case OP_APPEND: | |
13486 | if(sc->args==sc->NIL) { | |
13487 | return _s_return(sc,sc->NIL); | |
13488 | } | |
13489 | x=((sc->args)->_object._cons._car); | |
13490 | if(((sc->args)->_object._cons._cdr)==sc->NIL) { | |
13491 | return _s_return(sc,sc->args); | |
13492 | } | |
13493 | for (y = ((sc->args)->_object._cons._cdr); y != sc->NIL; y = ((y)->_object._cons._cdr)) { | |
13494 | x=append(sc,x,((y)->_object._cons._car)); | |
13495 | } | |
13496 | return _s_return(sc,x); | |
13497 | # 3699 "scheme.c" | |
13498 | case OP_QUIT: | |
13499 | if(is_pair(sc->args)) { | |
13500 | sc->retcode=ivalue(((sc->args)->_object._cons._car)); | |
13501 | } | |
13502 | return (sc->NIL); | |
13503 | ||
13504 | case OP_GC: | |
13505 | gc(sc, sc->NIL, sc->NIL); | |
13506 | return _s_return(sc,sc->T); | |
13507 | ||
13508 | case OP_GCVERB: | |
13509 | { int was = sc->gc_verbose; | |
13510 | ||
13511 | sc->gc_verbose = (((sc->args)->_object._cons._car) != sc->F); | |
13512 | return _s_return(sc,(was) ? sc->T : sc->F); | |
13513 | } | |
13514 | ||
13515 | case OP_NEWSEGMENT: | |
13516 | if (!is_pair(sc->args) || !is_number(((sc->args)->_object._cons._car))) { | |
13517 | return _Error_1(sc,"new-segment: argument must be a number",0); | |
13518 | } | |
13519 | alloc_cellseg(sc, (int) ivalue(((sc->args)->_object._cons._car))); | |
13520 | return _s_return(sc,sc->T); | |
13521 | ||
13522 | case OP_OBLIST: | |
13523 | return _s_return(sc,oblist_all_symbols(sc)); | |
13524 | ||
13525 | case OP_CURR_INPORT: | |
13526 | return _s_return(sc,sc->inport); | |
13527 | ||
13528 | case OP_CURR_OUTPORT: | |
13529 | return _s_return(sc,sc->outport); | |
13530 | ||
13531 | case OP_OPEN_INFILE: | |
13532 | case OP_OPEN_OUTFILE: | |
13533 | case OP_OPEN_INOUTFILE: { | |
13534 | int prop=0; | |
13535 | pointer p; | |
13536 | switch(op) { | |
13537 | case OP_OPEN_INFILE: prop=port_input; break; | |
13538 | case OP_OPEN_OUTFILE: prop=port_output; break; | |
13539 | case OP_OPEN_INOUTFILE: prop=port_input|port_output; break; | |
13540 | default: break; | |
13541 | } | |
13542 | p=port_from_filename(sc,((((sc->args)->_object._cons._car))->_object._string._svalue),prop); | |
13543 | if(p==sc->NIL) { | |
13544 | return _s_return(sc,sc->F); | |
13545 | } | |
13546 | return _s_return(sc,p); | |
13547 | } | |
13548 | ||
13549 | ||
13550 | case OP_OPEN_INSTRING: | |
13551 | case OP_OPEN_OUTSTRING: | |
13552 | case OP_OPEN_INOUTSTRING: { | |
13553 | int prop=0; | |
13554 | pointer p; | |
13555 | switch(op) { | |
13556 | case OP_OPEN_INSTRING: prop=port_input; break; | |
13557 | case OP_OPEN_OUTSTRING: prop=port_output; break; | |
13558 | case OP_OPEN_INOUTSTRING: prop=port_input|port_output; break; | |
13559 | default: break; | |
13560 | } | |
13561 | p=port_from_string(sc, ((((sc->args)->_object._cons._car))->_object._string._svalue), | |
13562 | ((((sc->args)->_object._cons._car))->_object._string._svalue)+((((sc->args)->_object._cons._car))->_object._string._length), prop); | |
13563 | if(p==sc->NIL) { | |
13564 | return _s_return(sc,sc->F); | |
13565 | } | |
13566 | return _s_return(sc,p); | |
13567 | } | |
13568 | ||
13569 | ||
13570 | case OP_CLOSE_INPORT: | |
13571 | port_close(sc,((sc->args)->_object._cons._car),port_input); | |
13572 | return _s_return(sc,sc->T); | |
13573 | ||
13574 | case OP_CLOSE_OUTPORT: | |
13575 | port_close(sc,((sc->args)->_object._cons._car),port_output); | |
13576 | return _s_return(sc,sc->T); | |
13577 | ||
13578 | case OP_INT_ENV: | |
13579 | return _s_return(sc,sc->global_env); | |
13580 | ||
13581 | case OP_CURR_ENV: | |
13582 | return _s_return(sc,sc->envir); | |
13583 | ||
13584 | default: | |
13585 | sprintf(sc->strbuff, "%d: illegal operator", sc->op); | |
13586 | return _Error_1(sc,sc->strbuff,0); | |
13587 | } | |
13588 | return sc->T; | |
13589 | } | |
13590 | ||
13591 | static pointer opexe_5(scheme *sc, enum scheme_opcodes op) { | |
13592 | pointer x; | |
13593 | ||
13594 | if(sc->nesting!=0) { | |
13595 | int n=sc->nesting; | |
13596 | sc->nesting=0; | |
13597 | sc->retcode=-1; | |
13598 | return _Error_1(sc,"unmatched parentheses:",mk_integer(sc,n)); | |
13599 | } | |
13600 | ||
13601 | switch (op) { | |
13602 | ||
13603 | case OP_READ: | |
13604 | if(!is_pair(sc->args)) { | |
13605 | do { sc->op = (int)(OP_READ_INTERNAL); return sc->T; } while (0); | |
13606 | } | |
13607 | if(!((((((sc->args)->_object._cons._car))->_flag)&31)==T_PORT && ((sc->args)->_object._cons._car)->_object._port->kind&port_input)) { | |
13608 | return _Error_1(sc,"read: not an input port:",((sc->args)->_object._cons._car)); | |
13609 | } | |
13610 | if(((sc->args)->_object._cons._car)==sc->inport) { | |
13611 | do { sc->op = (int)(OP_READ_INTERNAL); return sc->T; } while (0); | |
13612 | } | |
13613 | x=sc->inport; | |
13614 | sc->inport=((sc->args)->_object._cons._car); | |
13615 | x=_cons(sc,x,sc->NIL,0); | |
13616 | s_save(sc,OP_SET_INPORT, x, sc->NIL); | |
13617 | do { sc->op = (int)(OP_READ_INTERNAL); return sc->T; } while (0); | |
13618 | ||
13619 | case OP_READ_CHAR: | |
13620 | case OP_PEEK_CHAR: { | |
13621 | gunichar c; | |
13622 | if(is_pair(sc->args)) { | |
13623 | if(((sc->args)->_object._cons._car)!=sc->inport) { | |
13624 | x=sc->inport; | |
13625 | x=_cons(sc,x,sc->NIL,0); | |
13626 | s_save(sc,OP_SET_INPORT, x, sc->NIL); | |
13627 | sc->inport=((sc->args)->_object._cons._car); | |
13628 | } | |
13629 | } | |
13630 | c=inchar(sc); | |
13631 | if(c==(-1)) { | |
13632 | return _s_return(sc,sc->EOF_OBJ); | |
13633 | } | |
13634 | if(sc->op==OP_PEEK_CHAR) { | |
13635 | backchar(sc,c); | |
13636 | } | |
13637 | return _s_return(sc,mk_character(sc,c)); | |
13638 | } | |
13639 | ||
13640 | case OP_CHAR_READY: { | |
13641 | pointer p=sc->inport; | |
13642 | int res; | |
13643 | if(is_pair(sc->args)) { | |
13644 | p=((sc->args)->_object._cons._car); | |
13645 | } | |
13646 | res=p->_object._port->kind&port_string; | |
13647 | return _s_return(sc,(res) ? sc->T : sc->F); | |
13648 | } | |
13649 | ||
13650 | case OP_SET_INPORT: | |
13651 | sc->inport=((sc->args)->_object._cons._car); | |
13652 | return _s_return(sc,sc->value); | |
13653 | ||
13654 | case OP_SET_OUTPORT: | |
13655 | sc->outport=((sc->args)->_object._cons._car); | |
13656 | return _s_return(sc,sc->value); | |
13657 | ||
13658 | case OP_RDSEXPR: | |
13659 | switch (sc->tok) { | |
13660 | case (-1): | |
13661 | if(sc->inport==sc->loadport) { | |
13662 | sc->args=sc->NIL; | |
13663 | do { sc->op = (int)(OP_QUIT); return sc->T; } while (0); | |
13664 | } else { | |
13665 | return _s_return(sc,sc->EOF_OBJ); | |
13666 | } | |
13667 | # 3879 "scheme.c" | |
13668 | case 12: | |
13669 | s_save(sc,OP_RDVEC,sc->NIL,sc->NIL); | |
13670 | ||
13671 | case 0: | |
13672 | sc->tok = token(sc); | |
13673 | if (sc->tok == 1) { | |
13674 | return _s_return(sc,sc->NIL); | |
13675 | } else if (sc->tok == 2) { | |
13676 | return _Error_1(sc,"syntax error: illegal dot expression",0); | |
13677 | } else { | |
13678 | sc->nesting_stack[sc->file_i]++; | |
13679 | s_save(sc,OP_RDLIST, sc->NIL, sc->NIL); | |
13680 | do { sc->op = (int)(OP_RDSEXPR); return sc->T; } while (0); | |
13681 | } | |
13682 | case 4: | |
13683 | s_save(sc,OP_RDQUOTE, sc->NIL, sc->NIL); | |
13684 | sc->tok = token(sc); | |
13685 | do { sc->op = (int)(OP_RDSEXPR); return sc->T; } while (0); | |
13686 | case 7: | |
13687 | sc->tok = token(sc); | |
13688 | if(sc->tok==12) { | |
13689 | s_save(sc,OP_RDQQUOTEVEC, sc->NIL, sc->NIL); | |
13690 | sc->tok=0; | |
13691 | do { sc->op = (int)(OP_RDSEXPR); return sc->T; } while (0); | |
13692 | } else { | |
13693 | s_save(sc,OP_RDQQUOTE, sc->NIL, sc->NIL); | |
13694 | } | |
13695 | do { sc->op = (int)(OP_RDSEXPR); return sc->T; } while (0); | |
13696 | case 8: | |
13697 | s_save(sc,OP_RDUNQUOTE, sc->NIL, sc->NIL); | |
13698 | sc->tok = token(sc); | |
13699 | do { sc->op = (int)(OP_RDSEXPR); return sc->T; } while (0); | |
13700 | case 9: | |
13701 | s_save(sc,OP_RDUQTSP, sc->NIL, sc->NIL); | |
13702 | sc->tok = token(sc); | |
13703 | do { sc->op = (int)(OP_RDSEXPR); return sc->T; } while (0); | |
13704 | case 3: | |
13705 | return _s_return(sc,mk_atom(sc, readstr_upto(sc, "();\t\n\r "))); | |
13706 | case 6: | |
13707 | x=readstrexp(sc); | |
13708 | if(x==sc->F) { | |
13709 | return _Error_1(sc,"Error reading string",0); | |
13710 | } | |
13711 | setimmutable(x); | |
13712 | return _s_return(sc,x); | |
13713 | case 10: { | |
13714 | pointer f=find_slot_in_env(sc,sc->envir,sc->SHARP_HOOK,1); | |
13715 | if(f==sc->NIL) { | |
13716 | return _Error_1(sc,"undefined sharp expression",0); | |
13717 | } else { | |
13718 | sc->code=_cons(sc,slot_value_in_env(f),sc->NIL,0); | |
13719 | do { sc->op = (int)(OP_EVAL); return sc->T; } while (0); | |
13720 | } | |
13721 | } | |
13722 | case 11: | |
13723 | if ((x = mk_sharp_const(sc, readstr_upto(sc, "();\t\n\r "))) == sc->NIL) { | |
13724 | return _Error_1(sc,"undefined sharp expression",0); | |
13725 | } else { | |
13726 | return _s_return(sc,x); | |
13727 | } | |
13728 | default: | |
13729 | sprintf(sc->linebuff, "syntax error: illegal token %d", sc->tok); | |
13730 | return _Error_1(sc,sc->linebuff,0); | |
13731 | } | |
13732 | break; | |
13733 | ||
13734 | case OP_RDLIST: { | |
13735 | sc->args = _cons(sc,sc->value,sc->args,0); | |
13736 | sc->tok = token(sc); | |
13737 | # 3956 "scheme.c" | |
13738 | if (sc->tok == 1) { | |
13739 | gunichar c = inchar(sc); | |
13740 | if (c != '\n') backchar(sc,c); | |
13741 | sc->nesting_stack[sc->file_i]--; | |
13742 | return _s_return(sc,reverse_in_place(sc, sc->NIL, sc->args)); | |
13743 | } else if (sc->tok == 2) { | |
13744 | s_save(sc,OP_RDDOT, sc->args, sc->NIL); | |
13745 | sc->tok = token(sc); | |
13746 | do { sc->op = (int)(OP_RDSEXPR); return sc->T; } while (0); | |
13747 | } else { | |
13748 | s_save(sc,OP_RDLIST, sc->args, sc->NIL); | |
13749 | do { sc->op = (int)(OP_RDSEXPR); return sc->T; } while (0); | |
13750 | } | |
13751 | } | |
13752 | ||
13753 | case OP_RDDOT: | |
13754 | if (token(sc) != 1) { | |
13755 | return _Error_1(sc,"syntax error: illegal dot expression",0); | |
13756 | } else { | |
13757 | sc->nesting_stack[sc->file_i]--; | |
13758 | return _s_return(sc,reverse_in_place(sc, sc->value, sc->args)); | |
13759 | } | |
13760 | ||
13761 | case OP_RDQUOTE: | |
13762 | return _s_return(sc,_cons(sc,sc->QUOTE,_cons(sc,sc->value,sc->NIL,0),0)); | |
13763 | ||
13764 | case OP_RDQQUOTE: | |
13765 | return _s_return(sc,_cons(sc,sc->QQUOTE,_cons(sc,sc->value,sc->NIL,0),0)); | |
13766 | ||
13767 | case OP_RDQQUOTEVEC: | |
13768 | return _s_return(sc,_cons(sc,mk_symbol(sc,"apply"),_cons(sc,mk_symbol(sc,"vector"),_cons(sc,_cons(sc,sc->QQUOTE,_cons(sc,sc->value,sc->NIL,0),0),sc->NIL,0),0),0)); | |
13769 | ||
13770 | ||
13771 | ||
13772 | ||
13773 | ||
13774 | case OP_RDUNQUOTE: | |
13775 | return _s_return(sc,_cons(sc,sc->UNQUOTE,_cons(sc,sc->value,sc->NIL,0),0)); | |
13776 | ||
13777 | case OP_RDUQTSP: | |
13778 | return _s_return(sc,_cons(sc,sc->UNQUOTESP,_cons(sc,sc->value,sc->NIL,0),0)); | |
13779 | ||
13780 | case OP_RDVEC: | |
13781 | ||
13782 | ||
13783 | ||
13784 | ||
13785 | ||
13786 | ||
13787 | ||
13788 | sc->args=sc->value; | |
13789 | do { sc->op = (int)(OP_VECTOR); return sc->T; } while (0); | |
13790 | ||
13791 | ||
13792 | case OP_P0LIST: | |
13793 | if(is_vector(sc->args)) { | |
13794 | putstr(sc,"#("); | |
13795 | sc->args=_cons(sc,sc->args,mk_integer(sc,0),0); | |
13796 | do { sc->op = (int)(OP_PVECFROM); return sc->T; } while (0); | |
13797 | } else if(is_environment(sc->args)) { | |
13798 | putstr(sc,"#<ENVIRONMENT>"); | |
13799 | return _s_return(sc,sc->T); | |
13800 | } else if (!is_pair(sc->args)) { | |
13801 | printatom(sc, sc->args, sc->print_flag); | |
13802 | return _s_return(sc,sc->T); | |
13803 | } else if (((sc->args)->_object._cons._car) == sc->QUOTE && (is_pair(((sc->args)->_object._cons._cdr)) && ((((sc->args)->_object._cons._cdr))->_object._cons._cdr) == sc->NIL)) { | |
13804 | putstr(sc, "'"); | |
13805 | sc->args = ((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
13806 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
13807 | } else if (((sc->args)->_object._cons._car) == sc->QQUOTE && (is_pair(((sc->args)->_object._cons._cdr)) && ((((sc->args)->_object._cons._cdr))->_object._cons._cdr) == sc->NIL)) { | |
13808 | putstr(sc, "`"); | |
13809 | sc->args = ((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
13810 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
13811 | } else if (((sc->args)->_object._cons._car) == sc->UNQUOTE && (is_pair(((sc->args)->_object._cons._cdr)) && ((((sc->args)->_object._cons._cdr))->_object._cons._cdr) == sc->NIL)) { | |
13812 | putstr(sc, ","); | |
13813 | sc->args = ((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
13814 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
13815 | } else if (((sc->args)->_object._cons._car) == sc->UNQUOTESP && (is_pair(((sc->args)->_object._cons._cdr)) && ((((sc->args)->_object._cons._cdr))->_object._cons._cdr) == sc->NIL)) { | |
13816 | putstr(sc, ",@"); | |
13817 | sc->args = ((((sc->args)->_object._cons._cdr))->_object._cons._car); | |
13818 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
13819 | } else { | |
13820 | putstr(sc, "("); | |
13821 | s_save(sc,OP_P1LIST, ((sc->args)->_object._cons._cdr), sc->NIL); | |
13822 | sc->args = ((sc->args)->_object._cons._car); | |
13823 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
13824 | } | |
13825 | ||
13826 | case OP_P1LIST: | |
13827 | if (is_pair(sc->args)) { | |
13828 | s_save(sc,OP_P1LIST, ((sc->args)->_object._cons._cdr), sc->NIL); | |
13829 | putstr(sc, " "); | |
13830 | sc->args = ((sc->args)->_object._cons._car); | |
13831 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
13832 | } else if(is_vector(sc->args)) { | |
13833 | s_save(sc,OP_P1LIST,sc->NIL,sc->NIL); | |
13834 | putstr(sc, " . "); | |
13835 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
13836 | } else { | |
13837 | if (sc->args != sc->NIL) { | |
13838 | putstr(sc, " . "); | |
13839 | printatom(sc, sc->args, sc->print_flag); | |
13840 | } | |
13841 | putstr(sc, ")"); | |
13842 | return _s_return(sc,sc->T); | |
13843 | } | |
13844 | case OP_PVECFROM: { | |
13845 | int i=((((sc->args)->_object._cons._cdr))->_object._number.value.ivalue); | |
13846 | pointer vec=((sc->args)->_object._cons._car); | |
13847 | int len=((vec)->_object._number.value.ivalue); | |
13848 | if(i==len) { | |
13849 | putstr(sc," )"); | |
13850 | return _s_return(sc,sc->T); | |
13851 | } else { | |
13852 | pointer elem=vector_elem(vec,i); | |
13853 | ((((sc->args)->_object._cons._cdr))->_object._number.value.ivalue)=i+1; | |
13854 | s_save(sc,OP_PVECFROM, sc->args, sc->NIL); | |
13855 | sc->args=elem; | |
13856 | putstr(sc," "); | |
13857 | do { sc->op = (int)(OP_P0LIST); return sc->T; } while (0); | |
13858 | } | |
13859 | } | |
13860 | ||
13861 | default: | |
13862 | sprintf(sc->strbuff, "%d: illegal operator", sc->op); | |
13863 | return _Error_1(sc,sc->strbuff,0); | |
13864 | ||
13865 | } | |
13866 | return sc->T; | |
13867 | } | |
13868 | ||
13869 | static pointer opexe_6(scheme *sc, enum scheme_opcodes op) { | |
13870 | pointer x, y; | |
13871 | long v; | |
13872 | ||
13873 | switch (op) { | |
13874 | case OP_LIST_LENGTH: | |
13875 | v=list_length(sc,((sc->args)->_object._cons._car)); | |
13876 | if(v<0) { | |
13877 | return _Error_1(sc,"length: not a list:",((sc->args)->_object._cons._car)); | |
13878 | } | |
13879 | return _s_return(sc,mk_integer(sc, v)); | |
13880 | ||
13881 | case OP_ASSQ: | |
13882 | x = ((sc->args)->_object._cons._car); | |
13883 | for (y = ((((sc->args)->_object._cons._cdr))->_object._cons._car); is_pair(y); y = ((y)->_object._cons._cdr)) { | |
13884 | if (!is_pair(((y)->_object._cons._car))) { | |
13885 | return _Error_1(sc,"unable to handle non pair element",0); | |
13886 | } | |
13887 | if (x == ((((y)->_object._cons._car))->_object._cons._car)) | |
13888 | break; | |
13889 | } | |
13890 | if (is_pair(y)) { | |
13891 | return _s_return(sc,((y)->_object._cons._car)); | |
13892 | } else { | |
13893 | return _s_return(sc,sc->F); | |
13894 | } | |
13895 | ||
13896 | ||
13897 | case OP_GET_CLOSURE: | |
13898 | sc->args = ((sc->args)->_object._cons._car); | |
13899 | if (sc->args == sc->NIL) { | |
13900 | return _s_return(sc,sc->F); | |
13901 | } else if (is_closure(sc->args)) { | |
13902 | return _s_return(sc,_cons(sc,sc->LAMBDA,closure_code(sc->value),0)); | |
13903 | } else if (is_macro(sc->args)) { | |
13904 | return _s_return(sc,_cons(sc,sc->LAMBDA,closure_code(sc->value),0)); | |
13905 | } else { | |
13906 | return _s_return(sc,sc->F); | |
13907 | } | |
13908 | case OP_CLOSUREP: | |
13909 | ||
13910 | ||
13911 | ||
13912 | ||
13913 | return _s_return(sc,(is_closure(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13914 | case OP_MACROP: | |
13915 | return _s_return(sc,(is_macro(((sc->args)->_object._cons._car))) ? sc->T : sc->F); | |
13916 | default: | |
13917 | sprintf(sc->strbuff, "%d: illegal operator", sc->op); | |
13918 | return _Error_1(sc,sc->strbuff,0); | |
13919 | } | |
13920 | return sc->T; | |
13921 | } | |
13922 | ||
13923 | typedef pointer (*dispatch_func)(scheme *, enum scheme_opcodes); | |
13924 | ||
13925 | typedef int (*test_predicate)(pointer); | |
13926 | static int is_any(pointer p) { return 1;} | |
13927 | static int is_num_integer(pointer p) { | |
13928 | return is_number(p) && ((p)->_object._number.is_fixnum); | |
13929 | } | |
13930 | static int is_nonneg(pointer p) { | |
13931 | return is_num_integer(p) && ivalue(p)>=0; | |
13932 | } | |
13933 | ||
13934 | ||
13935 | static struct { | |
13936 | test_predicate fct; | |
13937 | const char *kind; | |
13938 | } tests[]={ | |
13939 | {0,0}, | |
13940 | {is_any, 0}, | |
13941 | {is_string, "string"}, | |
13942 | {is_symbol, "symbol"}, | |
13943 | {is_port, "port"}, | |
13944 | {0,"input port"}, | |
13945 | {0,"output_port"}, | |
13946 | {is_environment, "environment"}, | |
13947 | {is_pair, "pair"}, | |
13948 | {0, "pair or '()"}, | |
13949 | {is_character, "character"}, | |
13950 | {is_vector, "vector"}, | |
13951 | {is_number, "number"}, | |
13952 | {is_num_integer, "integer"}, | |
13953 | {is_nonneg, "non-negative integer"}, | |
13954 | }; | |
13955 | # 4190 "scheme.c" | |
13956 | typedef struct { | |
13957 | dispatch_func func; | |
13958 | char *name; | |
13959 | int min_arity; | |
13960 | int max_arity; | |
13961 | char *arg_tests_encoding; | |
13962 | } op_code_info; | |
13963 | ||
13964 | ||
13965 | ||
13966 | static op_code_info dispatch_table[]= { | |
13967 | ||
13968 | # 1 "opdefines.h" 1 | |
13969 | {opexe_0,"load",1,1,"\002"}, | |
13970 | {opexe_0,0,0,0,0}, | |
13971 | {opexe_0,0,0,0,0}, | |
13972 | {opexe_0,0,0,0,0}, | |
13973 | {opexe_0,"gensym",0,0,0}, | |
13974 | {opexe_0,0,0,0,0}, | |
13975 | {opexe_0,0,0,0,0}, | |
13976 | ||
13977 | {opexe_0,0,0,0,0}, | |
13978 | ||
13979 | {opexe_0,0,0,0,0}, | |
13980 | {opexe_0,0,0,0,0}, | |
13981 | {opexe_0,0,0,0,0}, | |
13982 | ||
13983 | {opexe_0,0,0,0,0}, | |
13984 | {opexe_0,"tracing",1,1,"\016"}, | |
13985 | ||
13986 | {opexe_0,0,0,0,0}, | |
13987 | {opexe_0,0,0,0,0}, | |
13988 | {opexe_0,"make-closure",1,2,"\010" "\007"}, | |
13989 | {opexe_0,0,0,0,0}, | |
13990 | {opexe_0,0,0,0,0}, | |
13991 | {opexe_0,0,0,0,0}, | |
13992 | {opexe_0,"defined?",1,2,"\003" "\007"}, | |
13993 | {opexe_0,0,0,0,0}, | |
13994 | {opexe_0,0,0,0,0}, | |
13995 | {opexe_0,0,0,0,0}, | |
13996 | {opexe_0,0,0,0,0}, | |
13997 | {opexe_0,0,0,0,0}, | |
13998 | {opexe_0,0,0,0,0}, | |
13999 | {opexe_0,0,0,0,0}, | |
14000 | {opexe_0,0,0,0,0}, | |
14001 | {opexe_0,0,0,0,0}, | |
14002 | {opexe_0,0,0,0,0}, | |
14003 | {opexe_0,0,0,0,0}, | |
14004 | {opexe_1,0,0,0,0}, | |
14005 | {opexe_1,0,0,0,0}, | |
14006 | {opexe_1,0,0,0,0}, | |
14007 | {opexe_1,0,0,0,0}, | |
14008 | {opexe_1,0,0,0,0}, | |
14009 | {opexe_1,0,0,0,0}, | |
14010 | {opexe_1,0,0,0,0}, | |
14011 | {opexe_1,0,0,0,0}, | |
14012 | {opexe_1,0,0,0,0}, | |
14013 | {opexe_1,0,0,0,0}, | |
14014 | {opexe_1,0,0,0,0}, | |
14015 | {opexe_1,0,0,0,0}, | |
14016 | {opexe_1,0,0,0,0}, | |
14017 | {opexe_1,0,0,0,0}, | |
14018 | {opexe_1,0,0,0,0}, | |
14019 | {opexe_1,0,0,0,0}, | |
14020 | {opexe_1,0,0,0,0}, | |
14021 | {opexe_1,"eval",1,2,"\001" "\007"}, | |
14022 | {opexe_1,"apply",1,0xffff,0}, | |
14023 | {opexe_1,"call-with-current-continuation",1,1,0}, | |
14024 | ||
14025 | {opexe_2,"inexact->exact",1,1,"\014"}, | |
14026 | {opexe_2,"exp",1,1,"\014"}, | |
14027 | {opexe_2,"log",1,1,"\014"}, | |
14028 | {opexe_2,"sin",1,1,"\014"}, | |
14029 | {opexe_2,"cos",1,1,"\014"}, | |
14030 | {opexe_2,"tan",1,1,"\014"}, | |
14031 | {opexe_2,"asin",1,1,"\014"}, | |
14032 | {opexe_2,"acos",1,1,"\014"}, | |
14033 | {opexe_2,"atan",1,2,"\014"}, | |
14034 | {opexe_2,"sqrt",1,1,"\014"}, | |
14035 | {opexe_2,"expt",2,2,"\014"}, | |
14036 | {opexe_2,"floor",1,1,"\014"}, | |
14037 | {opexe_2,"ceiling",1,1,"\014"}, | |
14038 | {opexe_2,"truncate",1,1,"\014"}, | |
14039 | {opexe_2,"round",1,1,"\014"}, | |
14040 | ||
14041 | {opexe_2,"+",0,0xffff,"\014"}, | |
14042 | {opexe_2,"-",1,0xffff,"\014"}, | |
14043 | {opexe_2,"*",0,0xffff,"\014"}, | |
14044 | {opexe_2,"/",1,0xffff,"\014"}, | |
14045 | {opexe_2,"quotient",1,0xffff,"\015"}, | |
14046 | {opexe_2,"remainder",2,2,"\015"}, | |
14047 | {opexe_2,"modulo",2,2,"\015"}, | |
14048 | {opexe_2,"car",1,1,"\010"}, | |
14049 | {opexe_2,"cdr",1,1,"\010"}, | |
14050 | {opexe_2,"cons",2,2,0}, | |
14051 | {opexe_2,"set-car!",2,2,"\010" "\001"}, | |
14052 | {opexe_2,"set-cdr!",2,2,"\010" "\001"}, | |
14053 | {opexe_2,"char->integer",1,1,"\012"}, | |
14054 | {opexe_2,"integer->char",1,1,"\016"}, | |
14055 | {opexe_2,"char-upcase",1,1,"\012"}, | |
14056 | {opexe_2,"char-downcase",1,1,"\012"}, | |
14057 | {opexe_2,"symbol->string",1,1,"\003"}, | |
14058 | {opexe_2,"atom->string",1,1,"\001"}, | |
14059 | {opexe_2,"string->symbol",1,1,"\002"}, | |
14060 | {opexe_2,"string->atom",1,1,"\002"}, | |
14061 | {opexe_2,"make-string",1,2,"\016" "\012"}, | |
14062 | {opexe_2,"string-length",1,1,"\002"}, | |
14063 | {opexe_2,"string-ref",2,2,"\002" "\016"}, | |
14064 | {opexe_2,"string-set!",3,3,"\002" "\016" "\012"}, | |
14065 | {opexe_2,"string-append",0,0xffff,"\002"}, | |
14066 | {opexe_2,"substring",2,3,"\002" "\016"}, | |
14067 | {opexe_2,"vector",0,0xffff,0}, | |
14068 | {opexe_2,"make-vector",1,2,"\016" "\001"}, | |
14069 | {opexe_2,"vector-length",1,1,"\013"}, | |
14070 | {opexe_2,"vector-ref",2,2,"\013" "\016"}, | |
14071 | {opexe_2,"vector-set!",3,3,"\013" "\016" "\001"}, | |
14072 | {opexe_3,"not",1,1,0}, | |
14073 | {opexe_3,"boolean?",1,1,0}, | |
14074 | {opexe_3,"eof-object?",1,1,0}, | |
14075 | {opexe_3,"null?",1,1,0}, | |
14076 | {opexe_3,"=",2,0xffff,"\014"}, | |
14077 | {opexe_3,"<",2,0xffff,"\014"}, | |
14078 | {opexe_3,">",2,0xffff,"\014"}, | |
14079 | {opexe_3,"<=",2,0xffff,"\014"}, | |
14080 | {opexe_3,">=",2,0xffff,"\014"}, | |
14081 | {opexe_3,"symbol?",1,1,"\001"}, | |
14082 | {opexe_3,"number?",1,1,"\001"}, | |
14083 | {opexe_3,"string?",1,1,"\001"}, | |
14084 | {opexe_3,"integer?",1,1,"\001"}, | |
14085 | {opexe_3,"real?",1,1,"\001"}, | |
14086 | {opexe_3,"char?",1,1,"\001"}, | |
14087 | ||
14088 | {opexe_3,"char-alphabetic?",1,1,"\012"}, | |
14089 | {opexe_3,"char-numeric?",1,1,"\012"}, | |
14090 | {opexe_3,"char-whitespace?",1,1,"\012"}, | |
14091 | {opexe_3,"char-upper-case?",1,1,"\012"}, | |
14092 | {opexe_3,"char-lower-case?",1,1,"\012"}, | |
14093 | ||
14094 | {opexe_3,"port?",1,1,"\001"}, | |
14095 | {opexe_3,"input-port?",1,1,"\001"}, | |
14096 | {opexe_3,"output-port?",1,1,"\001"}, | |
14097 | {opexe_3,"procedure?",1,1,"\001"}, | |
14098 | {opexe_3,"pair?",1,1,"\001"}, | |
14099 | {opexe_3,"list?",1,1,"\001"}, | |
14100 | {opexe_3,"environment?",1,1,"\001"}, | |
14101 | {opexe_3,"vector?",1,1,"\001"}, | |
14102 | {opexe_3,"array?",1,1,"\001"}, | |
14103 | {opexe_3,"eq?",2,2,"\001"}, | |
14104 | {opexe_3,"eqv?",2,2,"\001"}, | |
14105 | {opexe_4,"force",1,1,"\001"}, | |
14106 | {opexe_4,0,0,0,0}, | |
14107 | {opexe_4,"write",1,2,"\001" "\006"}, | |
14108 | {opexe_4,"write-char",1,2,"\012" "\006"}, | |
14109 | {opexe_4,"display",1,2,"\001" "\006"}, | |
14110 | {opexe_4,"newline",0,1,"\006"}, | |
14111 | {opexe_4,"error",1,0xffff,0}, | |
14112 | {opexe_4,0,0,0,0}, | |
14113 | {opexe_4,"reverse",1,1,"\010"}, | |
14114 | {opexe_4,"list*",1,0xffff,0}, | |
14115 | {opexe_4,"append",0,0xffff,0}, | |
14116 | {opexe_4,"put",3,3,0}, | |
14117 | {opexe_4,"get",2,2,0}, | |
14118 | {opexe_4,"quit",0,1,"\014"}, | |
14119 | {opexe_4,"gc",0,0,0}, | |
14120 | {opexe_4,"gc-verbose",0,1,0}, | |
14121 | {opexe_4,"new-segment",0,1,"\014"}, | |
14122 | {opexe_4,"oblist",0,0,0}, | |
14123 | {opexe_4,"current-input-port",0,0,0}, | |
14124 | {opexe_4,"current-output-port",0,0,0}, | |
14125 | {opexe_4,"open-input-file",1,1,"\002"}, | |
14126 | {opexe_4,"open-output-file",1,1,"\002"}, | |
14127 | {opexe_4,"open-input-output-file",1,1,"\002"}, | |
14128 | ||
14129 | {opexe_4,"open-input-string",1,1,"\002"}, | |
14130 | {opexe_4,"open-output-string",1,1,"\002"}, | |
14131 | {opexe_4,"open-input-output-string",1,1,"\002"}, | |
14132 | ||
14133 | {opexe_4,"close-input-port",1,1,"\005"}, | |
14134 | {opexe_4,"close-output-port",1,1,"\006"}, | |
14135 | {opexe_4,"interaction-environment",0,0,0}, | |
14136 | {opexe_4,"current-environment",0,0,0}, | |
14137 | {opexe_5,"read",0,1,"\005"}, | |
14138 | {opexe_5,"read-char",0,1,"\005"}, | |
14139 | {opexe_5,"peek-char",0,1,"\005"}, | |
14140 | {opexe_5,"char-ready?",0,1,"\005"}, | |
14141 | {opexe_5,"set-input-port",1,1,"\005"}, | |
14142 | {opexe_5,"set-output-port",1,1,"\006"}, | |
14143 | {opexe_5,0,0,0,0}, | |
14144 | {opexe_5,0,0,0,0}, | |
14145 | {opexe_5,0,0,0,0}, | |
14146 | {opexe_5,0,0,0,0}, | |
14147 | {opexe_5,0,0,0,0}, | |
14148 | {opexe_5,0,0,0,0}, | |
14149 | {opexe_5,0,0,0,0}, | |
14150 | {opexe_5,0,0,0,0}, | |
14151 | {opexe_5,0,0,0,0}, | |
14152 | {opexe_5,0,0,0,0}, | |
14153 | {opexe_5,0,0,0,0}, | |
14154 | {opexe_5,0,0,0,0}, | |
14155 | {opexe_6,"length",1,1,"\011"}, | |
14156 | {opexe_6,"assq",2,2,0}, | |
14157 | {opexe_6,"get-closure-code",1,1,0}, | |
14158 | {opexe_6,"closure?",1,1,0}, | |
14159 | {opexe_6,"macro?",1,1,0}, | |
14160 | # 4203 "scheme.c" 2 | |
14161 | { 0 } | |
14162 | }; | |
14163 | ||
14164 | static const char *procname(pointer x) { | |
14165 | int n=ivalue(x); | |
14166 | const char *name=dispatch_table[n].name; | |
14167 | if(name==0) { | |
14168 | name="ILLEGAL!"; | |
14169 | } | |
14170 | return name; | |
14171 | } | |
14172 | ||
14173 | ||
14174 | static void Eval_Cycle(scheme *sc, enum scheme_opcodes op) { | |
14175 | int count=0; | |
14176 | int old_op; | |
14177 | ||
14178 | sc->op = op; | |
14179 | for (;;) { | |
14180 | op_code_info *pcd=dispatch_table+sc->op; | |
14181 | if (pcd->name!=0) { | |
14182 | char msg[512]; | |
14183 | int ok=1; | |
14184 | int n=list_length(sc,sc->args); | |
14185 | ||
14186 | ||
14187 | if(n<pcd->min_arity) { | |
14188 | ok=0; | |
14189 | sprintf(msg,"%s: needs%s %d argument(s)", | |
14190 | pcd->name, | |
14191 | pcd->min_arity==pcd->max_arity?"":" at least", | |
14192 | pcd->min_arity); | |
14193 | } | |
14194 | if(ok && n>pcd->max_arity) { | |
14195 | ok=0; | |
14196 | sprintf(msg,"%s: needs%s %d argument(s)", | |
14197 | pcd->name, | |
14198 | pcd->min_arity==pcd->max_arity?"":" at most", | |
14199 | pcd->max_arity); | |
14200 | } | |
14201 | if(ok) { | |
14202 | if(pcd->arg_tests_encoding!=0) { | |
14203 | int i=0; | |
14204 | int j; | |
14205 | const char *t=pcd->arg_tests_encoding; | |
14206 | pointer arglist=sc->args; | |
14207 | do { | |
14208 | pointer arg=((arglist)->_object._cons._car); | |
14209 | j=(int)t[0]; | |
14210 | if(j=="\005"[0]) { | |
14211 | if(!((((arg)->_flag)&31)==T_PORT && arg->_object._port->kind&port_input)) break; | |
14212 | } else if(j=="\006"[0]) { | |
14213 | if(!((((arg)->_flag)&31)==T_PORT && arg->_object._port->kind&port_output)) break; | |
14214 | } else if(j=="\011"[0]) { | |
14215 | if(arg!=sc->NIL && !is_pair(arg)) break; | |
14216 | } else { | |
14217 | if(!tests[j].fct(arg)) break; | |
14218 | } | |
14219 | ||
14220 | if(t[1]!=0) { | |
14221 | t++; | |
14222 | } | |
14223 | arglist=((arglist)->_object._cons._cdr); | |
14224 | i++; | |
14225 | } while(i<n); | |
14226 | if(i<n) { | |
14227 | ok=0; | |
14228 | sprintf(msg,"%s: argument %d must be: %s", | |
14229 | pcd->name, | |
14230 | i+1, | |
14231 | tests[j].kind); | |
14232 | } | |
14233 | } | |
14234 | } | |
14235 | if(!ok) { | |
14236 | if(_Error_1(sc,msg,0)==sc->NIL) { | |
14237 | return; | |
14238 | } | |
14239 | pcd=dispatch_table+sc->op; | |
14240 | } | |
14241 | } | |
14242 | old_op=sc->op; | |
14243 | if (pcd->func(sc, (enum scheme_opcodes)sc->op) == sc->NIL) { | |
14244 | return; | |
14245 | } | |
14246 | if(sc->no_memory) { | |
14247 | fprintf(stderr,"No memory!\n"); | |
14248 | return; | |
14249 | } | |
14250 | count++; | |
14251 | } | |
14252 | } | |
14253 | ||
14254 | ||
14255 | ||
14256 | static void assign_syntax(scheme *sc, char *name) { | |
14257 | pointer x; | |
14258 | ||
14259 | x = oblist_add_by_name(sc, name); | |
14260 | ((x)->_flag) |= 4096; | |
14261 | } | |
14262 | ||
14263 | static void assign_proc(scheme *sc, enum scheme_opcodes op, char *name) { | |
14264 | pointer x, y; | |
14265 | ||
14266 | x = mk_symbol(sc, name); | |
14267 | y = mk_proc(sc,op); | |
14268 | new_slot_in_env(sc, x, y); | |
14269 | } | |
14270 | ||
14271 | static pointer mk_proc(scheme *sc, enum scheme_opcodes op) { | |
14272 | pointer y; | |
14273 | ||
14274 | y = get_cell(sc, sc->NIL, sc->NIL); | |
14275 | ((y)->_flag) = (T_PROC | 16384); | |
14276 | ((y)->_object._number.value.ivalue) = (long) op; | |
14277 | (y)->_object._number.is_fixnum=1;; | |
14278 | return y; | |
14279 | } | |
14280 | ||
14281 | ||
14282 | static int syntaxnum(pointer p) { | |
14283 | const char *s=((((p)->_object._cons._car))->_object._string._svalue); | |
14284 | switch(((((p)->_object._cons._car))->_object._string._length)) { | |
14285 | case 2: | |
14286 | if(s[0]=='i') return OP_IF0; | |
14287 | else return OP_OR0; | |
14288 | case 3: | |
14289 | if(s[0]=='a') return OP_AND0; | |
14290 | else return OP_LET0; | |
14291 | case 4: | |
14292 | switch(s[3]) { | |
14293 | case 'e': return OP_CASE0; | |
14294 | case 'd': return OP_COND0; | |
14295 | case '*': return OP_LET0AST; | |
14296 | default: return OP_SET0; | |
14297 | } | |
14298 | case 5: | |
14299 | switch(s[2]) { | |
14300 | case 'g': return OP_BEGIN; | |
14301 | case 'l': return OP_DELAY; | |
14302 | case 'c': return OP_MACRO0; | |
14303 | default: return OP_QUOTE; | |
14304 | } | |
14305 | case 6: | |
14306 | switch(s[2]) { | |
14307 | case 'm': return OP_LAMBDA; | |
14308 | case 'f': return OP_DEF0; | |
14309 | default: return OP_LET0REC; | |
14310 | } | |
14311 | default: | |
14312 | return OP_C0STREAM; | |
14313 | } | |
14314 | } | |
14315 | ||
14316 | ||
14317 | ||
14318 | static pointer s_cons(scheme *sc, pointer a, pointer b) { | |
14319 | return _cons(sc,a,b,0); | |
14320 | } | |
14321 | static pointer s_immutable_cons(scheme *sc, pointer a, pointer b) { | |
14322 | return _cons(sc,a,b,1); | |
14323 | } | |
14324 | ||
14325 | static struct scheme_interface vtbl ={ | |
14326 | scheme_define, | |
14327 | s_cons, | |
14328 | s_immutable_cons, | |
14329 | reserve_cells, | |
14330 | mk_integer, | |
14331 | mk_real, | |
14332 | mk_symbol, | |
14333 | gensym, | |
14334 | mk_string, | |
14335 | mk_counted_string, | |
14336 | mk_character, | |
14337 | mk_vector, | |
14338 | mk_foreign_func, | |
14339 | mk_closure, | |
14340 | putstr, | |
14341 | putcharacter, | |
14342 | ||
14343 | is_string, | |
14344 | string_length, | |
14345 | string_value, | |
14346 | is_number, | |
14347 | nvalue, | |
14348 | ivalue, | |
14349 | rvalue, | |
14350 | is_integer, | |
14351 | is_real, | |
14352 | is_character, | |
14353 | charvalue, | |
14354 | is_list, | |
14355 | is_vector, | |
14356 | list_length, | |
14357 | ivalue, | |
14358 | fill_vector, | |
14359 | vector_elem, | |
14360 | set_vector_elem, | |
14361 | ||
14362 | is_port, | |
14363 | ||
14364 | is_pair, | |
14365 | pair_car, | |
14366 | pair_cdr, | |
14367 | set_car, | |
14368 | set_cdr, | |
14369 | ||
14370 | is_symbol, | |
14371 | symname, | |
14372 | ||
14373 | is_syntax, | |
14374 | is_proc, | |
14375 | is_foreign, | |
14376 | syntaxname, | |
14377 | is_closure, | |
14378 | is_macro, | |
14379 | closure_code, | |
14380 | closure_env, | |
14381 | ||
14382 | is_continuation, | |
14383 | is_promise, | |
14384 | is_environment, | |
14385 | is_immutable, | |
14386 | setimmutable, | |
14387 | ||
14388 | scheme_load_file, | |
14389 | scheme_load_string | |
14390 | }; | |
14391 | ||
14392 | ||
14393 | scheme *scheme_init_new() { | |
14394 | scheme *sc=(scheme*)malloc(sizeof(scheme)); | |
14395 | if(!scheme_init(sc)) { | |
14396 | free(sc); | |
14397 | return 0; | |
14398 | } else { | |
14399 | return sc; | |
14400 | } | |
14401 | } | |
14402 | ||
14403 | scheme *scheme_init_new_custom_alloc(func_alloc malloc, func_dealloc free) { | |
14404 | scheme *sc=(scheme*)malloc(sizeof(scheme)); | |
14405 | if(!scheme_init_custom_alloc(sc,malloc,free)) { | |
14406 | free(sc); | |
14407 | return 0; | |
14408 | } else { | |
14409 | return sc; | |
14410 | } | |
14411 | } | |
14412 | ||
14413 | ||
14414 | int scheme_init(scheme *sc) { | |
14415 | return scheme_init_custom_alloc(sc,malloc,free); | |
14416 | } | |
14417 | ||
14418 | int scheme_init_custom_alloc(scheme *sc, func_alloc malloc, func_dealloc free) { | |
14419 | int i, n=sizeof(dispatch_table)/sizeof(dispatch_table[0]); | |
14420 | pointer x; | |
14421 | ||
14422 | num_zero.is_fixnum=1; | |
14423 | num_zero.value.ivalue=0; | |
14424 | num_one.is_fixnum=1; | |
14425 | num_one.value.ivalue=1; | |
14426 | ||
14427 | ||
14428 | sc->vptr=&vtbl; | |
14429 | ||
14430 | sc->gensym_cnt=0; | |
14431 | sc->malloc=malloc; | |
14432 | sc->free=free; | |
14433 | sc->last_cell_seg = -1; | |
14434 | sc->sink = &sc->_sink; | |
14435 | sc->NIL = &sc->_NIL; | |
14436 | sc->T = &sc->_HASHT; | |
14437 | sc->F = &sc->_HASHF; | |
14438 | sc->EOF_OBJ=&sc->_EOF_OBJ; | |
14439 | sc->free_cell = &sc->_NIL; | |
14440 | sc->fcells = 0; | |
14441 | sc->no_memory=0; | |
14442 | sc->inport=sc->NIL; | |
14443 | sc->outport=sc->NIL; | |
14444 | sc->save_inport=sc->NIL; | |
14445 | sc->loadport=sc->NIL; | |
14446 | sc->nesting=0; | |
14447 | sc->interactive_repl=0; | |
14448 | sc->print_output=0; | |
14449 | sc->print_error=0; | |
14450 | ||
14451 | if (alloc_cellseg(sc,3) != 3) { | |
14452 | sc->no_memory=1; | |
14453 | return 0; | |
14454 | } | |
14455 | sc->gc_verbose = 0; | |
14456 | dump_stack_initialize(sc); | |
14457 | sc->code = sc->NIL; | |
14458 | sc->tracing=0; | |
14459 | sc->bc_flag = 0; | |
14460 | sc->safe_foreign = sc->NIL; | |
14461 | ||
14462 | ||
14463 | ((sc->NIL)->_flag) = (16384 | 32768); | |
14464 | ((sc->NIL)->_object._cons._car) = ((sc->NIL)->_object._cons._cdr) = sc->NIL; | |
14465 | ||
14466 | ((sc->T)->_flag) = (16384 | 32768); | |
14467 | ((sc->T)->_object._cons._car) = ((sc->T)->_object._cons._cdr) = sc->T; | |
14468 | ||
14469 | ((sc->F)->_flag) = (16384 | 32768); | |
14470 | ((sc->F)->_object._cons._car) = ((sc->F)->_object._cons._cdr) = sc->F; | |
14471 | sc->oblist = oblist_initial_value(sc); | |
14472 | ||
14473 | new_frame_in_env(sc, sc->NIL); | |
14474 | sc->global_env = sc->envir; | |
14475 | ||
14476 | x = mk_symbol(sc,"else"); | |
14477 | new_slot_in_env(sc, x, sc->T); | |
14478 | ||
14479 | assign_syntax(sc, "lambda"); | |
14480 | assign_syntax(sc, "quote"); | |
14481 | assign_syntax(sc, "define"); | |
14482 | assign_syntax(sc, "if"); | |
14483 | assign_syntax(sc, "begin"); | |
14484 | assign_syntax(sc, "set!"); | |
14485 | assign_syntax(sc, "let"); | |
14486 | assign_syntax(sc, "let*"); | |
14487 | assign_syntax(sc, "letrec"); | |
14488 | assign_syntax(sc, "cond"); | |
14489 | assign_syntax(sc, "delay"); | |
14490 | assign_syntax(sc, "and"); | |
14491 | assign_syntax(sc, "or"); | |
14492 | assign_syntax(sc, "cons-stream"); | |
14493 | assign_syntax(sc, "macro"); | |
14494 | assign_syntax(sc, "case"); | |
14495 | ||
14496 | for(i=0; i<n; i++) { | |
14497 | if(dispatch_table[i].name!=0) { | |
14498 | assign_proc(sc, (enum scheme_opcodes)i, dispatch_table[i].name); | |
14499 | } | |
14500 | } | |
14501 | ||
14502 | ||
14503 | sc->LAMBDA = mk_symbol(sc, "lambda"); | |
14504 | sc->QUOTE = mk_symbol(sc, "quote"); | |
14505 | sc->QQUOTE = mk_symbol(sc, "quasiquote"); | |
14506 | sc->UNQUOTE = mk_symbol(sc, "unquote"); | |
14507 | sc->UNQUOTESP = mk_symbol(sc, "unquote-splicing"); | |
14508 | sc->FEED_TO = mk_symbol(sc, "=>"); | |
14509 | sc->COLON_HOOK = mk_symbol(sc,"*colon-hook*"); | |
14510 | sc->ERROR_HOOK = mk_symbol(sc, "*error-hook*"); | |
14511 | sc->SHARP_HOOK = mk_symbol(sc, "*sharp-hook*"); | |
14512 | ||
14513 | return !sc->no_memory; | |
14514 | } | |
14515 | ||
14516 | void scheme_set_input_port_file(scheme *sc, FILE *fin) { | |
14517 | sc->inport=port_from_file(sc,fin,port_input); | |
14518 | } | |
14519 | ||
14520 | void scheme_set_input_port_string(scheme *sc, char *start, char *past_the_end) { | |
14521 | sc->inport=port_from_string(sc,start,past_the_end,port_input); | |
14522 | } | |
14523 | ||
14524 | void scheme_set_output_port_file(scheme *sc, FILE *fout) { | |
14525 | sc->outport=port_from_file(sc,fout,port_output); | |
14526 | } | |
14527 | ||
14528 | void scheme_set_output_port_string(scheme *sc, char *start, char *past_the_end) { | |
14529 | sc->outport=port_from_string(sc,start,past_the_end,port_output); | |
14530 | } | |
14531 | ||
14532 | void scheme_set_external_data(scheme *sc, void *p) { | |
14533 | sc->ext_data=p; | |
14534 | } | |
14535 | ||
14536 | void scheme_deinit(scheme *sc) { | |
14537 | int i; | |
14538 | ||
14539 | sc->oblist=sc->NIL; | |
14540 | sc->global_env=sc->NIL; | |
14541 | dump_stack_free(sc); | |
14542 | sc->envir=sc->NIL; | |
14543 | sc->code=sc->NIL; | |
14544 | sc->args=sc->NIL; | |
14545 | sc->value=sc->NIL; | |
14546 | if(is_port(sc->inport)) { | |
14547 | ((sc->inport)->_flag) = 16384; | |
14548 | } | |
14549 | sc->inport=sc->NIL; | |
14550 | sc->outport=sc->NIL; | |
14551 | if(is_port(sc->save_inport)) { | |
14552 | ((sc->save_inport)->_flag) = 16384; | |
14553 | } | |
14554 | sc->save_inport=sc->NIL; | |
14555 | if(is_port(sc->loadport)) { | |
14556 | ((sc->loadport)->_flag) = 16384; | |
14557 | } | |
14558 | sc->loadport=sc->NIL; | |
14559 | sc->gc_verbose=0; | |
14560 | gc(sc,sc->NIL,sc->NIL); | |
14561 | ||
14562 | for(i=0; i<=sc->last_cell_seg; i++) { | |
14563 | sc->free(sc->alloc_seg[i]); | |
14564 | } | |
14565 | } | |
14566 | ||
14567 | void scheme_load_file(scheme *sc, FILE *fin) { | |
14568 | dump_stack_reset(sc); | |
14569 | sc->envir = sc->global_env; | |
14570 | sc->file_i=0; | |
14571 | sc->load_stack[0].kind=port_input|port_file; | |
14572 | sc->load_stack[0].rep.stdio.file=fin; | |
14573 | sc->loadport=mk_port(sc,sc->load_stack); | |
14574 | sc->retcode=0; | |
14575 | if(fin==stdin) { | |
14576 | sc->interactive_repl=1; | |
14577 | } | |
14578 | sc->inport=sc->loadport; | |
14579 | Eval_Cycle(sc, OP_T0LVL); | |
14580 | ((sc->loadport)->_flag)=16384; | |
14581 | if(sc->retcode==0) { | |
14582 | sc->retcode=sc->nesting!=0; | |
14583 | } | |
14584 | } | |
14585 | ||
14586 | void scheme_load_string(scheme *sc, const char *cmd) { | |
14587 | dump_stack_reset(sc); | |
14588 | sc->envir = sc->global_env; | |
14589 | sc->file_i=0; | |
14590 | sc->load_stack[0].kind=port_input|port_string; | |
14591 | sc->load_stack[0].rep.string.start=(char*)cmd; | |
14592 | sc->load_stack[0].rep.string.past_the_end=(char*)cmd+strlen(cmd); | |
14593 | sc->load_stack[0].rep.string.curr=(char*)cmd; | |
14594 | sc->loadport=mk_port(sc,sc->load_stack); | |
14595 | sc->retcode=0; | |
14596 | sc->interactive_repl=0; | |
14597 | sc->inport=sc->loadport; | |
14598 | Eval_Cycle(sc, OP_T0LVL); | |
14599 | ((sc->loadport)->_flag)=16384; | |
14600 | if(sc->retcode==0) { | |
14601 | sc->retcode=sc->nesting!=0; | |
14602 | } | |
14603 | } | |
14604 | ||
14605 | void scheme_define(scheme *sc, pointer envir, pointer symbol, pointer value) { | |
14606 | pointer x; | |
14607 | ||
14608 | x=find_slot_in_env(sc,envir,symbol,0); | |
14609 | if (x != sc->NIL) { | |
14610 | set_slot_in_env(sc, x, value); | |
14611 | } else { | |
14612 | new_slot_spec_in_env(sc, envir, symbol, value); | |
14613 | } | |
14614 | } | |
14615 | ||
14616 | ||
14617 | void scheme_apply0(scheme *sc, const char *procname) { | |
14618 | pointer carx=mk_symbol(sc,procname); | |
14619 | pointer cdrx=sc->NIL; | |
14620 | ||
14621 | dump_stack_reset(sc); | |
14622 | sc->envir = sc->global_env; | |
14623 | sc->code = _cons(sc,carx,cdrx,0); | |
14624 | sc->interactive_repl=0; | |
14625 | sc->retcode=0; | |
14626 | Eval_Cycle(sc,OP_EVAL); | |
14627 | } | |
14628 | ||
14629 | void scheme_call(scheme *sc, pointer func, pointer args) { | |
14630 | dump_stack_reset(sc); | |
14631 | sc->envir = sc->global_env; | |
14632 | sc->args = args; | |
14633 | sc->code = func; | |
14634 | sc->interactive_repl =0; | |
14635 | sc->retcode = 0; | |
14636 | Eval_Cycle(sc, OP_APPLY); | |
14637 | } |