Archeus 0.0.0
A C library and game engine that focuses on documentation
Loading...
Searching...
No Matches
chemical.h
Go to the documentation of this file.
1#ifndef ARC_STD_PARSER_CHEMICAL_H_
2#define ARC_STD_PARSER_CHEMICAL_H_
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stdint.h>
9#include "arc/std/parser.h"
10
11/*
12 * TODO: note here in header that this uses parser
13 * TODO: note here in header that group being used is persistant
14<language> -> <group> <language> | <variableLine> <language> | <whitespace> <language>
15
16<group> -> <groupName> <whitespace> <variable> <whitespace> LEFT_CURLY_BRACE <whitespace> <variableLine> <whitespace> RIGHT_CURLY_BRACE
17
18<variableLine> -> <type> <whitespace> <variable> <whitespace> EQUALS <whitespace> value <whitespace> SEMICOLON <whitespace>
19
20<groupName> -> <variable>
21<type> -> <variable>
22<value> -> <variable> | <number> | <nestedValue>
23<nestedValue> -> OPEN_CURLY_BRACE <whitespace> <valueArgs> <whitespace> CLOSE_CURLY_BRACE
24<valueArgs> -> <value> | <value> COMMA <valueArgs>
25
26<variable> -> ALPHA_UPPER_CHAR <variableName> | ALPHA_LOWER_CHAR <variableName> | UNDERSCORE <variableName>
27<variableName> -> <charOrNum> <variableName> | LAMBDA
28<charOrNum> -> ALPHA_UPPER_CHAR | ALPHA_LOWER_CHAR | UNDERSCORE | NUM
29
30<number> -> NUMBER <number> | NUMBER LAMBDA
31
32<whitespace> -> SPACE <whitespace> | TAB <whitespace> | NEWLINE <whitespace> | LAMBDA
33*/
34
35/**
36 * @brief TODO: write this
37*/
38typedef void (* ARC_ChemicalData_CopyToTypeFn)(void **data, ARC_ParserTagToken *parsedData);
39
40/**
41 * @brief TODO: write this
42*/
43typedef void (* ARC_ParserCSV_DestroyTypeFn)(void *data);
44
45/**
46 * @brief a function to read a key from string to a ARC_ConfigTypeTemplate
47 *
48 * @param config ARC_Config to store data to
49 * @param string ARC_String of data that is being read in
50 * @param value value that is read in
51 *
52 * @note use ARC_Config_StoreValue(ARC_Config *config, ARC_String *name, void *value); to store a value to the config
53 * if there is an error, set arc_errno
54 *
55 * @return 0 if value not a reference, 1 if value is a reference
56 */
57//typedef uint8_t (* ARC_ConfigKeyRead)(ARC_Config* config, ARC_String *string, void **value);
58
59/**
60 * @brief a function to delete a value from a key in ARC_Config
61 *
62 * @param config ARC_Config that can be used to check for references in data
63 * @param value pointer of data to be deleted
64 *
65 * @note this function can be NULL if memory does not need to be cleaned for this type
66 * if there is an error, set arc_errno
67 */
68//typedef void (* ARC_ConfigKeyDelete)(ARC_Config* config, ARC_String *string, void *value);
69
70/**
71 * @brief TODO: write this
72*/
74
75/**
76 * @brief TODO: write this
77*/
79
80/**
81 * @brief TODO: write this
82*/
84
85/**
86 * @brief TODO: write this
87*/
89
90/**
91 * @brief sets current group in config
92 *
93 * @note ARC_Chemical_Get will use this set group
94 *
95 * @param[in] chemical ARC_Config we are setting current group in
96 * @param[in] groupname name of group that will be set
97 */
98void ARC_Chemical_SetGroup(ARC_Chemical *chemical, ARC_String *groupName);
99
100/**
101 * @brief get a value from a given keyname
102 *
103 * @note name may be prefaced with <group>:: to specify group
104 *
105 * @param[in] chemical ARC_Chemical to get value from
106 * @param[in] element name of a variable that has been read in
107 *
108 * @return the stored element on success, or NULL on failure
109 */
110void *ARC_Chemical_Get(ARC_Chemical *chemical, ARC_String *element);
111
112/**
113 * @brief TODO: write this
114*/
116
117/**
118 * @brief TODO: write this
119*/
121
122/**
123 * @brief TODO: write this
124*/
126
127/**
128 * @brief TODO: write this
129*/
131
132#ifdef __cplusplus
133}
134#endif
135
136#endif //ARC_STD_PARSER_CHEMICAL_H_
struct ARC_Chemical ARC_Chemical
a function to read a key from string to a ARC_ConfigTypeTemplate
Definition chemical.h:73
void ARC_Chemical_LoadFromFile(ARC_String *path)
TODO: write this.
void ARC_Chemical_UnloadFromFile(ARC_String *data)
TODO: write this.
void ARC_Chemical_LoadFromString(ARC_String *path)
TODO: write this.
void ARC_Chemical_Create(ARC_Chemical **chemical)
TODO: write this.
void ARC_Chemical_RegisterType(ARC_Chemical *chemical, ARC_String *typeName, ARC_ChemicalData_CopyToTypeFn *copyToTypeFn, ARC_ParserCSV_DestroyTypeFn destroyTypeFn)
TODO: write this.
void ARC_Chemical_SetGroup(ARC_Chemical *chemical, ARC_String *groupName)
sets current group in config
void ARC_Chemical_Destroy(ARC_Chemical *chemical)
TODO: write this.
void(* ARC_ParserCSV_DestroyTypeFn)(void *data)
TODO: write this.
Definition chemical.h:43
void(* ARC_ChemicalData_CopyToTypeFn)(void **data, ARC_ParserTagToken *parsedData)
TODO: write this.
Definition chemical.h:38
void ARC_Chemical_UnloadFromString(ARC_String *data)
TODO: write this.
void * ARC_Chemical_Get(ARC_Chemical *chemical, ARC_String *element)
get a value from a given keyname
a parser type used inside of the parser data create function
Definition parser.h:35
substring position within a string
Definition string.h:14