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