common: update bluelib api usage
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include <blue/object/array.h>
|
||||
#include <blue/object/string.h>
|
||||
#include <blue/ds/array.h>
|
||||
#include <blue/ds/string.h>
|
||||
#include <errno.h>
|
||||
#include <ivy/file.h>
|
||||
#include <stdlib.h>
|
||||
@@ -24,7 +24,7 @@ static enum ivy_status get_row(
|
||||
return IVY_ERR_EOF;
|
||||
}
|
||||
|
||||
b_string *line = B_STRING(b_array_at(f->f_lines, row - 1));
|
||||
b_string *line = b_array_at(f->f_lines, row - 1);
|
||||
|
||||
const char *line_str = b_string_ptr(line);
|
||||
size_t line_len = b_string_get_size(line, B_STRLEN_NORMAL);
|
||||
@@ -54,7 +54,7 @@ static enum ivy_status readline(
|
||||
|
||||
b_string *line_str = b_string_create_from_cstr(buf);
|
||||
b_array_append(f->f_lines, B_OBJECT(line_str));
|
||||
b_string_release(line_str);
|
||||
b_string_unref(line_str);
|
||||
|
||||
*nr_read = strlen(buf);
|
||||
return IVY_OK;
|
||||
@@ -89,7 +89,7 @@ enum ivy_status ivy_file_open(const char *path, struct ivy_file **out)
|
||||
|
||||
void ivy_file_close(struct ivy_file *file)
|
||||
{
|
||||
b_array_release(file->f_lines);
|
||||
b_array_unref(file->f_lines);
|
||||
free(file->f_path);
|
||||
fclose(file->f_fp);
|
||||
free(file);
|
||||
|
||||
Reference in New Issue
Block a user