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