1 /*
2 ** Copyright (C) 2006-2020 by Carnegie Mellon University.
3 **
4 ** @OPENSOURCE_LICENSE_START@
5 ** See license information in ../../LICENSE.txt
6 ** @OPENSOURCE_LICENSE_END@
7 */
8 #ifndef _INTDICT_H
9 #define _INTDICT_H
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #include <silk/silk.h>
15 
16 RCSIDENTVAR(rcsID_INTDICT_H, "$SiLK: intdict.h ef14e54179be 2020-04-14 21:57:45Z mthomas $");
17 
18 /*
19 **  intdict.h
20 **
21 **  Integer dictionaries
22 **
23 */
24 
25 
26 typedef int32_t intkey_t;
27 
28 struct int_dict_st;
29 typedef struct int_dict_st int_dict_t;
30 
31 struct int_dict_iter_st;
32 typedef struct int_dict_iter_st int_dict_iter_t;
33 
34 int_dict_t *
35 int_dict_create(
36     size_t              value_size);
37 
38 void
39 int_dict_destroy(
40     int_dict_t         *dict);
41 
42 void *
43 int_dict_get(
44     int_dict_t         *dict,
45     intkey_t            key,
46     void               *value);
47 
48 void *
49 int_dict_get_first(
50     int_dict_t         *dict,
51     intkey_t           *key,
52     void               *value);
53 
54 void *
55 int_dict_get_last(
56     int_dict_t         *dict,
57     intkey_t           *key,
58     void               *value);
59 
60 void *
61 int_dict_get_next(
62     int_dict_t         *dict,
63     intkey_t           *key,
64     void               *value);
65 
66 void *
67 int_dict_get_prev(
68     int_dict_t         *dict,
69     intkey_t           *key,
70     void               *value);
71 
72 int
73 int_dict_set(
74     int_dict_t         *dict,
75     intkey_t            key,
76     void               *value);
77 
78 int
79 int_dict_del(
80     int_dict_t         *dict,
81     intkey_t            key);
82 
83 unsigned int
84 int_dict_get_count(
85     int_dict_t         *dict);
86 
87 int_dict_iter_t *
88 int_dict_open(
89     int_dict_t         *dict);
90 
91 void *
92 int_dict_next(
93     int_dict_iter_t    *iter,
94     intkey_t           *key,
95     void               *value);
96 
97 void
98 int_dict_close(
99     int_dict_iter_t    *iter);
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 #endif /* _INTDICT_H */
105 
106 /*
107 ** Local Variables:
108 ** mode:c
109 ** indent-tabs-mode:nil
110 ** c-basic-offset:4
111 ** End:
112 */
113