Allow $SIG{CHLD}='IGNORE' to work on Solaris
[p5sagit/p5-mst-13.2.git] / opcode.pl
1 #!/usr/bin/perl
2
3 unlink "opcode.h";
4 open(OC, ">opcode.h") || die "Can't create opcode.h: $!\n";
5 select OC;
6
7 # Read data.
8
9 while (<DATA>) {
10     chop;
11     next unless $_;
12     next if /^#/;
13     ($key, $desc, $check, $flags, $args) = split(/\t+/, $_, 5);
14
15     warn qq[Description "$desc" duplicates $seen{$desc}\n] if $seen{$desc};
16     die qq[Opcode "$key" duplicates $seen{$key}\n] if $seen{$key};
17     $seen{$desc} = qq[description of opcode "$key"];
18     $seen{$key} = qq[opcode "$key"];
19
20     push(@ops, $key);
21     $desc{$key} = $desc;
22     $check{$key} = $check;
23     $ckname{$check}++;
24     $flags{$key} = $flags;
25     $args{$key} = $args;
26 }
27
28 # Emit defines.
29
30 $i = 0;
31 print <<"END";
32 #define pp_i_preinc pp_preinc
33 #define pp_i_predec pp_predec
34 #define pp_i_postinc pp_postinc
35 #define pp_i_postdec pp_postdec
36
37 typedef enum {
38 END
39 for (@ops) {
40     print "\t", &tab(3,"OP_\U$_,"), "/* ", $i++, " */\n";
41 }
42 print "\t", &tab(3,"OP_max"), "\n";
43 print "} opcode;\n";
44 print "\n#define MAXO ", scalar @ops, "\n\n"; 
45
46 # Emit op names and descriptions.
47
48 print <<END;
49 #ifndef DOINIT
50 EXT char *op_name[];
51 #else
52 EXT char *op_name[] = {
53 END
54
55 for (@ops) {
56     print qq(\t"$_",\n);
57 }
58
59 print <<END;
60 };
61 #endif
62
63 END
64
65 print <<END;
66 #ifndef DOINIT
67 EXT char *op_desc[];
68 #else
69 EXT char *op_desc[] = {
70 END
71
72 for (@ops) {
73     print qq(\t"$desc{$_}",\n);
74 }
75
76 print <<END;
77 };
78 #endif
79
80 #ifndef PERL_OBJECT
81 START_EXTERN_C
82
83 END
84
85 # Emit function declarations.
86
87 for (sort keys %ckname) {
88     print "OP *\t", &tab(3,$_),"_((OP* o));\n";
89 }
90
91 print "\n";
92
93 for (@ops) {
94     print "OP *\t", &tab(3, "pp_$_"), "_((ARGSproto));\n";
95 }
96
97 # Emit ppcode switch array.
98
99 print <<END;
100
101 END_EXTERN_C
102 #endif  /* PERL_OBJECT */
103
104 #ifndef DOINIT
105 EXT OP * (CPERLscope(*ppaddr)[])(ARGSproto);
106 #else
107 #ifndef PERL_OBJECT
108 EXT OP * (CPERLscope(*ppaddr)[])(ARGSproto) = {
109 END
110
111 for (@ops) {
112     print "\tpp_$_,\n";
113 }
114
115 print <<END;
116 };
117 #endif  /* PERL_OBJECT */
118 #endif
119
120 END
121
122 # Emit check routines.
123
124 print <<END;
125 #ifndef DOINIT
126 EXT OP * (CPERLscope(*check)[]) _((OP *op));
127 #else
128 #ifndef PERL_OBJECT
129 EXT OP * (CPERLscope(*check)[]) _((OP *op)) = {
130 END
131
132 for (@ops) {
133     print "\t", &tab(3, "$check{$_},"), "/* $_ */\n";
134 }
135
136 print <<END;
137 };
138 #endif  /* PERL_OBJECT */
139 #endif
140
141 END
142
143 # Emit allowed argument types.
144
145 print <<END;
146 #ifndef DOINIT
147 EXT U32 opargs[];
148 #else
149 EXT U32 opargs[] = {
150 END
151
152 %argnum = (
153     S,  1,              # scalar
154     L,  2,              # list
155     A,  3,              # array value
156     H,  4,              # hash value
157     C,  5,              # code value
158     F,  6,              # file value
159     R,  7,              # scalar reference
160 );
161
162 %opclass = (
163     '0',  0,            # baseop
164     '1',  1,            # unop
165     '2',  2,            # binop
166     '|',  3,            # logop
167     '?',  4,            # condop
168     '@',  5,            # listop
169     '/',  6,            # pmop
170     '$',  7,            # svop
171     '*',  8,            # gvop
172     '"',  9,            # pvop
173     '{',  10,           # loop
174     ';',  11,           # cop
175     '%',  12,           # baseop_or_unop
176     '-',  13,           # filestatop
177     '}',  14,           # loopexop
178 );
179
180 for (@ops) {
181     $argsum = 0;
182     $flags = $flags{$_};
183     $argsum |= 1 if $flags =~ /m/;              # needs stack mark
184     $argsum |= 2 if $flags =~ /f/;              # fold constants
185     $argsum |= 4 if $flags =~ /s/;              # always produces scalar
186     $argsum |= 8 if $flags =~ /t/;              # needs target scalar
187     $argsum |= 16 if $flags =~ /i/;             # always produces integer
188     $argsum |= 32 if $flags =~ /I/;             # has corresponding int op
189     $argsum |= 64 if $flags =~ /d/;             # danger, unknown side effects
190     $argsum |= 128 if $flags =~ /u/;            # defaults to $_
191
192     $flags =~ /([^a-zA-Z])/ or die qq[Opcode "$_" has no class indicator];
193     $argsum |= $opclass{$1} << 8;
194     $mul = 4096;                                # 2 ^ OASHIFT
195     for $arg (split(' ',$args{$_})) {
196         $argnum = ($arg =~ s/\?//) ? 8 : 0;
197         $argnum += $argnum{$arg};
198         $argsum += $argnum * $mul;
199         $mul <<= 4;
200     }
201     $argsum = sprintf("0x%08x", $argsum);
202     print "\t", &tab(3, "$argsum,"), "/* $_ */\n";
203 }
204
205 print <<END;
206 };
207 #endif
208 END
209
210 close OC or die "Error closing opcode.h: $!";
211
212 open PP, '>pp_proto.h' or die "Error creating pp_proto.h: $!";
213 for (@ops) {
214     print PP "PPDEF(pp_$_)\n";
215 }
216
217 close PP or die "Error closing pp_proto.h: $!";
218
219 ###########################################################################
220 sub tab {
221     local($l, $t) = @_;
222     $t .= "\t" x ($l - (length($t) + 1) / 8);
223     $t;
224 }
225 ###########################################################################
226 __END__
227
228 # Nothing.
229
230 null            null operation          ck_null         0       
231 stub            stub                    ck_null         0
232 scalar          scalar                  ck_fun          s%      S
233
234 # Pushy stuff.
235
236 pushmark        pushmark                ck_null         s0      
237 wantarray       wantarray               ck_null         is0     
238
239 const           constant item           ck_svconst      s$      
240
241 gvsv            scalar variable         ck_null         ds*     
242 gv              glob value              ck_null         ds*     
243 gelem           glob elem               ck_null         d2      S S
244 padsv           private variable        ck_null         ds0
245 padav           private array           ck_null         d0
246 padhv           private hash            ck_null         d0
247 padany          private something       ck_null         d0
248
249 pushre          push regexp             ck_null         /
250
251 # References and stuff.
252
253 rv2gv           ref-to-glob cast        ck_rvconst      ds1     
254 rv2sv           scalar deref            ck_rvconst      ds1     
255 av2arylen       array length            ck_null         is1     
256 rv2cv           subroutine deref        ck_rvconst      d1
257 anoncode        anonymous subroutine    ck_anoncode     $       
258 prototype       subroutine prototype    ck_null         s%      S
259 refgen          reference constructor   ck_spair        m1      L
260 srefgen         scalar ref constructor  ck_null         fs1     S
261 ref             reference-type operator ck_fun          stu%    S?
262 bless           bless                   ck_fun          s@      S S?
263
264 # Pushy I/O.
265
266 backtick        backticks               ck_null         t%      
267 # glob defaults its first arg to $_
268 glob            glob                    ck_glob         t@      S? S?
269 readline        <HANDLE>                ck_null         t%      
270 rcatline        append I/O operator     ck_null         t%      
271
272 # Bindable operators.
273
274 regcmaybe       regexp comp once        ck_fun          s1      S
275 regcomp         regexp compilation      ck_null         s|      S
276 match           pattern match           ck_match        d/
277 subst           substitution            ck_null         dis/    S
278 substcont       substitution cont       ck_null         dis|    
279 trans           character translation   ck_null         is"     S
280
281 # Lvalue operators.
282 # sassign is special-cased for op class
283
284 sassign         scalar assignment       ck_null         s0
285 aassign         list assignment         ck_null         t2      L L
286
287 chop            chop                    ck_spair        mts%    L
288 schop           scalar chop             ck_null         stu%    S?
289 chomp           safe chop               ck_spair        mts%    L
290 schomp          scalar safe chop        ck_null         stu%    S?
291 defined         defined operator        ck_rfun         isu%    S?
292 undef           undef operator          ck_lfun         s%      S?
293 study           study                   ck_fun          su%     S?
294 pos             match position          ck_lfun         stu%    S?
295
296 preinc          preincrement            ck_lfun         dIs1    S
297 i_preinc        integer preincrement    ck_lfun         dis1    S
298 predec          predecrement            ck_lfun         dIs1    S
299 i_predec        integer predecrement    ck_lfun         dis1    S
300 postinc         postincrement           ck_lfun         dIst1   S
301 i_postinc       integer postincrement   ck_lfun         dist1   S
302 postdec         postdecrement           ck_lfun         dIst1   S
303 i_postdec       integer postdecrement   ck_lfun         dist1   S
304
305 # Ordinary operators.
306
307 pow             exponentiation          ck_null         fst2    S S
308
309 multiply        multiplication          ck_null         Ifst2   S S
310 i_multiply      integer multiplication  ck_null         ifst2   S S
311 divide          division                ck_null         Ifst2   S S
312 i_divide        integer division        ck_null         ifst2   S S
313 modulo          modulus                 ck_null         Iifst2  S S
314 i_modulo        integer modulus         ck_null         ifst2   S S
315 repeat          repeat                  ck_repeat       mt2     L S
316
317 add             addition                ck_null         Ifst2   S S
318 i_add           integer addition        ck_null         ifst2   S S
319 subtract        subtraction             ck_null         Ifst2   S S
320 i_subtract      integer subtraction     ck_null         ifst2   S S
321 concat          concatenation           ck_concat       fst2    S S
322 stringify       string                  ck_fun          fst@    S
323
324 left_shift      left bitshift           ck_bitop        fst2    S S
325 right_shift     right bitshift          ck_bitop        fst2    S S
326
327 lt              numeric lt              ck_null         Iifs2   S S
328 i_lt            integer lt              ck_null         ifs2    S S
329 gt              numeric gt              ck_null         Iifs2   S S
330 i_gt            integer gt              ck_null         ifs2    S S
331 le              numeric le              ck_null         Iifs2   S S
332 i_le            integer le              ck_null         ifs2    S S
333 ge              numeric ge              ck_null         Iifs2   S S
334 i_ge            integer ge              ck_null         ifs2    S S
335 eq              numeric eq              ck_null         Iifs2   S S
336 i_eq            integer eq              ck_null         ifs2    S S
337 ne              numeric ne              ck_null         Iifs2   S S
338 i_ne            integer ne              ck_null         ifs2    S S
339 ncmp            spaceship operator      ck_null         Iifst2  S S
340 i_ncmp          integer spaceship       ck_null         ifst2   S S
341
342 slt             string lt               ck_scmp         ifs2    S S
343 sgt             string gt               ck_scmp         ifs2    S S
344 sle             string le               ck_scmp         ifs2    S S
345 sge             string ge               ck_scmp         ifs2    S S
346 seq             string eq               ck_null         ifs2    S S
347 sne             string ne               ck_null         ifs2    S S
348 scmp            string comparison       ck_scmp         ifst2   S S
349
350 bit_and         bitwise and             ck_bitop        fst2    S S
351 bit_xor         bitwise xor             ck_bitop        fst2    S S
352 bit_or          bitwise or              ck_bitop        fst2    S S
353
354 negate          negate                  ck_null         Ifst1   S
355 i_negate        integer negate          ck_null         ifst1   S
356 not             not                     ck_null         ifs1    S
357 complement      1's complement          ck_bitop        fst1    S
358
359 # High falutin' math.
360
361 atan2           atan2                   ck_fun          fst@    S S
362 sin             sin                     ck_fun          fstu%   S?
363 cos             cos                     ck_fun          fstu%   S?
364 rand            rand                    ck_fun          st%     S?
365 srand           srand                   ck_fun          s%      S?
366 exp             exp                     ck_fun          fstu%   S?
367 log             log                     ck_fun          fstu%   S?
368 sqrt            sqrt                    ck_fun          fstu%   S?
369
370 # Lowbrow math.
371
372 int             int                     ck_fun          fstu%   S?
373 hex             hex                     ck_fun          fstu%   S?
374 oct             oct                     ck_fun          fstu%   S?
375 abs             abs                     ck_fun          fstu%   S?
376
377 # String stuff.
378
379 length          length                  ck_lengthconst  istu%   S?
380 substr          substr                  ck_fun          st@     S S S? S?
381 vec             vec                     ck_fun          ist@    S S S
382
383 index           index                   ck_index        ist@    S S S?
384 rindex          rindex                  ck_index        ist@    S S S?
385
386 sprintf         sprintf                 ck_fun_locale   mfst@   S L
387 formline        formline                ck_fun          ms@     S L
388 ord             ord                     ck_fun          ifstu%  S?
389 chr             chr                     ck_fun          fstu%   S?
390 crypt           crypt                   ck_fun          fst@    S S
391 ucfirst         upper case first        ck_fun_locale   fstu%   S?
392 lcfirst         lower case first        ck_fun_locale   fstu%   S?
393 uc              upper case              ck_fun_locale   fstu%   S?
394 lc              lower case              ck_fun_locale   fstu%   S?
395 quotemeta       quote metachars         ck_fun          fstu%   S?
396
397 # Arrays.
398
399 rv2av           array deref             ck_rvconst      dt1     
400 aelemfast       known array element     ck_null         s*      A S
401 aelem           array element           ck_null         s2      A S
402 aslice          array slice             ck_null         m@      A L
403
404 # Hashes.
405
406 each            each                    ck_fun          t%      H
407 values          values                  ck_fun          t%      H
408 keys            keys                    ck_fun          t%      H
409 delete          delete                  ck_delete       %       S
410 exists          exists operator         ck_exists       is%     S
411 rv2hv           hash deref              ck_rvconst      dt1     
412 helem           hash elem               ck_null         s2@     H S
413 hslice          hash slice              ck_null         m@      H L
414
415 # Explosives and implosives.
416
417 unpack          unpack                  ck_fun          @       S S
418 pack            pack                    ck_fun          mst@    S L
419 split           split                   ck_split        t@      S S S
420 join            join                    ck_fun          mst@    S L
421
422 # List operators.
423
424 list            list                    ck_null         m@      L
425 lslice          list slice              ck_null         2       H L L
426 anonlist        anonymous list          ck_fun          ms@     L
427 anonhash        anonymous hash          ck_fun          ms@     L
428
429 splice          splice                  ck_fun          m@      A S? S? L
430 push            push                    ck_fun          imst@   A L
431 pop             pop                     ck_shift        si%     A
432 shift           shift                   ck_shift        s%      A
433 unshift         unshift                 ck_fun          imst@   A L
434 sort            sort                    ck_sort         m@      C? L
435 reverse         reverse                 ck_fun          mt@     L
436
437 grepstart       grep                    ck_grep         dm@     C L
438 grepwhile       grep iterator           ck_null         dt|     
439
440 mapstart        map                     ck_grep         dm@     C L
441 mapwhile        map iterator            ck_null         dt|
442
443 # Range stuff.
444
445 range           flipflop                ck_null         ?       S S
446 flip            range (or flip)         ck_null         1       S S
447 flop            range (or flop)         ck_null         1
448
449 # Control.
450
451 and             logical and             ck_null         |       
452 or              logical or              ck_null         |       
453 xor             logical xor             ck_null         fs|     S S     
454 cond_expr       conditional expression  ck_null         d?      
455 andassign       logical and assignment  ck_null         s|      
456 orassign        logical or assignment   ck_null         s|      
457
458 method          method lookup           ck_null         d1
459 entersub        subroutine entry        ck_subr         dmt1    L
460 leavesub        subroutine exit         ck_null         1       
461 caller          caller                  ck_fun          t%      S?
462 warn            warn                    ck_fun          imst@   L
463 die             die                     ck_fun          dimst@  L
464 reset           reset                   ck_fun          is%     S?
465
466 lineseq         line sequence           ck_null         @       
467 nextstate       next statement          ck_null         s;      
468 dbstate         debug next statement    ck_null         s;      
469 unstack         unstack                 ck_null         s0
470 enter           block entry             ck_null         0       
471 leave           block exit              ck_null         @       
472 scope           block                   ck_null         @       
473 enteriter       foreach loop entry      ck_null         d{      
474 iter            foreach loop iterator   ck_null         0       
475 enterloop       loop entry              ck_null         d{      
476 leaveloop       loop exit               ck_null         2       
477 return          return                  ck_null         dm@     L
478 last            last                    ck_null         ds}     
479 next            next                    ck_null         ds}     
480 redo            redo                    ck_null         ds}     
481 dump            dump                    ck_null         ds}     
482 goto            goto                    ck_null         ds}     
483 exit            exit                    ck_fun          ds%     S?
484
485 #nswitch                numeric switch          ck_null         d       
486 #cswitch                character switch        ck_null         d       
487
488 # I/O.
489
490 open            open                    ck_fun          ist@    F S?
491 close           close                   ck_fun          is%     F?
492 pipe_op         pipe                    ck_fun          is@     F F
493
494 fileno          fileno                  ck_fun          ist%    F
495 umask           umask                   ck_fun          ist%    S?
496 binmode         binmode                 ck_fun          s%      F
497
498 tie             tie                     ck_fun          idms@   R S L
499 untie           untie                   ck_fun          is%     R
500 tied            tied                    ck_fun          s%      R
501 dbmopen         dbmopen                 ck_fun          is@     H S S
502 dbmclose        dbmclose                ck_fun          is%     H
503
504 sselect         select system call      ck_select       t@      S S S S
505 select          select                  ck_select       st@     F?
506
507 getc            getc                    ck_eof          st%     F?
508 read            read                    ck_fun          imst@   F R S S?
509 enterwrite      write                   ck_fun          dis%    F?
510 leavewrite      write exit              ck_null         1       
511
512 prtf            printf                  ck_listiob      ims@    F? L
513 print           print                   ck_listiob      ims@    F? L
514
515 sysopen         sysopen                 ck_fun          s@      F S S S?
516 sysseek         sysseek                 ck_fun          s@      F S S
517 sysread         sysread                 ck_fun          imst@   F R S S?
518 syswrite        syswrite                ck_fun          imst@   F S S S?
519
520 send            send                    ck_fun          imst@   F S S S?
521 recv            recv                    ck_fun          imst@   F R S S
522
523 eof             eof                     ck_eof          is%     F?
524 tell            tell                    ck_fun          st%     F?
525 seek            seek                    ck_fun          s@      F S S
526 # truncate really behaves as if it had both "S S" and "F S"
527 truncate        truncate                ck_trunc        is@     S S
528
529 fcntl           fcntl                   ck_fun          st@     F S S
530 ioctl           ioctl                   ck_fun          st@     F S S
531 flock           flock                   ck_fun          ist@    F S
532
533 # Sockets.
534
535 socket          socket                  ck_fun          is@     F S S S
536 sockpair        socketpair              ck_fun          is@     F F S S S
537
538 bind            bind                    ck_fun          is@     F S
539 connect         connect                 ck_fun          is@     F S
540 listen          listen                  ck_fun          is@     F S
541 accept          accept                  ck_fun          ist@    F F
542 shutdown        shutdown                ck_fun          ist@    F S
543
544 gsockopt        getsockopt              ck_fun          is@     F S S
545 ssockopt        setsockopt              ck_fun          is@     F S S S
546
547 getsockname     getsockname             ck_fun          is%     F
548 getpeername     getpeername             ck_fun          is%     F
549
550 # Stat calls.
551
552 lstat           lstat                   ck_ftst         u-      F
553 stat            stat                    ck_ftst         u-      F
554 ftrread         -R                      ck_ftst         isu-    F
555 ftrwrite        -W                      ck_ftst         isu-    F
556 ftrexec         -X                      ck_ftst         isu-    F
557 fteread         -r                      ck_ftst         isu-    F
558 ftewrite        -w                      ck_ftst         isu-    F
559 fteexec         -x                      ck_ftst         isu-    F
560 ftis            -e                      ck_ftst         isu-    F
561 fteowned        -O                      ck_ftst         isu-    F
562 ftrowned        -o                      ck_ftst         isu-    F
563 ftzero          -z                      ck_ftst         isu-    F
564 ftsize          -s                      ck_ftst         istu-   F
565 ftmtime         -M                      ck_ftst         stu-    F
566 ftatime         -A                      ck_ftst         stu-    F
567 ftctime         -C                      ck_ftst         stu-    F
568 ftsock          -S                      ck_ftst         isu-    F
569 ftchr           -c                      ck_ftst         isu-    F
570 ftblk           -b                      ck_ftst         isu-    F
571 ftfile          -f                      ck_ftst         isu-    F
572 ftdir           -d                      ck_ftst         isu-    F
573 ftpipe          -p                      ck_ftst         isu-    F
574 ftlink          -l                      ck_ftst         isu-    F
575 ftsuid          -u                      ck_ftst         isu-    F
576 ftsgid          -g                      ck_ftst         isu-    F
577 ftsvtx          -k                      ck_ftst         isu-    F
578 fttty           -t                      ck_ftst         is-     F
579 fttext          -T                      ck_ftst         isu-    F
580 ftbinary        -B                      ck_ftst         isu-    F
581
582 # File calls.
583
584 chdir           chdir                   ck_fun          ist%    S?
585 chown           chown                   ck_fun          imst@   L
586 chroot          chroot                  ck_fun          istu%   S?
587 unlink          unlink                  ck_fun          imstu@  L
588 chmod           chmod                   ck_fun          imst@   L
589 utime           utime                   ck_fun          imst@   L
590 rename          rename                  ck_fun          ist@    S S
591 link            link                    ck_fun          ist@    S S
592 symlink         symlink                 ck_fun          ist@    S S
593 readlink        readlink                ck_fun          stu%    S?
594 mkdir           mkdir                   ck_fun          ist@    S S
595 rmdir           rmdir                   ck_fun          istu%   S?
596
597 # Directory calls.
598
599 open_dir        opendir                 ck_fun          is@     F S
600 readdir         readdir                 ck_fun          %       F
601 telldir         telldir                 ck_fun          st%     F
602 seekdir         seekdir                 ck_fun          s@      F S
603 rewinddir       rewinddir               ck_fun          s%      F
604 closedir        closedir                ck_fun          is%     F
605
606 # Process control.
607
608 fork            fork                    ck_null         ist0    
609 wait            wait                    ck_null         ist0    
610 waitpid         waitpid                 ck_fun          ist@    S S
611 system          system                  ck_exec         imst@   S? L
612 exec            exec                    ck_exec         dimst@  S? L
613 kill            kill                    ck_fun          dimst@  L
614 getppid         getppid                 ck_null         ist0    
615 getpgrp         getpgrp                 ck_fun          ist%    S?
616 setpgrp         setpgrp                 ck_fun          ist@    S? S?
617 getpriority     getpriority             ck_fun          ist@    S S
618 setpriority     setpriority             ck_fun          ist@    S S S
619
620 # Time calls.
621
622 time            time                    ck_null         ist0    
623 tms             times                   ck_null         0       
624 localtime       localtime               ck_fun          t%      S?
625 gmtime          gmtime                  ck_fun          t%      S?
626 alarm           alarm                   ck_fun          istu%   S?
627 sleep           sleep                   ck_fun          ist%    S?
628
629 # Shared memory.
630
631 shmget          shmget                  ck_fun          imst@   S S S
632 shmctl          shmctl                  ck_fun          imst@   S S S
633 shmread         shmread                 ck_fun          imst@   S S S S
634 shmwrite        shmwrite                ck_fun          imst@   S S S S
635
636 # Message passing.
637
638 msgget          msgget                  ck_fun          imst@   S S
639 msgctl          msgctl                  ck_fun          imst@   S S S
640 msgsnd          msgsnd                  ck_fun          imst@   S S S
641 msgrcv          msgrcv                  ck_fun          imst@   S S S S S
642
643 # Semaphores.
644
645 semget          semget                  ck_fun          imst@   S S S
646 semctl          semctl                  ck_fun          imst@   S S S S
647 semop           semop                   ck_fun          imst@   S S
648
649 # Eval.
650
651 require         require                 ck_require      du%     S?
652 dofile          do 'file'               ck_fun          d1      S
653 entereval       eval string             ck_eval         d%      S
654 leaveeval       eval exit               ck_null         1       S
655 #evalonce       eval constant string    ck_null         d1      S
656 entertry        eval block              ck_null         |       
657 leavetry        eval block exit         ck_null         @       
658
659 # Get system info.
660
661 ghbyname        gethostbyname           ck_fun          %       S
662 ghbyaddr        gethostbyaddr           ck_fun          @       S S
663 ghostent        gethostent              ck_null         0       
664 gnbyname        getnetbyname            ck_fun          %       S
665 gnbyaddr        getnetbyaddr            ck_fun          @       S S
666 gnetent         getnetent               ck_null         0       
667 gpbyname        getprotobyname          ck_fun          %       S
668 gpbynumber      getprotobynumber        ck_fun          @       S
669 gprotoent       getprotoent             ck_null         0       
670 gsbyname        getservbyname           ck_fun          @       S S
671 gsbyport        getservbyport           ck_fun          @       S S
672 gservent        getservent              ck_null         0       
673 shostent        sethostent              ck_fun          is%     S
674 snetent         setnetent               ck_fun          is%     S
675 sprotoent       setprotoent             ck_fun          is%     S
676 sservent        setservent              ck_fun          is%     S
677 ehostent        endhostent              ck_null         is0     
678 enetent         endnetent               ck_null         is0     
679 eprotoent       endprotoent             ck_null         is0     
680 eservent        endservent              ck_null         is0     
681 gpwnam          getpwnam                ck_fun          %       S
682 gpwuid          getpwuid                ck_fun          %       S
683 gpwent          getpwent                ck_null         0       
684 spwent          setpwent                ck_null         is0     
685 epwent          endpwent                ck_null         is0     
686 ggrnam          getgrnam                ck_fun          %       S
687 ggrgid          getgrgid                ck_fun          %       S
688 ggrent          getgrent                ck_null         0       
689 sgrent          setgrent                ck_null         is0     
690 egrent          endgrent                ck_null         is0     
691 getlogin        getlogin                ck_null         st0     
692
693 # Miscellaneous.
694
695 syscall         syscall                 ck_fun          imst@   S L
696
697 # For multi-threading
698 lock            lock                    ck_rfun         s%      S
699 threadsv        per-thread variable     ck_null         ds0