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