[asperl] integrate latest win32 branch
[p5sagit/p5-mst-13.2.git] / perlvars.h
1 /* This file describes the "global" variables used by perl  */
2 /* This used to be in perl.h directly but we want to        */
3 /* abstract out which are per-thread per-interpreter really */
4 /* global and how initialized into one file                 */
5
6 /****************/
7 /* Truly global */
8 /****************/
9
10 /* global state */
11 PERLVAR(Gcurinterp,     PerlInterpreter *)              /* currently running interpreter */
12 #ifdef USE_THREADS
13 PERLVAR(Gthr_key,       perl_key)               /* For per-thread struct perl_thread* */
14 PERLVAR(Gsv_mutex,      perl_mutex)             /* Mutex for allocating SVs in sv.c */
15 PERLVAR(Gmalloc_mutex,  perl_mutex)             /* Mutex for malloc */
16 PERLVAR(Geval_mutex,    perl_mutex)             /* Mutex for doeval */
17 PERLVAR(Geval_cond,     perl_cond)              /* Condition variable for doeval */
18 PERLVAR(Geval_owner,    struct perl_thread *)           /* Owner thread for doeval */
19 PERLVAR(Gnthreads,      int)            /* Number of threads currently */
20 PERLVAR(Gthreads_mutex, perl_mutex)             /* Mutex for nthreads and thread list */
21 PERLVAR(Gnthreads_cond, perl_cond)              /* Condition variable for nthreads */
22 PERLVARI(Gthreadsv_names,       char *, THREADSV_NAMES) 
23 #ifdef FAKE_THREADS
24 PERLVAR(Gcurthr,        struct perl_thread *)   /* Currently executing (fake) thread */
25 #endif
26 #endif /* USE_THREADS */
27 #ifdef PERL_OBJECT
28 #ifdef WIN32
29 PERLVAR(Gerror_no,    int)      /* errno for each interpreter */
30 #endif
31 #endif
32
33 PERLVAR(Guid,   int)            /* current real user id */
34 PERLVAR(Geuid,  int)            /* current effective user id */
35 PERLVAR(Ggid,   int)            /* current real group id */
36 PERLVAR(Gegid,  int)            /* current effective group id */
37 PERLVAR(Gnomemok,       bool)           /* let malloc context handle nomem */
38 PERLVAR(Gan,    U32)            /* malloc sequence number */
39 PERLVAR(Gcop_seqmax,    U32)            /* statement sequence number */
40 PERLVAR(Gop_seqmax,     U16)            /* op sequence number */
41 PERLVAR(Gevalseq,       U32)            /* eval sequence number */
42 PERLVAR(Gsub_generation,        U32)            /* inc to force methods to be looked up again */
43 PERLVAR(Gorigenviron,   char **)                
44 PERLVAR(Gorigalen,      U32)            
45 PERLVAR(Gpidstatus,     HV *)           /* pid-to-status mappings for waitpid */
46 PERLVAR(Gprofiledata,   U32 *)          
47 PERLVARI(Gmaxo, int,    MAXO)   /* Number of ops */
48 PERLVAR(Gosname,        char *)         /* operating system */
49 PERLVARI(Gsh_path,      char *, SH_PATH)        /* full path of shell */
50 PERLVAR(Gsighandlerp,   Sighandler_t)           
51
52 PERLVAR(Gxiv_arenaroot, XPV*)           /* list of allocated xiv areas */
53 PERLVAR(Gxiv_root,      IV **)          /* free xiv list--shared by interpreters */
54 PERLVAR(Gxnv_root,      double *)               /* free xnv list--shared by interpreters */
55 PERLVAR(Gxrv_root,      XRV *)          /* free xrv list--shared by interpreters */
56 PERLVAR(Gxpv_root,      XPV *)          /* free xpv list--shared by interpreters */
57 PERLVAR(Ghe_root,       HE *)           /* free he list--shared by interpreters */
58 PERLVAR(Gnice_chunk,    char *)         /* a nice chunk of memory to reuse */
59 PERLVAR(Gnice_chunk_size,       U32)            /* how nice the chunk of memory is */
60
61 #ifdef PERL_OBJECT
62 PERLVAR(Grunops,        runops_proc_t)  
63 #else
64 PERLVARI(Grunops,       runops_proc_t *,        RUNOPS_DEFAULT) 
65 #endif
66
67 PERLVAR(Gtokenbuf[256], char)           
68 PERLVAR(Gna,    STRLEN)         /* for use in SvPV when length is Not Applicable */
69
70 PERLVAR(Gsv_undef,      SV)             
71 PERLVAR(Gsv_no, SV)             
72 PERLVAR(Gsv_yes,        SV)             
73 #ifdef CSH
74 PERLVARI(Gcshname,      char *, CSH)    
75 PERLVAR(Gcshlen,        I32)            
76 #endif
77
78 PERLVAR(Glex_state,     U32)            /* next token is determined */
79 PERLVAR(Glex_defer,     U32)            /* state after determined token */
80 PERLVAR(Glex_expect,    expectation)            /* expect after determined token */
81 PERLVAR(Glex_brackets,  I32)            /* bracket count */
82 PERLVAR(Glex_formbrack, I32)            /* bracket count at outer format level */
83 PERLVAR(Glex_fakebrack, I32)            /* outer bracket is mere delimiter */
84 PERLVAR(Glex_casemods,  I32)            /* casemod count */
85 PERLVAR(Glex_dojoin,    I32)            /* doing an array interpolation */
86 PERLVAR(Glex_starts,    I32)            /* how many interps done on level */
87 PERLVAR(Glex_stuff,     SV *)           /* runtime pattern from m// or s/// */
88 PERLVAR(Glex_repl,      SV *)           /* runtime replacement from s/// */
89 PERLVAR(Glex_op,        OP *)           /* extra info to pass back on op */
90 PERLVAR(Glex_inpat,     OP *)           /* in pattern $) and $| are special */
91 PERLVAR(Glex_inwhat,    I32)            /* what kind of quoting are we in */
92 PERLVAR(Glex_brackstack,        char *)         /* what kind of brackets to pop */
93 PERLVAR(Glex_casestack, char *)         /* what kind of case mods in effect */
94
95 /* What we know when we're in LEX_KNOWNEXT state. */
96 PERLVAR(Gnextval[5],    YYSTYPE)                /* value of next token, if any */
97 PERLVAR(Gnexttype[5],   I32)            /* type of next token */
98 PERLVAR(Gnexttoke,      I32)            
99
100 PERLVARI(Grsfp, PerlIO * VOL,   Nullfp) 
101 PERLVAR(Glinestr,       SV *)           
102 PERLVAR(Gbufptr,        char *)         
103 PERLVAR(Goldbufptr,     char *)         
104 PERLVAR(Goldoldbufptr,  char *)         
105 PERLVAR(Gbufend,        char *)         
106 PERLVARI(Gexpect,       expectation,    XSTATE) /* how to interpret ambiguous tokens */
107 PERLVAR(Grsfp_filters,  AV *)           
108
109 PERLVAR(Gmulti_start,   I32)            /* 1st line of multi-line string */
110 PERLVAR(Gmulti_end,     I32)            /* last line of multi-line string */
111 PERLVAR(Gmulti_open,    I32)            /* delimiter of said string */
112 PERLVAR(Gmulti_close,   I32)            /* delimiter of said string */
113
114 PERLVAR(Gscrgv, GV *)           
115 PERLVAR(Gerror_count,   I32)            /* how many errors so far, max 10 */
116 PERLVAR(Gsubline,       I32)            /* line this subroutine began on */
117 PERLVAR(Gsubname,       SV *)           /* name of current subroutine */
118
119 PERLVAR(Gcompcv,        CV *)           /* currently compiling subroutine */
120 PERLVAR(Gcomppad,       AV *)           /* storage for lexically scoped temporaries */
121 PERLVAR(Gcomppad_name,  AV *)           /* variable names for "my" variables */
122 PERLVAR(Gcomppad_name_fill,     I32)            /* last "introduced" variable offset */
123 PERLVAR(Gcomppad_name_floor,    I32)            /* start of vars in innermost block */
124 PERLVAR(Gmin_intro_pending,     I32)            /* start of vars to introduce */
125 PERLVAR(Gmax_intro_pending,     I32)            /* end of vars to introduce */
126 PERLVAR(Gpadix, I32)            /* max used index in current "register" pad */
127 PERLVAR(Gpadix_floor,   I32)            /* how low may inner block reset padix */
128 PERLVAR(Gpad_reset_pending,     I32)            /* reset pad on next attempted alloc */
129 PERLVAR(Gcompiling,     COP)            
130
131 PERLVAR(Gthisexpr,      I32)            /* name id for nothing_in_common() */
132 PERLVAR(Glast_uni,      char *)         /* position of last named-unary operator */
133 PERLVAR(Glast_lop,      char *)         /* position of last list operator */
134 PERLVAR(Glast_lop_op,   OPCODE)         /* last list operator */
135 PERLVAR(Gin_my, bool)           /* we're compiling a "my" declaration */
136 PERLVAR(Gin_my_stash,   HV *)           /* declared class of this "my" declaration */
137 #ifdef FCRYPT
138 PERLVAR(Gcryptseen,     I32)            /* has fast crypt() been initialized? */
139 #endif
140
141 PERLVAR(Ghints, U32)            /* various compilation flags */
142
143 PERLVAR(Gdo_undump,     bool)           /* -u or dump seen? */
144 PERLVAR(Gdebug, VOL U32)                
145
146
147 #ifdef OVERLOAD
148
149 PERLVAR(Gamagic_generation,     long)           
150
151 #endif
152
153 #ifdef USE_LOCALE_COLLATE
154 PERLVAR(Gcollation_ix,  U32)            /* Collation generation index */
155 PERLVAR(Gcollation_name,        char *)         /* Name of current collation */
156 PERLVARI(Gcollation_standard,   bool,   TRUE)   /* Assume simple collation */
157 PERLVAR(Gcollxfrm_base, Size_t)         /* Basic overhead in *xfrm() */
158 PERLVARI(Gcollxfrm_mult,        Size_t, 2)      /* Expansion factor in *xfrm() */
159 #endif /* USE_LOCALE_COLLATE */
160
161 #ifdef USE_LOCALE_NUMERIC
162
163 PERLVAR(Gnumeric_name,  char *)         /* Name of current numeric locale */
164 PERLVARI(Gnumeric_standard,     bool,   TRUE)   /* Assume simple numerics */
165 PERLVARI(Gnumeric_local,        bool,   TRUE)   /* Assume local numerics */
166
167 #endif /* !USE_LOCALE_NUMERIC */
168
169 /* constants (these are not literals to facilitate pointer comparisons) */
170 PERLVARIC(GYes,         char *, "1")
171 PERLVARIC(GNo,          char *, "")
172 PERLVARIC(Ghexdigit,    char *, "0123456789abcdef0123456789ABCDEFx")
173 PERLVARIC(Gpatleave,    char *, "\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}")
174