PIPS
database.h
Go to the documentation of this file.
1 #ifndef _newgen_database_included
2 #define _newgen_database_included
3 #define _gen_database_start 7
4 /*
5  * THIS FILE HAS BEEN AUTOMATICALLY GENERATED BY NEWGEN.
6  *
7  * PLEASE DO NOT MODIFY IT.
8  */
9 
10 #define database_domain (_gen_database_start+0)
11 #if !defined(_newgen_database_domain_defined_)
12 #define _newgen_database_domain_defined_
13 #define DATABASE_NEWGEN_DOMAIN (database_domain)
14 #define database_NEWGEN_DOMAIN (database_domain)
16 #endif /* _newgen_database_domain_defined_ */
17 
18 #define resource_domain (_gen_database_start+1)
19 #if !defined(_newgen_resource_domain_defined_)
20 #define _newgen_resource_domain_defined_
21 #define RESOURCE_NEWGEN_DOMAIN (resource_domain)
22 #define resource_NEWGEN_DOMAIN (resource_domain)
24 #endif /* _newgen_resource_domain_defined_ */
25 
26 #define status_domain (_gen_database_start+2)
27 #if !defined(_newgen_status_domain_defined_)
28 #define _newgen_status_domain_defined_
29 #define STATUS_NEWGEN_DOMAIN (status_domain)
30 #define status_NEWGEN_DOMAIN (status_domain)
31 typedef struct _newgen_struct_status_ * status;
32 #endif /* _newgen_status_domain_defined_ */
33 
34 /* DATABASE
35  */
36 #define DATABASE(x) ((database)((x).p))
37 #define database_CAST(x) DATABASE(x)
38 #define DATABASE_CAST(x) DATABASE(x)
39 #define DATABASE_(x) ((x).e)
40 #define DATABASE_TYPE database
41 #define database_TYPE database
42 #define database_undefined ((database)gen_chunk_undefined)
43 #define database_undefined_p(x) ((x)==database_undefined)
44 
46 extern void free_database(database);
48 extern bool database_consistent_p(database);
49 extern bool database_defined_p(database);
50 #define gen_DATABASE_cons gen_database_cons
54 extern void write_database(FILE*, database);
55 extern database read_database(FILE*);
56 extern database make_database(string, string, list);
57 
60  string _database_name_; /* name:string */
61  string _database_directory_; /* directory:string */
62  list _database_resources_; /* resources:resource* */
63 };
64 
65 #define database_domain_number(x) ((x)->_type_)
66 #define database_name_(x) database_name(x) /* old hack compatible */
67 #define database_name(x) ((x)->_database_name_)
68 #define database_directory_(x) database_directory(x) /* old hack compatible */
69 #define database_directory(x) ((x)->_database_directory_)
70 #define database_resources_(x) database_resources(x) /* old hack compatible */
71 #define database_resources(x) ((x)->_database_resources_)
72 
73 /* RESOURCE
74  */
75 #define RESOURCE(x) ((resource)((x).p))
76 #define resource_CAST(x) RESOURCE(x)
77 #define RESOURCE_CAST(x) RESOURCE(x)
78 #define RESOURCE_(x) ((x).e)
79 #define RESOURCE_TYPE resource
80 #define resource_TYPE resource
81 #define resource_undefined ((resource)gen_chunk_undefined)
82 #define resource_undefined_p(x) ((x)==resource_undefined)
83 
85 extern void free_resource(resource);
87 extern bool resource_consistent_p(resource);
88 extern bool resource_defined_p(resource);
89 #define gen_RESOURCE_cons gen_resource_cons
93 extern void write_resource(FILE*, resource);
94 extern resource read_resource(FILE*);
95 extern resource make_resource(string, string, status, intptr_t, intptr_t);
96 
99  string _resource_name_; /* name:string */
100  string _resource_owner_name_; /* owner_name:string */
101  status _resource_status_; /* status:status */
102  intptr_t _resource_time_; /* time:int */
103  intptr_t _resource_file_time_; /* file_time:int */
104 };
105 
106 #define resource_domain_number(x) ((x)->_type_)
107 #define resource_name_(x) resource_name(x) /* old hack compatible */
108 #define resource_name(x) ((x)->_resource_name_)
109 #define resource_owner_name_(x) resource_owner_name(x) /* old hack compatible */
110 #define resource_owner_name(x) ((x)->_resource_owner_name_)
111 #define resource_status_(x) resource_status(x) /* old hack compatible */
112 #define resource_status(x) ((x)->_resource_status_)
113 #define resource_time_(x) resource_time(x) /* old hack compatible */
114 #define resource_time(x) ((x)->_resource_time_)
115 #define resource_file_time_(x) resource_file_time(x) /* old hack compatible */
116 #define resource_file_time(x) ((x)->_resource_file_time_)
117 
118 /* STATUS
119  */
120 #define STATUS(x) ((status)((x).p))
121 #define status_CAST(x) STATUS(x)
122 #define STATUS_CAST(x) STATUS(x)
123 #define STATUS_(x) ((x).e)
124 #define STATUS_TYPE status
125 #define status_TYPE status
126 #define status_undefined ((status)gen_chunk_undefined)
127 #define status_undefined_p(x) ((x)==status_undefined)
128 
129 extern status copy_status(status);
130 extern void free_status(status);
131 extern status check_status(status);
132 extern bool status_consistent_p(status);
133 extern bool status_defined_p(status);
134 #define gen_STATUS_cons gen_status_cons
136 extern void status_assign_contents(status, status);
137 extern void status_non_recursive_free(status);
138 extern void write_status(FILE*, status);
139 extern status read_status(FILE*);
143 };
144 extern string status_tag_as_string(enum status_utype);
145 extern status make_status(enum status_utype, void *);
146 extern status make_status_memory(string);
147 extern status make_status_file(string);
148 
152  union {
153  string _status_memory_; /* memory:string */
154  string _status_file_; /* file:string */
156 };
157 
158 #define status_domain_number(x) ((x)->_type_)
159 #define status_tag(x) ((x)->_status_tag__)
160 #define status_memory_p(x) (status_tag(x)==is_status_memory)
161 #define status_memory_(x) status_memory(x) /* old hack compatible */
162 #define status_memory(x) ((x)->_status_union_._status_memory_)
163 #define status_file_p(x) (status_tag(x)==is_status_file)
164 #define status_file_(x) status_file(x) /* old hack compatible */
165 #define status_file(x) ((x)->_status_union_._status_file_)
166 
167 #define database_spec "\
168 --NEWGEN-START 7\n\
169 database = name:string x directory:string x resources:resource*;\n\
170 resource = name:string x owner_name:string x status:status x time:int x file_time:int;\n\
171 status = memory:string + file:string;\n\
172 "
173 #endif
status copy_status(status)
STATUS.
Definition: database.c:100
list gen_database_cons(database, list)
Definition: database.c:32
void free_resource(resource)
Definition: database.c:61
database make_database(string, string, list)
Definition: database.c:52
status make_status_file(string)
Definition: database.c:149
void write_resource(FILE *, resource)
Definition: database.c:88
void database_assign_contents(database, database)
Definition: database.c:35
void resource_non_recursive_free(resource)
Definition: database.c:84
void database_non_recursive_free(database)
Definition: database.c:42
string status_tag_as_string(enum status_utype)
Definition: database.c:136
void resource_assign_contents(resource, resource)
Definition: database.c:77
status make_status(enum status_utype, void *)
Definition: database.c:143
struct _newgen_struct_database_ * database
Definition: database.h:15
bool status_consistent_p(status)
Definition: database.c:109
bool resource_consistent_p(resource)
Definition: database.c:67
void free_status(status)
Definition: database.c:103
bool database_consistent_p(database)
Definition: database.c:25
void write_status(FILE *, status)
Definition: database.c:130
void status_assign_contents(status, status)
Definition: database.c:119
bool resource_defined_p(resource)
Definition: database.c:71
struct _newgen_struct_status_ * status
Definition: database.h:31
database check_database(database)
Definition: database.c:22
database read_database(FILE *)
Definition: database.c:49
status_utype
Definition: database.h:140
@ is_status_file
Definition: database.h:142
@ is_status_memory
Definition: database.h:141
list gen_status_cons(status, list)
Definition: database.c:116
database copy_database(database)
DATABASE.
Definition: database.c:16
resource read_resource(FILE *)
Definition: database.c:91
struct _newgen_struct_resource_ * resource
Definition: database.h:23
resource make_resource(string, string, status, intptr_t, intptr_t)
Definition: database.c:94
resource check_resource(resource)
Definition: database.c:64
status check_status(status)
Definition: database.c:106
bool status_defined_p(status)
Definition: database.c:113
void status_non_recursive_free(status)
Definition: database.c:126
resource copy_resource(resource)
RESOURCE.
Definition: database.c:58
void write_database(FILE *, database)
Definition: database.c:46
status make_status_memory(string)
Definition: database.c:146
void free_database(database)
Definition: database.c:19
bool database_defined_p(database)
Definition: database.c:29
list gen_resource_cons(resource, list)
Definition: database.c:74
status read_status(FILE *)
Definition: database.c:133
#define intptr_t
Definition: stdint.in.h:294
string _database_directory_
name:string
Definition: database.h:61
list _database_resources_
directory:string
Definition: database.h:62
string _resource_owner_name_
name:string
Definition: database.h:100
status _resource_status_
owner_name:string
Definition: database.h:101
intptr_t _resource_time_
status:status
Definition: database.h:102
intptr_t _resource_file_time_
time:int
Definition: database.h:103
enum status_utype _status_tag__
Definition: database.h:151
union _newgen_struct_status_::@45 _status_union_
string _status_file_
memory:string
Definition: database.h:154
The structure used to build lists in NewGen.
Definition: newgen_list.h:41