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-2006 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 68... Line 98...
68
#include "solve-cycles.h"
98
#include "solve-cycles.h"
69
 
99
 
70
/*--------------------------------------------------------------------------*/
100
/*--------------------------------------------------------------------------*/
71
 
101
 
72
ShapeEntryP
102
ShapeEntryP
73
shape_entry_create PROTO_N ((key))
103
shape_entry_create(NStringP key)
74
		   PROTO_T (NStringP key)
-
 
75
{
104
{
76
    ShapeEntryP entry = ALLOCATE (ShapeEntryT);
105
    ShapeEntryP entry = ALLOCATE(ShapeEntryT);
77
 
106
 
78
    entry->next      = NIL (ShapeEntryP);
107
    entry->next      = NIL(ShapeEntryP);
79
    nstring_copy (shape_entry_key (entry), key);
108
    nstring_copy(shape_entry_key(entry), key);
80
    entry->names     = name_table_create ();
109
    entry->names     = name_table_create();
81
    entry->id_count  = 0;
110
    entry->id_count  = 0;
82
    entry->non_empty = FALSE;
111
    entry->non_empty = FALSE;
83
    entry->head      = NIL (NameEntryP);
112
    entry->head      = NIL(NameEntryP);
84
    entry->tail      = &(entry->head);
113
    entry->tail      = & (entry->head);
85
    return (entry);
114
    return(entry);
86
}
115
}
87
 
116
 
88
ShapeEntryP
117
ShapeEntryP
89
shape_entry_next PROTO_N ((entry))
118
shape_entry_next(ShapeEntryP entry)
90
		 PROTO_T (ShapeEntryP entry)
-
 
91
{
119
{
92
    return (entry->next);
120
    return(entry->next);
93
}
121
}
94
 
122
 
95
ShapeEntryP *
123
ShapeEntryP *
96
shape_entry_next_ref PROTO_N ((entry))
124
shape_entry_next_ref(ShapeEntryP entry)
97
		     PROTO_T (ShapeEntryP entry)
-
 
98
{
125
{
99
    return (&(entry->next));
126
    return(& (entry->next));
100
}
127
}
101
 
128
 
102
NStringP
129
NStringP
103
shape_entry_key PROTO_N ((entry))
130
shape_entry_key(ShapeEntryP entry)
104
		PROTO_T (ShapeEntryP entry)
-
 
105
{
131
{
106
    return (&(entry->key));
132
    return(& (entry->key));
107
}
133
}
108
 
134
 
109
NameTableP
135
NameTableP
110
shape_entry_name_table PROTO_N ((entry))
136
shape_entry_name_table(ShapeEntryP entry)
111
		       PROTO_T (ShapeEntryP entry)
-
 
112
{
137
{
113
    return (entry->names);
138
    return(entry->names);
114
}
139
}
115
 
140
 
116
unsigned
141
unsigned
117
shape_entry_next_id PROTO_N ((entry))
142
shape_entry_next_id(ShapeEntryP entry)
118
		    PROTO_T (ShapeEntryP entry)
-
 
119
{
143
{
120
    if (entry->id_count == UINT_MAX) {
144
    if (entry->id_count == UINT_MAX) {
121
	E_too_many_ids ();
145
	E_too_many_ids();
122
    }
146
    }
123
    return (entry->id_count ++);
147
    return(entry->id_count++);
124
}
148
}
125
 
149
 
126
void
150
void
127
shape_entry_set_non_empty PROTO_N ((entry))
151
shape_entry_set_non_empty(ShapeEntryP entry)
128
			  PROTO_T (ShapeEntryP entry)
-
 
129
{
152
{
130
    entry->non_empty = TRUE;
153
    entry->non_empty = TRUE;
131
}
154
}
132
 
155
 
133
BoolT
156
BoolT
134
shape_entry_get_non_empty PROTO_N ((entry))
157
shape_entry_get_non_empty(ShapeEntryP entry)
135
			  PROTO_T (ShapeEntryP entry)
-
 
136
{
158
{
137
    return (entry->non_empty);
159
    return(entry->non_empty);
138
}
160
}
139
 
161
 
140
void
162
void
141
shape_entry_add_to_list PROTO_N ((entry, name_entry))
163
shape_entry_add_to_list(ShapeEntryP entry,				 NameEntryP  name_entry)
142
			PROTO_T (ShapeEntryP entry X
-
 
143
				 NameEntryP  name_entry)
-
 
144
{
164
{
145
    *(entry->tail) = name_entry;
165
    *(entry->tail) = name_entry;
146
    entry->tail    = name_entry_list_next_ref (name_entry);
166
    entry->tail    = name_entry_list_next_ref(name_entry);
147
}
167
}
148
 
168
 
149
NameEntryP
169
NameEntryP
150
shape_entry_get_from_list PROTO_N ((entry))
170
shape_entry_get_from_list(ShapeEntryP entry)
151
			  PROTO_T (ShapeEntryP entry)
-
 
152
{
171
{
153
    NameEntryP name_entry;
172
    NameEntryP name_entry;
154
 
173
 
155
    if ((name_entry = entry->head) != NIL (NameEntryP)) {
174
    if ((name_entry = entry->head) != NIL(NameEntryP)) {
156
	entry->head = name_entry_list_next (name_entry);
175
	entry->head = name_entry_list_next(name_entry);
157
	if (entry->head == NIL (NameEntryP)) {
176
	if (entry->head == NIL(NameEntryP)) {
158
	    entry->tail = (&entry->head);
177
	    entry->tail = (&entry->head);
159
	}
178
	}
160
    }
179
    }
161
    return (name_entry);
180
    return(name_entry);
162
}
181
}
163
 
182
 
164
ShapeEntryP
183
ShapeEntryP
165
shape_entry_deallocate PROTO_N ((entry))
184
shape_entry_deallocate(ShapeEntryP entry)
166
		       PROTO_T (ShapeEntryP entry)
-
 
167
{
185
{
168
    ShapeEntryP next = shape_entry_next (entry);
186
    ShapeEntryP next = shape_entry_next(entry);
169
 
187
 
170
    nstring_destroy (shape_entry_key (entry));
188
    nstring_destroy(shape_entry_key(entry));
171
    name_table_deallocate (shape_entry_name_table (entry));
189
    name_table_deallocate(shape_entry_name_table(entry));
172
    DEALLOCATE (entry);
190
    DEALLOCATE(entry);
173
    return (next);
191
    return(next);
174
}
192
}
175
 
193
 
176
/*--------------------------------------------------------------------------*/
194
/*--------------------------------------------------------------------------*/
177
 
195
 
178
void
196
void
179
shape_entry_do_count PROTO_N ((entry, gclosure))
197
shape_entry_do_count(ShapeEntryP entry,			      GenericP    gclosure)
180
		     PROTO_T (ShapeEntryP entry X
-
 
181
			      GenericP    gclosure)
-
 
182
{
198
{
183
    unsigned *count_ref = (unsigned *) gclosure;
199
    unsigned *count_ref = (unsigned *)gclosure;
184
 
200
 
185
    if ((entry->id_count > 0) || (shape_entry_get_non_empty (entry))) {
201
    if ((entry->id_count > 0) || (shape_entry_get_non_empty(entry))) {
186
	shape_entry_set_non_empty (entry);
202
	shape_entry_set_non_empty(entry);
187
	(*count_ref) ++;
203
	(*count_ref)++;
188
    }
204
    }
189
}
205
}
190
 
206
 
191
void
207
void
192
shape_entry_write_shape PROTO_N ((entry, gclosure))
208
shape_entry_write_shape(ShapeEntryP entry,				 GenericP    gclosure)
193
			PROTO_T (ShapeEntryP entry X
-
 
194
				 GenericP    gclosure)
-
 
195
{
209
{
196
    if (shape_entry_get_non_empty (entry)) {
210
    if (shape_entry_get_non_empty(entry)) {
197
	TDFWriterP writer  = (TDFWriterP) gclosure;
211
	TDFWriterP writer  = (TDFWriterP)gclosure;
198
	NStringP   key     = shape_entry_key (entry);
212
	NStringP   key     = shape_entry_key(entry);
199
	unsigned   num_ids = entry->id_count;
213
	unsigned   num_ids = entry->id_count;
200
 
214
 
201
	debug_info_w_shape (key, num_ids);
215
	debug_info_w_shape(key, num_ids);
202
	tdf_write_string (writer, key);
216
	tdf_write_string(writer, key);
203
	tdf_write_int (writer, num_ids);
217
	tdf_write_int(writer, num_ids);
204
    }
218
    }
205
}
219
}
206
 
220
 
207
void
221
void
208
shape_entry_write_externs PROTO_N ((entry, gclosure))
222
shape_entry_write_externs(ShapeEntryP entry,				   GenericP    gclosure)
209
			  PROTO_T (ShapeEntryP entry X
-
 
210
				   GenericP    gclosure)
-
 
211
{
223
{
212
    if (shape_entry_get_non_empty (entry)) {
224
    if (shape_entry_get_non_empty(entry)) {
213
	TDFWriterP writer      = (TDFWriterP) gclosure;
225
	TDFWriterP writer      = (TDFWriterP)gclosure;
214
	unsigned   num_externs = 0;
226
	unsigned   num_externs = 0;
215
	NameTableP table       = entry->names;
227
	NameTableP table       = entry->names;
216
	NStringP   key         = shape_entry_key (entry);
228
	NStringP   key         = shape_entry_key(entry);
217
 
229
 
218
	name_table_iter (table, name_entry_do_count, (GenericP) &num_externs);
230
	name_table_iter(table, name_entry_do_count,(GenericP) &num_externs);
219
	debug_info_w_start_shape_names (key, num_externs);
231
	debug_info_w_start_shape_names(key, num_externs);
220
	tdf_write_int (writer, num_externs);
232
	tdf_write_int(writer, num_externs);
221
	name_table_iter (table, name_entry_write_name, (GenericP) writer);
233
	name_table_iter(table, name_entry_write_name,(GenericP)writer);
222
    }
234
    }
223
}
235
}
224
 
236
 
225
void
237
void
226
shape_entry_compute_tld_size PROTO_N ((entry, gclosure))
238
shape_entry_compute_tld_size(ShapeEntryP entry,				      GenericP    gclosure)
227
			     PROTO_T (ShapeEntryP entry X
-
 
228
				      GenericP    gclosure)
-
 
229
{
239
{
230
    if (shape_entry_get_non_empty (entry)) {
240
    if (shape_entry_get_non_empty(entry)) {
231
	name_table_iter (entry->names, name_entry_compute_tld_size, gclosure);
241
	name_table_iter(entry->names, name_entry_compute_tld_size, gclosure);
232
    }
242
    }
233
}
243
}
234
 
244
 
235
void
245
void
236
shape_entry_write_tld PROTO_N ((entry, gclosure))
246
shape_entry_write_tld(ShapeEntryP entry,			       GenericP    gclosure)
237
		      PROTO_T (ShapeEntryP entry X
-
 
238
			       GenericP    gclosure)
-
 
239
{
247
{
240
    if (shape_entry_get_non_empty (entry)) {
248
    if (shape_entry_get_non_empty(entry)) {
241
	debug_info_w_start_usages (shape_entry_key (entry));
249
	debug_info_w_start_usages(shape_entry_key(entry));
242
	name_table_iter (entry->names, name_entry_write_tld, gclosure);
250
	name_table_iter(entry->names, name_entry_write_tld, gclosure);
243
    }
251
    }
244
}
252
}
245
 
253
 
246
void
254
void
247
shape_entry_write_count PROTO_N ((entry, gclosure))
255
shape_entry_write_count(ShapeEntryP entry,				 GenericP    gclosure)
248
			PROTO_T (ShapeEntryP entry X
-
 
249
				 GenericP    gclosure)
-
 
250
{
256
{
251
    ShapeClosureP closure = (ShapeClosureP) gclosure;
257
    ShapeClosureP closure = (ShapeClosureP)gclosure;
252
 
258
 
253
    if (shape_entry_get_non_empty (entry)) {
259
    if (shape_entry_get_non_empty(entry)) {
254
	MapTableP  table     = closure->table;
260
	MapTableP  table     = closure->table;
255
	TDFWriterP writer    = closure->writer;
261
	TDFWriterP writer    = closure->writer;
256
	MapEntryP  map_entry = map_table_get (table, shape_entry_key (entry));
262
	MapEntryP  map_entry = map_table_get(table, shape_entry_key(entry));
257
	unsigned   count     = (map_entry ? map_entry_get_count (map_entry) :
263
	unsigned   count     = (map_entry ? map_entry_get_count(map_entry):
258
				0);
264
				0);
259
	NStringP   key       = shape_entry_key (entry);
265
	NStringP   key       = shape_entry_key(entry);
260
 
266
 
261
	debug_info_w_count (count, key);
267
	debug_info_w_count(count, key);
262
	tdf_write_int (writer, count);
268
	tdf_write_int(writer, count);
263
    }
269
    }
264
}
270
}
265
 
271
 
266
void
272
void
267
shape_entry_write_links PROTO_N ((entry, gclosure))
273
shape_entry_write_links(ShapeEntryP entry,				 GenericP    gclosure)
268
			PROTO_T (ShapeEntryP entry X
-
 
269
				 GenericP    gclosure)
-
 
270
{
274
{
271
    ShapeClosureP closure = (ShapeClosureP) gclosure;
275
    ShapeClosureP closure = (ShapeClosureP)gclosure;
272
 
276
 
273
    if (shape_entry_get_non_empty (entry)) {
277
    if (shape_entry_get_non_empty(entry)) {
274
	MapTableP  table     = closure->table;
278
	MapTableP  table     = closure->table;
275
	TDFWriterP writer    = closure->writer;
279
	TDFWriterP writer    = closure->writer;
276
	MapEntryP  map_entry = map_table_get (table, shape_entry_key (entry));
280
	MapEntryP  map_entry = map_table_get(table, shape_entry_key(entry));
277
	NStringP   key       = shape_entry_key (entry);
281
	NStringP   key       = shape_entry_key(entry);
278
 
282
 
279
	if (map_entry) {
283
	if (map_entry) {
280
	    unsigned num_links = map_entry_get_num_links (map_entry);
284
	    unsigned num_links = map_entry_get_num_links(map_entry);
281
	    unsigned i;
285
	    unsigned i;
282
 
286
 
283
	    debug_info_w_start_shape_maps (key, num_links);
287
	    debug_info_w_start_shape_maps(key, num_links);
284
	    tdf_write_int (writer, num_links);
288
	    tdf_write_int(writer, num_links);
285
	    for (i = 0; i < num_links; i ++) {
289
	    for (i = 0; i < num_links; i++) {
286
		unsigned internal;
290
		unsigned internal;
287
		unsigned external;
291
		unsigned external;
288
 
292
 
289
		map_entry_get_link (map_entry, i , &internal, &external);
293
		map_entry_get_link(map_entry, i , &internal, &external);
290
		debug_info_w_map (internal, external);
294
		debug_info_w_map(internal, external);
291
		tdf_write_int (writer, internal);
295
		tdf_write_int(writer, internal);
292
		tdf_write_int (writer, external);
296
		tdf_write_int(writer, external);
293
	    }
297
	    }
294
	} else {
298
	} else {
295
	    debug_info_w_start_shape_maps (key, (unsigned) 0);
299
	    debug_info_w_start_shape_maps(key,(unsigned)0);
296
	    tdf_write_int (writer, (unsigned) 0);
300
	    tdf_write_int(writer,(unsigned)0);
297
	}
301
	}
298
    }
302
    }
299
}
303
}
300
 
304
 
301
void
305
void
302
shape_entry_check_multi_defs PROTO_N ((entry, gclosure))
306
shape_entry_check_multi_defs(ShapeEntryP entry,				      GenericP    gclosure)
303
			     PROTO_T (ShapeEntryP entry X
-
 
304
				      GenericP    gclosure)
-
 
305
{
307
{
306
    NameTableP table = shape_entry_name_table (entry);
308
    NameTableP table = shape_entry_name_table(entry);
307
    NStringP   key   = shape_entry_key (entry);
309
    NStringP   key   = shape_entry_key(entry);
308
 
310
 
309
    UNUSED (gclosure);
311
    UNUSED(gclosure);
310
    name_table_iter (table, name_entry_check_multi_defs, (GenericP) key);
312
    name_table_iter(table, name_entry_check_multi_defs,(GenericP)key);
311
}
313
}
312
 
314
 
313
void
315
void
314
shape_entry_do_lib_count PROTO_N ((entry, gclosure))
316
shape_entry_do_lib_count(ShapeEntryP entry,				  GenericP    gclosure)
315
			 PROTO_T (ShapeEntryP entry X
-
 
316
				  GenericP    gclosure)
-
 
317
{
317
{
318
    NameTableP table     = shape_entry_name_table (entry);
318
    NameTableP table     = shape_entry_name_table(entry);
319
    unsigned   num_names = 0;
319
    unsigned   num_names = 0;
320
 
320
 
321
    name_table_iter (table, name_entry_do_lib_count, (GenericP) &num_names);
321
    name_table_iter(table, name_entry_do_lib_count,(GenericP) &num_names);
322
    if (num_names > 0) {
322
    if (num_names > 0) {
323
	unsigned *num_shapes_ref = (unsigned *) gclosure;
323
	unsigned *num_shapes_ref = (unsigned *)gclosure;
324
 
324
 
325
	(*num_shapes_ref) ++;
325
	(*num_shapes_ref)++;
326
    }
326
    }
327
    entry->num_lib_names = num_names;
327
    entry->num_lib_names = num_names;
328
}
328
}
329
 
329
 
330
void
330
void
331
shape_entry_do_lib_write PROTO_N ((entry, gclosure))
331
shape_entry_do_lib_write(ShapeEntryP entry,				  GenericP    gclosure)
332
			 PROTO_T (ShapeEntryP entry X
-
 
333
				  GenericP    gclosure)
-
 
334
{
332
{
335
    unsigned num_names = entry->num_lib_names;
333
    unsigned num_names = entry->num_lib_names;
336
 
334
 
337
    if (num_names > 0) {
335
    if (num_names > 0) {
338
	TDFWriterP writer = (TDFWriterP) gclosure;
336
	TDFWriterP writer = (TDFWriterP)gclosure;
339
	NameTableP table  = shape_entry_name_table (entry);
337
	NameTableP table  = shape_entry_name_table(entry);
340
	NStringP   key    = shape_entry_key (entry);
338
	NStringP   key    = shape_entry_key(entry);
341
 
339
 
342
	debug_info_w_start_shape_index (key, num_names);
340
	debug_info_w_start_shape_index(key, num_names);
343
	tdf_write_string (writer, shape_entry_key (entry));
341
	tdf_write_string(writer, shape_entry_key(entry));
344
	tdf_write_int (writer, num_names);
342
	tdf_write_int(writer, num_names);
345
	name_table_iter (table, name_entry_do_lib_write, gclosure);
343
	name_table_iter(table, name_entry_do_lib_write, gclosure);
346
    }
344
    }
347
}
345
}
348
 
346
 
349
void
347
void
350
shape_entry_resolve_undefined PROTO_N ((entry, gclosure))
348
shape_entry_resolve_undefined(ShapeEntryP entry,				       GenericP    gclosure)
351
			      PROTO_T (ShapeEntryP entry X
-
 
352
				       GenericP    gclosure)
-
 
353
{
349
{
354
    ShapeLibClosureP closure   = (ShapeLibClosureP) gclosure;
350
    ShapeLibClosureP closure   = (ShapeLibClosureP)gclosure;
355
    NStringP         key       = shape_entry_key (entry);
351
    NStringP         key       = shape_entry_key(entry);
356
    ShapeEntryP      lib_entry = shape_table_get (closure->lib_shapes, key);
352
    ShapeEntryP      lib_entry = shape_table_get(closure->lib_shapes, key);
357
    NameTableP       table     = ((lib_entry != NIL (ShapeEntryP)) ?
353
    NameTableP       table     = ((lib_entry != NIL(ShapeEntryP))?
358
				  shape_entry_name_table (lib_entry) :
354
				  shape_entry_name_table(lib_entry):
359
				  NIL (NameTableP));
355
				  NIL(NameTableP));
360
    NameEntryP       name_entry;
356
    NameEntryP       name_entry;
361
 
357
 
362
    while ((name_entry = shape_entry_get_from_list (entry)) !=
358
    while ((name_entry = shape_entry_get_from_list(entry)) !=
363
	   NIL (NameEntryP)) {
359
	   NIL(NameEntryP)) {
364
	if (name_entry_resolve_undefined (name_entry, table, closure->units,
360
	if (name_entry_resolve_undefined(name_entry, table, closure->units,
365
					  closure->shapes, key)) {
361
					  closure->shapes, key)) {
366
	    closure->did_define = TRUE;
362
	    closure->did_define = TRUE;
367
	}
363
	}
368
    }
364
    }
369
}
365
}
370
 
366
 
371
void
367
void
372
shape_entry_hide_all_defd PROTO_N ((entry, gclosure))
368
shape_entry_hide_all_defd(ShapeEntryP entry,				   GenericP    gclosure)
373
			  PROTO_T (ShapeEntryP entry X
-
 
374
				   GenericP    gclosure)
-
 
375
{
369
{
376
    NameTableP table = shape_entry_name_table (entry);
370
    NameTableP table = shape_entry_name_table(entry);
377
    NStringP   shape = shape_entry_key (entry);
371
    NStringP   shape = shape_entry_key(entry);
378
 
372
 
379
    UNUSED (gclosure);
373
    UNUSED(gclosure);
380
    name_table_iter (table, name_entry_hide_defd, (GenericP) shape);
374
    name_table_iter(table, name_entry_hide_defd,(GenericP)shape);
381
}
375
}
382
 
376
 
383
void
377
void
384
shape_entry_suppress_mult PROTO_N ((entry, gclosure))
378
shape_entry_suppress_mult(ShapeEntryP entry,				   GenericP    gclosure)
385
			  PROTO_T (ShapeEntryP entry X
-
 
386
				   GenericP    gclosure)
-
 
387
{
379
{
388
    NameTableP table = shape_entry_name_table (entry);
380
    NameTableP table = shape_entry_name_table(entry);
389
    NStringP   shape = shape_entry_key (entry);
381
    NStringP   shape = shape_entry_key(entry);
390
 
382
 
391
    UNUSED (gclosure);
383
    UNUSED(gclosure);
392
    name_table_iter (table, name_entry_suppress_mult, (GenericP) shape);
384
    name_table_iter(table, name_entry_suppress_mult,(GenericP)shape);
393
}
385
}
394
 
386
 
395
void
387
void
396
shape_entry_lib_suppress_mult PROTO_N ((entry, gclosure))
388
shape_entry_lib_suppress_mult(ShapeEntryP entry,				       GenericP    gclosure)
397
			      PROTO_T (ShapeEntryP entry X
-
 
398
				       GenericP    gclosure)
-
 
399
{
389
{
400
    NameTableP table = shape_entry_name_table (entry);
390
    NameTableP table = shape_entry_name_table(entry);
401
    NStringP   shape = shape_entry_key (entry);
391
    NStringP   shape = shape_entry_key(entry);
402
 
392
 
403
    UNUSED (gclosure);
393
    UNUSED(gclosure);
404
    name_table_iter (table, name_entry_lib_suppress_mult, (GenericP) shape);
394
    name_table_iter(table, name_entry_lib_suppress_mult,(GenericP)shape);
405
}
395
}
406
 
396
 
407
void
397
void
408
shape_entry_show_content PROTO_N ((entry, gclosure))
398
shape_entry_show_content(ShapeEntryP entry,				  GenericP    gclosure)
409
			 PROTO_T (ShapeEntryP entry X
-
 
410
				  GenericP    gclosure)
-
 
411
{
399
{
412
    UNUSED (gclosure);
400
    UNUSED(gclosure);
413
    write_nstring (ostream_output, shape_entry_key (entry));
401
    write_nstring(ostream_output, shape_entry_key(entry));
414
    write_char (ostream_output, ':');
402
    write_char(ostream_output, ':');
415
    write_newline (ostream_output);
403
    write_newline(ostream_output);
416
    name_table_iter (shape_entry_name_table (entry), name_entry_show_content,
404
    name_table_iter(shape_entry_name_table(entry), name_entry_show_content,
417
		     NIL (GenericP));
405
		     NIL(GenericP));
418
}
406
}
419

407

420
/*
408
/*
421
 * Local variables(smf):
409
 * Local variables(smf):
422
 * eval: (include::add-path-entry "../os-interface" "../library")
410
 * eval: (include::add-path-entry "../os-interface" "../library")