Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – tendra.SVN – Blame – //branches/tendra4/src/tools/pl/templ/decodings.c – Rev 2

Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | 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
#include "config.h"
32
#include "enc_nos.h"
33
#include "errors.h"
34
#include "readstreams.h"
35
#include "decodings.h"
36
@use all
37
@loop sort
38
@if sort.basic
39
 
40
 
41
/* DECODE %ST */
42
 
43
unsigned int d_%SN
44
    PROTO_N ( ( n ) )
45
    PROTO_T ( int n )
46
{
47
    unsigned int enc = get_basic_int ( %SB, %SE ) ;
48
    switch ( enc ) {
49
@loop sort.cons
50
	case e_%CN : {
51
	    consname ( "%CN", n ) ;
52
@loop cons.param
53
@if param.sort.eq.bitstream
54
	    IGNORE d_bitstream ( "%CN", n + 1 ) ;
55
@else
56
	    IGNORE d_%PSN ( n + 1 ) ;
57
@endif
58
@end
59
	    break ;
60
	}
61
@end
62
	default : {
63
	    fail ( "Bad %SN value, %u", enc ) ;
64
	    break ;
65
	}
66
    }
67
    return ( enc ) ;
68
}
69
@else
70
@if sort.dummy
71
 
72
 
73
/* DECODE %ST */
74
 
75
unsigned int d_%SN
76
    PROTO_N ( ( n ) )
77
    PROTO_T ( int n )
78
{
79
@loop sort.cons
80
    consname ( "%CN", n ) ;
81
@loop cons.param
82
@if param.sort.eq.bitstream
83
    IGNORE d_bitstream ( "%CN", n + 1 ) ;
84
@else
85
    IGNORE d_%PSN ( n + 1 ) ;
86
@endif
87
@end
88
    return ( %CE ) ;
89
@end
90
}
91
@else
92
@if sort.option
93
 
94
 
95
/* DECODE OPTIONAL %SST */
96
 
97
unsigned int d_%SN
98
    PROTO_N ( ( n ) )
99
    PROTO_T ( int n )
100
{
101
    unsigned int nl = get_basic_int ( 1, 0 ) ;
102
    if ( nl ) IGNORE d_%SSN ( n ) ;
103
    return ( nl ) ;
104
}
105
@else
106
@if sort.slist
107
 
108
 
109
/* DECODE SIMPLE %SST LIST */
110
 
111
unsigned int d_%SN
112
    PROTO_N ( ( n ) )
113
    PROTO_T ( int n )
114
{
115
    unsigned int nl = get_tdfint () ;
116
    for ( ; nl != 0 ; nl-- ) IGNORE d_%SSN ( n + 1 ) ;
117
    return ( nl ) ;
118
}
119
@else
120
@if sort.list
121
 
122
 
123
/* DECODE %SST LIST */
124
 
125
unsigned int d_%SN
126
    PROTO_N ( ( n ) )
127
    PROTO_T ( int n )
128
{
129
    unsigned int nl ;
130
    IGNORE get_basic_int ( 1, 0 ) ;
131
    nl = get_tdfint () ;
132
    for ( ; nl != 0 ; nl-- ) IGNORE d_%SSN ( n + 1 ) ;
133
    return ( nl ) ;
134
}
135
@endif
136
@endif
137
@endif
138
@endif
139
@endif
140
@end