This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
implement C<use caller 'encoding'>
[perl5.git] / perlvars.h
CommitLineData
49f531da
NIS
1/****************/
2/* Truly global */
3/****************/
4
cb68f92d
GS
5/* Don't forget to re-run embed.pl to propagate changes! */
6
7/* This file describes the "global" variables used by perl
8 * This used to be in perl.h directly but we want to abstract out into
9 * distinct files which are per-thread, per-interpreter or really global,
10 * and how they're initialized.
11 *
12 * The 'G' prefix is only needed for vars that need appropriate #defines
22c35a8c 13 * generated in embed*.h. Such symbols are also used to generate
cb68f92d
GS
14 * the appropriate export list for win32.
15 *
16 * Avoid build-specific #ifdefs here, like DEBUGGING. That way,
17 * we can keep binary compatibility of the curinterp structure */
18
19
49f531da 20/* global state */
cb68f92d
GS
21PERLVAR(Gcurinterp, PerlInterpreter *)
22 /* currently running interpreter */
49f531da 23#ifdef USE_THREADS
cb68f92d
GS
24PERLVAR(Gthr_key, perl_key) /* For per-thread struct perl_thread* */
25PERLVAR(Gsv_mutex, perl_mutex) /* Mutex for allocating SVs in sv.c */
26PERLVAR(Gmalloc_mutex, perl_mutex) /* Mutex for malloc */
27PERLVAR(Geval_mutex, perl_mutex) /* Mutex for doeval */
28PERLVAR(Geval_cond, perl_cond) /* Condition variable for doeval */
29PERLVAR(Geval_owner, struct perl_thread *)
30 /* Owner thread for doeval */
22239a37 31PERLVAR(Gnthreads, int) /* Number of threads currently */
cb68f92d
GS
32PERLVAR(Gthreads_mutex, perl_mutex) /* Mutex for nthreads and thread list */
33PERLVAR(Gnthreads_cond, perl_cond) /* Condition variable for nthreads */
34PERLVAR(Gsvref_mutex, perl_mutex) /* Mutex for SvREFCNT_{inc,dec} */
35PERLVARI(Gthreadsv_names,char *, THREADSV_NAMES)
49f531da 36#ifdef FAKE_THREADS
cb68f92d
GS
37PERLVAR(Gcurthr, struct perl_thread *)
38 /* Currently executing (fake) thread */
49f531da 39#endif
5ff3f7a4
GS
40
41PERLVAR(Gcred_mutex, perl_mutex) /* altered credentials in effect */
42
49f531da
NIS
43#endif /* USE_THREADS */
44
cb68f92d 45PERLVAR(Gninterps, int) /* number of active interpreters */
8736538c 46PERLVARI(Gdo_undump, bool, FALSE) /* -u or dump seen? */
a0ed51b3 47
3fe35a81 48/* constants (these are not literals to facilitate pointer comparisons) */
3fe6f2dc
MB
49PERLVARIC(GYes, char *, "1")
50PERLVARIC(GNo, char *, "")
e3fdf988 51PERLVARIC(Ghexdigit, char *, "0123456789abcdef0123456789ABCDEF")
3fe6f2dc 52PERLVARIC(Gpatleave, char *, "\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}")