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