| 1 |
from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, intptr_t |
| 2 |
from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t |
| 3 |
cdef extern from *: |
| 4 |
ctypedef bint bool |
| 5 |
ctypedef struct va_list |
| 6 |
|
| 7 |
cdef extern from *: |
| 8 |
|
| 9 |
ctypedef const char *Str; |
| 10 |
|
| 11 |
ctypedef struct HashTable_Str__c_char__false: |
| 12 |
uintptr_t num_buckets; |
| 13 |
uintptr_t capacity; |
| 14 |
uint8_t *occupied; |
| 15 |
Str *keys; |
| 16 |
char *vals; |
| 17 |
|
| 18 |
ctypedef HashTable_Str__c_char__false MySet; |
| 19 |
|
| 20 |
ctypedef void (*SetCallback)(Str key); |
| 21 |
|
| 22 |
ctypedef struct HashTable_Str__u64__true: |
| 23 |
uintptr_t num_buckets; |
| 24 |
uintptr_t capacity; |
| 25 |
uint8_t *occupied; |
| 26 |
Str *keys; |
| 27 |
uint64_t *vals; |
| 28 |
|
| 29 |
ctypedef void (*MapCallback)(Str key, uint64_t val); |
| 30 |
|
| 31 |
MySet *new_set(); |
| 32 |
|
| 33 |
void set_for_each(const MySet *set, SetCallback callback); |
| 34 |
|
| 35 |
HashTable_Str__u64__true *new_map(); |
| 36 |
|
| 37 |
void map_for_each(const HashTable_Str__u64__true *map, MapCallback callback); |