Subversion Repositories tendra.SVN

Rev

Rev 5 | 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
    AUTOMATICALLY GENERATED FROM ALGEBRA disk (VERSION 1.1)
32
    BY calculus (VERSION 1.2)
33
*/
34
 
35
#ifndef WRITE_DEF_H_INCLUDED
36
#define WRITE_DEF_H_INCLUDED
37
 
38
#include "disk.h"
39
#include "type_ops.h"
40
 
41
/* Disk writing function declarations */
42
 
43
#ifndef WRITE_disk_list_ptr_type
6 7u83 44
#define WRITE_disk_list_ptr_type(A) WRITE_list_ptr_type(A)
2 7u83 45
#endif
46
 
47
#ifndef WRITE_list_ptr_type
6 7u83 48
static void WRITE_list_ptr_type(LIST(PTR(TYPE)));
2 7u83 49
#endif
50
 
51
#ifndef WRITE_disk_string
6 7u83 52
#define WRITE_disk_string(A) WRITE_string(A)
2 7u83 53
#endif
54
 
55
#ifndef WRITE_disk_int
6 7u83 56
#define WRITE_disk_int(A) WRITE_int(A)
2 7u83 57
#endif
58
 
59
#ifndef WRITE_type
6 7u83 60
static void WRITE_type(TYPE);
2 7u83 61
#endif
62
 
63
#ifndef WRITE_zero_int
6 7u83 64
#define WRITE_zero_int(A) WRITE_int(A)
2 7u83 65
#endif
66
 
67
#ifndef WRITE_PRIMITIVE_P
6 7u83 68
#define WRITE_PRIMITIVE_P(A) WRITE_ptr_prim(A)
2 7u83 69
#endif
70
 
71
#ifndef WRITE_ptr_prim
6 7u83 72
static void WRITE_ptr_prim(PTR(PRIMITIVE));
2 7u83 73
#endif
74
 
75
#ifndef WRITE_prim
6 7u83 76
static void WRITE_prim(PRIMITIVE);
2 7u83 77
#endif
78
 
79
#ifndef WRITE_CLASS_ID_P
6 7u83 80
#define WRITE_CLASS_ID_P(A) WRITE_ptr_cid(A)
2 7u83 81
#endif
82
 
83
#ifndef WRITE_ptr_cid
6 7u83 84
static void WRITE_ptr_cid(PTR(CLASS_ID));
2 7u83 85
#endif
86
 
87
#ifndef WRITE_cid
6 7u83 88
static void WRITE_cid(CLASS_ID);
2 7u83 89
#endif
90
 
91
#ifndef WRITE_name_string
6 7u83 92
#define WRITE_name_string(A) WRITE_string(A)
2 7u83 93
#endif
94
 
95
#ifndef WRITE_IDENTITY_P
6 7u83 96
#define WRITE_IDENTITY_P(A) WRITE_ptr_ident(A)
2 7u83 97
#endif
98
 
99
#ifndef WRITE_ptr_ident
6 7u83 100
static void WRITE_ptr_ident(PTR(IDENTITY));
2 7u83 101
#endif
102
 
103
#ifndef WRITE_ident
6 7u83 104
static void WRITE_ident(IDENTITY);
2 7u83 105
#endif
106
 
107
#ifndef WRITE_TYPE_P
6 7u83 108
#define WRITE_TYPE_P(A) WRITE_ptr_type(A)
2 7u83 109
#endif
110
 
111
#ifndef WRITE_ptr_type
6 7u83 112
static void WRITE_ptr_type(PTR(TYPE));
2 7u83 113
#endif
114
 
115
#ifndef WRITE_ENUM_P
6 7u83 116
#define WRITE_ENUM_P(A) WRITE_ptr_en(A)
2 7u83 117
#endif
118
 
119
#ifndef WRITE_ptr_en
6 7u83 120
static void WRITE_ptr_en(PTR(ENUM));
2 7u83 121
#endif
122
 
123
#ifndef WRITE_en
6 7u83 124
static void WRITE_en(ENUM);
2 7u83 125
#endif
126
 
127
#ifndef WRITE_list_ptr_ec
6 7u83 128
static void WRITE_list_ptr_ec(LIST(PTR(ECONST)));
2 7u83 129
#endif
130
 
131
#ifndef WRITE_list_ECONST_P
6 7u83 132
#define WRITE_list_ECONST_P(A) WRITE_list_ptr_ec(A)
2 7u83 133
#endif
134
 
135
#ifndef WRITE_ECONST_P
6 7u83 136
#define WRITE_ECONST_P(A) WRITE_ptr_ec(A)
2 7u83 137
#endif
138
 
139
#ifndef WRITE_ptr_ec
6 7u83 140
static void WRITE_ptr_ec(PTR(ECONST));
2 7u83 141
#endif
142
 
143
#ifndef WRITE_ec
6 7u83 144
static void WRITE_ec(ECONST);
2 7u83 145
#endif
146
 
147
#ifndef WRITE_STRUCTURE_P
6 7u83 148
#define WRITE_STRUCTURE_P(A) WRITE_ptr_str(A)
2 7u83 149
#endif
150
 
151
#ifndef WRITE_ptr_str
6 7u83 152
static void WRITE_ptr_str(PTR(STRUCTURE));
2 7u83 153
#endif
154
 
155
#ifndef WRITE_str
6 7u83 156
static void WRITE_str(STRUCTURE);
2 7u83 157
#endif
158
 
159
#ifndef WRITE_list_ptr_cmp
6 7u83 160
static void WRITE_list_ptr_cmp(LIST(PTR(COMPONENT)));
2 7u83 161
#endif
162
 
163
#ifndef WRITE_list_COMPONENT_P
6 7u83 164
#define WRITE_list_COMPONENT_P(A) WRITE_list_ptr_cmp(A)
2 7u83 165
#endif
166
 
167
#ifndef WRITE_COMPONENT_P
6 7u83 168
#define WRITE_COMPONENT_P(A) WRITE_ptr_cmp(A)
2 7u83 169
#endif
170
 
171
#ifndef WRITE_ptr_cmp
6 7u83 172
static void WRITE_ptr_cmp(PTR(COMPONENT));
2 7u83 173
#endif
174
 
175
#ifndef WRITE_cmp
6 7u83 176
static void WRITE_cmp(COMPONENT);
2 7u83 177
#endif
178
 
179
#ifndef WRITE_UNION_P
6 7u83 180
#define WRITE_UNION_P(A) WRITE_ptr_un(A)
2 7u83 181
#endif
182
 
183
#ifndef WRITE_ptr_un
6 7u83 184
static void WRITE_ptr_un(PTR(UNION));
2 7u83 185
#endif
186
 
187
#ifndef WRITE_un
6 7u83 188
static void WRITE_un(UNION);
2 7u83 189
#endif
190
 
191
#ifndef WRITE_list_ptr_fld
6 7u83 192
static void WRITE_list_ptr_fld(LIST(PTR(FIELD)));
2 7u83 193
#endif
194
 
195
#ifndef WRITE_list_FIELD_P
6 7u83 196
#define WRITE_list_FIELD_P(A) WRITE_list_ptr_fld(A)
2 7u83 197
#endif
198
 
199
#ifndef WRITE_FIELD_P
6 7u83 200
#define WRITE_FIELD_P(A) WRITE_ptr_fld(A)
2 7u83 201
#endif
202
 
203
#ifndef WRITE_ptr_fld
6 7u83 204
static void WRITE_ptr_fld(PTR(FIELD));
2 7u83 205
#endif
206
 
207
#ifndef WRITE_fld
6 7u83 208
static void WRITE_fld(FIELD);
2 7u83 209
#endif
210
 
211
#ifndef WRITE_list_ptr_map
6 7u83 212
static void WRITE_list_ptr_map(LIST(PTR(MAP)));
2 7u83 213
#endif
214
 
215
#ifndef WRITE_list_MAP_P
6 7u83 216
#define WRITE_list_MAP_P(A) WRITE_list_ptr_map(A)
2 7u83 217
#endif
218
 
219
#ifndef WRITE_MAP_P
6 7u83 220
#define WRITE_MAP_P(A) WRITE_ptr_map(A)
2 7u83 221
#endif
222
 
223
#ifndef WRITE_ptr_map
6 7u83 224
static void WRITE_ptr_map(PTR(MAP));
2 7u83 225
#endif
226
 
227
#ifndef WRITE_map
6 7u83 228
static void WRITE_map(MAP);
2 7u83 229
#endif
230
 
231
#ifndef WRITE_list_ptr_arg
6 7u83 232
static void WRITE_list_ptr_arg(LIST(PTR(ARGUMENT)));
2 7u83 233
#endif
234
 
235
#ifndef WRITE_list_ARGUMENT_P
6 7u83 236
#define WRITE_list_ARGUMENT_P(A) WRITE_list_ptr_arg(A)
2 7u83 237
#endif
238
 
239
#ifndef WRITE_ARGUMENT_P
6 7u83 240
#define WRITE_ARGUMENT_P(A) WRITE_ptr_arg(A)
2 7u83 241
#endif
242
 
243
#ifndef WRITE_ptr_arg
6 7u83 244
static void WRITE_ptr_arg(PTR(ARGUMENT));
2 7u83 245
#endif
246
 
247
#ifndef WRITE_arg
6 7u83 248
static void WRITE_arg(ARGUMENT);
2 7u83 249
#endif
250
 
251
 
6 7u83 252
/* Disk writing routine for LIST(PTR(TYPE)) */
2 7u83 253
 
254
#ifndef WRITE_list_ptr_type
255
 
256
static void WRITE_list_ptr_type
6 7u83 257
 
258
(LIST(PTR(TYPE)) x_)
2 7u83 259
{
6 7u83 260
    while (!IS_NULL_list(x_)) {
261
	PTR(TYPE) y_;
262
	y_ = DEREF_ptr(HEAD_list(x_));
263
	WRITE_BITS(1, (unsigned)1);
264
	WRITE_ptr_type(y_);
265
	x_ = TAIL_list(x_);
2 7u83 266
    }
6 7u83 267
    WRITE_BITS(1, (unsigned)0);
268
    return;
2 7u83 269
}
270
 
271
#endif
272
 
273
 
274
/* Disk writing routine for TYPE */
275
 
276
#ifndef WRITE_type
277
 
278
static void WRITE_type
6 7u83 279
 
280
(TYPE x_)
2 7u83 281
{
6 7u83 282
    if (IS_NULL_type(x_)) {
283
	WRITE_BITS(1, (unsigned)0);
2 7u83 284
    } else {
6 7u83 285
	zero_int size;
286
	unsigned tag_ = TAG_type(x_);
287
	WRITE_BITS(1, (unsigned)1);
288
	WRITE_BITS(4, tag_);
289
	switch (tag_) {
290
	    case type_primitive_tag: {
291
		PRIMITIVE_P prim;
292
		unsigned alias_ = GET_ALIAS_type_primitive(x_);
293
		if (alias_) {
294
		    WRITE_ALIAS(alias_);
295
		    WRITE_BITS(1, (unsigned)0);
296
		    break;
2 7u83 297
		}
6 7u83 298
		alias_ = ++crt_disk_alias;
299
		SET_ALIAS_type_primitive(x_, alias_);
300
		WRITE_ALIAS(alias_);
301
		WRITE_BITS(1, (unsigned)1);
302
		DECONS_type_primitive(size, prim,  x_);
303
		WRITE_zero_int(size);
304
		WRITE_PRIMITIVE_P(prim);
305
		break;
2 7u83 306
	    }
6 7u83 307
	    case type_ident_tag: {
308
		IDENTITY_P id;
309
		unsigned alias_ = GET_ALIAS_type_ident(x_);
310
		if (alias_) {
311
		    WRITE_ALIAS(alias_);
312
		    WRITE_BITS(1, (unsigned)0);
313
		    break;
2 7u83 314
		}
6 7u83 315
		alias_ = ++crt_disk_alias;
316
		SET_ALIAS_type_ident(x_, alias_);
317
		WRITE_ALIAS(alias_);
318
		WRITE_BITS(1, (unsigned)1);
319
		DECONS_type_ident(size, id,  x_);
320
		WRITE_zero_int(size);
321
		WRITE_IDENTITY_P(id);
322
		break;
2 7u83 323
	    }
6 7u83 324
	    case type_enumeration_tag: {
325
		ENUM_P en;
326
		unsigned alias_ = GET_ALIAS_type_enumeration(x_);
327
		if (alias_) {
328
		    WRITE_ALIAS(alias_);
329
		    WRITE_BITS(1, (unsigned)0);
330
		    break;
2 7u83 331
		}
6 7u83 332
		alias_ = ++crt_disk_alias;
333
		SET_ALIAS_type_enumeration(x_, alias_);
334
		WRITE_ALIAS(alias_);
335
		WRITE_BITS(1, (unsigned)1);
336
		DECONS_type_enumeration(size, en,  x_);
337
		WRITE_zero_int(size);
338
		WRITE_ENUM_P(en);
339
		break;
2 7u83 340
	    }
6 7u83 341
	    case type_structure_tag: {
342
		STRUCTURE_P struc;
343
		unsigned alias_ = GET_ALIAS_type_structure(x_);
344
		if (alias_) {
345
		    WRITE_ALIAS(alias_);
346
		    WRITE_BITS(1, (unsigned)0);
347
		    break;
2 7u83 348
		}
6 7u83 349
		alias_ = ++crt_disk_alias;
350
		SET_ALIAS_type_structure(x_, alias_);
351
		WRITE_ALIAS(alias_);
352
		WRITE_BITS(1, (unsigned)1);
353
		DECONS_type_structure(size, struc,  x_);
354
		WRITE_zero_int(size);
355
		WRITE_STRUCTURE_P(struc);
356
		break;
2 7u83 357
	    }
6 7u83 358
	    case type_onion_tag: {
359
		UNION_P un;
360
		unsigned alias_ = GET_ALIAS_type_onion(x_);
361
		if (alias_) {
362
		    WRITE_ALIAS(alias_);
363
		    WRITE_BITS(1, (unsigned)0);
364
		    break;
2 7u83 365
		}
6 7u83 366
		alias_ = ++crt_disk_alias;
367
		SET_ALIAS_type_onion(x_, alias_);
368
		WRITE_ALIAS(alias_);
369
		WRITE_BITS(1, (unsigned)1);
370
		DECONS_type_onion(size, un,  x_);
371
		WRITE_zero_int(size);
372
		WRITE_UNION_P(un);
373
		break;
2 7u83 374
	    }
6 7u83 375
	    case type_ptr_tag: {
376
		TYPE_P sub;
377
		unsigned alias_ = GET_ALIAS_type_ptr(x_);
378
		if (alias_) {
379
		    WRITE_ALIAS(alias_);
380
		    WRITE_BITS(1, (unsigned)0);
381
		    break;
2 7u83 382
		}
6 7u83 383
		alias_ = ++crt_disk_alias;
384
		SET_ALIAS_type_ptr(x_, alias_);
385
		WRITE_ALIAS(alias_);
386
		WRITE_BITS(1, (unsigned)1);
387
		DECONS_type_ptr(size, sub,  x_);
388
		WRITE_zero_int(size);
389
		WRITE_TYPE_P(sub);
390
		break;
2 7u83 391
	    }
6 7u83 392
	    case type_list_tag: {
393
		TYPE_P sub;
394
		unsigned alias_ = GET_ALIAS_type_list(x_);
395
		if (alias_) {
396
		    WRITE_ALIAS(alias_);
397
		    WRITE_BITS(1, (unsigned)0);
398
		    break;
2 7u83 399
		}
6 7u83 400
		alias_ = ++crt_disk_alias;
401
		SET_ALIAS_type_list(x_, alias_);
402
		WRITE_ALIAS(alias_);
403
		WRITE_BITS(1, (unsigned)1);
404
		DECONS_type_list(size, sub,  x_);
405
		WRITE_zero_int(size);
406
		WRITE_TYPE_P(sub);
407
		break;
2 7u83 408
	    }
6 7u83 409
	    case type_stack_tag: {
410
		TYPE_P sub;
411
		unsigned alias_ = GET_ALIAS_type_stack(x_);
412
		if (alias_) {
413
		    WRITE_ALIAS(alias_);
414
		    WRITE_BITS(1, (unsigned)0);
415
		    break;
2 7u83 416
		}
6 7u83 417
		alias_ = ++crt_disk_alias;
418
		SET_ALIAS_type_stack(x_, alias_);
419
		WRITE_ALIAS(alias_);
420
		WRITE_BITS(1, (unsigned)1);
421
		DECONS_type_stack(size, sub,  x_);
422
		WRITE_zero_int(size);
423
		WRITE_TYPE_P(sub);
424
		break;
2 7u83 425
	    }
6 7u83 426
	    case type_vec_tag: {
427
		TYPE_P sub;
428
		unsigned alias_ = GET_ALIAS_type_vec(x_);
429
		if (alias_) {
430
		    WRITE_ALIAS(alias_);
431
		    WRITE_BITS(1, (unsigned)0);
432
		    break;
2 7u83 433
		}
6 7u83 434
		alias_ = ++crt_disk_alias;
435
		SET_ALIAS_type_vec(x_, alias_);
436
		WRITE_ALIAS(alias_);
437
		WRITE_BITS(1, (unsigned)1);
438
		DECONS_type_vec(size, sub,  x_);
439
		WRITE_zero_int(size);
440
		WRITE_TYPE_P(sub);
441
		break;
2 7u83 442
	    }
6 7u83 443
	    case type_vec_ptr_tag: {
444
		TYPE_P sub;
445
		unsigned alias_ = GET_ALIAS_type_vec_ptr(x_);
446
		if (alias_) {
447
		    WRITE_ALIAS(alias_);
448
		    WRITE_BITS(1, (unsigned)0);
449
		    break;
2 7u83 450
		}
6 7u83 451
		alias_ = ++crt_disk_alias;
452
		SET_ALIAS_type_vec_ptr(x_, alias_);
453
		WRITE_ALIAS(alias_);
454
		WRITE_BITS(1, (unsigned)1);
455
		DECONS_type_vec_ptr(size, sub,  x_);
456
		WRITE_zero_int(size);
457
		WRITE_TYPE_P(sub);
458
		break;
2 7u83 459
	    }
6 7u83 460
	    case type_quote_tag: {
461
		string defn;
462
		DECONS_type_quote(size, defn,  x_);
463
		WRITE_zero_int(size);
464
		WRITE_string(defn);
465
		break;
2 7u83 466
	    }
6 7u83 467
	    case type_undef_tag: {
468
		string name;
469
		DECONS_type_undef(size, name,  x_);
470
		WRITE_zero_int(size);
471
		WRITE_string(name);
472
		break;
2 7u83 473
	    }
474
	}
475
    }
6 7u83 476
    return;
2 7u83 477
}
478
 
479
#endif
480
 
481
 
6 7u83 482
/* Disk writing routine for PTR(PRIMITIVE) */
2 7u83 483
 
484
#ifndef WRITE_ptr_prim
485
 
486
static void WRITE_ptr_prim
6 7u83 487
 
488
(PTR(PRIMITIVE) x_)
2 7u83 489
{
6 7u83 490
    if (IS_NULL_ptr(x_)) {
491
	WRITE_BITS(1, (unsigned)0);
2 7u83 492
    } else {
6 7u83 493
	PRIMITIVE y_;
494
	DEREF_prim(x_, y_);
495
	WRITE_BITS(1, (unsigned)1);
496
	WRITE_prim(y_);
2 7u83 497
    }
6 7u83 498
    return;
2 7u83 499
}
500
 
501
#endif
502
 
503
 
504
/* Disk writing routine for PRIMITIVE */
505
 
506
#ifndef WRITE_prim
507
 
508
static void WRITE_prim
6 7u83 509
 
510
(PRIMITIVE x_)
2 7u83 511
{
6 7u83 512
    WRITE_CLASS_ID_P(x_.id);
513
    WRITE_string(x_.defn);
514
    return;
2 7u83 515
}
516
 
517
#endif
518
 
519
 
6 7u83 520
/* Disk writing routine for PTR(CLASS_ID) */
2 7u83 521
 
522
#ifndef WRITE_ptr_cid
523
 
524
static void WRITE_ptr_cid
6 7u83 525
 
526
(PTR(CLASS_ID) x_)
2 7u83 527
{
6 7u83 528
    if (IS_NULL_ptr(x_)) {
529
	WRITE_BITS(1, (unsigned)0);
2 7u83 530
    } else {
6 7u83 531
	CLASS_ID y_;
532
	DEREF_cid(x_, y_);
533
	WRITE_BITS(1, (unsigned)1);
534
	WRITE_cid(y_);
2 7u83 535
    }
6 7u83 536
    return;
2 7u83 537
}
538
 
539
#endif
540
 
541
 
542
/* Disk writing routine for CLASS_ID */
543
 
544
#ifndef WRITE_cid
545
 
546
static void WRITE_cid
6 7u83 547
 
548
(CLASS_ID x_)
2 7u83 549
{
6 7u83 550
    WRITE_string(x_.name);
551
    WRITE_string(x_.name_aux);
552
    WRITE_int(x_.flag);
553
    WRITE_name_string(x_.file);
554
    WRITE_int(x_.line);
555
    return;
2 7u83 556
}
557
 
558
#endif
559
 
560
 
6 7u83 561
/* Disk writing routine for PTR(IDENTITY) */
2 7u83 562
 
563
#ifndef WRITE_ptr_ident
564
 
565
static void WRITE_ptr_ident
6 7u83 566
 
567
(PTR(IDENTITY) x_)
2 7u83 568
{
6 7u83 569
    if (IS_NULL_ptr(x_)) {
570
	WRITE_BITS(1, (unsigned)0);
2 7u83 571
    } else {
6 7u83 572
	IDENTITY y_;
573
	DEREF_ident(x_, y_);
574
	WRITE_BITS(1, (unsigned)1);
575
	WRITE_ident(y_);
2 7u83 576
    }
6 7u83 577
    return;
2 7u83 578
}
579
 
580
#endif
581
 
582
 
583
/* Disk writing routine for IDENTITY */
584
 
585
#ifndef WRITE_ident
586
 
587
static void WRITE_ident
6 7u83 588
 
589
(IDENTITY x_)
2 7u83 590
{
6 7u83 591
    WRITE_CLASS_ID_P(x_.id);
592
    WRITE_TYPE_P(x_.defn);
593
    return;
2 7u83 594
}
595
 
596
#endif
597
 
598
 
6 7u83 599
/* Disk writing routine for PTR(TYPE) */
2 7u83 600
 
601
#ifndef WRITE_ptr_type
602
 
603
static void WRITE_ptr_type
6 7u83 604
 
605
(PTR(TYPE) x_)
2 7u83 606
{
6 7u83 607
    if (IS_NULL_ptr(x_)) {
608
	WRITE_BITS(1, (unsigned)0);
2 7u83 609
    } else {
6 7u83 610
	TYPE y_;
611
	y_ = DEREF_type(x_);
612
	WRITE_BITS(1, (unsigned)1);
613
	WRITE_type(y_);
2 7u83 614
    }
6 7u83 615
    return;
2 7u83 616
}
617
 
618
#endif
619
 
620
 
6 7u83 621
/* Disk writing routine for PTR(ENUM) */
2 7u83 622
 
623
#ifndef WRITE_ptr_en
624
 
625
static void WRITE_ptr_en
6 7u83 626
 
627
(PTR(ENUM) x_)
2 7u83 628
{
6 7u83 629
    if (IS_NULL_ptr(x_)) {
630
	WRITE_BITS(1, (unsigned)0);
2 7u83 631
    } else {
6 7u83 632
	ENUM y_;
633
	DEREF_en(x_, y_);
634
	WRITE_BITS(1, (unsigned)1);
635
	WRITE_en(y_);
2 7u83 636
    }
6 7u83 637
    return;
2 7u83 638
}
639
 
640
#endif
641
 
642
 
643
/* Disk writing routine for ENUM */
644
 
645
#ifndef WRITE_en
646
 
647
static void WRITE_en
6 7u83 648
 
649
(ENUM x_)
2 7u83 650
{
6 7u83 651
    WRITE_CLASS_ID_P(x_.id);
652
    WRITE_list_ECONST_P(x_.consts);
653
    WRITE_number(x_.order);
654
    WRITE_int(x_.lists);
655
    return;
2 7u83 656
}
657
 
658
#endif
659
 
660
 
6 7u83 661
/* Disk writing routine for LIST(PTR(ECONST)) */
2 7u83 662
 
663
#ifndef WRITE_list_ptr_ec
664
 
665
static void WRITE_list_ptr_ec
6 7u83 666
 
667
(LIST(PTR(ECONST)) x_)
2 7u83 668
{
6 7u83 669
    while (!IS_NULL_list(x_)) {
670
	PTR(ECONST) y_;
671
	y_ = DEREF_ptr(HEAD_list(x_));
672
	WRITE_BITS(1, (unsigned)1);
673
	WRITE_ptr_ec(y_);
674
	x_ = TAIL_list(x_);
2 7u83 675
    }
6 7u83 676
    WRITE_BITS(1, (unsigned)0);
677
    return;
2 7u83 678
}
679
 
680
#endif
681
 
682
 
6 7u83 683
/* Disk writing routine for PTR(ECONST) */
2 7u83 684
 
685
#ifndef WRITE_ptr_ec
686
 
687
static void WRITE_ptr_ec
6 7u83 688
 
689
(PTR(ECONST) x_)
2 7u83 690
{
6 7u83 691
    if (IS_NULL_ptr(x_)) {
692
	WRITE_BITS(1, (unsigned)0);
2 7u83 693
    } else {
6 7u83 694
	ECONST y_;
695
	DEREF_ec(x_, y_);
696
	WRITE_BITS(1, (unsigned)1);
697
	WRITE_ec(y_);
2 7u83 698
    }
6 7u83 699
    return;
2 7u83 700
}
701
 
702
#endif
703
 
704
 
705
/* Disk writing routine for ECONST */
706
 
707
#ifndef WRITE_ec
708
 
709
static void WRITE_ec
6 7u83 710
 
711
(ECONST x_)
2 7u83 712
{
6 7u83 713
    WRITE_string(x_.name);
714
    WRITE_number(x_.value);
715
    return;
2 7u83 716
}
717
 
718
#endif
719
 
720
 
6 7u83 721
/* Disk writing routine for PTR(STRUCTURE) */
2 7u83 722
 
723
#ifndef WRITE_ptr_str
724
 
725
static void WRITE_ptr_str
6 7u83 726
 
727
(PTR(STRUCTURE) x_)
2 7u83 728
{
6 7u83 729
    if (IS_NULL_ptr(x_)) {
730
	WRITE_BITS(1, (unsigned)0);
2 7u83 731
    } else {
6 7u83 732
	STRUCTURE y_;
733
	DEREF_str(x_, y_);
734
	WRITE_BITS(1, (unsigned)1);
735
	WRITE_str(y_);
2 7u83 736
    }
6 7u83 737
    return;
2 7u83 738
}
739
 
740
#endif
741
 
742
 
743
/* Disk writing routine for STRUCTURE */
744
 
745
#ifndef WRITE_str
746
 
747
static void WRITE_str
6 7u83 748
 
749
(STRUCTURE x_)
2 7u83 750
{
6 7u83 751
    WRITE_CLASS_ID_P(x_.id);
752
    WRITE_STRUCTURE_P(x_.base);
753
    WRITE_list_COMPONENT_P(x_.defn);
754
    WRITE_zero_int(x_.output);
755
    return;
2 7u83 756
}
757
 
758
#endif
759
 
760
 
6 7u83 761
/* Disk writing routine for LIST(PTR(COMPONENT)) */
2 7u83 762
 
763
#ifndef WRITE_list_ptr_cmp
764
 
765
static void WRITE_list_ptr_cmp
6 7u83 766
 
767
(LIST(PTR(COMPONENT)) x_)
2 7u83 768
{
6 7u83 769
    while (!IS_NULL_list(x_)) {
770
	PTR(COMPONENT) y_;
771
	y_ = DEREF_ptr(HEAD_list(x_));
772
	WRITE_BITS(1, (unsigned)1);
773
	WRITE_ptr_cmp(y_);
774
	x_ = TAIL_list(x_);
2 7u83 775
    }
6 7u83 776
    WRITE_BITS(1, (unsigned)0);
777
    return;
2 7u83 778
}
779
 
780
#endif
781
 
782
 
6 7u83 783
/* Disk writing routine for PTR(COMPONENT) */
2 7u83 784
 
785
#ifndef WRITE_ptr_cmp
786
 
787
static void WRITE_ptr_cmp
6 7u83 788
 
789
(PTR(COMPONENT) x_)
2 7u83 790
{
6 7u83 791
    if (IS_NULL_ptr(x_)) {
792
	WRITE_BITS(1, (unsigned)0);
2 7u83 793
    } else {
6 7u83 794
	COMPONENT y_;
795
	DEREF_cmp(x_, y_);
796
	WRITE_BITS(1, (unsigned)1);
797
	WRITE_cmp(y_);
2 7u83 798
    }
6 7u83 799
    return;
2 7u83 800
}
801
 
802
#endif
803
 
804
 
805
/* Disk writing routine for COMPONENT */
806
 
807
#ifndef WRITE_cmp
808
 
809
static void WRITE_cmp
6 7u83 810
 
811
(COMPONENT x_)
2 7u83 812
{
6 7u83 813
    WRITE_string(x_.name);
814
    WRITE_TYPE_P(x_.type);
815
    WRITE_string(x_.value);
816
    return;
2 7u83 817
}
818
 
819
#endif
820
 
821
 
6 7u83 822
/* Disk writing routine for PTR(UNION) */
2 7u83 823
 
824
#ifndef WRITE_ptr_un
825
 
826
static void WRITE_ptr_un
6 7u83 827
 
828
(PTR(UNION) x_)
2 7u83 829
{
6 7u83 830
    if (IS_NULL_ptr(x_)) {
831
	WRITE_BITS(1, (unsigned)0);
2 7u83 832
    } else {
6 7u83 833
	UNION y_;
834
	DEREF_un(x_, y_);
835
	WRITE_BITS(1, (unsigned)1);
836
	WRITE_un(y_);
2 7u83 837
    }
6 7u83 838
    return;
2 7u83 839
}
840
 
841
#endif
842
 
843
 
844
/* Disk writing routine for UNION */
845
 
846
#ifndef WRITE_un
847
 
848
static void WRITE_un
6 7u83 849
 
850
(UNION x_)
2 7u83 851
{
6 7u83 852
    WRITE_CLASS_ID_P(x_.id);
853
    WRITE_UNION_P(x_.base);
854
    WRITE_list_COMPONENT_P(x_.s_defn);
855
    WRITE_list_FIELD_P(x_.u_defn);
856
    WRITE_list_MAP_P(x_.map);
857
    WRITE_int(x_.no_fields);
858
    return;
2 7u83 859
}
860
 
861
#endif
862
 
863
 
6 7u83 864
/* Disk writing routine for LIST(PTR(FIELD)) */
2 7u83 865
 
866
#ifndef WRITE_list_ptr_fld
867
 
868
static void WRITE_list_ptr_fld
6 7u83 869
 
870
(LIST(PTR(FIELD)) x_)
2 7u83 871
{
6 7u83 872
    while (!IS_NULL_list(x_)) {
873
	PTR(FIELD) y_;
874
	y_ = DEREF_ptr(HEAD_list(x_));
875
	WRITE_BITS(1, (unsigned)1);
876
	WRITE_ptr_fld(y_);
877
	x_ = TAIL_list(x_);
2 7u83 878
    }
6 7u83 879
    WRITE_BITS(1, (unsigned)0);
880
    return;
2 7u83 881
}
882
 
883
#endif
884
 
885
 
6 7u83 886
/* Disk writing routine for PTR(FIELD) */
2 7u83 887
 
888
#ifndef WRITE_ptr_fld
889
 
890
static void WRITE_ptr_fld
6 7u83 891
 
892
(PTR(FIELD) x_)
2 7u83 893
{
6 7u83 894
    if (IS_NULL_ptr(x_)) {
895
	WRITE_BITS(1, (unsigned)0);
2 7u83 896
    } else {
6 7u83 897
	FIELD y_;
898
	DEREF_fld(x_, y_);
899
	WRITE_BITS(1, (unsigned)1);
900
	WRITE_fld(y_);
2 7u83 901
    }
6 7u83 902
    return;
2 7u83 903
}
904
 
905
#endif
906
 
907
 
908
/* Disk writing routine for FIELD */
909
 
910
#ifndef WRITE_fld
911
 
912
static void WRITE_fld
6 7u83 913
 
914
(FIELD x_)
2 7u83 915
{
6 7u83 916
    WRITE_string(x_.name);
917
    WRITE_int(x_.tag);
918
    WRITE_int(x_.flag);
919
    WRITE_int(x_.set);
920
    WRITE_FIELD_P(x_.base);
921
    WRITE_list_COMPONENT_P(x_.defn);
922
    return;
2 7u83 923
}
924
 
925
#endif
926
 
927
 
6 7u83 928
/* Disk writing routine for LIST(PTR(MAP)) */
2 7u83 929
 
930
#ifndef WRITE_list_ptr_map
931
 
932
static void WRITE_list_ptr_map
6 7u83 933
 
934
(LIST(PTR(MAP)) x_)
2 7u83 935
{
6 7u83 936
    while (!IS_NULL_list(x_)) {
937
	PTR(MAP) y_;
938
	y_ = DEREF_ptr(HEAD_list(x_));
939
	WRITE_BITS(1, (unsigned)1);
940
	WRITE_ptr_map(y_);
941
	x_ = TAIL_list(x_);
2 7u83 942
    }
6 7u83 943
    WRITE_BITS(1, (unsigned)0);
944
    return;
2 7u83 945
}
946
 
947
#endif
948
 
949
 
6 7u83 950
/* Disk writing routine for PTR(MAP) */
2 7u83 951
 
952
#ifndef WRITE_ptr_map
953
 
954
static void WRITE_ptr_map
6 7u83 955
 
956
(PTR(MAP) x_)
2 7u83 957
{
6 7u83 958
    if (IS_NULL_ptr(x_)) {
959
	WRITE_BITS(1, (unsigned)0);
2 7u83 960
    } else {
6 7u83 961
	MAP y_;
962
	DEREF_map(x_, y_);
963
	WRITE_BITS(1, (unsigned)1);
964
	WRITE_map(y_);
2 7u83 965
    }
6 7u83 966
    return;
2 7u83 967
}
968
 
969
#endif
970
 
971
 
972
/* Disk writing routine for MAP */
973
 
974
#ifndef WRITE_map
975
 
976
static void WRITE_map
6 7u83 977
 
978
(MAP x_)
2 7u83 979
{
6 7u83 980
    WRITE_string(x_.name);
981
    WRITE_int(x_.flag);
982
    WRITE_TYPE_P(x_.ret_type);
983
    WRITE_list_ARGUMENT_P(x_.args);
984
    return;
2 7u83 985
}
986
 
987
#endif
988
 
989
 
6 7u83 990
/* Disk writing routine for LIST(PTR(ARGUMENT)) */
2 7u83 991
 
992
#ifndef WRITE_list_ptr_arg
993
 
994
static void WRITE_list_ptr_arg
6 7u83 995
 
996
(LIST(PTR(ARGUMENT)) x_)
2 7u83 997
{
6 7u83 998
    while (!IS_NULL_list(x_)) {
999
	PTR(ARGUMENT) y_;
1000
	y_ = DEREF_ptr(HEAD_list(x_));
1001
	WRITE_BITS(1, (unsigned)1);
1002
	WRITE_ptr_arg(y_);
1003
	x_ = TAIL_list(x_);
2 7u83 1004
    }
6 7u83 1005
    WRITE_BITS(1, (unsigned)0);
1006
    return;
2 7u83 1007
}
1008
 
1009
#endif
1010
 
1011
 
6 7u83 1012
/* Disk writing routine for PTR(ARGUMENT) */
2 7u83 1013
 
1014
#ifndef WRITE_ptr_arg
1015
 
1016
static void WRITE_ptr_arg
6 7u83 1017
 
1018
(PTR(ARGUMENT) x_)
2 7u83 1019
{
6 7u83 1020
    if (IS_NULL_ptr(x_)) {
1021
	WRITE_BITS(1, (unsigned)0);
2 7u83 1022
    } else {
6 7u83 1023
	ARGUMENT y_;
1024
	DEREF_arg(x_, y_);
1025
	WRITE_BITS(1, (unsigned)1);
1026
	WRITE_arg(y_);
2 7u83 1027
    }
6 7u83 1028
    return;
2 7u83 1029
}
1030
 
1031
#endif
1032
 
1033
 
1034
/* Disk writing routine for ARGUMENT */
1035
 
1036
#ifndef WRITE_arg
1037
 
1038
static void WRITE_arg
6 7u83 1039
 
1040
(ARGUMENT x_)
2 7u83 1041
{
6 7u83 1042
    WRITE_string(x_.name);
1043
    WRITE_TYPE_P(x_.type);
1044
    return;
2 7u83 1045
}
1046
 
1047
#endif
1048
 
1049
 
1050
#endif