2022-10-27 15:16:54 -06:00
|
|
|
#ifndef ARC_STD_CONFIG_H_
|
|
|
|
|
#define ARC_STD_CONFIG_H_
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-03-11 00:41:17 -06:00
|
|
|
#include "arc/std/parser.h"
|
2025-03-28 04:12:57 -06:00
|
|
|
#include <stdint.h>
|
2022-10-27 15:16:54 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-27 23:43:17 -06:00
|
|
|
* @brief the config type for archeus, loads in a .chemical file which syntax is specified in the documentation
|
2025-03-11 00:41:17 -06:00
|
|
|
*/
|
2022-10-27 15:16:54 -06:00
|
|
|
typedef struct ARC_Config ARC_Config;
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-11 00:41:17 -06:00
|
|
|
* @brief a function callback to create a type stored within a config
|
2025-03-28 01:34:29 -06:00
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-11 00:41:17 -06:00
|
|
|
*/
|
2025-03-17 18:01:18 -06:00
|
|
|
typedef void (* ARC_ConfigType_CopyFn)(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
2022-10-27 15:16:54 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-11 00:41:17 -06:00
|
|
|
* @brief a function callback to destroy a type
|
2025-03-28 01:34:29 -06:00
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-11 00:41:17 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
typedef void (* ARC_ConfigType_DestroyFn)(ARC_Config *config, void *type);
|
2022-10-27 15:16:54 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-11 00:41:17 -06:00
|
|
|
* @brief the functions for used for loading and unloading a type, the name will be the key of a hashtable
|
|
|
|
|
*/
|
|
|
|
|
typedef struct ARC_ConfigType {
|
2025-03-26 04:27:02 -06:00
|
|
|
uint32_t size;
|
2025-03-11 00:41:17 -06:00
|
|
|
ARC_ConfigType_CopyFn copyFn;
|
|
|
|
|
ARC_ConfigType_DestroyFn destroyFn;
|
2025-03-17 18:01:18 -06:00
|
|
|
void *userdata;
|
2025-03-11 00:41:17 -06:00
|
|
|
} ARC_ConfigType;
|
2023-01-17 01:59:08 -07:00
|
|
|
|
|
|
|
|
/**
|
2025-03-11 00:41:17 -06:00
|
|
|
* @brief creates the arc config type (a type that loads in config files and can have types added to it)
|
2025-03-19 05:13:11 -06:00
|
|
|
*
|
|
|
|
|
* @param[out] ARC_Config to create
|
2023-01-17 01:59:08 -07:00
|
|
|
*/
|
2025-03-11 00:41:17 -06:00
|
|
|
void ARC_Config_Create(ARC_Config **config);
|
2022-10-27 15:16:54 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-11 00:41:17 -06:00
|
|
|
* @brief destroys an ARC_Config type
|
2025-03-19 05:13:11 -06:00
|
|
|
*
|
|
|
|
|
* @param[in] config ARC_Config to destroy
|
2025-03-11 00:41:17 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_Config_Destroy(ARC_Config *config);
|
2022-10-27 15:16:54 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-11 00:41:17 -06:00
|
|
|
* @brief adds creation and destruction functions for a new user provided type will be used for config load and unload functions
|
2022-10-27 15:16:54 -06:00
|
|
|
*
|
2025-03-11 00:41:17 -06:00
|
|
|
* @note this function uses ARC_Config_RegisterTypeWithCStr so it shares error messages with that function
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the ARC_Config to set the new type into
|
|
|
|
|
* @param[in] typeName the name of the type like "uint32" or "ARC_Rect" that will be read in from a config file
|
|
|
|
|
* @param[in] type the copy and destroy functions for the type used on load and unload
|
|
|
|
|
*/
|
|
|
|
|
void ARC_Config_RegisterType(ARC_Config *config, ARC_String *typeName, ARC_ConfigType type);
|
2022-10-27 15:16:54 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-11 00:41:17 -06:00
|
|
|
* @brief adds creation and destruction functions for a new user provided type
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the ARC_Config to set the new type into
|
|
|
|
|
* @param[in] typeName the name of the type like "uint32" or "ARC_Rect" that will be read in from a config file
|
|
|
|
|
* @param[in] type the copy and destroy functions for the type used on load and unload
|
|
|
|
|
*/
|
|
|
|
|
void ARC_Config_RegisterTypeWithCStr(ARC_Config *config, const char *typeNameCStr, ARC_ConfigType type);
|
2022-10-27 15:16:54 -06:00
|
|
|
|
2025-03-25 03:30:32 -06:00
|
|
|
/**
|
|
|
|
|
* @brief add a value with a given keyname
|
|
|
|
|
*
|
|
|
|
|
* @note name should be prefaced with <group>:: to specify group, or just the name if it is in the default group
|
|
|
|
|
* @note not specifying the group will use the current group
|
|
|
|
|
* @note this function uses ARC_Config_AddWithCStr so it shares error messages with that function
|
|
|
|
|
* @note value will be freed on cleanup or remove
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config ARC_Config to add value to
|
|
|
|
|
* @param[in] type the type of a variable to add to specified group
|
|
|
|
|
* @param[in] name name of a variable to add to specified group
|
|
|
|
|
* @param[in] value the value of the variable to add, will be freed
|
|
|
|
|
*/
|
|
|
|
|
void ARC_Config_Add(ARC_Config *config, ARC_String *type, ARC_String *name, void *value);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief add a value with a given keyname
|
|
|
|
|
*
|
|
|
|
|
* @note name should be prefaced with <group>:: to specify group, or just the name if it is in the default group
|
|
|
|
|
* @note not specifying the group will use the current group
|
|
|
|
|
* @note value will be freed on cleanup or remove
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config ARC_Config to add value to
|
|
|
|
|
* @param[in] type the type of a variable to add to specified group
|
|
|
|
|
* @param[in] name name of a variable to add to specified group
|
|
|
|
|
* @param[in] value the value of the variable to add, will be freed
|
|
|
|
|
*/
|
|
|
|
|
void ARC_Config_AddWithCStr(ARC_Config *config, const char *type, const char *name, void *value);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief remove a value with a given keyname
|
|
|
|
|
*
|
|
|
|
|
* @note name should be prefaced with <group>:: to specify group, or just the name if it is in the default group
|
|
|
|
|
* @note not specifying the group will use the current group
|
|
|
|
|
* @note this function uses ARC_Config_RemoveWithCStr so it shares error messages with that function
|
|
|
|
|
*
|
2025-03-25 04:54:13 -06:00
|
|
|
* @param[in] config ARC_Config to remove value from
|
|
|
|
|
* @param[in] name name of a variable to remove to specified group
|
|
|
|
|
* @param[in] isArray a boolean to specify if the variable is an array
|
2025-03-25 03:30:32 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_Config_Remove(ARC_Config *config, ARC_String *name, ARC_Bool isArray);
|
2025-03-25 03:30:32 -06:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief remove a value with a given keyname
|
|
|
|
|
*
|
|
|
|
|
* @note name should be prefaced with <group>:: to specify group, or just the name if it is in the default group
|
|
|
|
|
* @note not specifying the group will use the current group
|
|
|
|
|
*
|
2025-03-25 04:54:13 -06:00
|
|
|
* @param[in] config ARC_Config to remove value from
|
|
|
|
|
* @param[in] name name of a variable to remove to specified group
|
|
|
|
|
* @param[in] isArray a boolean to specify if the variable is an array
|
2025-03-25 03:30:32 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_Config_RemoveWithCStr(ARC_Config *config, const char *name, ARC_Bool isArray);
|
2025-03-25 03:30:32 -06:00
|
|
|
|
2022-10-27 15:16:54 -06:00
|
|
|
/**
|
|
|
|
|
* @brief sets current group in config
|
|
|
|
|
*
|
|
|
|
|
* @note ARC_Config_Get will use this set group
|
2025-03-11 00:41:17 -06:00
|
|
|
* @note this function uses ARC_Config_SetGroupWithCStr so it shares error messages with that function
|
2022-10-27 15:16:54 -06:00
|
|
|
*
|
2025-03-11 00:41:17 -06:00
|
|
|
* @param[in] config ARC_Config we are setting current group in
|
|
|
|
|
* @param[in] groupname name of group that will be set
|
2025-03-25 03:30:32 -06:00
|
|
|
*/
|
2025-03-11 00:41:17 -06:00
|
|
|
void ARC_Config_SetGroup(ARC_Config *config, ARC_String *groupName);
|
2022-10-27 15:16:54 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-11 00:41:17 -06:00
|
|
|
* @brief sets current group in config
|
2022-10-27 15:16:54 -06:00
|
|
|
*
|
2025-03-11 00:41:17 -06:00
|
|
|
* @note ARC_Config_Get will use this set group
|
2022-10-27 15:16:54 -06:00
|
|
|
*
|
2025-03-11 00:41:17 -06:00
|
|
|
* @param[in] config ARC_Config we are setting current group in
|
|
|
|
|
* @param[in] groupname name of group that will be set
|
2025-03-25 03:30:32 -06:00
|
|
|
*/
|
2025-03-11 00:41:17 -06:00
|
|
|
void ARC_Config_SetGroupWithCStr(ARC_Config *config, const char *groupName);
|
2022-10-27 15:16:54 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-11 00:41:17 -06:00
|
|
|
* @brief get a value from a given name
|
|
|
|
|
*
|
2025-03-25 03:30:32 -06:00
|
|
|
* @note name should be prefaced with <group>:: to specify group, or just the name if it is in the default group
|
2025-03-11 00:41:17 -06:00
|
|
|
*
|
|
|
|
|
* @param[in] config ARC_Config to get value from
|
|
|
|
|
* @param[in] name name of a variable that has been read in
|
|
|
|
|
*
|
|
|
|
|
* @return the stored element on success, or NULL on failure
|
2025-03-25 03:30:32 -06:00
|
|
|
*/
|
2025-03-11 00:41:17 -06:00
|
|
|
void *ARC_Config_Get(ARC_Config *config, ARC_String *name);
|
2023-01-17 01:59:08 -07:00
|
|
|
|
|
|
|
|
/**
|
2025-03-11 00:41:17 -06:00
|
|
|
* @brief get a value from a given keyname
|
2022-10-27 15:16:54 -06:00
|
|
|
*
|
2025-03-25 03:30:32 -06:00
|
|
|
* @note name should be prefaced with <group>:: to specify group, or just the name if it is in the default group
|
2025-03-11 00:41:17 -06:00
|
|
|
* @note this function uses ARC_Config_Get so it shares error messages with that function
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config ARC_Config to get value from
|
|
|
|
|
* @param[in] name name of a variable that has been read in
|
|
|
|
|
*
|
|
|
|
|
* @return the stored element on success, or NULL on failure
|
2025-03-25 03:30:32 -06:00
|
|
|
*/
|
2025-03-11 00:41:17 -06:00
|
|
|
void *ARC_Config_GetWithCStr(ARC_Config *config, const char *name);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-27 23:43:17 -06:00
|
|
|
* @brief takes a given string and loads it into the config
|
|
|
|
|
*
|
|
|
|
|
* @breif config the config to load the string to
|
|
|
|
|
* @breif string the string to load into the config
|
2025-03-11 00:41:17 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_Config_LoadFromString(ARC_Config *config, ARC_String **string);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-27 23:43:17 -06:00
|
|
|
* @brief takes a given file path and loads it into the config
|
|
|
|
|
*
|
|
|
|
|
* @note this path will be based on wherever the executable is run from
|
|
|
|
|
*
|
|
|
|
|
* @breif config the config to load the file to
|
|
|
|
|
* @breif path the location of the .chemical file to load
|
2025-03-11 00:41:17 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_Config_LoadFromFile(ARC_Config *config, ARC_String *path);
|
|
|
|
|
|
2025-03-19 05:13:11 -06:00
|
|
|
/**
|
2025-03-27 23:43:17 -06:00
|
|
|
* @brief takes a given file path and loads it into the config
|
|
|
|
|
*
|
|
|
|
|
* @note this path will be based on wherever the executable is run from
|
|
|
|
|
*
|
|
|
|
|
* @breif config the config to load the file to
|
|
|
|
|
* @breif path the location of the .chemical file to load
|
2025-03-19 05:13:11 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_Config_LoadFromFileWithCStr(ARC_Config *config, const char *path);
|
|
|
|
|
|
2025-03-11 00:41:17 -06:00
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief takes a given file path and unloads it into the config
|
|
|
|
|
*
|
|
|
|
|
* @note this path will be based on wherever the executable is run from
|
|
|
|
|
*
|
|
|
|
|
* @breif config the config to unload the file from
|
|
|
|
|
* @breif path the location of the .chemical file to unload
|
2025-03-11 00:41:17 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_Config_UnloadFromString(ARC_Config *config, ARC_String **string);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief takes a given file path and unloads it into the config
|
|
|
|
|
*
|
|
|
|
|
* @note this path will be based on wherever the executable is run from
|
|
|
|
|
*
|
|
|
|
|
* @breif config the config to unload the file from
|
|
|
|
|
* @breif path the location of the .chemical file to unload
|
2025-03-11 00:41:17 -06:00
|
|
|
*/
|
2025-04-07 06:41:52 -06:00
|
|
|
void ARC_Config_UnloadFromFile(ARC_Config *config, ARC_String *path);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief takes a given file path and unloads it into the config
|
|
|
|
|
*
|
|
|
|
|
* @note this path will be based on wherever the executable is run from
|
|
|
|
|
*
|
|
|
|
|
* @breif config the config to unload the file from
|
|
|
|
|
* @breif path the location of the .chemical file to unload
|
|
|
|
|
*/
|
|
|
|
|
void ARC_Config_UnloadFromFileWithCStr(ARC_Config *config, const char *path);
|
2025-03-11 00:41:17 -06:00
|
|
|
|
2025-03-28 01:34:29 -06:00
|
|
|
/**
|
|
|
|
|
* @{
|
|
|
|
|
* @brief defaults used by arc config can be defined before building to change them
|
|
|
|
|
*/
|
|
|
|
|
#ifndef ARC_CONFIG_DEFAULT_GROUP
|
2025-03-11 00:41:17 -06:00
|
|
|
#define ARC_CONFIG_DEFAULT_GROUP " "
|
2025-03-28 01:34:29 -06:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef ARC_CONFIG_GROUP_TAG_NAME
|
2025-03-11 00:41:17 -06:00
|
|
|
#define ARC_CONFIG_GROUP_TAG_NAME "group"
|
2025-03-28 01:34:29 -06:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef ARC_CONFIG_GROUP_SEPARATOR
|
2025-03-11 00:41:17 -06:00
|
|
|
#define ARC_CONFIG_GROUP_SEPARATOR "::"
|
2025-03-28 01:34:29 -06:00
|
|
|
#endif
|
|
|
|
|
/**
|
|
|
|
|
* @}
|
|
|
|
|
*/
|
2025-03-11 00:41:17 -06:00
|
|
|
|
2025-03-28 01:34:29 -06:00
|
|
|
/**
|
|
|
|
|
* @{
|
|
|
|
|
* @brief tokens used in the config langauge, defined here for use in ARC_ConfigType_CopyFn and ARC_ConfigType_DestroyFn
|
|
|
|
|
*
|
|
|
|
|
* @note the grouping is based on the ascii table, but the ids are sequential to make finding tokens quicker (look at the lexer continious for more explanation)
|
|
|
|
|
*/
|
2025-03-11 00:41:17 -06:00
|
|
|
#define ARC_CONFIG_TAB 0x01
|
|
|
|
|
#define ARC_CONFIG_NEWLINE 0x02
|
|
|
|
|
|
|
|
|
|
#define ARC_CONFIG_SPACE 0x03
|
|
|
|
|
#define ARC_CONFIG_BANG 0x04
|
|
|
|
|
#define ARC_CONFIG_QUOTE 0x05
|
|
|
|
|
#define ARC_CONFIG_HASH 0x06
|
|
|
|
|
#define ARC_CONFIG_DOLLAR 0x07
|
|
|
|
|
#define ARC_CONFIG_PERCENT 0x08
|
|
|
|
|
#define ARC_CONFIG_AMPERSAND 0x09
|
|
|
|
|
#define ARC_CONFIG_SINGLE_QUOTE 0x0A
|
|
|
|
|
#define ARC_CONFIG_OPEN_PAREN 0x0B
|
|
|
|
|
#define ARC_CONFIG_CLOSE_PAREN 0x0C
|
|
|
|
|
#define ARC_CONFIG_ASTERISK 0x0D
|
|
|
|
|
#define ARC_CONFIG_PLUS 0x0E
|
|
|
|
|
#define ARC_CONFIG_COMMA 0x0F
|
|
|
|
|
#define ARC_CONFIG_MINUS 0x10
|
|
|
|
|
#define ARC_CONFIG_PERIOD 0x11
|
|
|
|
|
#define ARC_CONFIG_SLASH 0x12
|
|
|
|
|
#define ARC_CONFIG_NUMBER 0x13
|
|
|
|
|
|
|
|
|
|
#define ARC_CONFIG_COLON 0x14
|
|
|
|
|
#define ARC_CONFIG_SEMICOLON 0x15
|
|
|
|
|
#define ARC_CONFIG_LESS_THAN 0x16
|
|
|
|
|
#define ARC_CONFIG_GREATER_THAN 0x17
|
|
|
|
|
#define ARC_CONFIG_EQUAL 0x18
|
|
|
|
|
#define ARC_CONFIG_QUESTION_MARK 0x19
|
|
|
|
|
#define ARC_CONFIG_AT 0x1A
|
|
|
|
|
#define ARC_CONFIG_ALPHA_UPPER_CHAR 0x1B
|
|
|
|
|
|
|
|
|
|
#define ARC_CONFIG_OPEN_BRACKET 0x1C
|
|
|
|
|
#define ARC_CONFIG_BACKSLASH 0x1D
|
|
|
|
|
#define ARC_CONFIG_CLOSE_BRACKET 0x1E
|
|
|
|
|
#define ARC_CONFIG_CARET 0x1F
|
|
|
|
|
#define ARC_CONFIG_UNDERSCORE 0x20
|
|
|
|
|
#define ARC_CONFIG_GRAVE 0x21
|
|
|
|
|
#define ARC_CONFIG_ALPHA_LOWER_CHAR 0x22
|
|
|
|
|
|
|
|
|
|
#define ARC_CONFIG_OPEN_CURLY_BRACE 0x23
|
|
|
|
|
#define ARC_CONFIG_VERTICAL_LINE 0x24
|
|
|
|
|
#define ARC_CONFIG_CLOSE_CURLY_BRACE 0x25
|
|
|
|
|
#define ARC_CONFIG_TILDE 0x26
|
|
|
|
|
|
2025-03-24 00:32:44 -06:00
|
|
|
#define ARC_CONFIG_LANGUAGE 0x27
|
|
|
|
|
#define ARC_CONFIG_GROUP 0x28
|
|
|
|
|
#define ARC_CONFIG_GROUP_NAME 0x29
|
|
|
|
|
#define ARC_CONFIG_GROUP_ARGS 0x2A
|
|
|
|
|
#define ARC_CONFIG_VARIABLE_LINES 0x2B
|
|
|
|
|
#define ARC_CONFIG_VARIABLE_LINE 0x2C
|
|
|
|
|
#define ARC_CONFIG_ALLOW_SPACE 0x2D
|
|
|
|
|
#define ARC_CONFIG_TYPE 0x2E
|
|
|
|
|
#define ARC_CONFIG_VALUE 0x2F
|
|
|
|
|
#define ARC_CONFIG_NESTED_VALUE 0x30
|
|
|
|
|
#define ARC_CONFIG_VALUE_ARGS 0x31
|
|
|
|
|
#define ARC_CONFIG_ARRAY 0x32
|
|
|
|
|
#define ARC_CONFIG_VARIABLE 0x33
|
|
|
|
|
#define ARC_CONFIG_VARIABLE_NAME 0x34
|
|
|
|
|
#define ARC_CONFIG_VARIABLE_CHAR 0x35
|
|
|
|
|
#define ARC_CONFIG_STRING 0x36
|
|
|
|
|
#define ARC_CONFIG_STRING_CHARS 0x37
|
|
|
|
|
#define ARC_CONFIG_STRING_CHAR 0x38
|
|
|
|
|
#define ARC_CONFIG_ESCAPE_CHAR 0x39
|
2025-03-25 03:30:32 -06:00
|
|
|
#define ARC_CONFIG_FLOAT 0x3A
|
|
|
|
|
#define ARC_CONFIG_NUMBER_SIGN 0x3B
|
|
|
|
|
#define ARC_CONFIG_NUMBER_TAG 0x3C
|
|
|
|
|
#define ARC_CONFIG_WHITESPACE 0x3D
|
|
|
|
|
#define ARC_CONFIG_COMMENT 0x3E
|
|
|
|
|
#define ARC_CONFIG_LINE_COMMENT 0x3F
|
|
|
|
|
#define ARC_CONFIG_MULTI_LINE_COMMENT 0x40
|
|
|
|
|
#define ARC_CONFIG_LINE_CHARS 0x41
|
|
|
|
|
#define ARC_CONFIG_MULTI_LINE_CHARS 0x42
|
|
|
|
|
#define ARC_CONFIG_COMMENT_CHAR 0x43
|
2025-03-28 01:34:29 -06:00
|
|
|
/**
|
|
|
|
|
* @}
|
|
|
|
|
*/
|
2022-10-27 15:16:54 -06:00
|
|
|
|
2025-03-20 05:34:03 -06:00
|
|
|
/**
|
|
|
|
|
* @brief TODO: write this
|
|
|
|
|
*/
|
2025-03-22 03:38:28 -06:00
|
|
|
void ARC_Config_InitStd(ARC_Config *config);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to create an ARC_Bool stored within a config
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_CopyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_ConfigType_BoolCopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to destroy an ARC_Bool type
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_DestroyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_ConfigType_BoolDestroyFn(ARC_Config *config, void *type);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to create an int8_t stored within a config
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_CopyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_ConfigType_Int8CopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to destroy an int8_t type
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_DestroyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_ConfigType_Int8DestroyFn(ARC_Config *config, void *type);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to create an uint8_t stored within a config
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_CopyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_ConfigType_Uint8CopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to destroy an uint8_t type
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_DestroyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_ConfigType_Uint8DestroyFn(ARC_Config *config, void *type);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to create an int16_t stored within a config
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_CopyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_ConfigType_Int16CopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to destroy an int16_t type
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_DestroyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_ConfigType_Int16DestroyFn(ARC_Config *config, void *type);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to create an uint16_t stored within a config
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_CopyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_ConfigType_Uint16CopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to destroy an uint16_t type
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_DestroyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_ConfigType_Uint16DestroyFn(ARC_Config *config, void *type);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to create an int32_t stored within a config
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_CopyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_ConfigType_Int32CopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to destroy an int32_t type
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_DestroyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_ConfigType_Int32DestroyFn(ARC_Config *config, void *type);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to create an uint32_t stored within a config
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_CopyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_ConfigType_Uint32CopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to destroy an uint32_t type
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_DestroyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_ConfigType_Uint32DestroyFn(ARC_Config *config, void *type);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to create an int64_t stored within a config
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_CopyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_ConfigType_Int64CopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to destroy an int64_t type
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_DestroyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_ConfigType_Int64DestroyFn(ARC_Config *config, void *type);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to create an uint64_t stored within a config
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_CopyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_ConfigType_Uint64CopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to destroy an uint64_t type
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_DestroyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_ConfigType_Uint64DestroyFn(ARC_Config *config, void *type);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to create a float stored within a config
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_CopyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_ConfigType_FloatCopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to destroy a float type
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_DestroyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_ConfigType_FloatDestroyFn(ARC_Config *config, void *type);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to create a double stored within a config
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_CopyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_ConfigType_DoubleCopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to destroy a double type
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_DestroyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_ConfigType_DoubleDestroyFn(ARC_Config *config, void *type);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to create an ARC_String stored within a config
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_CopyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[out] type the place to store the type copy, should be set to NULL on error
|
|
|
|
|
* @param[in] parsedData the parsed data used to copy from. will be <value> as defined in the language
|
|
|
|
|
* @param[in] config the config that is reading in the data, can be used within the copy function to add a new type (check ARC_ConfigType_SpriteCopyFn for an example)
|
|
|
|
|
* @param[in] userdata userdata that was stored in the type during type register
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
|
|
|
|
void ARC_ConfigType_StringCopyFn(void **type, ARC_ParserTagToken *parsedData, ARC_Config *config, void *userdata);
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-28 01:34:29 -06:00
|
|
|
* @brief a function callback to destroy an ARC_String type
|
|
|
|
|
*
|
|
|
|
|
* @note this function is an ARC_ConfigType_DestroyFn callback
|
|
|
|
|
*
|
|
|
|
|
* @param[in] config the config that is destroying the data, can be used within the destroy function to remove a previously added tag (check ARC_ConfigType_SpriteDestroyFn for an example)
|
|
|
|
|
* @param[in] type the type to be destroyed
|
2025-03-20 05:34:03 -06:00
|
|
|
*/
|
2025-03-25 04:54:13 -06:00
|
|
|
void ARC_ConfigType_StringDestroyFn(ARC_Config *config, void *type);
|
2025-03-20 05:34:03 -06:00
|
|
|
|
2022-10-27 15:16:54 -06:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-03-28 04:30:45 -06:00
|
|
|
#endif // !ARC_STD_CONFIG_H_
|