From d945987cdac264f10e4b3cb5b24e1e663fbe533f Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser hiddenalpha.ch Date: Mon, 1 Dec 2025 20:23:02 +0100 Subject: Kludge-around with 'FileSystem' impl. Quite useless so far. --- include/qntan/Qntan.h | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'include/qntan') diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index 6f5a7fa..0b8a4c9 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -57,6 +57,7 @@ struct Qntan_Executor; struct Qntan_Scheduler; struct Qntan_IoMux; struct Qntan_File; +struct Qntan_FileSystem; struct Qntan_FourierTransform; struct Qntan_Process; struct Qntan_HshTbl; @@ -431,6 +432,7 @@ struct Qntan_File { void (*truncate)( struct Qntan_File**, int64_t size, void(*onDone)(int,Qntan_Cls), Qntan_Cls ); /* TODO doc + * TODO There's a duplicate in 'FileSystem' of this function. * WARN: size MUST be zero. Any other value is UB! (aka reserved for * future specifications) */ @@ -445,6 +447,65 @@ struct Qntan_File { +struct Qntan_FileSystem { + /* VFS (VirtualFileSystem) + * WARN: Heavily experimental API! + * TODO: Review/fix/adjust/tune function signatures. + */ +// void (*getattr)( struct Qntan_FileSystem**, const char*path, +// void(*onDone)(int, struct stat*buf, Qntan_Cls), Qntan_Cls); +// /* Get detail information of a file/dir. +// * 'buf' is only valid until return from 'onDone'. +// */ +// void (*mkdir)( struct Qntan_FileSystem**, char const*path, mode_t, +// void(*onDone)(int, Qntan_Cls), Qntan_Cls ); +// /**/ +// void (*rmdir)( struct Qntan_FileSystem**, const char*path, +// void(*onDone)(int, Qntan_Cls), Qntan_Cls ); +// /**/ +// void (*open)( struct Qntan_FileSystem**, const char*path, +// struct fuse_file_info*, void(*onDone)(int, Qntan_Cls), Qntan_Cls); +// /**/ +// void (*create)( struct Qntan_FileSystem**, const char*path, mode_t mode, +// struct fuse_file_info*, void(*onDone)(int, Qntan_Cls), Qntan_Cls); +// /**/ +// void (*unlink)( struct Qntan_FileSystem**, const char*path, +// void(*onDone)(int, Qntan_Cls), Qntan_Cls); +// /**/ +// void (*truncate)( struct Qntan_FileSystem**, char const*path, off_t size, +// void(*onDone)(int, Qntan_Cls), Qntan_Cls); +// /* TODO There's a duplicate in 'File' of this function. +// */ +// void (*rename)( struct Qntan_FileSystem**, char const*from, char const*to, +// void(*onDone)(int, Qntan_Cls), Qntan_Cls); +// /**/ +// void (*chmod)( struct Qntan_FileSystem**, char const*path, mode_t, +// void(*onDone)(int, Qntan_Cls), Qntan_Cls); +// /**/ +// void (*chown)( struct Qntan_FileSystem**, char const*path, uid_t, gid_t, +// void(*onDone)(int, Qntan_Cls), Qntan_Cls); +// /**/ +// void (*utimens)( struct Qntan_FileSystem**, char const*path, const struct timespec, +// void(*onDone)(int, Qntan_Cls), Qntan_Cls ); +// /**/ +// void (*release)( struct Qntan_FileSystem**, char const*path, struct fuse_file_info*, +// void(*onDone)(int, Qntan_Cls), Qntan_Cls); +// /**/ +// /* TODO what about 'close()' ? */ +// void (*fsync)( struct Qntan_FileSystem**, char const*path, int isdatasync, +// struct fuse_file_info*, void(*onDone)(int, Qntan_Cls), Qntan_Cls); +// /**/ +}; + + + + + + + + + + #ifndef Qntan_FourierTransform_transform # define Qntan_FourierTransform_transform(A, ...) (*A)->transform(A, __VA_ARGS__) #endif -- cgit v1.3.1