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 |
/*** library.h --- TDF library ADT.
|
|
|
32 |
*
|
|
|
33 |
** Author: Steve Folkes <smf@hermes.mod.uk>
|
|
|
34 |
*
|
|
|
35 |
*** Commentary:
|
|
|
36 |
*
|
|
|
37 |
* See the file "library.c" for more information.
|
|
|
38 |
*
|
|
|
39 |
*** Change Log:
|
|
|
40 |
* $Log: library.h,v $
|
|
|
41 |
* Revision 1.1.1.1 1998/01/17 15:57:18 release
|
|
|
42 |
* First version to be checked into rolling release.
|
|
|
43 |
*
|
|
|
44 |
* Revision 1.4 1995/09/22 08:39:20 smf
|
|
|
45 |
* Fixed problems with incomplete structures (to shut "tcc" up).
|
|
|
46 |
* Fixed some problems in "name-key.c" (no real problems, but rewritten to
|
|
|
47 |
* reduce the warnings that were output by "tcc" and "gcc").
|
|
|
48 |
* Fixed bug CR95_354.tld-common-id-problem (library capsules could be loaded
|
|
|
49 |
* more than once).
|
|
|
50 |
*
|
|
|
51 |
* Revision 1.3 1995/07/07 15:32:28 smf
|
|
|
52 |
* Updated to support TDF specification 4.0.
|
|
|
53 |
*
|
|
|
54 |
* Revision 1.2 1994/12/12 11:46:25 smf
|
|
|
55 |
* Performing changes for 'CR94_178.sid+tld-update' - bringing in line with
|
|
|
56 |
* OSSG C Coding Standards.
|
|
|
57 |
*
|
|
|
58 |
* Revision 1.1.1.1 1994/07/25 16:03:32 smf
|
|
|
59 |
* Initial import of TDF linker 3.5 non shared files.
|
|
|
60 |
*
|
|
|
61 |
**/
|
|
|
62 |
|
|
|
63 |
/****************************************************************************/
|
|
|
64 |
|
|
|
65 |
#ifndef H_LIBRARY
|
|
|
66 |
#define H_LIBRARY
|
|
|
67 |
|
|
|
68 |
#include "os-interface.h"
|
|
|
69 |
#include "capsule.h"
|
|
|
70 |
#include "dalloc.h"
|
|
|
71 |
#include "shape-table.h"
|
|
|
72 |
#include "tdf-read.h"
|
|
|
73 |
#include "tdf-write.h"
|
|
|
74 |
|
|
|
75 |
/*--------------------------------------------------------------------------*/
|
|
|
76 |
|
|
|
77 |
#ifdef FS_NO_ENUM
|
|
|
78 |
typedef int LibraryTypeT, *LibraryTypeP;
|
|
|
79 |
#define LT_INPUT (0)
|
|
|
80 |
#define LT_OUTPUT (1)
|
|
|
81 |
#else
|
|
|
82 |
typedef enum {
|
|
|
83 |
LT_INPUT,
|
|
|
84 |
LT_OUTPUT
|
|
|
85 |
} LibraryTypeT, *LibraryTypeP;
|
|
|
86 |
#endif /* defined (FS_NO_ENUM) */
|
|
|
87 |
|
|
|
88 |
struct LibraryT;
|
|
|
89 |
|
|
|
90 |
typedef struct LibCapsuleT {
|
|
|
91 |
struct LibraryT *library;
|
|
|
92 |
CStringP name;
|
|
|
93 |
NStringT contents;
|
|
|
94 |
BoolT loaded;
|
|
|
95 |
} LibCapsuleT, *LibCapsuleP;
|
|
|
96 |
|
|
|
97 |
typedef struct LibraryT {
|
|
|
98 |
LibraryTypeT type;
|
|
|
99 |
union {
|
|
|
100 |
TDFReaderT reader;
|
|
|
101 |
TDFWriterT writer;
|
|
|
102 |
} u;
|
|
|
103 |
CStringP name;
|
|
|
104 |
unsigned num_capsules;
|
|
|
105 |
LibCapsuleP capsules;
|
|
|
106 |
unsigned major;
|
|
|
107 |
unsigned minor;
|
|
|
108 |
BoolT complete;
|
|
|
109 |
} LibraryT, *LibraryP;
|
|
|
110 |
|
|
|
111 |
/*--------------------------------------------------------------------------*/
|
|
|
112 |
|
|
|
113 |
extern CStringP lib_capsule_name
|
|
|
114 |
PROTO_S ((LibCapsuleP));
|
|
|
115 |
extern CStringP lib_capsule_full_name
|
|
|
116 |
PROTO_S ((LibCapsuleP));
|
|
|
117 |
extern NStringP lib_capsule_contents
|
|
|
118 |
PROTO_S ((LibCapsuleP));
|
|
|
119 |
extern BoolT lib_capsule_is_loaded
|
|
|
120 |
PROTO_S ((LibCapsuleP));
|
|
|
121 |
extern void lib_capsule_loaded
|
|
|
122 |
PROTO_S ((LibCapsuleP));
|
|
|
123 |
|
|
|
124 |
extern void write_lib_capsule_full_name
|
|
|
125 |
PROTO_S ((OStreamP, LibCapsuleP));
|
|
|
126 |
|
|
|
127 |
extern LibraryP library_create_stream_input
|
|
|
128 |
PROTO_S ((CStringP));
|
|
|
129 |
extern LibraryP library_create_stream_output
|
|
|
130 |
PROTO_S ((CStringP));
|
|
|
131 |
extern CStringP library_name
|
|
|
132 |
PROTO_S ((LibraryP));
|
|
|
133 |
extern unsigned library_num_capsules
|
|
|
134 |
PROTO_S ((LibraryP));
|
|
|
135 |
extern LibCapsuleP library_get_capsule
|
|
|
136 |
PROTO_S ((LibraryP, unsigned));
|
|
|
137 |
extern unsigned library_byte
|
|
|
138 |
PROTO_S ((LibraryP));
|
|
|
139 |
extern void library_content
|
|
|
140 |
PROTO_S ((LibraryP, BoolT, BoolT, BoolT));
|
|
|
141 |
extern void library_extract_all
|
|
|
142 |
PROTO_S ((LibraryP, BoolT));
|
|
|
143 |
extern void library_extract
|
|
|
144 |
PROTO_S ((LibraryP, BoolT, BoolT, unsigned, CStringP *));
|
|
|
145 |
extern void library_read
|
|
|
146 |
PROTO_S ((LibraryP, ShapeTableP));
|
|
|
147 |
extern void library_write
|
|
|
148 |
PROTO_S ((LibraryP, ShapeTableP, unsigned, CapsuleP *));
|
|
|
149 |
extern void library_close
|
|
|
150 |
PROTO_S ((LibraryP));
|
|
|
151 |
|
|
|
152 |
#endif /* !defined (H_LIBRARY) */
|
|
|
153 |
|
|
|
154 |
/*
|
|
|
155 |
* Local variables(smf):
|
|
|
156 |
* eval: (include::add-path-entry "../os-interface" "../library")
|
|
|
157 |
* eval: (include::add-path-entry "../generated")
|
|
|
158 |
* end:
|
|
|
159 |
**/
|