Line -... |
Line 1... |
- |
|
1 |
/*
|
- |
|
2 |
* Copyright (c) 2002-2006 The TenDRA Project <http://www.tendra.org/>.
|
- |
|
3 |
* All rights reserved.
|
- |
|
4 |
*
|
- |
|
5 |
* Redistribution and use in source and binary forms, with or without
|
- |
|
6 |
* modification, are permitted provided that the following conditions are met:
|
- |
|
7 |
*
|
- |
|
8 |
* 1. Redistributions of source code must retain the above copyright notice,
|
- |
|
9 |
* this list of conditions and the following disclaimer.
|
- |
|
10 |
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
- |
|
11 |
* this list of conditions and the following disclaimer in the documentation
|
- |
|
12 |
* and/or other materials provided with the distribution.
|
- |
|
13 |
* 3. Neither the name of The TenDRA Project nor the names of its contributors
|
- |
|
14 |
* may be used to endorse or promote products derived from this software
|
- |
|
15 |
* without specific, prior written permission.
|
- |
|
16 |
*
|
- |
|
17 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
- |
|
18 |
* IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
- |
|
19 |
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
- |
|
20 |
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
- |
|
21 |
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
- |
|
22 |
* EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
- |
|
23 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
- |
|
24 |
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
- |
|
25 |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
- |
|
26 |
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
- |
|
27 |
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
- |
|
28 |
*
|
- |
|
29 |
* $Id$
|
- |
|
30 |
*/
|
1 |
/*
|
31 |
/*
|
2 |
Crown Copyright (c) 1997
|
32 |
Crown Copyright (c) 1997
|
3 |
|
33 |
|
4 |
This TenDRA(r) Computer Program is subject to Copyright
|
34 |
This TenDRA(r) Computer Program is subject to Copyright
|
5 |
owned by the United Kingdom Secretary of State for Defence
|
35 |
owned by the United Kingdom Secretary of State for Defence
|
6 |
acting through the Defence Evaluation and Research Agency
|
36 |
acting through the Defence Evaluation and Research Agency
|
7 |
(DERA). It is made available to Recipients with a
|
37 |
(DERA). It is made available to Recipients with a
|
8 |
royalty-free licence for its use, reproduction, transfer
|
38 |
royalty-free licence for its use, reproduction, transfer
|
9 |
to other parties and amendment for any purpose not excluding
|
39 |
to other parties and amendment for any purpose not excluding
|
10 |
product development provided that any such use et cetera
|
40 |
product development provided that any such use et cetera
|
11 |
shall be deemed to be acceptance of the following conditions:-
|
41 |
shall be deemed to be acceptance of the following conditions:-
|
12 |
|
42 |
|
13 |
(1) Its Recipients shall ensure that this Notice is
|
43 |
(1) Its Recipients shall ensure that this Notice is
|
14 |
reproduced upon any copies or amended versions of it;
|
44 |
reproduced upon any copies or amended versions of it;
|
15 |
|
45 |
|
16 |
(2) Any amended version of it shall be clearly marked to
|
46 |
(2) Any amended version of it shall be clearly marked to
|
17 |
show both the nature of and the organisation responsible
|
47 |
show both the nature of and the organisation responsible
|
18 |
for the relevant amendment or amendments;
|
48 |
for the relevant amendment or amendments;
|
19 |
|
49 |
|
20 |
(3) Its onward transfer from a recipient to another
|
50 |
(3) Its onward transfer from a recipient to another
|
21 |
party shall be deemed to be that party's acceptance of
|
51 |
party shall be deemed to be that party's acceptance of
|
22 |
these conditions;
|
52 |
these conditions;
|
23 |
|
53 |
|
24 |
(4) DERA gives no warranty or assurance as to its
|
54 |
(4) DERA gives no warranty or assurance as to its
|
25 |
quality or suitability for any purpose and DERA accepts
|
55 |
quality or suitability for any purpose and DERA accepts
|
26 |
no liability whatsoever in relation to any use to which
|
56 |
no liability whatsoever in relation to any use to which
|
27 |
it may be put.
|
57 |
it may be put.
|
28 |
*/
|
58 |
*/
|
Line 46... |
Line 76... |
46 |
*
|
76 |
*
|
47 |
* This is the output stream type.
|
77 |
* This is the output stream type.
|
48 |
*
|
78 |
*
|
49 |
***=== FUNCTIONS ============================================================
|
79 |
***=== FUNCTIONS ============================================================
|
50 |
*
|
80 |
*
|
51 |
** Function: void bostream_init
|
81 |
** Function: void bostream_init(BOStreamP bostream)
|
52 |
* PROTO_S ((BOStreamP bostream))
|
- |
|
53 |
** Exceptions:
|
82 |
** Exceptions:
|
54 |
*
|
83 |
*
|
55 |
* This function initialises the specified bostream not to write to any file.
|
84 |
* This function initialises the specified bostream not to write to any file.
|
56 |
*
|
85 |
*
|
57 |
** Function: BoolT bostream_open
|
- |
|
58 |
* PROTO_S ((BOStreamP bostream, CStringP name))
|
86 |
** Function: BoolT bostream_open(BOStreamP bostream, CStringP name)
|
59 |
** Exceptions:
|
87 |
** Exceptions:
|
60 |
*
|
88 |
*
|
61 |
* This function initialises the specified bostream to write to the file with
|
89 |
* This function initialises the specified bostream to write to the file with
|
62 |
* the specified name. The name should not be modified or deallocated until
|
90 |
* the specified name. The name should not be modified or deallocated until
|
63 |
* the bostream has been closed. If the file cannot be opened, the function
|
91 |
* the bostream has been closed. If the file cannot be opened, the function
|
64 |
* returns false. If the file is opened successfully, the function returns
|
92 |
* returns false. If the file is opened successfully, the function returns
|
65 |
* true.
|
93 |
* true.
|
66 |
*
|
94 |
*
|
67 |
** Function: void bostream_assign
|
- |
|
68 |
* PROTO_S ((BOStreamP to, BOStreamP from))
|
95 |
** Function: void bostream_assign(BOStreamP to, BOStreamP from)
|
69 |
** Exceptions:
|
96 |
** Exceptions:
|
70 |
*
|
97 |
*
|
71 |
* This function assigns the from bostream to the to bostream. The from
|
98 |
* This function assigns the from bostream to the to bostream. The from
|
72 |
* bostream should not be used again.
|
99 |
* bostream should not be used again.
|
73 |
*
|
100 |
*
|
74 |
** Function: BoolT bostream_is_open
|
101 |
** Function: BoolT bostream_is_open(BOStreamP bostream)
|
75 |
* PROTO_S ((BOStreamP bostream))
|
- |
|
76 |
*
|
102 |
*
|
77 |
* This function returns true if the specified bostream is writing to a file,
|
103 |
* This function returns true if the specified bostream is writing to a file,
|
78 |
* and false otherwise.
|
104 |
* and false otherwise.
|
79 |
*
|
105 |
*
|
80 |
** Function: void bostream_write_chars
|
- |
|
81 |
* PROTO_S ((BOStreamP bostream, unsigned length,
|
106 |
** Function: void bostream_write_chars(BOStreamP bostream, unsigned length,
|
82 |
* CStringP chars))
|
107 |
* CStringP chars)
|
83 |
** Exceptions: XX_bostream_write_error
|
108 |
** Exceptions: XX_bostream_write_error
|
84 |
*
|
109 |
*
|
85 |
* This function writes the length characters in the chars vector to the
|
110 |
* This function writes the length characters in the chars vector to the
|
86 |
* specified bostream.
|
111 |
* specified bostream.
|
87 |
*
|
112 |
*
|
88 |
** Function: void bostream_write_bytes
|
- |
|
89 |
* PROTO_S ((BOStreamP bostream, unsigned length,
|
113 |
** Function: void bostream_write_bytes(BOStreamP bostream, unsigned length,
|
90 |
* ByteP bytes))
|
114 |
* ByteP bytes)
|
91 |
** Exceptions: XX_bostream_write_error
|
115 |
** Exceptions: XX_bostream_write_error
|
92 |
*
|
116 |
*
|
93 |
* This function writes the length bytes in the bytes vector to the specified
|
117 |
* This function writes the length bytes in the bytes vector to the specified
|
94 |
* bostream.
|
118 |
* bostream.
|
95 |
*
|
119 |
*
|
96 |
** Function: void bostream_write_byte
|
- |
|
97 |
* PROTO_S ((BOStreamP bostream, ByteT byte))
|
120 |
** Function: void bostream_write_byte(BOStreamP bostream, ByteT byte)
|
98 |
** Exceptions: XX_bostream_write_error
|
121 |
** Exceptions: XX_bostream_write_error
|
99 |
*
|
122 |
*
|
100 |
* This function writes the byte to the specified bostream.
|
123 |
* This function writes the byte to the specified bostream.
|
101 |
*
|
124 |
*
|
102 |
** Function: CStringP bostream_name
|
125 |
** Function: CStringP bostream_name(BOStreamP bostream)
|
103 |
* PROTO_S ((BOStreamP bostream))
|
- |
|
104 |
** Exceptions:
|
126 |
** Exceptions:
|
105 |
*
|
127 |
*
|
106 |
* This function returns the name of the file to which the specified
|
128 |
* This function returns the name of the file to which the specified
|
107 |
* bostream is writing. The return value should not be modified or
|
129 |
* bostream is writing. The return value should not be modified or
|
108 |
* deallocated.
|
130 |
* deallocated.
|
109 |
*
|
131 |
*
|
110 |
** Function: void bostream_close
|
132 |
** Function: void bostream_close(BOStreamP bostream)
|
111 |
* PROTO_S ((BOStreamP bostream))
|
- |
|
112 |
** Exceptions:
|
133 |
** Exceptions:
|
113 |
*
|
134 |
*
|
114 |
* This function closes the specified bostream.
|
135 |
* This function closes the specified bostream.
|
115 |
*
|
136 |
*
|
116 |
***=== EXCEPTIONS ===========================================================
|
137 |
***=== EXCEPTIONS ===========================================================
|
Line 155... |
Line 176... |
155 |
extern ExceptionP XX_bostream_write_error;
|
176 |
extern ExceptionP XX_bostream_write_error;
|
156 |
|
177 |
|
157 |
/*--------------------------------------------------------------------------*/
|
178 |
/*--------------------------------------------------------------------------*/
|
158 |
|
179 |
|
159 |
extern void bostream_init
|
180 |
extern void bostream_init
|
160 |
PROTO_S ((BOStreamP));
|
181 |
(BOStreamP);
|
161 |
extern BoolT bostream_open
|
182 |
extern BoolT bostream_open
|
162 |
PROTO_S ((BOStreamP, CStringP));
|
183 |
(BOStreamP, CStringP);
|
163 |
extern void bostream_assign
|
184 |
extern void bostream_assign
|
164 |
PROTO_S ((BOStreamP, BOStreamP));
|
185 |
(BOStreamP, BOStreamP);
|
165 |
extern BoolT bostream_is_open
|
186 |
extern BoolT bostream_is_open
|
166 |
PROTO_S ((BOStreamP));
|
187 |
(BOStreamP);
|
167 |
extern void bostream_write_chars
|
188 |
extern void bostream_write_chars
|
168 |
PROTO_S ((BOStreamP, unsigned, CStringP));
|
189 |
(BOStreamP, unsigned, CStringP);
|
169 |
extern void bostream_write_bytes
|
190 |
extern void bostream_write_bytes
|
170 |
PROTO_S ((BOStreamP, unsigned, ByteP));
|
191 |
(BOStreamP, unsigned, ByteP);
|
171 |
extern void bostream_write_byte
|
192 |
extern void bostream_write_byte
|
172 |
PROTO_S ((BOStreamP, ByteT));
|
193 |
(BOStreamP, ByteT);
|
173 |
extern CStringP bostream_name
|
194 |
extern CStringP bostream_name
|
174 |
PROTO_S ((BOStreamP));
|
195 |
(BOStreamP);
|
175 |
extern void bostream_close
|
196 |
extern void bostream_close
|
176 |
PROTO_S ((BOStreamP));
|
197 |
(BOStreamP);
|
177 |
|
198 |
|
178 |
#endif /* !defined (H_BOSTREAM) */
|
199 |
#endif /* !defined (H_BOSTREAM) */
|