]> andersk Git - splint.git/blame - src/Headers/multiVal.h
Fixed loading of rc files, warnrc and showscan.
[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
28bf4b0b 10typedef /*@null@*/ struct
885824d3 11{
12 mvkind kind;
28bf4b0b 13 union
14 {
15 long int ival;
16 char cval;
17 double fval;
18 /*@only@*/ cstring sval;
19 } value;
885824d3 20} *multiVal;
21
22extern /*@falsenull@*/ bool multiVal_isDefined (multiVal p_m) /*@*/ ;
23extern /*@truenull@*/ bool multiVal_isUndefined (multiVal p_m) /*@*/ ;
24extern /*@truenull@*/ bool multiVal_isUnknown (multiVal p_m) /*@*/ ;
25
26/*@constant null multiVal multiVal_undefined; @*/
27# define multiVal_undefined (multiVal)NULL
28# define multiVal_isDefined(m) ((m) != multiVal_undefined)
29# define multiVal_isUndefined(m) ((m) == multiVal_undefined)
30# define multiVal_isUnknown(m) ((m) == multiVal_undefined)
31
32extern /*@observer@*/ /*@dependent@*/ cstring multiVal_forceString (multiVal p_m) /*@*/ ;
33extern /*@unused@*/ double multiVal_forceDouble (multiVal p_m) /*@*/ ;
34extern char multiVal_forceChar (multiVal p_m) /*@*/ ;
35extern long multiVal_forceInt (multiVal p_m) /*@*/ ;
36
37extern /*@only@*/ multiVal multiVal_makeString (/*@only@*/ cstring p_s) /*@*/ ;
38extern /*@only@*/ multiVal multiVal_makeDouble (double p_x) /*@*/ ;
39extern /*@only@*/ multiVal multiVal_makeChar (char p_x) /*@*/ ;
40extern /*@only@*/ multiVal multiVal_makeInt (long p_x) /*@*/ ;
41extern /*@only@*/ multiVal multiVal_unknown (void) /*@*/ ;
42
43extern /*@only@*/ multiVal multiVal_copy (multiVal p_m) /*@*/ ;
44extern void multiVal_free (/*@only@*/ multiVal p_m);
45
46extern multiVal multiVal_invert (multiVal p_m) /*@*/ ;
47
48extern /*@falsenull@*/ bool multiVal_isInt (multiVal p_m) /*@*/ ;
49extern /*@falsenull@*/ bool multiVal_isChar (multiVal p_m) /*@*/ ;
50extern /*@falsenull@*/ bool multiVal_isDouble (multiVal p_m) /*@*/ ;
51extern /*@falsenull@*/ bool multiVal_isString (multiVal p_m) /*@*/ ;
52
53extern /*@only@*/ multiVal multiVal_undump (char **p_s) /*@modifies *p_s;@*/ ;
54extern /*@only@*/ cstring multiVal_dump (multiVal p_m) /*@*/ ;
55
56extern /*@only@*/ cstring multiVal_unparse (multiVal p_m) /*@*/ ;
57extern int multiVal_compare (multiVal p_m1, multiVal p_m2) /*@*/ ;
58
59extern bool multiVal_equiv (multiVal p_m1, multiVal p_m2) /*@*/ ;
60# define multiVal_equiv(m1,m2) ((multiVal_compare(m1, m2)) == 0)
61
62# else
63# error "Multiple include"
64# endif
This page took 0.064161 seconds and 5 git commands to generate.