Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 243

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 247

Warning: Undefined variable $m in /usr/local/www/websvn.planix.org/include/diff_util.php on line 251

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 243

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 247

Warning: Undefined variable $m in /usr/local/www/websvn.planix.org/include/diff_util.php on line 251

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 243

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 247

Warning: Undefined variable $m in /usr/local/www/websvn.planix.org/include/diff_util.php on line 251
WebSVN – tendra.SVN – Diff – /branches/tendra5/src/tools/tld/debug.c – Rev 5 and 6

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 67... Line 97...
67
 
97
 
68
#include "solve-cycles.h"
98
#include "solve-cycles.h"
69
 
99
 
70
/*--------------------------------------------------------------------------*/
100
/*--------------------------------------------------------------------------*/
71
 
101
 
72
static OStreamP	debug_file   = NIL (OStreamP);
102
static OStreamP	debug_file   = NIL(OStreamP);
73
 
103
 
74
/*--------------------------------------------------------------------------*/
104
/*--------------------------------------------------------------------------*/
75
 
105
 
76
void
106
void
77
debug_set_file PROTO_N ((file))
107
debug_set_file(OStreamP file)
78
	       PROTO_T (OStreamP file)
-
 
79
{
108
{
80
    if (ostream_is_open (file)) {
109
    if (ostream_is_open(file)) {
81
	debug_file = file;
110
	debug_file = file;
82
    } else {
111
    } else {
193
{
226
{
194
    if (debug_file) {
227
    if (debug_file) {
195
	write_cstring (debug_file, "    Reading ");
228
	write_cstring(debug_file, "      ");
-
 
229
	write_name_key(debug_file, name);
-
 
230
	write_cstring(debug_file, ", ");
196
	write_unsigned (debug_file, num_names);
231
	write_unsigned(debug_file, old_id);
197
	write_cstring (debug_file, " external ");
232
	write_cstring(debug_file, " -> ");
198
	write_nstring (debug_file, shape);
233
	write_unsigned(debug_file, new_id);
199
	write_cstring (debug_file, " names:");
234
	write_cstring(debug_file, " (");
-
 
235
	write_name_key(debug_file, key);
-
 
236
	write_char(debug_file, ')');
200
	write_newline (debug_file);
237
	write_newline(debug_file);
201
    }
238
    }
202
}
239
}
203
 
240
 
204
void
241
void
205
debug_info_r_name PROTO_N ((name, old_id, new_id, key))
-
 
206
		  PROTO_T (NameKeyP name X
-
 
207
			   unsigned old_id X
-
 
208
			   unsigned new_id X
-
 
209
			   NameKeyP key)
-
 
210
{
-
 
211
    if (debug_file) {
-
 
212
	write_cstring (debug_file, "      ");
-
 
213
	write_name_key (debug_file, name);
-
 
214
	write_cstring (debug_file, ", ");
-
 
215
	write_unsigned (debug_file, old_id);
-
 
216
	write_cstring (debug_file, " -> ");
-
 
217
	write_unsigned (debug_file, new_id);
-
 
218
	write_cstring (debug_file, " (");
-
 
219
	write_name_key (debug_file, key);
-
 
220
	write_char (debug_file, ')');
-
 
221
	write_newline (debug_file);
-
 
222
    }
-
 
223
}
-
 
224
 
-
 
225
void
-
 
226
debug_info_r_start_unit_sets PROTO_N ((num_unit_sets))
242
debug_info_r_start_unit_sets(unsigned num_unit_sets)
227
			     PROTO_T (unsigned num_unit_sets)
-
 
228
{
243
{
229
    if (debug_file) {
244
    if (debug_file) {
230
	write_cstring (debug_file, "  Reading ");
245
	write_cstring(debug_file, "  Reading ");
231
	write_unsigned (debug_file, num_unit_sets);
246
	write_unsigned(debug_file, num_unit_sets);
232
	write_cstring (debug_file, " unit sets:");
247
	write_cstring(debug_file, " unit sets:");
233
	write_newline (debug_file);
248
	write_newline(debug_file);
234
    }
249
    }
235
}
250
}
236
 
251
 
237
void
252
void
238
debug_info_r_start_units PROTO_N ((unit_set, num_units))
253
debug_info_r_start_units(NStringP unit_set,				  unsigned num_units)
239
			 PROTO_T (NStringP unit_set X
-
 
240
				  unsigned num_units)
-
 
241
{
254
{
242
    if (debug_file) {
255
    if (debug_file) {
243
	write_cstring (debug_file, "    Reading ");
256
	write_cstring(debug_file, "    Reading ");
244
	write_unsigned (debug_file, num_units);
257
	write_unsigned(debug_file, num_units);
245
	write_char (debug_file, ' ');
258
	write_char(debug_file, ' ');
246
	write_nstring (debug_file, unit_set);
259
	write_nstring(debug_file, unit_set);
247
	write_cstring (debug_file, " units:");
260
	write_cstring(debug_file, " units:");
248
	write_newline (debug_file);
261
	write_newline(debug_file);
249
    }
262
    }
250
}
263
}
251
 
264
 
252
void
265
void
253
debug_info_r_start_unit PROTO_N ((unit_set, unit, num_units))
266
debug_info_r_start_unit(NStringP unit_set,				 unsigned unit, 
254
			PROTO_T (NStringP unit_set X
-
 
255
				 unsigned unit X
-
 
256
				 unsigned num_units)
267
				 unsigned num_units)
257
{
268
{
258
    if (debug_file) {
269
    if (debug_file) {
259
	write_cstring (debug_file, "      Reading ");
270
	write_cstring(debug_file, "      Reading ");
260
	write_nstring (debug_file, unit_set);
271
	write_nstring(debug_file, unit_set);
261
	write_cstring (debug_file, " unit ");
272
	write_cstring(debug_file, " unit ");
262
	write_unsigned (debug_file, unit);
273
	write_unsigned(debug_file, unit);
263
	write_cstring (debug_file, " of ");
274
	write_cstring(debug_file, " of ");
264
	write_unsigned (debug_file, num_units);
275
	write_unsigned(debug_file, num_units);
265
	write_char (debug_file, ':');
276
	write_char(debug_file, ':');
266
	write_newline (debug_file);
277
	write_newline(debug_file);
267
    }
278
    }
268
}
279
}
269
 
280
 
270
void
281
void
271
debug_info_r_start_counts PROTO_N ((num_counts))
282
debug_info_r_start_counts(unsigned num_counts)
272
			  PROTO_T (unsigned num_counts)
-
 
273
{
283
{
274
    if (debug_file) {
284
    if (debug_file) {
275
	write_cstring (debug_file, "        Reading ");
285
	write_cstring(debug_file, "        Reading ");
276
	write_unsigned (debug_file, num_counts);
286
	write_unsigned(debug_file, num_counts);
277
	write_cstring (debug_file, " counts:");
287
	write_cstring(debug_file, " counts:");
278
	write_newline (debug_file);
288
	write_newline(debug_file);
279
    }
289
    }
280
}
290
}
281
 
291
 
282
void
292
void
283
debug_info_r_count PROTO_N ((count, shape))
293
debug_info_r_count(unsigned count,			    NStringP shape)
284
		   PROTO_T (unsigned count X
-
 
285
			    NStringP shape)
-
 
286
{
294
{
287
    if (debug_file) {
295
    if (debug_file) {
288
	write_cstring (debug_file, "          ");
296
	write_cstring(debug_file, "          ");
289
	write_unsigned (debug_file, count);
297
	write_unsigned(debug_file, count);
290
	write_cstring (debug_file, " (");
298
	write_cstring(debug_file, " (");
291
	write_nstring (debug_file, shape);
299
	write_nstring(debug_file, shape);
292
	write_char (debug_file, ')');
300
	write_char(debug_file, ')');
293
	write_newline (debug_file);
301
	write_newline(debug_file);
294
    }
302
    }
295
}
303
}
296
 
304
 
297
void
305
void
298
debug_info_r_start_maps PROTO_N ((num_maps))
306
debug_info_r_start_maps(unsigned num_maps)
-
 
307
{
-
 
308
    if (debug_file) {
-
 
309
	write_cstring(debug_file, "        Reading ");
299
			PROTO_T (unsigned num_maps)
310
	write_unsigned(debug_file, num_maps);
-
 
311
	write_cstring(debug_file, " mapping categories:");
-
 
312
	write_newline(debug_file);
-
 
313
    }
-
 
314
}
-
 
315
 
-
 
316
void
-
 
317
debug_info_r_start_shape_maps(NStringP shape,				       unsigned num_maps)
300
{
318
{
301
    if (debug_file) {
319
    if (debug_file) {
302
	write_cstring (debug_file, "        Reading ");
320
	write_cstring(debug_file, "          Reading ");
303
	write_unsigned (debug_file, num_maps);
321
	write_unsigned(debug_file, num_maps);
-
 
322
	write_char(debug_file, ' ');
-
 
323
	write_nstring(debug_file, shape);
304
	write_cstring (debug_file, " mapping categories:");
324
	write_cstring(debug_file, " mappings:");
305
	write_newline (debug_file);
325
	write_newline(debug_file);
306
    }
326
    }
307
}
327
}
308
 
328
 
309
void
329
void
310
debug_info_r_start_shape_maps PROTO_N ((shape, num_maps))
330
debug_info_r_map(unsigned internal,			  unsigned old_external, 
311
			      PROTO_T (NStringP shape X
-
 
312
				       unsigned num_maps)
331
			  unsigned new_external)
313
{
332
{
314
    if (debug_file) {
333
    if (debug_file) {
315
	write_cstring (debug_file, "          Reading ");
334
	write_cstring(debug_file, "            ");
316
	write_unsigned (debug_file, num_maps);
335
	write_unsigned(debug_file, internal);
317
	write_char (debug_file, ' ');
336
	write_cstring(debug_file, ", ");
-
 
337
	write_unsigned(debug_file, old_external);
318
	write_nstring (debug_file, shape);
338
	write_cstring(debug_file, " -> ");
319
	write_cstring (debug_file, " mappings:");
339
	write_unsigned(debug_file, new_external);
320
	write_newline (debug_file);
340
	write_newline(debug_file);
321
    }
341
    }
322
}
342
}
323
 
343
 
324
void
344
void
519
void
558
void
520
debug_info_w_name PROTO_N ((name, id))
559
debug_info_w_start_counts(unsigned num_counts)
521
		  PROTO_T (NameKeyP name X
-
 
522
			   unsigned id)
-
 
523
{
560
{
524
    if (debug_file) {
561
    if (debug_file) {
525
	write_cstring (debug_file, "      ");
562
	write_cstring(debug_file, "        Writing ");
526
	write_name_key (debug_file, name);
563
	write_unsigned(debug_file, num_counts);
527
	write_cstring (debug_file, ", ");
564
	write_cstring(debug_file, " counts:");
528
	write_unsigned (debug_file, id);
-
 
529
	write_newline (debug_file);
565
	write_newline(debug_file);
530
    }
566
    }
531
}
567
}
532
 
568
 
533
void
569
void
534
debug_info_w_start_unit_sets PROTO_N ((num_unit_sets))
570
debug_info_w_count(unsigned count,			    NStringP shape)
535
			     PROTO_T (unsigned num_unit_sets)
-
 
536
{
571
{
537
    if (debug_file) {
572
    if (debug_file) {
538
	write_cstring (debug_file, "  Writing ");
573
	write_cstring(debug_file, "          ");
539
	write_unsigned (debug_file, num_unit_sets);
574
	write_unsigned(debug_file, count);
540
	write_cstring (debug_file, " unit sets:");
575
	write_cstring(debug_file, " (");
-
 
576
	write_nstring(debug_file, shape);
-
 
577
	write_char(debug_file, ')');
541
	write_newline (debug_file);
578
	write_newline(debug_file);
542
    }
579
    }
543
}
580
}
544
 
581
 
545
void
582
void
546
debug_info_w_start_units PROTO_N ((unit_set, num_units))
583
debug_info_w_start_maps(unsigned num_maps)
-
 
584
{
547
			 PROTO_T (NStringP unit_set X
585
    if (debug_file) {
-
 
586
	write_cstring(debug_file, "        Writing ");
-
 
587
	write_unsigned(debug_file, num_maps);
-
 
588
	write_cstring(debug_file, " mapping categories:");
548
				  unsigned num_units)
589
	write_newline(debug_file);
-
 
590
    }
-
 
591
}
-
 
592
 
-
 
593
void
-
 
594
debug_info_w_start_shape_maps(NStringP shape,				       unsigned num_maps)
549
{
595
{
550
    if (debug_file) {
596
    if (debug_file) {
551
	write_cstring (debug_file, "    Writing ");
597
	write_cstring(debug_file, "          Writing ");
552
	write_unsigned (debug_file, num_units);
598
	write_unsigned(debug_file, num_maps);
553
	write_char (debug_file, ' ');
599
	write_char(debug_file, ' ');
554
	write_nstring (debug_file, unit_set);
600
	write_nstring(debug_file, shape);
555
	write_cstring (debug_file, " units:");
601
	write_cstring(debug_file, " mappings:");
556
	write_newline (debug_file);
602
	write_newline(debug_file);
557
    }
603
    }
558
}
604
}
559
 
605
 
560
void
606
void
772
void
799
void
773
debug_info_r_start_index PROTO_N ((num_shapes))
800
debug_info_w_start_library(CStringP name)
774
			 PROTO_T (unsigned num_shapes)
-
 
775
{
801
{
776
    if (debug_file) {
802
    if (debug_file) {
777
	write_cstring (debug_file, "    Reading ");
803
	write_cstring(debug_file, "Writing library '");
778
	write_unsigned (debug_file, num_shapes);
804
	write_cstring(debug_file, name);
779
	write_cstring (debug_file, " shape indices:");
805
	write_cstring(debug_file, "':");
780
	write_newline (debug_file);
806
	write_newline(debug_file);
781
    }
807
    }
782
}
808
}
783
 
809
 
784
void
810
void
785
debug_info_r_start_shape_index PROTO_N ((shape, num_names))
811
debug_info_w_lib_versions(unsigned major, unsigned minor)
786
			       PROTO_T (NStringP shape X
-
 
787
					unsigned num_names)
-
 
788
{
812
{
789
    if (debug_file) {
813
    if (debug_file) {
790
	write_cstring (debug_file, "      Reading ");
814
	write_cstring (debug_file, "  Writing major version: ");
791
	write_unsigned (debug_file, num_names);
815
	write_unsigned(debug_file, major);
792
	write_cstring (debug_file, " entries in ");
816
	write_cstring (debug_file, "; minor version: ");
793
	write_nstring (debug_file, shape);
817
	write_unsigned(debug_file, minor);
794
	write_cstring (debug_file, " external name index:");
-
 
795
	write_newline (debug_file);
818
	write_newline (debug_file);
796
    }
819
    }
797
}
820
}
798
 
821
 
799
void
822
void
-
 
823
debug_info_w_library_version(unsigned version)
-
 
824
{
-
 
825
    if (debug_file) {
-
 
826
	write_cstring(debug_file, "  Writing type ");
-
 
827
	write_unsigned(debug_file, version);
-
 
828
	write_cstring(debug_file, " library:");
-
 
829
	write_newline(debug_file);
-
 
830
    }
-
 
831
}
-
 
832
 
-
 
833
void
-
 
834
debug_info_w_start_capsules(unsigned num_capsules)
-
 
835
{
-
 
836
    if (debug_file) {
-
 
837
	write_cstring(debug_file, "    Writing ");
-
 
838
	write_unsigned(debug_file, num_capsules);
-
 
839
	write_cstring(debug_file, " capsules:");
-
 
840
	write_newline(debug_file);
-
 
841
    }
-
 
842
}
-
 
843
 
-
 
844
void
800
debug_info_r_index_entry PROTO_N ((name, use, name_use, key, cap_name))
845
debug_info_w_capsule(CStringP name,			      unsigned length)
-
 
846
{
-
 
847
    if (debug_file) {
-
 
848
	write_cstring(debug_file, "      Saved '");
801
			 PROTO_T (NameKeyP name X
849
	write_cstring(debug_file, name);
-
 
850
	write_cstring(debug_file, "', ");
-
 
851
	write_unsigned(debug_file, length);
-
 
852
	write_cstring(debug_file, " bytes");
-
 
853
	write_newline(debug_file);
-
 
854
    }
-
 
855
}
-
 
856
 
-
 
857
void
-
 
858
debug_info_w_start_index(unsigned num_shapes)
-
 
859
{
-
 
860
    if (debug_file) {
-
 
861
	write_cstring(debug_file, "    Writing ");
-
 
862
	write_unsigned(debug_file, num_shapes);
-
 
863
	write_cstring(debug_file, " shape indices:");
-
 
864
	write_newline(debug_file);
-
 
865
    }
-
 
866
}
-
 
867
 
-
 
868
void
-
 
869
debug_info_w_start_shape_index(NStringP shape,					unsigned num_names)
-
 
870
{
-
 
871
    if (debug_file) {
-
 
872
	write_cstring(debug_file, "      Writing ");
-
 
873
	write_unsigned(debug_file, num_names);
-
 
874
	write_cstring(debug_file, " entries in ");
-
 
875
	write_nstring(debug_file, shape);
-
 
876
	write_cstring(debug_file, " external name index:");
-
 
877
	write_newline(debug_file);
-
 
878
    }
-
 
879
}
-
 
880
 
-
 
881
void
-
 
882
debug_info_w_index_entry(NameKeyP key,				  unsigned use, 
802
				  unsigned use X
883
				  CStringP cap_name, 
803
				  unsigned name_use X
884
				  unsigned cap_index)
-
 
885
{
804
				  NameKeyP key X
886
    if (debug_file) {
-
 
887
	write_cstring(debug_file, "        ");
-
 
888
	write_name_key(debug_file, key);
-
 
889
	write_cstring(debug_file, ", ");
-
 
890
	write_usage(debug_file, use);
-
 
891
	write_cstring(debug_file, ", '");
805
				  CStringP cap_name)
892
	write_cstring(debug_file, cap_name);
-
 
893
	write_cstring(debug_file, "' (");
-
 
894
	write_unsigned(debug_file, cap_index);
-
 
895
	write_char(debug_file, ')');
-
 
896
	write_newline(debug_file);
-
 
897
    }
-
 
898
}
-
 
899
 
-
 
900
void
-
 
901
debug_info_w_end_library(void)
806
{
902
{
807
    if (debug_file) {
903
    if (debug_file) {
808
	write_cstring (debug_file, "        ");
-
 
809
	write_name_key (debug_file, name);
-
 
810
	write_cstring (debug_file, ", ");
-
 
811
	write_usage (debug_file, use);
-
 
812
	write_cstring (debug_file, ", '");
-
 
813
	write_cstring (debug_file, cap_name);
-
 
814
	write_cstring (debug_file, "' (");
-
 
815
	write_name_key (debug_file, key);
-
 
816
	write_cstring (debug_file, ", ");
-
 
817
	write_usage (debug_file, name_use);
-
 
818
	write_char (debug_file, ')');
-
 
819
	write_newline (debug_file);
-
 
820
    }
-
 
821
}
-
 
822
 
-
 
823
void
-
 
824
debug_info_r_end_library PROTO_Z ()
-
 
825
{
-
 
826
    if (debug_file) {
-
 
827
	write_cstring (debug_file, "Finished reading library");
-
 
828
	write_newline (debug_file);
-
 
829
    }
-
 
830
}
-
 
831
 
-
 
832
void
-
 
833
debug_info_r_abort_library PROTO_Z ()
-
 
834
{
-
 
835
    if (debug_file) {
-
 
836
	write_cstring (debug_file, "Aborted reading library");
-
 
837
	write_newline (debug_file);
-
 
838
    }
-
 
839
}
-
 
840
 
-
 
841
/*--------------------------------------------------------------------------*/
-
 
842
 
-
 
843
void
-
 
844
debug_info_w_start_library PROTO_N ((name))
-
 
845
			   PROTO_T (CStringP name)
-
 
846
{
-
 
847
    if (debug_file) {
-
 
848
	write_cstring (debug_file, "Writing library '");
-
 
849
	write_cstring (debug_file, name);
-
 
850
	write_cstring (debug_file, "':");
-
 
851
	write_newline (debug_file);
-
 
852
    }
-
 
853
}
-
 
854
 
-
 
855
void
-
 
856
debug_info_w_lib_versions PROTO_N ((major, minor))
-
 
857
    			  PROTO_T (unsigned major X unsigned minor)
-
 
858
{
-
 
859
    if (debug_file) {
-
 
860
	write_cstring  (debug_file, "  Writing major version: ");
-
 
861
	write_unsigned (debug_file, major);
-
 
862
	write_cstring  (debug_file, "; minor version: ");
-
 
863
	write_unsigned (debug_file, minor);
-
 
864
	write_newline  (debug_file);
-
 
865
    }
-
 
866
}
-
 
867
 
-
 
868
void
-
 
869
debug_info_w_library_version PROTO_N ((version))
-
 
870
			     PROTO_T (unsigned version)
-
 
871
{
-
 
872
    if (debug_file) {
-
 
873
	write_cstring (debug_file, "  Writing type ");
-
 
874
	write_unsigned (debug_file, version);
-
 
875
	write_cstring (debug_file, " library:");
-
 
876
	write_newline (debug_file);
-
 
877
    }
-
 
878
}
-
 
879
 
-
 
880
void
-
 
881
debug_info_w_start_capsules PROTO_N ((num_capsules))
-
 
882
			    PROTO_T (unsigned num_capsules)
-
 
883
{
-
 
884
    if (debug_file) {
-
 
885
	write_cstring (debug_file, "    Writing ");
-
 
886
	write_unsigned (debug_file, num_capsules);
-
 
887
	write_cstring (debug_file, " capsules:");
-
 
888
	write_newline (debug_file);
-
 
889
    }
-
 
890
}
-
 
891
 
-
 
892
void
-
 
893
debug_info_w_capsule PROTO_N ((name, length))
-
 
894
		     PROTO_T (CStringP name X
-
 
895
			      unsigned length)
-
 
896
{
-
 
897
    if (debug_file) {
-
 
898
	write_cstring (debug_file, "      Saved '");
-
 
899
	write_cstring (debug_file, name);
-
 
900
	write_cstring (debug_file, "', ");
-
 
901
	write_unsigned (debug_file, length);
-
 
902
	write_cstring (debug_file, " bytes");
-
 
903
	write_newline (debug_file);
-
 
904
    }
-
 
905
}
-
 
906
 
-
 
907
void
-
 
908
debug_info_w_start_index PROTO_N ((num_shapes))
-
 
909
			 PROTO_T (unsigned num_shapes)
-
 
910
{
-
 
911
    if (debug_file) {
-
 
912
	write_cstring (debug_file, "    Writing ");
-
 
913
	write_unsigned (debug_file, num_shapes);
-
 
914
	write_cstring (debug_file, " shape indices:");
-
 
915
	write_newline (debug_file);
-
 
916
    }
-
 
917
}
-
 
918
 
-
 
919
void
-
 
920
debug_info_w_start_shape_index PROTO_N ((shape, num_names))
-
 
921
			       PROTO_T (NStringP shape X
-
 
922
					unsigned num_names)
-
 
923
{
-
 
924
    if (debug_file) {
-
 
925
	write_cstring (debug_file, "      Writing ");
-
 
926
	write_unsigned (debug_file, num_names);
-
 
927
	write_cstring (debug_file, " entries in ");
-
 
928
	write_nstring (debug_file, shape);
-
 
929
	write_cstring (debug_file, " external name index:");
-
 
930
	write_newline (debug_file);
-
 
931
    }
-
 
932
}
-
 
933
 
-
 
934
void
-
 
935
debug_info_w_index_entry PROTO_N ((key, use, cap_name, cap_index))
-
 
936
			 PROTO_T (NameKeyP key X
-
 
937
				  unsigned use X
-
 
938
				  CStringP cap_name X
-
 
939
				  unsigned cap_index)
-
 
940
{
-
 
941
    if (debug_file) {
-
 
942
	write_cstring (debug_file, "        ");
-
 
943
	write_name_key (debug_file, key);
-
 
944
	write_cstring (debug_file, ", ");
-
 
945
	write_usage (debug_file, use);
-
 
946
	write_cstring (debug_file, ", '");
-
 
947
	write_cstring (debug_file, cap_name);
-
 
948
	write_cstring (debug_file, "' (");
-
 
949
	write_unsigned (debug_file, cap_index);
-
 
950
	write_char (debug_file, ')');
-
 
951
	write_newline (debug_file);
-
 
952
    }
-
 
953
}
-
 
954
 
-
 
955
void
-
 
956
debug_info_w_end_library PROTO_Z ()
-
 
957
{
-
 
958
    if (debug_file) {
-
 
959
	write_cstring (debug_file, "Finished writing library");
904
	write_cstring(debug_file, "Finished writing library");
960
	write_newline (debug_file);
905
	write_newline(debug_file);
961
    }
906
    }
962
}
907
}
963
 
908
 
964
/*--------------------------------------------------------------------------*/
909
/*--------------------------------------------------------------------------*/
965
 
910
 
966
void
911
void
967
debug_info_l_not_needed PROTO_N ((key, shape_key, use))
912
debug_info_l_not_needed(NameKeyP key,				 NStringP shape_key, 
968
			PROTO_T (NameKeyP key X
-
 
969
				 NStringP shape_key X
-
 
970
				 unsigned use)
913
				 unsigned use)
971
{
914
{
972
    if (debug_file) {
915
    if (debug_file) {
973
	write_cstring (debug_file, "No definition needed for ");
916
	write_cstring(debug_file, "No definition needed for ");
974
	write_nstring (debug_file, shape_key);
917
	write_nstring(debug_file, shape_key);
975
	write_cstring (debug_file, " '");
918
	write_cstring(debug_file, " '");
976
	write_name_key (debug_file, key);
919
	write_name_key(debug_file, key);
977
	write_cstring (debug_file, "' (");
920
	write_cstring(debug_file, "' (");
978
	write_usage (debug_file, use);
921
	write_usage(debug_file, use);
979
	write_char (debug_file, ')');
922
	write_char(debug_file, ')');
980
	write_newline (debug_file);
923
	write_newline(debug_file);
981
    }
924
    }
982
}
925
}
983
 
926
 
984
void
927
void
985
debug_info_l_not_found PROTO_N ((key, shape_key, use))
928
debug_info_l_not_found(NameKeyP key,				NStringP shape_key, 
986
		       PROTO_T (NameKeyP key X
-
 
987
				NStringP shape_key X
-
 
988
				unsigned use)
929
				unsigned use)
989
{
-
 
990
    if (debug_file) {
-
 
991
	write_cstring (debug_file, "No definition found for ");
-
 
992
	write_nstring (debug_file, shape_key);
-
 
993
	write_cstring (debug_file, " '");
-
 
994
	write_name_key (debug_file, key);
-
 
995
	write_cstring (debug_file, "' (");
-
 
996
	write_usage (debug_file, use);
-
 
997
	write_char (debug_file, ')');
-
 
998
	write_newline (debug_file);
-
 
999
    }
-
 
1000
}
-
 
1001
 
-
 
1002
void
-
 
1003
debug_info_l_found PROTO_N ((key, shape_key, use, name))
-
 
1004
		   PROTO_T (NameKeyP key X
-
 
1005
			    NStringP shape_key X
-
 
1006
			    unsigned use X
-
 
1007
			    CStringP name)
-
 
1008
{
-
 
1009
    if (debug_file) {
-
 
1010
	write_cstring (debug_file, "Definition found for ");
-
 
1011
	write_nstring (debug_file, shape_key);
-
 
1012
	write_cstring (debug_file, " '");
-
 
1013
	write_name_key (debug_file, key);
-
 
1014
	write_cstring (debug_file, "' (");
-
 
1015
	write_usage (debug_file, use);
-
 
1016
	write_cstring (debug_file, ") in file '");
-
 
1017
	write_cstring (debug_file, name);
-
 
1018
	write_char (debug_file, '\'');
-
 
1019
	write_newline (debug_file);
-
 
1020
    }
-
 
1021
}
-
 
1022
 
-
 
1023
void
-
 
1024
debug_info_l_hide PROTO_N ((shape, key))
-
 
1025
		  PROTO_T (NStringP shape X
-
 
1026
			   NameKeyP key)
-
 
1027
{
-
 
1028
    if (debug_file) {
-
 
1029
	write_cstring (debug_file, "Hid external ");
-
 
1030
	write_nstring (debug_file, shape);
-
 
1031
	write_cstring (debug_file, " '");
-
 
1032
	write_name_key (debug_file, key);
-
 
1033
	write_char (debug_file, '\'');
-
 
1034
	write_newline (debug_file);
-
 
1035
    }
-
 
1036
}
-
 
1037
 
-
 
1038
void
-
 
1039
debug_info_l_keep PROTO_N ((shape, key))
-
 
1040
		  PROTO_T (NStringP shape X
-
 
1041
			   NameKeyP key)
-
 
1042
{
930
{
1043
    if (debug_file) {
931
    if (debug_file) {
1044
	write_cstring (debug_file, "Kept external ");
932
	write_cstring(debug_file, "No definition found for ");
1045
	write_nstring (debug_file, shape);
933
	write_nstring(debug_file, shape_key);
1046
	write_cstring (debug_file, " '");
934
	write_cstring(debug_file, " '");
1047
	write_name_key (debug_file, key);
935
	write_name_key(debug_file, key);
-
 
936
	write_cstring(debug_file, "' (");
-
 
937
	write_usage(debug_file, use);
1048
	write_char (debug_file, '\'');
938
	write_char(debug_file, ')');
1049
	write_newline (debug_file);
939
	write_newline(debug_file);
1050
    }
940
    }
1051
}
941
}
1052
 
942
 
1053
void
943
void
1054
debug_info_l_suppress PROTO_N ((shape, key))
944
debug_info_l_found(NameKeyP key,			    NStringP shape_key, 
1055
		      PROTO_T (NStringP shape X
945
			    unsigned use, 
1056
			       NameKeyP key)
946
			    CStringP name)
1057
{
947
{
1058
    if (debug_file) {
948
    if (debug_file) {
-
 
949
	write_cstring(debug_file, "Definition found for ");
-
 
950
	write_nstring(debug_file, shape_key);
-
 
951
	write_cstring(debug_file, " '");
-
 
952
	write_name_key(debug_file, key);
-
 
953
	write_cstring(debug_file, "' (");
-
 
954
	write_usage(debug_file, use);
-
 
955
	write_cstring(debug_file, ") in file '");
-
 
956
	write_cstring(debug_file, name);
-
 
957
	write_char(debug_file, '\'');
-
 
958
	write_newline(debug_file);
-
 
959
    }
-
 
960
}
-
 
961
 
-
 
962
void
-
 
963
debug_info_l_hide(NStringP shape,			   NameKeyP key)
-
 
964
{
-
 
965
    if (debug_file) {
-
 
966
	write_cstring(debug_file, "Hid external ");
-
 
967
	write_nstring(debug_file, shape);
-
 
968
	write_cstring(debug_file, " '");
-
 
969
	write_name_key(debug_file, key);
-
 
970
	write_char(debug_file, '\'');
-
 
971
	write_newline(debug_file);
-
 
972
    }
-
 
973
}
-
 
974
 
-
 
975
void
-
 
976
debug_info_l_keep(NStringP shape,			   NameKeyP key)
-
 
977
{
-
 
978
    if (debug_file) {
1059
	write_cstring (debug_file, "Suppressed external ");
979
	write_cstring(debug_file, "Kept external ");
1060
	write_nstring (debug_file, shape);
980
	write_nstring(debug_file, shape);
1061
	write_cstring (debug_file, " '");
981
	write_cstring(debug_file, " '");
1062
	write_name_key (debug_file, key);
982
	write_name_key(debug_file, key);
1063
	write_char (debug_file, '\'');
983
	write_char(debug_file, '\'');
1064
	write_newline (debug_file);
984
	write_newline(debug_file);
1065
    }
985
    }
1066
}
986
}
1067
 
987
 
1068
void
988
void
1069
debug_info_l_rename PROTO_N ((shape, from, to))
989
debug_info_l_suppress(NStringP shape,			       NameKeyP key)
-
 
990
{
-
 
991
    if (debug_file) {
-
 
992
	write_cstring(debug_file, "Suppressed external ");
1070
		    PROTO_T (NStringP shape X
993
	write_nstring(debug_file, shape);
-
 
994
	write_cstring(debug_file, " '");
-
 
995
	write_name_key(debug_file, key);
-
 
996
	write_char(debug_file, '\'');
1071
			     NameKeyP from X
997
	write_newline(debug_file);
-
 
998
    }
-
 
999
}
-
 
1000
 
-
 
1001
void
-
 
1002
debug_info_l_rename(NStringP shape,			     NameKeyP from, 
1072
			     NameKeyP to)
1003
			     NameKeyP to)
1073
{
1004
{
1074
    if (debug_file) {
1005
    if (debug_file) {
1075
	write_cstring (debug_file, "Renamed external ");
1006
	write_cstring(debug_file, "Renamed external ");
1076
	write_nstring (debug_file, shape);
1007
	write_nstring(debug_file, shape);
1077
	write_cstring (debug_file, " '");
1008
	write_cstring(debug_file, " '");
1078
	write_name_key (debug_file, from);
1009
	write_name_key(debug_file, from);
1079
	write_cstring (debug_file, "' to '");
1010
	write_cstring(debug_file, "' to '");
1080
	write_name_key (debug_file, to);
1011
	write_name_key(debug_file, to);
1081
	write_char (debug_file, '\'');
1012
	write_char(debug_file, '\'');
1082
	write_newline (debug_file);
1013
	write_newline(debug_file);
1083
    }
1014
    }
1084
}
1015
}
1085

1016

1086
/*
1017
/*
1087
 * Local variables(smf):
1018
 * Local variables(smf):