Subversion Repositories tendra.SVN

Rev

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

Rev 5 Rev 6
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 65... Line 95...
65
#include "type.h"
95
#include "type.h"
66
 
96
 
67
/*--------------------------------------------------------------------------*/
97
/*--------------------------------------------------------------------------*/
68
 
98
 
69
static unsigned
99
static unsigned
70
table_next_generated_key PROTO_Z ()
100
table_next_generated_key(void)
71
{
101
{
72
    static unsigned sequence = 0;
102
    static unsigned sequence = 0;
73
 
103
 
74
    if (sequence == UINT_MAX) {
104
    if (sequence == UINT_MAX) {
75
	E_too_many_generated_ids ();
105
	E_too_many_generated_ids();
76
	UNREACHED;
106
	UNREACHED;
77
    }
107
    }
78
    return (sequence ++);
108
    return(sequence++);
79
}
109
}
80
 
110
 
81
static EntryP
111
static EntryP
82
table_add_entry PROTO_N ((table, key, type, found_ref))
112
table_add_entry(TableP table, NStringP key, EntryTypeT type, BoolT *found_ref)
83
		PROTO_T (TableP     table X
-
 
84
			 NStringP   key X
-
 
85
			 EntryTypeT type X
-
 
86
			 BoolT     *found_ref)
-
 
87
{
113
{
88
    unsigned hash   = (nstring_hash_value (key) % TABLE_SIZE);
114
    unsigned hash   = (nstring_hash_value(key)% TABLE_SIZE);
89
    EntryP  *entryp = &(table->contents [hash]);
115
    EntryP  *entryp = &(table->contents[hash]);
90
    EntryP   entry;
116
    EntryP   entry;
91
    unsigned number;
117
    unsigned number;
92
 
118
 
93
    *found_ref = FALSE;
119
    *found_ref = FALSE;
94
    while ((entry = *entryp) != NIL (EntryP)) {
120
    while ((entry = *entryp) != NIL(EntryP)) {
95
	KeyP ent_key = entry_key (entry);
121
	KeyP ent_key = entry_key(entry);
96
 
122
 
97
	if ((key_is_string (ent_key)) &&
123
	if ((key_is_string(ent_key)) &&
98
	    (nstring_equal (key_get_string (ent_key), key))) {
124
	   (nstring_equal(key_get_string(ent_key), key))) {
99
	    if (type == ET_NAME) {
125
	    if (type == ET_NAME) {
100
		nstring_destroy (key);
126
		nstring_destroy(key);
101
		return (entry);
127
		return(entry);
102
	    } else if (entry_type (entry) == ET_NAME) {
128
	    } else if (entry_type(entry) == ET_NAME) {
103
		nstring_destroy (key);
129
		nstring_destroy(key);
104
		entry_change_type (entry, type);
130
		entry_change_type(entry, type);
105
		return (entry);
131
		return(entry);
106
	    } else if ((entry_type (entry) == type) &&
132
	    } else if ((entry_type(entry) == type) &&
107
		       ((type == ET_ACTION) || (type == ET_RULE))) {
133
		      ((type == ET_ACTION) || (type == ET_RULE))) {
108
		*found_ref = TRUE;
134
		*found_ref = TRUE;
109
		nstring_destroy (key);
135
		nstring_destroy(key);
110
		return (entry);
136
		return(entry);
111
	    } else {
137
	    } else {
112
		return (NIL (EntryP));
138
		return(NIL(EntryP));
113
	    }
139
	    }
114
	}
140
	}
115
	entryp = entry_next_ref (entry);
141
	entryp = entry_next_ref(entry);
116
    }
142
    }
117
    number  = table_next_generated_key ();
143
    number  = table_next_generated_key();
118
    entry   = entry_create_from_string (key, number, type);
144
    entry   = entry_create_from_string(key, number, type);
119
    *entryp = entry;
145
    *entryp = entry;
120
    return (entry);
146
    return(entry);
121
}
147
}
122
 
148
 
123
/*--------------------------------------------------------------------------*/
149
/*--------------------------------------------------------------------------*/
124
 
150
 
125
void
151
void
126
table_init PROTO_N ((table))
152
table_init(TableP table)
127
	   PROTO_T (TableP table)
-
 
128
{
153
{
129
    unsigned i;
154
    unsigned i;
130
 
155
 
131
    for (i = 0; i < TABLE_SIZE; i ++) {
156
    for (i = 0; i < TABLE_SIZE; i++) {
132
	table->contents [i] = NIL (EntryP);
157
	table->contents[i] = NIL(EntryP);
133
    }
158
    }
134
}
159
}
135
 
160
 
136
EntryP
161
EntryP
137
table_add_type PROTO_N ((table, key))
162
table_add_type(TableP table, NStringP key)
138
	       PROTO_T (TableP   table X
-
 
139
			NStringP key)
-
 
140
{
163
{
141
    BoolT  found;
164
    BoolT  found;
142
    EntryP entry = table_add_entry (table, key, ET_TYPE, &found);
165
    EntryP entry = table_add_entry(table, key, ET_TYPE, &found);
143
 
166
 
144
    if (entry) {
167
    if (entry) {
145
	entry_set_type (entry, type_create ());
168
	entry_set_type(entry, type_create());
146
    }
169
    }
147
    return (entry);
170
    return(entry);
148
}
171
}
149
 
172
 
150
EntryP
173
EntryP
151
table_add_basic PROTO_N ((table, key, grammar, ignored))
174
table_add_basic(TableP table, NStringP key, GrammarP grammar, BoolT ignored)
152
		PROTO_T (TableP   table X
-
 
153
			 NStringP key X
-
 
154
			 GrammarP grammar X
-
 
155
			 BoolT    ignored)
-
 
156
{
175
{
157
    BoolT  found;
176
    BoolT  found;
158
    EntryP entry = table_add_entry (table, key, ET_BASIC, &found);
177
    EntryP entry = table_add_entry(table, key, ET_BASIC, &found);
159
 
178
 
160
    if (entry) {
179
    if (entry) {
161
	entry_set_basic (entry, basic_create (grammar, ignored));
180
	entry_set_basic(entry, basic_create(grammar, ignored));
162
    }
181
    }
163
    return (entry);
182
    return(entry);
164
}
183
}
165
 
184
 
166
EntryP
185
EntryP
167
table_add_action PROTO_N ((table, key))
186
table_add_action(TableP table, NStringP key)
168
		 PROTO_T (TableP   table X
-
 
169
			  NStringP key)
-
 
170
{
187
{
171
    BoolT  found;
188
    BoolT  found;
172
    EntryP entry = table_add_entry (table, key, ET_ACTION, &found);
189
    EntryP entry = table_add_entry(table, key, ET_ACTION, &found);
173
 
190
 
174
    if ((entry != NIL (EntryP)) && (!found)) {
191
    if ((entry != NIL(EntryP)) && (!found)) {
175
	entry_set_action (entry, action_create ());
192
	entry_set_action(entry, action_create());
176
    }
193
    }
177
    return (entry);
194
    return(entry);
178
}
195
}
179
 
196
 
180
EntryP
197
EntryP
181
table_add_rule PROTO_N ((table, key))
198
table_add_rule(TableP table, NStringP key)
182
	       PROTO_T (TableP   table X
-
 
183
			NStringP key)
-
 
184
{
199
{
185
    BoolT  found;
200
    BoolT  found;
186
    EntryP entry = table_add_entry (table, key, ET_RULE, &found);
201
    EntryP entry = table_add_entry(table, key, ET_RULE, &found);
187
 
202
 
188
    if ((entry != NIL (EntryP)) && (!found)) {
203
    if ((entry != NIL(EntryP)) && (!found)) {
189
	entry_set_rule (entry, rule_create (entry));
204
	entry_set_rule(entry, rule_create(entry));
190
    }
205
    }
191
    return (entry);
206
    return(entry);
192
}
207
}
193
 
208
 
194
EntryP
209
EntryP
195
table_add_generated_rule PROTO_N ((table, traced))
210
table_add_generated_rule(TableP table, BoolT traced)
196
			 PROTO_T (TableP table X
-
 
197
				  BoolT  traced)
-
 
198
{
211
{
199
    unsigned sequence = table_next_generated_key ();
212
    unsigned sequence = table_next_generated_key();
200
    unsigned hash     = (sequence % TABLE_SIZE);
213
    unsigned hash     = (sequence % TABLE_SIZE);
201
    EntryP  *entryp   = &(table->contents [hash]);
214
    EntryP  *entryp   = &(table->contents[hash]);
202
    EntryP   entry;
215
    EntryP   entry;
203
 
216
 
204
    entry = entry_create_from_number (sequence, ET_RULE, traced, *entryp);
217
    entry = entry_create_from_number(sequence, ET_RULE, traced, *entryp);
205
    entry_set_rule (entry, rule_create (entry));
218
    entry_set_rule(entry, rule_create(entry));
206
    *entryp = entry;
219
    *entryp = entry;
207
    return (entry);
220
    return(entry);
208
}
221
}
209
 
222
 
210
EntryP
223
EntryP
211
table_add_name PROTO_N ((table, key))
224
table_add_name(TableP table, NStringP key)
212
	       PROTO_T (TableP   table X
-
 
213
			NStringP key)
-
 
214
{
225
{
215
    BoolT found;
226
    BoolT found;
216
 
227
 
217
    return (table_add_entry (table, key, ET_NAME, &found));
228
    return(table_add_entry(table, key, ET_NAME, &found));
218
}
229
}
219
 
230
 
220
EntryP
231
EntryP
221
table_add_generated_name PROTO_N ((table))
232
table_add_generated_name(TableP table)
222
			 PROTO_T (TableP table)
-
 
223
{
233
{
224
    unsigned sequence = table_next_generated_key ();
234
    unsigned sequence = table_next_generated_key();
225
    unsigned hash     = (sequence % TABLE_SIZE);
235
    unsigned hash     = (sequence % TABLE_SIZE);
226
    EntryP  *entryp   = &(table->contents [hash]);
236
    EntryP  *entryp   = &(table->contents[hash]);
227
    EntryP   entry;
237
    EntryP   entry;
228
 
238
 
229
    entry = entry_create_from_number (sequence, ET_NAME, FALSE, *entryp);
239
    entry = entry_create_from_number(sequence, ET_NAME, FALSE, *entryp);
230
    *entryp = entry;
240
    *entryp = entry;
231
    return (entry);
241
    return(entry);
232
}
242
}
233
 
243
 
234
EntryP
244
EntryP
235
table_add_rename PROTO_N ((table))
245
table_add_rename(TableP table)
236
		 PROTO_T (TableP table)
-
 
237
{
246
{
238
    unsigned sequence = table_next_generated_key ();
247
    unsigned sequence = table_next_generated_key();
239
    unsigned hash     = (sequence % TABLE_SIZE);
248
    unsigned hash     = (sequence % TABLE_SIZE);
240
    EntryP  *entryp   = &(table->contents [hash]);
249
    EntryP  *entryp   = &(table->contents[hash]);
241
    EntryP   entry;
250
    EntryP   entry;
242
 
251
 
243
    entry = entry_create_from_number (sequence, ET_RENAME, TRUE, *entryp);
252
    entry = entry_create_from_number(sequence, ET_RENAME, TRUE, *entryp);
244
    *entryp = entry;
253
    *entryp = entry;
245
    return (entry);
254
    return(entry);
246
}
255
}
247
 
256
 
248
EntryP
257
EntryP
249
table_add_non_local PROTO_N ((table, key, type))
258
table_add_non_local(TableP table, NStringP key, EntryP type)
250
		    PROTO_T (TableP   table X
-
 
251
			     NStringP key X
-
 
252
			     EntryP   type)
-
 
253
{
259
{
254
    BoolT  found;
260
    BoolT  found;
255
    EntryP entry = table_add_entry (table, key, ET_NON_LOCAL, &found);
261
    EntryP entry = table_add_entry(table, key, ET_NON_LOCAL, &found);
256
 
262
 
257
    if (entry) {
263
    if (entry) {
258
	entry_set_non_local (entry, type);
264
	entry_set_non_local(entry, type);
259
    }
265
    }
260
    return (entry);
266
    return(entry);
261
}
267
}
262
 
268
 
263
EntryP
269
EntryP
264
table_get_entry PROTO_N ((table, key))
270
table_get_entry(TableP table, NStringP key)
265
		PROTO_T (TableP   table X
-
 
266
			 NStringP key)
-
 
267
{
271
{
268
    unsigned hash  = (nstring_hash_value (key) % TABLE_SIZE);
272
    unsigned hash  = (nstring_hash_value(key)% TABLE_SIZE);
269
    EntryP   entry = (table->contents [hash]);
273
    EntryP   entry = (table->contents[hash]);
270
 
274
 
271
    while (entry) {
275
    while (entry) {
272
	KeyP ent_key = entry_key (entry);
276
	KeyP ent_key = entry_key(entry);
273
 
277
 
274
	if ((key_is_string (ent_key)) &&
278
	if ((key_is_string(ent_key)) &&
275
	    (nstring_equal (key_get_string (ent_key), key))) {
279
	   (nstring_equal(key_get_string(ent_key), key))) {
276
	    return (entry);
280
	    return(entry);
277
	}
281
	}
278
	entry = entry->next;
282
	entry = entry->next;
279
    }
283
    }
280
    return (NIL (EntryP));
284
    return(NIL(EntryP));
281
}
285
}
282
 
286
 
283
EntryP
287
EntryP
284
table_get_type PROTO_N ((table, key))
288
table_get_type(TableP table, NStringP key)
285
	       PROTO_T (TableP   table X
-
 
286
			NStringP key)
-
 
287
{
289
{
288
    EntryP entry = table_get_entry (table, key);
290
    EntryP entry = table_get_entry(table, key);
289
 
291
 
290
    if ((entry) && (entry_is_type (entry))) {
292
    if ((entry) && (entry_is_type(entry))) {
291
	return (entry);
293
	return(entry);
292
    } else {
294
    } else {
293
	return (NIL (EntryP));
295
	return(NIL(EntryP));
294
    }
296
    }
295
}
297
}
296
 
298
 
297
EntryP
299
EntryP
298
table_get_basic PROTO_N ((table, key))
300
table_get_basic(TableP table, NStringP key)
299
		PROTO_T (TableP   table X
-
 
300
			 NStringP key)
-
 
301
{
301
{
302
    EntryP entry = table_get_entry (table, key);
302
    EntryP entry = table_get_entry(table, key);
303
 
303
 
304
    if ((entry) && (entry_is_basic (entry))) {
304
    if ((entry) && (entry_is_basic(entry))) {
305
	return (entry);
305
	return(entry);
306
    } else {
306
    } else {
307
	return (NIL (EntryP));
307
	return(NIL(EntryP));
308
    }
308
    }
309
}
309
}
310
 
310
 
311
EntryP
311
EntryP
312
table_get_basic_by_number PROTO_N ((table, number))
312
table_get_basic_by_number(TableP table, unsigned number)
313
			  PROTO_T (TableP   table X
-
 
314
				   unsigned number)
-
 
315
{
313
{
316
    unsigned i;
314
    unsigned i;
317
 
315
 
318
    for (i = 0; i < TABLE_SIZE; i ++) {
316
    for (i = 0; i < TABLE_SIZE; i++) {
319
	EntryP entry;
317
	EntryP entry;
320
 
318
 
321
	for (entry = table->contents [i]; entry; entry = entry_next (entry)) {
319
	for (entry = table->contents[i]; entry; entry = entry_next(entry)) {
322
	    if (entry_is_basic (entry)) {
320
	    if (entry_is_basic(entry)) {
323
		BasicP basic = entry_get_basic (entry);
321
		BasicP basic = entry_get_basic(entry);
324
 
322
 
325
		if (basic_terminal (basic) == number) {
323
		if (basic_terminal(basic) == number) {
326
		    return (entry);
324
		    return(entry);
327
		}
325
		}
328
	    }
326
	    }
329
	}
327
	}
330
    }
328
    }
331
    return (NIL (EntryP));
329
    return(NIL(EntryP));
332
}
330
}
333
 
331
 
334
EntryP
332
EntryP
335
table_get_action PROTO_N ((table, key))
333
table_get_action(TableP table, NStringP key)
336
		 PROTO_T (TableP   table X
-
 
337
			  NStringP key)
-
 
338
{
334
{
339
    EntryP entry = table_get_entry (table, key);
335
    EntryP entry = table_get_entry(table, key);
340
 
336
 
341
    if ((entry) && (entry_is_action (entry))) {
337
    if ((entry) && (entry_is_action(entry))) {
342
	return (entry);
338
	return(entry);
343
    } else {
339
    } else {
344
	return (NIL (EntryP));
340
	return(NIL(EntryP));
345
    }
341
    }
346
}
342
}
347
 
343
 
348
EntryP
344
EntryP
349
table_get_rule PROTO_N ((table, key))
345
table_get_rule(TableP table, NStringP key)
350
	       PROTO_T (TableP   table X
-
 
351
			NStringP key)
-
 
352
{
346
{
353
    EntryP entry = table_get_entry (table, key);
347
    EntryP entry = table_get_entry(table, key);
354
 
348
 
355
    if ((entry) && (entry_is_rule (entry))) {
349
    if ((entry) && (entry_is_rule(entry))) {
356
	return (entry);
350
	return(entry);
357
    } else {
351
    } else {
358
	return (NIL (EntryP));
352
	return(NIL(EntryP));
359
    }
353
    }
360
}
354
}
361
 
355
 
362
void
356
void
363
table_iter PROTO_N ((table, proc, closure))
357
table_iter(TableP table, void (*proc)(EntryP, GenericP),
364
	   PROTO_T (TableP  table X
-
 
365
		    void   (*proc) PROTO_S ((EntryP, GenericP)) X
-
 
366
		    GenericP closure)
358
	   GenericP closure)
367
{
359
{
368
    unsigned i;
360
    unsigned i;
369
 
361
 
370
    for (i = 0; i < TABLE_SIZE; i ++) {
362
    for (i = 0; i < TABLE_SIZE; i++) {
371
	EntryP entry;
363
	EntryP entry;
372
 
364
 
373
	for (entry = table->contents [i]; entry; entry = entry_next (entry)) {
365
	for (entry = table->contents[i]; entry; entry = entry_next(entry)) {
374
	    (*proc) (entry, closure);
366
	   (*proc)(entry, closure);
375
	}
367
	}
376
    }
368
    }
377
}
369
}
378
 
370
 
379
void
371
void
380
table_untrace PROTO_N ((table))
372
table_untrace(TableP table)
381
	      PROTO_T (TableP table)
-
 
382
{
373
{
383
    unsigned i;
374
    unsigned i;
384
 
375
 
385
    for (i = 0; i < TABLE_SIZE; i ++) {
376
    for (i = 0; i < TABLE_SIZE; i++) {
386
	EntryP entry;
377
	EntryP entry;
387
 
378
 
388
	for (entry = table->contents [i]; entry; entry = entry_next (entry)) {
379
	for (entry = table->contents[i]; entry; entry = entry_next(entry)) {
389
	    entry_not_traced (entry);
380
	    entry_not_traced(entry);
390
	}
381
	}
391
    }
382
    }
392
}
383
}
393
 
384
 
394
void
385
void
395
table_unlink_untraced_rules PROTO_N ((table))
386
table_unlink_untraced_rules(TableP table)
396
			    PROTO_T (TableP table)
-
 
397
{
387
{
398
    unsigned i;
388
    unsigned i;
399
 
389
 
400
    for (i = 0; i < TABLE_SIZE; i ++) {
390
    for (i = 0; i < TABLE_SIZE; i++) {
401
	EntryP entry = (table->contents [i]);
391
	EntryP entry = (table->contents[i]);
402
 
392
 
403
	while (entry) {
393
	while (entry) {
404
	    if (entry_is_rule (entry) && (!entry_is_traced (entry))) {
394
	    if (entry_is_rule(entry) && (!entry_is_traced(entry))) {
405
		rule_deallocate (entry_get_rule (entry));
395
		rule_deallocate(entry_get_rule(entry));
406
		entry_change_type (entry, ET_NAME);
396
		entry_change_type(entry, ET_NAME);
407
	    }
397
	    }
408
	    entry = entry_next (entry);
398
	    entry = entry_next(entry);
409
	}
399
	}
410
    }
400
    }
411
}
401
}
412

402

413
/*
403
/*