3 DECLARE_PTR_LIST(state_list
, struct sm_state
);
4 DECLARE_PTR_LIST(state_list_stack
, struct state_list
);
5 DECLARE_PTR_LIST(stree_stack
, struct AVL
);
9 struct state_list
*slist
;
11 DECLARE_ALLOCATOR(named_slist
);
12 DECLARE_PTR_LIST(named_stack
, struct named_slist
);
18 DECLARE_ALLOCATOR(named_stree
);
19 DECLARE_PTR_LIST(named_stree_stack
, struct named_stree
);
22 extern struct state_list_stack
*implied_pools
;
23 extern int __slist_id
;
25 char *show_sm(struct sm_state
*sm
);
26 void __print_slist(struct state_list
*slist
);
27 void __print_stree(struct AVL
*stree
);
28 void add_history(struct sm_state
*sm
);
29 int cmp_tracker(const struct sm_state
*a
, const struct sm_state
*b
);
30 char *alloc_sname(const char *str
);
32 void free_every_single_sm_state(void);
33 struct sm_state
*clone_sm(struct sm_state
*s
);
34 int is_merged(struct sm_state
*sm
);
35 int is_implied(struct sm_state
*sm
);
36 struct state_list
*clone_slist(struct state_list
*from_slist
);
37 struct state_list_stack
*clone_stack(struct state_list_stack
*from_stack
);
39 int slist_has_state(struct state_list
*slist
, struct smatch_state
*state
);
40 struct smatch_state
*merge_states(int owner
, const char *name
,
42 struct smatch_state
*state1
,
43 struct smatch_state
*state2
);
45 int too_many_possible(struct sm_state
*sm
);
46 struct sm_state
*merge_sm_states(struct sm_state
*one
, struct sm_state
*two
);
47 struct smatch_state
*get_state_slist(struct state_list
*slist
, int owner
, const char *name
,
49 struct smatch_state
*get_state_stree(struct AVL
*stree
, int owner
, const char *name
,
52 struct sm_state
*get_sm_state_slist(struct state_list
*slist
, int owner
, const char *name
,
54 struct sm_state
*get_sm_state_stree(struct AVL
*stree
, int owner
, const char *name
,
57 void overwrite_sm_state(struct state_list
**slist
, struct sm_state
*sm
);
58 void overwrite_sm_state_stree(struct AVL
**stree
, struct sm_state
*sm
);
59 void overwrite_sm_state_stack(struct state_list_stack
**stack
, struct sm_state
*sm
);
60 struct sm_state
*set_state_slist(struct state_list
**slist
, int owner
, const char *name
,
61 struct symbol
*sym
, struct smatch_state
*state
);
62 struct sm_state
*set_state_stree(struct AVL
**stree
, int owner
, const char *name
,
63 struct symbol
*sym
, struct smatch_state
*state
);
65 void delete_state_slist(struct state_list
**slist
, int owner
, const char *name
,
67 void delete_state_stree(struct AVL
**stree
, int owner
, const char *name
,
70 void delete_state_stack(struct state_list_stack
**stack
, int owner
, const char *name
,
72 void delete_state_stree_stack(struct stree_stack
**stack
, int owner
, const char *name
,
75 void push_slist(struct state_list_stack
**list_stack
, struct state_list
*slist
);
76 void push_stree(struct stree_stack
**list_stack
, struct AVL
*stree
);
78 struct state_list
*pop_slist(struct state_list_stack
**list_stack
);
79 struct AVL
*pop_stree(struct stree_stack
**list_stack
);
81 void free_slist(struct state_list
**slist
);
82 void free_stree(struct AVL
**stree
);
83 void free_stack(struct state_list_stack
**stack
);
84 void free_stree_stack(struct stree_stack
**stack
);
85 void free_stack_and_slists(struct state_list_stack
**slist_stack
);
86 void free_stack_and_strees(struct stree_stack
**stree_stack
);
88 struct sm_state
*set_state_stack(struct state_list_stack
**stack
, int owner
, const char *name
,
89 struct symbol
*sym
, struct smatch_state
*state
);
90 struct sm_state
*set_state_stree_stack(struct stree_stack
**stack
, int owner
, const char *name
,
91 struct symbol
*sym
, struct smatch_state
*state
);
93 struct smatch_state
*get_state_stack(struct state_list_stack
*stack
, int owner
,
94 const char *name
, struct symbol
*sym
);
95 struct smatch_state
*get_state_stree_stack(struct stree_stack
*stack
, int owner
,
96 const char *name
, struct symbol
*sym
);
98 int out_of_memory(void);
99 int low_on_memory(void);
100 void merge_slist(struct state_list
**to
, struct state_list
*slist
);
101 void merge_stree(struct AVL
**to
, struct AVL
*stree
);
102 void filter_slist(struct state_list
**slist
, struct state_list
*filter
);
103 void filter_stree(struct AVL
**stree
, struct AVL
*filter
);
104 void and_slist_stack(struct state_list_stack
**slist_stack
);
105 void and_stree_stack(struct stree_stack
**stree_stack
);
107 void or_slist_stack(struct state_list_stack
**pre_conds
,
108 struct state_list
*cur_slist
,
109 struct state_list_stack
**slist_stack
);
110 void or_stree_stack(struct stree_stack
**pre_conds
,
111 struct AVL
*cur_stree
,
112 struct stree_stack
**stack
);
114 struct state_list
**get_slist_from_named_stack(struct named_stack
*stack
,
117 struct state_list
**get_stree_from_named_stack(struct named_stree_stack
*stack
,
120 void overwrite_slist(struct state_list
*from
, struct state_list
**to
);
121 void overwrite_stree(struct AVL
*from
, struct AVL
**to
);
123 /* add stuff smatch_returns.c here */
125 void all_return_states_hook(void (*callback
)(struct state_list
*slist
));
126 void all_return_states_hook_stree(void (*callback
)(struct AVL
*slist
));
128 int get_slist_id(struct state_list
*slist
);
129 int get_stree_id(struct AVL
*slist
);
131 struct state_list
*stree_to_slist(struct AVL
*stree
);
132 struct AVL
*slist_to_stree(struct state_list
*stree
);