summaryrefslogtreecommitdiff
path: root/vfs/common
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2008-06-07 20:34:49 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2008-06-07 20:34:49 +0200
commitecde167da74c86bc047aaf84c5e548cf65a5da98 (patch)
treea015dfda84f28a65811e3aa0d369f8f211ec8c60 /vfs/common
downloadtuxcmd-ecde167da74c86bc047aaf84c5e548cf65a5da98.tar.xz
Diffstat (limited to 'vfs/common')
-rw-r--r--vfs/common/vfs_types.h114
1 files changed, 114 insertions, 0 deletions
diff --git a/vfs/common/vfs_types.h b/vfs/common/vfs_types.h
new file mode 100644
index 0000000..609a78b
--- /dev/null
+++ b/vfs/common/vfs_types.h
@@ -0,0 +1,114 @@
+/* Tux Commander VFS: Virtual File System types and definitions
+ * - prototypes functions and types
+ * draft version 3
+ *
+ * Copyright (C) 2003 Radek Cervinka <radek.cervinka@centrum.cz>
+ * Copyright (C) 2008 Tomas Bzatek <tbzatek@users.sourceforge.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __VFS_TYPES_H__
+#define __VFS_TYPES_H__
+
+
+#include <stdio.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+typedef int TVFSResult;
+
+
+typedef void (* TVFSLogFunc)(char *s);
+typedef int (* TVFSCopyCallBackFunc)(u_int64_t iPos, u_int64_t iMax, void *data);
+typedef void *TVFSFileDes;
+
+static const int cVFSVersion = 3; // current version of the VFS API
+
+// Capabilities
+static const int capVFS_nil = 0;
+static const int capVFS_List = 1 << 0;
+static const int capVFS_CopyOut = 1 << 1;
+static const int capVFS_CopyIn = 1 << 2;
+static const int capVFS_MkDir = 1 << 3;
+static const int capVFS_RmDir = 1 << 4;
+static const int capVFS_Multiple = 1 << 5; // support multiple files = background copy & thread safe
+static const int capVFS_Delete = 1 << 6;
+static const int capVFS_Rename = 1 << 7;
+static const int capVFS_Execute = 1 << 8;
+static const int capVFS_Append = 1 << 9;
+
+// Error codes (TVFSResult)
+enum {
+ cVFS_OK = 0,
+ cVFS_Failed = 1, // also No such file
+ cVFS_Cancelled = 2,
+ cVFS_Not_Supported = 3,
+ cVFS_No_More_Files = 4,
+ cVFS_ReadErr = 5,
+ cVFS_WriteErr = 6, // also Readonly FileSystem
+ cVFS_LoginFailed = 7,
+ cVFS_PermissionDenied = 8,
+ cVFS_NoSpaceLeft = 9,
+ cVFS_mallocFailed = 10,
+ cVFS_BadPassword = 11,
+ cVFS_MissingVolume = 12,
+ cVFS_CorruptedArchive = 13
+};
+
+
+// Open modes
+enum {
+ cVFS_OpenRead,
+ cVFS_OpenWrite,
+ cVFS_OpenAppend
+};
+
+
+// Item Type enum
+enum TVFSItemType {
+ vRegular = 0,
+ vSymlink = 1,
+ vChardev = 2,
+ vBlockdev = 3,
+ vDirectory = 4,
+ vFifo = 5,
+ vSock = 6,
+ vOther = 7
+};
+
+
+struct TVFSItem {
+ char *sFileName;
+ u_int64_t iSize;
+ __time_t m_time; // numbers should be located before the other variables (bug?)
+ __time_t a_time;
+ __time_t c_time;
+ __mode_t iMode;
+ char *sLinkTo;
+ __uid_t iUID;
+ __gid_t iGID;
+ enum TVFSItemType ItemType;
+};
+
+struct TVFSInfo {
+ const char *Name;
+ const char *Description;
+ const char *About;
+ const char *Copyright;
+};
+
+
+#endif /* __VFS_TYPES_H__ */