From 831e814ce9bdb84e86c06c4a52008f6bdaaa00d6 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 16 Nov 2018 00:24:51 +0800 Subject: =?UTF-8?q?*=E5=90=88=E5=B9=B6master=E5=88=B0minimal=E5=88=86?= =?UTF-8?q?=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/3rdparty/smount/smount.h | 74 ------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 src/libjin/3rdparty/smount/smount.h (limited to 'src/libjin/3rdparty/smount/smount.h') diff --git a/src/libjin/3rdparty/smount/smount.h b/src/libjin/3rdparty/smount/smount.h deleted file mode 100644 index 0f8f774..0000000 --- a/src/libjin/3rdparty/smount/smount.h +++ /dev/null @@ -1,74 +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 -- cgit v1.1-26-g67d0