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