This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Resolve [perl #37110]: Update README.win32
[perl5.git] / perlvars.h
1 /*    perlvars.h
2  *
3  *    Copyright (C) 1999, 2000, 2001, 2002, by Larry Wall and others
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
10 /****************/
11 /* Truly global */
12 /****************/
13
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
22  * generated in embed*.h.  Such symbols are also used to generate
23  * the appropriate export list for win32. */
24
25 /* global state */
26 PERLVAR(Gcurinterp,     PerlInterpreter *)
27                                         /* currently running interpreter
28                                          * (initial parent interpreter under
29                                          * useithreads) */
30 #if defined(USE_ITHREADS)
31 PERLVAR(Gthr_key,       perl_key)       /* key to retrieve per-thread struct */
32 #endif
33
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[{]}")
40
41 /* XXX does anyone even use this? */
42 PERLVARI(Gdo_undump,    bool,   FALSE)  /* -u or dump seen? */
43
44 #if defined(MYMALLOC) && defined(USE_ITHREADS)
45 PERLVAR(Gmalloc_mutex,  perl_mutex)     /* Mutex for malloc */
46 #endif
47
48 #if defined(USE_ITHREADS)
49 PERLVAR(Gop_mutex,      perl_mutex)     /* Mutex for op refcounting */
50 #endif
51
52 #ifdef USE_ITHREADS
53 PERLVAR(Gdollarzero_mutex, perl_mutex)  /* Modifying $0 */
54 #endif
55
56 /* This is constant on most architectures, a global on OS/2 */
57 PERLVARI(Gsh_path,      const char *,   SH_PATH)/* full path of shell */
58
59 #ifndef PERL_MICRO
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)
63 #endif
64
65 /* Restricted hashes placeholder value.
66  * The contents are never used, only the address. */
67 PERLVAR(Gsv_placeholder, SV)
68
69 #ifndef PERL_MICRO
70 PERLVARI(Gcsighandlerp, Sighandler_t, Perl_csighandler) /* Pointer to C-level sighandler */
71 #endif
72
73 #ifndef PERL_USE_SAFE_PUTENV
74 PERLVARI(Guse_safe_putenv, int, 1)
75 #endif
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
93 PERLVARA(Gsig_defaulting, SIG_SIZE, int)
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