Subversion Repositories tendra.SVN

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
#ifndef OBJECT_INCLUDED
32
#define OBJECT_INCLUDED
33
 
34
 
35
/*
36
    FORWARD STRUCTURE DECLARATIONS
37
 
38
    A number of types are defined recursively, these are declared here.
39
*/
40
 
41
struct field_tag ;
42
struct info_tag ;
43
struct type_tag ;
44
 
45
 
46
/*
47
    TYPE REPRESENTING AN OBJECT
48
 
49
    This type is used to represent a general object of list of objects.
50
    Each object has an associated name, an object type, a union giving
51
    different information for different object types, and a pointer to
52
    the next object.
53
*/
54
 
55
typedef struct object_tag {
56
    char *name ;
57
    int objtype ;
58
    union {
59
	int u_num ;
60
	char *u_str ;
61
	FILE *u_file ;
62
	struct field_tag *u_field ;
63
	struct info_tag *u_info ;
64
	struct object_tag *u_obj ;
65
	struct type_tag *u_type ;
66
    } u ;
67
    struct object_tag *next ;
68
    char *filename ;
69
    int line_no ;
70
} object ;
71
 
72
 
73
/*
74
    OBJECT TYPES
75
 
76
    These values give the various values for the objtype field of an
77
    object.  For each object type, the corresponding field of the union
78
    is given.
79
*/
80
 
81
#define OBJ_CONST		0	/* u_type */
82
#define OBJ_DEFINE		1	/* u_str */
83
#define OBJ_ENUM		2	/* u_type */
84
#define OBJ_ENUMVAL		3	/* u_str */
85
#define OBJ_EXP			4	/* u_type */
86
#define OBJ_EXTERN		5	/* u_type */
87
#define OBJ_FIELD		6	/* u_field */
88
#define OBJ_FILE		7	/* u_file */
89
#define OBJ_FUNC		8	/* u_type */
90
#define OBJ_IF			9	/* u_num */
91
#define OBJ_IMPLEMENT		10	/* u_obj */
92
#define OBJ_MACRO		11	/* u_str */
93
#define OBJ_NAT			12	/* none */
94
#define OBJ_SET			13	/* u_obj */
95
#define OBJ_STATEMENT		14	/* u_type */
96
#define OBJ_SUBSET		15	/* u_info */
97
#define OBJ_TEXT_INCL		16	/* none */
98
#define OBJ_TEXT_SRC		17	/* none */
99
#define OBJ_TOKEN		18	/* u_obj or u_str */
100
#define OBJ_TYPE		19	/* u_type */
101
#define OBJ_USE			20	/* u_obj */
102
#define OBJ_WEAK		21	/* u_type */
103
#define OBJ_KEYWORD		22	/* u_num */
104
 
105
 
106
/*
107
    SUBTYPES FOR IF STATEMENTS
108
 
109
    Objects of type OBJ_IF are classified by a number indicating the 
110
    corresponding directive.
111
*/
112
 
113
#define CMD_END			0
114
#define CMD_IF			1
115
#define CMD_IFDEF		2
116
#define CMD_IFNDEF		3
117
#define CMD_ELSE		4
118
#define CMD_ENDIF		5
119
#define CMD_NONE		6
120
 
121
 
122
/*
123
    SUBSET INFORMATION
124
 
125
    This routine is used to represent subset information.
126
*/
127
 
128
typedef struct info_tag {
129
    char *api, *file, *subset ;
130
    time_t age ;
131
    char *incl, *src ;
132
    char *block ;
133
    char *linkage ;
134
    char *nspace ;
135
    char *method ;
136
    char *prefix ;
137
    char *protect ;
138
    char *version ;
139
    boolean tokens ;
140
    int implemented ;
141
    object *elements ;
142
} info ;
143
 
144
 
145
/*
146
    PROCEDURE DECLARATIONS
147
 
148
    These routines are concerned with creating and manipulating objects.
149
*/
150
 
151
extern object *make_object PROTO_S ( ( char *, int ) ) ;
152
extern object *join_object PROTO_S ( ( object *, object * ) ) ;
153
extern object *make_subset PROTO_S ( ( char * ) ) ;
154
extern info *make_info PROTO_S ( ( char *, char *, char * ) ) ;
155
extern object *make_token PROTO_S ( ( char *, int, object *, int ) ) ;
156
extern object *make_exp PROTO_S ( ( char *, int, int ) ) ;
157
extern void update_time PROTO_S ( ( object *, object * ) ) ;
158
 
159
 
160
#endif