meta: add module for disk I/O functionality

This commit is contained in:
2025-02-10 13:59:20 +00:00
parent 9add587ddd
commit 4f9ea02126
7 changed files with 102 additions and 1 deletions

25
io/include/blue/io/path.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef BLUELIB_IO_PATH_H_
#define BLUELIB_IO_PATH_H_
#include <blue/core/misc.h>
#include <blue/core/status.h>
#include <blue/object/object.h>
#include <stddef.h>
typedef struct b_path b_path;
BLUE_API b_status b_path_create(b_path **out);
BLUE_API b_status b_path_create_root(b_path **out);
BLUE_API b_status b_path_create_cwd(b_path **out);
BLUE_API b_status b_path_create_from_cstr(const char *path, b_path **out);
BLUE_API b_status b_path_join(const b_path *paths[], size_t nr_paths, b_path **out);
BLUE_API b_status b_path_make_absolute(const b_path *in, b_path **out);
BLUE_API b_status b_path_make_relative(const b_path *in, b_path **out);
BLUE_API b_status b_path_make_canonical(const b_path *in, b_path **out);
BLUE_API b_path *b_path_retain(b_path *path);
BLUE_API void b_path_release(b_path *path);
#endif