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