2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2000.
3 ** See ../LICENSE for license information.
5 # ifndef constraintLIST_H
6 # define constraintLIST_H
8 typedef /*@only@*/ /*@notnull@*/ constraint o_constraint
;
10 struct s_constraintList
14 /*@reldef@*/ /*@relnull@*/ o_constraint
*elements
;
17 /*@constant null constraintList constraintList_undefined;@*/
19 # define constraintList_undefined ((constraintList)NULL)
21 extern /*@falsewhennull@*/ bool constraintList_isDefined (constraintList p_e
) /*@*/ ;
22 extern /*@unused@*/ /*@nullwhentrue@*/ bool constraintList_isUndefined (constraintList p_e
) /*@*/ ;
23 extern /*@nullwhentrue@*/ /*@unused@*/ bool constraintList_isError (constraintList p_e
) /*@*/ ;
25 # define constraintList_isDefined(e) ((e) != constraintList_undefined)
26 # define constraintList_isUndefined(e) ((e) == constraintList_undefined)
27 # define constraintList_isError(e) ((e) == constraintList_undefined)
29 extern bool constraintList_isEmpty (/*@sef@*/ constraintList p_e
) /*@*/;
31 # define constraintList_isEmpty(e) ((constraintList_isUndefined((e)) ) ||(( (e)->nelements == 0) ) )
33 extern constraintList
constraintList_single (/*@only@*/ constraint
) ;
35 extern constraintList
constraintList_addListFree (/*@returned@*/ constraintList
, /*@only@*/ constraintList
) ;
36 extern constraintList
constraintList_preserveCallInfo (/*@returned@*/ constraintList p_c
, /*@observer@*/ /*@dependent@*/ exprNode p_fcn
) ;
38 /*@iter constraintList_elements (sef constraintList x, yield exposed constraint el); @*/
39 # define constraintList_elements(x, m_el) \
40 { if (constraintList_isDefined (x)) { int m_ind; constraint *m_elements = &((x)->elements[0]); \
41 for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \
42 { constraint m_el = *(m_elements++);
44 # define end_constraintList_elements }}}
46 extern /*@only@*/ constraintList
constraintList_makeNew(void) /*@*/;
47 extern constraintList
constraintList_add (/*@returned@*/ constraintList p_s
, /*@only@*/ constraint p_el
) /*@modifies p_s@*/ ;
49 extern /*@only@*/ constraintList
constraintList_addList (/*@only@*/ /*@returned@*/ constraintList p_s
, /*@observer@*/ /*@temp@*/ constraintList p_newList
) /*@modifies p_s@*/ ;
52 extern constraintList
constraintList_copy ( /*@observer@*/ /*@temp@*/ constraintList p_s
) /*@*/ ;
55 extern void constraintList_free (/*@only@*/ constraintList p_s
) ;
58 extern /*@only@*/ cstring
constraintList_unparse (/*@observer@*/ constraintList p_s
) /*@*/;
60 extern cstring
constraintList_unparseDetailed (/*@observer@*/ constraintList p_s
) /*@*/;
62 extern /*@only@*/ constraintList
63 constraintList_logicalOr ( /*@observer@*/ constraintList p_l1
, /*@observer@*/ constraintList p_l2
);
65 extern constraintList
constraintList_preserveOrig (/*@returned@*/ constraintList p_c
);
67 /*@constant int constraintListBASESIZE;@*/
69 # define constraintListBASESIZE SMALLBASESIZE
71 extern constraintList
constraintList_togglePost (/*@returned@*/ constraintList p_c
) /*@modifies p_c@*/;
73 extern /*@only@*/ constraintList
constraintList_doSRefFixConstraintParam ( /*@only@*/ constraintList p_preconditions
, /*@observer@*/ /*@temp@*/ exprNodeList p_arglist
) /*@modifies p_preconditions@*/;
75 /*@only@*/ constraintList
constraintList_doFixResult ( /*@only@*/ constraintList p_postconditions
, /*@observer@*/ /*@dependent@*/ exprNode p_fcnCall
) /*@modifies p_postconditions@*/;
77 extern constraintList
constraintList_addGeneratingExpr (/*@returned@*/ constraintList p_c
, /*@dependent@*/ /*@observer@*/ exprNode p_e
) /*@modifies p_c@*/;
78 extern /*@only@*/ constraintList
constraintList_makeFixedArrayConstraints ( /*@observer@*/ sRefSet p_s
) ;
79 extern void constraintList_printErrorPostConditions (constraintList p_s
, fileloc p_loc
) ;
80 extern void constraintList_printError (constraintList p_s
, /*@observer@*/ fileloc p_loc
) ;
82 extern constraintList
constraintList_sort (/*@returned@*/ constraintList p_ret
)
83 /*@modifies p_ret@*/ ;
85 extern void constraintList_dump (/*@observer@*/ constraintList p_c
, FILE * p_f
);
87 /*@only@*/ constraintList
constraintList_undump (FILE * p_f
);
88 /*@only@*/ constraintList
constraintList_removeSurpressed (/*@only@*/ constraintList p_s
);
90 /*drl 1/6/2001: I didn't think these functions were solid enough to include in the stable release of splint.*/
91 /*drl added 12/30/01 */
92 /* / *@only@* / constraintList constraintList_doSRefFixStructConstraint(constraintList p_invars, sRef p_s, ctype p_ct ); */
95 # error "Multiple include"