This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [patch perlapi doc] sv_magic
[perl5.git] / perlapi.c
CommitLineData
d6376244
JH
1/*
2 * perlapi.c
3 *
4bb101f2 4 * Copyright (C) 1999, 2000, 2001, by Larry Wall and others
d6376244
JH
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 *
d6376244 9 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
f5e3445d
RGS
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.
6296ff16
JH
15 *
16 *
17 * Up to the threshold of the door there mounted a flight of twenty-seven
18 * broad stairs, hewn by some unknown art of the same black stone. This
19 * was the only entrance to the tower.
20 *
d6376244 21 */
51371543
GS
22
23#include "EXTERN.h"
24#include "perl.h"
25#include "perlapi.h"
26
acfe0abc 27#if defined (MULTIPLICITY)
51371543
GS
28
29/* accessor functions for Perl variables (provides binary compatibility) */
30START_EXTERN_C
31
32#undef PERLVAR
33#undef PERLVARA
34#undef PERLVARI
35#undef PERLVARIC
6f4183fe 36
6f4183fe
GS
37#define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \
38 { return &(aTHX->v); }
39#define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \
40 { return &(aTHX->v); }
6f4183fe 41
51371543 42#define PERLVARI(v,t,i) PERLVAR(v,t)
c5be433b 43#define PERLVARIC(v,t,i) PERLVAR(v, const t)
51371543
GS
44
45#include "thrdvar.h"
46#include "intrpvar.h"
c5be433b
GS
47
48#undef PERLVAR
49#undef PERLVARA
acfe0abc 50#define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \
c5be433b 51 { return &(PL_##v); }
acfe0abc 52#define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \
c5be433b 53 { return &(PL_##v); }
34f7a5fe 54#undef PERLVARIC
acfe0abc 55#define PERLVARIC(v,t,i) const t* Perl_##v##_ptr(pTHX) \
34f7a5fe 56 { return (const t *)&(PL_##v); }
51371543
GS
57#include "perlvars.h"
58
59#undef PERLVAR
60#undef PERLVARA
61#undef PERLVARI
62#undef PERLVARIC
63
51371543
GS
64END_EXTERN_C
65
acfe0abc 66#endif /* MULTIPLICITY */