# creates a C API file from proto.h # takes one argument, the path to lib/CORE directory. # creates 2 files: "perlCAPI.cpp" and "perlCAPI.h". my $hdrfile = "$ARGV[0]/perlCAPI.h"; my $infile = '../proto.h'; my @embedsyms = ('../global.sym', '../pp.sym'); my $separateObj = 0; my %skip_list; my %embed; sub readsyms(\%@) { my ($syms, @files) = @_; my ($line, @words); %$syms = (); foreach my $file (@files) { local (*FILE, $_); open(FILE, "< $file") or die "$0: Can't open $file: $!\n"; while () { s/[ \t]*#.*$//; # delete comments if (/^\s*(\S+)\s*$/) { my $sym = $1; $$syms{$sym} = "Perl_$sym"; } } close(FILE); } } readsyms %embed, @embedsyms; sub skip_these { my $list = shift; foreach my $symbol (@$list) { $skip_list{$symbol} = 1; } } skip_these [qw( yylex cando cast_ulong my_chsize condpair_magic deb deb_growlevel debprofdump debop debstack debstackptrs dump_fds dump_mstats fprintf find_threadsv magic_mutexfree my_memcmp my_memset my_pclose my_popen my_swap my_htonl my_ntohl new_struct_thread same_dirent unlnk unlock_condpair safexmalloc safexcalloc safexrealloc safexfree Perl_GetVars malloced_size do_exec3 getenv_len )]; if (!open(INFILE, "<$infile")) { print "open of $infile failed: $!\n"; return 1; } if (!open(OUTFILE, ">perlCAPI.cpp")) { print "open of perlCAPI.cpp failed: $!\n"; return 1; } print OUTFILE <); if (/^VIRTUAL\s/) { while (!/;$/) { chomp; $_ .= ; } $_ =~ s/^VIRTUAL\s*//; $_ =~ s/\s*__attribute__.*$/;/; if ( /(.*)\s([A-z_]*[0-9A-z_]+\s)_\(\((.*)\)\);/ || /(.*)\*([A-z_]*[0-9A-z_]+\s)_\(\((.*)\)\);/ ) { $type = $1; $name = $2; $args = $3; $name =~ s/\s*$//; $type =~ s/\s*$//; next if (defined $skip_list{$name}); if($args eq "ARGSproto") { $args = "void"; } $return = ($type eq "void" or $type eq "Free_t") ? "\t" : "\treturn"; if(defined $embed{$name}) { $funcName = $embed{$name}; } else { $funcName = $name; } @args = split(',', $args); if ($args[$#args] =~ /\s*\.\.\.\s*/) { if(($name eq "croak") or ($name eq "deb") or ($name eq "die") or ($name eq "form") or ($name eq "warn") or ($name eq "warner")) { print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); for (@args) { $_ = $1 if /(\w+)\W*$/; } $arg = $args[$#args-1]; my $start = ''; $start = join(', ',@args[0 .. ($#args - 2)]) if @args > 2; $start .= ', ' if $start; print OUTFILE <Perl_sv_2mortal(pPerl->Perl_newSVsv(pPerl->Perl_mess($arg, &args))); $return pPerl->Perl_$name($start SvPV_nolen(pmsg)); va_end(args); } ENDCODE print OUTFILE "#endif\n" unless ($separateObj == 0); } elsif($name eq "newSVpvf") { print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); $args[0] =~ /(\w+)\W*$/; $arg = $1; print OUTFILE <Perl_newSV(0); pPerl->Perl_sv_vcatpvfn(sv, $arg, strlen($arg), &args, NULL, 0, NULL); va_end(args); return sv; } ENDCODE print OUTFILE "#endif\n" unless ($separateObj == 0); } elsif($name eq "sv_catpvf") { print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); $args[0] =~ /(\w+)\W*$/; $arg0 = $1; $args[1] =~ /(\w+)\W*$/; $arg1 = $1; print OUTFILE <Perl_sv_vcatpvfn($arg0, $arg1, strlen($arg1), &args, NULL, 0, NULL); va_end(args); } ENDCODE print OUTFILE "#endif\n" unless ($separateObj == 0); } elsif($name eq "sv_catpvf_mg") { print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); $args[0] =~ /(\w+)\W*$/; $arg0 = $1; $args[1] =~ /(\w+)\W*$/; $arg1 = $1; print OUTFILE <Perl_mg_set #endif extern "C" $type $funcName ($args) { va_list args; va_start(args, $arg1); pPerl->Perl_sv_vcatpvfn($arg0, $arg1, strlen($arg1), &args, NULL, 0, NULL); va_end(args); SvSETMAGIC(sv); } ENDCODE print OUTFILE "#endif\n" unless ($separateObj == 0); } elsif($name eq "sv_setpvf") { print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); $args[0] =~ /(\w+)\W*$/; $arg0 = $1; $args[1] =~ /(\w+)\W*$/; $arg1 = $1; print OUTFILE <Perl_sv_vsetpvfn($arg0, $arg1, strlen($arg1), &args, NULL, 0, NULL); va_end(args); } ENDCODE print OUTFILE "#endif\n" unless ($separateObj == 0); } elsif($name eq "sv_setpvf_mg") { print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); $args[0] =~ /(\w+)\W*$/; $arg0 = $1; $args[1] =~ /(\w+)\W*$/; $arg1 = $1; print OUTFILE <Perl_mg_set #endif extern "C" $type $funcName ($args) { va_list args; va_start(args, $arg1); pPerl->Perl_sv_vsetpvfn($arg0, $arg1, strlen($arg1), &args, NULL, 0, NULL); va_end(args); SvSETMAGIC(sv); } ENDCODE print OUTFILE "#endif\n" unless ($separateObj == 0); } elsif($name eq "fprintf") { print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); $args[0] =~ /(\w+)\W*$/; $arg0 = $1; $args[1] =~ /(\w+)\W*$/; $arg1 = $1; print OUTFILE <perl_parse(xsinit, argc, argv, env); } ENDCODE print OUTFILE "#endif\n" unless ($separateObj == 0); next; } # handle special case for perl_atexit if ($name eq "perl_atexit") { print OUTFILE <perl_atexit(fn, ptr); } ENDCODE print OUTFILE "#endif\n" unless ($separateObj == 0); next; } if($name eq "byterun" and $args eq "struct bytestream bs") { next; } # foo(void); if ($args eq "void") { print OUTFILE <$funcName(); } ENDCODE print OUTFILE "#endif\n" unless ($separateObj == 0); next; } # foo(char *s, const int bar); print OUTFILE <$funcName"; $doneone = 0; foreach $arg (@args) { if ($arg =~ /(\w+)\W*$/) { if ($doneone) { print OUTFILE ", $1"; } else { print OUTFILE "($1"; $doneone++; } } } print OUTFILE ");\n}\n"; print OUTFILE "#endif\n" unless ($separateObj == 0); } else { print "failed to match $_"; } } } close INFILE; %skip_list = (); skip_these [qw( strchop filemode lastfd oldname curinterp Argv Cmd sortcop sortstash firstgv secondgv sortstack signalstack mystrk oldlastpm gensym preambled preambleav Ilaststatval Ilaststype mess_sv ors opsave eval_mutex strtab_mutex orslen ofmt modcount generation DBcv archpat_auto sortcxix lastgotoprobe regdummy regcomp_parse regxend regcode regnaughty regsawback regprecomp regnpar regsize regflags regseen seen_zerolen regcomp_rx extralen colorset colors reginput regbol regeol regstartp regendp reglastparen regtill regprev reg_start_tmp reg_start_tmpl regdata bostr reg_flags reg_eval_set regnarrate regprogram regindent regcc in_clean_objs in_clean_all linestart pending_ident statusvalue_vms sublex_info thrsv threadnum PL_piMem PL_piENV PL_piStdIO PL_piLIO PL_piDir PL_piSock PL_piProc cshname threadsv_names thread nthreads thr_key threads_mutex malloc_mutex svref_mutex sv_mutex cred_mutex nthreads_cond eval_cond cryptseen cshlen watchaddr watchok )]; sub readvars(\%$$) { my ($syms, $file, $pre) = @_; %$syms = (); local (*FILE, $_); open(FILE, "< $file") or die "$0: Can't open $file: $!\n"; while () { s/[ \t]*#.*//; # Delete comments. if (/PERLVARI?C?\($pre(\w+),\s*([^,)]+)/) { $$syms{$1} = $2; } } close(FILE); } my %intrp; my %thread; my %globvar; readvars %intrp, '..\intrpvar.h','I'; readvars %thread, '..\thrdvar.h','T'; readvars %globvar, '..\perlvars.h','G'; open(HDRFILE, ">$hdrfile") or die "$0: Can't open $hdrfile: $!\n"; print HDRFILE <PL_$name); } ENDCODE print OUTFILE "#endif\n" unless ($separateObj == 0); print HDRFILE <Perl_get_op_descs(); } char ** _Perl_op_name(void) { return pPerl->Perl_get_op_names(); } char * _Perl_no_modify(void) { return pPerl->Perl_get_no_modify(); } U32 * _Perl_opargs(void) { return pPerl->Perl_get_opargs(); } void xs_handler(CV* cv, CPerlObj* p) { void(*func)(CV*); SV* sv; MAGIC* m = pPerl->Perl_mg_find((SV*)cv, '~'); if(m != NULL) { sv = m->mg_obj; if(SvIOK(sv)) { func = (void(*)(CV*))SvIVX(sv); } else { func = (void(*)(CV*))pPerl->Perl_sv_2iv(sv); } func(cv); } } CV* Perl_newXS(char* name, void (*subaddr)(CV* cv), char* filename) { CV* cv = pPerl->Perl_newXS(name, xs_handler, filename); pPerl->Perl_sv_magic((SV*)cv, pPerl->Perl_sv_2mortal(pPerl->Perl_newSViv((IV)subaddr)), '~', "CAPI", 4); return cv; } void Perl_deb(const char pat, ...) { } #undef PL_piMem #undef PL_piENV #undef PL_piStdIO #undef PL_piLIO #undef PL_piDir #undef PL_piSock #undef PL_piProc int * _win32_errno(void) { return &pPerl->ErrorNo(); } FILE* _win32_stdin(void) { return (FILE*)pPerl->PL_piStdIO->Stdin(); } FILE* _win32_stdout(void) { return (FILE*)pPerl->PL_piStdIO->Stdout(); } FILE* _win32_stderr(void) { return (FILE*)pPerl->PL_piStdIO->Stderr(); } int _win32_ferror(FILE *fp) { return pPerl->PL_piStdIO->Error((PerlIO*)fp, ErrorNo()); } int _win32_feof(FILE *fp) { return pPerl->PL_piStdIO->Eof((PerlIO*)fp, ErrorNo()); } char* _win32_strerror(int e) { return strerror(e); } void _win32_perror(const char *str) { perror(str); } int _win32_vfprintf(FILE *pf, const char *format, va_list arg) { return pPerl->PL_piStdIO->Vprintf((PerlIO*)pf, ErrorNo(), format, arg); } int _win32_vprintf(const char *format, va_list arg) { return pPerl->PL_piStdIO->Vprintf(pPerl->PL_piStdIO->Stdout(), ErrorNo(), format, arg); } int _win32_fprintf(FILE *pf, const char *format, ...) { int ret; va_list args; va_start(args, format); ret = _win32_vfprintf(pf, format, args); va_end(args); return ret; } int _win32_printf(const char *format, ...) { int ret; va_list args; va_start(args, format); ret = _win32_vprintf(format, args); va_end(args); return ret; } size_t _win32_fread(void *buf, size_t size, size_t count, FILE *pf) { return pPerl->PL_piStdIO->Read((PerlIO*)pf, buf, (size*count), ErrorNo()); } size_t _win32_fwrite(const void *buf, size_t size, size_t count, FILE *pf) { return pPerl->PL_piStdIO->Write((PerlIO*)pf, buf, (size*count), ErrorNo()); } FILE* _win32_fopen(const char *path, const char *mode) { return (FILE*)pPerl->PL_piStdIO->Open(path, mode, ErrorNo()); } FILE* _win32_fdopen(int fh, const char *mode) { return (FILE*)pPerl->PL_piStdIO->Fdopen(fh, mode, ErrorNo()); } FILE* _win32_freopen(const char *path, const char *mode, FILE *pf) { return (FILE*)pPerl->PL_piStdIO->Reopen(path, mode, (PerlIO*)pf, ErrorNo()); } int _win32_fclose(FILE *pf) { return pPerl->PL_piStdIO->Close((PerlIO*)pf, ErrorNo()); } int _win32_fputs(const char *s,FILE *pf) { return pPerl->PL_piStdIO->Puts((PerlIO*)pf, s, ErrorNo()); } int _win32_fputc(int c,FILE *pf) { return pPerl->PL_piStdIO->Putc((PerlIO*)pf, c, ErrorNo()); } int _win32_ungetc(int c,FILE *pf) { return pPerl->PL_piStdIO->Ungetc((PerlIO*)pf, c, ErrorNo()); } int _win32_getc(FILE *pf) { return pPerl->PL_piStdIO->Getc((PerlIO*)pf, ErrorNo()); } int _win32_fileno(FILE *pf) { return pPerl->PL_piStdIO->Fileno((PerlIO*)pf, ErrorNo()); } void _win32_clearerr(FILE *pf) { pPerl->PL_piStdIO->Clearerr((PerlIO*)pf, ErrorNo()); } int _win32_fflush(FILE *pf) { return pPerl->PL_piStdIO->Flush((PerlIO*)pf, ErrorNo()); } long _win32_ftell(FILE *pf) { return pPerl->PL_piStdIO->Tell((PerlIO*)pf, ErrorNo()); } int _win32_fseek(FILE *pf,long offset,int origin) { return pPerl->PL_piStdIO->Seek((PerlIO*)pf, offset, origin, ErrorNo()); } int _win32_fgetpos(FILE *pf,fpos_t *p) { return pPerl->PL_piStdIO->Getpos((PerlIO*)pf, p, ErrorNo()); } int _win32_fsetpos(FILE *pf,const fpos_t *p) { return pPerl->PL_piStdIO->Setpos((PerlIO*)pf, p, ErrorNo()); } void _win32_rewind(FILE *pf) { pPerl->PL_piStdIO->Rewind((PerlIO*)pf, ErrorNo()); } FILE* _win32_tmpfile(void) { return (FILE*)pPerl->PL_piStdIO->Tmpfile(ErrorNo()); } void _win32_setbuf(FILE *pf, char *buf) { pPerl->PL_piStdIO->SetBuf((PerlIO*)pf, buf, ErrorNo()); } int _win32_setvbuf(FILE *pf, char *buf, int type, size_t size) { return pPerl->PL_piStdIO->SetVBuf((PerlIO*)pf, buf, type, size, ErrorNo()); } char* _win32_fgets(char *s, int n, FILE *pf) { return pPerl->PL_piStdIO->Gets((PerlIO*)pf, s, n, ErrorNo()); } char* _win32_gets(char *s) { return _win32_fgets(s, 80, (FILE*)pPerl->PL_piStdIO->Stdin()); } int _win32_fgetc(FILE *pf) { return pPerl->PL_piStdIO->Getc((PerlIO*)pf, ErrorNo()); } int _win32_putc(int c, FILE *pf) { return pPerl->PL_piStdIO->Putc((PerlIO*)pf, c, ErrorNo()); } int _win32_puts(const char *s) { return pPerl->PL_piStdIO->Puts(pPerl->PL_piStdIO->Stdout(), s, ErrorNo()); } int _win32_getchar(void) { return pPerl->PL_piStdIO->Getc(pPerl->PL_piStdIO->Stdin(), ErrorNo()); } int _win32_putchar(int c) { return pPerl->PL_piStdIO->Putc(pPerl->PL_piStdIO->Stdout(), c, ErrorNo()); } void* _win32_malloc(size_t size) { return pPerl->PL_piMem->Malloc(size); } void* _win32_calloc(size_t numitems, size_t size) { return pPerl->PL_piMem->Malloc(numitems*size); } void* _win32_realloc(void *block, size_t size) { return pPerl->PL_piMem->Realloc(block, size); } void _win32_free(void *block) { pPerl->PL_piMem->Free(block); } void _win32_abort(void) { pPerl->PL_piProc->Abort(); } int _win32_pipe(int *phandles, unsigned int psize, int textmode) { return pPerl->PL_piProc->Pipe(phandles); } FILE* _win32_popen(const char *command, const char *mode) { return (FILE*)pPerl->PL_piProc->Popen(command, mode); } int _win32_pclose(FILE *pf) { return pPerl->PL_piProc->Pclose((PerlIO*)pf); } unsigned _win32_sleep(unsigned int t) { return pPerl->PL_piProc->Sleep(t); } int _win32_spawnvp(int mode, const char *cmdname, const char *const *argv) { return pPerl->PL_piProc->Spawnvp(mode, cmdname, argv); } int _win32_mkdir(const char *dir, int mode) { return pPerl->PL_piDir->Makedir(dir, mode, ErrorNo()); } int _win32_rmdir(const char *dir) { return pPerl->PL_piDir->Rmdir(dir, ErrorNo()); } int _win32_chdir(const char *dir) { return pPerl->PL_piDir->Chdir(dir, ErrorNo()); } #undef stat int _win32_fstat(int fd,struct stat *sbufptr) { return pPerl->PL_piLIO->FileStat(fd, sbufptr, ErrorNo()); } int _win32_stat(const char *name,struct stat *sbufptr) { return pPerl->PL_piLIO->NameStat(name, sbufptr, ErrorNo()); } int _win32_rename(const char *oname, const char *newname) { return pPerl->PL_piLIO->Rename(oname, newname, ErrorNo()); } int _win32_setmode(int fd, int mode) { return pPerl->PL_piLIO->Setmode(fd, mode, ErrorNo()); } long _win32_lseek(int fd, long offset, int origin) { return pPerl->PL_piLIO->Lseek(fd, offset, origin, ErrorNo()); } long _win32_tell(int fd) { return pPerl->PL_piStdIO->Tell((PerlIO*)fd, ErrorNo()); } int _win32_dup(int fd) { return pPerl->PL_piLIO->Dup(fd, ErrorNo()); } int _win32_dup2(int h1, int h2) { return pPerl->PL_piLIO->Dup2(h1, h2, ErrorNo()); } int _win32_open(const char *path, int oflag,...) { return pPerl->PL_piLIO->Open(path, oflag, ErrorNo()); } int _win32_close(int fd) { return pPerl->PL_piLIO->Close(fd, ErrorNo()); } int _win32_read(int fd, void *buf, unsigned int cnt) { return pPerl->PL_piLIO->Read(fd, buf, cnt, ErrorNo()); } int _win32_write(int fd, const void *buf, unsigned int cnt) { return pPerl->PL_piLIO->Write(fd, buf, cnt, ErrorNo()); } int _win32_times(struct tms *timebuf) { return pPerl->PL_piProc->Times(timebuf); } int _win32_ioctl(int i, unsigned int u, char *data) { return pPerl->PL_piLIO->IOCtl(i, u, data, ErrorNo()); } int _win32_utime(const char *f, struct utimbuf *t) { return pPerl->PL_piLIO->Utime((char*)f, t, ErrorNo()); } int _win32_uname(struct utsname *name) { return pPerl->PL_piENV->Uname(name, ErrorNo()); } char* _win32_getenv(const char *name) { return pPerl->PL_piENV->Getenv(name, ErrorNo()); } int _win32_putenv(const char *name) { return pPerl->PL_piENV->Putenv(name, ErrorNo()); } int _win32_open_osfhandle(long handle, int flags) { return pPerl->PL_piStdIO->OpenOSfhandle(handle, flags); } long _win32_get_osfhandle(int fd) { return pPerl->PL_piStdIO->GetOSfhandle(fd); } u_long _win32_htonl (u_long hostlong) { return pPerl->PL_piSock->Htonl(hostlong); } u_short _win32_htons (u_short hostshort) { return pPerl->PL_piSock->Htons(hostshort); } u_long _win32_ntohl (u_long netlong) { return pPerl->PL_piSock->Ntohl(netlong); } u_short _win32_ntohs (u_short netshort) { return pPerl->PL_piSock->Ntohs(netshort); } unsigned long _win32_inet_addr (const char * cp) { return pPerl->PL_piSock->InetAddr(cp, ErrorNo()); } char * _win32_inet_ntoa (struct in_addr in) { return pPerl->PL_piSock->InetNtoa(in, ErrorNo()); } SOCKET _win32_socket (int af, int type, int protocol) { return pPerl->PL_piSock->Socket(af, type, protocol, ErrorNo()); } int _win32_bind (SOCKET s, const struct sockaddr *addr, int namelen) { return pPerl->PL_piSock->Bind(s, addr, namelen, ErrorNo()); } int _win32_listen (SOCKET s, int backlog) { return pPerl->PL_piSock->Listen(s, backlog, ErrorNo()); } SOCKET _win32_accept (SOCKET s, struct sockaddr *addr, int *addrlen) { return pPerl->PL_piSock->Accept(s, addr, addrlen, ErrorNo()); } int _win32_connect (SOCKET s, const struct sockaddr *name, int namelen) { return pPerl->PL_piSock->Connect(s, name, namelen, ErrorNo()); } int _win32_send (SOCKET s, const char * buf, int len, int flags) { return pPerl->PL_piSock->Send(s, buf, len, flags, ErrorNo()); } int _win32_sendto (SOCKET s, const char * buf, int len, int flags, const struct sockaddr *to, int tolen) { return pPerl->PL_piSock->Sendto(s, buf, len, flags, to, tolen, ErrorNo()); } int _win32_recv (SOCKET s, char * buf, int len, int flags) { return pPerl->PL_piSock->Recv(s, buf, len, flags, ErrorNo()); } int _win32_recvfrom (SOCKET s, char * buf, int len, int flags, struct sockaddr *from, int * fromlen) { return pPerl->PL_piSock->Recvfrom(s, buf, len, flags, from, fromlen, ErrorNo()); } int _win32_shutdown (SOCKET s, int how) { return pPerl->PL_piSock->Shutdown(s, how, ErrorNo()); } int _win32_closesocket (SOCKET s) { return pPerl->PL_piSock->Closesocket(s, ErrorNo()); } int _win32_ioctlsocket (SOCKET s, long cmd, u_long *argp) { return pPerl->PL_piSock->Ioctlsocket(s, cmd, argp, ErrorNo()); } int _win32_setsockopt (SOCKET s, int level, int optname, const char * optval, int optlen) { return pPerl->PL_piSock->Setsockopt(s, level, optname, optval, optlen, ErrorNo()); } int _win32_getsockopt (SOCKET s, int level, int optname, char * optval, int *optlen) { return pPerl->PL_piSock->Getsockopt(s, level, optname, optval, optlen, ErrorNo()); } int _win32_getpeername (SOCKET s, struct sockaddr *name, int * namelen) { return pPerl->PL_piSock->Getpeername(s, name, namelen, ErrorNo()); } int _win32_getsockname (SOCKET s, struct sockaddr *name, int * namelen) { return pPerl->PL_piSock->Getsockname(s, name, namelen, ErrorNo()); } int _win32_gethostname (char * name, int namelen) { return pPerl->PL_piSock->Gethostname(name, namelen, ErrorNo()); } struct hostent * _win32_gethostbyname(const char * name) { return pPerl->PL_piSock->Gethostbyname(name, ErrorNo()); } struct hostent * _win32_gethostbyaddr(const char * addr, int len, int type) { return pPerl->PL_piSock->Gethostbyaddr(addr, len, type, ErrorNo()); } struct protoent * _win32_getprotobyname(const char * name) { return pPerl->PL_piSock->Getprotobyname(name, ErrorNo()); } struct protoent * _win32_getprotobynumber(int proto) { return pPerl->PL_piSock->Getprotobynumber(proto, ErrorNo()); } struct servent * _win32_getservbyname(const char * name, const char * proto) { return pPerl->PL_piSock->Getservbyname(name, proto, ErrorNo()); } struct servent * _win32_getservbyport(int port, const char * proto) { return pPerl->PL_piSock->Getservbyport(port, proto, ErrorNo()); } int _win32_select (int nfds, Perl_fd_set *rfds, Perl_fd_set *wfds, Perl_fd_set *xfds, const struct timeval *timeout) { return pPerl->PL_piSock->Select(nfds, (char*)rfds, (char*)wfds, (char*)xfds, timeout, ErrorNo()); } void _win32_endnetent(void) { pPerl->PL_piSock->Endnetent(ErrorNo()); } void _win32_endhostent(void) { pPerl->PL_piSock->Endhostent(ErrorNo()); } void _win32_endprotoent(void) { pPerl->PL_piSock->Endprotoent(ErrorNo()); } void _win32_endservent(void) { pPerl->PL_piSock->Endservent(ErrorNo()); } struct netent * _win32_getnetent(void) { return pPerl->PL_piSock->Getnetent(ErrorNo()); } struct netent * _win32_getnetbyname(char *name) { return pPerl->PL_piSock->Getnetbyname(name, ErrorNo()); } struct netent * _win32_getnetbyaddr(long net, int type) { return pPerl->PL_piSock->Getnetbyaddr(net, type, ErrorNo()); } struct protoent *_win32_getprotoent(void) { return pPerl->PL_piSock->Getprotoent(ErrorNo()); } struct servent *_win32_getservent(void) { return pPerl->PL_piSock->Getservent(ErrorNo()); } void _win32_sethostent(int stayopen) { pPerl->PL_piSock->Sethostent(stayopen, ErrorNo()); } void _win32_setnetent(int stayopen) { pPerl->PL_piSock->Setnetent(stayopen, ErrorNo()); } void _win32_setprotoent(int stayopen) { pPerl->PL_piSock->Setprotoent(stayopen, ErrorNo()); } void _win32_setservent(int stayopen) { pPerl->PL_piSock->Setservent(stayopen, ErrorNo()); } } /* extern "C" */ EOCODE print HDRFILE <