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