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