gbarr is maintaining IO.
[p5sagit/p5-mst-13.2.git] / perlvars.h
CommitLineData
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 26PERLVAR(Gcurinterp, PerlInterpreter *)
43165c05 27 /* currently running interpreter
ba869deb 28 * (initial parent interpreter under
29 * useithreads) */
3db8f154 30#if defined(USE_ITHREADS)
ba869deb 31PERLVAR(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) */
36PERLVARISC(GYes, "1")
37PERLVARISC(GNo, "")
38PERLVARISC(Ghexdigit, "0123456789abcdef0123456789ABCDEF")
39PERLVARISC(Gpatleave, "\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}")
43165c05 40
41/* XXX does anyone even use this? */
42PERLVARI(Gdo_undump, bool, FALSE) /* -u or dump seen? */
b363f7ed 43
3db8f154 44#if defined(MYMALLOC) && defined(USE_ITHREADS)
b363f7ed 45PERLVAR(Gmalloc_mutex, perl_mutex) /* Mutex for malloc */
46#endif
534825c4 47
48#if defined(USE_ITHREADS)
49PERLVAR(Gop_mutex, perl_mutex) /* Mutex for op refcounting */
50#endif
60e4ec2e 51
d90a703e 52#ifdef USE_ITHREADS
53PERLVAR(Gdollarzero_mutex, perl_mutex) /* Modifying $0 */
54#endif
5c728af0 55
56/* This is constant on most architectures, a global on OS/2 */
e1ec3a88 57PERLVARI(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. */
62PERLVAR(Gsigfpe_saved, Sighandler_t)
2f42fcb0 63#endif
b35112e7 64
643157af 65/* Restricted hashes placeholder value.
66 * The contents are never used, only the address. */
67PERLVAR(Gsv_placeholder, SV)
68
2f42fcb0 69#ifndef PERL_MICRO
1c127fab 70PERLVARI(Gcsighandlerp, Sighandler_t, Perl_csighandler) /* Pointer to C-level sighandler */
2f42fcb0 71#endif
5c1546dc 72
50acdf95 73#ifndef PERL_USE_SAFE_PUTENV
74PERLVARI(Guse_safe_putenv, int, 1)
75#endif
27da23d5 76
77#ifdef USE_PERLIO
78PERLVARA(Gperlio_fd_refcnt, 2048, int) /* PERLIO_MAX_REFCOUNTABLE_FD */
79PERLVARI(Gperlio_debug_fd, int, 0) /* the fd to write perlio debug into, 0 means not set yet */
80#endif
81
82#ifdef HAS_MMAP
83PERLVARI(Gmmap_page_size, IV, 0)
84#endif
85
86#if defined(FAKE_PERSISTENT_SIGNAL_HANDLERS)||defined(FAKE_DEFAULT_SIGNAL_HANDLERS)
87PERLVARI(Gsig_handlers_initted, int, 0)
88#endif
89#ifdef FAKE_PERSISTENT_SIGNAL_HANDLERS
90PERLVARA(Gsig_ignoring, SIG_SIZE, int) /* which signals we are ignoring */
91#endif
92#ifdef FAKE_DEFAULT_SIGNAL_HANDLERS
aadb217d 93PERLVARA(Gsig_defaulting, SIG_SIZE, int)
27da23d5 94#endif
95
96#ifndef PERL_IMPLICIT_CONTEXT
97PERLVAR(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
103PERLVARI(Gsig_trapped, int, 0)
104#endif
105
106#ifdef DEBUGGING
107PERLVAR(Gwatch_pvx, char*)
108#endif
109
110#ifdef PERL_GLOBAL_STRUCT
111PERLVAR(Gppaddr, Perl_ppaddr_t*) /* or opcode.h */
112PERLVAR(Gcheck, Perl_check_t *) /* or opcode.h */
113PERLVARA(Gfold_locale, 256, unsigned char) /* or perl.h */
114#endif
115
116#ifdef PERL_NEED_APPCTX
117PERLVAR(Gappctx, void*) /* the application context */
118#endif
119
120PERLVAR(Gop_sequence, HV*) /* dump.c */
121PERLVARI(Gop_seq, UV, 0) /* dump.c */
122
123#if defined(HAS_TIMES) && defined(PERL_NEED_TIMESBASE)
124PERLVAR(Gtimesbase, struct tms)
125#endif
126
127