~ubuntu-branches/ubuntu/saucy/ladr/saucy

« back to all changes in this revision

Viewing changes to ladr/glist.h.bak

  • Committer: Package Import Robot
  • Author(s): Frank Lichtenheld
  • Date: 2013-05-25 11:43:32 UTC
  • mfrom: (5.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20130525114332-lkzco1dti2hwrf7v
Tags: 0.0.200911a-2
* QA upload.
* Upload to unstable.
* Change maintainer to QA group.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  Copyright (C) 2006, 2007 William McCune
2
 
 
3
 
    This file is part of the LADR Deduction Library.
4
 
 
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,
7
 
    version 2.
8
 
 
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.
13
 
 
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.
17
 
*/
18
 
 
19
 
#ifndef TP_GLIST_H
20
 
#define TP_GLIST_H
21
 
 
22
 
#include "order.h"
23
 
#include "string.h"
24
 
 
25
 
/* INTRODUCTION
26
 
This package handles
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).
31
 
*/
32
 
 
33
 
/* Public definitions */
34
 
 
35
 
typedef struct plist * Plist;
36
 
 
37
 
struct plist {
38
 
  void *v;
39
 
  Plist next;
40
 
};
41
 
 
42
 
typedef struct ilist * Ilist;
43
 
 
44
 
struct ilist {
45
 
  int i;
46
 
  Ilist next;
47
 
};
48
 
 
49
 
typedef struct i2list * I2list;
50
 
 
51
 
struct i2list {
52
 
  int i;
53
 
  int j;
54
 
  I2list next;
55
 
};
56
 
 
57
 
typedef struct i3list * I3list;
58
 
 
59
 
struct i3list {
60
 
  int i;
61
 
  int j;
62
 
  int k;
63
 
  I3list next;
64
 
};
65
 
 
66
 
/* End of public definitions */
67
 
 
68
 
/* Public function prototypes from glist.c */
69
 
 
70
 
Ilist get_ilist(void);
71
 
 
72
 
void free_ilist(Ilist p);
73
 
 
74
 
Plist get_plist(void);
75
 
 
76
 
void free_plist(Plist p);
77
 
 
78
 
I2list get_i2list(void);
79
 
 
80
 
void free_i2list(I2list p);
81
 
 
82
 
I3list get_i3list(void);
83
 
 
84
 
void free_i3list(I3list p);
85
 
 
86
 
void fprint_glist_mem(FILE *fp, BOOL heading);
87
 
 
88
 
void p_glist_mem();
89
 
 
90
 
Plist plist_cat(Plist p1, Plist p2);
91
 
 
92
 
Plist plist_cat2(Plist p1, Plist p2);
93
 
 
94
 
Plist plist_pop(Plist p);
95
 
 
96
 
int plist_count(Plist p);
97
 
 
98
 
Plist reverse_plist(Plist p);
99
 
 
100
 
Plist copy_plist(Plist p);
101
 
 
102
 
void zap_plist(Plist p);
103
 
 
104
 
Plist plist_append(Plist lst, void *v);
105
 
 
106
 
Plist plist_prepend(Plist lst, void *v);
107
 
 
108
 
BOOL plist_member(Plist lst, void *v);
109
 
 
110
 
Plist plist_subtract(Plist p1, Plist p2);
111
 
 
112
 
BOOL plist_subset(Plist a, Plist b);
113
 
 
114
 
Plist plist_remove(Plist p, void *v);
115
 
 
116
 
Plist plist_remove_string(Plist p, char *s);
117
 
 
118
 
Plist sort_plist(Plist objects, Ordertype (*comp_proc) (void *, void *));
119
 
 
120
 
Plist plist_remove_last(Plist p);
121
 
 
122
 
int position_of_string_in_plist(char *s, Plist p);
123
 
 
124
 
BOOL string_member_plist(char *s, Plist p);
125
 
 
126
 
int longest_string_in_plist(Plist p);
127
 
 
128
 
void *ith_in_plist(Plist p, int i);
129
 
 
130
 
void *plist_last(Plist p);
131
 
 
132
 
Ilist ilist_cat(Ilist p1, Ilist p2);
133
 
 
134
 
Ilist ilist_cat2(Ilist p1, Ilist p2);
135
 
 
136
 
Ilist ilist_pop(Ilist p);
137
 
 
138
 
int ilist_count(Ilist p);
139
 
 
140
 
Ilist reverse_ilist(Ilist p);
141
 
 
142
 
Ilist copy_ilist(Ilist p);
143
 
 
144
 
void zap_ilist(Ilist p);
145
 
 
146
 
Ilist ilist_append(Ilist lst, int i);
147
 
 
148
 
Ilist ilist_prepend(Ilist lst, int i);
149
 
 
150
 
Ilist ilist_last(Ilist lst);
151
 
 
152
 
BOOL ilist_member(Ilist lst, int i);
153
 
 
154
 
Ilist ilist_subtract(Ilist p1, Ilist p2);
155
 
 
156
 
Ilist ilist_removeall(Ilist p, int i);
157
 
 
158
 
Ilist ilist_intersect(Ilist a, Ilist b);
159
 
 
160
 
Ilist ilist_union(Ilist a, Ilist b);
161
 
 
162
 
Ilist ilist_set(Ilist m);
163
 
 
164
 
Ilist ilist_rem_dups(Ilist m);
165
 
 
166
 
BOOL ilist_is_set(Ilist a);
167
 
 
168
 
BOOL ilist_subset(Ilist a, Ilist b);
169
 
 
170
 
void fprint_ilist(FILE *fp, Ilist p);
171
 
 
172
 
void p_ilist(Ilist p);
173
 
 
174
 
Ilist ilist_copy(Ilist p);
175
 
 
176
 
Ilist ilist_remove_last(Ilist p);
177
 
 
178
 
int ilist_occurrences(Ilist p, int i);
179
 
 
180
 
Ilist ilist_insert_up(Ilist p, int i);
181
 
 
182
 
int position_in_ilist(int i, Ilist p);
183
 
 
184
 
void zap_i2list(I2list p);
185
 
 
186
 
I2list i2list_append(I2list lst, int i, int j);
187
 
 
188
 
I2list i2list_prepend(I2list lst, int i, int j);
189
 
 
190
 
I2list i2list_removeall(I2list p, int i);
191
 
 
192
 
I2list i2list_member(I2list lst, int i);
193
 
 
194
 
void p_i2list(I2list p);
195
 
 
196
 
int i2list_count(I2list p);
197
 
 
198
 
BOOL i3list_member(I3list lst, int i, int j, int k);
199
 
 
200
 
I3list i3list_append(I3list lst, int i, int j, int k);
201
 
 
202
 
I3list i3list_prepend(I3list lst, int i, int j, int k);
203
 
 
204
 
void zap_i3list(I3list p);
205
 
 
206
 
I3list reverse_i3list(I3list p);
207
 
 
208
 
I3list copy_i3list(I3list p);
209
 
 
210
 
int i3list_count(I3list p);
211
 
 
212
 
I2list alist_insert(I2list p, int key, int val);
213
 
 
214
 
int assoc(I2list p, int key);
215
 
 
216
 
I3list alist2_insert(I3list p, int key, int a, int b);
217
 
 
218
 
int assoc2a(I3list p, int key);
219
 
 
220
 
int assoc2b(I3list p, int key);
221
 
 
222
 
I3list alist2_remove(I3list p, int key);
223
 
 
224
 
BOOL i2list_multimember(I2list b, int i, int n);
225
 
 
226
 
BOOL i2list_multisubset(I2list a, I2list b);
227
 
 
228
 
I2list multiset_add_n(I2list a, int i, int n);
229
 
 
230
 
I2list multiset_add(I2list a, int i);
231
 
 
232
 
I2list multiset_union(I2list a, I2list b);
233
 
 
234
 
Ilist multiset_to_set(I2list m);
235
 
 
236
 
int multiset_occurrences(I2list m, int i);
237
 
 
238
 
#endif  /* conditional compilation of whole file */