forked from snowflakedb/pdo_snowflake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snowflake_treemap.h
60 lines (47 loc) · 1.12 KB
/
snowflake_treemap.h
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
/*
* Copyright (c) 2017-2019 Snowflake Computing, Inc. All rights reserved.
*/
#ifndef SNOWFLAKE_TREEMAP_H
#define SNOWFLAKE_TREEMAP_H
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(_WIN32)
#define STDCALL
#else
#define STDCALL __stdcall
#endif
#include "snowflake_rbtree.h"
#define TREE_MAP_MAX_SIZE 1000
#define HASH_CONSTANT 31
typedef struct pdo_sf_treemap_node
{
RedBlackTree *tree;
} TREE_MAP;
/*
** Treemap needs to be initialized
** to a size which is sufficiently
** large and is a prime number
** @return pointer to TREE_MAP
*/
TREE_MAP * STDCALL pdo_sf_treemap_init(void);
/* pdo_sf_treemap_set
** insert param into treemap
** @return- SF_INT_RET_CODE
*/
int STDCALL pdo_sf_treemap_set(TREE_MAP *tree_map, void *param, char *key);
/*
** pdo_sf_treemap_get
** get params corresponding to a key from the treemap
** @return void struct
*/
void * STDCALL pdo_sf_treemap_get(TREE_MAP *tree_map, char *key);
/* pdo_sf_treemap_deallocate
** deallocate treemap and any chained lists.
** @return void
*/
void STDCALL pdo_sf_treemap_deallocate(TREE_MAP *tree_map);
#ifdef __cplusplus
}
#endif
#endif /* SNOWFLAKE_TREEMAP_H */