File: gb_index.h

package info (click to toggle)
arb 6.0.2-1%2Bdeb8u1
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie
  • size: 65,916 kB
  • ctags: 53,258
  • sloc: ansic: 394,903; cpp: 250,252; makefile: 19,620; sh: 15,878; perl: 10,461; fortran: 6,019; ruby: 683; xml: 503; python: 53; awk: 32
file content (103 lines) | stat: -rw-r--r-- 3,301 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// =============================================================== //
//                                                                 //
//   File      : gb_index.h                                        //
//   Purpose   :                                                   //
//                                                                 //
//   Institute of Microbiology (Technical University Munich)       //
//   http://www.arb-home.de/                                       //
//                                                                 //
// =============================================================== //

#ifndef GB_INDEX_H
#define GB_INDEX_H

#ifndef GB_MEMORY_H
#include "gb_memory.h"
#endif
#ifndef GB_DATA_H
#include "gb_data.h"
#endif

// ----------------------
//      gb_if_entries

struct gb_if_entries {
    GB_REL_IFES   rel_ie_next;
    GB_REL_GBDATA rel_ie_gbd;
};

inline gb_if_entries *GB_IF_ENTRIES_NEXT(gb_if_entries *ie) {
    return GB_RESOLVE(gb_if_entries *, ie, rel_ie_next);
}
inline void SET_GB_IF_ENTRIES_NEXT(gb_if_entries *ie, gb_if_entries *next) {
    GB_SETREL(ie, rel_ie_next, next);
}

inline GBDATA *GB_IF_ENTRIES_GBD(gb_if_entries *ie) {
    return GB_RESOLVE(GBDATA*, ie, rel_ie_gbd);
}
inline void SET_GB_IF_ENTRIES_GBD(gb_if_entries *ie, GBDATA *gbd) {
    GB_SETREL(ie, rel_ie_gbd, gbd);
}


// ------------------------------
//      gb_index_files

struct gb_index_files {
    GB_REL_IFS   rel_if_next;
    GBQUARK      key;
    long         hash_table_size;
    long         nr_of_elements;
    GB_CASE      case_sens;
    GB_REL_PIFES rel_entries;
};


#if (MEMORY_TEST==1)

#define GB_ENTRIES_ENTRY(entries, idx)       (entries)[idx]
#define SET_GB_ENTRIES_ENTRY(entries, idx, ie) (entries)[idx] = (ie);

#else

#define GB_ENTRIES_ENTRY(entries, idx)                                  \
    ((gb_if_entries *) ((entries)[idx] ? ((char*)(entries))+((entries)[idx]) : NULL))

#define SET_GB_ENTRIES_ENTRY(entries, idx, ie)                  \
    do {                                                        \
        if (ie) {                                               \
            (entries)[idx] = (char*)(ie)-(char*)(entries);      \
        }                                                       \
        else {                                                  \
            (entries)[idx] = 0;                                 \
        }                                                       \
    } while (0)

#endif // MEMORY_TEST


inline GB_REL_IFES *GB_INDEX_FILES_ENTRIES(gb_index_files *ifs) {
    return GB_RESOLVE(GB_REL_IFES *, ifs, rel_entries);
}
inline void SET_GB_INDEX_FILES_ENTRIES(gb_index_files *ixf, gb_if_entries **entries) {
    GB_SETREL(ixf, rel_entries, entries);
}

inline gb_index_files *GB_INDEX_FILES_NEXT(gb_index_files *ixf) {
    return GB_RESOLVE(gb_index_files *, ixf, rel_if_next);
}
inline void SET_GB_INDEX_FILES_NEXT(gb_index_files *ixf, gb_index_files *next) {
    GB_SETREL(ixf, rel_if_next, next);
}

inline gb_index_files *GBCONTAINER_IFS(GBCONTAINER *gbc) {
    return GB_RESOLVE(gb_index_files *, gbc, rel_ifs);
}
inline void SET_GBCONTAINER_IFS(GBCONTAINER *gbc, gb_index_files *ifs) {
    GB_SETREL(gbc, rel_ifs, ifs);
}

#else
#error gb_index.h included twice
#endif // GB_INDEX_H