Commit | Line | Data |
eb1102fc |
1 | /* perlvars.h |
2 | * |
4bb101f2 |
3 | * Copyright (C) 1999, 2000, 2001, 2002, by Larry Wall and others |
eb1102fc |
4 | * |
5 | * You may distribute under the terms of either the GNU General Public |
6 | * License or the Artistic License, as specified in the README file. |
7 | * |
8 | */ |
9 | |
49f531da |
10 | /****************/ |
11 | /* Truly global */ |
12 | /****************/ |
13 | |
cb68f92d |
14 | /* Don't forget to re-run embed.pl to propagate changes! */ |
15 | |
16 | /* This file describes the "global" variables used by perl |
17 | * This used to be in perl.h directly but we want to abstract out into |
18 | * distinct files which are per-thread, per-interpreter or really global, |
19 | * and how they're initialized. |
20 | * |
21 | * The 'G' prefix is only needed for vars that need appropriate #defines |
22c35a8c |
22 | * generated in embed*.h. Such symbols are also used to generate |
14dd3ad8 |
23 | * the appropriate export list for win32. */ |
cb68f92d |
24 | |
49f531da |
25 | /* global state */ |
cb68f92d |
26 | PERLVAR(Gcurinterp, PerlInterpreter *) |
43165c05 |
27 | /* currently running interpreter |
ba869deb |
28 | * (initial parent interpreter under |
29 | * useithreads) */ |
3db8f154 |
30 | #if defined(USE_ITHREADS) |
ba869deb |
31 | PERLVAR(Gthr_key, perl_key) /* key to retrieve per-thread struct */ |
32 | #endif |
a0ed51b3 |
33 | |
27da23d5 |
34 | /* constants (these are not literals to facilitate pointer comparisons) |
35 | * (PERLVARISC really does create variables, despite its looks) */ |
36 | PERLVARISC(GYes, "1") |
37 | PERLVARISC(GNo, "") |
38 | PERLVARISC(Ghexdigit, "0123456789abcdef0123456789ABCDEF") |
39 | PERLVARISC(Gpatleave, "\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}") |
43165c05 |
40 | |
41 | /* XXX does anyone even use this? */ |
42 | PERLVARI(Gdo_undump, bool, FALSE) /* -u or dump seen? */ |
b363f7ed |
43 | |
3db8f154 |
44 | #if defined(MYMALLOC) && defined(USE_ITHREADS) |
b363f7ed |
45 | PERLVAR(Gmalloc_mutex, perl_mutex) /* Mutex for malloc */ |
46 | #endif |
534825c4 |
47 | |
48 | #if defined(USE_ITHREADS) |
49 | PERLVAR(Gop_mutex, perl_mutex) /* Mutex for op refcounting */ |
50 | #endif |
60e4ec2e |
51 | |
d90a703e |
52 | #ifdef USE_ITHREADS |
53 | PERLVAR(Gdollarzero_mutex, perl_mutex) /* Modifying $0 */ |
54 | #endif |
5c728af0 |
55 | |
56 | /* This is constant on most architectures, a global on OS/2 */ |
e1ec3a88 |
57 | PERLVARI(Gsh_path, const char *, SH_PATH)/* full path of shell */ |
af419de7 |
58 | |
2f42fcb0 |
59 | #ifndef PERL_MICRO |
b35112e7 |
60 | /* If Perl has to ignore SIGPFE, this is its saved state. |
61 | * See perl.h macros PERL_FPU_INIT and PERL_FPU_{PRE,POST}_EXEC. */ |
62 | PERLVAR(Gsigfpe_saved, Sighandler_t) |
2f42fcb0 |
63 | #endif |
b35112e7 |
64 | |
643157af |
65 | /* Restricted hashes placeholder value. |
66 | * The contents are never used, only the address. */ |
67 | PERLVAR(Gsv_placeholder, SV) |
68 | |
2f42fcb0 |
69 | #ifndef PERL_MICRO |
1c127fab |
70 | PERLVARI(Gcsighandlerp, Sighandler_t, Perl_csighandler) /* Pointer to C-level sighandler */ |
2f42fcb0 |
71 | #endif |
5c1546dc |
72 | |
50acdf95 |
73 | #ifndef PERL_USE_SAFE_PUTENV |
74 | PERLVARI(Guse_safe_putenv, int, 1) |
75 | #endif |
27da23d5 |
76 | |
77 | #ifdef USE_PERLIO |
78 | PERLVARA(Gperlio_fd_refcnt, 2048, int) /* PERLIO_MAX_REFCOUNTABLE_FD */ |
79 | PERLVARI(Gperlio_debug_fd, int, 0) /* the fd to write perlio debug into, 0 means not set yet */ |
80 | #endif |
81 | |
82 | #ifdef HAS_MMAP |
83 | PERLVARI(Gmmap_page_size, IV, 0) |
84 | #endif |
85 | |
86 | #if defined(FAKE_PERSISTENT_SIGNAL_HANDLERS)||defined(FAKE_DEFAULT_SIGNAL_HANDLERS) |
87 | PERLVARI(Gsig_handlers_initted, int, 0) |
88 | #endif |
89 | #ifdef FAKE_PERSISTENT_SIGNAL_HANDLERS |
90 | PERLVARA(Gsig_ignoring, SIG_SIZE, int) /* which signals we are ignoring */ |
91 | #endif |
92 | #ifdef FAKE_DEFAULT_SIGNAL_HANDLERS |
aadb217d |
93 | PERLVARA(Gsig_defaulting, SIG_SIZE, int) |
27da23d5 |
94 | #endif |
95 | |
96 | #ifndef PERL_IMPLICIT_CONTEXT |
97 | PERLVAR(Gsig_sv, SV*) |
98 | #endif |
99 | |
100 | /* XXX signals are process-wide anyway, so we |
101 | * ignore the implications of this for threading */ |
102 | #ifndef HAS_SIGACTION |
103 | PERLVARI(Gsig_trapped, int, 0) |
104 | #endif |
105 | |
106 | #ifdef DEBUGGING |
107 | PERLVAR(Gwatch_pvx, char*) |
108 | #endif |
109 | |
110 | #ifdef PERL_GLOBAL_STRUCT |
111 | PERLVAR(Gppaddr, Perl_ppaddr_t*) /* or opcode.h */ |
112 | PERLVAR(Gcheck, Perl_check_t *) /* or opcode.h */ |
113 | PERLVARA(Gfold_locale, 256, unsigned char) /* or perl.h */ |
114 | #endif |
115 | |
116 | #ifdef PERL_NEED_APPCTX |
117 | PERLVAR(Gappctx, void*) /* the application context */ |
118 | #endif |
119 | |
120 | PERLVAR(Gop_sequence, HV*) /* dump.c */ |
121 | PERLVARI(Gop_seq, UV, 0) /* dump.c */ |
122 | |
123 | #if defined(HAS_TIMES) && defined(PERL_NEED_TIMESBASE) |
124 | PERLVAR(Gtimesbase, struct tms) |
125 | #endif |
126 | |
127 | |