This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix [perl #21742] :
[perl5.git] / perlapi.c
1 /*
2  *    perlapi.c
3  *
4  *    Copyright (C) 1999, 2000, 2001, by Larry Wall and others
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  * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
10  * This file is built by embed.pl from data in embed.fnc, embed.pl,
11  * pp.sym, intrpvar.h, perlvars.h and thrdvar.h.
12  * Any changes made here will be lost!
13  *
14  * Edit those files and run 'make regen_headers' to effect changes.
15  */
16
17 #include "EXTERN.h"
18 #include "perl.h"
19 #include "perlapi.h"
20
21 #if defined (MULTIPLICITY)
22
23 /* accessor functions for Perl variables (provides binary compatibility) */
24 START_EXTERN_C
25
26 #undef PERLVAR
27 #undef PERLVARA
28 #undef PERLVARI
29 #undef PERLVARIC
30
31 #define PERLVAR(v,t)    t* Perl_##v##_ptr(pTHX)                         \
32                         { return &(aTHX->v); }
33 #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX)                \
34                         { return &(aTHX->v); }
35
36 #define PERLVARI(v,t,i) PERLVAR(v,t)
37 #define PERLVARIC(v,t,i) PERLVAR(v, const t)
38
39 #include "thrdvar.h"
40 #include "intrpvar.h"
41
42 #undef PERLVAR
43 #undef PERLVARA
44 #define PERLVAR(v,t)    t* Perl_##v##_ptr(pTHX)                         \
45                         { return &(PL_##v); }
46 #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX)                \
47                         { return &(PL_##v); }
48 #undef PERLVARIC
49 #define PERLVARIC(v,t,i)        const t* Perl_##v##_ptr(pTHX)           \
50                         { return (const t *)&(PL_##v); }
51 #include "perlvars.h"
52
53 #undef PERLVAR
54 #undef PERLVARA
55 #undef PERLVARI
56 #undef PERLVARIC
57
58 END_EXTERN_C
59
60 #endif /* MULTIPLICITY */