Debian Codegraph @

prboom2/src/dsda/deh_hash.h

raw
1 //
2 // Copyright(C) 2022 by Ryan Krafnick
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // DESCRIPTION:
15 // DSDA Dehacked Hash
16 //
17
18 #ifndef __DSDA_DEH_HASH__
19 #define __DSDA_DEH_HASH__
20
21 #define DEH_INDEX_HASH_SIZE 128
22 #define DEH_INDEX_NOT_FOUND -1
23
24 typedef struct deh_index_entry_s {
25 int index_in;
26 int index_out;
27 struct deh_index_entry_s* next;
28 } deh_index_entry_t;
29
30 typedef struct {
31 deh_index_entry_t table[DEH_INDEX_HASH_SIZE];
32 int start_index;
33 int end_index;
34 } deh_index_hash_t;
35
36 int dsda_FindDehIndex(int index, deh_index_hash_t* hash);
37 int dsda_GetDehIndex(int index, deh_index_hash_t* hash);
38
39 #endif