]> andersk Git - splint.git/blob - src/Headers/metaStateInfo.h
*** empty log message ***
[splint.git] / src / Headers / metaStateInfo.h
1 /*
2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
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 default_ref;
34   int default_parameter;
35   int default_result;
36
37   /* context */
38   mtContextNode context;
39 } ;
40
41 /* in forwardTypes: abst_typedef null struct _metaStateInfo *metaStateInfo; */
42
43 /*@constant null metaStateInfo metaStateInfo_undefined; @*/
44 # define metaStateInfo_undefined    ((metaStateInfo) NULL)
45
46 extern /*@falsenull@*/ bool metaStateInfo_isDefined (metaStateInfo) /*@*/ ;
47 # define metaStateInfo_isDefined(p_info) ((p_info) != NULL)
48
49 extern /*@truenull@*/ bool metaStateInfo_isUndefined (metaStateInfo) /*@*/ ;
50 # define metaStateInfo_isUndefined(p_info) ((p_info) == NULL)
51
52 extern /*@notnull@*/ metaStateInfo 
53 metaStateInfo_create (/*@only@*/ cstring p_name,
54                       /*@only@*/ cstringList p_valueNames,
55                       /*@only@*/ mtContextNode p_context,
56                       /*@only@*/ stateCombinationTable p_sctable,
57                       /*@only@*/ stateCombinationTable p_mergetable,
58                       /*@only@*/ fileloc p_loc) ;
59
60 extern bool metaStateInfo_equal (metaStateInfo p_m1, metaStateInfo p_m2) /*@*/ ;
61 # define metaStateInfo_equal(m1,m2) ((m1) == (m2))
62
63 extern void metaStateInfo_setDefaultRefValue (metaStateInfo p_info, int p_val) 
64      /*@modifies p_info@*/ ;
65
66 extern void metaStateInfo_setDefaultParamValue (metaStateInfo p_info, int p_val) 
67      /*@modifies p_info@*/ ;
68
69 extern void metaStateInfo_setDefaultResultValue (metaStateInfo p_info, int p_val) 
70      /*@modifies p_info@*/ ;
71
72 extern int metaStateInfo_getDefaultValue (metaStateInfo p_info, sRef p_s) /*@*/ ;
73
74 extern int metaStateInfo_getDefaultRefValue (metaStateInfo p_info) /*@*/ ;
75 extern int metaStateInfo_getDefaultParamValue (metaStateInfo p_info) /*@*/ ;
76 extern int metaStateInfo_getDefaultResultValue (metaStateInfo p_info) /*@*/ ;
77 extern int metaStateInfo_getDefaultGlobalValue (metaStateInfo p_info) /*@*/ ;
78
79 extern /*@observer@*/ mtContextNode metaStateInfo_getContext (metaStateInfo p_info) /*@*/ ;
80 extern /*@observer@*/ cstring metaStateInfo_getName (metaStateInfo p_info) /*@*/ ;
81 extern /*@observer@*/ fileloc metaStateInfo_getLoc (metaStateInfo p_info) /*@*/ ;
82
83 extern /*@exposed@*/ stateCombinationTable metaStateInfo_getTransferTable (metaStateInfo p_info) /*@*/ ;
84
85 extern /*@exposed@*/ stateCombinationTable metaStateInfo_getMergeTable (metaStateInfo p_info) /*@*/ ;
86
87 extern /*@only@*/ cstring metaStateInfo_unparse (metaStateInfo p_info) /*@*/ ;
88
89 extern /*@observer@*/ cstring metaStateInfo_unparseValue (metaStateInfo p_info, int p_value) /*@*/ ;
90
91 extern void metaStateInfo_free (/*@only@*/ metaStateInfo) ;
92
93 # else
94 # error "Multiple include"
95 # endif 
96
97
98
99
This page took 0.040346 seconds and 5 git commands to generate.