added userdata to hastable to be able to do stuff in the iterator function callback

This commit is contained in:
herbglitch 2025-03-06 03:11:16 -07:00
parent d79f9bb2ec
commit 7316f7c779
5 changed files with 80 additions and 25 deletions

View file

@ -39,16 +39,6 @@ extern "C" {
<whitespace> -> SPACE <whitespace> | TAB <whitespace> | NEWLINE <whitespace> | LAMBDA
*/
/**
* @brief TODO: write this
*/
typedef void (* ARC_ChemicalData_CopyToTypeFn)(void **data, ARC_ParserTagToken *parsedData);
/**
* @brief TODO: write this
*/
typedef void (* ARC_ParserCSV_DestroyTypeFn)(void *data);
/**
* @brief a function to read a key from string to a ARC_ConfigTypeTemplate
*
@ -79,6 +69,24 @@ typedef void (* ARC_ParserCSV_DestroyTypeFn)(void *data);
*/
typedef struct ARC_Chemical ARC_Chemical;
/**
* @brief
*/
typedef void (* ARC_ChemicalType_CopyFn)(void **type, ARC_ParserTagToken *parsedData, ARC_Chemical *chemical);
/**
* @brief
*/
typedef void (* ARC_ChemicalType_DestroyFn)(void *type);
/**
* @brief
*/
typedef struct ARC_ChemicalType {
ARC_ChemicalType_CopyFn copyFn;
ARC_ChemicalType_DestroyFn destroyFn;
} ARC_ChemicalType;
/**
* @brief TODO: write this
*/
@ -92,7 +100,12 @@ void ARC_Chemical_Destroy(ARC_Chemical *chemical);
/**
* @brief TODO: write this
*/
void ARC_Chemical_RegisterType(ARC_Chemical *chemical, ARC_String *typeName, ARC_ChemicalData_CopyToTypeFn *copyToTypeFn, ARC_ParserCSV_DestroyTypeFn destroyTypeFn);
void ARC_Chemical_RegisterType(ARC_Chemical *chemical, ARC_String *typeName, ARC_ChemicalType type);
/**
* @brief TODO: write this
*/
void ARC_Chemical_RegisterTypeWithCStr(ARC_Chemical *chemical, const char *typeNameCStr, ARC_ChemicalType type);
/**
* @brief sets current group in config