From 2e97d908d8093589d66e84820dff10af1433deac Mon Sep 17 00:00:00 2001 From: herbglitch Date: Wed, 26 Mar 2025 04:27:02 -0600 Subject: [PATCH] spritesheet being read in, needs testing and possible memory leak fix --- include/arc/graphics/sprite.h | 2 +- include/arc/std/config.h | 1 + packages/graphics/sdl3/config.c | 274 +++++++++------------------ packages/graphics/sdl3/sprite.c | 2 +- packages/graphics/sdl3/spritesheet.c | 1 + src/math/config.c | 8 +- src/std/config.c | 34 ++-- 7 files changed, 120 insertions(+), 202 deletions(-) diff --git a/include/arc/graphics/sprite.h b/include/arc/graphics/sprite.h index 092fe81..f09e8b7 100644 --- a/include/arc/graphics/sprite.h +++ b/include/arc/graphics/sprite.h @@ -99,7 +99,7 @@ void ARC_Sprite_SetFrameIndex(ARC_Sprite *sprite, uint32_t index); * @brief sets the origin point of the sprite (the rotation and position point) * * @param sprite ARC_Sprite that is having its angle set - * @param index the given agnel in degrees to rotate around (rotated clockwise) + * @param angle the given agnel in degrees to rotate around (rotated clockwise) */ void ARC_Sprite_SetAngle(ARC_Sprite *sprite, double angle); diff --git a/include/arc/std/config.h b/include/arc/std/config.h index 0b74436..4b3eb64 100644 --- a/include/arc/std/config.h +++ b/include/arc/std/config.h @@ -28,6 +28,7 @@ typedef void (* ARC_ConfigType_DestroyFn)(ARC_Config *config, void *type); * @brief the functions for used for loading and unloading a type, the name will be the key of a hashtable */ typedef struct ARC_ConfigType { + uint32_t size; ARC_ConfigType_CopyFn copyFn; ARC_ConfigType_DestroyFn destroyFn; void *userdata; diff --git a/packages/graphics/sdl3/config.c b/packages/graphics/sdl3/config.c index a251427..7d6a911 100644 --- a/packages/graphics/sdl3/config.c +++ b/packages/graphics/sdl3/config.c @@ -1,22 +1,22 @@ #include "arc/graphics/config.h" -#include -#include -#include "renderer.h" -#include "arc/graphics/sprite.h" -#include "arc/graphics/spritesheet.h" -#include "arc/std/string.h" -#include "arc/std/parser/helpers.h" -#include "arc/std/errno.h" +#include "spritesheet.h" #include "arc/graphics/sprite.h" #include "arc/graphics/spritesheet.h" #include "arc/math/config.h" #include "arc/math/point.h" #include "arc/math/rectangle.h" +#include "arc/std/errno.h" +#include "arc/std/string.h" +#include "arc/std/parser/helpers.h" +#include "arc/std/vector/inline.h" +#include +#include +#include void ARC_Config_InitGraphics(ARC_Config *config, ARC_Renderer *renderer){ - ARC_Config_RegisterTypeWithCStr(config, "ARC_Spritesheet", (ARC_ConfigType){ ARC_ConfigType_SpritesheetCopyFn, ARC_ConfigType_SpritesheetDestroyFn, renderer}); - ARC_Config_RegisterTypeWithCStr(config, "ARC_Sprite" , (ARC_ConfigType){ ARC_ConfigType_SpriteCopyFn , ARC_ConfigType_SpriteDestroyFn , renderer}); + ARC_Config_RegisterTypeWithCStr(config, "ARC_Spritesheet", (ARC_ConfigType){ sizeof(ARC_Spritesheet), ARC_ConfigType_SpritesheetCopyFn, ARC_ConfigType_SpritesheetDestroyFn, renderer}); + ARC_Config_RegisterTypeWithCStr(config, "ARC_Sprite" , (ARC_ConfigType){ sizeof(ARC_Sprite) , ARC_ConfigType_SpriteCopyFn , ARC_ConfigType_SpriteDestroyFn , renderer}); } void ARC_ConfigType_SpritesheetString(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata){ @@ -71,6 +71,9 @@ void ARC_ConfigType_SpriteCopyFn(void **type, ARC_ParserTagToken *parsedData, AR // -> OPEN_CURLY_BRACE CLOSE_CURLY_BRACE ARC_ParserTagToken *valueArgsTagToken = (ARC_ParserTagToken *)ARC_Vector_Get(childTagToken->tagTokens, 2); + if(ARC_Vector_GetSize(valueArgsTagToken->tagTokens) == 1){ + //TODO: error here + } ARC_Sprite *sprite; ARC_Sprite_Create(&sprite, NULL, (ARC_Array){ 0, NULL }); @@ -79,14 +82,11 @@ void ARC_ConfigType_SpriteCopyFn(void **type, ARC_ParserTagToken *parsedData, AR char pointerCString[64]; sprintf(pointerCString, "%p", sprite); - // -> COMMA | - if(ARC_Vector_GetSize(valueArgsTagToken->tagTokens) == 1){ - //TODO: error here - } - ARC_ParserTagToken *valueTagToken = (ARC_ParserTagToken *)ARC_Vector_Get(valueArgsTagToken->tagTokens, 0); - /* ~ spritesheet ~ */ + // -> COMMA | + ARC_ParserTagToken *valueTagToken = (ARC_ParserTagToken *)ARC_Vector_Get(valueArgsTagToken->tagTokens, 0); + //check if spritesheet exist ARC_String *valueString; ARC_String_Create(&valueString, NULL, 0); @@ -110,23 +110,86 @@ void ARC_ConfigType_SpriteCopyFn(void **type, ARC_ParserTagToken *parsedData, AR ARC_String_Destroy(spritesheetName); } + //set the spritesheet to the sprite + sprite->spritesheet = spritesheet; + //cleanup ARC_String_Destroy(valueString); valueString = NULL; /* ~ bounds aka frames ~ */ + // -> COMMA | + valueArgsTagToken = (ARC_ParserTagToken *)ARC_Vector_Get(valueArgsTagToken->tagTokens, 4); + if(ARC_Vector_GetSize(valueArgsTagToken->tagTokens) == 1){ + //TODO: error here + } + + // -> COMMA | + valueTagToken = (ARC_ParserTagToken *)ARC_Vector_Get(valueArgsTagToken->tagTokens, 0); + //check if bounds exist ARC_String_Create(&valueString, NULL, 0); ARC_ParserData_HelperRecurseStringAdd(&valueString, valueTagToken); - void *bounds = ARC_Config_Get(config, valueString); + ARC_Array *bounds = (ARC_Array *)ARC_Config_Get(config, valueString); if(bounds == NULL){ - //ARC_Config_AddWithCStr(config, "ARC_FRect[]", const char *name, void *value) + //create a temporary vector to read in the array + ARC_VectorInline *typeVector; + ARC_VectorInline_Create(&typeVector, sizeof(ARC_FRect), NULL, NULL); + + // -> | | | | + valueArgsTagToken = (ARC_ParserTagToken *)ARC_Vector_Get(valueTagToken->tagTokens, 0); + + // -> COMMA | + while(valueArgsTagToken->id == ARC_CONFIG_VALUE_ARGS){ + valueTagToken = ARC_Vector_Get(valueArgsTagToken->tagTokens, 0); + + //copy the type and store it in the vector + void *typeData = NULL; + ARC_ConfigType_FRectCopyFn(&typeData, valueTagToken, config, userdata); + ARC_VectorInline_Add(typeVector, typeData); + + //if this value args was the last one break + if(ARC_Vector_GetSize(valueArgsTagToken->tagTokens) == 1){ + break; + } + + //get the next valueArgs + valueArgsTagToken = ARC_Vector_Get(valueArgsTagToken->tagTokens, 4); + } + + //copy the data in an ARC_Array + ARC_Array typeVectorArray = ARC_VectorInline_GetData(typeVector); + bounds = (ARC_Array *)malloc(sizeof(ARC_Array)); + bounds->size = typeVectorArray.size; + bounds->data = NULL; + + if(typeVectorArray.size != 0){ + //copy the vector into the array's data + bounds->data = (void *)malloc(sizeof(ARC_FRect) * typeVectorArray.size); + memcpy(bounds->data, typeVectorArray.data, typeVectorArray.size); + } + + //create a name based on the type and the sprite pointer to have a unique name for cleanup on remove + ARC_String *boundsName; + ARC_String_CreateWithStrlen(&boundsName, pointerCString); + ARC_String_AppendCStringWithStrlen(&boundsName, "ARC_FRect"); + + //add the new ARC_FRect as ARC_Array type to the config + ARC_Config_AddWithCStr(config, "ARC_FRect", boundsName->data, (void *)bounds); + + //cleanup + ARC_String_Destroy(boundsName); } + //set the bounds to the frames + sprite->frames = *bounds; + + //cleanup ARC_String_Destroy(valueString); + //set the type *type = sprite; } @@ -137,177 +200,26 @@ void ARC_ConfigType_SpriteDestroyFn(ARC_Config *config, void *type){ char pointerCString[64]; sprintf(pointerCString, "%p", sprite); + /* ~ spritesheet ~ */ //create a name based on the type and the sprite pointer to have a unique name for cleanup on remove ARC_String *spritesheetName; ARC_String_CreateWithStrlen(&spritesheetName, pointerCString); ARC_String_AppendCStringWithStrlen(&spritesheetName, "ARC_Spritesheet"); //remove the spritesheet from the config (it won't error if it doesn't exist) - //ARC_Config_RemoveWithCStr(config, spritesheetName->data, ARC_False); + ARC_Config_RemoveWithCStr(config, spritesheetName->data, ARC_False); + + /* ~ ARC_FRect Array ~ */ + //create a name based on the type and the sprite pointer to have a unique name for cleanup on remove + ARC_String *boundsName; + ARC_String_CreateWithStrlen(&boundsName, pointerCString); + ARC_String_AppendCStringWithStrlen(&boundsName, "ARC_FRect"); + + //remove the ARC_FRect from the config (it won't error if it doesn't exist) + ARC_Config_RemoveWithCStr(config, boundsName->data, ARC_False); //cleanup + ARC_String_Destroy(boundsName); ARC_String_Destroy(spritesheetName); } - - - -//uint8_t ARC_Sprite_Read(ARC_Config* config, ARC_String *string, void **value){ -// ARC_Config_Get(config, string, value); -// if(*value){ -// return 1; -// } -// -// if(string->data[0] != '{' || string->data[string->length - 1] != '}'){ -// ARC_Spritesheet_ReadTexture(config, string, NULL, value); -// return 0; -// } -// -// uint64_t split = ARC_GraphicsConfig_GetIndexAndErrorCheck(string, ",", 1); -// if(arc_errno){ -// return 0; -// } -// -// ARC_String *temp, *spritesheetStr, *framesStr; -// ARC_String_CopySubstring(&temp, string, 1, split - 2); -// ARC_String_StripEndsWhitespace(&spritesheetStr, temp); -// ARC_String_Destroy(temp); -// -// ARC_String_CopySubstring(&temp, string, split + 1, string->length - (split + 2)); -// ARC_String_StripEndsWhitespace(&framesStr, temp); -// ARC_String_Destroy(temp); -// -// //spritesheet -// ARC_Spritesheet *spritesheet; -// ARC_Config_Get(config, spritesheetStr, (void **)&spritesheet); -// -// if(!spritesheet){ -// ARC_Spritesheet_Read(config, spritesheetStr, (void **)&spritesheet); -// if(arc_errno){ -// ARC_String_Destroy(spritesheetStr); -// ARC_String_Destroy(framesStr ); -// return 0; -// } -// } -// -// //bounds -// ARC_Array *frames; -// ARC_Config_Get(config, framesStr, (void **)&frames); -// -// if(!frames){ -// ARC_RectArray_Read(config, framesStr, (void **)&frames); -// if(arc_errno){ -// ARC_String_Destroy(spritesheetStr); -// ARC_String_Destroy(framesStr ); -// return 0; -// } -// } -// -// ARC_String_Destroy(spritesheetStr); -// ARC_String_Destroy(framesStr ); -// -// // Scale frames to match spritesheet size -// // TODO: possible bug for sheets that use same frames -// if(spritesheet->size){ -// for(uint32_t i = 0; i < frames->size; i++){ -// ((ARC_Rect *)frames->data)[i].x *= *spritesheet->size; -// ((ARC_Rect *)frames->data)[i].y *= *spritesheet->size; -// ((ARC_Rect *)frames->data)[i].w *= *spritesheet->size; -// ((ARC_Rect *)frames->data)[i].h *= *spritesheet->size; -// } -// } -// //sprite -// ARC_Sprite_Create((ARC_Sprite **)value, spritesheet, frames); -// -// return 0; -//} -// -//void ARC_SDL_Texture_Delete(ARC_Config* config, ARC_String *string, void *value){ -// SDL_DestroyTexture((SDL_Texture *) value); -//} -// -//void ARC_Spritesheet_Delete(ARC_Config* config, ARC_String *string, void *value){ -// ARC_Spritesheet *sheetValue = (ARC_Spritesheet *)value; -// -// //check if read in as a Textrue reference -// void *temp; -// ARC_Config_Get(config, string, &temp); -// if(temp){ -// //TODO: test to see if this breaks references -// free(sheetValue); -// return; -// } -// -// uint64_t split = ARC_GraphicsConfig_GetIndexAndErrorCheck(string, ",", 1); -// if(arc_errno){ -// //TODO: test to make sure no edge cases -// // free(sheetValue); -// ARC_SDL_Texture_Delete(config, string, value); -// arc_errno = 0; -// return; -// } -// -// if(split == ~0){ -// -// } -// -// //check if texture and size are references -// ARC_String *tempStr, *textureStr, *sizeStr; -// ARC_String_CopySubstring(&tempStr, string, 1, split - 1); -// ARC_String_StripEndsWhitespace(&textureStr, tempStr); -// ARC_String_Destroy(tempStr); -// -// ARC_String_CopySubstring(&tempStr, string, split + 1, string->length - (split + 1)); -// ARC_String_StripEndsWhitespace(&sizeStr, tempStr); -// ARC_String_Destroy(tempStr); -// -// ARC_Config_Get(config, sizeStr, (void **)&temp); -// ARC_String_Destroy(sizeStr); -// if(temp){ -// free(sheetValue->size); -// } -// -// ARC_Config_Get(config, textureStr, (void **)&temp); -// ARC_String_Destroy(textureStr); -// if(temp){ -// free(sheetValue->size); -// } -// -// free(sheetValue); -//} -// -//void ARC_Sprite_Delete(ARC_Config* config, ARC_String *string, void *value){ -// ARC_Sprite *spriteValue = (ARC_Sprite *)value; -// -// //check if read in as a Textrue reference -// void *temp; -// uint64_t split = ARC_GraphicsConfig_GetIndexAndErrorCheck(string, ",", 1); -// if(arc_errno){ -// free(spriteValue); -// return; -// } -// -// //check if texture and size are references -// ARC_String *tempStr, *spritesheetStr, *framesStr; -// ARC_String_CopySubstring(&tempStr, string, 1, split - 1); -// ARC_String_StripEndsWhitespace(&spritesheetStr, tempStr); -// ARC_String_Destroy(tempStr); -// -// ARC_String_CopySubstring(&tempStr, string, split + 1, string->length - (split + 1)); -// ARC_String_StripEndsWhitespace(&framesStr, tempStr); -// ARC_String_Destroy(tempStr); -// -// ARC_Config_Get(config, spritesheetStr, (void **)&temp); -// ARC_String_Destroy(spritesheetStr); -// if(temp){ -// free(spriteValue->spritesheet); -// } -// -// ARC_Config_Get(config, framesStr, (void **)&temp); -// ARC_String_Destroy(framesStr); -// if(temp){ -// free(spriteValue->frames); -// } -// -// free(spriteValue); -//} diff --git a/packages/graphics/sdl3/sprite.c b/packages/graphics/sdl3/sprite.c index f7b6fd9..4c85687 100644 --- a/packages/graphics/sdl3/sprite.c +++ b/packages/graphics/sdl3/sprite.c @@ -42,7 +42,7 @@ void ARC_Sprite_Render(ARC_Sprite *sprite, ARC_Renderer *renderer, ARC_FRect ren } void ARC_Sprite_RenderAt(ARC_Sprite *sprite, ARC_Renderer *renderer, ARC_FPoint point, double scale){ - ARC_FRect sourceRect = *(ARC_FRect *)(sprite->frames.data + sprite->frameIndex); + ARC_FRect sourceRect = ((ARC_FRect *)(sprite->frames.data))[sprite->frameIndex]; //TODO: check that this works ARC_FRect destinationRect = { (point.x - sprite->origin.x) * scale, diff --git a/packages/graphics/sdl3/spritesheet.c b/packages/graphics/sdl3/spritesheet.c index 041dd6c..6bca7ac 100644 --- a/packages/graphics/sdl3/spritesheet.c +++ b/packages/graphics/sdl3/spritesheet.c @@ -30,6 +30,7 @@ void ARC_Spritesheet_CreateFromFile(ARC_Spritesheet **spritesheet, ARC_Renderer SDL_GetSurfaceBlendMode(surface, &tempMode); (*spritesheet)->texture = SDL_CreateTextureFromSurface((SDL_Renderer *)renderer, surface); SDL_SetTextureBlendMode((*spritesheet)->texture, tempMode); + SDL_SetTextureScaleMode((*spritesheet)->texture, SDL_SCALEMODE_NEAREST); //set the tile size to empty (*spritesheet)->size = 0; diff --git a/src/math/config.c b/src/math/config.c index b259062..cec1f8f 100644 --- a/src/math/config.c +++ b/src/math/config.c @@ -7,10 +7,10 @@ #include "arc/math/rectangle.h" void ARC_Config_InitMath(ARC_Config *config){ - ARC_Config_RegisterTypeWithCStr(config, "ARC_Point" , (ARC_ConfigType){ ARC_ConfigType_PointCopyFn , ARC_ConfigType_PointDestroyFn , NULL }); - ARC_Config_RegisterTypeWithCStr(config, "ARC_FPoint", (ARC_ConfigType){ ARC_ConfigType_FPointCopyFn, ARC_ConfigType_FPointDestroyFn, NULL }); - ARC_Config_RegisterTypeWithCStr(config, "ARC_Rect" , (ARC_ConfigType){ ARC_ConfigType_RectCopyFn , ARC_ConfigType_RectDestroyFn , NULL }); - ARC_Config_RegisterTypeWithCStr(config, "ARC_FRect" , (ARC_ConfigType){ ARC_ConfigType_FRectCopyFn , ARC_ConfigType_FRectDestroyFn , NULL }); + ARC_Config_RegisterTypeWithCStr(config, "ARC_Point" , (ARC_ConfigType){ sizeof(ARC_Point) , ARC_ConfigType_PointCopyFn , ARC_ConfigType_PointDestroyFn , NULL }); + ARC_Config_RegisterTypeWithCStr(config, "ARC_FPoint", (ARC_ConfigType){ sizeof(ARC_FPoint), ARC_ConfigType_FPointCopyFn, ARC_ConfigType_FPointDestroyFn, NULL }); + ARC_Config_RegisterTypeWithCStr(config, "ARC_Rect" , (ARC_ConfigType){ sizeof(ARC_Rect) , ARC_ConfigType_RectCopyFn , ARC_ConfigType_RectDestroyFn , NULL }); + ARC_Config_RegisterTypeWithCStr(config, "ARC_FRect" , (ARC_ConfigType){ sizeof(ARC_FRect) , ARC_ConfigType_FRectCopyFn , ARC_ConfigType_FRectDestroyFn , NULL }); } void ARC_ConfigType_PointCopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata){ diff --git a/src/std/config.c b/src/std/config.c index 5bba5a4..cbe3eb8 100644 --- a/src/std/config.c +++ b/src/std/config.c @@ -364,6 +364,8 @@ void ARC_ConfigData_RunVariableLineTag(ARC_ParserTagToken *tagToken, ARC_Config } removingType->destroyFn = ARC_ConfigType_EmptyDestroyFn; + free(array->data); + free(array); ARC_Hashtable_Remove(config->currentGroup, (void *)variableString->data); return; } @@ -428,7 +430,7 @@ void ARC_ConfigData_RunVariableLineTag(ARC_ParserTagToken *tagToken, ARC_Config //create a temporary vector to read in the array ARC_VectorInline *typeVector; - ARC_VectorInline_Create(&typeVector, sizeof(void *), NULL, NULL); + ARC_VectorInline_Create(&typeVector, type->size, NULL, NULL); // -> COMMA | while(valueArgsTagToken->id == ARC_CONFIG_VALUE_ARGS){ @@ -456,8 +458,8 @@ void ARC_ConfigData_RunVariableLineTag(ARC_ParserTagToken *tagToken, ARC_Config if(typeVectorArray.size != 0){ //copy the vector into the array's data - array->data = (void **)malloc(sizeof(void *) * typeVectorArray.size); - memcpy(array->data, typeVectorArray.data, typeVectorArray.size); + array->data = (void *)malloc(type->size * typeVectorArray.size); + memcpy(array->data, typeVectorArray.data, type->size * typeVectorArray.size); } //set the type data as an array @@ -885,6 +887,8 @@ void ARC_Config_Remove(ARC_Config *config, ARC_String *name, ARC_Bool isArray){ } typeData->destroyFn = ARC_ConfigType_EmptyDestroyFn; + + free(array); } //remove the value @@ -1042,18 +1046,18 @@ void ARC_Config_UnloadFromFile(ARC_Config *config, ARC_String *path){ } void ARC_Config_InitStd(ARC_Config *config){ - ARC_Config_RegisterTypeWithCStr(config, "bool" , (ARC_ConfigType){ ARC_ConfigType_BoolCopyFn , ARC_ConfigType_BoolDestroyFn , NULL }); - ARC_Config_RegisterTypeWithCStr(config, "int8" , (ARC_ConfigType){ ARC_ConfigType_Int8CopyFn , ARC_ConfigType_Int8DestroyFn , NULL }); - ARC_Config_RegisterTypeWithCStr(config, "uint8" , (ARC_ConfigType){ ARC_ConfigType_Uint8CopyFn , ARC_ConfigType_Uint8DestroyFn , NULL }); - ARC_Config_RegisterTypeWithCStr(config, "int16" , (ARC_ConfigType){ ARC_ConfigType_Int16CopyFn , ARC_ConfigType_Int16DestroyFn , NULL }); - ARC_Config_RegisterTypeWithCStr(config, "uint16" , (ARC_ConfigType){ ARC_ConfigType_Uint16CopyFn, ARC_ConfigType_Uint16DestroyFn, NULL }); - ARC_Config_RegisterTypeWithCStr(config, "int32" , (ARC_ConfigType){ ARC_ConfigType_Int32CopyFn , ARC_ConfigType_Int32DestroyFn , NULL }); - ARC_Config_RegisterTypeWithCStr(config, "uint32" , (ARC_ConfigType){ ARC_ConfigType_Uint32CopyFn, ARC_ConfigType_Uint32DestroyFn, NULL }); - ARC_Config_RegisterTypeWithCStr(config, "int64" , (ARC_ConfigType){ ARC_ConfigType_Int64CopyFn , ARC_ConfigType_Int64DestroyFn , NULL }); - ARC_Config_RegisterTypeWithCStr(config, "uint64" , (ARC_ConfigType){ ARC_ConfigType_Uint64CopyFn, ARC_ConfigType_Uint64DestroyFn, NULL }); - ARC_Config_RegisterTypeWithCStr(config, "float" , (ARC_ConfigType){ ARC_ConfigType_FloatCopyFn , ARC_ConfigType_FloatDestroyFn , NULL }); - ARC_Config_RegisterTypeWithCStr(config, "double" , (ARC_ConfigType){ ARC_ConfigType_DoubleCopyFn, ARC_ConfigType_DoubleDestroyFn, NULL }); - ARC_Config_RegisterTypeWithCStr(config, "ARC_String", (ARC_ConfigType){ ARC_ConfigType_StringCopyFn, ARC_ConfigType_StringDestroyFn, NULL }); + ARC_Config_RegisterTypeWithCStr(config, "bool" , (ARC_ConfigType){ sizeof(ARC_Bool) , ARC_ConfigType_BoolCopyFn , ARC_ConfigType_BoolDestroyFn , NULL }); + ARC_Config_RegisterTypeWithCStr(config, "int8" , (ARC_ConfigType){ sizeof(int8_t) , ARC_ConfigType_Int8CopyFn , ARC_ConfigType_Int8DestroyFn , NULL }); + ARC_Config_RegisterTypeWithCStr(config, "uint8" , (ARC_ConfigType){ sizeof(uint8_t) , ARC_ConfigType_Uint8CopyFn , ARC_ConfigType_Uint8DestroyFn , NULL }); + ARC_Config_RegisterTypeWithCStr(config, "int16" , (ARC_ConfigType){ sizeof(int16_t) , ARC_ConfigType_Int16CopyFn , ARC_ConfigType_Int16DestroyFn , NULL }); + ARC_Config_RegisterTypeWithCStr(config, "uint16" , (ARC_ConfigType){ sizeof(uint16_t) , ARC_ConfigType_Uint16CopyFn, ARC_ConfigType_Uint16DestroyFn, NULL }); + ARC_Config_RegisterTypeWithCStr(config, "int32" , (ARC_ConfigType){ sizeof(int32_t) , ARC_ConfigType_Int32CopyFn , ARC_ConfigType_Int32DestroyFn , NULL }); + ARC_Config_RegisterTypeWithCStr(config, "uint32" , (ARC_ConfigType){ sizeof(uint32_t) , ARC_ConfigType_Uint32CopyFn, ARC_ConfigType_Uint32DestroyFn, NULL }); + ARC_Config_RegisterTypeWithCStr(config, "int64" , (ARC_ConfigType){ sizeof(int64_t) , ARC_ConfigType_Int64CopyFn , ARC_ConfigType_Int64DestroyFn , NULL }); + ARC_Config_RegisterTypeWithCStr(config, "uint64" , (ARC_ConfigType){ sizeof(uint64_t) , ARC_ConfigType_Uint64CopyFn, ARC_ConfigType_Uint64DestroyFn, NULL }); + ARC_Config_RegisterTypeWithCStr(config, "float" , (ARC_ConfigType){ sizeof(float) , ARC_ConfigType_FloatCopyFn , ARC_ConfigType_FloatDestroyFn , NULL }); + ARC_Config_RegisterTypeWithCStr(config, "double" , (ARC_ConfigType){ sizeof(double) , ARC_ConfigType_DoubleCopyFn, ARC_ConfigType_DoubleDestroyFn, NULL }); + ARC_Config_RegisterTypeWithCStr(config, "ARC_String", (ARC_ConfigType){ sizeof(ARC_String), ARC_ConfigType_StringCopyFn, ARC_ConfigType_StringDestroyFn, NULL }); } void ARC_ConfigType_BoolCopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata){