ARB
gb_index.h
Go to the documentation of this file.
1 // =============================================================== //
2 // //
3 // File : gb_index.h //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // =============================================================== //
10 
11 #ifndef GB_INDEX_H
12 #define GB_INDEX_H
13 
14 #ifndef GB_MEMORY_H
15 #include "gb_memory.h"
16 #endif
17 #ifndef GB_DATA_H
18 #include "gb_data.h"
19 #endif
20 
21 // ----------------------
22 // gb_if_entries
23 
24 struct gb_if_entries {
27 };
28 
30  return GB_RESOLVE(gb_if_entries *, ie, rel_ie_next);
31 }
33  GB_SETREL(ie, rel_ie_next, next);
34 }
35 
37  return GB_RESOLVE(GBDATA*, ie, rel_ie_gbd);
38 }
39 inline void SET_GB_IF_ENTRIES_GBD(gb_if_entries *ie, GBDATA *gbd) {
40  GB_SETREL(ie, rel_ie_gbd, gbd);
41 }
42 
43 
44 // ------------------------------
45 // gb_index_files
46 
54 };
55 
56 
57 #if (MEMORY_TEST==1)
58 
59 #define GB_ENTRIES_ENTRY(entries, idx) (entries)[idx]
60 #define SET_GB_ENTRIES_ENTRY(entries, idx, ie) (entries)[idx] = (ie);
61 
62 #else
63 
64 #define GB_ENTRIES_ENTRY(entries, idx) \
65  ((gb_if_entries *) ((entries)[idx] ? ((char*)(entries))+((entries)[idx]) : NULp))
66 
67 #define SET_GB_ENTRIES_ENTRY(entries, idx, ie) \
68  do { \
69  if (ie) { \
70  (entries)[idx] = (char*)(ie)-(char*)(entries); \
71  } \
72  else { \
73  (entries)[idx] = 0; \
74  } \
75  } while (0)
76 
77 #endif // MEMORY_TEST
78 
79 
81  return GB_RESOLVE(GB_REL_IFES *, ifs, rel_entries);
82 }
84  GB_SETREL(ixf, rel_entries, entries);
85 }
86 
88  return GB_RESOLVE(gb_index_files *, ixf, rel_if_next);
89 }
91  GB_SETREL(ixf, rel_if_next, next);
92 }
93 
95  return GB_RESOLVE(gb_index_files *, gbc, rel_ifs);
96 }
98  GB_SETREL(gbc, rel_ifs, ifs);
99 }
100 
101 #else
102 #error gb_index.h included twice
103 #endif // GB_INDEX_H
long GB_REL_PIFES
Definition: gb_memory.h:61
void SET_GB_IF_ENTRIES_GBD(gb_if_entries *ie, GBDATA *gbd)
Definition: gb_index.h:39
gb_index_files * GB_INDEX_FILES_NEXT(gb_index_files *ixf)
Definition: gb_index.h:87
GBDATA * GB_IF_ENTRIES_GBD(gb_if_entries *ie)
Definition: gb_index.h:36
long GB_REL_GBDATA
Definition: gb_memory.h:56
long GB_REL_IFS
Definition: gb_memory.h:60
GB_REL_GBDATA rel_ie_gbd
Definition: gb_index.h:26
void SET_GB_INDEX_FILES_ENTRIES(gb_index_files *ixf, gb_if_entries **entries)
Definition: gb_index.h:83
GB_REL_PIFES rel_entries
Definition: gb_index.h:53
GB_REL_IFES rel_ie_next
Definition: gb_index.h:25
GBQUARK key
Definition: gb_index.h:49
void SET_GB_INDEX_FILES_NEXT(gb_index_files *ixf, gb_index_files *next)
Definition: gb_index.h:90
void SET_GB_IF_ENTRIES_NEXT(gb_if_entries *ie, gb_if_entries *next)
Definition: gb_index.h:32
gb_index_files * GBCONTAINER_IFS(GBCONTAINER *gbc)
Definition: gb_index.h:94
GB_CASE
Definition: arb_core.h:30
gb_if_entries * GB_IF_ENTRIES_NEXT(gb_if_entries *ie)
Definition: gb_index.h:29
#define GB_SETREL(struct_add, member_name, address)
Definition: gb_memory.h:82
GB_CASE case_sens
Definition: gb_index.h:52
long GB_REL_IFES
Definition: gb_memory.h:59
void SET_GBCONTAINER_IFS(GBCONTAINER *gbc, gb_index_files *ifs)
Definition: gb_index.h:97
GB_REL_IFS rel_if_next
Definition: gb_index.h:48
#define GB_RESOLVE(typ, struct_add, member_name)
Definition: gb_memory.h:77
GB_REL_IFES * GB_INDEX_FILES_ENTRIES(gb_index_files *ifs)
Definition: gb_index.h:80
long nr_of_elements
Definition: gb_index.h:51
long hash_table_size
Definition: gb_index.h:50