compiles but doesnt work
This commit is contained in:
parent
b627affbde
commit
3323c40fa3
@ -13,7 +13,35 @@ Autoarr_define(int32)
|
|||||||
Autoarr_define(uint64)
|
Autoarr_define(uint64)
|
||||||
Autoarr_define(int64)
|
Autoarr_define(int64)
|
||||||
|
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrChar);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrBool);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrFloat32);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrFloat64);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrInt8);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrUInt8);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrInt16);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrUInt16);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrInt32);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrUInt32);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrInt64);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrUInt64);
|
||||||
|
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrCharPtr);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrBoolPtr);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrFloat32Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrFloat64Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrInt8Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrUInt8Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrInt16Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrUInt16Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrInt32Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrUInt32Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrInt64Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrUInt64Ptr);
|
||||||
|
|
||||||
Autoarr_define(Unitype)
|
Autoarr_define(Unitype)
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrUnitype);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrUnitypePtr);
|
||||||
|
|
||||||
// right func to clear array of unitype values
|
// right func to clear array of unitype values
|
||||||
void __Autoarr_free_Unitype_(Autoarr(Unitype)* ar, bool freePtr){
|
void __Autoarr_free_Unitype_(Autoarr(Unitype)* ar, bool freePtr){
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
#include "Hashtable.h"
|
#include "Hashtable.h"
|
||||||
|
|
||||||
|
kerepTypeId_define(kerepTypeId_Hashtable);
|
||||||
|
kerepTypeId_define(kerepTypeId_HashtablePtr);
|
||||||
|
|
||||||
// amount of rows
|
// amount of rows
|
||||||
static const uint16 HT_HEIGHTS[]={17,61,257,1021,4099,16381,65521};
|
static const uint16 HT_HEIGHTS[]={17,61,257,1021,4099,16381,65521};
|
||||||
#define HT_HEIN_MIN 0
|
#define HT_HEIN_MIN 0
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
#include "KeyValuePair.h"
|
#include "KeyValuePair.h"
|
||||||
|
|
||||||
Autoarr_define(KVPair)
|
kerepTypeId_define(kerepTypeId_KVPair);
|
||||||
|
kerepTypeId_define(kerepTypeId_KVPairPtr);
|
||||||
|
|
||||||
|
Autoarr_define(KVPair)
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrKVPair);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrKVPairPtr);
|
||||||
|
|
||||||
// proper way to clear a KVP
|
// proper way to clear a KVP
|
||||||
void KVPair_free(KVPair p){
|
void KVPair_free(KVPair p){
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
#include "SearchTree.h"
|
#include "SearchTree.h"
|
||||||
|
|
||||||
|
kerepTypeId_define(kerepTypeId_STNode);
|
||||||
|
kerepTypeId_define(kerepTypeId_STNodePtr);
|
||||||
|
|
||||||
STNode* STNode_create(){
|
STNode* STNode_create(){
|
||||||
STNode* node=malloc(sizeof(STNode));
|
STNode* node=malloc(sizeof(STNode));
|
||||||
node->branches=NULL;
|
node->branches=NULL;
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
#include "StringBuilder.h"
|
#include "StringBuilder.h"
|
||||||
|
|
||||||
Autoarr_define(string)
|
Autoarr_define(string)
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrString);
|
||||||
|
kerepTypeId_define(kerepTypeId_AutoarrStringPtr);
|
||||||
|
|
||||||
|
kerepTypeId_define(kerepTypeId_StringBuilder);
|
||||||
|
kerepTypeId_define(kerepTypeId_StringBuilderPtr);
|
||||||
|
|
||||||
#define BL_C 32
|
#define BL_C 32
|
||||||
#define BL_L 1024
|
#define BL_L 1024
|
||||||
|
|||||||
@ -8,6 +8,8 @@ extern "C" {
|
|||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
|
||||||
Autoarr_declare(string)
|
Autoarr_declare(string)
|
||||||
|
kerepTypeId_declare(kerepTypeId_AutoarrString);
|
||||||
|
kerepTypeId_declare(kerepTypeId_AutoarrStringPtr);
|
||||||
|
|
||||||
typedef struct StringBuilder{
|
typedef struct StringBuilder{
|
||||||
Autoarr(string)* compl_bufs;
|
Autoarr(string)* compl_bufs;
|
||||||
|
|||||||
@ -90,6 +90,8 @@ void kerepTypeDescriptors_initKerepTypes(){
|
|||||||
kerepType_register(Hashtable*, kerepTypeId_HashtablePtr, __Hashtable_free);
|
kerepType_register(Hashtable*, kerepTypeId_HashtablePtr, __Hashtable_free);
|
||||||
|
|
||||||
// StringBuilder
|
// StringBuilder
|
||||||
|
kerepType_register(Autoarr_string, kerepTypeId_AutoarrString, ____Autoarr_free_string);
|
||||||
|
kerepType_register(Autoarr_string*, kerepTypeId_AutoarrStringPtr, ____Autoarr_free_string);
|
||||||
kerepType_register(StringBuilder, kerepTypeId_StringBuilder, __StringBuilder_free);
|
kerepType_register(StringBuilder, kerepTypeId_StringBuilder, __StringBuilder_free);
|
||||||
kerepType_register(StringBuilder*, kerepTypeId_StringBuilderPtr, __StringBuilder_free);
|
kerepType_register(StringBuilder*, kerepTypeId_StringBuilderPtr, __StringBuilder_free);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,34 @@
|
|||||||
Autoarr_declare(kerepTypeDescriptor)
|
Autoarr_declare(kerepTypeDescriptor)
|
||||||
Autoarr_define(kerepTypeDescriptor)
|
Autoarr_define(kerepTypeDescriptor)
|
||||||
|
|
||||||
|
kerepTypeId_define(kerepTypeId_Null);
|
||||||
|
|
||||||
|
kerepTypeId_define(kerepTypeId_Char);
|
||||||
|
kerepTypeId_define(kerepTypeId_Bool);
|
||||||
|
kerepTypeId_define(kerepTypeId_Float32);
|
||||||
|
kerepTypeId_define(kerepTypeId_Float64);
|
||||||
|
kerepTypeId_define(kerepTypeId_Int8);
|
||||||
|
kerepTypeId_define(kerepTypeId_UInt8);
|
||||||
|
kerepTypeId_define(kerepTypeId_Int16);
|
||||||
|
kerepTypeId_define(kerepTypeId_UInt16);
|
||||||
|
kerepTypeId_define(kerepTypeId_Int32);
|
||||||
|
kerepTypeId_define(kerepTypeId_UInt32);
|
||||||
|
kerepTypeId_define(kerepTypeId_Int64);
|
||||||
|
kerepTypeId_define(kerepTypeId_UInt64);
|
||||||
|
|
||||||
|
kerepTypeId_define(kerepTypeId_CharPtr);
|
||||||
|
kerepTypeId_define(kerepTypeId_BoolPtr);
|
||||||
|
kerepTypeId_define(kerepTypeId_Float32Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_Float64Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_Int8Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_UInt8Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_Int16Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_UInt16Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_Int32Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_UInt32Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_Int64Ptr);
|
||||||
|
kerepTypeId_define(kerepTypeId_UInt64Ptr);
|
||||||
|
|
||||||
// type descriptors are stored here during initialization
|
// type descriptors are stored here during initialization
|
||||||
Autoarr(kerepTypeDescriptor)* __kerepTypeDescriptors=NULL;
|
Autoarr(kerepTypeDescriptor)* __kerepTypeDescriptors=NULL;
|
||||||
// here type descriptors are stored when initialization is complited
|
// here type descriptors are stored when initialization is complited
|
||||||
@ -31,7 +59,7 @@ void __kerepType_register(char* name, int16 size, void (*free_members)(void*)){
|
|||||||
.size=size,
|
.size=size,
|
||||||
.free_members=free_members,
|
.free_members=free_members,
|
||||||
.id=++kerepTypeId_last
|
.id=++kerepTypeId_last
|
||||||
};
|
}; dbg(kerepTypeId_last);
|
||||||
Autoarr_add(__kerepTypeDescriptors, typeDesc);
|
Autoarr_add(__kerepTypeDescriptors, typeDesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
#include "base.h"
|
#include "base.h"
|
||||||
|
|
||||||
|
kerepTypeId_define(kerepTypeId_Unitype);
|
||||||
|
kerepTypeId_define(kerepTypeId_UnitypePtr);
|
||||||
|
|
||||||
void Unitype_free(Unitype u){
|
void Unitype_free(Unitype u){
|
||||||
kerepTypeDescriptor type=kerepTypeDescriptor_get(u.typeId);
|
kerepTypeDescriptor type=kerepTypeDescriptor_get(u.typeId);
|
||||||
if(type.free_members)
|
if(type.free_members)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user