This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Add new macro for readability
[perl5.git] / perlapi.c
1 /* -*- buffer-read-only: t -*-
2  *
3  *    perlapi.c
4  *
5  *    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
6  *    2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by Larry Wall and others
7  *
8  *    You may distribute under the terms of either the GNU General Public
9  *    License or the Artistic License, as specified in the README file.
10  *
11  * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
12  * This file is built by regen/embed.pl from data in embed.fnc,
13  * regen/embed.pl, regen/opcodes, intrpvar.h and perlvars.h.
14  * Any changes made here will be lost!
15  *
16  * Edit those files and run 'make regen_headers' to effect changes.
17  *
18  *
19  * Up to the threshold of the door there mounted a flight of twenty-seven
20  * broad stairs, hewn by some unknown art of the same black stone.  This
21  * was the only entrance to the tower; ...
22  *
23  *     [p.577 of _The Lord of the Rings_, III/x: "The Voice of Saruman"]
24  *
25  */
26
27 #include "EXTERN.h"
28 #include "perl.h"
29 #include "perlapi.h"
30
31 #if defined (MULTIPLICITY) && defined (PERL_GLOBAL_STRUCT)
32
33 /* accessor functions for Perl "global" variables */
34 START_EXTERN_C
35
36 #undef PERLVARI
37 #define PERLVARI(v,t,i) PERLVAR(v,t)
38
39 #undef PERLVAR
40 #undef PERLVARA
41 #define PERLVAR(v,t)    t* Perl_##v##_ptr(pTHX)                         \
42                         { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); }
43 #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX)                \
44                         { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); }
45 #undef PERLVARIC
46 #undef PERLVARISC
47 #define PERLVARIC(v,t,i)        \
48                         const t* Perl_##v##_ptr(pTHX)           \
49                         { PERL_UNUSED_CONTEXT; return (const t *)&(PL_##v); }
50 #define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX)        \
51                         { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); }
52 #include "perlvars.h"
53
54 #undef PERLVAR
55 #undef PERLVARA
56 #undef PERLVARI
57 #undef PERLVARIC
58 #undef PERLVARISC
59
60 END_EXTERN_C
61
62 #endif /* MULTIPLICITY && PERL_GLOBAL_STRUCT */
63
64 /* ex: set ro: */