Subversion Repositories tendra.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 7
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
-
 
3
 * All rights reserved.
-
 
4
 *
-
 
5
 * Redistribution and use in source and binary forms, with or without
-
 
6
 * modification, are permitted provided that the following conditions are met:
-
 
7
 *
-
 
8
 * 1. Redistributions of source code must retain the above copyright notice,
-
 
9
 *    this list of conditions and the following disclaimer.
-
 
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
-
 
11
 *    this list of conditions and the following disclaimer in the documentation
-
 
12
 *    and/or other materials provided with the distribution.
-
 
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
-
 
14
 *    may be used to endorse or promote products derived from this software
-
 
15
 *    without specific, prior written permission.
-
 
16
 *
-
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
-
 
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-
 
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
-
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
 
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-
 
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-
 
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-
 
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-
 
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
28
 *
-
 
29
 * $Id$
-
 
30
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
    
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
36
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
37
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
38
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
39
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
40
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
41
    shall be deemed to be acceptance of the following conditions:-
12
    
42
 
13
        (1) Its Recipients shall ensure that this Notice is
43
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
44
        reproduced upon any copies or amended versions of it;
15
    
45
 
16
        (2) Any amended version of it shall be clearly marked to
46
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
47
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
48
        for the relevant amendment or amendments;
19
    
49
 
20
        (3) Its onward transfer from a recipient to another
50
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
51
        party shall be deemed to be that party's acceptance of
22
        these conditions;
52
        these conditions;
23
    
53
 
24
        (4) DERA gives no warranty or assurance as to its
54
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
55
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
56
        no liability whatsoever in relation to any use to which
27
        it may be put.
57
        it may be put.
28
*/
58
*/
Line 114... Line 144...
114
    struct NameT	       *name;
144
    struct NameT	       *name;
115
} EntryT, *EntryP;
145
} EntryT, *EntryP;
116
 
146
 
117
/*--------------------------------------------------------------------------*/
147
/*--------------------------------------------------------------------------*/
118
 
148
 
119
extern EntryP			entry_create_from_string
149
extern EntryP		entry_create_from_string(NStringP, unsigned,
120
	PROTO_S ((NStringP, unsigned, EntryTypeT));
150
						 EntryTypeT);
121
extern EntryP			entry_create_from_number
151
extern EntryP		entry_create_from_number(unsigned, EntryTypeT, BoolT,
122
	PROTO_S ((unsigned, EntryTypeT, BoolT, EntryP));
-
 
123
extern void			entry_set_basic
152
						 EntryP);
124
	PROTO_S ((EntryP, struct BasicT *));
153
extern void		entry_set_basic(EntryP, struct BasicT *);
125
extern void			entry_set_rule
-
 
126
	PROTO_S ((EntryP, struct RuleT *));
154
extern void		entry_set_rule(EntryP, struct RuleT *);
127
extern void			entry_set_action
-
 
128
	PROTO_S ((EntryP, struct ActionT *));
155
extern void		entry_set_action(EntryP, struct ActionT *);
129
extern void			entry_set_type
-
 
130
	PROTO_S ((EntryP, struct TypeT *));
156
extern void		entry_set_type(EntryP, struct TypeT *);
131
extern void			entry_set_non_local
157
extern void		entry_set_non_local(EntryP, EntryP);
132
	PROTO_S ((EntryP, EntryP));
-
 
133
extern EntryP			entry_next
158
extern EntryP		entry_next(EntryP);
134
	PROTO_S ((EntryP));
-
 
135
extern EntryP		       *entry_next_ref
159
extern EntryP	       *entry_next_ref(EntryP);
136
	PROTO_S ((EntryP));
-
 
137
extern KeyP			entry_key
160
extern KeyP		entry_key(EntryP);
138
	PROTO_S ((EntryP));
-
 
139
extern EntryTypeT		entry_type
161
extern EntryTypeT	entry_type(EntryP);
140
	PROTO_S ((EntryP));
-
 
141
extern void			entry_change_type
162
extern void		entry_change_type(EntryP, EntryTypeT);
142
	PROTO_S ((EntryP, EntryTypeT));
-
 
143
extern BoolT			entry_is_basic
163
extern BoolT		entry_is_basic(EntryP);
144
	PROTO_S ((EntryP));
-
 
145
extern BoolT			entry_is_action
164
extern BoolT		entry_is_action(EntryP);
146
	PROTO_S ((EntryP));
-
 
147
extern BoolT			entry_is_rule
165
extern BoolT		entry_is_rule(EntryP);
148
	PROTO_S ((EntryP));
-
 
149
extern BoolT			entry_is_type
166
extern BoolT		entry_is_type(EntryP);
150
	PROTO_S ((EntryP));
-
 
151
extern BoolT			entry_is_non_local
167
extern BoolT		entry_is_non_local(EntryP);
152
	PROTO_S ((EntryP));
-
 
153
extern struct BasicT	       *entry_get_basic
168
extern struct BasicT   *entry_get_basic(EntryP);
154
	PROTO_S ((EntryP));
-
 
155
extern struct ActionT	       *entry_get_action
169
extern struct ActionT  *entry_get_action(EntryP);
156
	PROTO_S ((EntryP));
-
 
157
extern struct RuleT	       *entry_get_rule
170
extern struct RuleT    *entry_get_rule(EntryP);
158
	PROTO_S ((EntryP));
-
 
159
extern struct NameT	       *entry_get_name
171
extern struct NameT    *entry_get_name(EntryP);
160
	PROTO_S ((EntryP));
-
 
161
extern struct TypeT	       *entry_get_type
172
extern struct TypeT    *entry_get_type(EntryP);
162
	PROTO_S ((EntryP));
-
 
163
extern EntryP			entry_get_non_local
173
extern EntryP		entry_get_non_local(EntryP);
164
	PROTO_S ((EntryP));
-
 
165
extern void			entry_set_mapping
174
extern void		entry_set_mapping(EntryP, NStringP);
166
	PROTO_S ((EntryP, NStringP));
-
 
167
extern NStringP			entry_get_mapping
175
extern NStringP		entry_get_mapping(EntryP);
168
	PROTO_S ((EntryP));
-
 
169
extern void			entry_iter
-
 
170
	PROTO_S ((EntryP, BoolT, void (*) (EntryP, GenericP), GenericP));
176
extern void		entry_iter(EntryP, BoolT, void(*)(EntryP, GenericP),
171
extern void			entry_not_traced
-
 
172
	PROTO_S ((EntryP));
177
				   GenericP);
173
extern BoolT			entry_is_traced
178
extern void		entry_not_traced(EntryP);
174
	PROTO_S ((EntryP));
179
extern BoolT		entry_is_traced(EntryP);
175
 
180
 
176
/*--------------------------------------------------------------------------*/
181
/*--------------------------------------------------------------------------*/
177
 
182
 
178
#ifdef FS_FAST
183
#ifdef FS_FAST
179
#define entry_set_basic(e, b)  ((e)->u.basic = (b))
184
#define entry_set_basic(e, b)	((e)->u.basic = (b))
180
#define entry_set_rule(e, r)  ((e)->u.rule = (r))
185
#define entry_set_rule(e, r)	((e)->u.rule = (r))
181
#define entry_set_action(e, a)  ((e)->u.action = (a))
186
#define entry_set_action(e, a)	((e)->u.action = (a))
182
#define entry_set_type(e, t)  ((e)->u.type = (t))
187
#define entry_set_type(e, t)	((e)->u.type = (t))
183
#define entry_next(e) ((e)->next)
188
#define entry_next(e)		((e)->next)
184
#define entry_next_ref(e) (&((e)->next))
189
#define entry_next_ref(e)	(&((e)->next))
185
#define entry_key(e) (&((e)->key))
190
#define entry_key(e)		(&((e)->key))
186
#define entry_type(e) ((e)->type)
191
#define entry_type(e)		((e)->type)
187
#define entry_change_type(e, t) ((e)->type = (t))
192
#define entry_change_type(e, t)	((e)->type = (t))
188
#define entry_is_basic(e) ((e)->type == ET_BASIC)
193
#define entry_is_basic(e)	((e)->type == ET_BASIC)
189
#define entry_is_action(e) ((e)->type == ET_ACTION)
194
#define entry_is_action(e)	((e)->type == ET_ACTION)
190
#define entry_is_rule(e) ((e)->type == ET_RULE)
195
#define entry_is_rule(e)	((e)->type == ET_RULE)
191
#define entry_is_type(e) ((e)->type == ET_TYPE)
196
#define entry_is_type(e)	((e)->type == ET_TYPE)
192
#define entry_is_non_local(e) ((e)->type == ET_NON_LOCAL)
197
#define entry_is_non_local(e)	((e)->type == ET_NON_LOCAL)
193
#define entry_get_basic(e) ((e)->u.basic)
198
#define entry_get_basic(e)	((e)->u.basic)
194
#define entry_get_action(e) ((e)->u.action)
199
#define entry_get_action(e)	((e)->u.action)
195
#define entry_get_rule(e) ((e)->u.rule)
200
#define entry_get_rule(e)	((e)->u.rule)
196
#define entry_get_name(e) ((e)->name)
201
#define entry_get_name(e)	((e)->name)
197
#define entry_get_type(e) ((e)->u.type)
202
#define entry_get_type(e)	((e)->u.type)
198
#define entry_not_traced(e) ((e)->traced = FALSE)
203
#define entry_not_traced(e)	((e)->traced = FALSE)
199
#define entry_is_traced(e) ((e)->traced)
204
#define entry_is_traced(e)	((e)->traced)
200
#endif /* defined (FS_FAST) */
205
#endif /* defined (FS_FAST) */
201
 
206
 
202
#endif /* !defined (H_ENTRY) */
207
#endif /* !defined (H_ENTRY) */
203

208

204
/*
209
/*