This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
[perl5.git] / perlvars.h
1 /*    perlvars.h
2  *
3  *    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
4  *    by Larry Wall and others
5  *
6  *    You may distribute under the terms of either the GNU General Public
7  *    License or the Artistic License, as specified in the README file.
8  *
9  */
10
11 /****************/
12 /* Truly global */
13 /****************/
14
15 /* Don't forget to re-run embed.pl to propagate changes! */
16
17 /* This file describes the "global" variables used by perl
18  * This used to be in perl.h directly but we want to abstract out into
19  * distinct files which are per-thread, per-interpreter or really global,
20  * and how they're initialized.
21  *
22  * The 'G' prefix is only needed for vars that need appropriate #defines
23  * generated in embed*.h.  Such symbols are also used to generate
24  * the appropriate export list for win32. */
25
26 /* global state */
27 PERLVAR(Gcurinterp,     PerlInterpreter *)
28                                         /* currently running interpreter
29                                          * (initial parent interpreter under
30                                          * useithreads) */
31 #if defined(USE_5005THREADS) || defined(USE_ITHREADS)
32 PERLVAR(Gthr_key,       perl_key)       /* key to retrieve per-thread struct */
33 #endif
34
35 /* constants (these are not literals to facilitate pointer comparisons) */
36 PERLVARIC(GYes,         char *, "1")
37 PERLVARIC(GNo,          char *, "")
38 PERLVARIC(Ghexdigit,    char *, "0123456789abcdef0123456789ABCDEF")
39 PERLVARIC(Gpatleave,    char *, "\\.^$@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_5005THREADS) || 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 #if defined(USE_5005THREADS) || defined(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 #  if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
71 PERLVARI(Gcsighandlerp, Sighandler_t, Perl_csighandler_va)      /* Pointer to C-level sighandler */
72 #else
73 PERLVARI(Gcsighandlerp, Sighandler_t, Perl_csighandler) /* Pointer to C-level sighandler */
74 #  endif
75 #endif
76
77 #ifndef PERL_USE_SAFE_PUTENV
78 PERLVARI(Guse_safe_putenv, int, 1)
79 #endif