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 TDF_INCLUDED
|
|
|
32 |
#define TDF_INCLUDED
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
/*
|
|
|
36 |
TDF CONSTRUCT ENCODING MACROS
|
|
|
37 |
|
|
|
38 |
The main TDF construct encoding macros are automatically generated
|
|
|
39 |
from the TDF specification. There are two versions provided, which
|
|
|
40 |
one is included depends on the value of TDF_VERSION.
|
|
|
41 |
*/
|
|
|
42 |
|
|
|
43 |
#if TDF_OUTPUT
|
|
|
44 |
#if ( TDF_VERSION == 401 )
|
|
|
45 |
#include "tdf1.h"
|
|
|
46 |
#else
|
|
|
47 |
FAIL_COMPILER Unknown TDF version number!
|
|
|
48 |
#endif
|
|
|
49 |
#else
|
|
|
50 |
#define TDF_major ( TDF_VERSION / 100 )
|
|
|
51 |
#define TDF_minor ( TDF_VERSION % 100 )
|
|
|
52 |
#endif
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
/*
|
|
|
56 |
EXTRA ENCODING MACROS
|
|
|
57 |
|
|
|
58 |
These macros give further useful encoding constructs. Again A appears
|
|
|
59 |
more than once in certain of these macros.
|
|
|
60 |
*/
|
|
|
61 |
|
|
|
62 |
#define ENC_LIST( A, B ) { ENC_BITS ( A, 1, 0 ) ; ENC_INT ( A, B ) ; }
|
|
|
63 |
#define ENC_SLIST( A, B ) ENC_INT ( A, B )
|
|
|
64 |
#define ENC_LENGTH( A, B ) ENC_INT ( A, B )
|
|
|
65 |
|
|
|
66 |
#define ENC_INT_SMALL( A, B ) ENC_BITS ( A, 4, ( B ) + 8 )
|
|
|
67 |
#define ENC_LIST_SMALL( A, B ) ENC_BITS ( A, 5, ( B ) + 8 )
|
|
|
68 |
#define ENC_SLIST_SMALL( A, B ) ENC_INT_SMALL ( A, B )
|
|
|
69 |
#define ENC_LEN_SMALL( A, B ) ENC_INT_SMALL ( A, B )
|
|
|
70 |
|
|
|
71 |
#define ENC_NTEST( A, B ) ENX_ntest ( A, ( B ) + 3 )
|
|
|
72 |
#define ENC_RMODE( A, B ) ENX_rounding_mode ( A, ( B ) + 3 )
|
|
|
73 |
|
|
|
74 |
#define ENC_SEQUENCE( A, B ) { ENC_sequence ( A ) ; ENC_LIST ( A, B ) ; }
|
|
|
75 |
#define ENC_SEQ_SMALL( A, B ) { ENC_sequence ( A ) ; ENC_LIST_SMALL ( A, B ) ; }
|
|
|
76 |
|
|
|
77 |
#ifndef LINK_dg_comp_props
|
|
|
78 |
#define LINK_dg_comp_props "<error>"
|
|
|
79 |
#define TDF_NEW_DIAG 0
|
|
|
80 |
#else
|
|
|
81 |
#define TDF_NEW_DIAG 1
|
|
|
82 |
#endif
|
|
|
83 |
|
|
|
84 |
#ifndef LINK_dg_tag
|
|
|
85 |
#define LINK_dg_tag "<error>"
|
|
|
86 |
#endif
|
|
|
87 |
|
|
|
88 |
#ifndef ENC_make_string
|
|
|
89 |
#define ENC_make_string( A ) /* empty */
|
|
|
90 |
#endif
|
|
|
91 |
|
|
|
92 |
#ifndef ENC_initial_value
|
|
|
93 |
#define ENC_initial_value( A ) /* empty */
|
|
|
94 |
#endif
|
|
|
95 |
|
|
|
96 |
#ifndef ENC_token_definition
|
|
|
97 |
#define ENC_token_definition( A ) ENC_BITS ( A, 1, 1 )
|
|
|
98 |
#endif
|
|
|
99 |
|
|
|
100 |
|
|
|
101 |
/*
|
|
|
102 |
ENCODING PARAMETERS
|
|
|
103 |
|
|
|
104 |
This macros give various values which are used to parameterise the
|
|
|
105 |
encoding.
|
|
|
106 |
*/
|
|
|
107 |
|
|
|
108 |
#define ARRAY_PADDING 1
|
|
|
109 |
#define STRING_PADDING 7
|
|
|
110 |
#define SMALL_COMPOUND_INIT 4
|
|
|
111 |
#define SMALL_FLOAT_CONST 128
|
|
|
112 |
#define SMALL_ARRAY_BOUND 10000
|
|
|
113 |
|
|
|
114 |
|
|
|
115 |
#endif
|