aboutsummaryrefslogtreecommitdiff
path: root/include/bh/bh.h
blob: a56e169365c4a24d1f7cbc5a23eb13fa0599fd24 (plain)
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
#ifndef BH_H
#define BH_H

#include <bh/config.h>
#include <stddef.h>
#include "platform.h"


#define BH_INT_TO_PTR(x) \
    ((void *)((bh_intptr_t)(x)))

#define BH_UINT_TO_PTR(x) \
    ((void *)((bh_uintptr_t)(x)))

#define BH_PTR_TO_INT(x) \
    ((bh_intptr_t)(x))

#define BH_PTR_TO_UINT(x) \
    ((bh_uintptr_t)(x))

#define BH_OK           0x0000
#define BH_ERROR        0x0001
#define BH_OOM          0x0002
#define BH_INVALID      0x0003
#define BH_NO_IMPL      0x0004
#define BH_FOUND        0x0005
#define BH_NOT_FOUND    0x0006
#define BH_TIMEOUT      0x0007

typedef void (*bh_generic_cb_t)(void *data);
typedef int (*bh_equal_cb_t)(const void *, const void *);
typedef size_t (*bh_hash_cb_t)(const void *);

#endif /* BH_H */