]> andersk Git - splint.git/blob - src/Headers/flags.h
Merged code tree with Dave Evans's version. Many changes to numberous to list....
[splint.git] / src / Headers / flags.h
1 /*
2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
3 ** See ../LICENSE for license information.
4 **
5 */
6 # ifndef FLAGS_H
7 # define FLAGS_H
8
9
10 typedef enum 
11 {
12   FK_ABSTRACT, FK_ANSI, FK_BEHAVIOR, 
13   FK_COMMENTS, FK_COMPLETE, FK_CONTROL, FK_DEBUG, FK_DECL,
14   FK_DEF, FK_DIRECT, FK_DISPLAY, FK_EFFECT, FK_EXPORT,
15   FK_EXPOSURE, FK_FORMAT, FK_GLOBAL, FK_GLOBALS, FK_HEADERS,
16   FK_HELP, FK_IGNORERET, FK_INIT, FK_ITER, FK_LIBS, FK_LIMITS,
17   FK_MACROS, FK_MEMORY, FK_MODIFIES, FK_NAMES, FK_NONE,
18   FK_NULL, FK_NT, FK_OPS, FK_PRED, FK_PREPROC, FK_SECRET,
19   FK_SUPPRESS, FK_SYNTAX, FK_TYPE, FK_TYPEEQ, FK_NUMBERS, 
20   FK_POINTER, FK_UNRECOG, FK_USE, FK_BOOL, FK_ALIAS, 
21   FK_PROTOS, FK_SPEC, 
22   FK_IMPLICIT, FK_FILES, FK_ERRORS, FK_UNSPEC, 
23   FK_SPEED, FK_PARAMS, FK_DEAD, FK_SECURITY,
24   FK_LEAK, FK_ARRAY, FK_OBSOLETE, FK_PREFIX, FK_WARNUSE
25 } flagkind;
26
27 extern void listAllCategories (void);
28 extern void printAlphaFlags (void);
29 extern void printAllFlags (bool p_desc, bool p_full);
30
31 extern void flagcode_recordError (flagcode p_f);
32 extern void flagcode_recordSuppressed (flagcode p_f);
33 extern int flagcode_numReported (flagcode p_f);
34 extern bool flagcode_isNamePrefixFlag (flagcode p_f);
35
36 extern /*@only@*/ cstring  describeFlag (cstring p_flagname);
37 extern flagcode identifyFlag (cstring p_s);
38 extern void setValueFlag (flagcode p_opt, cstring p_arg);
39 extern void setStringFlag (flagcode p_opt, /*@only@*/ cstring p_arg);
40
41 extern /*@observer@*/ cstring flagcode_unparse (flagcode p_code) /*@*/ ;
42 extern int flagcode_valueIndex (flagcode p_f) /*@*/ ;
43 extern int flagcode_stringIndex (flagcode p_f) /*@*/ ;
44
45 extern /*@observer@*/ cstring flagcodeHint (flagcode p_f);
46
47 extern flagkind identifyCategory (cstring p_s) /*@*/ ;
48 extern void printCategory (flagkind p_kind) /*@modifies g_msgstream@*/ ;
49
50 extern bool flagcode_isInvalid (flagcode p_f) /*@*/ ;
51 # define flagcode_isInvalid(f) ((f) == INVALID_FLAG)
52
53 extern bool flagcode_isSkip (flagcode p_f) /*@*/ ;
54 # define flagcode_isSkip(f) ((f) == SKIP_FLAG)
55
56 extern bool flagcode_isValid (flagcode p_f) /*@*/ ;
57 # define flagcode_isValid(f) ((f) != INVALID_FLAG)
58
59 extern bool flagcode_isPassThrough (/*@sef@*/ flagcode p_f);
60 # define flagcode_isPassThrough(f) ((f) == FLG_DEFINE || (f) == FLG_UNDEFINE)
61
62 extern bool flagcode_isLibraryFlag (/*@sef@*/ flagcode p_f);
63 # define flagcode_isLibraryFlag(f) \
64    ((f) == FLG_POSIXLIB || (f) == FLG_POSIXSTRICTLIB \
65     || (f) == FLG_UNIXLIB || (f) == FLG_UNIXSTRICTLIB \
66     || (f) == FLG_STRICTLIB || (f) == FLG_NOLIB \
67     || (f) == FLG_ANSILIB)
68
69 extern bool flagcode_isWarnUseFlag (/*@sef@*/ flagcode p_f);
70 # define flagcode_isWarnUseFlag(f) \
71    ((f) == FLG_BUFFEROVERFLOW || (f) == FLG_BUFFEROVERFLOWHIGH)
72
73 extern bool flagcode_hasValue (flagcode p_f);
74 extern bool flagcode_hasString (flagcode p_f);
75 extern bool flagcode_hasArgument (flagcode p_f);
76
77 /*@constant observer cstring DEFAULT_MODE;@*/
78 # define DEFAULT_MODE (cstring_makeLiteralTemp ("standard"))
79
80 extern void flags_initMod (void);
81
82 extern bool isMode (cstring p_s);
83 extern /*@only@*/ cstring describeModes (void);
84 extern void summarizeErrors (void);
85
86 extern bool flagcode_isNameChecksFlag (flagcode p_f);
87 extern bool flagcode_isIdemFlag (flagcode p_f);
88 extern bool flagcode_isModeFlag (flagcode p_f);
89 extern bool flagcode_isSpecialFlag (flagcode p_f);
90 extern bool flagcode_isGlobalFlag (flagcode p_f);
91
92 # else
93 # error "Multiple include"
94 # endif
95
96
97
98
99
100
101
102
103
104
105
106
107
This page took 0.219942 seconds and 5 git commands to generate.