meta: rename to fx
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
#include "blue/serial/toml.h"
|
||||
|
||||
#include <blue/io/file.h>
|
||||
#include <blue/io/path.h>
|
||||
#include <blue/serial.h>
|
||||
#include <fx/io/file.h>
|
||||
#include <fx/io/path.h>
|
||||
#include <fx/serial.h>
|
||||
#include <fx/serial/toml.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
@@ -12,20 +11,20 @@ int main(int argc, const char **argv)
|
||||
}
|
||||
|
||||
const char *path_cstr = argv[1];
|
||||
b_path *path = b_path_create_from_cstr(path_cstr);
|
||||
fx_path *path = fx_path_create_from_cstr(path_cstr);
|
||||
|
||||
b_file *src = NULL;
|
||||
b_result result = b_file_open(NULL, path, B_FILE_READ_ONLY, &src);
|
||||
if (b_result_is_error(result)) {
|
||||
b_throw(result);
|
||||
fx_file *src = NULL;
|
||||
fx_result result = fx_file_open(NULL, path, FX_FILE_READ_ONLY, &src);
|
||||
if (fx_result_is_error(result)) {
|
||||
fx_throw(result);
|
||||
return -1;
|
||||
}
|
||||
|
||||
b_serial_ctx *ctx = b_toml_serial_ctx_create();
|
||||
fx_serial_ctx *ctx = fx_toml_serial_ctx_create();
|
||||
|
||||
b_object *data = NULL;
|
||||
b_status status = b_serial_ctx_deserialise(ctx, src, &data, 0);
|
||||
if (!B_OK(status)) {
|
||||
fx_object *data = NULL;
|
||||
fx_status status = fx_serial_ctx_deserialise(ctx, src, &data, 0);
|
||||
if (!FX_OK(status)) {
|
||||
fprintf(stderr, "cannot read data\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -34,12 +33,12 @@ int main(int argc, const char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
b_object_to_string(data, b_stdout);
|
||||
b_stream_write_char(b_stdout, '\n');
|
||||
fx_object_to_string(data, fx_stdout);
|
||||
fx_stream_write_char(fx_stdout, '\n');
|
||||
|
||||
b_object_unref(data);
|
||||
b_object_unref(src);
|
||||
b_serial_ctx_unref(ctx);
|
||||
fx_object_unref(data);
|
||||
fx_object_unref(src);
|
||||
fx_serial_ctx_unref(ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user