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