7
This commit is contained in:
parent
84c3a10035
commit
7cd2facc5e
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "../HashFunctions/hash.h"
|
#include "../HashFunctions/hash.h"
|
||||||
#include "../Autoarr2/Autoarr2.hpp"
|
#include "../Autoarr2/Autoarr2.hpp"
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
// amount of rows
|
// amount of rows
|
||||||
typedef uint32 HT_HEIGHT_T;
|
typedef uint32 HT_HEIGHT_T;
|
||||||
@ -27,8 +28,9 @@ class Hashtable2{
|
|||||||
HT_HASH_T hash;
|
HT_HASH_T hash;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
using HashKeyFunc_t=HT_HASH_T (*)(TKey);
|
//using HashKeyFunc_t=HT_HASH_T (*)(TKey);
|
||||||
using KeyCmpFunc_t=bool (*)(TKey, TKey);
|
using HashKeyFunc_t=std::function<HT_HASH_T(TKey)>;
|
||||||
|
using KeyCmpFunc_t=std::function<bool(TKey, TKey)>;
|
||||||
|
|
||||||
// fields
|
// fields
|
||||||
Autoarr2<KeyValue>** rows;
|
Autoarr2<KeyValue>** rows;
|
||||||
|
|||||||
@ -26,6 +26,7 @@ typedef enum __attribute__((__packed__)) my_type {
|
|||||||
AutoarrInt32Ptr, AutoarrUInt32Ptr, AutoarrInt64Ptr, AutoarrUInt64Ptr,
|
AutoarrInt32Ptr, AutoarrUInt32Ptr, AutoarrInt64Ptr, AutoarrUInt64Ptr,
|
||||||
AutoarrUnitypePtr, AutoarrKVPairPtr
|
AutoarrUnitypePtr, AutoarrKVPairPtr
|
||||||
} my_type;
|
} my_type;
|
||||||
|
static const my_type my_type_last=AutoarrKVPairPtr;
|
||||||
|
|
||||||
const char* my_type_name(my_type t);
|
const char* my_type_name(my_type t);
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ void test_searchtree(){
|
|||||||
printuni(u);
|
printuni(u);
|
||||||
ST_push(node,"message_id", u);
|
ST_push(node,"message_id", u);
|
||||||
printf(" -> message_id\n ");
|
printf(" -> message_id\n ");
|
||||||
u=(Unitype){.type=Int8Ptr,.VoidPtr=malloc(1)};
|
u=(Unitype){.type=CharPtr,.VoidPtr=cptr_copy("some text UwU")};
|
||||||
printuni(u);
|
printuni(u);
|
||||||
ST_push(node,"text", u);
|
ST_push(node,"text", u);
|
||||||
printf(" -> text\n");
|
printf(" -> text\n");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user