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