diff options
author | chai <chaifix@163.com> | 2018-07-28 10:23:36 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-07-28 10:23:36 +0800 |
commit | 654a75401775d74f95f3d98611e333bb5641ee9b (patch) | |
tree | ee73025f6def4b62102ee0f2566ff205f167e20a /src/3rdparty/smount/smount.h | |
parent | 61301a96d309fe2deef0d0dc2e2bc2f3d4003bf9 (diff) |
*update
Diffstat (limited to 'src/3rdparty/smount/smount.h')
-rw-r--r-- | src/3rdparty/smount/smount.h | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/src/3rdparty/smount/smount.h b/src/3rdparty/smount/smount.h deleted file mode 100644 index c0836a7..0000000 --- a/src/3rdparty/smount/smount.h +++ /dev/null @@ -1,89 +0,0 @@ -/** -* Copyright (c) 2018 chai -*/ -#ifndef SMOUNT_H -#define SMOUNT_H - -// path type -enum -{ - PATH_DIR = 1, // directory - PATH_REG = 2 // regular file -}; - -// sm status -enum -{ - SMT_SUCCESS = 0, - SMT_INVALIDMOUNT = 1, // invalid mount directory. - SMT_NOSUCHDIR = 2, // directory or file doesn't exsist. - SMT_UNABLEOPEN = 3, // - SMT_CANTWRITE = 4, -}; - -typedef struct smtPath -{ - int type; - char* path; - struct smtPath* next; -}smtPath; - -/** -* A shared context structrue. -*/ -typedef struct smtShared -{ - smtPath* mount; // the root directory -}smtShared; - -smtShared* smtnewshared(); - -void smtcloseshared(smtShared* S); - -/** -* Get error string with given error code. -*/ -const char *smterrstr(int err); - -/** -* Mount a sub file system. -*/ -int smtmount(smtShared* S, const char *path); - -/** -* Free mount -*/ -void smtunmount(smtShared* S); - -int smtexists(smtShared* S, const char *path); - -/** -* Get size of a file. -*/ -int smtsize(smtShared* S, const char *path); - -/** -* Can only read files under root directory. -*/ -void *smtread(smtShared* S, const char *path, unsigned int *size); - -int smtisdir(smtShared* S, const char *path); - -int smtisreg(smtShared* S, const char *path); - -/** -* List all folders and files inside current mount directory. -*/ -smtPath *smtlist(smtShared*S, const char *path); - -void smtfreelist(smtPath* S); - -int smtwrite(smtShared* S, const char *path, const void *data, int size); - -void smtdelete(smtShared* S, const char *path); - -int smtmkdir(smtShared* S, const char *path); - -char* smtfullpath(smtShared* S, const char* path); - -#endif
\ No newline at end of file |