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