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