diff options
| -rw-r--r-- | include/qntan/Qntan.h | 118 |
1 files changed, 62 insertions, 56 deletions
diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index 45df974..3d23892 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -651,9 +651,11 @@ struct Qntan_FileSystem_Dirent { /* f=File, d=Directory, b=BlockDev, c=CharDev, p=Pipe, l=Link, s=Socket. * WARN: This field may not available on all systems! Be prepared for NULL. */ -// uint64_t size; -// /* File size -// */ +#if 0 +TODO uint64_t size; +TODO /* File size +TODO */ +#endif }; struct Qntan_FileSystem { @@ -661,11 +663,13 @@ struct Qntan_FileSystem { * 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'. -// */ +#if 0 +TODO void (*getattr)( struct Qntan_FileSystem**, const char*path, +TODO void(*onDone)(int, struct stat*buf, Qntan_Cls), Qntan_Cls); +TODO /* Get detail information of a file/dir. +TODO * 'buf' is only valid until return from 'onDone'. +TODO */ +#endif void (*mkdir)( struct Qntan_FileSystem**, char const*path, uint32_t mode, void(*onDone)(int, Qntan_Cls), Qntan_Cls ); /* Same idea as @@ -676,44 +680,50 @@ struct Qntan_FileSystem { void(*onDone)(int, Qntan_Cls), Qntan_Cls ); /* Same idea as `mkdir` but creates all missing parent dirs too. */ -// 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); -// /**/ +#if 0 +TODO void (*rmdir)( struct Qntan_FileSystem**, const char*path, +TODO void(*onDone)(int, Qntan_Cls), Qntan_Cls ); +TODO /**/ +TODO void (*open)( struct Qntan_FileSystem**, const char*path, +TODO struct fuse_file_info*, void(*onDone)(int, Qntan_Cls), Qntan_Cls); +TODO /**/ +TODO void (*create)( struct Qntan_FileSystem**, const char*path, mode_t mode, +TODO struct fuse_file_info*, void(*onDone)(int, Qntan_Cls), Qntan_Cls); +TODO /**/ +#endif void (*unlink)( struct Qntan_FileSystem**, const char*path, void(*onDone)(int, Qntan_Cls), Qntan_Cls); /* Same idea as * "https://pubs.opengroup.org/onlinepubs/009696799/functions/unlink.html" * just using an async API. */ -// 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. -// */ +#if 0 +TODO void (*truncate)( struct Qntan_FileSystem**, char const*path, off_t size, +TODO void(*onDone)(int, Qntan_Cls), Qntan_Cls); +TODO /* TODO There's a duplicate in 'File' of this function. +TODO */ +#endif void (*rename)( struct Qntan_FileSystem**, char const*src, char const*dst, 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); -// /**/ +#if 0 +TODO void (*chmod)( struct Qntan_FileSystem**, char const*path, mode_t, +TODO void(*onDone)(int, Qntan_Cls), Qntan_Cls); +TODO /**/ +TODO void (*chown)( struct Qntan_FileSystem**, char const*path, uid_t, gid_t, +TODO void(*onDone)(int, Qntan_Cls), Qntan_Cls); +TODO /**/ +TODO void (*utimens)( struct Qntan_FileSystem**, char const*path, const struct timespec, +TODO void(*onDone)(int, Qntan_Cls), Qntan_Cls ); +TODO /**/ +TODO void (*release)( struct Qntan_FileSystem**, char const*path, struct fuse_file_info*, +TODO void(*onDone)(int, Qntan_Cls), Qntan_Cls); +TODO /**/ +TODO /* TODO what about 'close()' ? */ +TODO void (*fsync)( struct Qntan_FileSystem**, char const*path, int isdatasync, +TODO struct fuse_file_info*, void(*onDone)(int, Qntan_Cls), Qntan_Cls); +TODO /**/ +#endif void (*listDir)( struct Qntan_FileSystem**, char const*path, @@ -1272,12 +1282,14 @@ struct Qntan_CsvDec_Mentor { * 1st colum is nr 1). `flg & 4` indicates this is the last buffer * for this cell. */ -// TODO void (*onChunkRaw)( struct Qntan_CsvDec_Mentor**, -// TODO int64_t row, int64_t col, char const*buf, int buf_len, unsigned flg, -// TODO void(*onDone)(Qntan_Cls), Qntan_Cls ); -// TODO /* Same as `onChunk`. BUT: Quotations will not be removed, but will -// TODO * be as found in the original document. -// TODO */ +#if 0 +TODO void (*onChunkRaw)( struct Qntan_CsvDec_Mentor**, +TODO int64_t row, int64_t col, char const*buf, int buf_len, unsigned flg, +TODO void(*onDone)(Qntan_Cls), Qntan_Cls ); +TODO /* Same as `onChunk`. BUT: Quotations will not be removed, but will +TODO * be as found in the original document. +TODO */ +#endif void (*onEnd)( struct Qntan_CsvDec_Mentor**, int err, char*emsg ); /* Called ONCE at end. with err `0` on success. `err` is a negated * error number on erorr. In this case, `emsg` MAY contains error @@ -1587,19 +1599,13 @@ struct Qntan_JsonTreeDec_JsonNode { * NOT codepoints. */ union /* See 'type' to know which of those values is valid. */ { - double valNumber; - int valBool; - struct valStr { - char const *buf; - int len; - }; - struct valChild { - /* dictionary or array. For dictionary keys see 'valChild.arr[i]->key' - */ - struct Qntan_JsonTreeDec_JsonNode **arr; - int cnt; - }; - }; + double number; + int boolean; + struct { char const *buf; int len; } str; + struct { struct Qntan_JsonTreeDec_JsonNode **arr; int cnt; } child; + /* dictionary or array. If dictionary, for keys see 'val.child.arr[i]->key' + */ + } val; }; #ifndef Qntan_JsonTreeDec_write |
