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