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