serialize()
This commit is contained in:
@@ -33,3 +33,11 @@ bool Hashtable_try_get(Hashtable* ht, char* key, Unitype* output);
|
||||
//not implemented yet
|
||||
void Hashtable_set_pair(Hashtable* ht, KeyValuePair p);
|
||||
void Hashtable_set(Hashtable* ht, char* key, Unitype u);
|
||||
|
||||
#define Hashtable_foreach(HT, EL, codeblock)({\
|
||||
uint16 hmax=Hashtable_height(HT);\
|
||||
for(uint16 h=0; h<hmax; h++){\
|
||||
Autoarr(KeyValuePair)* AR=HT->rows+h;\
|
||||
Autoarr_foreach(AR, EL, codeblock);\
|
||||
}\
|
||||
})
|
||||
|
||||
@@ -18,3 +18,9 @@ void Autoarr_KeyValuePair_clear(Autoarr_KeyValuePair* ar){
|
||||
KeyValuePair_free(ar->values[ar->blocks_count-1][elemI]);
|
||||
Autoarr_clear(ar);
|
||||
}
|
||||
|
||||
void printkvp(KeyValuePair p){
|
||||
printf("{\"%s\", ",p.key);
|
||||
printuni(p.value);
|
||||
printf("}");
|
||||
}
|
||||
|
||||
@@ -13,3 +13,5 @@ void KeyValuePair_free(KeyValuePair p);
|
||||
|
||||
//func to clear KVP array
|
||||
void Autoarr_KeyValuePair_clear(Autoarr_KeyValuePair* ar);
|
||||
|
||||
void printkvp(KeyValuePair p);
|
||||
|
||||
Reference in New Issue
Block a user