Commit | Line | Data |
e3b8966e |
1 | |
2 | # creates a C API file from proto.h |
3 | # takes one argument, the path to lib/CORE directory. |
6de196ee |
4 | # creates 2 files: "perlCAPI.cpp" and "perlCAPI.h". |
e3b8966e |
5 | |
6de196ee |
6 | my $hdrfile = "$ARGV[0]\\perlCAPI.h"; |
e3b8966e |
7 | my $infile = '..\\proto.h'; |
8 | my $embedfile = '..\\embed.h'; |
9 | my $separateObj = 0; |
10 | |
11 | my %skip_list; |
12 | my %embed; |
13 | |
14 | sub readembed(\%$) { |
15 | my ($syms, $file) = @_; |
16 | my ($line, @words); |
17 | %$syms = (); |
18 | local (*FILE, $_); |
19 | open(FILE, "< $file") |
20 | or die "$0: Can't open $file: $!\n"; |
21 | while ($line = <FILE>) { |
22 | chop($line); |
23 | if ($line =~ /^#define\s+\w+/) { |
24 | $line =~ s/^#define\s+//; |
25 | @words = split ' ', $line; |
26 | # print "$words[0]\t$words[1]\n"; |
27 | $$syms{$words[0]} = $words[1]; |
28 | } |
29 | } |
30 | close(FILE); |
31 | } |
32 | |
33 | readembed %embed, $embedfile; |
34 | |
35 | sub skip_these { |
36 | my $list = shift; |
37 | foreach my $symbol (@$list) { |
38 | $skip_list{$symbol} = 1; |
39 | } |
40 | } |
41 | |
42 | skip_these [qw( |
43 | cando |
44 | cast_ulong |
45 | my_chsize |
46 | condpair_magic |
47 | deb |
48 | deb_growlevel |
49 | debprofdump |
50 | debop |
51 | debstack |
52 | debstackptrs |
58a50f62 |
53 | dump_fds |
54 | dump_mstats |
e3b8966e |
55 | fprintf |
56 | find_threadsv |
57 | magic_mutexfree |
58a50f62 |
58 | my_memcmp |
59 | my_memset |
e3b8966e |
60 | my_pclose |
61 | my_popen |
62 | my_swap |
63 | my_htonl |
64 | my_ntohl |
65 | new_struct_thread |
66 | same_dirent |
67 | unlnk |
68 | unlock_condpair |
69 | safexmalloc |
70 | safexcalloc |
71 | safexrealloc |
72 | safexfree |
73 | Perl_GetVars |
066ef5b5 |
74 | malloced_size |
e3b8966e |
75 | )]; |
76 | |
77 | |
78 | |
79 | if (!open(INFILE, "<$infile")) { |
80 | print "open of $infile failed: $!\n"; |
81 | return 1; |
82 | } |
83 | |
6de196ee |
84 | if (!open(OUTFILE, ">perlCAPI.cpp")) { |
85 | print "open of perlCAPI.cpp failed: $!\n"; |
e3b8966e |
86 | return 1; |
87 | } |
88 | |
b207eff1 |
89 | print OUTFILE <<ENDCODE; |
90 | #include "EXTERN.h" |
91 | #include "perl.h" |
92 | #include "XSUB.h" |
93 | |
94 | #define DESTRUCTORFUNC (void (*)(void*)) |
95 | |
96 | ENDCODE |
97 | |
98 | print OUTFILE "#ifdef SetCPerlObj_defined\n" unless ($separateObj == 0); |
99 | |
100 | print OUTFILE <<ENDCODE; |
101 | extern "C" void SetCPerlObj(CPerlObj* pP) |
102 | { |
103 | pPerl = pP; |
104 | } |
105 | |
106 | ENDCODE |
107 | |
e3b8966e |
108 | print OUTFILE "#endif\n" unless ($separateObj == 0); |
109 | |
110 | while () { |
111 | last unless defined ($_ = <INFILE>); |
112 | if (/^VIRTUAL\s/) { |
113 | while (!/;$/) { |
114 | chomp; |
115 | $_ .= <INFILE>; |
116 | } |
117 | $_ =~ s/^VIRTUAL\s*//; |
118 | $_ =~ s/\s*__attribute__.*$/;/; |
119 | if ( /(.*)\s([A-z_]*[0-9A-z_]+\s)_\(\((.*)\)\);/ || |
120 | /(.*)\*([A-z_]*[0-9A-z_]+\s)_\(\((.*)\)\);/ ) { |
121 | $type = $1; |
122 | $name = $2; |
123 | $args = $3; |
124 | |
125 | $name =~ s/\s*$//; |
126 | $type =~ s/\s*$//; |
127 | next if (defined $skip_list{$name}); |
128 | |
129 | if($args eq "ARGSproto") { |
130 | $args = "void"; |
131 | } |
132 | |
133 | $return = ($type eq "void" or $type eq "Free_t") ? "\t" : "\treturn"; |
134 | |
135 | if(defined $embed{$name}) { |
136 | $funcName = $embed{$name}; |
137 | } else { |
138 | $funcName = $name; |
139 | } |
140 | |
141 | @args = split(',', $args); |
142 | if ($args[$#args] =~ /\s*\.\.\.\s*/) { |
143 | if(($name eq "croak") or ($name eq "deb") or ($name eq "die") |
144 | or ($name eq "form") or ($name eq "warn")) { |
145 | print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); |
e3b8966e |
146 | $args[0] =~ /(\w+)\W*$/; |
147 | $arg = $1; |
b207eff1 |
148 | print OUTFILE <<ENDCODE; |
149 | |
150 | #undef $name |
151 | extern "C" $type $funcName ($args) |
152 | { |
153 | char *pstr; |
154 | char *pmsg; |
155 | va_list args; |
156 | va_start(args, $arg); |
157 | pmsg = pPerl->Perl_mess($arg, &args); |
158 | New(0, pstr, strlen(pmsg)+1, char); |
159 | strcpy(pstr, pmsg); |
160 | $return pPerl->Perl_$name(pstr); |
161 | va_end(args); |
162 | } |
163 | ENDCODE |
e3b8966e |
164 | print OUTFILE "#endif\n" unless ($separateObj == 0); |
165 | } |
166 | elsif($name eq "newSVpvf") { |
167 | print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); |
e3b8966e |
168 | $args[0] =~ /(\w+)\W*$/; |
169 | $arg = $1; |
b207eff1 |
170 | print OUTFILE <<ENDCODE; |
171 | |
172 | #undef $name |
173 | extern "C" $type $funcName ($args) |
174 | { |
175 | SV *sv; |
176 | va_list args; |
177 | va_start(args, $arg); |
178 | sv = pPerl->Perl_newSV(0); |
179 | pPerl->Perl_sv_vcatpvfn(sv, $arg, strlen($arg), &args, NULL, 0, NULL); |
180 | va_end(args); |
181 | return sv; |
182 | } |
183 | ENDCODE |
e3b8966e |
184 | print OUTFILE "#endif\n" unless ($separateObj == 0); |
185 | } |
186 | elsif($name eq "sv_catpvf") { |
187 | print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); |
e3b8966e |
188 | $args[0] =~ /(\w+)\W*$/; |
189 | $arg0 = $1; |
190 | $args[1] =~ /(\w+)\W*$/; |
191 | $arg1 = $1; |
b207eff1 |
192 | print OUTFILE <<ENDCODE; |
193 | |
194 | #undef $name |
195 | extern "C" $type $funcName ($args) |
196 | { |
197 | va_list args; |
198 | va_start(args, $arg1); |
199 | pPerl->Perl_sv_vcatpvfn($arg0, $arg1, strlen($arg1), &args, NULL, 0, NULL); |
200 | va_end(args); |
201 | } |
202 | ENDCODE |
e3b8966e |
203 | print OUTFILE "#endif\n" unless ($separateObj == 0); |
204 | } |
205 | elsif($name eq "sv_setpvf") { |
206 | print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); |
e3b8966e |
207 | $args[0] =~ /(\w+)\W*$/; |
208 | $arg0 = $1; |
209 | $args[1] =~ /(\w+)\W*$/; |
210 | $arg1 = $1; |
b207eff1 |
211 | print OUTFILE <<ENDCODE; |
212 | |
213 | #undef $name |
214 | extern "C" $type $funcName ($args) |
215 | { |
216 | va_list args; |
217 | va_start(args, $arg1); |
218 | pPerl->Perl_sv_vsetpvfn($arg0, $arg1, strlen($arg1), &args, NULL, 0, NULL); |
219 | va_end(args); |
220 | } |
221 | ENDCODE |
e3b8966e |
222 | print OUTFILE "#endif\n" unless ($separateObj == 0); |
223 | } |
224 | elsif($name eq "fprintf") { |
225 | print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); |
e3b8966e |
226 | $args[0] =~ /(\w+)\W*$/; |
227 | $arg0 = $1; |
228 | $args[1] =~ /(\w+)\W*$/; |
229 | $arg1 = $1; |
b207eff1 |
230 | print OUTFILE <<ENDCODE; |
231 | |
232 | #undef $name |
233 | extern "C" $type $name ($args) |
234 | { |
235 | int nRet; |
236 | va_list args; |
237 | va_start(args, $arg1); |
238 | nRet = PerlIO_vprintf($arg0, $arg1, args); |
239 | va_end(args); |
240 | return nRet; |
241 | } |
242 | ENDCODE |
e3b8966e |
243 | print OUTFILE "#endif\n" unless ($separateObj == 0); |
244 | } else { |
245 | print "Warning: can't handle varargs function '$name'\n"; |
246 | } |
247 | next; |
248 | } |
249 | |
250 | # newXS special case |
251 | if ($name eq "newXS") { |
252 | next; |
253 | } |
254 | |
255 | print OUTFILE "\n#ifdef $name" . "defined" unless ($separateObj == 0); |
256 | |
257 | # handle specical case for save_destructor |
258 | if ($name eq "save_destructor") { |
259 | next; |
260 | } |
261 | # handle specical case for sighandler |
262 | if ($name eq "sighandler") { |
263 | next; |
264 | } |
265 | # handle special case for sv_grow |
266 | if ($name eq "sv_grow" and $args eq "SV* sv, unsigned long newlen") { |
267 | next; |
268 | } |
269 | # handle special case for newSV |
270 | if ($name eq "newSV" and $args eq "I32 x, STRLEN len") { |
271 | next; |
272 | } |
273 | # handle special case for perl_parse |
274 | if ($name eq "perl_parse") { |
b207eff1 |
275 | print OUTFILE <<ENDCODE; |
276 | |
277 | #undef $name |
278 | extern "C" $type $name ($args) |
279 | { |
280 | return pPerl->perl_parse(xsinit, argc, argv, env); |
281 | } |
282 | ENDCODE |
e3b8966e |
283 | print OUTFILE "#endif\n" unless ($separateObj == 0); |
284 | next; |
285 | } |
35ff7856 |
286 | # handle special case for perl_atexit |
287 | if ($name eq "perl_atexit") { |
288 | print OUTFILE <<ENDCODE; |
289 | |
290 | #undef $name |
291 | extern "C" $type $name ($args) |
292 | { |
58a50f62 |
293 | pPerl->perl_atexit(fn, ptr); |
35ff7856 |
294 | } |
295 | ENDCODE |
296 | print OUTFILE "#endif\n" unless ($separateObj == 0); |
297 | next; |
298 | } |
299 | |
e3b8966e |
300 | |
9e6b2b00 |
301 | if($name eq "byterun" and $args eq "struct bytestream bs") { |
302 | next; |
303 | } |
304 | |
e3b8966e |
305 | # foo(void); |
306 | if ($args eq "void") { |
b207eff1 |
307 | print OUTFILE <<ENDCODE; |
308 | |
309 | #undef $name |
310 | extern "C" $type $funcName () |
311 | { |
312 | $return pPerl->$funcName(); |
313 | } |
314 | |
315 | ENDCODE |
e3b8966e |
316 | print OUTFILE "#endif\n" unless ($separateObj == 0); |
317 | next; |
318 | } |
319 | |
320 | # foo(char *s, const int bar); |
b207eff1 |
321 | print OUTFILE <<ENDCODE; |
322 | |
323 | #undef $name |
324 | extern "C" $type $funcName ($args) |
325 | { |
b207eff1 |
326 | ENDCODE |
35ff7856 |
327 | print OUTFILE "$return pPerl->$funcName"; |
e3b8966e |
328 | $doneone = 0; |
329 | foreach $arg (@args) { |
330 | if ($arg =~ /(\w+)\W*$/) { |
331 | if ($doneone) { |
332 | print OUTFILE ", $1"; |
333 | } |
334 | else { |
335 | print OUTFILE "($1"; |
336 | $doneone++; |
337 | } |
338 | } |
339 | } |
340 | print OUTFILE ");\n}\n"; |
341 | print OUTFILE "#endif\n" unless ($separateObj == 0); |
342 | } |
343 | else { |
344 | print "failed to match $_"; |
345 | } |
346 | } |
347 | } |
348 | |
349 | close INFILE; |
350 | |
351 | %skip_list = (); |
352 | |
353 | skip_these [qw( |
354 | strchop |
355 | filemode |
356 | lastfd |
357 | oldname |
358 | curinterp |
359 | Argv |
360 | Cmd |
361 | sortcop |
362 | sortstash |
363 | firstgv |
364 | secondgv |
365 | sortstack |
366 | signalstack |
367 | mystrk |
368 | dumplvl |
369 | oldlastpm |
370 | gensym |
371 | preambled |
372 | preambleav |
373 | Ilaststatval |
374 | Ilaststype |
375 | mess_sv |
376 | ors |
377 | opsave |
378 | eval_mutex |
379 | orslen |
380 | ofmt |
e3b8966e |
381 | modcount |
382 | generation |
383 | DBcv |
384 | archpat_auto |
385 | sortcxix |
386 | lastgotoprobe |
387 | regdummy |
77d41b28 |
388 | regcomp_parse |
e3b8966e |
389 | regxend |
390 | regcode |
391 | regnaughty |
392 | regsawback |
393 | regprecomp |
394 | regnpar |
395 | regsize |
396 | regflags |
397 | regseen |
398 | seen_zerolen |
77d41b28 |
399 | regcomp_rx |
e3b8966e |
400 | extralen |
401 | colorset |
402 | colors |
403 | reginput |
404 | regbol |
405 | regeol |
406 | regstartp |
407 | regendp |
408 | reglastparen |
409 | regtill |
410 | regprev |
411 | reg_start_tmp |
412 | reg_start_tmpl |
413 | regdata |
414 | bostr |
415 | reg_flags |
416 | reg_eval_set |
417 | regnarrate |
418 | regprogram |
419 | regindent |
420 | regcc |
421 | in_clean_objs |
422 | in_clean_all |
423 | linestart |
424 | pending_ident |
425 | statusvalue_vms |
426 | sublex_info |
427 | thrsv |
428 | threadnum |
4c2891ed |
429 | PL_piMem |
430 | PL_piENV |
431 | PL_piStdIO |
432 | PL_piLIO |
433 | PL_piDir |
434 | PL_piSock |
435 | PL_piProc |
e3b8966e |
436 | cshname |
437 | threadsv_names |
438 | thread |
439 | nthreads |
440 | thr_key |
441 | threads_mutex |
442 | malloc_mutex |
443 | svref_mutex |
444 | sv_mutex |
445 | nthreads_cond |
446 | eval_cond |
447 | cryptseen |
448 | cshlen |
449 | )]; |
450 | |
451 | sub readvars(\%$$) { |
452 | my ($syms, $file, $pre) = @_; |
453 | %$syms = (); |
454 | local (*FILE, $_); |
455 | open(FILE, "< $file") |
456 | or die "$0: Can't open $file: $!\n"; |
457 | while (<FILE>) { |
458 | s/[ \t]*#.*//; # Delete comments. |
459 | if (/PERLVARI?C?\($pre(\w+),\s*([^,)]+)/) { |
460 | $$syms{$1} = $2; |
461 | } |
462 | } |
463 | close(FILE); |
464 | } |
465 | |
466 | my %intrp; |
467 | my %thread; |
468 | my %globvar; |
469 | |
470 | readvars %intrp, '..\intrpvar.h','I'; |
471 | readvars %thread, '..\thrdvar.h','T'; |
472 | readvars %globvar, '..\perlvars.h','G'; |
473 | |
474 | open(HDRFILE, ">$hdrfile") or die "$0: Can't open $hdrfile: $!\n"; |
b207eff1 |
475 | print HDRFILE <<ENDCODE; |
476 | void SetCPerlObj(void* pP); |
477 | CV* Perl_newXS(char* name, void (*subaddr)(CV* cv), char* filename); |
478 | |
479 | ENDCODE |
e3b8966e |
480 | |
481 | sub DoVariable($$) { |
482 | my $name = shift; |
483 | my $type = shift; |
484 | |
485 | return if (defined $skip_list{$name}); |
486 | return if ($type eq 'struct perl_thread *'); |
487 | |
488 | print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); |
b207eff1 |
489 | print OUTFILE <<ENDCODE; |
4c2891ed |
490 | #undef PL_$name |
491 | extern "C" $type * _PL_$name () |
b207eff1 |
492 | { |
4c2891ed |
493 | return (($type *)&pPerl->PL_$name); |
b207eff1 |
494 | } |
495 | |
496 | ENDCODE |
497 | |
e3b8966e |
498 | print OUTFILE "#endif\n" unless ($separateObj == 0); |
499 | |
b207eff1 |
500 | print HDRFILE <<ENDCODE; |
501 | |
4c2891ed |
502 | #undef PL_$name |
503 | $type * _PL_$name (); |
504 | #define PL_$name (*_PL_$name()) |
b207eff1 |
505 | |
506 | ENDCODE |
507 | |
e3b8966e |
508 | } |
509 | |
510 | foreach $key (keys %intrp) { |
511 | DoVariable ($key, $intrp{$key}); |
512 | } |
513 | |
514 | foreach $key (keys %thread) { |
515 | DoVariable ($key, $thread{$key}); |
516 | } |
517 | |
518 | foreach $key (keys %globvar) { |
519 | DoVariable ($key, $globvar{$key}); |
520 | } |
521 | |
522 | print OUTFILE <<EOCODE; |
523 | |
524 | |
525 | extern "C" { |
9e6b2b00 |
526 | |
527 | |
528 | char ** _Perl_op_desc(void) |
529 | { |
530 | return pPerl->Perl_get_op_descs(); |
531 | } |
532 | |
533 | char ** _Perl_op_name(void) |
534 | { |
535 | return pPerl->Perl_get_op_names(); |
536 | } |
537 | |
538 | char * _Perl_no_modify(void) |
539 | { |
540 | return pPerl->Perl_get_no_modify(); |
541 | } |
542 | |
543 | U32 * _Perl_opargs(void) |
544 | { |
545 | return pPerl->Perl_get_opargs(); |
546 | } |
547 | |
b207eff1 |
548 | void xs_handler(CV* cv, CPerlObj* p) |
e3b8966e |
549 | { |
550 | void(*func)(CV*); |
551 | SV* sv; |
552 | MAGIC* m = pPerl->Perl_mg_find((SV*)cv, '~'); |
553 | if(m != NULL) |
554 | { |
555 | sv = m->mg_obj; |
556 | if(SvIOK(sv)) |
557 | { |
558 | func = (void(*)(CV*))SvIVX(sv); |
559 | } |
560 | else |
561 | { |
562 | func = (void(*)(CV*))pPerl->Perl_sv_2iv(sv); |
563 | } |
e3b8966e |
564 | func(cv); |
565 | } |
566 | } |
567 | |
568 | CV* Perl_newXS(char* name, void (*subaddr)(CV* cv), char* filename) |
569 | { |
570 | CV* cv = pPerl->Perl_newXS(name, xs_handler, filename); |
571 | pPerl->Perl_sv_magic((SV*)cv, pPerl->Perl_sv_2mortal(pPerl->Perl_newSViv((IV)subaddr)), '~', "CAPI", 4); |
572 | return cv; |
573 | } |
574 | |
b207eff1 |
575 | |
576 | void Perl_deb(const char pat, ...) |
577 | { |
578 | } |
579 | |
4c2891ed |
580 | #undef PL_piMem |
581 | #undef PL_piENV |
582 | #undef PL_piStdIO |
583 | #undef PL_piLIO |
584 | #undef PL_piDir |
585 | #undef PL_piSock |
586 | #undef PL_piProc |
e3b8966e |
587 | |
588 | int * _win32_errno(void) |
589 | { |
590 | return &pPerl->ErrorNo(); |
591 | } |
592 | |
593 | FILE* _win32_stdin(void) |
594 | { |
4c2891ed |
595 | return (FILE*)pPerl->PL_piStdIO->Stdin(); |
e3b8966e |
596 | } |
597 | |
598 | FILE* _win32_stdout(void) |
599 | { |
4c2891ed |
600 | return (FILE*)pPerl->PL_piStdIO->Stdout(); |
e3b8966e |
601 | } |
602 | |
603 | FILE* _win32_stderr(void) |
604 | { |
4c2891ed |
605 | return (FILE*)pPerl->PL_piStdIO->Stderr(); |
e3b8966e |
606 | } |
607 | |
608 | int _win32_ferror(FILE *fp) |
609 | { |
4c2891ed |
610 | return pPerl->PL_piStdIO->Error((PerlIO*)fp, ErrorNo()); |
e3b8966e |
611 | } |
612 | |
613 | int _win32_feof(FILE *fp) |
614 | { |
4c2891ed |
615 | return pPerl->PL_piStdIO->Eof((PerlIO*)fp, ErrorNo()); |
e3b8966e |
616 | } |
617 | |
618 | char* _win32_strerror(int e) |
619 | { |
620 | return strerror(e); |
621 | } |
622 | |
623 | void _win32_perror(const char *str) |
624 | { |
625 | perror(str); |
626 | } |
627 | |
628 | int _win32_vfprintf(FILE *pf, const char *format, va_list arg) |
629 | { |
4c2891ed |
630 | return pPerl->PL_piStdIO->Vprintf((PerlIO*)pf, ErrorNo(), format, arg); |
e3b8966e |
631 | } |
632 | |
633 | int _win32_vprintf(const char *format, va_list arg) |
634 | { |
4c2891ed |
635 | return pPerl->PL_piStdIO->Vprintf(pPerl->PL_piStdIO->Stdout(), ErrorNo(), format, arg); |
e3b8966e |
636 | } |
637 | |
638 | int _win32_fprintf(FILE *pf, const char *format, ...) |
639 | { |
640 | int ret; |
641 | va_list args; |
642 | va_start(args, format); |
643 | ret = _win32_vfprintf(pf, format, args); |
644 | va_end(args); |
645 | return ret; |
646 | } |
647 | |
648 | int _win32_printf(const char *format, ...) |
649 | { |
650 | int ret; |
651 | va_list args; |
652 | va_start(args, format); |
653 | ret = _win32_vprintf(format, args); |
654 | va_end(args); |
655 | return ret; |
656 | } |
657 | |
658 | size_t _win32_fread(void *buf, size_t size, size_t count, FILE *pf) |
659 | { |
4c2891ed |
660 | return pPerl->PL_piStdIO->Read((PerlIO*)pf, buf, (size*count), ErrorNo()); |
e3b8966e |
661 | } |
662 | |
663 | size_t _win32_fwrite(const void *buf, size_t size, size_t count, FILE *pf) |
664 | { |
4c2891ed |
665 | return pPerl->PL_piStdIO->Write((PerlIO*)pf, buf, (size*count), ErrorNo()); |
e3b8966e |
666 | } |
667 | |
668 | FILE* _win32_fopen(const char *path, const char *mode) |
669 | { |
4c2891ed |
670 | return (FILE*)pPerl->PL_piStdIO->Open(path, mode, ErrorNo()); |
e3b8966e |
671 | } |
672 | |
673 | FILE* _win32_fdopen(int fh, const char *mode) |
674 | { |
4c2891ed |
675 | return (FILE*)pPerl->PL_piStdIO->Fdopen(fh, mode, ErrorNo()); |
e3b8966e |
676 | } |
677 | |
678 | FILE* _win32_freopen(const char *path, const char *mode, FILE *pf) |
679 | { |
4c2891ed |
680 | return (FILE*)pPerl->PL_piStdIO->Reopen(path, mode, (PerlIO*)pf, ErrorNo()); |
e3b8966e |
681 | } |
682 | |
683 | int _win32_fclose(FILE *pf) |
684 | { |
4c2891ed |
685 | return pPerl->PL_piStdIO->Close((PerlIO*)pf, ErrorNo()); |
e3b8966e |
686 | } |
687 | |
688 | int _win32_fputs(const char *s,FILE *pf) |
689 | { |
4c2891ed |
690 | return pPerl->PL_piStdIO->Puts((PerlIO*)pf, s, ErrorNo()); |
e3b8966e |
691 | } |
692 | |
693 | int _win32_fputc(int c,FILE *pf) |
694 | { |
4c2891ed |
695 | return pPerl->PL_piStdIO->Putc((PerlIO*)pf, c, ErrorNo()); |
e3b8966e |
696 | } |
697 | |
698 | int _win32_ungetc(int c,FILE *pf) |
699 | { |
4c2891ed |
700 | return pPerl->PL_piStdIO->Ungetc((PerlIO*)pf, c, ErrorNo()); |
e3b8966e |
701 | } |
702 | |
703 | int _win32_getc(FILE *pf) |
704 | { |
4c2891ed |
705 | return pPerl->PL_piStdIO->Getc((PerlIO*)pf, ErrorNo()); |
e3b8966e |
706 | } |
707 | |
708 | int _win32_fileno(FILE *pf) |
709 | { |
4c2891ed |
710 | return pPerl->PL_piStdIO->Fileno((PerlIO*)pf, ErrorNo()); |
e3b8966e |
711 | } |
712 | |
713 | void _win32_clearerr(FILE *pf) |
714 | { |
4c2891ed |
715 | pPerl->PL_piStdIO->Clearerr((PerlIO*)pf, ErrorNo()); |
e3b8966e |
716 | } |
717 | |
718 | int _win32_fflush(FILE *pf) |
719 | { |
4c2891ed |
720 | return pPerl->PL_piStdIO->Flush((PerlIO*)pf, ErrorNo()); |
e3b8966e |
721 | } |
722 | |
723 | long _win32_ftell(FILE *pf) |
724 | { |
4c2891ed |
725 | return pPerl->PL_piStdIO->Tell((PerlIO*)pf, ErrorNo()); |
e3b8966e |
726 | } |
727 | |
728 | int _win32_fseek(FILE *pf,long offset,int origin) |
729 | { |
4c2891ed |
730 | return pPerl->PL_piStdIO->Seek((PerlIO*)pf, offset, origin, ErrorNo()); |
e3b8966e |
731 | } |
732 | |
733 | int _win32_fgetpos(FILE *pf,fpos_t *p) |
734 | { |
4c2891ed |
735 | return pPerl->PL_piStdIO->Getpos((PerlIO*)pf, p, ErrorNo()); |
e3b8966e |
736 | } |
737 | |
738 | int _win32_fsetpos(FILE *pf,const fpos_t *p) |
739 | { |
4c2891ed |
740 | return pPerl->PL_piStdIO->Setpos((PerlIO*)pf, p, ErrorNo()); |
e3b8966e |
741 | } |
742 | |
743 | void _win32_rewind(FILE *pf) |
744 | { |
4c2891ed |
745 | pPerl->PL_piStdIO->Rewind((PerlIO*)pf, ErrorNo()); |
e3b8966e |
746 | } |
747 | |
748 | FILE* _win32_tmpfile(void) |
749 | { |
4c2891ed |
750 | return (FILE*)pPerl->PL_piStdIO->Tmpfile(ErrorNo()); |
e3b8966e |
751 | } |
752 | |
753 | void _win32_setbuf(FILE *pf, char *buf) |
754 | { |
4c2891ed |
755 | pPerl->PL_piStdIO->SetBuf((PerlIO*)pf, buf, ErrorNo()); |
e3b8966e |
756 | } |
757 | |
758 | int _win32_setvbuf(FILE *pf, char *buf, int type, size_t size) |
759 | { |
4c2891ed |
760 | return pPerl->PL_piStdIO->SetVBuf((PerlIO*)pf, buf, type, size, ErrorNo()); |
e3b8966e |
761 | } |
762 | |
9e6b2b00 |
763 | char* _win32_fgets(char *s, int n, FILE *pf) |
764 | { |
4c2891ed |
765 | return pPerl->PL_piStdIO->Gets((PerlIO*)pf, s, n, ErrorNo()); |
9e6b2b00 |
766 | } |
767 | |
768 | char* _win32_gets(char *s) |
769 | { |
4c2891ed |
770 | return _win32_fgets(s, 80, (FILE*)pPerl->PL_piStdIO->Stdin()); |
9e6b2b00 |
771 | } |
772 | |
e3b8966e |
773 | int _win32_fgetc(FILE *pf) |
774 | { |
4c2891ed |
775 | return pPerl->PL_piStdIO->Getc((PerlIO*)pf, ErrorNo()); |
e3b8966e |
776 | } |
777 | |
778 | int _win32_putc(int c, FILE *pf) |
779 | { |
4c2891ed |
780 | return pPerl->PL_piStdIO->Putc((PerlIO*)pf, c, ErrorNo()); |
e3b8966e |
781 | } |
782 | |
783 | int _win32_puts(const char *s) |
784 | { |
4c2891ed |
785 | return pPerl->PL_piStdIO->Puts(pPerl->PL_piStdIO->Stdout(), s, ErrorNo()); |
e3b8966e |
786 | } |
787 | |
788 | int _win32_getchar(void) |
789 | { |
4c2891ed |
790 | return pPerl->PL_piStdIO->Getc(pPerl->PL_piStdIO->Stdin(), ErrorNo()); |
e3b8966e |
791 | } |
792 | |
793 | int _win32_putchar(int c) |
794 | { |
4c2891ed |
795 | return pPerl->PL_piStdIO->Putc(pPerl->PL_piStdIO->Stdout(), c, ErrorNo()); |
e3b8966e |
796 | } |
797 | |
798 | void* _win32_malloc(size_t size) |
799 | { |
4c2891ed |
800 | return pPerl->PL_piMem->Malloc(size); |
e3b8966e |
801 | } |
802 | |
803 | void* _win32_calloc(size_t numitems, size_t size) |
804 | { |
4c2891ed |
805 | return pPerl->PL_piMem->Malloc(numitems*size); |
e3b8966e |
806 | } |
807 | |
808 | void* _win32_realloc(void *block, size_t size) |
809 | { |
4c2891ed |
810 | return pPerl->PL_piMem->Realloc(block, size); |
e3b8966e |
811 | } |
812 | |
813 | void _win32_free(void *block) |
814 | { |
4c2891ed |
815 | pPerl->PL_piMem->Free(block); |
e3b8966e |
816 | } |
817 | |
818 | void _win32_abort(void) |
819 | { |
4c2891ed |
820 | pPerl->PL_piProc->Abort(); |
e3b8966e |
821 | } |
822 | |
823 | int _win32_pipe(int *phandles, unsigned int psize, int textmode) |
824 | { |
4c2891ed |
825 | return pPerl->PL_piProc->Pipe(phandles); |
e3b8966e |
826 | } |
827 | |
828 | FILE* _win32_popen(const char *command, const char *mode) |
829 | { |
4c2891ed |
830 | return (FILE*)pPerl->PL_piProc->Popen(command, mode); |
e3b8966e |
831 | } |
832 | |
833 | int _win32_pclose(FILE *pf) |
834 | { |
4c2891ed |
835 | return pPerl->PL_piProc->Pclose((PerlIO*)pf); |
e3b8966e |
836 | } |
837 | |
838 | unsigned _win32_sleep(unsigned int t) |
839 | { |
4c2891ed |
840 | return pPerl->PL_piProc->Sleep(t); |
e3b8966e |
841 | } |
842 | |
843 | int _win32_spawnvp(int mode, const char *cmdname, const char *const *argv) |
844 | { |
4c2891ed |
845 | return pPerl->PL_piProc->Spawnvp(mode, cmdname, argv); |
e3b8966e |
846 | } |
847 | |
848 | int _win32_mkdir(const char *dir, int mode) |
849 | { |
4c2891ed |
850 | return pPerl->PL_piDir->Makedir(dir, mode, ErrorNo()); |
e3b8966e |
851 | } |
852 | |
853 | int _win32_rmdir(const char *dir) |
854 | { |
4c2891ed |
855 | return pPerl->PL_piDir->Rmdir(dir, ErrorNo()); |
e3b8966e |
856 | } |
857 | |
858 | int _win32_chdir(const char *dir) |
859 | { |
4c2891ed |
860 | return pPerl->PL_piDir->Chdir(dir, ErrorNo()); |
e3b8966e |
861 | } |
862 | |
863 | #undef stat |
864 | int _win32_fstat(int fd,struct stat *sbufptr) |
865 | { |
4c2891ed |
866 | return pPerl->PL_piLIO->FileStat(fd, sbufptr, ErrorNo()); |
e3b8966e |
867 | } |
868 | |
869 | int _win32_stat(const char *name,struct stat *sbufptr) |
870 | { |
4c2891ed |
871 | return pPerl->PL_piLIO->NameStat(name, sbufptr, ErrorNo()); |
e3b8966e |
872 | } |
873 | |
8d9b2e3c |
874 | int _win32_rename(const char *oname, const char *newname) |
e24c7c18 |
875 | { |
4c2891ed |
876 | return pPerl->PL_piLIO->Rename(oname, newname, ErrorNo()); |
e24c7c18 |
877 | } |
878 | |
e3b8966e |
879 | int _win32_setmode(int fd, int mode) |
880 | { |
4c2891ed |
881 | return pPerl->PL_piLIO->Setmode(fd, mode, ErrorNo()); |
e3b8966e |
882 | } |
883 | |
884 | long _win32_lseek(int fd, long offset, int origin) |
885 | { |
4c2891ed |
886 | return pPerl->PL_piLIO->Lseek(fd, offset, origin, ErrorNo()); |
e3b8966e |
887 | } |
888 | |
889 | long _win32_tell(int fd) |
890 | { |
4c2891ed |
891 | return pPerl->PL_piStdIO->Tell((PerlIO*)fd, ErrorNo()); |
e3b8966e |
892 | } |
893 | |
894 | int _win32_dup(int fd) |
895 | { |
4c2891ed |
896 | return pPerl->PL_piLIO->Dup(fd, ErrorNo()); |
e3b8966e |
897 | } |
898 | |
899 | int _win32_dup2(int h1, int h2) |
900 | { |
4c2891ed |
901 | return pPerl->PL_piLIO->Dup2(h1, h2, ErrorNo()); |
e3b8966e |
902 | } |
903 | |
904 | int _win32_open(const char *path, int oflag,...) |
905 | { |
4c2891ed |
906 | return pPerl->PL_piLIO->Open(path, oflag, ErrorNo()); |
e3b8966e |
907 | } |
908 | |
909 | int _win32_close(int fd) |
910 | { |
4c2891ed |
911 | return pPerl->PL_piLIO->Close(fd, ErrorNo()); |
e3b8966e |
912 | } |
913 | |
914 | int _win32_read(int fd, void *buf, unsigned int cnt) |
915 | { |
4c2891ed |
916 | return pPerl->PL_piLIO->Read(fd, buf, cnt, ErrorNo()); |
e3b8966e |
917 | } |
918 | |
919 | int _win32_write(int fd, const void *buf, unsigned int cnt) |
920 | { |
4c2891ed |
921 | return pPerl->PL_piLIO->Write(fd, buf, cnt, ErrorNo()); |
e3b8966e |
922 | } |
923 | |
924 | int _win32_times(struct tms *timebuf) |
925 | { |
4c2891ed |
926 | return pPerl->PL_piProc->Times(timebuf); |
e3b8966e |
927 | } |
928 | |
929 | int _win32_ioctl(int i, unsigned int u, char *data) |
930 | { |
4c2891ed |
931 | return pPerl->PL_piLIO->IOCtl(i, u, data, ErrorNo()); |
e3b8966e |
932 | } |
933 | |
934 | int _win32_utime(const char *f, struct utimbuf *t) |
935 | { |
4c2891ed |
936 | return pPerl->PL_piLIO->Utime((char*)f, t, ErrorNo()); |
e3b8966e |
937 | } |
938 | |
939 | char* _win32_getenv(const char *name) |
940 | { |
4c2891ed |
941 | return pPerl->PL_piENV->Getenv(name, ErrorNo()); |
e3b8966e |
942 | } |
943 | |
944 | int _win32_open_osfhandle(long handle, int flags) |
945 | { |
4c2891ed |
946 | return pPerl->PL_piStdIO->OpenOSfhandle(handle, flags); |
e3b8966e |
947 | } |
948 | |
949 | long _win32_get_osfhandle(int fd) |
950 | { |
4c2891ed |
951 | return pPerl->PL_piStdIO->GetOSfhandle(fd); |
e3b8966e |
952 | } |
891fc7f2 |
953 | |
954 | u_long _win32_htonl (u_long hostlong) |
955 | { |
4c2891ed |
956 | return pPerl->PL_piSock->Htonl(hostlong); |
891fc7f2 |
957 | } |
958 | |
959 | u_short _win32_htons (u_short hostshort) |
960 | { |
4c2891ed |
961 | return pPerl->PL_piSock->Htons(hostshort); |
891fc7f2 |
962 | } |
963 | |
964 | u_long _win32_ntohl (u_long netlong) |
965 | { |
4c2891ed |
966 | return pPerl->PL_piSock->Ntohl(netlong); |
891fc7f2 |
967 | } |
968 | |
969 | u_short _win32_ntohs (u_short netshort) |
970 | { |
4c2891ed |
971 | return pPerl->PL_piSock->Ntohs(netshort); |
891fc7f2 |
972 | } |
973 | |
974 | unsigned long _win32_inet_addr (const char * cp) |
975 | { |
4c2891ed |
976 | return pPerl->PL_piSock->InetAddr(cp, ErrorNo()); |
891fc7f2 |
977 | } |
978 | |
979 | char * _win32_inet_ntoa (struct in_addr in) |
980 | { |
4c2891ed |
981 | return pPerl->PL_piSock->InetNtoa(in, ErrorNo()); |
891fc7f2 |
982 | } |
983 | |
984 | SOCKET _win32_socket (int af, int type, int protocol) |
985 | { |
4c2891ed |
986 | return pPerl->PL_piSock->Socket(af, type, protocol, ErrorNo()); |
891fc7f2 |
987 | } |
988 | |
989 | int _win32_bind (SOCKET s, const struct sockaddr *addr, int namelen) |
990 | { |
4c2891ed |
991 | return pPerl->PL_piSock->Bind(s, addr, namelen, ErrorNo()); |
891fc7f2 |
992 | } |
993 | |
994 | int _win32_listen (SOCKET s, int backlog) |
995 | { |
4c2891ed |
996 | return pPerl->PL_piSock->Listen(s, backlog, ErrorNo()); |
891fc7f2 |
997 | } |
998 | |
999 | SOCKET _win32_accept (SOCKET s, struct sockaddr *addr, int *addrlen) |
1000 | { |
4c2891ed |
1001 | return pPerl->PL_piSock->Accept(s, addr, addrlen, ErrorNo()); |
891fc7f2 |
1002 | } |
1003 | |
1004 | int _win32_connect (SOCKET s, const struct sockaddr *name, int namelen) |
1005 | { |
4c2891ed |
1006 | return pPerl->PL_piSock->Connect(s, name, namelen, ErrorNo()); |
891fc7f2 |
1007 | } |
1008 | |
1009 | int _win32_send (SOCKET s, const char * buf, int len, int flags) |
1010 | { |
4c2891ed |
1011 | return pPerl->PL_piSock->Send(s, buf, len, flags, ErrorNo()); |
891fc7f2 |
1012 | } |
1013 | |
1014 | int _win32_sendto (SOCKET s, const char * buf, int len, int flags, |
1015 | const struct sockaddr *to, int tolen) |
1016 | { |
4c2891ed |
1017 | return pPerl->PL_piSock->Sendto(s, buf, len, flags, to, tolen, ErrorNo()); |
891fc7f2 |
1018 | } |
1019 | |
1020 | int _win32_recv (SOCKET s, char * buf, int len, int flags) |
1021 | { |
4c2891ed |
1022 | return pPerl->PL_piSock->Recv(s, buf, len, flags, ErrorNo()); |
891fc7f2 |
1023 | } |
1024 | |
1025 | int _win32_recvfrom (SOCKET s, char * buf, int len, int flags, |
1026 | struct sockaddr *from, int * fromlen) |
1027 | { |
4c2891ed |
1028 | return pPerl->PL_piSock->Recvfrom(s, buf, len, flags, from, fromlen, ErrorNo()); |
891fc7f2 |
1029 | } |
1030 | |
1031 | int _win32_shutdown (SOCKET s, int how) |
1032 | { |
4c2891ed |
1033 | return pPerl->PL_piSock->Shutdown(s, how, ErrorNo()); |
891fc7f2 |
1034 | } |
1035 | |
1036 | int _win32_closesocket (SOCKET s) |
1037 | { |
4c2891ed |
1038 | return pPerl->PL_piSock->Closesocket(s, ErrorNo()); |
891fc7f2 |
1039 | } |
1040 | |
1041 | int _win32_ioctlsocket (SOCKET s, long cmd, u_long *argp) |
1042 | { |
4c2891ed |
1043 | return pPerl->PL_piSock->Ioctlsocket(s, cmd, argp, ErrorNo()); |
891fc7f2 |
1044 | } |
1045 | |
1046 | int _win32_setsockopt (SOCKET s, int level, int optname, |
1047 | const char * optval, int optlen) |
1048 | { |
4c2891ed |
1049 | return pPerl->PL_piSock->Setsockopt(s, level, optname, optval, optlen, ErrorNo()); |
891fc7f2 |
1050 | } |
1051 | |
1052 | int _win32_getsockopt (SOCKET s, int level, int optname, char * optval, int *optlen) |
1053 | { |
4c2891ed |
1054 | return pPerl->PL_piSock->Getsockopt(s, level, optname, optval, optlen, ErrorNo()); |
891fc7f2 |
1055 | } |
1056 | |
1057 | int _win32_getpeername (SOCKET s, struct sockaddr *name, int * namelen) |
1058 | { |
4c2891ed |
1059 | return pPerl->PL_piSock->Getpeername(s, name, namelen, ErrorNo()); |
891fc7f2 |
1060 | } |
1061 | |
1062 | int _win32_getsockname (SOCKET s, struct sockaddr *name, int * namelen) |
1063 | { |
4c2891ed |
1064 | return pPerl->PL_piSock->Getsockname(s, name, namelen, ErrorNo()); |
891fc7f2 |
1065 | } |
1066 | |
1067 | int _win32_gethostname (char * name, int namelen) |
1068 | { |
4c2891ed |
1069 | return pPerl->PL_piSock->Gethostname(name, namelen, ErrorNo()); |
891fc7f2 |
1070 | } |
1071 | |
1072 | struct hostent * _win32_gethostbyname(const char * name) |
1073 | { |
4c2891ed |
1074 | return pPerl->PL_piSock->Gethostbyname(name, ErrorNo()); |
891fc7f2 |
1075 | } |
1076 | |
1077 | struct hostent * _win32_gethostbyaddr(const char * addr, int len, int type) |
1078 | { |
4c2891ed |
1079 | return pPerl->PL_piSock->Gethostbyaddr(addr, len, type, ErrorNo()); |
891fc7f2 |
1080 | } |
1081 | |
1082 | struct protoent * _win32_getprotobyname(const char * name) |
1083 | { |
4c2891ed |
1084 | return pPerl->PL_piSock->Getprotobyname(name, ErrorNo()); |
891fc7f2 |
1085 | } |
1086 | |
1087 | struct protoent * _win32_getprotobynumber(int proto) |
1088 | { |
4c2891ed |
1089 | return pPerl->PL_piSock->Getprotobynumber(proto, ErrorNo()); |
891fc7f2 |
1090 | } |
1091 | |
1092 | struct servent * _win32_getservbyname(const char * name, const char * proto) |
1093 | { |
4c2891ed |
1094 | return pPerl->PL_piSock->Getservbyname(name, proto, ErrorNo()); |
891fc7f2 |
1095 | } |
1096 | |
1097 | struct servent * _win32_getservbyport(int port, const char * proto) |
1098 | { |
4c2891ed |
1099 | return pPerl->PL_piSock->Getservbyport(port, proto, ErrorNo()); |
891fc7f2 |
1100 | } |
1101 | |
1102 | int _win32_select (int nfds, Perl_fd_set *rfds, Perl_fd_set *wfds, Perl_fd_set *xfds, |
1103 | const struct timeval *timeout) |
1104 | { |
4c2891ed |
1105 | return pPerl->PL_piSock->Select(nfds, (char*)rfds, (char*)wfds, (char*)xfds, timeout, ErrorNo()); |
891fc7f2 |
1106 | } |
1107 | |
1108 | void _win32_endnetent(void) |
1109 | { |
4c2891ed |
1110 | pPerl->PL_piSock->Endnetent(ErrorNo()); |
891fc7f2 |
1111 | } |
1112 | |
1113 | void _win32_endhostent(void) |
1114 | { |
4c2891ed |
1115 | pPerl->PL_piSock->Endhostent(ErrorNo()); |
891fc7f2 |
1116 | } |
1117 | |
1118 | void _win32_endprotoent(void) |
1119 | { |
4c2891ed |
1120 | pPerl->PL_piSock->Endprotoent(ErrorNo()); |
891fc7f2 |
1121 | } |
1122 | |
1123 | void _win32_endservent(void) |
1124 | { |
4c2891ed |
1125 | pPerl->PL_piSock->Endservent(ErrorNo()); |
891fc7f2 |
1126 | } |
1127 | |
1128 | struct netent * _win32_getnetent(void) |
1129 | { |
4c2891ed |
1130 | return pPerl->PL_piSock->Getnetent(ErrorNo()); |
891fc7f2 |
1131 | } |
1132 | |
1133 | struct netent * _win32_getnetbyname(char *name) |
1134 | { |
4c2891ed |
1135 | return pPerl->PL_piSock->Getnetbyname(name, ErrorNo()); |
891fc7f2 |
1136 | } |
1137 | |
1138 | struct netent * _win32_getnetbyaddr(long net, int type) |
1139 | { |
4c2891ed |
1140 | return pPerl->PL_piSock->Getnetbyaddr(net, type, ErrorNo()); |
891fc7f2 |
1141 | } |
1142 | |
1143 | struct protoent *_win32_getprotoent(void) |
1144 | { |
4c2891ed |
1145 | return pPerl->PL_piSock->Getprotoent(ErrorNo()); |
891fc7f2 |
1146 | } |
1147 | |
1148 | struct servent *_win32_getservent(void) |
1149 | { |
4c2891ed |
1150 | return pPerl->PL_piSock->Getservent(ErrorNo()); |
891fc7f2 |
1151 | } |
1152 | |
1153 | void _win32_sethostent(int stayopen) |
1154 | { |
4c2891ed |
1155 | pPerl->PL_piSock->Sethostent(stayopen, ErrorNo()); |
891fc7f2 |
1156 | } |
1157 | |
1158 | void _win32_setnetent(int stayopen) |
1159 | { |
4c2891ed |
1160 | pPerl->PL_piSock->Setnetent(stayopen, ErrorNo()); |
891fc7f2 |
1161 | } |
1162 | |
1163 | void _win32_setprotoent(int stayopen) |
1164 | { |
4c2891ed |
1165 | pPerl->PL_piSock->Setprotoent(stayopen, ErrorNo()); |
891fc7f2 |
1166 | } |
1167 | |
1168 | void _win32_setservent(int stayopen) |
1169 | { |
4c2891ed |
1170 | pPerl->PL_piSock->Setservent(stayopen, ErrorNo()); |
891fc7f2 |
1171 | } |
e3b8966e |
1172 | } /* extern "C" */ |
1173 | EOCODE |
1174 | |
1175 | |
1176 | print HDRFILE <<EOCODE; |
9e6b2b00 |
1177 | #undef Perl_op_desc |
1178 | char ** _Perl_op_desc (); |
1179 | #define Perl_op_desc (_Perl_op_desc()) |
1180 | |
1181 | #undef Perl_op_name |
1182 | char ** _Perl_op_name (); |
1183 | #define Perl_op_name (_Perl_op_name()) |
1184 | |
1185 | #undef Perl_no_modify |
58a50f62 |
1186 | char * _Perl_no_modify (); |
9e6b2b00 |
1187 | #define Perl_no_modify (_Perl_no_modify()) |
1188 | |
1189 | #undef Perl_opargs |
58a50f62 |
1190 | U32 * _Perl_opargs (); |
9e6b2b00 |
1191 | #define Perl_opargs (_Perl_opargs()) |
1192 | |
1193 | |
e3b8966e |
1194 | #undef win32_errno |
1195 | #undef win32_stdin |
1196 | #undef win32_stdout |
1197 | #undef win32_stderr |
1198 | #undef win32_ferror |
1199 | #undef win32_feof |
1200 | #undef win32_fprintf |
1201 | #undef win32_printf |
1202 | #undef win32_vfprintf |
1203 | #undef win32_vprintf |
1204 | #undef win32_fread |
1205 | #undef win32_fwrite |
1206 | #undef win32_fopen |
1207 | #undef win32_fdopen |
1208 | #undef win32_freopen |
1209 | #undef win32_fclose |
1210 | #undef win32_fputs |
1211 | #undef win32_fputc |
1212 | #undef win32_ungetc |
1213 | #undef win32_getc |
1214 | #undef win32_fileno |
1215 | #undef win32_clearerr |
1216 | #undef win32_fflush |
1217 | #undef win32_ftell |
1218 | #undef win32_fseek |
1219 | #undef win32_fgetpos |
1220 | #undef win32_fsetpos |
1221 | #undef win32_rewind |
1222 | #undef win32_tmpfile |
1223 | #undef win32_abort |
1224 | #undef win32_fstat |
1225 | #undef win32_stat |
1226 | #undef win32_pipe |
1227 | #undef win32_popen |
1228 | #undef win32_pclose |
e24c7c18 |
1229 | #undef win32_rename |
e3b8966e |
1230 | #undef win32_setmode |
1231 | #undef win32_lseek |
1232 | #undef win32_tell |
1233 | #undef win32_dup |
1234 | #undef win32_dup2 |
1235 | #undef win32_open |
1236 | #undef win32_close |
1237 | #undef win32_eof |
1238 | #undef win32_read |
1239 | #undef win32_write |
1240 | #undef win32_mkdir |
1241 | #undef win32_rmdir |
1242 | #undef win32_chdir |
1243 | #undef win32_setbuf |
1244 | #undef win32_setvbuf |
1245 | #undef win32_fgetc |
9e6b2b00 |
1246 | #undef win32_fgets |
1247 | #undef win32_gets |
e3b8966e |
1248 | #undef win32_putc |
1249 | #undef win32_puts |
1250 | #undef win32_getchar |
1251 | #undef win32_putchar |
1252 | #undef win32_malloc |
1253 | #undef win32_calloc |
1254 | #undef win32_realloc |
1255 | #undef win32_free |
1256 | #undef win32_sleep |
1257 | #undef win32_times |
1258 | #undef win32_stat |
1259 | #undef win32_ioctl |
1260 | #undef win32_utime |
1261 | #undef win32_getenv |
1262 | |
891fc7f2 |
1263 | #undef win32_htonl |
1264 | #undef win32_htons |
1265 | #undef win32_ntohl |
1266 | #undef win32_ntohs |
1267 | #undef win32_inet_addr |
1268 | #undef win32_inet_ntoa |
1269 | |
1270 | #undef win32_socket |
1271 | #undef win32_bind |
1272 | #undef win32_listen |
1273 | #undef win32_accept |
1274 | #undef win32_connect |
1275 | #undef win32_send |
1276 | #undef win32_sendto |
1277 | #undef win32_recv |
1278 | #undef win32_recvfrom |
1279 | #undef win32_shutdown |
1280 | #undef win32_closesocket |
1281 | #undef win32_ioctlsocket |
1282 | #undef win32_setsockopt |
1283 | #undef win32_getsockopt |
1284 | #undef win32_getpeername |
1285 | #undef win32_getsockname |
1286 | #undef win32_gethostname |
1287 | #undef win32_gethostbyname |
1288 | #undef win32_gethostbyaddr |
1289 | #undef win32_getprotobyname |
1290 | #undef win32_getprotobynumber |
1291 | #undef win32_getservbyname |
1292 | #undef win32_getservbyport |
1293 | #undef win32_select |
1294 | #undef win32_endhostent |
1295 | #undef win32_endnetent |
1296 | #undef win32_endprotoent |
1297 | #undef win32_endservent |
1298 | #undef win32_getnetent |
1299 | #undef win32_getnetbyname |
1300 | #undef win32_getnetbyaddr |
1301 | #undef win32_getprotoent |
1302 | #undef win32_getservent |
1303 | #undef win32_sethostent |
1304 | #undef win32_setnetent |
1305 | #undef win32_setprotoent |
1306 | #undef win32_setservent |
1307 | |
e3b8966e |
1308 | #define win32_errno _win32_errno |
1309 | #define win32_stdin _win32_stdin |
1310 | #define win32_stdout _win32_stdout |
1311 | #define win32_stderr _win32_stderr |
1312 | #define win32_ferror _win32_ferror |
1313 | #define win32_feof _win32_feof |
1314 | #define win32_strerror _win32_strerror |
1315 | #define win32_perror _win32_perror |
1316 | #define win32_fprintf _win32_fprintf |
1317 | #define win32_printf _win32_printf |
1318 | #define win32_vfprintf _win32_vfprintf |
1319 | #define win32_vprintf _win32_vprintf |
1320 | #define win32_fread _win32_fread |
1321 | #define win32_fwrite _win32_fwrite |
1322 | #define win32_fopen _win32_fopen |
1323 | #define win32_fdopen _win32_fdopen |
1324 | #define win32_freopen _win32_freopen |
1325 | #define win32_fclose _win32_fclose |
1326 | #define win32_fputs _win32_fputs |
1327 | #define win32_fputc _win32_fputc |
1328 | #define win32_ungetc _win32_ungetc |
1329 | #define win32_getc _win32_getc |
1330 | #define win32_fileno _win32_fileno |
1331 | #define win32_clearerr _win32_clearerr |
1332 | #define win32_fflush _win32_fflush |
1333 | #define win32_ftell _win32_ftell |
1334 | #define win32_fseek _win32_fseek |
1335 | #define win32_fgetpos _win32_fgetpos |
1336 | #define win32_fsetpos _win32_fsetpos |
1337 | #define win32_rewind _win32_rewind |
1338 | #define win32_tmpfile _win32_tmpfile |
1339 | #define win32_abort _win32_abort |
1340 | #define win32_fstat _win32_fstat |
1341 | #define win32_stat _win32_stat |
1342 | #define win32_pipe _win32_pipe |
1343 | #define win32_popen _win32_popen |
1344 | #define win32_pclose _win32_pclose |
e24c7c18 |
1345 | #define win32_rename _win32_rename |
e3b8966e |
1346 | #define win32_setmode _win32_setmode |
1347 | #define win32_lseek _win32_lseek |
1348 | #define win32_tell _win32_tell |
1349 | #define win32_dup _win32_dup |
1350 | #define win32_dup2 _win32_dup2 |
1351 | #define win32_open _win32_open |
1352 | #define win32_close _win32_close |
1353 | #define win32_eof _win32_eof |
1354 | #define win32_read _win32_read |
1355 | #define win32_write _win32_write |
1356 | #define win32_mkdir _win32_mkdir |
1357 | #define win32_rmdir _win32_rmdir |
1358 | #define win32_chdir _win32_chdir |
1359 | #define win32_setbuf _win32_setbuf |
1360 | #define win32_setvbuf _win32_setvbuf |
1361 | #define win32_fgetc _win32_fgetc |
9e6b2b00 |
1362 | #define win32_fgets _win32_fgets |
1363 | #define win32_gets _win32_gets |
e3b8966e |
1364 | #define win32_putc _win32_putc |
1365 | #define win32_puts _win32_puts |
1366 | #define win32_getchar _win32_getchar |
1367 | #define win32_putchar _win32_putchar |
1368 | #define win32_malloc _win32_malloc |
1369 | #define win32_calloc _win32_calloc |
1370 | #define win32_realloc _win32_realloc |
1371 | #define win32_free _win32_free |
1372 | #define win32_sleep _win32_sleep |
1373 | #define win32_spawnvp _win32_spawnvp |
1374 | #define win32_times _win32_times |
1375 | #define win32_stat _win32_stat |
1376 | #define win32_ioctl _win32_ioctl |
1377 | #define win32_utime _win32_utime |
1378 | #define win32_getenv _win32_getenv |
1379 | #define win32_open_osfhandle _win32_open_osfhandle |
1380 | #define win32_get_osfhandle _win32_get_osfhandle |
1381 | |
891fc7f2 |
1382 | #define win32_htonl _win32_htonl |
1383 | #define win32_htons _win32_htons |
1384 | #define win32_ntohl _win32_ntohl |
1385 | #define win32_ntohs _win32_ntohs |
1386 | #define win32_inet_addr _win32_inet_addr |
1387 | #define win32_inet_ntoa _win32_inet_ntoa |
1388 | |
1389 | #define win32_socket _win32_socket |
1390 | #define win32_bind _win32_bind |
1391 | #define win32_listen _win32_listen |
1392 | #define win32_accept _win32_accept |
1393 | #define win32_connect _win32_connect |
1394 | #define win32_send _win32_send |
1395 | #define win32_sendto _win32_sendto |
1396 | #define win32_recv _win32_recv |
1397 | #define win32_recvfrom _win32_recvfrom |
1398 | #define win32_shutdown _win32_shutdown |
1399 | #define win32_closesocket _win32_closesocket |
1400 | #define win32_ioctlsocket _win32_ioctlsocket |
1401 | #define win32_setsockopt _win32_setsockopt |
1402 | #define win32_getsockopt _win32_getsockopt |
1403 | #define win32_getpeername _win32_getpeername |
1404 | #define win32_getsockname _win32_getsockname |
1405 | #define win32_gethostname _win32_gethostname |
1406 | #define win32_gethostbyname _win32_gethostbyname |
1407 | #define win32_gethostbyaddr _win32_gethostbyaddr |
1408 | #define win32_getprotobyname _win32_getprotobyname |
1409 | #define win32_getprotobynumber _win32_getprotobynumber |
1410 | #define win32_getservbyname _win32_getservbyname |
1411 | #define win32_getservbyport _win32_getservbyport |
1412 | #define win32_select _win32_select |
1413 | #define win32_endhostent _win32_endhostent |
1414 | #define win32_endnetent _win32_endnetent |
1415 | #define win32_endprotoent _win32_endprotoent |
1416 | #define win32_endservent _win32_endservent |
1417 | #define win32_getnetent _win32_getnetent |
1418 | #define win32_getnetbyname _win32_getnetbyname |
1419 | #define win32_getnetbyaddr _win32_getnetbyaddr |
1420 | #define win32_getprotoent _win32_getprotoent |
1421 | #define win32_getservent _win32_getservent |
1422 | #define win32_sethostent _win32_sethostent |
1423 | #define win32_setnetent _win32_setnetent |
1424 | #define win32_setprotoent _win32_setprotoent |
1425 | #define win32_setservent _win32_setservent |
1426 | |
e3b8966e |
1427 | int * _win32_errno(void); |
1428 | FILE* _win32_stdin(void); |
1429 | FILE* _win32_stdout(void); |
1430 | FILE* _win32_stderr(void); |
1431 | int _win32_ferror(FILE *fp); |
1432 | int _win32_feof(FILE *fp); |
1433 | char* _win32_strerror(int e); |
1434 | void _win32_perror(const char *str); |
1435 | int _win32_fprintf(FILE *pf, const char *format, ...); |
1436 | int _win32_printf(const char *format, ...); |
1437 | int _win32_vfprintf(FILE *pf, const char *format, va_list arg); |
1438 | int _win32_vprintf(const char *format, va_list arg); |
1439 | size_t _win32_fread(void *buf, size_t size, size_t count, FILE *pf); |
1440 | size_t _win32_fwrite(const void *buf, size_t size, size_t count, FILE *pf); |
1441 | FILE* _win32_fopen(const char *path, const char *mode); |
1442 | FILE* _win32_fdopen(int fh, const char *mode); |
1443 | FILE* _win32_freopen(const char *path, const char *mode, FILE *pf); |
1444 | int _win32_fclose(FILE *pf); |
1445 | int _win32_fputs(const char *s,FILE *pf); |
1446 | int _win32_fputc(int c,FILE *pf); |
1447 | int _win32_ungetc(int c,FILE *pf); |
1448 | int _win32_getc(FILE *pf); |
1449 | int _win32_fileno(FILE *pf); |
1450 | void _win32_clearerr(FILE *pf); |
1451 | int _win32_fflush(FILE *pf); |
1452 | long _win32_ftell(FILE *pf); |
1453 | int _win32_fseek(FILE *pf,long offset,int origin); |
1454 | int _win32_fgetpos(FILE *pf,fpos_t *p); |
1455 | int _win32_fsetpos(FILE *pf,const fpos_t *p); |
1456 | void _win32_rewind(FILE *pf); |
1457 | FILE* _win32_tmpfile(void); |
1458 | void _win32_abort(void); |
1459 | int _win32_fstat(int fd,struct stat *sbufptr); |
1460 | int _win32_stat(const char *name,struct stat *sbufptr); |
1461 | int _win32_pipe( int *phandles, unsigned int psize, int textmode ); |
1462 | FILE* _win32_popen( const char *command, const char *mode ); |
1463 | int _win32_pclose( FILE *pf); |
e24c7c18 |
1464 | int _win32_rename( const char *oldname, const char *newname); |
e3b8966e |
1465 | int _win32_setmode( int fd, int mode); |
1466 | long _win32_lseek( int fd, long offset, int origin); |
1467 | long _win32_tell( int fd); |
1468 | int _win32_dup( int fd); |
1469 | int _win32_dup2(int h1, int h2); |
1470 | int _win32_open(const char *path, int oflag,...); |
1471 | int _win32_close(int fd); |
1472 | int _win32_eof(int fd); |
1473 | int _win32_read(int fd, void *buf, unsigned int cnt); |
1474 | int _win32_write(int fd, const void *buf, unsigned int cnt); |
1475 | int _win32_mkdir(const char *dir, int mode); |
1476 | int _win32_rmdir(const char *dir); |
1477 | int _win32_chdir(const char *dir); |
1478 | void _win32_setbuf(FILE *pf, char *buf); |
1479 | int _win32_setvbuf(FILE *pf, char *buf, int type, size_t size); |
1480 | char* _win32_fgets(char *s, int n, FILE *pf); |
1481 | char* _win32_gets(char *s); |
1482 | int _win32_fgetc(FILE *pf); |
1483 | int _win32_putc(int c, FILE *pf); |
1484 | int _win32_puts(const char *s); |
1485 | int _win32_getchar(void); |
1486 | int _win32_putchar(int c); |
1487 | void* _win32_malloc(size_t size); |
1488 | void* _win32_calloc(size_t numitems, size_t size); |
1489 | void* _win32_realloc(void *block, size_t size); |
1490 | void _win32_free(void *block); |
1491 | unsigned _win32_sleep(unsigned int); |
1492 | int _win32_spawnvp(int mode, const char *cmdname, const char *const *argv); |
1493 | int _win32_times(struct tms *timebuf); |
1494 | int _win32_stat(const char *path, struct stat *buf); |
1495 | int _win32_ioctl(int i, unsigned int u, char *data); |
1496 | int _win32_utime(const char *f, struct utimbuf *t); |
1497 | char* _win32_getenv(const char *name); |
1498 | int _win32_open_osfhandle(long handle, int flags); |
1499 | long _win32_get_osfhandle(int fd); |
1500 | |
891fc7f2 |
1501 | u_long _win32_htonl (u_long hostlong); |
1502 | u_short _win32_htons (u_short hostshort); |
1503 | u_long _win32_ntohl (u_long netlong); |
1504 | u_short _win32_ntohs (u_short netshort); |
1505 | unsigned long _win32_inet_addr (const char * cp); |
1506 | char * _win32_inet_ntoa (struct in_addr in); |
1507 | |
1508 | SOCKET _win32_socket (int af, int type, int protocol); |
1509 | int _win32_bind (SOCKET s, const struct sockaddr *addr, int namelen); |
1510 | int _win32_listen (SOCKET s, int backlog); |
1511 | SOCKET _win32_accept (SOCKET s, struct sockaddr *addr, int *addrlen); |
1512 | int _win32_connect (SOCKET s, const struct sockaddr *name, int namelen); |
1513 | int _win32_send (SOCKET s, const char * buf, int len, int flags); |
1514 | int _win32_sendto (SOCKET s, const char * buf, int len, int flags, |
1515 | const struct sockaddr *to, int tolen); |
1516 | int _win32_recv (SOCKET s, char * buf, int len, int flags); |
1517 | int _win32_recvfrom (SOCKET s, char * buf, int len, int flags, |
1518 | struct sockaddr *from, int * fromlen); |
1519 | int _win32_shutdown (SOCKET s, int how); |
1520 | int _win32_closesocket (SOCKET s); |
1521 | int _win32_ioctlsocket (SOCKET s, long cmd, u_long *argp); |
1522 | int _win32_setsockopt (SOCKET s, int level, int optname, |
1523 | const char * optval, int optlen); |
1524 | int _win32_getsockopt (SOCKET s, int level, int optname, char * optval, int *optlen); |
1525 | int _win32_getpeername (SOCKET s, struct sockaddr *name, int * namelen); |
1526 | int _win32_getsockname (SOCKET s, struct sockaddr *name, int * namelen); |
1527 | int _win32_gethostname (char * name, int namelen); |
1528 | struct hostent * _win32_gethostbyname(const char * name); |
1529 | struct hostent * _win32_gethostbyaddr(const char * addr, int len, int type); |
1530 | struct protoent * _win32_getprotobyname(const char * name); |
1531 | struct protoent * _win32_getprotobynumber(int proto); |
1532 | struct servent * _win32_getservbyname(const char * name, const char * proto); |
1533 | struct servent * _win32_getservbyport(int port, const char * proto); |
1534 | int _win32_select (int nfds, Perl_fd_set *rfds, Perl_fd_set *wfds, Perl_fd_set *xfds, |
1535 | const struct timeval *timeout); |
1536 | void _win32_endnetent(void); |
1537 | void _win32_endhostent(void); |
1538 | void _win32_endprotoent(void); |
1539 | void _win32_endservent(void); |
1540 | struct netent * _win32_getnetent(void); |
1541 | struct netent * _win32_getnetbyname(char *name); |
1542 | struct netent * _win32_getnetbyaddr(long net, int type); |
1543 | struct protoent *_win32_getprotoent(void); |
1544 | struct servent *_win32_getservent(void); |
1545 | void _win32_sethostent(int stayopen); |
1546 | void _win32_setnetent(int stayopen); |
1547 | void _win32_setprotoent(int stayopen); |
1548 | void _win32_setservent(int stayopen); |
1549 | |
e3b8966e |
1550 | #pragma warning(once : 4113) |
1551 | EOCODE |
1552 | |
1553 | |
1554 | close HDRFILE; |
1555 | close OUTFILE; |