-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperlapi.c
71 lines (60 loc) · 1.89 KB
/
perlapi.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include "EXTERN.h"
#include "perl.h"
#include "perlapi.h"
#if defined (MULTIPLICITY)
START_EXTERN_C
#undef PERLVAR
#undef PERLVARA
#undef PERLVARI
#undef PERLVARIC
#undef PERLVARISC
#define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \
{ dVAR; PERL_UNUSED_CONTEXT; return &(aTHX->v); }
#define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \
{ dVAR; PERL_UNUSED_CONTEXT; return &(aTHX->v); }
#define PERLVARI(v,t,i) PERLVAR(v,t)
#define PERLVARIC(v,t,i) PERLVAR(v, const t)
#define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \
{ dVAR; PERL_UNUSED_CONTEXT; return &(aTHX->v); }
#include "intrpvar.h"
#undef PERLVAR
#undef PERLVARA
#define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \
{ dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); }
#define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \
{ dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); }
#undef PERLVARIC
#undef PERLVARISC
#define PERLVARIC(v,t,i) \
const t* Perl_##v##_ptr(pTHX) \
{ PERL_UNUSED_CONTEXT; return (const t *)&(PL_##v); }
#define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \
{ dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); }
#include "perlvars.h"
#undef PERLVAR
#undef PERLVARA
#undef PERLVARI
#undef PERLVARIC
#undef PERLVARISC
#ifndef PERL_GLOBAL_STRUCT
#undef PL_ppaddr
#undef PL_check
#undef PL_fold_locale
Perl_ppaddr_t** Perl_Gppaddr_ptr(pTHX) {
static Perl_ppaddr_t* const ppaddr_ptr = PL_ppaddr;
PERL_UNUSED_CONTEXT;
return (Perl_ppaddr_t**)&ppaddr_ptr;
}
Perl_check_t** Perl_Gcheck_ptr(pTHX) {
static Perl_check_t* const check_ptr = PL_check;
PERL_UNUSED_CONTEXT;
return (Perl_check_t**)&check_ptr;
}
unsigned char** Perl_Gfold_locale_ptr(pTHX) {
static unsigned char* const fold_locale_ptr = PL_fold_locale;
PERL_UNUSED_CONTEXT;
return (unsigned char**)&fold_locale_ptr;
}
#endif
END_EXTERN_C
#endif