Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | 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
#ifndef TREE_INCLUDED
32
#define TREE_INCLUDED
33
 
34
 
35
/*
36
    STRUCTURE DEFINITION : WORD
37
 
38
    The structure word is used to record the layout of the pretty
39
    printed TDF tree.  It consists of a layout type (see below
40
    for details), a string of characters, together with the length
41
    of this string, and pointers to the "son" and "brother" words.
42
*/
43
 
44
 
45
typedef struct s_word {
46
    char type ;
47
    int length ;
48
    char *text ;
49
    struct s_word *son ;
50
    struct s_word *bro ;
51
} word ;
52
 
53
 
54
/*
55
    WORD LAYOUT TYPES
56
 
57
    The available layout types are :
58
 
59
	SIMPLE - representing a simple word,
60
	HORIZ_NONE - a word with a number of arguments listed horizontally,
61
	HORIZ_BRACKETS - a word with arguments listed horizontally in brackets,
62
	VERT_NONE - a word with arguments listed vertically,
63
	VERT_BRACKETS - a word with arguments listed vertically in brackets.
64
*/
65
 
66
#define SIMPLE			0
67
#define HORIZ_BRACKETS		1
68
#define VERT_BRACKETS		2
69
#define HORIZ_NONE		3
70
#define VERT_NONE		4
71
 
72
 
73
/*
74
    TDF TREE MANIPULATION
75
 
76
    The layout of the pretty-printed TDF tree is recorded in the
77
    structure word. The routine new_word allocates a new word of
78
    a given type.  The macro end_word is used to indicate the end
79
    of a complex word.  The routine format combines these with
80
    decode to provide a convenient way of decoding a word with a
81
    number of arguments of given sorts.
82
*/
83
 
84
#define blank_line()		( void ) new_word ( SIMPLE )
85
#define end_word( X )		word_ptr = ( X ) ; word_ptr->bro = null
86
 
87
extern int length ;
88
extern word word1 ;
89
extern word *word_ptr ;
90
 
91
extern void initialize_tree PROTO_S ( ( void ) ) ;
92
extern word *new_word PROTO_S ( ( int ) ) ;
93
extern void out_char PROTO_S ( ( int ) ) ;
94
extern void out_string PROTO_S ( ( char * ) ) ;
95
extern void out PROTO_S ( ( char * ) ) ;
96
extern void out_int PROTO_S ( ( long ) ) ;
97
extern void out_signed PROTO_S ( ( char *, int ) ) ;
98
extern void out_unique PROTO_S ( ( unique ) ) ;
99
extern void format PROTO_S ( ( int, char *, char * ) ) ;
100
 
101
 
102
#endif