#define bufend pPerl->Perl_bufend
#undef bufptr
#define bufptr pPerl->Perl_bufptr
+#undef byterun
+#define byterun pPerl->Perl_byterun
#undef cddir
#define cddir pPerl->Perl_cddir
#undef chopset
#define get_op_descs pPerl->Perl_get_op_descs
#undef get_op_names
#define get_op_names pPerl->Perl_get_op_names
+#undef get_no_modify
+#define get_no_modify pPerl->Perl_get_no_modify
+#undef get_opargs
+#define get_opargs pPerl->Perl_get_opargs
#undef gp_free
#define gp_free pPerl->Perl_gp_free
#undef gp_ref
void (*freadpv)(U32, void*);
};
void byterun _((struct bytestream));
-#else
-void byterun _((PerlIO *));
+/* #else
+void byterun _((PerlIO *)); */
#endif /* INDIRECT_BGET_MACROS */
void *bset_obj_store _((void *, I32));
#define freq Perl_freq
#define ge_amg Perl_ge_amg
#define gen_constant_list Perl_gen_constant_list
+#define get_no_modify Perl_get_no_modify
#define get_op_descs Perl_get_op_descs
#define get_op_names Perl_get_op_names
+#define get_opargs Perl_get_opargs
+#define get_specialsv_list Perl_get_specialsv_list
#define gp_free Perl_gp_free
#define gp_ref Perl_gp_ref
#define gt_amg Perl_gt_amg
#define sawampersand (curinterp->Isawampersand)
#define sawstudy (curinterp->Isawstudy)
#define sawvec (curinterp->Isawvec)
-#define seen_zerolen (curinterp->Iseen_zerolen)
#define screamfirst (curinterp->Iscreamfirst)
#define screamnext (curinterp->Iscreamnext)
#define secondgv (curinterp->Isecondgv)
+#define seen_zerolen (curinterp->Iseen_zerolen)
#define siggv (curinterp->Isiggv)
#define sortcop (curinterp->Isortcop)
#define sortcxix (curinterp->Isortcxix)
#define do_undump (Perl_Vars.Gdo_undump)
#define egid (Perl_Vars.Gegid)
#define error_count (Perl_Vars.Gerror_count)
-#define error_no (Perl_Vars.Gerror_no)
+#define error_no (Perl_Vars.Gerror_no)
#define euid (Perl_Vars.Geuid)
#define eval_cond (Perl_Vars.Geval_cond)
#define eval_mutex (Perl_Vars.Geval_mutex)
#define Gdo_undump do_undump
#define Gegid egid
#define Gerror_count error_count
-#define Gerror_no error_no
+#define Gerror_no error_no
#define Geuid euid
#define Geval_cond eval_cond
#define Geval_mutex eval_mutex
#define do_undump Perl_do_undump
#define egid Perl_egid
#define error_count Perl_error_count
-#define error_no Perl_error_no
+#define error_no Perl_error_no
#define euid Perl_euid
#define eval_cond Perl_eval_cond
#define eval_mutex Perl_eval_mutex
ge_amg
get_op_descs
get_op_names
+get_no_modify
+get_opargs
+get_specialsv_list
gt_amg
inc_amg
init_thread_intern
}
#endif /* WIN32 */
+#ifndef DEBUGGING
+/* create a matching set of virtual entries for the non debugging version */
+void CPerlObj::deb_place_holder _((const char* pat,...)) {};
+void CPerlObj::deb_growlevel_place_holder _((void)) {};
+void CPerlObj::debprofdump_place_holder _((void)) {};
+I32 CPerlObj::debop_place_holder _((OP* o)) { return 0; };
+I32 CPerlObj::debstack_place_holder _((void)) { return 0; };
+I32 CPerlObj::debstackptrs_place_holder _((void)) { return 0; };
+#endif
+
#endif /* PERL_OBJECT */
maxscream
maxsysfd
mess_sv
+mh
minus_F
minus_a
minus_c
virtual unsigned long InetAddr(const char* cp, int &err) = 0;
virtual char* InetNtoa(struct in_addr in, int &err) = 0;
virtual int Listen(SOCKET s, int backlog, int &err) = 0;
+ virtual int Recv(SOCKET s, char* buf, int len, int flags, int &err) = 0;
virtual int Recvfrom(SOCKET s, char* buf, int len, int flags, struct sockaddr* from, int* fromlen, int &err) = 0;
virtual int Select(int nfds, char* readfds, char* writefds, char* exceptfds, const struct timeval* timeout, int &err) = 0;
virtual int Send(SOCKET s, const char* buf, int len, int flags, int &err) = 0;
virtual int Shutdown(SOCKET s, int how, int &err) = 0;
virtual SOCKET Socket(int af, int type, int protocol, int &err) = 0;
virtual int Socketpair(int domain, int type, int protocol, int* fds, int &err) = 0;
+#ifdef WIN32
+ virtual int Closesocket(SOCKET s, int& err) = 0;
+ virtual int Ioctlsocket(SOCKET s, long cmd, u_long *argp, int& err) = 0;
+#endif
};
#endif /* __Inc__IPerlSock___ */
virtual int GetBufsiz(PerlIO *, int &err) = 0;
virtual int GetCnt(PerlIO *, int &err) = 0;
virtual char* GetPtr(PerlIO *, int &err) = 0;
+ virtual char* Gets(PerlIO*, char*, int, int& err) = 0;
virtual int Putc(PerlIO*, int, int &err) = 0;
virtual int Puts(PerlIO*, const char *, int &err) = 0;
virtual int Flush(PerlIO*, int &err) = 0;
#define get_op_descs CPerlObj::Perl_get_op_descs
#undef get_op_names
#define get_op_names CPerlObj::Perl_get_op_names
+#undef get_no_modify
+#define get_no_modify CPerlObj::Perl_get_no_modify
+#undef get_opargs
+#define get_opargs CPerlObj::Perl_get_opargs
#undef getlogin
#define getlogin CPerlObj::getlogin
#undef gp_free
#define PerlIO_putc(f,c) piStdIO->Putc((f),(c), ErrorNo())
#define PerlIO_puts(f,s) piStdIO->Puts((f),(s), ErrorNo())
#define PerlIO_flush(f) piStdIO->Flush((f), ErrorNo())
+#define PerlIO_gets(s, n, fp) piStdIO->Gets((fp), s, n, ErrorNo())
#define PerlIO_ungetc(f,c) piStdIO->Ungetc((f),(c), ErrorNo())
#define PerlIO_fileno(f) piStdIO->Fileno((f), ErrorNo())
#define PerlIO_fdopen(f, s) piStdIO->Fdopen((f),(s), ErrorNo())
#define PerlSock_inet_addr(c) piSock->InetAddr(c, ErrorNo())
#define PerlSock_inet_ntoa(i) piSock->InetNtoa(i, ErrorNo())
#define PerlSock_listen(s, b) piSock->Listen(s, b, ErrorNo())
+#define PerlSock_recv(s, b, l, f) piSock->Recv(s, b, l, f, ErrorNo())
#define PerlSock_recvfrom(s, b, l, f, from, fromlen) piSock->Recvfrom(s, b, l, f, from, fromlen, ErrorNo())
#define PerlSock_select(n, r, w, e, t) piSock->Select(n, (char*)r, (char*)w, (char*)e, t, ErrorNo())
#define PerlSock_send(s, b, l, f) piSock->Send(s, b, l, f, ErrorNo())
VIRTUAL I32 filter_read _((int idx, SV* buffer, int maxlen));
VIRTUAL char ** get_op_descs _((void));
VIRTUAL char ** get_op_names _((void));
+VIRTUAL char * get_no_modify _((void));
+VIRTUAL U32 * get_opargs _((void));
VIRTUAL I32 cxinc _((void));
#ifdef DEBUGGING
VIRTUAL void deb _((const char* pat,...)) __attribute__((format(printf,1,2)));
VIRTUAL I32 debop _((OP* o));
VIRTUAL I32 debstack _((void));
VIRTUAL I32 debstackptrs _((void));
+#else
+#ifdef PERL_OBJECT
+/* create a matching set of virtual entries for the non debugging version */
+VIRTUAL void deb_place_holder _((const char* pat,...));
+VIRTUAL void deb_growlevel_place_holder _((void));
+VIRTUAL void debprofdump_place_holder _((void));
+VIRTUAL I32 debop_place_holder _((OP* o));
+VIRTUAL I32 debstack_place_holder _((void));
+VIRTUAL I32 debstackptrs_place_holder _((void));
+#endif
#endif
VIRTUAL char* delimcpy _((char* to, char* toend, char* from, char* fromend,
int delim, I32* retlen));
#endif
void *bset_obj_store _((void *obj, I32 ix));
-#ifdef INDIRECT_BGET_MACROS
-void byterun _((struct bytestream bs));
-#else
-void byterun _((PerlIO *fp));
-#endif /* INDIRECT_BGET_MACROS */
-
OP *new_logop _((I32 type, I32 flags, OP **firstp, OP **otherp));
#define PPDEF(s) OP* CPerlObj::s _((ARGSproto));
public:
+#ifdef INDIRECT_BGET_MACROS
+VIRTUAL void byterun _((struct bytestream bs));
+#else
+VIRTUAL void byterun _((PerlIO *fp));
+#endif /* INDIRECT_BGET_MACROS */
+
PPDEF(pp_aassign)
PPDEF(pp_abs)
PPDEF(pp_accept)
{
return op_desc;
}
+
+char *
+get_no_modify(void)
+{
+ return (char*)no_modify;
+}
+
+U32 *
+get_opargs(void)
+{
+ return opargs;
+}
debop
debstack
debstackptrs
+deb_place_holder
+deb_growlevel_place_holder
+debprofdump_place_holder
+debop_place_holder
+debstack_place_holder
+debstackptrs_place_holder
fprintf
find_threadsv
magic_mutexfree
next;
}
+ if($name eq "byterun" and $args eq "struct bytestream bs") {
+ next;
+ }
+
# foo(void);
if ($args eq "void") {
print OUTFILE <<ENDCODE;
extern "C" {
+
+
+char ** _Perl_op_desc(void)
+{
+ return pPerl->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*);
return pPerl->piStdIO->SetVBuf((PerlIO*)pf, buf, type, size, ErrorNo());
}
+char* _win32_fgets(char *s, int n, FILE *pf)
+{
+ return pPerl->piStdIO->Gets((PerlIO*)pf, s, n, ErrorNo());
+}
+
+char* _win32_gets(char *s)
+{
+ return _win32_fgets(s, 80, (FILE*)pPerl->piStdIO->Stdin());
+}
+
int _win32_fgetc(FILE *pf)
{
return pPerl->piStdIO->Getc((PerlIO*)pf, ErrorNo());
int _win32_recv (SOCKET s, char * buf, int len, int flags)
{
- return 0;
+ return pPerl->piSock->Recv(s, buf, len, flags, ErrorNo());
}
int _win32_recvfrom (SOCKET s, char * buf, int len, int flags,
int _win32_closesocket (SOCKET s)
{
- return 0;
+ return pPerl->piSock->Closesocket(s, ErrorNo());
}
int _win32_ioctlsocket (SOCKET s, long cmd, u_long *argp)
{
- return 0;
+ return pPerl->piSock->Ioctlsocket(s, cmd, argp, ErrorNo());
}
int _win32_setsockopt (SOCKET s, int level, int optname,
print HDRFILE <<EOCODE;
+#undef Perl_op_desc
+char ** _Perl_op_desc ();
+#define Perl_op_desc (_Perl_op_desc())
+
+#undef Perl_op_name
+char ** _Perl_op_name ();
+#define Perl_op_name (_Perl_op_name())
+
+#undef Perl_no_modify
+char ** _Perl_no_modify ();
+#define Perl_no_modify (_Perl_no_modify())
+
+#undef Perl_opargs
+char ** _Perl_opargs ();
+#define Perl_opargs (_Perl_opargs())
+
+
#undef win32_errno
#undef win32_stdin
#undef win32_stdout
#undef win32_setbuf
#undef win32_setvbuf
#undef win32_fgetc
+#undef win32_fgets
+#undef win32_gets
#undef win32_putc
#undef win32_puts
#undef win32_getchar
#define win32_setbuf _win32_setbuf
#define win32_setvbuf _win32_setvbuf
#define win32_fgetc _win32_fgetc
+#define win32_fgets _win32_fgets
+#define win32_gets _win32_gets
#define win32_putc _win32_putc
#define win32_puts _win32_puts
#define win32_getchar _win32_getchar
char *r = win32_inet_ntoa(in);
PROCESS_AND_RETURN;
};
- virtual int IoctlSocket(SOCKET s, long cmd, u_long *argp, int& err)
+ virtual int Listen(SOCKET s, int backlog, int &err)
{
- int r = win32_ioctlsocket(s, cmd, argp);
+ int r = win32_listen(s, backlog);
PROCESS_AND_RETURN;
};
- virtual int Listen(SOCKET s, int backlog, int &err)
+ virtual int Recv(SOCKET s, char* buffer, int len, int flags, int &err)
{
- int r = win32_listen(s, backlog);
+ int r = win32_recv(s, buffer, len, flags);
PROCESS_AND_RETURN;
};
virtual int Recvfrom(SOCKET s, char* buffer, int len, int flags, struct sockaddr* from, int* fromlen, int &err)
croak("socketpair not implemented!\n");
return 0;
};
+ virtual int Closesocket(SOCKET s, int& err)
+ {
+ int r = win32_closesocket(s);
+ PROCESS_AND_RETURN;
+ };
+ virtual int Ioctlsocket(SOCKET s, long cmd, u_long *argp, int& err)
+ {
+ int r = win32_ioctlsocket(s, cmd, argp);
+ PROCESS_AND_RETURN;
+ };
};
FILE *f = (FILE*)pf;
return FILE_ptr(f);
};
+ virtual char* Gets(PerlIO* pf, char* s, int n, int& err)
+ {
+ char* ret = win32_fgets(s, n, (FILE*)pf);
+ if(errno)
+ err = errno;
+ return ret;
+ };
virtual int Putc(PerlIO* pf, int c, int &err)
{
CALLFUNCERR(win32_fputc(c, (FILE*)pf))