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