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