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
#ifndef HIGH_INCLUDED
32
#define HIGH_INCLUDED
33
 
34
 
35
/*
36
    TYPE REPRESENTING HIGH LEVEL SORTS
37
 
38
    A high level sort consists of a name and a dummy sort number, id.
39
    These are associated with a sort number, giving the result sort,
40
    and an array of sort numbers, giving the argument sorts.
41
*/
42
 
43
typedef struct {
44
    char *name ;
45
    sortname id ;
46
    sortname res ;
47
    int no_args ;
48
    sortname *args ;
49
} high_sort ;
50
 
51
 
52
/*
53
    STARTING POINT FOR HIGH LEVEL SORTS
54
 
55
    To distinguish them from the normal TDF sorts, high level sorts
56
    are assigned sort numbers starting at high_start.  The macro
57
    is_high is used to test whether a sort number corresponds to a
58
    high level sort, and high_no is used to transform a high level
59
    sort number into an offset in the table high_sorts.
60
*/
61
 
62
#define high_start	100
63
#define is_high( s )	( ( s ) >= high_start )
64
#define high_no( n )	( ( int ) ( ( n ) - high_start ) )
65
 
66
 
67
/*
68
    ROUTINES FOR MANIPULATING HIGH LEVEL SORTS
69
*/
70
 
71
extern high_sort *high_sorts ;
72
extern int crt_high_sort ;
73
extern high_sort *new_high_sort PROTO_S ( ( high_sort * ) ) ;
74
extern void set_high_sort PROTO_S ( ( char *, tok_info * ) ) ;
75
extern high_sort *unique_high_sort PROTO_S ( ( high_sort * ) ) ;
76
extern sortname find_high_sort PROTO_S ( ( char * ) ) ;
77
extern char *find_decode_string PROTO_S ( ( high_sort * ) ) ;
78
extern char *find_sortname PROTO_S ( ( char *, sortname * ) ) ;
79
#define sprint_high_sort( p, s )\
80
	( void ) sprintf ( p, "T%d#", high_no ( s ) )
81
 
82
 
83
#endif