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