Wild Life: def_struct.h Source File

Wild Life 2.30

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Macros
def_struct.h
Go to the documentation of this file.
1
12 typedef long type_ptr;
13
19 // from c_life.h
20
21 typedef void *PsiTerm;
22
23 // from extern.h
24
25 /******************************* TYPES ************************************/
26
35 typedef unsigned long *GENERIC;
36 // typedef void * GENERIC;
37
43 typedef int operator;
44
49 typedef long goals;
50
51 #ifdef X11
52 typedef long Action;
53 #endif
54
55 typedef char string[STRLEN];
56 typedef struct wl_operator_data * ptr_operator_data;
57 typedef struct wl_int_list * ptr_int_list;
58 typedef struct wl_resid_list * ptr_resid_list; /* 21.9 */
59 typedef struct wl_definition * ptr_definition;
60 typedef struct wl_definition * def_type;
61 typedef struct wl_residuation * ptr_residuation;
62 typedef struct wl_psi_term * ptr_psi_term;
63 typedef struct wl_node * ptr_node;
64 typedef struct wl_pair_list * ptr_pair_list;
65 typedef struct wl_triple_list * ptr_triple_list;
66 typedef struct wl_list * ptr_list;
67 typedef struct wl_stack * ptr_stack;
68 typedef struct wl_goal * ptr_goal;
69 typedef struct wl_choice_point * ptr_choice_point;
70
71 /****************************** DATA STRUCTURES **************************/
72
73 typedef struct wl_operator_data {
74 operator type;
75 long precedence;
76 ptr_operator_data next;
77 } operator_data;
78
84 typedef struct wl_int_list {
85 GENERIC value_1;
86 ptr_int_list next;
87 } int_list;
88
94 typedef struct wl_resid_list {
95 ptr_psi_term var;
96 ptr_psi_term othervar; /* needed for its sort only */
97 ptr_resid_list next;
98 } resid_list;
99
100 typedef struct wl_hash_table * ptr_hash_table;
101
102 /************ MODULES **************/
103 /* RM: Jan 7 1993 */
104
105 struct wl_module {
106 char *module_name;
107 char *source_file;
108 ptr_int_list open_modules;
109 ptr_int_list inherited_modules;
110 ptr_hash_table symbol_table;
111 };
112
113
114 typedef struct wl_module * ptr_module;
115
116 struct wl_keyword {
117 ptr_module module;
118 char *symbol;
119 char *combined_name; /* module#symbol */
120 int public;
121 int private_feature; /* RM: Mar 11 1993 */
122 ptr_definition definition;
123 };
124
125 typedef struct wl_keyword * ptr_keyword;
126
127 /********* END MODULES *************/
128
129
130
131 /************ HASH CODED SYMBOL TABLE **************/
132 /* RM: Feb 3 1993 */
133
134 /* Hash tables for keywords */
135
136 struct wl_hash_table {
137 int size;
138 int used;
139 ptr_keyword *data;
140 };
141
142 /****************************/
143 /* Definition of a keyword. */
144 /* This includes the rules associated to the symbol and how old they are. */
145 typedef struct wl_definition {
146 long date;
147 ptr_keyword keyword; /* RM: Jan 11 1993 */
148 ptr_pair_list rule;
149 ptr_triple_list properties;
150 ptr_int_list code;
151 ptr_int_list parents;
152 ptr_int_list children;
153 def_type type_def;
154 char always_check; /* TRUE by default */
155 char protected; /* TRUE by default */
156 char evaluate_args; /* TRUE by default */
157 char already_loaded; /* Cleared at the prompt, set upon loading */
158 ptr_operator_data op_data;
159 ptr_psi_term global_value; /* RM: Feb 8 1993 */
160 ptr_psi_term init_value; /* RM: Mar 23 1993 */
161 #ifdef CLIFE
162 ptr_block_definition block_def; /* AA: Mar 10 1993 */
163 #endif /* CLIFE */
164 ptr_definition next;
165 } definition;
166
167 /* 22.9 */
168 typedef struct wl_residuation {
169 long sortflag; /* bestsort == if TRUE ptr_definition else ptr_int_list */
170 GENERIC bestsort; /* 21.9 */
171 GENERIC value_2; /* to handle psi-terms with a value field 6.10 */
172 ptr_goal goal;
173 ptr_residuation next;
174 } residuation;
175
176 /* PSI_TERM */
177 typedef struct wl_psi_term {
178 #ifdef TS
179 unsigned long time_stamp; /* Avoid multiple trailing on a choice point. 9.6 */
180 #endif
181 ptr_definition type;
182 long status; /* Indicates whether the properties of the type have been */
183 /* checked or the function evaluated */
184 /* long curried; Distinguish between quoted and curried object 20.5 */
185 long flags; /* 14.9 */
186 GENERIC value_3;
187 ptr_node attr_list;
188 ptr_psi_term coref;
189 ptr_residuation resid; /* List of goals to prove if type is narrowed. */
190 } psi_term;
191
192 /* Binary tree node. */
193 /* KEY can be either an integer (a pointer) or a pointer to a string. */
194 /* DATA is the information accessed under the KEY, in most cases a pointer */
195 /* to a PSI-TERM. */
196
197 typedef struct wl_node {
198 char *key;
199 ptr_node left;
200 ptr_node right;
201 GENERIC data;
202 } node;
203
204 typedef struct wl_pair_list {
205 ptr_psi_term aaaa_2;
206 ptr_psi_term bbbb_2;
207 ptr_pair_list next;
208 } pair_list;
209
210 /* Used for type properties */
211 typedef struct wl_triple_list {
212 ptr_psi_term aaaa_4; /* Attributes */
213 ptr_psi_term bbbb_4; /* Constralong */
214 ptr_definition cccc_4; /* Original type of attribute & constralong */
215 ptr_triple_list next;
216 } triple_list;
217
218 /* RM: Dec 15 1992 Away goes the old list structure!!
219 typedef struct wl_list {
220 ptr_psi_term car;
221 ptr_psi_term cdr;
222 } list;
223 */
224
225 #ifdef CLIFE
226 #include "blockstruct.h"
227 #endif /* CLIFE */
228
229
230 typedef struct wl_stack {
231 type_ptr type;
232 GENERIC *aaaa_3; // was GENERIC
233 GENERIC *bbbb_3; // was GENERIC
234 ptr_stack next;
235 } stack;
236
237 typedef struct wl_goal {
238 goals type;
239 ptr_psi_term aaaa_1;
240 ptr_psi_term bbbb_1;
241 GENERIC cccc_1;
242 ptr_goal next;
243 ptr_definition pending;
244 } goal;
245
246 typedef struct wl_choice_point {
247 unsigned long time_stamp;
248 ptr_stack undo_point;
249 ptr_goal goal_stack;
250 ptr_choice_point next;
251 GENERIC stack_top;
252 } choice_point;
253
254 // from lefun.h
255
256
257 /* Residuation block state handling */
258
259 typedef struct wl_resid_block *ptr_resid_block;
260
261 typedef struct wl_resid_block {
262 long cc_cr; /* 11.9 */
263 ptr_goal ra;
264 /* long cc; 11.9 */
265 /* long cr; 11.9 */
266 ptr_resid_list rv; /* 21.9 */
267 ptr_psi_term md;
268 } resid_block;
269
270 // from list.h
271
272 typedef void * Ref;
273 typedef struct wl_ListLinks * RefListLinks;
274 typedef struct wl_ListHeader * RefListHeader;
275 typedef RefListLinks (*RefListGetLinksProc) ( );
276 typedef int (*RefListEnumProc) ( );
277
278 /*
279 "First", "Last" are pointers to the first and last element of the list
280 respectively.
281
282 "Current" points to the current processed element of the list. Used when
283 applying a function to each element of the list.
284
285 "GetLinks" is a function to get the list links on the object.
286
287 "Lock" is the number of recursive enum calls on the list. Used only in
288 debugging mode.
289 */
290
291 typedef struct wl_ListHeader
292 {
293 Ref First, Last;
294 #ifdef prlDEBUG
295 Int32 Lock;
296 #endif
297 RefListGetLinksProc GetLinks;
298 } ListHeader;
299
300 typedef struct wl_ListLinks
301 {
302 Ref Next, Prev;
303 } ListLinks;
304
305 // from print.h
306
307 typedef struct wl_tab_brk * ptr_tab_brk;
308 typedef struct wl_item * ptr_item;
309 typedef struct wl_tab_brk {
310 long column;
311 long broken;
312 long printed;
313 } tab_brk;
314 typedef struct wl_item {
315 char *str;
316 ptr_tab_brk tab;
317 } item;
318 // from sys.h
319 /********************************************************************
320 When calling a primitive, you always need to process the arguments
321 according to the same protocol. The call_primitive procedure does
322 all this work for you. It should be called as follows:
323
324 call_primitive(f,n,args,info)
325
326 where f is the primitive implementing the actual functionality, n
327 is the number of arguments described in args, and args is an array
328 of argument descriptions, and info is a pointer to extra info to be
329 passed to f. Each argument is described by a psi_arg structure
330 whose 1st field is a string naming the feature, 2nd field is a type
331 restriction, and 3rd field describes processing options, e.g.:
332
333 { "1" , quoted_string , REQUIRED }
334
335 describes a required argument on feature 1, that must be a string.
336 The 3rd field is a mask of boolean flags and is constructed by
337 ORing some constants chosen from the set:
338
339 OPTIONAL for an optional argument
340 REQUIRED for a required argument (i.e. residuate on it if not
341 present
342 UNEVALED if the argument should not be evaluated
343 JUSTFAIL to just fail is the argument does not meet its type
344 restriction
345 POLYTYPE sometimes you want to permit several particular sorts
346 in that case the 2nd psi_arg field is interpreted as
347 a pointer to a NULL terminated array of ptr_definitions
348 MANDATORY like REQUIRED, but it is an error for it not to be
349 present; don't residuate. This is useful for
350 predicates since it doesn't make sense for them to
351 residuate.
352 NOVALUE no value required for this argument.
353
354 The primitive must be defined to take the following arguments
355 f(argl,result,funct[,info])
356 where argl is an array containing the arguments obtained by call_
357 primitive, result is the result in case we are implementing a
358 function, and info (optional) is extra information, typically a
359 pointer to a structure.
360 *******************************************************************/
361
362
363 typedef struct {
364 char *feature;
365 ptr_definition type;
366 unsigned int options;
367 } psi_arg;
368
369 // from token.h
370
371 typedef struct wl_parse_block {
372 long lc;
373 long sol;
374 long sc;
375 long osc;
376 ptr_psi_term spt;
377 ptr_psi_term ospt;
378 long ef;
379 } parse_block;
380
381 typedef struct wl_parse_block *ptr_parse_block;
382
383 // from copy.c
384 struct hashbucket {
385 ptr_psi_term old_value;
386 ptr_psi_term new_value;
387 long info;
388 long next;
389 };
390
391 struct hashentry {
392 long timestamp;
393 long bucketindex;
394 };
395
396 #define TEXTBUFSIZE 5000
397
398 struct text_buffer {
399 struct text_buffer *next;
400 int top;
401 char data[TEXTBUFSIZE];
402 };
tab_brk
struct wl_tab_brk tab_brk
wl_hash_table::data
ptr_keyword * data
Definition: def_struct.h:139
wl_goal::aaaa_1
ptr_psi_term aaaa_1
Definition: def_struct.h:239
wl_pair_list::aaaa_2
ptr_psi_term aaaa_2
Definition: def_struct.h:205
wl_psi_term::resid
ptr_residuation resid
Definition: def_struct.h:189
ptr_node
struct wl_node * ptr_node
Definition: def_struct.h:63
choice_point
struct wl_choice_point choice_point
wl_definition::already_loaded
char already_loaded
Definition: def_struct.h:157
wl_operator_data::precedence
long precedence
Definition: def_struct.h:75
ptr_resid_block
struct wl_resid_block * ptr_resid_block
Definition: def_struct.h:259
wl_definition::init_value
ptr_psi_term init_value
Definition: def_struct.h:160
wl_parse_block::ospt
ptr_psi_term ospt
Definition: def_struct.h:377
def_type
struct wl_definition * def_type
Definition: def_struct.h:60
wl_definition::evaluate_args
char evaluate_args
Definition: def_struct.h:156
wl_item
Definition: def_struct.h:314
wl_choice_point
Definition: def_struct.h:246
wl_tab_brk::printed
long printed
Definition: def_struct.h:312
wl_hash_table
Definition: def_struct.h:136
wl_keyword::combined_name
char * combined_name
Definition: def_struct.h:119
text_buffer::data
char data[TEXTBUFSIZE]
Definition: def_struct.h:401
ptr_resid_list
struct wl_resid_list * ptr_resid_list
Definition: def_struct.h:58
wl_operator_data
Definition: def_struct.h:73
int_list
struct wl_int_list int_list
List of integers or pointers.
operator_data
struct wl_operator_data operator_data
wl_parse_block::sol
long sol
Definition: def_struct.h:373
wl_residuation::goal
ptr_goal goal
Definition: def_struct.h:172
item
struct wl_item item
wl_goal
Definition: def_struct.h:237
resid_block
struct wl_resid_block resid_block
ListHeader
struct wl_ListHeader ListHeader
wl_residuation::next
ptr_residuation next
Definition: def_struct.h:173
wl_pair_list::next
ptr_pair_list next
Definition: def_struct.h:207
psi_arg::options
unsigned int options
Definition: def_struct.h:366
wl_stack::bbbb_3
GENERIC * bbbb_3
Definition: def_struct.h:233
wl_goal::cccc_1
GENERIC cccc_1
Definition: def_struct.h:241
wl_module::inherited_modules
ptr_int_list inherited_modules
Definition: def_struct.h:109
wl_operator_data::next
ptr_operator_data next
Definition: def_struct.h:76
wl_module
Definition: def_struct.h:105
wl_tab_brk::column
long column
Definition: def_struct.h:310
wl_keyword::definition
ptr_definition definition
Definition: def_struct.h:122
wl_choice_point::undo_point
ptr_stack undo_point
Definition: def_struct.h:248
wl_hash_table::size
int size
Definition: def_struct.h:137
wl_definition::type_def
def_type type_def
Definition: def_struct.h:153
text_buffer
Definition: def_struct.h:398
wl_psi_term
Definition: def_struct.h:177
wl_stack
Definition: def_struct.h:230
wl_triple_list
Definition: def_struct.h:211
wl_resid_list::next
ptr_resid_list next
Definition: def_struct.h:97
wl_item::tab
ptr_tab_brk tab
Definition: def_struct.h:316
wl_parse_block::osc
long osc
Definition: def_struct.h:375
wl_ListHeader::GetLinks
RefListGetLinksProc GetLinks
Definition: def_struct.h:297
wl_choice_point::stack_top
GENERIC stack_top
Definition: def_struct.h:251
wl_resid_block::ra
ptr_goal ra
Definition: def_struct.h:263
wl_residuation
Definition: def_struct.h:168
wl_module::symbol_table
ptr_hash_table symbol_table
Definition: def_struct.h:110
wl_definition::keyword
ptr_keyword keyword
Definition: def_struct.h:147
wl_pair_list
Definition: def_struct.h:204
wl_item::str
char * str
Definition: def_struct.h:315
ptr_tab_brk
struct wl_tab_brk * ptr_tab_brk
Definition: def_struct.h:307
psi_term
struct wl_psi_term psi_term
wl_resid_block::cc_cr
long cc_cr
Definition: def_struct.h:262
ptr_psi_term
struct wl_psi_term * ptr_psi_term
quotedStackCopy
Definition: def_struct.h:62
wl_node::data
GENERIC data
Definition: def_struct.h:201
goal
struct wl_goal goal
PsiTerm
void * PsiTerm
Type for psi-terms, hidden from users.
Definition: def_struct.h:21
hashbucket::old_value
ptr_psi_term old_value
Definition: def_struct.h:385
wl_ListLinks::Next
Ref Next
Definition: def_struct.h:302
wl_keyword::symbol
char * symbol
Definition: def_struct.h:118
ptr_hash_table
struct wl_hash_table * ptr_hash_table
Definition: def_struct.h:100
wl_choice_point::time_stamp
unsigned long time_stamp
Definition: def_struct.h:247
wl_choice_point::next
ptr_choice_point next
Definition: def_struct.h:250
wl_triple_list::next
ptr_triple_list next
Definition: def_struct.h:215
psi_arg
Definition: def_struct.h:363
wl_triple_list::cccc_4
ptr_definition cccc_4
Definition: def_struct.h:214
wl_ListLinks::Prev
Ref Prev
Definition: def_struct.h:302
ptr_list
struct wl_list * ptr_list
Definition: def_struct.h:66
wl_definition::always_check
char always_check
Definition: def_struct.h:154
wl_residuation::sortflag
long sortflag
Definition: def_struct.h:169
resid_list
struct wl_resid_list resid_list
List of residuation variables 21.9.
wl_node::left
ptr_node left
Definition: def_struct.h:199
wl_ListLinks
Definition: def_struct.h:300
hashbucket::new_value
ptr_psi_term new_value
Definition: def_struct.h:386
wl_int_list
Definition: def_struct.h:84
ptr_module
struct wl_module * ptr_module
Definition: def_struct.h:114
hashbucket::next
long next
Definition: def_struct.h:388
wl_definition::next
ptr_definition next
Definition: def_struct.h:164
RefListGetLinksProc
RefListLinks(* RefListGetLinksProc)()
Definition: def_struct.h:275
text_buffer::top
int top
Definition: def_struct.h:400
GENERIC
unsigned long * GENERIC
unsigned long *GENERIC
Definition: def_struct.h:35
wl_parse_block::lc
long lc
Definition: def_struct.h:372
ptr_triple_list
struct wl_triple_list * ptr_triple_list
Definition: def_struct.h:65
wl_parse_block::ef
long ef
Definition: def_struct.h:378
wl_goal::type
goals type
Definition: def_struct.h:238
wl_tab_brk
Definition: def_struct.h:309
wl_stack::type
type_ptr type
Definition: def_struct.h:231
TEXTBUFSIZE
#define TEXTBUFSIZE
Definition: def_struct.h:396
psi_arg::type
ptr_definition type
Definition: def_struct.h:365
goals
long goals
int - formerly enum
Definition: def_struct.h:49
wl_node::key
char * key
Definition: def_struct.h:198
wl_parse_block
Definition: def_struct.h:371
wl_tab_brk::broken
long broken
Definition: def_struct.h:311
wl_parse_block::sc
long sc
Definition: def_struct.h:374
wl_resid_block::md
ptr_psi_term md
Definition: def_struct.h:267
ptr_choice_point
struct wl_choice_point * ptr_choice_point
Definition: def_struct.h:69
ptr_goal
struct wl_goal * ptr_goal
Definition: def_struct.h:68
wl_definition::date
long date
Definition: def_struct.h:146
ListLinks
struct wl_ListLinks ListLinks
wl_residuation::value_2
GENERIC value_2
Definition: def_struct.h:171
wl_definition::rule
ptr_pair_list rule
Definition: def_struct.h:148
wl_definition::global_value
ptr_psi_term global_value
Definition: def_struct.h:159
RefListLinks
struct wl_ListLinks * RefListLinks
Definition: def_struct.h:273
wl_resid_list
Definition: def_struct.h:94
wl_module::source_file
char * source_file
Definition: def_struct.h:107
ptr_definition
struct wl_definition * ptr_definition
Definition: def_struct.h:59
wl_keyword
Definition: def_struct.h:116
wl_psi_term::value_3
GENERIC value_3
Definition: def_struct.h:186
ptr_operator_data
struct wl_operator_data * ptr_operator_data
Definition: def_struct.h:56
ptr_pair_list
struct wl_pair_list * ptr_pair_list
Definition: def_struct.h:64
wl_pair_list::bbbb_2
ptr_psi_term bbbb_2
Definition: def_struct.h:206
wl_resid_list::var
ptr_psi_term var
Definition: def_struct.h:95
wl_triple_list::bbbb_4
ptr_psi_term bbbb_4
Definition: def_struct.h:213
hashentry::timestamp
long timestamp
Definition: def_struct.h:392
RefListHeader
struct wl_ListHeader * RefListHeader
Definition: def_struct.h:274
wl_module::module_name
char * module_name
Definition: def_struct.h:106
wl_psi_term::coref
ptr_psi_term coref
Definition: def_struct.h:188
hashentry
Definition: def_struct.h:391
wl_resid_block
Definition: def_struct.h:261
hashentry::bucketindex
long bucketindex
Definition: def_struct.h:393
wl_stack::aaaa_3
GENERIC * aaaa_3
Definition: def_struct.h:232
wl_residuation::bestsort
GENERIC bestsort
Definition: def_struct.h:170
wl_module::open_modules
ptr_int_list open_modules
Definition: def_struct.h:108
psi_arg::feature
char * feature
Definition: def_struct.h:364
stack
struct wl_stack stack
wl_psi_term::status
long status
Definition: def_struct.h:182
ptr_parse_block
struct wl_parse_block * ptr_parse_block
Definition: def_struct.h:381
ptr_keyword
struct wl_keyword * ptr_keyword
Definition: def_struct.h:125
wl_psi_term::flags
long flags
Definition: def_struct.h:185
wl_definition
Definition: def_struct.h:145
wl_keyword::module
ptr_module module
Definition: def_struct.h:117
hashbucket::info
long info
Definition: def_struct.h:387
wl_choice_point::goal_stack
ptr_goal goal_stack
Definition: def_struct.h:249
wl_hash_table::used
int used
Definition: def_struct.h:138
wl_resid_list::othervar
ptr_psi_term othervar
Definition: def_struct.h:96
wl_ListHeader
Definition: def_struct.h:291
parse_block
struct wl_parse_block parse_block
wl_keyword::private_feature
int private_feature
Definition: def_struct.h:121
RefListEnumProc
int(* RefListEnumProc)()
Definition: def_struct.h:276
ptr_residuation
struct wl_residuation * ptr_residuation
Definition: def_struct.h:61
STRLEN
#define STRLEN
Maximum size of file names and input tokens (which includes input strings) (Note: calculated tokens c...
Definition: def_const.h:162
wl_parse_block::spt
ptr_psi_term spt
Definition: def_struct.h:376
wl_resid_block::rv
ptr_resid_list rv
Definition: def_struct.h:266
wl_ListHeader::Last
Ref Last
Definition: def_struct.h:293
wl_definition::code
ptr_int_list code
Definition: def_struct.h:150
type_ptr
long type_ptr
Used to identify the object on the undo_stack.
Definition: def_struct.h:12
definition
struct wl_definition definition
wl_node
Definition: def_struct.h:197
hashbucket
Definition: def_struct.h:384
wl_psi_term::type
ptr_definition type
Definition: def_struct.h:181
wl_int_list::value_1
GENERIC value_1
Definition: def_struct.h:85
wl_goal::bbbb_1
ptr_psi_term bbbb_1
Definition: def_struct.h:240
wl_ListHeader::First
Ref First
Definition: def_struct.h:293
wl_definition::properties
ptr_triple_list properties
Definition: def_struct.h:149
triple_list
struct wl_triple_list triple_list
ptr_int_list
struct wl_int_list * ptr_int_list
Definition: def_struct.h:57
pair_list
struct wl_pair_list pair_list
text_buffer::next
struct text_buffer * next
Definition: def_struct.h:399
wl_definition::children
ptr_int_list children
Definition: def_struct.h:152
ptr_item
struct wl_item * ptr_item
Definition: def_struct.h:308
wl_stack::next
ptr_stack next
Definition: def_struct.h:234
ptr_stack
struct wl_stack * ptr_stack
Definition: def_struct.h:67
wl_psi_term::attr_list
ptr_node attr_list
Definition: def_struct.h:187
node
struct wl_node node
wl_goal::pending
ptr_definition pending
Definition: def_struct.h:243
wl_triple_list::aaaa_4
ptr_psi_term aaaa_4
Definition: def_struct.h:212
wl_definition::op_data
ptr_operator_data op_data
Definition: def_struct.h:158
Ref
void * Ref
Definition: def_struct.h:272
wl_node::right
ptr_node right
Definition: def_struct.h:200
residuation
struct wl_residuation residuation
wl_goal::next
ptr_goal next
Definition: def_struct.h:242
wl_int_list::next
ptr_int_list next
Definition: def_struct.h:86
wl_definition::parents
ptr_int_list parents
Definition: def_struct.h:151