Commit | Line | Data |
d6376244 |
1 | /* |
2 | * perlapi.c |
3 | * |
2419183b |
4 | * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
5 | * 2000, 2001, 2002, 2003, 2004, 2005, by Larry Wall and others |
d6376244 |
6 | * |
7 | * You may distribute under the terms of either the GNU General Public |
8 | * License or the Artistic License, as specified in the README file. |
9 | * |
d6376244 |
10 | * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! |
f5e3445d |
11 | * This file is built by embed.pl from data in embed.fnc, embed.pl, |
12 | * pp.sym, intrpvar.h, perlvars.h and thrdvar.h. |
13 | * Any changes made here will be lost! |
14 | * |
15 | * Edit those files and run 'make regen_headers' to effect changes. |
6296ff16 |
16 | * |
17 | * |
18 | * Up to the threshold of the door there mounted a flight of twenty-seven |
19 | * broad stairs, hewn by some unknown art of the same black stone. This |
20 | * was the only entrance to the tower. |
21 | * |
d6376244 |
22 | */ |
51371543 |
23 | |
24 | #include "EXTERN.h" |
25 | #include "perl.h" |
26 | #include "perlapi.h" |
27 | |
acfe0abc |
28 | #if defined (MULTIPLICITY) |
51371543 |
29 | |
30 | /* accessor functions for Perl variables (provides binary compatibility) */ |
31 | START_EXTERN_C |
32 | |
33 | #undef PERLVAR |
34 | #undef PERLVARA |
35 | #undef PERLVARI |
36 | #undef PERLVARIC |
27da23d5 |
37 | #undef PERLVARISC |
6f4183fe |
38 | |
6f4183fe |
39 | #define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \ |
27da23d5 |
40 | { dVAR; return &(aTHX->v); } |
6f4183fe |
41 | #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \ |
27da23d5 |
42 | { dVAR; return &(aTHX->v); } |
6f4183fe |
43 | |
51371543 |
44 | #define PERLVARI(v,t,i) PERLVAR(v,t) |
c5be433b |
45 | #define PERLVARIC(v,t,i) PERLVAR(v, const t) |
27da23d5 |
46 | #define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \ |
47 | { dVAR; return &(aTHX->v); } |
51371543 |
48 | |
49 | #include "thrdvar.h" |
50 | #include "intrpvar.h" |
c5be433b |
51 | |
52 | #undef PERLVAR |
53 | #undef PERLVARA |
acfe0abc |
54 | #define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \ |
27da23d5 |
55 | { dVAR; return &(PL_##v); } |
acfe0abc |
56 | #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \ |
27da23d5 |
57 | { dVAR; return &(PL_##v); } |
34f7a5fe |
58 | #undef PERLVARIC |
27da23d5 |
59 | #undef PERLVARISC |
60 | #define PERLVARIC(v,t,i) \ |
61 | const t* Perl_##v##_ptr(pTHX) \ |
34f7a5fe |
62 | { return (const t *)&(PL_##v); } |
27da23d5 |
63 | #define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \ |
64 | { dVAR; return &(PL_##v); } |
51371543 |
65 | #include "perlvars.h" |
66 | |
67 | #undef PERLVAR |
68 | #undef PERLVARA |
69 | #undef PERLVARI |
70 | #undef PERLVARIC |
27da23d5 |
71 | #undef PERLVARISC |
72 | |
73 | #ifndef PERL_GLOBAL_STRUCT |
74 | /* A few evil special cases. Could probably macrofy this. */ |
75 | #undef PL_ppaddr |
76 | #undef PL_check |
77 | #undef PL_fold_locale |
78 | Perl_ppaddr_t** Perl_Gppaddr_ptr(pTHX) { |
79 | static const Perl_ppaddr_t* ppaddr_ptr = PL_ppaddr; |
80 | return (Perl_ppaddr_t**)&ppaddr_ptr; |
81 | } |
82 | Perl_check_t** Perl_Gcheck_ptr(pTHX) { |
83 | static const Perl_check_t* check_ptr = PL_check; |
84 | return (Perl_check_t**)&check_ptr; |
85 | } |
86 | unsigned char** Perl_Gfold_locale_ptr(pTHX) { |
87 | static const unsigned char* fold_locale_ptr = PL_fold_locale; |
88 | return (unsigned char**)&fold_locale_ptr; |
89 | } |
90 | #endif |
51371543 |
91 | |
51371543 |
92 | END_EXTERN_C |
93 | |
acfe0abc |
94 | #endif /* MULTIPLICITY */ |