Add some evaluation stuff + versioning
Some checks failed
CMake / ubuntu-latest - shared=OFF, pthread=OFF, posix=OFF (push) Successful in 13s
CMake / ubuntu-latest - shared=ON, pthread=OFF, posix=OFF (push) Successful in 15s
CMake / ubuntu-latest - shared=OFF, pthread=OFF, posix=ON (push) Failing after 16s
CMake / ubuntu-latest - shared=ON, pthread=OFF, posix=ON (push) Failing after 17s
CMake / ubuntu-latest - shared=OFF, pthread=ON, posix=ON (push) Failing after 16s
CMake / ubuntu-latest - shared=ON, pthread=ON, posix=ON (push) Failing after 17s

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-08-01 02:56:44 +03:00
parent f1e4804167
commit e8f34b341e
3 changed files with 179 additions and 5 deletions

View File

@@ -49,9 +49,19 @@ typedef enum dcfg_ValueKind {
dcfg_ValueType_Object,
dcfg_ValueType_Array,
dcfg_ValueType_Function,
dcfg_ValueType_MemberAccess,
dcfg_ValueType_FunctionCall,
} dcfg_ValueType;
typedef struct dcfg_Version {
int major;
int minor;
int patch;
char const *str;
} dcfg_Version;
dcfg_Version dcfg_get_version(void);
dcfg_Instance *dcfg_make_instance(dcfg_InstanceCreateInfo const *create_info);
void dcfg_destroy_instance(dcfg_Instance *instance);
@@ -105,8 +115,10 @@ static inline bool dcfg_Value_get_function_body(
return dcfg_Value_get_function_body_ex(value, out_value, true);
}
// Allocates new values
bool dcfg_call_function(dcfg_Value *function, dcfg_Value **args,
size_t arg_count, dcfg_Value **out_value);
// Allocates new values
bool dcfg_Value_evaluate(dcfg_Value *value, dcfg_Value **out_value);
#ifdef __cplusplus