made all toml_load* functions public
This commit is contained in:
parent
7a0570b0b9
commit
3e21766514
@ -49,10 +49,25 @@ typedef List(TomlValue) TomlArray;
|
|||||||
// //
|
// //
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Result(TomlTable*) toml_load_str(str s);
|
/// opens file
|
||||||
Result(TomlTable*) toml_load_file(FILE* file);
|
|
||||||
Result(TomlTable*) toml_load_filename(cstr filename);
|
Result(TomlTable*) toml_load_filename(cstr filename);
|
||||||
|
|
||||||
|
/// @param filename to use in error messages
|
||||||
|
Result(TomlTable*) toml_load_str_filename(str s, cstr filename);
|
||||||
|
|
||||||
|
/// loads whole file in memory
|
||||||
|
/// @param filename to use in error messages
|
||||||
|
Result(TomlTable*) toml_load_file_filename(FILE* file, cstr filename);
|
||||||
|
|
||||||
|
static inline Result(TomlTable*) toml_load_str(str s){
|
||||||
|
return toml_load_str_filename(s, "<string>");
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline Result(TomlTable*) toml_load_file(FILE* file){
|
||||||
|
return toml_load_file_filename(file, "<stream>");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* TODO: implement dump functions
|
/* TODO: implement dump functions
|
||||||
str toml_dump_str(const TomlTable* self, TomlErr *err);
|
str toml_dump_str(const TomlTable* self, TomlErr *err);
|
||||||
void toml_dump_file(const TomlTable* self, FILE* file, TomlErr *err);
|
void toml_dump_file(const TomlTable* self, FILE* file, TomlErr *err);
|
||||||
|
|||||||
@ -30,16 +30,6 @@ Result(TomlTable*) toml_load_file_filename(FILE* file, cstr filename)
|
|||||||
Return RESULT_VALUE(p, table);
|
Return RESULT_VALUE(p, table);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result(TomlTable*) toml_load_str(str s)
|
|
||||||
{
|
|
||||||
return toml_load_str_filename(s, "<string>");
|
|
||||||
}
|
|
||||||
|
|
||||||
Result(TomlTable*) toml_load_file(FILE* file)
|
|
||||||
{
|
|
||||||
return toml_load_file_filename(file, "<stream>");
|
|
||||||
}
|
|
||||||
|
|
||||||
Result(TomlTable*) toml_load_filename(cstr filename)
|
Result(TomlTable*) toml_load_filename(cstr filename)
|
||||||
{
|
{
|
||||||
Deferral(1);
|
Deferral(1);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user