]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | /* |
28bf4b0b | 2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001. |
a0a162cd | 3 | ** See ../LICENSE for license information. |
885824d3 | 4 | ** |
5 | */ | |
6 | # ifndef FLAGS_H | |
7 | # define FLAGS_H | |
8 | ||
9 | ||
10 | typedef enum | |
11 | { | |
bb7c2085 | 12 | FK_ABSTRACT, FK_ANSI, FK_BEHAVIOR, FK_BOUNDS, |
885824d3 | 13 | FK_COMMENTS, FK_COMPLETE, FK_CONTROL, FK_DEBUG, FK_DECL, |
bb7c2085 | 14 | FK_SYNCOMMENTS, FK_HINTS, FK_SYSTEMFUNCTIONS, FK_ITS4, |
885824d3 | 15 | FK_DEF, FK_DIRECT, FK_DISPLAY, FK_EFFECT, FK_EXPORT, |
bb7c2085 | 16 | FK_EXPOSURE, |
17 | FK_EXTENSIBLE, | |
18 | FK_FORMAT, FK_GLOBAL, FK_GLOBALS, FK_HEADERS, | |
885824d3 | 19 | FK_HELP, FK_IGNORERET, FK_INIT, FK_ITER, FK_LIBS, FK_LIMITS, |
20 | FK_MACROS, FK_MEMORY, FK_MODIFIES, FK_NAMES, FK_NONE, | |
bb7c2085 | 21 | FK_NULL, FK_OPS, FK_PRED, FK_PREPROC, FK_SECRET, |
885824d3 | 22 | FK_SUPPRESS, FK_SYNTAX, FK_TYPE, FK_TYPEEQ, FK_NUMBERS, |
23 | FK_POINTER, FK_UNRECOG, FK_USE, FK_BOOL, FK_ALIAS, | |
24 | FK_PROTOS, FK_SPEC, | |
25 | FK_IMPLICIT, FK_FILES, FK_ERRORS, FK_UNSPEC, | |
28bf4b0b | 26 | FK_SPEED, FK_PARAMS, FK_DEAD, FK_SECURITY, |
27 | FK_LEAK, FK_ARRAY, FK_OBSOLETE, FK_PREFIX, FK_WARNUSE | |
885824d3 | 28 | } flagkind; |
29 | ||
30 | extern void listAllCategories (void); | |
31 | extern void printAlphaFlags (void); | |
32 | extern void printAllFlags (bool p_desc, bool p_full); | |
45569d72 | 33 | extern void printFlagManual (bool p_html); |
885824d3 | 34 | |
35 | extern void flagcode_recordError (flagcode p_f); | |
36 | extern void flagcode_recordSuppressed (flagcode p_f); | |
37 | extern int flagcode_numReported (flagcode p_f); | |
38 | extern bool flagcode_isNamePrefixFlag (flagcode p_f); | |
39 | ||
40 | extern /*@only@*/ cstring describeFlag (cstring p_flagname); | |
a956d444 | 41 | |
80489f0a | 42 | extern flagcode flags_identifyFlag (cstring p_s) /*@modifies g_warningstream@*/ ; |
a956d444 | 43 | extern flagcode flags_identifyFlagQuiet (cstring p_s) /*@modifies nothing@*/ ; |
44 | ||
885824d3 | 45 | extern void setValueFlag (flagcode p_opt, cstring p_arg); |
46 | extern void setStringFlag (flagcode p_opt, /*@only@*/ cstring p_arg); | |
47 | ||
28bf4b0b | 48 | extern /*@observer@*/ cstring flagcode_unparse (flagcode p_code) /*@*/ ; |
885824d3 | 49 | extern int flagcode_valueIndex (flagcode p_f) /*@*/ ; |
50 | extern int flagcode_stringIndex (flagcode p_f) /*@*/ ; | |
885824d3 | 51 | |
abd7f895 | 52 | extern bool flagcode_equal (flagcode p_code1, flagcode p_code2) /*@*/ ; |
53 | # define flagcode_equal(c1, c2) ((c1) == (c2)) | |
54 | ||
885824d3 | 55 | extern /*@observer@*/ cstring flagcodeHint (flagcode p_f); |
56 | ||
57 | extern flagkind identifyCategory (cstring p_s) /*@*/ ; | |
80489f0a | 58 | extern void printCategory (flagkind p_kind) /*@modifies g_warningstream@*/ ; |
885824d3 | 59 | |
28bf4b0b | 60 | extern bool flagcode_isInvalid (flagcode p_f) /*@*/ ; |
885824d3 | 61 | # define flagcode_isInvalid(f) ((f) == INVALID_FLAG) |
62 | ||
28bf4b0b | 63 | extern bool flagcode_isSkip (flagcode p_f) /*@*/ ; |
885824d3 | 64 | # define flagcode_isSkip(f) ((f) == SKIP_FLAG) |
65 | ||
aa9c1601 | 66 | extern bool flagcode_isModeName (flagcode p_f) /*@*/ ; |
67 | # define flagcode_isModeName(f) ((f) == MODENAME_FLAG) | |
68 | ||
28bf4b0b | 69 | extern bool flagcode_isValid (flagcode p_f) /*@*/ ; |
885824d3 | 70 | # define flagcode_isValid(f) ((f) != INVALID_FLAG) |
71 | ||
72 | extern bool flagcode_isPassThrough (/*@sef@*/ flagcode p_f); | |
73 | # define flagcode_isPassThrough(f) ((f) == FLG_DEFINE || (f) == FLG_UNDEFINE) | |
74 | ||
75 | extern bool flagcode_isLibraryFlag (/*@sef@*/ flagcode p_f); | |
76 | # define flagcode_isLibraryFlag(f) \ | |
77 | ((f) == FLG_POSIXLIB || (f) == FLG_POSIXSTRICTLIB \ | |
78 | || (f) == FLG_UNIXLIB || (f) == FLG_UNIXSTRICTLIB \ | |
79 | || (f) == FLG_STRICTLIB || (f) == FLG_NOLIB \ | |
80 | || (f) == FLG_ANSILIB) | |
81 | ||
28bf4b0b | 82 | extern bool flagcode_isWarnUseFlag (/*@sef@*/ flagcode p_f); |
83 | # define flagcode_isWarnUseFlag(f) \ | |
84 | ((f) == FLG_BUFFEROVERFLOW || (f) == FLG_BUFFEROVERFLOWHIGH) | |
85 | ||
80489f0a | 86 | extern bool flagcode_hasNumber (flagcode p_f) /*@*/ ; |
87 | extern bool flagcode_hasChar (flagcode p_f) /*@*/ ; | |
88 | extern bool flagcode_hasString (flagcode p_f) /*@*/ ; | |
89 | extern bool flagcode_hasArgument (flagcode p_f) /*@*/ ; | |
885824d3 | 90 | |
91 | /*@constant observer cstring DEFAULT_MODE;@*/ | |
92 | # define DEFAULT_MODE (cstring_makeLiteralTemp ("standard")) | |
93 | ||
aa9c1601 | 94 | extern bool flags_isModeName (cstring p_s) /*@*/ ; |
80489f0a | 95 | extern /*@only@*/ cstring describeModes (void) /*@modifies g_messagestream@*/ ; |
96 | extern void summarizeErrors (void) /*@modifies g_messagestream@*/ ; | |
885824d3 | 97 | |
80489f0a | 98 | extern bool flagcode_isNameChecksFlag (flagcode p_f) /*@*/ ; |
99 | extern bool flagcode_isIdemFlag (flagcode p_f) /*@*/ ; | |
100 | extern bool flagcode_isModeFlag (flagcode p_f) /*@*/ ; | |
101 | extern bool flagcode_isSpecialFlag (flagcode p_f) /*@*/ ; | |
102 | extern bool flagcode_isGlobalFlag (flagcode p_f) /*@*/ ; | |
103 | extern bool flagcode_isMessageControlFlag (flagcode p_f) /*@*/ ; | |
aa9c1601 | 104 | extern bool flagcode_isHelpFlag (flagcode p_f) /*@*/ ; |
105 | ||
106 | extern void flags_initMod (void) /*@modifies internalState@*/ ; | |
107 | ||
140c27a8 | 108 | extern void |
109 | flags_processFlags (bool p_inCommandLine, | |
110 | fileIdList p_xfiles, | |
111 | fileIdList p_cfiles, | |
112 | fileIdList p_lclfiles, | |
113 | fileIdList p_mtfiles, | |
114 | cstringSList *p_passThroughArgs, | |
115 | int p_argc, /*@null@*/ char **p_argv) | |
116 | /*@requires maxRead(p_argv) >= (p_argc - 1) @*/ | |
aa9c1601 | 117 | /* returns true if normal, false if execution should exit */ ; |
118 | ||
885824d3 | 119 | # else |
120 | # error "Multiple include" | |
121 | # endif | |
122 | ||
123 | ||
124 | ||
125 | ||
126 | ||
127 | ||
128 | ||
129 | ||
130 | ||
131 | ||
132 | ||
133 | ||
134 |