io: implement path manipulation and directory iteration on darwin

This commit is contained in:
2025-02-13 18:03:09 +00:00
parent 8862cdf2e0
commit c822be0804
6 changed files with 419 additions and 15 deletions

View File

@@ -6,6 +6,8 @@
#include <blue/object/object.h>
#include <stddef.h>
#define B_PATH(p) ((b_path *)p)
typedef struct b_path b_path;
BLUE_API b_path *b_path_create();
@@ -25,8 +27,16 @@ BLUE_API bool b_path_is_file(const b_path *path);
BLUE_API bool b_path_is_directory(const b_path *path);
BLUE_API const char *b_path_ptr(const b_path *path);
BLUE_API size_t b_path_length(const b_path *path);
BLUE_API b_path *b_path_retain(b_path *path);
BLUE_API void b_path_release(b_path *path);
static inline b_path *b_path_retain(b_path *path)
{
return B_PATH(b_retain(B_OBJECT(path)));
}
static inline void b_path_release(b_path *path)
{
b_release(B_OBJECT(path));
}
#endif