1
/* Copyright (C) 2006, 2007 William McCune
3
This file is part of the LADR Deduction Library.
5
The LADR Deduction Library is free software; you can redistribute it
6
and/or modify it under the terms of the GNU General Public License,
9
The LADR Deduction Library is distributed in the hope that it will be
10
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with the LADR Deduction Library; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
27
Plist (singly-linked list of void pointers),
28
Ilist (singly-linked list of integers),
29
I2list (singly-linked list of <integer,integer> pairs),
30
I3list (singly-linked list of <integer,integer,integer> triples).
33
/* Public definitions */
35
typedef struct plist * Plist;
42
typedef struct ilist * Ilist;
49
typedef struct i2list * I2list;
57
typedef struct i3list * I3list;
66
/* End of public definitions */
68
/* Public function prototypes from glist.c */
70
Ilist get_ilist(void);
72
void free_ilist(Ilist p);
74
Plist get_plist(void);
76
void free_plist(Plist p);
78
I2list get_i2list(void);
80
void free_i2list(I2list p);
82
I3list get_i3list(void);
84
void free_i3list(I3list p);
86
void fprint_glist_mem(FILE *fp, BOOL heading);
90
Plist plist_cat(Plist p1, Plist p2);
92
Plist plist_cat2(Plist p1, Plist p2);
94
Plist plist_pop(Plist p);
96
int plist_count(Plist p);
98
Plist reverse_plist(Plist p);
100
Plist copy_plist(Plist p);
102
void zap_plist(Plist p);
104
Plist plist_append(Plist lst, void *v);
106
Plist plist_prepend(Plist lst, void *v);
108
BOOL plist_member(Plist lst, void *v);
110
Plist plist_subtract(Plist p1, Plist p2);
112
BOOL plist_subset(Plist a, Plist b);
114
Plist plist_remove(Plist p, void *v);
116
Plist plist_remove_string(Plist p, char *s);
118
Plist sort_plist(Plist objects, Ordertype (*comp_proc) (void *, void *));
120
Plist plist_remove_last(Plist p);
122
int position_of_string_in_plist(char *s, Plist p);
124
BOOL string_member_plist(char *s, Plist p);
126
int longest_string_in_plist(Plist p);
128
void *ith_in_plist(Plist p, int i);
130
void *plist_last(Plist p);
132
Ilist ilist_cat(Ilist p1, Ilist p2);
134
Ilist ilist_cat2(Ilist p1, Ilist p2);
136
Ilist ilist_pop(Ilist p);
138
int ilist_count(Ilist p);
140
Ilist reverse_ilist(Ilist p);
142
Ilist copy_ilist(Ilist p);
144
void zap_ilist(Ilist p);
146
Ilist ilist_append(Ilist lst, int i);
148
Ilist ilist_prepend(Ilist lst, int i);
150
Ilist ilist_last(Ilist lst);
152
BOOL ilist_member(Ilist lst, int i);
154
Ilist ilist_subtract(Ilist p1, Ilist p2);
156
Ilist ilist_removeall(Ilist p, int i);
158
Ilist ilist_intersect(Ilist a, Ilist b);
160
Ilist ilist_union(Ilist a, Ilist b);
162
Ilist ilist_set(Ilist m);
164
Ilist ilist_rem_dups(Ilist m);
166
BOOL ilist_is_set(Ilist a);
168
BOOL ilist_subset(Ilist a, Ilist b);
170
void fprint_ilist(FILE *fp, Ilist p);
172
void p_ilist(Ilist p);
174
Ilist ilist_copy(Ilist p);
176
Ilist ilist_remove_last(Ilist p);
178
int ilist_occurrences(Ilist p, int i);
180
Ilist ilist_insert_up(Ilist p, int i);
182
int position_in_ilist(int i, Ilist p);
184
void zap_i2list(I2list p);
186
I2list i2list_append(I2list lst, int i, int j);
188
I2list i2list_prepend(I2list lst, int i, int j);
190
I2list i2list_removeall(I2list p, int i);
192
I2list i2list_member(I2list lst, int i);
194
void p_i2list(I2list p);
196
int i2list_count(I2list p);
198
BOOL i3list_member(I3list lst, int i, int j, int k);
200
I3list i3list_append(I3list lst, int i, int j, int k);
202
I3list i3list_prepend(I3list lst, int i, int j, int k);
204
void zap_i3list(I3list p);
206
I3list reverse_i3list(I3list p);
208
I3list copy_i3list(I3list p);
210
int i3list_count(I3list p);
212
I2list alist_insert(I2list p, int key, int val);
214
int assoc(I2list p, int key);
216
I3list alist2_insert(I3list p, int key, int a, int b);
218
int assoc2a(I3list p, int key);
220
int assoc2b(I3list p, int key);
222
I3list alist2_remove(I3list p, int key);
224
BOOL i2list_multimember(I2list b, int i, int n);
226
BOOL i2list_multisubset(I2list a, I2list b);
228
I2list multiset_add_n(I2list a, int i, int n);
230
I2list multiset_add(I2list a, int i);
232
I2list multiset_union(I2list a, I2list b);
234
Ilist multiset_to_set(I2list m);
236
int multiset_occurrences(I2list m, int i);
238
#endif /* conditional compilation of whole file */