]> andersk Git - splint.git/blob - src/Headers/flags.h
Commiting Merge of changes made in semester and ver 2.5M
[splint.git] / src / Headers / flags.h
1 /*
2 ** Copyright (c) Massachusetts Institute of Technology 1994-1998.
3 **          All Rights Reserved.
4 **          Unpublished rights reserved under the copyright laws of
5 **          the United States.
6 **
7 ** THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
8 ** OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
9 **
10 ** This code is distributed freely and may be used freely under the 
11 ** following conditions:
12 **
13 **     1. This notice may not be removed or altered.
14 **
15 **     2. Works derived from this code are not distributed for
16 **        commercial gain without explicit permission from MIT 
17 **        (for permission contact lclint-request@sds.lcs.mit.edu).
18 */
19 # ifndef FLAGS_H
20 # define FLAGS_H
21
22
23 typedef enum 
24 {
25   FK_ABSTRACT, FK_ANSI, FK_BEHAVIOR, 
26   FK_COMMENTS, FK_COMPLETE, FK_CONTROL, FK_DEBUG, FK_DECL,
27   FK_DEF, FK_DIRECT, FK_DISPLAY, FK_EFFECT, FK_EXPORT,
28   FK_EXPOSURE, FK_FORMAT, FK_GLOBAL, FK_GLOBALS, FK_HEADERS,
29   FK_HELP, FK_IGNORERET, FK_INIT, FK_ITER, FK_LIBS, FK_LIMITS,
30   FK_MACROS, FK_MEMORY, FK_MODIFIES, FK_NAMES, FK_NONE,
31   FK_NULL, FK_NT, FK_OPS, FK_PRED, FK_PREPROC, FK_SECRET,
32   FK_SUPPRESS, FK_SYNTAX, FK_TYPE, FK_TYPEEQ, FK_NUMBERS, 
33   FK_POINTER, FK_UNRECOG, FK_USE, FK_BOOL, FK_ALIAS, 
34   FK_PROTOS, FK_SPEC, 
35   FK_IMPLICIT, FK_FILES, FK_ERRORS, FK_UNSPEC, 
36   FK_SPEED, FK_PARAMS, FK_DEAD, 
37   FK_LEAK, FK_ARRAY, FK_OBSOLETE, FK_PREFIX
38 } flagkind;
39
40 extern void listAllCategories (void);
41 extern void printAlphaFlags (void);
42 extern void printAllFlags (bool p_desc, bool p_full);
43
44 extern void flagcode_recordError (flagcode p_f);
45 extern void flagcode_recordSuppressed (flagcode p_f);
46 extern int flagcode_numReported (flagcode p_f);
47 extern bool flagcode_isNamePrefixFlag (flagcode p_f);
48
49 extern /*@only@*/ cstring  describeFlag (cstring p_flagname);
50 extern flagcode identifyFlag (cstring p_s);
51 extern void setValueFlag (flagcode p_opt, cstring p_arg);
52 extern void setStringFlag (flagcode p_opt, /*@only@*/ cstring p_arg);
53
54 extern /*@observer@*/ cstring flagcode_name (flagcode p_code) /*@*/ ;
55 extern int flagcode_valueIndex (flagcode p_f) /*@*/ ;
56 extern int flagcode_stringIndex (flagcode p_f) /*@*/ ;
57 extern /*@observer@*/ cstring flagcode_unparse (flagcode p_f) /*@*/ ;
58 # define flagcode_unparse flagcode_name
59
60 extern /*@observer@*/ cstring flagcodeHint (flagcode p_f);
61
62 extern flagkind identifyCategory (cstring p_s) /*@*/ ;
63 extern void printCategory (flagkind p_kind) /*@modifies g_msgstream@*/ ;
64
65 extern bool flagcode_isInvalid (flagcode p_f);
66 # define flagcode_isInvalid(f) ((f) == INVALID_FLAG)
67
68 extern bool flagcode_isSkip (flagcode p_f);
69 # define flagcode_isSkip(f) ((f) == SKIP_FLAG)
70
71 extern bool flagcode_isValid (flagcode p_f);
72 # define flagcode_isValid(f) ((f) != INVALID_FLAG)
73
74 extern bool flagcode_isPassThrough (/*@sef@*/ flagcode p_f);
75 # define flagcode_isPassThrough(f) ((f) == FLG_DEFINE || (f) == FLG_UNDEFINE)
76
77 extern bool flagcode_isLibraryFlag (/*@sef@*/ flagcode p_f);
78 # define flagcode_isLibraryFlag(f) \
79    ((f) == FLG_POSIXLIB || (f) == FLG_POSIXSTRICTLIB \
80     || (f) == FLG_UNIXLIB || (f) == FLG_UNIXSTRICTLIB \
81     || (f) == FLG_STRICTLIB || (f) == FLG_NOLIB \
82     || (f) == FLG_ANSILIB)
83
84 extern bool flagcode_hasValue (flagcode p_f);
85 extern bool flagcode_hasString (flagcode p_f);
86 extern bool flagcode_hasArgument (flagcode p_f);
87
88 /*@constant observer cstring DEFAULT_MODE;@*/
89 # define DEFAULT_MODE (cstring_makeLiteralTemp ("standard"))
90
91 extern void flags_initMod (void);
92
93 extern bool isMode (cstring p_s);
94 extern /*@only@*/ cstring describeModes (void);
95 extern void summarizeErrors (void);
96
97 extern bool flagcode_isNameChecksFlag (flagcode p_f);
98 extern bool flagcode_isIdemFlag (flagcode p_f);
99 extern bool flagcode_isModeFlag (flagcode p_f);
100 extern bool flagcode_isSpecialFlag (flagcode p_f);
101 extern bool flagcode_isGlobalFlag (flagcode p_f);
102
103 # else
104 # error "Multiple include"
105 # endif
106
107
108
109
110
111
112
113
114
115
116
117
118
This page took 0.053677 seconds and 5 git commands to generate.