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