hoshi-lang dev
Yet another programming language
Loading...
Searching...
No Matches
fs.h
Go to the documentation of this file.
1//
2// Created by XIaokang00010 on 2025/12/09.
3//
4
5#ifndef HOSHI_FS_H
6#define HOSHI_FS_H
7
8#include <cstdint>
9#include <cstddef>
10#include <cstdio>
11
12#define LIBFS_EXPORT extern "C"
13
14LIBFS_EXPORT bool runtime_fs_exists(const char* path);
15
16LIBFS_EXPORT bool runtime_fs_isfile(const char* path);
17
18LIBFS_EXPORT bool runtime_fs_isdir(const char* path);
19
20LIBFS_EXPORT bool runtime_fs_issymlink(const char* path);
21
22LIBFS_EXPORT int64_t runtime_fs_get_mtime(const char* path);
23
24LIBFS_EXPORT uint64_t runtime_fs_get_size(const char* path);
25
26LIBFS_EXPORT int64_t runtime_fs_get_ctime(const char* path);
27
28LIBFS_EXPORT int64_t runtime_fs_get_atime(const char* path);
29
30LIBFS_EXPORT int runtime_fs_get_mode(const char* path);
31
32LIBFS_EXPORT int runtime_fs_get_uid(const char* path);
33
35
37
39
40LIBFS_EXPORT char *runtime_fs_realpath(const char* path);
41
42LIBFS_EXPORT void runtime_fs_finalize(void *res);
43
44LIBFS_EXPORT bool runtime_fs_mkdir(const char *path, int mode);
45
46LIBFS_EXPORT bool runtime_fs_rmdir(const char* path);
47
48LIBFS_EXPORT bool runtime_fs_rename(const char *old_path, const char *new_path);
49
50LIBFS_EXPORT bool runtime_fs_remove(const char *path);
51
52LIBFS_EXPORT void *runtime_fs_opendir(const char *name);
53
54LIBFS_EXPORT char *runtime_fs_readdir(void *dir);
55
56LIBFS_EXPORT void runtime_fs_closedir(void *dir);
57
58LIBFS_EXPORT bool runtime_fs_symlink(const char *src_path, const char *dest_path);
59
60#endif //HOSHI_FS_H
LIBFS_EXPORT bool runtime_fs_isdir(const char *path)
Definition fs.cpp:85
LIBFS_EXPORT int runtime_fs_get_uid(const char *path)
Definition fs.cpp:134
LIBFS_EXPORT bool runtime_fs_exists(const char *path)
Definition fs.cpp:70
LIBFS_EXPORT int64_t runtime_fs_get_ctime(const char *path)
Definition fs.cpp:120
LIBFS_EXPORT bool runtime_fs_mkdir(const char *path, int mode)
Definition fs.cpp:257
LIBFS_EXPORT char * runtime_fs_cwd()
Definition fs.cpp:209
LIBFS_EXPORT char * runtime_fs_readdir(void *dir)
Definition fs.cpp:319
LIBFS_EXPORT char * runtime_fs_realpath(const char *path)
Definition fs.cpp:239
LIBFS_EXPORT char * runtime_fs_home_dir()
Definition fs.cpp:177
LIBFS_EXPORT int runtime_fs_get_mode(const char *path)
LIBFS_EXPORT bool runtime_fs_isfile(const char *path)
Definition fs.cpp:78
LIBFS_EXPORT bool runtime_fs_remove(const char *path)
Definition fs.cpp:277
LIBFS_EXPORT char * runtime_fs_temp_dir()
Definition fs.cpp:141
LIBFS_EXPORT bool runtime_fs_rename(const char *old_path, const char *new_path)
Definition fs.cpp:288
LIBFS_EXPORT int64_t runtime_fs_get_atime(const char *path)
Definition fs.cpp:127
LIBFS_EXPORT bool runtime_fs_symlink(const char *src_path, const char *dest_path)
Definition fs.cpp:359
LIBFS_EXPORT bool runtime_fs_issymlink(const char *path)
Definition fs.cpp:92
LIBFS_EXPORT void runtime_fs_finalize(void *res)
Definition fs.cpp:251
#define LIBFS_EXPORT
Definition fs.h:12
LIBFS_EXPORT void runtime_fs_closedir(void *dir)
Definition fs.cpp:344
LIBFS_EXPORT void * runtime_fs_opendir(const char *name)
Definition fs.cpp:292
LIBFS_EXPORT uint64_t runtime_fs_get_size(const char *path)
Definition fs.cpp:113
LIBFS_EXPORT int64_t runtime_fs_get_mtime(const char *path)
Definition fs.cpp:106
LIBFS_EXPORT bool runtime_fs_rmdir(const char *path)
Definition fs.cpp:267