]> andersk Git - splint.git/blame - src/Headers/flags.h
Added the code for setBufferSize and setStringLegnth annotations.
[splint.git] / src / Headers / flags.h
CommitLineData
885824d3 1/*
1ac6313d 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.
885824d3 6**
1ac6313d 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).
885824d3 18*/
19# ifndef FLAGS_H
20# define FLAGS_H
21
22
23typedef 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,
1ac6313d 31 FK_NULL, FK_NT, FK_OPS, FK_PRED, FK_PREPROC, FK_SECRET,
885824d3 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
40extern void listAllCategories (void);
41extern void printAlphaFlags (void);
42extern void printAllFlags (bool p_desc, bool p_full);
43
44extern void flagcode_recordError (flagcode p_f);
45extern void flagcode_recordSuppressed (flagcode p_f);
46extern int flagcode_numReported (flagcode p_f);
47extern bool flagcode_isNamePrefixFlag (flagcode p_f);
48
49extern /*@only@*/ cstring describeFlag (cstring p_flagname);
50extern flagcode identifyFlag (cstring p_s);
51extern void setValueFlag (flagcode p_opt, cstring p_arg);
52extern void setStringFlag (flagcode p_opt, /*@only@*/ cstring p_arg);
53
54extern /*@observer@*/ cstring flagcode_name (flagcode p_code) /*@*/ ;
55extern int flagcode_valueIndex (flagcode p_f) /*@*/ ;
56extern int flagcode_stringIndex (flagcode p_f) /*@*/ ;
57extern /*@observer@*/ cstring flagcode_unparse (flagcode p_f) /*@*/ ;
58# define flagcode_unparse flagcode_name
59
60extern /*@observer@*/ cstring flagcodeHint (flagcode p_f);
61
62extern flagkind identifyCategory (cstring p_s) /*@*/ ;
63extern void printCategory (flagkind p_kind) /*@modifies g_msgstream@*/ ;
64
65extern bool flagcode_isInvalid (flagcode p_f);
66# define flagcode_isInvalid(f) ((f) == INVALID_FLAG)
67
68extern bool flagcode_isSkip (flagcode p_f);
69# define flagcode_isSkip(f) ((f) == SKIP_FLAG)
70
71extern bool flagcode_isValid (flagcode p_f);
72# define flagcode_isValid(f) ((f) != INVALID_FLAG)
73
74extern bool flagcode_isPassThrough (/*@sef@*/ flagcode p_f);
75# define flagcode_isPassThrough(f) ((f) == FLG_DEFINE || (f) == FLG_UNDEFINE)
76
77extern 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
84extern bool flagcode_hasValue (flagcode p_f);
85extern bool flagcode_hasString (flagcode p_f);
86extern bool flagcode_hasArgument (flagcode p_f);
87
88/*@constant observer cstring DEFAULT_MODE;@*/
89# define DEFAULT_MODE (cstring_makeLiteralTemp ("standard"))
90
91extern void flags_initMod (void);
92
93extern bool isMode (cstring p_s);
94extern /*@only@*/ cstring describeModes (void);
95extern void summarizeErrors (void);
96
97extern bool flagcode_isNameChecksFlag (flagcode p_f);
98extern bool flagcode_isIdemFlag (flagcode p_f);
99extern bool flagcode_isModeFlag (flagcode p_f);
100extern bool flagcode_isSpecialFlag (flagcode p_f);
101extern 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.070069 seconds and 5 git commands to generate.