Subversion Repositories tendra.SVN

Rev

Rev 2 | Go to most recent revision | 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
#ifndef FILE_INCLUDED
32
#define FILE_INCLUDED
33
 
34
 
35
/*
36
    FILE MANIPULATION DECLARATIONS
37
 
38
    The routines in this module are concerned with the low level file
39
    reading and manipulation, including the processing of #include
40
    directives, start-up and end-up files.  The routine next_char is the
41
    lowest level file reading routine, which returns the next character
42
    in the input file.
43
*/
44
 
45
extern int refill_char PROTO_S ( ( void ) ) ;
46
extern string init_buffer PROTO_S ( ( unsigned long ) ) ;
47
extern string make_pathname PROTO_S ( ( string ) ) ;
48
extern int is_full_pathname PROTO_S ( ( string ) ) ;
49
extern string set_crt_loc PROTO_S ( ( string, int ) ) ;
50
extern int start_include PROTO_S ( ( string, int, int, int ) ) ;
51
extern int end_include PROTO_S ( ( int ) ) ;
52
extern void open_startup PROTO_S ( ( void ) ) ;
53
extern int open_input PROTO_S ( ( int ) ) ;
54
extern int open_output PROTO_S ( ( int, int ) ) ;
55
extern void close_input PROTO_S ( ( void ) ) ;
56
extern void close_output PROTO_S ( ( int ) ) ;
57
extern void set_incl_depth PROTO_S ( ( unsigned long ) ) ;
58
extern void add_directory PROTO_S ( ( string, string ) ) ;
59
extern void directory_mode PROTO_S ( ( string, OPTIONS * ) ) ;
60
extern void builtin_startup PROTO_S ( ( void ) ) ;
61
extern void term_input PROTO_S ( ( void ) ) ;
62
extern long tell_buffer PROTO_S ( ( unsigned long ) ) ;
63
extern void seek_buffer PROTO_S ( ( unsigned long, long, int ) ) ;
64
extern void protection_macro PROTO_S ( ( HASHID, int, int ) ) ;
65
extern void update_column PROTO_S ( ( void ) ) ;
66
 
67
#ifdef SYSTEM_INCLUDED
68
extern int already_included PROTO_S ( ( string, STAT_TYPE *, int ) ) ;
69
#endif
70
 
71
 
72
/*
73
    TYPE REPRESENTING AN INCLUSION DIRECTORY
74
 
75
    This type is used to represent a directory which is searched during
76
    file inclusion.
77
*/
78
 
79
typedef struct incl_dir_tag {
80
    string path ;
81
    string name ;
82
    OPTIONS *mode ;
83
    ulong no ;
84
    struct incl_dir_tag *next ;
85
} INCL_DIR ;
86
 
87
 
88
/*
89
    FILE READING VARIABLES
90
 
91
    These variables relate to the file reading and writing routines.
92
*/
93
 
94
extern int crt_line_changed ;
95
extern int crt_file_changed ;
96
extern int crt_col_changed ;
97
extern int crt_file_type ;
98
extern int bad_crt_loc ;
99
extern unsigned long crt_spaces ;
100
extern unsigned long tab_width ;
101
extern BUFFER internal_buff ;
102
extern BUFFER incl_buff ;
103
extern LIST ( string ) startup_files, endup_files ;
104
extern FILE *input_file, *output_file [] ;
105
extern string input_name, output_name [] ;
106
extern unsigned long crt_buff_no ;
107
extern string input_start, input_end ;
108
extern string input_posn, input_eof ;
109
extern string input_crt ;
110
extern INCL_DIR *dir_path ;
111
 
112
 
113
/*
114
    CHARACTER READING AND UNREADING MACROS
115
 
116
    The macro next_char reads the next character from the input buffer.
117
    It needs to be checked against char_end to spot the end of the buffer.
118
    The macro unread_char unreads the character A by inserting it back
119
    into the input buffer.
120
*/
121
 
122
#define next_char()		( ( int ) ( *( input_posn++ ) ) )
123
#define unread_char( A )	( *( --input_posn ) = ( character ) ( A ) )
124
 
125
 
126
/*
127
    OUTPUT FILE NUMBERS
128
 
129
    These values are used to represent the various output files.
130
*/
131
 
132
#define OUTPUT_TDF		0
133
#define OUTPUT_PREPROC		1
134
#define OUTPUT_SPEC		2
135
#define OUTPUT_DUMP		3
136
#define OUTPUT_ERROR		4
137
#define OUTPUT_FILES		5
138
 
139
 
140
#endif