]> andersk Git - splint.git/blob - src/Headers/metaStateInfo.h
Updated copyrights
[splint.git] / src / Headers / metaStateInfo.h
1 /*
2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
3 ** See ../LICENSE for license information.
4 */
5 /*
6 ** metaStateInfo.h
7 **
8 ** A record that keeps information on a user-defined state including:
9 **
10 **    o A name
11 **    o State Type (what kinds of things have this state value)
12 **    o Number of values, and their mnemonics
13 **    o A combination table (stateCombinationTable) for how different states combine as l/rvalues
14 **    o Annotations (and map between annotation and value)
15 **    o Context information (where can annotations be used)
16 */
17
18 # ifndef MSINFO_H
19 # define MSINFO_H
20
21 /*@constant int metaState_error@*/
22 # define metaState_error -1
23
24 struct s_metaStateInfo {
25   /*@only@*/ cstring name;
26   fileloc loc;
27   /* metaStateKind type; */
28   cstringList valueNames;
29   stateCombinationTable sctable;
30   stateCombinationTable mergetable;
31
32   /* Default values */
33   int defaultValue [MTC_NUMCONTEXTS];
34
35   /* context */
36   mtContextNode context;
37 } ;
38
39 /* in forwardTypes: abst_typedef null struct _metaStateInfo *metaStateInfo; */
40
41 /*@constant null metaStateInfo metaStateInfo_undefined; @*/
42 # define metaStateInfo_undefined    ((metaStateInfo) NULL)
43
44 extern /*@falsewhennull@*/ bool metaStateInfo_isDefined (metaStateInfo) /*@*/ ;
45 # define metaStateInfo_isDefined(p_info) ((p_info) != NULL)
46
47 extern /*@nullwhentrue@*/ bool metaStateInfo_isUndefined (metaStateInfo) /*@*/ ;
48 # define metaStateInfo_isUndefined(p_info) ((p_info) == NULL)
49
50 extern /*@notnull@*/ metaStateInfo 
51 metaStateInfo_create (/*@only@*/ cstring p_name,
52                       /*@only@*/ cstringList p_valueNames,
53                       /*@only@*/ mtContextNode p_context,
54                       /*@only@*/ stateCombinationTable p_sctable,
55                       /*@only@*/ stateCombinationTable p_mergetable,
56                       /*@only@*/ fileloc p_loc) ;
57
58 extern bool metaStateInfo_equal (metaStateInfo p_m1, metaStateInfo p_m2) /*@*/ ;
59 # define metaStateInfo_equal(m1,m2) ((m1) == (m2))
60
61 extern int metaStateInfo_getDefaultValueContext (metaStateInfo p_info, mtContextKind p_context) /*@*/ ;
62 extern void metaStateInfo_setDefaultValueContext (metaStateInfo p_info, mtContextKind p_context, int p_val) /*@modifies p_info@*/ ;
63
64 extern void metaStateInfo_setDefaultRefValue (metaStateInfo p_info, int p_val) 
65      /*@modifies p_info@*/ ;
66
67 extern void metaStateInfo_setDefaultParamValue (metaStateInfo p_info, int p_val) 
68      /*@modifies p_info@*/ ;
69
70 extern void metaStateInfo_setDefaultResultValue (metaStateInfo p_info, int p_val) 
71      /*@modifies p_info@*/ ;
72
73 extern int metaStateInfo_getDefaultValue (metaStateInfo p_info, sRef p_s) /*@*/ ;
74
75 extern int metaStateInfo_getDefaultRefValue (metaStateInfo p_info) /*@*/ ;
76 extern int metaStateInfo_getDefaultParamValue (metaStateInfo p_info) /*@*/ ;
77 extern int metaStateInfo_getDefaultResultValue (metaStateInfo p_info) /*@*/ ;
78 extern int metaStateInfo_getDefaultGlobalValue (metaStateInfo p_info) /*@*/ ;
79
80 extern /*@observer@*/ mtContextNode metaStateInfo_getContext (metaStateInfo p_info) /*@*/ ;
81 extern /*@observer@*/ cstring metaStateInfo_getName (metaStateInfo p_info) /*@*/ ;
82 extern /*@observer@*/ fileloc metaStateInfo_getLoc (metaStateInfo p_info) /*@*/ ;
83
84 extern /*@exposed@*/ stateCombinationTable metaStateInfo_getTransferTable (metaStateInfo p_info) /*@*/ ;
85
86 extern /*@exposed@*/ stateCombinationTable metaStateInfo_getMergeTable (metaStateInfo p_info) /*@*/ ;
87
88 extern /*@only@*/ cstring metaStateInfo_unparse (metaStateInfo p_info) /*@*/ ;
89
90 extern /*@observer@*/ cstring metaStateInfo_unparseValue (metaStateInfo p_info, int p_value) /*@*/ ;
91
92 extern void metaStateInfo_free (/*@only@*/ metaStateInfo) ;
93
94 # else
95 # error "Multiple include"
96 # endif 
97
98
99
100
This page took 0.044742 seconds and 5 git commands to generate.