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