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