This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document embed.fnc 'U' and 's' flags.
[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
e1f795dc 117#define dUNDERBAR I32 padoff_du = Perl_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
954c1994
GS
182=for apidoc AmU||newXSproto
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
195=cut
196*/
197
4633a7c4 198#define XST_mIV(i,v) (ST(i) = sv_2mortal(newSViv(v)) )
108ccc45 199#define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) )
4633a7c4
LW
200#define XST_mNV(i,v) (ST(i) = sv_2mortal(newSVnv(v)) )
201#define XST_mPV(i,v) (ST(i) = sv_2mortal(newSVpv(v,0)))
79cb57f6 202#define XST_mPVN(i,v,n) (ST(i) = sv_2mortal(newSVpvn(v,n)))
3280af22
NIS
203#define XST_mNO(i) (ST(i) = &PL_sv_no )
204#define XST_mYES(i) (ST(i) = &PL_sv_yes )
205#define XST_mUNDEF(i) (ST(i) = &PL_sv_undef)
954c1994
GS
206
207#define XSRETURN(off) \
208 STMT_START { \
a02b2239
RGS
209 IV tmpXSoff = (off); \
210 PL_stack_sp = PL_stack_base + ax + (tmpXSoff - 1); \
954c1994
GS
211 return; \
212 } STMT_END
213
80b92232 214#define XSRETURN_IV(v) STMT_START { XST_mIV(0,v); XSRETURN(1); } STMT_END
108ccc45 215#define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END
80b92232
PP
216#define XSRETURN_NV(v) STMT_START { XST_mNV(0,v); XSRETURN(1); } STMT_END
217#define XSRETURN_PV(v) STMT_START { XST_mPV(0,v); XSRETURN(1); } STMT_END
954c1994 218#define XSRETURN_PVN(v,n) STMT_START { XST_mPVN(0,v,n); XSRETURN(1); } STMT_END
80b92232
PP
219#define XSRETURN_NO STMT_START { XST_mNO(0); XSRETURN(1); } STMT_END
220#define XSRETURN_YES STMT_START { XST_mYES(0); XSRETURN(1); } STMT_END
221#define XSRETURN_UNDEF STMT_START { XST_mUNDEF(0); XSRETURN(1); } STMT_END
222#define XSRETURN_EMPTY STMT_START { XSRETURN(0); } STMT_END
382b8d97 223
37120919 224#define newXSproto(a,b,c,d) sv_setpv((SV*)newXS(a,b,c), d)
720fb644
PP
225
226#ifdef XS_VERSION
c6af7a1a 227# define XS_VERSION_BOOTCHECK \
774d564b 228 STMT_START { \
3de3296f 229 SV *_sv; STRLEN n_a; \
2d8e6c8d 230 char *vn = Nullch, *module = SvPV(ST(0),n_a); \
774d564b 231 if (items >= 2) /* version supplied as bootstrap arg */ \
3de3296f 232 _sv = ST(1); \
774d564b 233 else { \
46fc3d4c 234 /* XXX GV_ADDWARN */ \
3de3296f 235 _sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
864dbfa3 236 vn = "XS_VERSION"), FALSE); \
3de3296f
AE
237 if (!_sv || !SvOK(_sv)) \
238 _sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
864dbfa3 239 vn = "VERSION"), FALSE); \
774d564b 240 } \
3de3296f 241 if (_sv && (!SvOK(_sv) || strNE(XS_VERSION, SvPV(_sv, n_a)))) \
894356b3 242 Perl_croak(aTHX_ "%s object version %s does not match %s%s%s%s %"SVf,\
ae66e5c8
CS
243 module, XS_VERSION, \
244 vn ? "$" : "", vn ? module : "", vn ? "::" : "", \
3de3296f 245 vn ? vn : "bootstrap parameter", _sv); \
80b92232 246 } STMT_END
720fb644 247#else
c6af7a1a 248# define XS_VERSION_BOOTCHECK
720fb644 249#endif
76e3520e 250
6a31061a
PM
251/*
252 The DBM_setFilter & DBM_ckFilter macros are only used by
253 the *DB*_File modules
254*/
255
256#define DBM_setFilter(db_type,code) \
257 { \
258 if (db_type) \
259 RETVAL = sv_mortalcopy(db_type) ; \
260 ST(0) = RETVAL ; \
261 if (db_type && (code == &PL_sv_undef)) { \
262 SvREFCNT_dec(db_type) ; \
263 db_type = NULL ; \
264 } \
265 else if (code) { \
266 if (db_type) \
267 sv_setsv(db_type, code) ; \
268 else \
269 db_type = newSVsv(code) ; \
270 } \
271 }
272
273#define DBM_ckFilter(arg,type,name) \
274 if (db->type) { \
275 if (db->filtering) { \
276 croak("recursion detected in %s", name) ; \
277 } \
278 ENTER ; \
279 SAVETMPS ; \
280 SAVEINT(db->filtering) ; \
281 db->filtering = TRUE ; \
282 SAVESPTR(DEFSV) ; \
5bbd4290
PM
283 if (name[7] == 's') \
284 arg = newSVsv(arg); \
6a31061a
PM
285 DEFSV = arg ; \
286 SvTEMP_off(arg) ; \
287 PUSHMARK(SP) ; \
288 PUTBACK ; \
289 (void) perl_call_sv(db->type, G_DISCARD); \
290 SPAGAIN ; \
291 PUTBACK ; \
292 FREETMPS ; \
293 LEAVE ; \
5bbd4290
PM
294 if (name[7] == 's'){ \
295 arg = sv_2mortal(arg); \
296 } \
297 SvOKp(arg); \
6a31061a
PM
298 }
299
51371543 300#if 1 /* for compatibility */
dc9e4912
GS
301# define VTBL_sv &PL_vtbl_sv
302# define VTBL_env &PL_vtbl_env
303# define VTBL_envelem &PL_vtbl_envelem
304# define VTBL_sig &PL_vtbl_sig
305# define VTBL_sigelem &PL_vtbl_sigelem
306# define VTBL_pack &PL_vtbl_pack
307# define VTBL_packelem &PL_vtbl_packelem
308# define VTBL_dbline &PL_vtbl_dbline
309# define VTBL_isa &PL_vtbl_isa
310# define VTBL_isaelem &PL_vtbl_isaelem
311# define VTBL_arylen &PL_vtbl_arylen
312# define VTBL_glob &PL_vtbl_glob
313# define VTBL_mglob &PL_vtbl_mglob
314# define VTBL_nkeys &PL_vtbl_nkeys
315# define VTBL_taint &PL_vtbl_taint
316# define VTBL_substr &PL_vtbl_substr
317# define VTBL_vec &PL_vtbl_vec
318# define VTBL_pos &PL_vtbl_pos
319# define VTBL_bm &PL_vtbl_bm
320# define VTBL_fm &PL_vtbl_fm
321# define VTBL_uvar &PL_vtbl_uvar
322# define VTBL_defelem &PL_vtbl_defelem
323# define VTBL_regexp &PL_vtbl_regexp
324# define VTBL_regdata &PL_vtbl_regdata
325# define VTBL_regdatum &PL_vtbl_regdatum
326# ifdef USE_LOCALE_COLLATE
327# define VTBL_collxfrm &PL_vtbl_collxfrm
328# endif
9e7bc3e8
JD
329# define VTBL_amagic &PL_vtbl_amagic
330# define VTBL_amagicelem &PL_vtbl_amagicelem
dc9e4912
GS
331#endif
332
6f4183fe 333#include "perlapi.h"
c6af7a1a 334
e8ee3774 335#if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_NO_GET_CONTEXT) && !defined(PERL_CORE)
c5be433b
GS
336# undef aTHX
337# undef aTHX_
54aff467
GS
338# define aTHX PERL_GET_THX
339# define aTHX_ aTHX,
54aff467
GS
340#endif
341
acfe0abc 342#if defined(PERL_IMPLICIT_SYS) && !defined(PERL_CORE)
c6af7a1a 343# ifndef NO_XSLOCKS
2986a63f
JH
344# if defined (NETWARE) && defined (USE_STDIO)
345# define times PerlProc_times
346# define setuid PerlProc_setuid
347# define setgid PerlProc_setgid
348# define getpid PerlProc_getpid
349# define pause PerlProc_pause
350# define exit PerlProc_exit
351# define _exit PerlProc__exit
352# else
c6af7a1a
GS
353# undef closedir
354# undef opendir
355# undef stdin
356# undef stdout
357# undef stderr
358# undef feof
359# undef ferror
360# undef fgetpos
361# undef ioctl
362# undef getlogin
363# undef setjmp
364# undef getc
365# undef ungetc
366# undef fileno
367
cb69f87a 368/* Following symbols were giving redefinition errors while building extensions - sgp 17th Oct 2000 */
2986a63f
JH
369#ifdef NETWARE
370# undef readdir
371# undef fstat
372# undef stat
373# undef longjmp
374# undef endhostent
375# undef endnetent
376# undef endprotoent
377# undef endservent
378# undef gethostbyaddr
379# undef gethostbyname
380# undef gethostent
381# undef getnetbyaddr
382# undef getnetbyname
383# undef getnetent
384# undef getprotobyname
385# undef getprotobynumber
386# undef getprotoent
387# undef getservbyname
388# undef getservbyport
389# undef getservent
390# undef inet_ntoa
391# undef sethostent
392# undef setnetent
393# undef setprotoent
394# undef setservent
395#endif /* NETWARE */
396
1018e26f
NIS
397# undef socketpair
398
c6af7a1a
GS
399# define mkdir PerlDir_mkdir
400# define chdir PerlDir_chdir
401# define rmdir PerlDir_rmdir
402# define closedir PerlDir_close
403# define opendir PerlDir_open
404# define readdir PerlDir_read
405# define rewinddir PerlDir_rewind
406# define seekdir PerlDir_seek
407# define telldir PerlDir_tell
408# define putenv PerlEnv_putenv
409# define getenv PerlEnv_getenv
b2af26b1 410# define uname PerlEnv_uname
197357d0
GS
411# define stdin PerlSIO_stdin
412# define stdout PerlSIO_stdout
413# define stderr PerlSIO_stderr
f9415d23
NIS
414# define fopen PerlSIO_fopen
415# define fclose PerlSIO_fclose
416# define feof PerlSIO_feof
417# define ferror PerlSIO_ferror
b6d726d6 418# define clearerr PerlSIO_clearerr
f9415d23
NIS
419# define getc PerlSIO_getc
420# define fputc PerlSIO_fputc
421# define fputs PerlSIO_fputs
422# define fflush PerlSIO_fflush
423# define ungetc PerlSIO_ungetc
424# define fileno PerlSIO_fileno
425# define fdopen PerlSIO_fdopen
426# define freopen PerlSIO_freopen
427# define fread PerlSIO_fread
428# define fwrite PerlSIO_fwrite
22a46b6e
NIS
429# define setbuf PerlSIO_setbuf
430# define setvbuf PerlSIO_setvbuf
431# define setlinebuf PerlSIO_setlinebuf
1f59ddd9
GS
432# define stdoutf PerlSIO_stdoutf
433# define vfprintf PerlSIO_vprintf
f9415d23
NIS
434# define ftell PerlSIO_ftell
435# define fseek PerlSIO_fseek
436# define fgetpos PerlSIO_fgetpos
437# define fsetpos PerlSIO_fsetpos
438# define frewind PerlSIO_rewind
439# define tmpfile PerlSIO_tmpfile
c6af7a1a
GS
440# define access PerlLIO_access
441# define chmod PerlLIO_chmod
442# define chsize PerlLIO_chsize
443# define close PerlLIO_close
444# define dup PerlLIO_dup
445# define dup2 PerlLIO_dup2
446# define flock PerlLIO_flock
447# define fstat PerlLIO_fstat
448# define ioctl PerlLIO_ioctl
449# define isatty PerlLIO_isatty
6b980173 450# define link PerlLIO_link
c6af7a1a
GS
451# define lseek PerlLIO_lseek
452# define lstat PerlLIO_lstat
453# define mktemp PerlLIO_mktemp
454# define open PerlLIO_open
455# define read PerlLIO_read
456# define rename PerlLIO_rename
457# define setmode PerlLIO_setmode
4f49e16e 458# define stat(buf,sb) PerlLIO_stat(buf,sb)
c6af7a1a
GS
459# define tmpnam PerlLIO_tmpnam
460# define umask PerlLIO_umask
461# define unlink PerlLIO_unlink
462# define utime PerlLIO_utime
463# define write PerlLIO_write
464# define malloc PerlMem_malloc
465# define realloc PerlMem_realloc
466# define free PerlMem_free
467# define abort PerlProc_abort
468# define exit PerlProc_exit
469# define _exit PerlProc__exit
470# define execl PerlProc_execl
471# define execv PerlProc_execv
472# define execvp PerlProc_execvp
473# define getuid PerlProc_getuid
474# define geteuid PerlProc_geteuid
475# define getgid PerlProc_getgid
476# define getegid PerlProc_getegid
477# define getlogin PerlProc_getlogin
478# define kill PerlProc_kill
479# define killpg PerlProc_killpg
480# define pause PerlProc_pause
481# define popen PerlProc_popen
482# define pclose PerlProc_pclose
483# define pipe PerlProc_pipe
484# define setuid PerlProc_setuid
485# define setgid PerlProc_setgid
486# define sleep PerlProc_sleep
487# define times PerlProc_times
488# define wait PerlProc_wait
489# define setjmp PerlProc_setjmp
490# define longjmp PerlProc_longjmp
491# define signal PerlProc_signal
7766f137 492# define getpid PerlProc_getpid
57ab3dfe 493# define gettimeofday PerlProc_gettimeofday
c6af7a1a
GS
494# define htonl PerlSock_htonl
495# define htons PerlSock_htons
496# define ntohl PerlSock_ntohl
497# define ntohs PerlSock_ntohs
498# define accept PerlSock_accept
499# define bind PerlSock_bind
500# define connect PerlSock_connect
501# define endhostent PerlSock_endhostent
502# define endnetent PerlSock_endnetent
503# define endprotoent PerlSock_endprotoent
504# define endservent PerlSock_endservent
505# define gethostbyaddr PerlSock_gethostbyaddr
506# define gethostbyname PerlSock_gethostbyname
507# define gethostent PerlSock_gethostent
508# define gethostname PerlSock_gethostname
509# define getnetbyaddr PerlSock_getnetbyaddr
510# define getnetbyname PerlSock_getnetbyname
511# define getnetent PerlSock_getnetent
512# define getpeername PerlSock_getpeername
513# define getprotobyname PerlSock_getprotobyname
514# define getprotobynumber PerlSock_getprotobynumber
515# define getprotoent PerlSock_getprotoent
516# define getservbyname PerlSock_getservbyname
517# define getservbyport PerlSock_getservbyport
518# define getservent PerlSock_getservent
519# define getsockname PerlSock_getsockname
520# define getsockopt PerlSock_getsockopt
521# define inet_addr PerlSock_inet_addr
522# define inet_ntoa PerlSock_inet_ntoa
523# define listen PerlSock_listen
524# define recv PerlSock_recv
525# define recvfrom PerlSock_recvfrom
526# define select PerlSock_select
527# define send PerlSock_send
528# define sendto PerlSock_sendto
529# define sethostent PerlSock_sethostent
530# define setnetent PerlSock_setnetent
531# define setprotoent PerlSock_setprotoent
532# define setservent PerlSock_setservent
533# define setsockopt PerlSock_setsockopt
534# define shutdown PerlSock_shutdown
535# define socket PerlSock_socket
536# define socketpair PerlSock_socketpair
2986a63f 537# endif /* NETWARE && USE_STDIO */
21c5e947
JH
538
539# ifdef USE_SOCKETS_AS_HANDLES
540# undef fd_set
541# undef FD_SET
542# undef FD_CLR
543# undef FD_ISSET
544# undef FD_ZERO
545# define fd_set Perl_fd_set
546# define FD_SET(n,p) PERL_FD_SET(n,p)
547# define FD_CLR(n,p) PERL_FD_CLR(n,p)
548# define FD_ISSET(n,p) PERL_FD_ISSET(n,p)
549# define FD_ZERO(p) PERL_FD_ZERO(p)
550# endif /* USE_SOCKETS_AS_HANDLES */
551
c6af7a1a 552# endif /* NO_XSLOCKS */
acfe0abc 553#endif /* PERL_IMPLICIT_SYS && !PERL_CORE */
b4ba0ab9 554
cfeeb022 555#endif /* _INC_PERL_XSUB_H */ /* include guard */