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 |
/*** tdf-read.h --- TDF reader ADT.
|
|
|
32 |
*
|
|
|
33 |
** Author: Steve Folkes <smf@hermes.mod.uk>
|
|
|
34 |
*
|
|
|
35 |
*** Commentary:
|
|
|
36 |
*
|
|
|
37 |
* See the file "tdf-read.c" for more information.
|
|
|
38 |
*
|
|
|
39 |
*** Change Log:
|
|
|
40 |
* $Log: tdf-read.h,v $
|
|
|
41 |
* Revision 1.1.1.1 1998/01/17 15:57:20 release
|
|
|
42 |
* First version to be checked into rolling release.
|
|
|
43 |
*
|
|
|
44 |
* Revision 1.2 1994/12/12 11:46:57 smf
|
|
|
45 |
* Performing changes for 'CR94_178.sid+tld-update' - bringing in line with
|
|
|
46 |
* OSSG C Coding Standards.
|
|
|
47 |
*
|
|
|
48 |
* Revision 1.1.1.1 1994/07/25 16:03:39 smf
|
|
|
49 |
* Initial import of TDF linker 3.5 non shared files.
|
|
|
50 |
*
|
|
|
51 |
**/
|
|
|
52 |
|
|
|
53 |
/****************************************************************************/
|
|
|
54 |
|
|
|
55 |
#ifndef H_TDF_READ
|
|
|
56 |
#define H_TDF_READ
|
|
|
57 |
|
|
|
58 |
#include "os-interface.h"
|
|
|
59 |
#include "bistream.h"
|
|
|
60 |
#include "dstring.h"
|
|
|
61 |
#include "exception.h"
|
|
|
62 |
#include "name-key.h"
|
|
|
63 |
|
|
|
64 |
/*--------------------------------------------------------------------------*/
|
|
|
65 |
|
|
|
66 |
#ifdef FS_NO_ENUM
|
|
|
67 |
typedef int ReaderTypeT, *ReaderTypeP;
|
|
|
68 |
#define RT_STREAM (0)
|
|
|
69 |
#define RT_STRING (1)
|
|
|
70 |
#else
|
|
|
71 |
typedef enum {
|
|
|
72 |
RT_STREAM,
|
|
|
73 |
RT_STRING
|
|
|
74 |
} ReaderTypeT, *ReaderTypeP;
|
|
|
75 |
#endif /* defined (FS_NO_ENUM) */
|
|
|
76 |
|
|
|
77 |
typedef struct TDFReaderT {
|
|
|
78 |
ReaderTypeT type;
|
|
|
79 |
union {
|
|
|
80 |
BIStreamT bistream;
|
|
|
81 |
struct {
|
|
|
82 |
CStringP contents;
|
|
|
83 |
CStringP current;
|
|
|
84 |
CStringP limit;
|
|
|
85 |
CStringP name;
|
|
|
86 |
unsigned byte;
|
|
|
87 |
} string;
|
|
|
88 |
} u;
|
|
|
89 |
ByteT byte;
|
|
|
90 |
BoolT new_byte;
|
|
|
91 |
} TDFReaderT, *TDFReaderP;
|
|
|
92 |
|
|
|
93 |
/*--------------------------------------------------------------------------*/
|
|
|
94 |
|
|
|
95 |
extern ExceptionP XX_tdf_read_error;
|
|
|
96 |
|
|
|
97 |
/*--------------------------------------------------------------------------*/
|
|
|
98 |
|
|
|
99 |
extern BoolT tdf_reader_open
|
|
|
100 |
PROTO_S ((TDFReaderP, CStringP));
|
|
|
101 |
extern void tdf_reader_open_string
|
|
|
102 |
PROTO_S ((TDFReaderP, CStringP, NStringP));
|
|
|
103 |
extern CStringP tdf_reader_name
|
|
|
104 |
PROTO_S ((TDFReaderP));
|
|
|
105 |
extern unsigned tdf_reader_byte
|
|
|
106 |
PROTO_S ((TDFReaderP));
|
|
|
107 |
extern unsigned tdf_read_int
|
|
|
108 |
PROTO_S ((TDFReaderP));
|
|
|
109 |
extern void tdf_read_align
|
|
|
110 |
PROTO_S ((TDFReaderP));
|
|
|
111 |
extern void tdf_read_bytes
|
|
|
112 |
PROTO_S ((TDFReaderP, NStringP));
|
|
|
113 |
extern void tdf_read_string
|
|
|
114 |
PROTO_S ((TDFReaderP, NStringP));
|
|
|
115 |
extern void tdf_read_name
|
|
|
116 |
PROTO_S ((TDFReaderP, NameKeyP));
|
|
|
117 |
extern void tdf_read_eof
|
|
|
118 |
PROTO_S ((TDFReaderP));
|
|
|
119 |
extern void tdf_reader_rewind
|
|
|
120 |
PROTO_S ((TDFReaderP));
|
|
|
121 |
extern void tdf_reader_close
|
|
|
122 |
PROTO_S ((TDFReaderP));
|
|
|
123 |
|
|
|
124 |
#endif /* !defined (H_TDF_READ) */
|
|
|
125 |
|
|
|
126 |
/*
|
|
|
127 |
* Local variables(smf):
|
|
|
128 |
* eval: (include::add-path-entry "../os-interface" "../library")
|
|
|
129 |
* eval: (include::add-path-entry "../generated")
|
|
|
130 |
* end:
|
|
|
131 |
**/
|