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