X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/885824d34f6f6626fde2fb041801408cbaf1f6f1..86d93ed383c14be2a4548bd8ab98e4c1a79cb1f0:/src/Headers/context.h?ds=sidebyside diff --git a/src/Headers/context.h b/src/Headers/context.h index 8cb3f59..2a1ebb0 100644 --- a/src/Headers/context.h +++ b/src/Headers/context.h @@ -1,5 +1,5 @@ /* -** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2000. +** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001. ** See ../LICENSE for license information. ** */ @@ -26,7 +26,7 @@ extern bool context_hasMods (void); extern bool context_isSystemDir (cstring p_dir) /*@*/ ; -extern /*@observer@*/ char *context_selectedLibrary (void) /*@*/ ; +extern /*@observer@*/ cstring context_selectedLibrary (void) /*@*/ ; extern bool context_usingPosixLibrary (void) /*@*/ ; extern bool context_usingAnsiLibrary (void) /*@*/ ; extern flagcode context_getLibrary (void) /*@*/ ; @@ -35,10 +35,15 @@ extern void context_setLibrary (flagcode) /*@modifies internalState@*/ ; extern void context_setPreprocessing (void) /*@modifies internalState@*/; extern void context_clearPreprocessing (void) /*@modifies internalState@*/; extern bool context_isPreprocessing (void) /*@*/; +extern bool context_loadingLibrary (void) /*@*/ ; extern void context_setInCommandLine (void) /*@modifies internalState@*/ ; extern void context_clearInCommandLine (void) /*@modifies internalState@*/ ; + +extern void context_checkGlobalScope (void) /*@modifies internalState@*/ ; + extern bool context_isInCommandLine (void) /*@*/ ; +extern bool context_inXHFile (void) /*@*/ ; extern void context_resetErrors (void); @@ -86,7 +91,9 @@ extern void context_hideShowscan (void); extern void context_unhideShowscan (void); extern void context_setMode (cstring p_s); +extern void context_setModeNoWarn (cstring p_s); extern void context_exitAllClauses (void); +extern void context_exitAllClausesQuiet (void); extern bool context_inHeader (void); extern /*@dependent@*/ /*@exposed@*/ fileTable context_fileTable (void) /*@*/ ; @@ -94,6 +101,9 @@ extern /*@dependent@*/ /*@exposed@*/ fileTable context_fileTable (void) /*@*/ ; extern /*@exposed@*/ messageLog context_messageLog (void); extern /*@dependent@*/ /*@observer@*/ cstring context_tmpdir (void); +extern void context_enterMTfile (void) /*@modifies internalState@*/ ; +extern void context_exitMTfile (void) /*@modifies internalState@*/ ; + # ifndef NOLCL extern void context_enterLCLfile (void); extern void context_exitLCLfile (void); @@ -119,7 +129,7 @@ extern /*@observer@*/ uentryList context_getParams (void); extern bool context_isSpecialFile (cstring p_fname); extern /*@observer@*/ cstring context_inFunctionName (void) /*@*/ ; extern ctype context_currentFunctionType (void) /*@*/ ; -extern void context_exitFile (void); +extern void context_exitCFile (void); extern void context_enterConstantMacro (/*@dependent@*/ /*@exposed@*/ uentry p_e); extern void context_enterMacro (/*@observer@*/ uentry p_e); extern void context_enterFunction (/*@exposed@*/ uentry p_e); @@ -131,14 +141,21 @@ extern bool context_globAccess (sRef p_s); extern /*@observer@*/ globSet context_getUsedGlobs (void); extern bool context_hasAccess (typeId p_t); extern bool context_couldHaveAccess (typeId p_t); -extern /*@only@*/ cstring context_unparse (void); +extern /*@only@*/ cstring context_unparse (void) /*@*/ ; extern void context_setFunctionDefined (fileloc p_loc); extern void context_setFlagTemp (flagcode p_f, bool p_b); +extern /*@unused@*/ void context_showFilelocStack (void) ; + extern bool context_getFlag (flagcode p_d) /*@*/ ; +extern bool context_flagOn (flagcode p_f, fileloc p_loc) /*@*/ ; + extern int context_getLineLen (void) /*@*/ ; # define context_getLineLen() ((int)context_getValue(FLG_LINELEN)) +extern int context_getIndentSpaces (void) /*@*/ ; +# define context_getIndentSpaces() ((int)context_getValue(FLG_INDENTSPACES)) + extern int context_getValue (flagcode p_flag) /*@*/ ; extern void context_setValueAndFlag (flagcode p_flag, int p_val) /*@modifies internalState@*/ ; @@ -164,7 +181,7 @@ extern int context_getExpect (void) /*@*/ ; extern /*@observer@*/ sRefSet context_modList(void); extern /*@exposed@*/ uentry context_getHeader(void) /*@*/; -extern void context_usedGlobal (sRef p_el); +extern void context_usedGlobal (/*@exposed@*/ sRef p_el); extern void context_resetModeFlags (void); extern ctype context_typeofZero (void); extern ctype context_typeofOne (void); @@ -193,7 +210,7 @@ extern bool context_inFunctionLike (void) /*@*/ ; extern void context_setMacroMissingParams (void); extern void context_resetMacroMissingParams (void); extern bool context_isMacroMissingParams (void) /*@*/ ; -extern bool context_inMacroUnknown (void) /*@*/ ; +extern bool context_inUnknownMacro (void) /*@*/ ; /*@observer@*/ cstring context_getDump (void) /*@*/ ; /*@observer@*/ cstring context_getMerge (void) /*@*/ ; @@ -288,9 +305,62 @@ extern /*@observer@*/ cstring context_moduleName (void) /*@*/ ; extern void context_recordFileGlobals (/*@dependent@*/ globSet p_mods); extern void context_checkSuppressCounts (void) /*@modifies g_msgstream@*/ ; -extern bool context_inFunctionDecl (void) /*@globals internalState@*/ ; -extern void context_enterFunctionDecl (void) /*@modifies internalState@*/ ; -extern void context_exitFunctionDecl (void) /*@modifies internalState@*/ ; +extern bool context_inFunctionHeader (void) /*@globals internalState@*/ ; +extern void context_enterFunctionHeader (void) /*@modifies internalState@*/ ; +extern void context_exitFunctionHeader (void) /*@modifies internalState@*/ ; + +extern bool context_inFunctionDeclaration (void) /*@globals internalState@*/ ; +extern void context_enterFunctionDeclaration (/*@exposed@*/ uentry) /*@modifies internalState@*/ ; +extern void context_exitFunctionDeclaration (void) /*@modifies internalState@*/ ; +extern void context_enterOldStyleScope (void) /*@modifies internalState@*/ ; +extern void context_completeOldStyleFunction (/*@exposed@*/ uentry p_e) /*@modifies internalState@*/ ; + +extern ctype context_boolImplementationType (void) /*@*/ ; +extern /*@observer@*/ /*@null@*/ annotationInfo + context_lookupAnnotation (cstring p_annot) /*@*/ ; + +extern /*@observer@*/ metaStateTable context_getMetaStateTable (void) + /*@globals internalState@*/ ; + +extern /*@observer@*/ metaStateInfo context_lookupMetaStateInfo (cstring p_key) + /*@globals internalState@*/ ; + +extern void context_addAnnotation (/*@only@*/ annotationInfo) + /*@modifies internalState@*/ ; + +extern void context_addMetaState (/*@only@*/ cstring, /*@only@*/ metaStateInfo) + /*@modifies internalState@*/ ; + +extern valueTable context_createValueTable (sRef p_s, /*@only@*/ stateInfo p_sinfo) + /*@globals internalState@*/ ; + +extern valueTable context_createGlobalMarkerValueTable (/*@only@*/ stateInfo p_sinfo) + /*@globals internalState@*/ ; + +extern int context_getBugsLimit (void) /*@*/ ; +# define context_getBugsLimit() ((int)context_getValue(FLG_BUGSLIMIT)) + +/*drl 12/30/2001 these are some ugly functions that were added to facilitate struct annotations */ + + +extern bool hasInvariants (ctype p_ct); + +/*drl 1/6/2001: I didn't think these functions were solid enough to include in the + stable release of splint. I coomented them out so that they won't break anything + but didn't delete them because they will be fixed and included later +*/ + +/*extern void setGlobalStructInfo(ctype p_ct, constraintList p_list); */ + +/*extern constraintList getInvariants (ctype p_ct); */ + +/* static int getSref (ctype ct, sRef s); */ + +/* sRef fixSref (ctype p_ct, sRef p_base, sRef p_fix); */ + +ctype context_setLastStruct (/*@returned@*/ ctype p_s) /*@modifies internalState@*/; +ctype context_getLastStruct (/*@returned@*/ /*ctype p_s*/) /*@modifies internalState@*/; + # else # error "Multiple include"