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