Subversion Repositories tendra.SVN

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | 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 HASH_INCLUDED
32
#define HASH_INCLUDED
33
 
34
 
35
/*
36
    TYPE REPRESENTING A HASH TABLE ELEMENT
37
 
38
    A hash table element consists of an object plus a version number.
39
*/
40
 
41
typedef struct hash_elem_tag {
42
    object *obj ;
43
    int vers ;
44
    struct hash_elem_tag *next ;
45
} hash_elem ;
46
 
47
 
48
/*
49
    TYPE REPRESENTING A HASH TABLE
50
 
51
    A hash table consists of a name, which is used in error reports,
52
    and an array of hash elements.
53
*/
54
 
55
#define hash_size		31
56
 
57
typedef struct {
58
    char *name ;
59
    hash_elem *array [ hash_size ] ;
60
} hash_table ;
61
 
62
 
63
/*
64
    SPECIAL VERSION NUMBERS
65
 
66
    Explicitly stated version numbers are always positive.  These are
67
    special version numbers for when no version number is given, or
68
    when a match with any version is permissable.
69
*/
70
 
71
#define no_version		-1
72
#define any_version		-2
73
 
74
 
75
/*
76
    PROCEDURE DECLARATIONS
77
 
78
    These routines are concerned with adding and looking up objects in
79
    hash tables.
80
*/
81
 
82
extern hash_table *make_hash_table PROTO_S ( ( char * ) ) ;
83
extern object *add_hash PROTO_S ( ( hash_table *, object *, int ) ) ;
84
extern object *search_hash PROTO_S ( ( hash_table *, char *, int ) ) ;
85
extern hash_elem *sort_hash PROTO_S ( ( hash_table * ) ) ;
86
extern void init_hash PROTO_S ( ( void ) ) ;
87
 
88
 
89
/*
90
    STANDARD HASH TABLES
91
 
92
    These hash tables represent the basic namespaces.
93
*/
94
 
95
extern hash_table *exps ;
96
extern hash_table *files ;
97
extern hash_table *keywords ;
98
extern hash_table *subsets ;
99
extern hash_table *tags ;
100
extern hash_table *tag_fields ;
101
extern hash_table *tokens ;
102
extern hash_table *types ;
103
extern hash_table *type_fields ;
104
 
105
 
106
#endif