@@ -4,24 +4,34 @@ Template for wrapping khash-tables for each primitive `dtype`
4
4
WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in
5
5
"""
6
6
7
+ {{py:
7
8
9
+ # name, c_type
10
+ primitive_types = [('int64', 'int64_t')]
11
+ }}
12
+
13
+ {{for name, c_type in primitive_types}}
8
14
9
15
cdef extern from "khash_python.h":
10
- ctypedef struct kh_int64_t :
16
+ ctypedef struct kh_{{name}}_t :
11
17
khint_t n_buckets, size, n_occupied, upper_bound
12
18
uint32_t *flags
13
- int64_t *keys
19
+ {{c_type}} *keys
14
20
size_t *vals
15
21
16
- kh_int64_t* kh_init_int64() nogil
17
- void kh_destroy_int64(kh_int64_t*) nogil
18
- void kh_clear_int64(kh_int64_t*) nogil
19
- khint_t kh_get_int64(kh_int64_t*, int64_t) nogil
20
- void kh_resize_int64(kh_int64_t*, khint_t) nogil
21
- khint_t kh_put_int64(kh_int64_t*, int64_t, int*) nogil
22
- void kh_del_int64(kh_int64_t*, khint_t) nogil
22
+ kh_{{name}}_t* kh_init_{{name}}() nogil
23
+ void kh_destroy_{{name}}(kh_{{name}}_t*) nogil
24
+ void kh_clear_{{name}}(kh_{{name}}_t*) nogil
25
+ khint_t kh_get_{{name}}(kh_{{name}}_t*, {{c_type}}) nogil
26
+ void kh_resize_{{name}}(kh_{{name}}_t*, khint_t) nogil
27
+ khint_t kh_put_{{name}}(kh_{{name}}_t*, {{c_type}}, int*) nogil
28
+ void kh_del_{{name}}(kh_{{name}}_t*, khint_t) nogil
29
+
30
+ bint kh_exist_{{name}}(kh_{{name}}_t*, khiter_t) nogil
23
31
24
- bint kh_exist_int64(kh_int64_t*, khiter_t) nogil
32
+ {{endfor}}
33
+
34
+ cdef extern from "khash_python.h":
25
35
26
36
ctypedef uint64_t khuint64_t
27
37
0 commit comments