3 * Copyright (C) 1999, 2000, 2001, 2002, by Larry Wall and others
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.
14 /* Don't forget to re-run embed.pl to propagate changes! */
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.
21 * The 'G' prefix is only needed for vars that need appropriate #defines
22 * generated in embed*.h. Such symbols are also used to generate
23 * the appropriate export list for win32. */
26 PERLVAR(Gcurinterp, PerlInterpreter *)
27 /* currently running interpreter
28 * (initial parent interpreter under
30 #if defined(USE_ITHREADS)
31 PERLVAR(Gthr_key, perl_key) /* key to retrieve per-thread struct */
34 /* constants (these are not literals to facilitate pointer comparisons)
35 * (PERLVARISC really does create variables, despite its looks) */
38 PERLVARISC(Ghexdigit, "0123456789abcdef0123456789ABCDEF")
39 PERLVARISC(Gpatleave, "\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}")
41 /* XXX does anyone even use this? */
42 PERLVARI(Gdo_undump, bool, FALSE) /* -u or dump seen? */
44 #if defined(MYMALLOC) && defined(USE_ITHREADS)
45 PERLVAR(Gmalloc_mutex, perl_mutex) /* Mutex for malloc */
48 #if defined(USE_ITHREADS)
49 PERLVAR(Gop_mutex, perl_mutex) /* Mutex for op refcounting */
53 PERLVAR(Gdollarzero_mutex, perl_mutex) /* Modifying $0 */
56 /* This is constant on most architectures, a global on OS/2 */
57 PERLVARI(Gsh_path, const char *, SH_PATH)/* full path of shell */
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)
65 /* Restricted hashes placeholder value.
66 * The contents are never used, only the address. */
67 PERLVAR(Gsv_placeholder, SV)
70 PERLVARI(Gcsighandlerp, Sighandler_t, Perl_csighandler) /* Pointer to C-level sighandler */
73 #ifndef PERL_USE_SAFE_PUTENV
74 PERLVARI(Guse_safe_putenv, int, 1)
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 */
83 PERLVARI(Gmmap_page_size, IV, 0)
86 #if defined(FAKE_PERSISTENT_SIGNAL_HANDLERS)||defined(FAKE_DEFAULT_SIGNAL_HANDLERS)
87 PERLVARI(Gsig_handlers_initted, int, 0)
89 #ifdef FAKE_PERSISTENT_SIGNAL_HANDLERS
90 PERLVARA(Gsig_ignoring, SIG_SIZE, int) /* which signals we are ignoring */
92 #ifdef FAKE_DEFAULT_SIGNAL_HANDLERS
93 PERLVARA(Gsig_defaulting, SIG_SIZE, int)
96 #ifndef PERL_IMPLICIT_CONTEXT
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)
107 PERLVAR(Gwatch_pvx, char*)
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 */
116 #ifdef PERL_NEED_APPCTX
117 PERLVAR(Gappctx, void*) /* the application context */
120 PERLVAR(Gop_sequence, HV*) /* dump.c */
121 PERLVARI(Gop_seq, UV, 0) /* dump.c */
123 #if defined(HAS_TIMES) && defined(PERL_NEED_TIMESBASE)
124 PERLVAR(Gtimesbase, struct tms)