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);
|
||||
Result(TomlTable*) toml_load_file(FILE* file);
|
||||
/// opens file
|
||||
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
|
||||
str toml_dump_str(const TomlTable* self, 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);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
Deferral(1);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user