]> andersk Git - splint.git/blame - src/Headers/multiVal.h
Updating to use the LEnsures and LRequires instead of the ensures requires so
[splint.git] / src / Headers / multiVal.h
CommitLineData
885824d3 1/*
2** multiVal.h
3*/
4
5# ifndef MULTIVAL_H
6# define MULTIVAL_H
7
8typedef enum { MVLONG, MVCHAR, MVDOUBLE, MVSTRING } mvkind;
9
10typedef /*@null@*/ struct _multiVal
11{
12 mvkind kind;
13 union _mval
14 {
15 long int ival;
16 char cval;
17 double fval;
18 /*@only@*/ cstring sval;
19 } value;
470b7798 20
885824d3 21} *multiVal;
22
23extern /*@falsenull@*/ bool multiVal_isDefined (multiVal p_m) /*@*/ ;
24extern /*@truenull@*/ bool multiVal_isUndefined (multiVal p_m) /*@*/ ;
25extern /*@truenull@*/ bool multiVal_isUnknown (multiVal p_m) /*@*/ ;
26
27/*@constant null multiVal multiVal_undefined; @*/
28# define multiVal_undefined (multiVal)NULL
29# define multiVal_isDefined(m) ((m) != multiVal_undefined)
30# define multiVal_isUndefined(m) ((m) == multiVal_undefined)
31# define multiVal_isUnknown(m) ((m) == multiVal_undefined)
32
33extern /*@observer@*/ /*@dependent@*/ cstring multiVal_forceString (multiVal p_m) /*@*/ ;
34extern /*@unused@*/ double multiVal_forceDouble (multiVal p_m) /*@*/ ;
35extern char multiVal_forceChar (multiVal p_m) /*@*/ ;
36extern long multiVal_forceInt (multiVal p_m) /*@*/ ;
37
38extern /*@only@*/ multiVal multiVal_makeString (/*@only@*/ cstring p_s) /*@*/ ;
39extern /*@only@*/ multiVal multiVal_makeDouble (double p_x) /*@*/ ;
40extern /*@only@*/ multiVal multiVal_makeChar (char p_x) /*@*/ ;
41extern /*@only@*/ multiVal multiVal_makeInt (long p_x) /*@*/ ;
42extern /*@only@*/ multiVal multiVal_unknown (void) /*@*/ ;
43
44extern /*@only@*/ multiVal multiVal_copy (multiVal p_m) /*@*/ ;
45extern void multiVal_free (/*@only@*/ multiVal p_m);
46
47extern multiVal multiVal_invert (multiVal p_m) /*@*/ ;
48
49extern /*@falsenull@*/ bool multiVal_isInt (multiVal p_m) /*@*/ ;
50extern /*@falsenull@*/ bool multiVal_isChar (multiVal p_m) /*@*/ ;
51extern /*@falsenull@*/ bool multiVal_isDouble (multiVal p_m) /*@*/ ;
52extern /*@falsenull@*/ bool multiVal_isString (multiVal p_m) /*@*/ ;
53
54extern /*@only@*/ multiVal multiVal_undump (char **p_s) /*@modifies *p_s;@*/ ;
55extern /*@only@*/ cstring multiVal_dump (multiVal p_m) /*@*/ ;
56
57extern /*@only@*/ cstring multiVal_unparse (multiVal p_m) /*@*/ ;
58extern int multiVal_compare (multiVal p_m1, multiVal p_m2) /*@*/ ;
59
60extern bool multiVal_equiv (multiVal p_m1, multiVal p_m2) /*@*/ ;
61# define multiVal_equiv(m1,m2) ((multiVal_compare(m1, m2)) == 0)
62
63# else
64# error "Multiple include"
65# endif
This page took 0.051112 seconds and 5 git commands to generate.