| 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 |
#ifndef OPHTASK_H |
| 33 |
#define OPHTASK_H |
| 34 |
|
| 35 |
#include "hash.h" |
| 36 |
#include "table.h" |
| 37 |
#include "ophel.h" |
| 38 |
#include "ophstat.h" |
| 39 |
|
| 40 |
#ifdef __cplusplus |
| 41 |
extern "C" { |
| 42 |
#endif |
| 43 |
|
| 44 |
#define BLOOM_SIZE 32768 |
| 45 |
|
| 46 |
typedef enum { preload_all = 0x001, |
| 47 |
preload_one = 0x002, |
| 48 |
unload = 0x004, |
| 49 |
find = 0x008, |
| 50 |
lookup_idx = 0x010, |
| 51 |
lookup_end = 0x020, |
| 52 |
lookup_srt = 0x040, |
| 53 |
check = 0x080, |
| 54 |
bforce_all = 0x100, |
| 55 |
bforce_nt = 0x200, |
| 56 |
bforce_lm = 0x400, |
| 57 |
resolve_nt = 0x800, |
| 58 |
all = 0xfff } ophkind_t; |
| 59 |
|
| 60 |
typedef struct ophload_t_ { |
| 61 |
list_t *tables; |
| 62 |
table_t *tbl; |
| 63 |
table_preload_t preload; |
| 64 |
} ophload_t; |
| 65 |
|
| 66 |
typedef struct ophwork_t_ { |
| 67 |
hash_t *hsh; |
| 68 |
htbl_t *htbl; |
| 69 |
|
| 70 |
int cmin; |
| 71 |
int cmax; |
| 72 |
|
| 73 |
ophel_t **tosearch; |
| 74 |
} ophwork_t; |
| 75 |
|
| 76 |
typedef struct ophbforce_t_ { |
| 77 |
int nhashes; |
| 78 |
|
| 79 |
hash_t **hashes; |
| 80 |
uchar_t **hash; |
| 81 |
int *found; |
| 82 |
|
| 83 |
int idx[8]; |
| 84 |
int len; |
| 85 |
|
| 86 |
int count; |
| 87 |
|
| 88 |
int bloom[BLOOM_SIZE]; |
| 89 |
} ophbforce_t; |
| 90 |
|
| 91 |
typedef struct ophtask_t_ { |
| 92 |
ophkind_t kind; |
| 93 |
void *data; |
| 94 |
ophstat_t *stat; |
| 95 |
} ophtask_t; |
| 96 |
|
| 97 |
ophtask_t *ophtask_alloc(ophkind_t kind); |
| 98 |
void ophtask_free(ophtask_t *task); |
| 99 |
void ophtask_convert(ophtask_t *task, ophkind_t from, ophkind_t to); |
| 100 |
|
| 101 |
#ifdef __cplusplus |
| 102 |
} |
| 103 |
#endif |
| 104 |
#endif |