This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Attempt to fix problems with new exception handling macros.
[perl5.git] / XSUB.h
CommitLineData
eb1102fc
NIS
1/* XSUB.h
2 *
4bb101f2
JH
3 * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999,
4 * 2000, 2001, 2002, 2003, by Larry Wall and others
eb1102fc
NIS
5 *
6 * You may distribute under the terms of either the GNU General Public
7 * License or the Artistic License, as specified in the README file.
8 *
9 */
10
b4ba0ab9
GS
11#ifndef _INC_PERL_XSUB_H
12#define _INC_PERL_XSUB_H 1
13
954c1994
GS
14/* first, some documentation for xsubpp-generated items */
15
16/*
ccfc67b7
JH
17=head1 Variables created by C<xsubpp> and C<xsubpp> internal functions
18
954c1994
GS
19=for apidoc Amn|char*|CLASS
20Variable which is setup by C<xsubpp> to indicate the
21class name for a C++ XS constructor. This is always a C<char*>. See C<THIS>.
22
23=for apidoc Amn|(whatever)|RETVAL
24Variable which is setup by C<xsubpp> to hold the return value for an
25XSUB. This is always the proper type for the XSUB. See
26L<perlxs/"The RETVAL Variable">.
27
28=for apidoc Amn|(whatever)|THIS
29Variable which is setup by C<xsubpp> to designate the object in a C++
30XSUB. This is always the proper type for the C++ object. See C<CLASS> and
31L<perlxs/"Using XS With C++">.
32
9f2ea798
DM
33=for apidoc Amn|I32|ax
34Variable which is setup by C<xsubpp> to indicate the stack base offset,
35used by the C<ST>, C<XSprePUSH> and C<XSRETURN> macros. The C<dMARK> macro
36must be called prior to setup the C<MARK> variable.
37
954c1994
GS
38=for apidoc Amn|I32|items
39Variable which is setup by C<xsubpp> to indicate the number of
40items on the stack. See L<perlxs/"Variable-length Parameter Lists">.
41
42=for apidoc Amn|I32|ix
43Variable which is setup by C<xsubpp> to indicate which of an
44XSUB's aliases was used to invoke it. See L<perlxs/"The ALIAS: Keyword">.
45
46=for apidoc Am|SV*|ST|int ix
47Used to access elements on the XSUB's stack.
48
49=for apidoc AmU||XS
50Macro to declare an XSUB and its C parameter list. This is handled by
51C<xsubpp>.
52
9f2ea798
DM
53=for apidoc Ams||dAX
54Sets up the C<ax> variable.
55This is usually handled automatically by C<xsubpp> by calling C<dXSARGS>.
56
57=for apidoc Ams||dITEMS
58Sets up the C<items> variable.
59This is usually handled automatically by C<xsubpp> by calling C<dXSARGS>.
60
954c1994 61=for apidoc Ams||dXSARGS
9f2ea798
DM
62Sets up stack and mark pointers for an XSUB, calling dSP and dMARK.
63Sets up the C<ax> and C<items> variables by calling C<dAX> and C<dITEMS>.
64This is usually handled automatically by C<xsubpp>.
954c1994
GS
65
66=for apidoc Ams||dXSI32
67Sets up the C<ix> variable for an XSUB which has aliases. This is usually
68handled automatically by C<xsubpp>.
69
88037a85
RGS
70=for apidoc Ams||dUNDERBAR
71Sets up the C<padoff_du> variable for an XSUB that wishes to use
72C<UNDERBAR>.
73
74=for apidoc AmU||UNDERBAR
75The SV* corresponding to the $_ variable. Works even if there
76is a lexical $_ in scope.
77
954c1994
GS
78=cut
79*/
80
3280af22 81#define ST(off) PL_stack_base[ax + (off)]
a0d0e21e 82
d308986b 83#if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
acfe0abc 84# define XS(name) __declspec(dllexport) void name(pTHX_ CV* cv)
cea2e8a9 85#else
acfe0abc 86# define XS(name) void name(pTHX_ CV* cv)
a0d0e21e
LW
87#endif
88
349b520e 89#define dAX I32 ax = MARK - PL_stack_base + 1
9f2ea798
DM
90
91#define dITEMS I32 items = SP - MARK
92
a0d0e21e 93#define dXSARGS \
3c78fafa 94 dSP; dMARK; \
9f2ea798 95 dAX; dITEMS
a0d0e21e 96
8a7fc0dc
GS
97#define dXSTARG SV * targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \
98 ? PAD_SV(PL_op->op_targ) : sv_newmortal())
99
b26a54d0
GS
100/* Should be used before final PUSHi etc. if not in PPCODE section. */
101#define XSprePUSH (sp = PL_stack_base + ax - 1)
102
a0d0e21e
LW
103#define XSANY CvXSUBANY(cv)
104
105#define dXSI32 I32 ix = XSANY.any_i32
106
cfc02341
IZ
107#ifdef __cplusplus
108# define XSINTERFACE_CVT(ret,name) ret (*name)(...)
109#else
110# define XSINTERFACE_CVT(ret,name) ret (*name)()
111#endif
112#define dXSFUNCTION(ret) XSINTERFACE_CVT(ret,XSFUNCTION)
2554589c 113#define XSINTERFACE_FUNC(ret,cv,f) ((XSINTERFACE_CVT(ret,))(f))
cfc02341 114#define XSINTERFACE_FUNC_SET(cv,f) \
a12c3db7 115 CvXSUBANY(cv).any_dxptr = (void (*) (pTHX_ void*))(f)
cfc02341 116
8e64067c 117#define dUNDERBAR I32 padoff_du = find_rundefsvoffset()
88037a85
RGS
118#define UNDERBAR ((padoff_du == NOT_IN_PAD \
119 || PAD_COMPNAME_FLAGS(padoff_du) & SVpad_OUR) \
120 ? DEFSV : PAD_SVl(padoff_du))
121
748a9306
LW
122/* Simple macros to put new mortal values onto the stack. */
123/* Typically used to return values from XS functions. */
954c1994
GS
124
125/*
ccfc67b7
JH
126=head1 Stack Manipulation Macros
127
954c1994
GS
128=for apidoc Am|void|XST_mIV|int pos|IV iv
129Place an integer into the specified position C<pos> on the stack. The
130value is stored in a new mortal SV.
131
132=for apidoc Am|void|XST_mNV|int pos|NV nv
133Place a double into the specified position C<pos> on the stack. The value
134is stored in a new mortal SV.
135
136=for apidoc Am|void|XST_mPV|int pos|char* str
137Place a copy of a string into the specified position C<pos> on the stack.
138The value is stored in a new mortal SV.
139
140=for apidoc Am|void|XST_mNO|int pos
141Place C<&PL_sv_no> into the specified position C<pos> on the
142stack.
143
144=for apidoc Am|void|XST_mYES|int pos
145Place C<&PL_sv_yes> into the specified position C<pos> on the
146stack.
147
148=for apidoc Am|void|XST_mUNDEF|int pos
149Place C<&PL_sv_undef> into the specified position C<pos> on the
150stack.
151
152=for apidoc Am|void|XSRETURN|int nitems
153Return from XSUB, indicating number of items on the stack. This is usually
154handled by C<xsubpp>.
155
156=for apidoc Am|void|XSRETURN_IV|IV iv
157Return an integer from an XSUB immediately. Uses C<XST_mIV>.
158
108ccc45
JH
159=for apidoc Am|void|XSRETURN_UV|IV uv
160Return an integer from an XSUB immediately. Uses C<XST_mUV>.
161
954c1994 162=for apidoc Am|void|XSRETURN_NV|NV nv
d1be9408 163Return a double from an XSUB immediately. Uses C<XST_mNV>.
954c1994
GS
164
165=for apidoc Am|void|XSRETURN_PV|char* str
166Return a copy of a string from an XSUB immediately. Uses C<XST_mPV>.
167
168=for apidoc Ams||XSRETURN_NO
169Return C<&PL_sv_no> from an XSUB immediately. Uses C<XST_mNO>.
170
171=for apidoc Ams||XSRETURN_YES
172Return C<&PL_sv_yes> from an XSUB immediately. Uses C<XST_mYES>.
173
174=for apidoc Ams||XSRETURN_UNDEF
175Return C<&PL_sv_undef> from an XSUB immediately. Uses C<XST_mUNDEF>.
176
177=for apidoc Ams||XSRETURN_EMPTY
178Return an empty list from an XSUB immediately.
179
ccfc67b7
JH
180=head1 Variables created by C<xsubpp> and C<xsubpp> internal functions
181
c578083c 182=for apidoc AmU||newXSproto|char* name|XSUBADDR_t f|char* filename|const char *proto
954c1994
GS
183Used by C<xsubpp> to hook up XSUBs as Perl subs. Adds Perl prototypes to
184the subs.
185
186=for apidoc AmU||XS_VERSION
187The version identifier for an XS module. This is usually
188handled automatically by C<ExtUtils::MakeMaker>. See C<XS_VERSION_BOOTCHECK>.
189
190=for apidoc Ams||XS_VERSION_BOOTCHECK
191Macro to verify that a PM module's $VERSION variable matches the XS
192module's C<XS_VERSION> variable. This is usually handled automatically by
193C<xsubpp>. See L<perlxs/"The VERSIONCHECK: Keyword">.
194
0ca3a874
MHM
195=head1 Simple Exception Handling Macros
196
197=for apidoc Ams||dXCPT
198Set up neccessary local variables for exception handling.
199See L<perlguts/"Exception Handling">.
200
201=for apidoc AmU||XCPT_TRY_START
202Starts a try block. See L<perlguts/"Exception Handling">.
203
204=for apidoc AmU||XCPT_TRY_END
205Ends a try block. See L<perlguts/"Exception Handling">.
206
207=for apidoc AmU||XCPT_CATCH
208Introduces a catch block. See L<perlguts/"Exception Handling">.
209
210=for apidoc Ams||XCPT_RETHROW
211Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
212
954c1994
GS
213=cut
214*/
215
4633a7c4 216#define XST_mIV(i,v) (ST(i) = sv_2mortal(newSViv(v)) )
108ccc45 217#define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) )
4633a7c4
LW
218#define XST_mNV(i,v) (ST(i) = sv_2mortal(newSVnv(v)) )
219#define XST_mPV(i,v) (ST(i) = sv_2mortal(newSVpv(v,0)))
79cb57f6 220#define XST_mPVN(i,v,n) (ST(i) = sv_2mortal(newSVpvn(v,n)))
3280af22
NIS
221#define XST_mNO(i) (ST(i) = &PL_sv_no )
222#define XST_mYES(i) (ST(i) = &PL_sv_yes )
223#define XST_mUNDEF(i) (ST(i) = &PL_sv_undef)
954c1994
GS
224
225#define XSRETURN(off) \
226 STMT_START { \
a02b2239
RGS
227 IV tmpXSoff = (off); \
228 PL_stack_sp = PL_stack_base + ax + (tmpXSoff - 1); \
954c1994
GS
229 return; \
230 } STMT_END
231
80b92232 232#define XSRETURN_IV(v) STMT_START { XST_mIV(0,v); XSRETURN(1); } STMT_END
108ccc45 233#define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END
80b92232
PP
234#define XSRETURN_NV(v) STMT_START { XST_mNV(0,v); XSRETURN(1); } STMT_END
235#define XSRETURN_PV(v) STMT_START { XST_mPV(0,v); XSRETURN(1); } STMT_END
954c1994 236#define XSRETURN_PVN(v,n) STMT_START { XST_mPVN(0,v,n); XSRETURN(1); } STMT_END
80b92232
PP
237#define XSRETURN_NO STMT_START { XST_mNO(0); XSRETURN(1); } STMT_END
238#define XSRETURN_YES STMT_START { XST_mYES(0); XSRETURN(1); } STMT_END
239#define XSRETURN_UNDEF STMT_START { XST_mUNDEF(0); XSRETURN(1); } STMT_END
240#define XSRETURN_EMPTY STMT_START { XSRETURN(0); } STMT_END
382b8d97 241
37120919 242#define newXSproto(a,b,c,d) sv_setpv((SV*)newXS(a,b,c), d)
720fb644
PP
243
244#ifdef XS_VERSION
c6af7a1a 245# define XS_VERSION_BOOTCHECK \
774d564b 246 STMT_START { \
3de3296f 247 SV *_sv; STRLEN n_a; \
2d8e6c8d 248 char *vn = Nullch, *module = SvPV(ST(0),n_a); \
774d564b 249 if (items >= 2) /* version supplied as bootstrap arg */ \
3de3296f 250 _sv = ST(1); \
774d564b 251 else { \
46fc3d4c 252 /* XXX GV_ADDWARN */ \
3de3296f 253 _sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
864dbfa3 254 vn = "XS_VERSION"), FALSE); \
3de3296f
AE
255 if (!_sv || !SvOK(_sv)) \
256 _sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
864dbfa3 257 vn = "VERSION"), FALSE); \
774d564b 258 } \
639e8c3d
JP
259 if (_sv) { \
260 SV *xssv = Perl_newSVpvf(aTHX_ "%s",XS_VERSION); \
261 xssv = new_version(xssv); \
262 if ( !sv_derived_from(_sv, "version") ) \
263 _sv = new_version(_sv); \
264 if ( vcmp(_sv,xssv) ) \
014ead4b 265 Perl_croak(aTHX_ "%s object version %"SVf" does not match %s%s%s%s %"SVf,\
639e8c3d
JP
266 module, vstringify(xssv), \
267 vn ? "$" : "", vn ? module : "", vn ? "::" : "", \
268 vn ? vn : "bootstrap parameter", vstringify(_sv));\
269 } \
80b92232 270 } STMT_END
720fb644 271#else
c6af7a1a 272# define XS_VERSION_BOOTCHECK
720fb644 273#endif
76e3520e 274
9b5c3821
MHM
275#ifdef NO_XSLOCKS
276# define dXCPT dJMPENV; int rEtV = 0
277# define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0)
278# define XCPT_TRY_END JMPENV_POP;
279# define XCPT_CATCH if (rEtV != 0)
280# define XCPT_RETHROW JMPENV_JUMP(rEtV)
281#endif
0ca3a874 282
6a31061a
PM
283/*
284 The DBM_setFilter & DBM_ckFilter macros are only used by
285 the *DB*_File modules
286*/
287
288#define DBM_setFilter(db_type,code) \
289 { \
290 if (db_type) \
291 RETVAL = sv_mortalcopy(db_type) ; \
292 ST(0) = RETVAL ; \
293 if (db_type && (code == &PL_sv_undef)) { \
294 SvREFCNT_dec(db_type) ; \
295 db_type = NULL ; \
296 } \
297 else if (code) { \
298 if (db_type) \
299 sv_setsv(db_type, code) ; \
300 else \
301 db_type = newSVsv(code) ; \
302 } \
303 }
304
305#define DBM_ckFilter(arg,type,name) \
306 if (db->type) { \
307 if (db->filtering) { \
308 croak("recursion detected in %s", name) ; \
309 } \
310 ENTER ; \
311 SAVETMPS ; \
312 SAVEINT(db->filtering) ; \
313 db->filtering = TRUE ; \
314 SAVESPTR(DEFSV) ; \
5bbd4290
PM
315 if (name[7] == 's') \
316 arg = newSVsv(arg); \
6a31061a
PM
317 DEFSV = arg ; \
318 SvTEMP_off(arg) ; \
319 PUSHMARK(SP) ; \
320 PUTBACK ; \
321 (void) perl_call_sv(db->type, G_DISCARD); \
322 SPAGAIN ; \
323 PUTBACK ; \
324 FREETMPS ; \
325 LEAVE ; \
5bbd4290
PM
326 if (name[7] == 's'){ \
327 arg = sv_2mortal(arg); \
328 } \
329 SvOKp(arg); \
6a31061a
PM
330 }
331
51371543 332#if 1 /* for compatibility */
dc9e4912
GS
333# define VTBL_sv &PL_vtbl_sv
334# define VTBL_env &PL_vtbl_env
335# define VTBL_envelem &PL_vtbl_envelem
336# define VTBL_sig &PL_vtbl_sig
337# define VTBL_sigelem &PL_vtbl_sigelem
338# define VTBL_pack &PL_vtbl_pack
339# define VTBL_packelem &PL_vtbl_packelem
340# define VTBL_dbline &PL_vtbl_dbline
341# define VTBL_isa &PL_vtbl_isa
342# define VTBL_isaelem &PL_vtbl_isaelem
343# define VTBL_arylen &PL_vtbl_arylen
344# define VTBL_glob &PL_vtbl_glob
345# define VTBL_mglob &PL_vtbl_mglob
346# define VTBL_nkeys &PL_vtbl_nkeys
347# define VTBL_taint &PL_vtbl_taint
348# define VTBL_substr &PL_vtbl_substr
349# define VTBL_vec &PL_vtbl_vec
350# define VTBL_pos &PL_vtbl_pos
351# define VTBL_bm &PL_vtbl_bm
352# define VTBL_fm &PL_vtbl_fm
353# define VTBL_uvar &PL_vtbl_uvar
354# define VTBL_defelem &PL_vtbl_defelem
355# define VTBL_regexp &PL_vtbl_regexp
356# define VTBL_regdata &PL_vtbl_regdata
357# define VTBL_regdatum &PL_vtbl_regdatum
358# ifdef USE_LOCALE_COLLATE
359# define VTBL_collxfrm &PL_vtbl_collxfrm
360# endif
9e7bc3e8
JD
361# define VTBL_amagic &PL_vtbl_amagic
362# define VTBL_amagicelem &PL_vtbl_amagicelem
dc9e4912
GS
363#endif
364
6f4183fe 365#include "perlapi.h"
c6af7a1a 366
e8ee3774 367#if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_NO_GET_CONTEXT) && !defined(PERL_CORE)
c5be433b
GS
368# undef aTHX
369# undef aTHX_
54aff467
GS
370# define aTHX PERL_GET_THX
371# define aTHX_ aTHX,
54aff467
GS
372#endif
373
acfe0abc 374#if defined(PERL_IMPLICIT_SYS) && !defined(PERL_CORE)
c6af7a1a 375# ifndef NO_XSLOCKS
2986a63f
JH
376# if defined (NETWARE) && defined (USE_STDIO)
377# define times PerlProc_times
378# define setuid PerlProc_setuid
379# define setgid PerlProc_setgid
380# define getpid PerlProc_getpid
381# define pause PerlProc_pause
382# define exit PerlProc_exit
383# define _exit PerlProc__exit
384# else
c6af7a1a
GS
385# undef closedir
386# undef opendir
387# undef stdin
388# undef stdout
389# undef stderr
390# undef feof
391# undef ferror
392# undef fgetpos
393# undef ioctl
394# undef getlogin
395# undef setjmp
396# undef getc
397# undef ungetc
398# undef fileno
399
cb69f87a 400/* Following symbols were giving redefinition errors while building extensions - sgp 17th Oct 2000 */
2986a63f
JH
401#ifdef NETWARE
402# undef readdir
403# undef fstat
404# undef stat
405# undef longjmp
406# undef endhostent
407# undef endnetent
408# undef endprotoent
409# undef endservent
410# undef gethostbyaddr
411# undef gethostbyname
412# undef gethostent
413# undef getnetbyaddr
414# undef getnetbyname
415# undef getnetent
416# undef getprotobyname
417# undef getprotobynumber
418# undef getprotoent
419# undef getservbyname
420# undef getservbyport
421# undef getservent
422# undef inet_ntoa
423# undef sethostent
424# undef setnetent
425# undef setprotoent
426# undef setservent
427#endif /* NETWARE */
428
1018e26f
NIS
429# undef socketpair
430
c6af7a1a
GS
431# define mkdir PerlDir_mkdir
432# define chdir PerlDir_chdir
433# define rmdir PerlDir_rmdir
434# define closedir PerlDir_close
435# define opendir PerlDir_open
436# define readdir PerlDir_read
437# define rewinddir PerlDir_rewind
438# define seekdir PerlDir_seek
439# define telldir PerlDir_tell
440# define putenv PerlEnv_putenv
441# define getenv PerlEnv_getenv
b2af26b1 442# define uname PerlEnv_uname
197357d0
GS
443# define stdin PerlSIO_stdin
444# define stdout PerlSIO_stdout
445# define stderr PerlSIO_stderr
f9415d23
NIS
446# define fopen PerlSIO_fopen
447# define fclose PerlSIO_fclose
448# define feof PerlSIO_feof
449# define ferror PerlSIO_ferror
b6d726d6 450# define clearerr PerlSIO_clearerr
f9415d23
NIS
451# define getc PerlSIO_getc
452# define fputc PerlSIO_fputc
453# define fputs PerlSIO_fputs
454# define fflush PerlSIO_fflush
455# define ungetc PerlSIO_ungetc
456# define fileno PerlSIO_fileno
457# define fdopen PerlSIO_fdopen
458# define freopen PerlSIO_freopen
459# define fread PerlSIO_fread
460# define fwrite PerlSIO_fwrite
22a46b6e
NIS
461# define setbuf PerlSIO_setbuf
462# define setvbuf PerlSIO_setvbuf
463# define setlinebuf PerlSIO_setlinebuf
1f59ddd9
GS
464# define stdoutf PerlSIO_stdoutf
465# define vfprintf PerlSIO_vprintf
f9415d23
NIS
466# define ftell PerlSIO_ftell
467# define fseek PerlSIO_fseek
468# define fgetpos PerlSIO_fgetpos
469# define fsetpos PerlSIO_fsetpos
470# define frewind PerlSIO_rewind
471# define tmpfile PerlSIO_tmpfile
c6af7a1a
GS
472# define access PerlLIO_access
473# define chmod PerlLIO_chmod
474# define chsize PerlLIO_chsize
475# define close PerlLIO_close
476# define dup PerlLIO_dup
477# define dup2 PerlLIO_dup2
478# define flock PerlLIO_flock
479# define fstat PerlLIO_fstat
480# define ioctl PerlLIO_ioctl
481# define isatty PerlLIO_isatty
6b980173 482# define link PerlLIO_link
c6af7a1a
GS
483# define lseek PerlLIO_lseek
484# define lstat PerlLIO_lstat
485# define mktemp PerlLIO_mktemp
486# define open PerlLIO_open
487# define read PerlLIO_read
488# define rename PerlLIO_rename
489# define setmode PerlLIO_setmode
4f49e16e 490# define stat(buf,sb) PerlLIO_stat(buf,sb)
c6af7a1a
GS
491# define tmpnam PerlLIO_tmpnam
492# define umask PerlLIO_umask
493# define unlink PerlLIO_unlink
494# define utime PerlLIO_utime
495# define write PerlLIO_write
496# define malloc PerlMem_malloc
497# define realloc PerlMem_realloc
498# define free PerlMem_free
499# define abort PerlProc_abort
500# define exit PerlProc_exit
501# define _exit PerlProc__exit
502# define execl PerlProc_execl
503# define execv PerlProc_execv
504# define execvp PerlProc_execvp
505# define getuid PerlProc_getuid
506# define geteuid PerlProc_geteuid
507# define getgid PerlProc_getgid
508# define getegid PerlProc_getegid
509# define getlogin PerlProc_getlogin
510# define kill PerlProc_kill
511# define killpg PerlProc_killpg
512# define pause PerlProc_pause
513# define popen PerlProc_popen
514# define pclose PerlProc_pclose
515# define pipe PerlProc_pipe
516# define setuid PerlProc_setuid
517# define setgid PerlProc_setgid
518# define sleep PerlProc_sleep
519# define times PerlProc_times
520# define wait PerlProc_wait
521# define setjmp PerlProc_setjmp
522# define longjmp PerlProc_longjmp
523# define signal PerlProc_signal
7766f137 524# define getpid PerlProc_getpid
57ab3dfe 525# define gettimeofday PerlProc_gettimeofday
c6af7a1a
GS
526# define htonl PerlSock_htonl
527# define htons PerlSock_htons
528# define ntohl PerlSock_ntohl
529# define ntohs PerlSock_ntohs
530# define accept PerlSock_accept
531# define bind PerlSock_bind
532# define connect PerlSock_connect
533# define endhostent PerlSock_endhostent
534# define endnetent PerlSock_endnetent
535# define endprotoent PerlSock_endprotoent
536# define endservent PerlSock_endservent
537# define gethostbyaddr PerlSock_gethostbyaddr
538# define gethostbyname PerlSock_gethostbyname
539# define gethostent PerlSock_gethostent
540# define gethostname PerlSock_gethostname
541# define getnetbyaddr PerlSock_getnetbyaddr
542# define getnetbyname PerlSock_getnetbyname
543# define getnetent PerlSock_getnetent
544# define getpeername PerlSock_getpeername
545# define getprotobyname PerlSock_getprotobyname
546# define getprotobynumber PerlSock_getprotobynumber
547# define getprotoent PerlSock_getprotoent
548# define getservbyname PerlSock_getservbyname
549# define getservbyport PerlSock_getservbyport
550# define getservent PerlSock_getservent
551# define getsockname PerlSock_getsockname
552# define getsockopt PerlSock_getsockopt
553# define inet_addr PerlSock_inet_addr
554# define inet_ntoa PerlSock_inet_ntoa
555# define listen PerlSock_listen
556# define recv PerlSock_recv
557# define recvfrom PerlSock_recvfrom
558# define select PerlSock_select
559# define send PerlSock_send
560# define sendto PerlSock_sendto
561# define sethostent PerlSock_sethostent
562# define setnetent PerlSock_setnetent
563# define setprotoent PerlSock_setprotoent
564# define setservent PerlSock_setservent
565# define setsockopt PerlSock_setsockopt
566# define shutdown PerlSock_shutdown
567# define socket PerlSock_socket
568# define socketpair PerlSock_socketpair
2986a63f 569# endif /* NETWARE && USE_STDIO */
21c5e947
JH
570
571# ifdef USE_SOCKETS_AS_HANDLES
572# undef fd_set
573# undef FD_SET
574# undef FD_CLR
575# undef FD_ISSET
576# undef FD_ZERO
577# define fd_set Perl_fd_set
578# define FD_SET(n,p) PERL_FD_SET(n,p)
579# define FD_CLR(n,p) PERL_FD_CLR(n,p)
580# define FD_ISSET(n,p) PERL_FD_ISSET(n,p)
581# define FD_ZERO(p) PERL_FD_ZERO(p)
582# endif /* USE_SOCKETS_AS_HANDLES */
583
c6af7a1a 584# endif /* NO_XSLOCKS */
acfe0abc 585#endif /* PERL_IMPLICIT_SYS && !PERL_CORE */
b4ba0ab9 586
cfeeb022 587#endif /* _INC_PERL_XSUB_H */ /* include guard */