summaryrefslogtreecommitdiff
path: root/src/emap/judyarray.h
blob: ad9e1f089ced320e3899f91a490eef7ae0f0a64f (plain) (blame)
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
// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// Copyright (c) 2018 Evol developers

#ifndef EVOL_JUDY_ARRAY
#define EVOL_JUDY_ARRAY

#include "common/hercules.h"
#include "common/db.h"

struct judy_interface
{
    int64 last_id;
    void *arrays;
    int64 (*new_array) (void);
    bool (*clear_array) (int64 id);
    bool (*destroy_array) (int64 id);
    bool (*array_exists) (int64 id);
    int64 (*array_size) (int64 id);
    const struct DBData* (*getvalue) (int64 id, const char *key, const struct DBData *defval);
    bool (*setvalue) (int64 id, const char *key, struct DBData *value);
};

void judy_defaults(void);
void judy_init(void);
void judy_final(void);

HPShared struct judy_interface *judy;

#endif  // EVOL_JUDY_ARRAY