DEADSOFTWARE

Patched for Linux
[mp3cc.git] / MPC.3.5.LINUX / structures / type.h
1 /********************************************************************
3 type.h - structures used to hold descriptions of pascal types
5 Niksa Orlic, 2004-04-28
7 ********************************************************************/
10 /*
11 The possible type classes
12 */
13 enum en_type_class
14 {
15 error_type, /* used to detect errors */
16 void_type,
17 integer_type,
18 real_type,
19 char_type,
20 boolean_type,
21 string_type,
22 array_type,
23 record_type,
24 interval_type,
25 image_type,
26 command_type,
27 stream_type,
28 record_store_type,
29 http_type,
30 alert_type /* this is only an internal type, the user cannot declare variables to be alert_type */
32 /* add our own types */
33 } en_type_class;
35 /*
36 The structure to hold description for a single
37 type.
38 */
39 struct type_struct
40 {
41 enum en_type_class type_class;
43 /* for array types */
44 struct type_struct* element_type; /* the type of array elements */
45 type_list *dimensions_list; /* the type for each dimension */
47 /* for record type */
48 string_list *elements_name_list; /* the elements in record, their names */
49 type_list *elements_type_list; /* the elements in record, their types */
50 int unique_record_ID; /* the name that identifies the record */
52 /* for interval type */
53 enum en_type_class interval_base_type;
54 long int first_element;
55 long int last_element;
56 };
58 typedef struct type_struct type;
61 type* type_create();
62 void type_destroy(type*);
64 type* type_duplicate(type*);
66 int type_equal(type*, type*);
67 int type_equal_cast(type*, type*);
69 string *type_get_name(type*);
71 void type_record_check_duplicate_names(type*, string_list*);
72 void type_add_record(type*, string_list*, type*);
74 type *type_find_record_element(type*, char*);