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