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