]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | /* |
28bf4b0b | 2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001. |
885824d3 | 3 | ** See ../LICENSE for license information. |
4 | ** | |
5 | */ | |
6 | /* | |
7 | ** context.h | |
8 | */ | |
9 | ||
10 | # ifndef CONTEXT_H | |
11 | # define CONTEXT_H | |
12 | ||
13 | extern void context_pushLoc (void); | |
14 | extern void context_popLoc (void); | |
15 | ||
16 | extern bool context_doMerge (void); | |
17 | extern bool context_doDump (void); | |
18 | ||
19 | extern void context_resetAllFlags (void); | |
20 | ||
21 | extern /*@unused@*/ cstring context_unparseFlagMarkers (void) /*@*/ ; | |
22 | ||
23 | extern void context_enterDoWhileClause (void) /*@modifies internalState@*/ ; | |
24 | ||
25 | extern bool context_hasMods (void); | |
26 | ||
27 | extern bool context_isSystemDir (cstring p_dir) /*@*/ ; | |
28 | ||
28bf4b0b | 29 | extern /*@observer@*/ cstring context_selectedLibrary (void) /*@*/ ; |
885824d3 | 30 | extern bool context_usingPosixLibrary (void) /*@*/ ; |
31 | extern bool context_usingAnsiLibrary (void) /*@*/ ; | |
32 | extern flagcode context_getLibrary (void) /*@*/ ; | |
33 | extern void context_setLibrary (flagcode) /*@modifies internalState@*/ ; | |
34 | ||
35 | extern void context_setPreprocessing (void) /*@modifies internalState@*/; | |
36 | extern void context_clearPreprocessing (void) /*@modifies internalState@*/; | |
37 | extern bool context_isPreprocessing (void) /*@*/; | |
990ec868 | 38 | extern bool context_loadingLibrary (void) /*@*/ ; |
885824d3 | 39 | |
40 | extern void context_setInCommandLine (void) /*@modifies internalState@*/ ; | |
41 | extern void context_clearInCommandLine (void) /*@modifies internalState@*/ ; | |
42 | extern bool context_isInCommandLine (void) /*@*/ ; | |
28bf4b0b | 43 | extern bool context_inXHFile (void) /*@*/ ; |
885824d3 | 44 | |
45 | extern void context_resetErrors (void); | |
46 | ||
47 | extern int context_getLinesProcessed (void) /*@*/ ; | |
48 | extern int context_getSpecLinesProcessed (void) /*@*/ ; | |
49 | ||
50 | extern bool context_setBoolName (void) /*@*/ ; | |
51 | extern /*@observer@*/ cstring context_getBoolName (void) /*@*/ ; | |
52 | extern /*@observer@*/ cstring context_printBoolName (void) /*@*/ ; | |
53 | extern /*@observer@*/ cstring context_getFalseName (void) /*@*/ ; | |
54 | extern /*@observer@*/ cstring context_getTrueName (void) /*@*/ ; | |
55 | extern /*@observer@*/ cstring context_getLarchPath (void) /*@*/ ; | |
56 | extern /*@observer@*/ cstring context_getLCLImportDir (void) /*@*/ ; | |
57 | ||
58 | extern bool context_checkExport (uentry p_e) /*@*/ ; | |
59 | extern bool context_checkGlobMod (sRef p_el) /*@*/ ; | |
60 | extern bool context_checkGlobUse (uentry p_glob); | |
61 | extern bool context_checkAliasGlob (uentry p_glob); | |
62 | extern bool context_checkInternalUse (void); | |
63 | extern void context_recordFileModifies (/*@dependent@*/ sRefSet p_mods); | |
64 | extern void context_clearJustPopped (void); | |
65 | extern bool context_justPopped (void); | |
66 | ||
67 | extern void context_enterTrueClause (exprNode p_e); | |
68 | extern void context_enterFalseClause (exprNode p_e); | |
69 | extern void context_exitClause (exprNode p_pred, | |
70 | exprNode p_tbranch, exprNode p_fbranch); | |
71 | extern void context_exitInnerSafe (void); | |
72 | extern void context_exitInnerPlain (void) /*@modifies internalState@*/ ; | |
73 | ||
74 | extern bool context_inGlobalScope (void); | |
75 | extern bool context_inInnerScope (void); | |
76 | extern void context_setProtectVars (void); | |
77 | ||
78 | extern int context_getLimit (void) /*@*/ ; | |
79 | extern bool context_unlimitedMessages (void) /*@*/ ; | |
80 | ||
81 | extern void context_releaseVars (void); | |
82 | extern void context_sizeofReleaseVars (void); | |
83 | extern bool context_inProtectVars (void); | |
84 | ||
85 | extern bool context_hasFileAccess (typeId p_t); | |
86 | ||
87 | extern void context_hideShowscan (void); | |
88 | extern void context_unhideShowscan (void); | |
89 | ||
90 | extern void context_setMode (cstring p_s); | |
91 | extern void context_exitAllClauses (void); | |
28bf4b0b | 92 | extern void context_exitAllClausesQuiet (void); |
885824d3 | 93 | extern bool context_inHeader (void); |
94 | ||
95 | extern /*@dependent@*/ /*@exposed@*/ fileTable context_fileTable (void) /*@*/ ; | |
96 | ||
97 | extern /*@exposed@*/ messageLog context_messageLog (void); | |
98 | extern /*@dependent@*/ /*@observer@*/ cstring context_tmpdir (void); | |
99 | ||
28bf4b0b | 100 | extern void context_enterMTfile (void) /*@modifies internalState@*/ ; |
101 | extern void context_exitMTfile (void) /*@modifies internalState@*/ ; | |
102 | ||
885824d3 | 103 | # ifndef NOLCL |
104 | extern void context_enterLCLfile (void); | |
105 | extern void context_exitLCLfile (void); | |
106 | extern void context_enterImport (void) ; | |
107 | extern void context_leaveImport (void) ; | |
108 | extern void context_processedSpecLine (void) /*@modifies internalState@*/ ; | |
109 | extern int context_getLCLExpect (void) /*@*/ ; | |
110 | extern bool context_msgLh (void) /*@*/ ; | |
111 | extern bool context_inLCLLib (void) /*@globals internalState@*/ ; | |
112 | extern bool context_inImport (void) /*@globals internalState@*/ ; | |
113 | extern void context_resetSpecLines (void) /*@modifies internalState@*/ ; | |
114 | # endif | |
115 | ||
116 | extern void context_exitMacroCache (void); | |
117 | extern void context_enterSuppressRegion (void); | |
118 | extern void context_exitSuppressRegion (void); | |
119 | extern void context_enterMacroFile (void); | |
120 | extern typeIdSet context_fileAccessTypes (void); | |
121 | extern void context_addFileAccessType (typeId p_t); | |
122 | extern void context_removeFileAccessType (typeId p_t); | |
123 | extern /*@observer@*/ uentryList context_getParams (void); | |
124 | ||
125 | extern bool context_isSpecialFile (cstring p_fname); | |
126 | extern /*@observer@*/ cstring context_inFunctionName (void) /*@*/ ; | |
127 | extern ctype context_currentFunctionType (void) /*@*/ ; | |
28bf4b0b | 128 | extern void context_exitCFile (void); |
885824d3 | 129 | extern void context_enterConstantMacro (/*@dependent@*/ /*@exposed@*/ uentry p_e); |
130 | extern void context_enterMacro (/*@observer@*/ uentry p_e); | |
131 | extern void context_enterFunction (/*@exposed@*/ uentry p_e); | |
132 | extern void context_exitFunction (void); | |
133 | extern void context_initMod (void) /*@modifies internalState@*/ ; | |
134 | extern void context_enterInnerContext(void); | |
135 | extern void context_exitInner (exprNode p_exp); | |
136 | extern bool context_globAccess (sRef p_s); | |
137 | extern /*@observer@*/ globSet context_getUsedGlobs (void); | |
138 | extern bool context_hasAccess (typeId p_t); | |
139 | extern bool context_couldHaveAccess (typeId p_t); | |
140 | extern /*@only@*/ cstring context_unparse (void); | |
141 | extern void context_setFunctionDefined (fileloc p_loc); | |
142 | extern void context_setFlagTemp (flagcode p_f, bool p_b); | |
143 | ||
a0a162cd | 144 | extern /*@unused@*/ void context_showFilelocStack (void) ; |
145 | ||
885824d3 | 146 | extern bool context_getFlag (flagcode p_d) /*@*/ ; |
28bf4b0b | 147 | extern bool context_flagOn (flagcode p_f, fileloc p_loc) /*@*/ ; |
148 | ||
885824d3 | 149 | extern int context_getLineLen (void) /*@*/ ; |
150 | # define context_getLineLen() ((int)context_getValue(FLG_LINELEN)) | |
151 | ||
28bf4b0b | 152 | extern int context_getIndentSpaces (void) /*@*/ ; |
153 | # define context_getIndentSpaces() ((int)context_getValue(FLG_INDENTSPACES)) | |
154 | ||
885824d3 | 155 | extern int context_getValue (flagcode p_flag) /*@*/ ; |
156 | extern void context_setValueAndFlag (flagcode p_flag, int p_val) | |
157 | /*@modifies internalState@*/ ; | |
158 | ||
159 | extern /*@unused@*/ int context_getCounter (flagcode p_flag) /*@*/ ; | |
160 | extern /*@unused@*/ void context_incCounter (flagcode p_flag) | |
161 | /*@modifies internalState@*/ ; | |
162 | extern /*@unused@*/ void context_decCounter (flagcode p_flag) | |
163 | /*@modifies internalState@*/ ; | |
164 | ||
165 | extern bool context_maybeSet (flagcode p_d) /*@*/ ; | |
166 | ||
167 | extern /*@observer@*/ cstring context_getString (flagcode p_flag) /*@*/ ; | |
168 | extern void context_setString (flagcode p_flag, /*@only@*/ cstring p_val) | |
169 | /*@modifies internalState@*/ ; | |
170 | ||
171 | extern bool context_getDebug (flagcode p_d); | |
172 | # define context_getDebug(p_d) context_getFlag(p_d) | |
173 | ||
174 | extern void context_userSetFlag (flagcode p_f, bool p_b); | |
175 | ||
176 | extern int context_getExpect (void) /*@*/ ; | |
177 | ||
178 | extern /*@observer@*/ sRefSet context_modList(void); | |
179 | extern /*@exposed@*/ uentry context_getHeader(void) /*@*/; | |
28bf4b0b | 180 | extern void context_usedGlobal (/*@exposed@*/ sRef p_el); |
885824d3 | 181 | extern void context_resetModeFlags (void); |
182 | extern ctype context_typeofZero (void); | |
183 | extern ctype context_typeofOne (void); | |
184 | extern void context_enterFile (void); | |
185 | extern void context_enterUnknownMacro (/*@dependent@*/ /*@observer@*/ uentry p_e); | |
186 | extern char context_getCommentMarkerChar (void); | |
187 | extern void context_setCommentMarkerChar (char p_c); | |
188 | extern bool context_inMacroConstant (void) /*@*/ ; | |
189 | extern void context_returnFunction (void); | |
190 | extern bool context_processingMacros (void); | |
191 | ||
192 | extern void context_saveLocation (void); | |
193 | extern /*@only@*/ fileloc context_getSaveLocation (void); | |
194 | ||
195 | extern void context_setFileId (fileId p_s); | |
196 | extern void context_setFilename(fileId p_fid, int p_lineno) | |
197 | /*@globals fileloc g_currentloc; @*/ | |
198 | /*@modifies g_currentloc@*/ ; | |
199 | ||
200 | extern void context_fileSetFlag (flagcode p_f, ynm p_set); | |
201 | ||
202 | extern /*@unused@*/ /*@only@*/ cstring context_unparseAccess (void) /*@*/ ; | |
203 | extern bool context_inFunction(void) /*@*/ ; | |
204 | extern bool context_inFunctionLike (void) /*@*/ ; | |
205 | ||
206 | extern void context_setMacroMissingParams (void); | |
207 | extern void context_resetMacroMissingParams (void); | |
208 | extern bool context_isMacroMissingParams (void) /*@*/ ; | |
209 | extern bool context_inMacroUnknown (void) /*@*/ ; | |
210 | ||
211 | /*@observer@*/ cstring context_getDump (void) /*@*/ ; | |
212 | /*@observer@*/ cstring context_getMerge (void) /*@*/ ; | |
213 | ||
214 | extern void context_incLineno (void); | |
215 | extern bool context_inSuppressRegion (void) /*@*/ ; | |
216 | extern void context_exitTrueClause (exprNode p_pred, exprNode p_tbranch); | |
217 | extern void context_destroyMod (void) /*@modifies internalState@*/ ; | |
218 | extern void context_addMacroCache (/*@only@*/ cstring p_def); | |
219 | extern void context_processAllMacros (void); | |
220 | extern void context_addComment (/*@only@*/ cstring p_def); | |
221 | extern void context_enterSuppressLine (int p_count); | |
222 | extern bool context_inSuppressZone (fileloc p_fl) /*@*/ ; | |
223 | extern void context_dumpModuleAccess (FILE *p_fout); | |
224 | extern void context_loadModuleAccess (FILE *p_in); | |
225 | extern bool context_inIterDef (void) /*@*/ ; | |
226 | extern bool context_inMacro (void) /*@*/ ; | |
227 | extern bool context_inIterEnd (void) /*@*/ ; | |
228 | extern ctype context_getRetType (void) /*@*/ ; | |
229 | ||
230 | extern void context_enterIterDef (/*@observer@*/ uentry p_le); | |
231 | extern void context_enterIterEnd (/*@observer@*/ uentry p_le); | |
232 | extern void context_addBoolAccess (void); | |
233 | extern bool context_canAccessBool (void); | |
234 | extern void context_quietExitFunction (void); | |
235 | ||
236 | /* speedy shortcuts for frequently used flags */ | |
237 | ||
238 | extern bool context_msgBoolInt (void) /*@*/ ; | |
239 | extern bool context_msgCharInt (void) /*@*/ ; | |
240 | extern bool context_msgEnumInt (void) /*@*/ ; | |
241 | extern bool context_msgPointerArith (void) /*@*/ ; | |
242 | extern bool context_msgStrictOps (void) /*@*/ ; | |
243 | ||
244 | extern void context_exitStructInnerContext (void); | |
245 | extern void context_enterStructInnerContext (void); | |
246 | extern bool context_inRealFunction (void) /*@*/ ; | |
247 | extern void context_exitOrClause (exprNode p_pred, exprNode p_tbranch); | |
248 | extern void context_exitAndClause (exprNode p_pred, exprNode p_tbranch); | |
249 | extern void context_enterOrClause (exprNode p_e); | |
250 | extern void context_enterAndClause (exprNode p_e); | |
251 | ||
252 | extern void context_enterForClause (exprNode p_e); | |
253 | extern void context_enterWhileClause (exprNode p_e); | |
254 | ||
255 | extern void context_enterIterClause (void); | |
256 | extern void context_exitIterClause (exprNode p_body); | |
257 | ||
258 | extern void context_exitWhileClause (exprNode p_pred, exprNode p_body); | |
259 | extern void context_exitDoWhileClause (exprNode p_pred); | |
260 | extern void context_exitForClause (exprNode p_forPred, exprNode p_body); | |
261 | ||
262 | extern /*@only@*/ cstring context_unparseClauses (void) /*@*/ ; | |
263 | extern /*@observer@*/ globSet context_getGlobs (void) /*@*/ ; | |
264 | ||
265 | extern /*@only@*/ cstring context_getMessageAnnote (void); | |
266 | extern void context_clearMessageAnnote (void); | |
267 | extern bool context_hasMessageAnnote (void); | |
268 | extern void context_setMessageAnnote (/*@only@*/ cstring p_s); | |
269 | extern bool context_suppressFlagMsg (flagcode p_flag, fileloc p_fl); | |
270 | extern bool context_suppressNotFlagMsg (flagcode p_flag, fileloc p_fl); | |
271 | extern void context_enterCaseClause (exprNode p_e); | |
272 | extern void context_enterSwitch (exprNode p_e); | |
273 | extern void context_exitSwitch (exprNode p_e, bool p_allpaths); | |
274 | ||
275 | extern bool context_showFunction (void); | |
276 | extern void context_setShownFunction (void); | |
277 | ||
278 | extern void context_clearAliasAnnote (void); | |
279 | extern cstring context_getAliasAnnote (void); | |
280 | extern bool context_hasAliasAnnote (void); | |
281 | extern void context_setAliasAnnote (/*@observer@*/ sRef p_s, /*@observer@*/ sRef p_t); | |
282 | ||
283 | extern bool context_inDeepLoop (void) /*@globals internalState@*/ ; | |
284 | extern bool context_inDeepLoopSwitch (void) /*@globals internalState@*/ ; | |
285 | extern bool context_inConditional (void) /*@globals internalState@*/ ; | |
286 | extern bool context_inDeepSwitch (void) /*@globals internalState@*/ ; | |
287 | ||
288 | extern clause context_breakClause (void); | |
289 | extern clause context_nextBreakClause (void); | |
290 | ||
291 | extern bool context_anyErrors (void) /*@globals internalState@*/ ; | |
292 | extern void context_hasError (void) /*@modifies internalState@*/ ; | |
293 | extern int context_numErrors (void) /*@globals internalState@*/ ; | |
294 | extern bool context_neednl (void); | |
295 | extern void context_setNeednl (void); | |
296 | ||
297 | extern bool context_inGlobalContext (void) /*@globals internalState@*/ ; | |
298 | extern bool context_inMacroFunction (void) /*@globals internalState@*/ ; | |
299 | ||
300 | extern /*@observer@*/ cstring context_moduleName (void) /*@*/ ; | |
301 | extern void context_recordFileGlobals (/*@dependent@*/ globSet p_mods); | |
302 | extern void context_checkSuppressCounts (void) /*@modifies g_msgstream@*/ ; | |
303 | ||
28bf4b0b | 304 | extern bool context_inFunctionHeader (void) /*@globals internalState@*/ ; |
305 | extern void context_enterFunctionHeader (void) /*@modifies internalState@*/ ; | |
306 | extern void context_exitFunctionHeader (void) /*@modifies internalState@*/ ; | |
307 | ||
308 | extern bool context_inFunctionDeclaration (void) /*@globals internalState@*/ ; | |
309 | extern void context_enterFunctionDeclaration (/*@exposed@*/ uentry) /*@modifies internalState@*/ ; | |
310 | extern void context_exitFunctionDeclaration (void) /*@modifies internalState@*/ ; | |
885824d3 | 311 | |
a0a162cd | 312 | extern ctype context_boolImplementationType (void) /*@*/ ; |
28bf4b0b | 313 | extern /*@observer@*/ /*@null@*/ annotationInfo |
314 | context_lookupAnnotation (cstring p_annot) /*@*/ ; | |
315 | ||
316 | extern /*@observer@*/ metaStateTable context_getMetaStateTable (void) | |
317 | /*@globals internalState@*/ ; | |
318 | ||
319 | extern /*@observer@*/ metaStateInfo context_lookupMetaStateInfo (cstring p_key) | |
320 | /*@globals internalState@*/ ; | |
321 | ||
322 | extern void context_addAnnotation (/*@only@*/ annotationInfo) | |
323 | /*@modifies internalState@*/ ; | |
324 | ||
325 | extern void context_addMetaState (/*@only@*/ cstring, /*@only@*/ metaStateInfo) | |
326 | /*@modifies internalState@*/ ; | |
327 | ||
328 | extern valueTable context_createValueTable (sRef p_s) | |
329 | /*@globals internalState@*/ ; | |
330 | ||
331 | extern valueTable context_createGlobalMarkerValueTable (void) | |
332 | /*@globals internalState@*/ ; | |
333 | ||
334 | extern int context_getBugsLimit (void) /*@*/ ; | |
335 | # define context_getBugsLimit() ((int)context_getValue(FLG_BUGSLIMIT)) | |
a0a162cd | 336 | |
885824d3 | 337 | # else |
338 | # error "Multiple include" | |
339 | # endif | |
340 | ||
341 | ||
342 | ||
343 | ||
344 | ||
345 | ||
346 | ||
347 |