1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
/* Tux Commander VFS: Virtual File System types and definitions
* - prototypes functions and types
* draft version 5
*
* Copyright (C) 2003 Radek Cervinka <radek.cervinka@centrum.cz>
* Copyright (C) 2008-2009 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__
#ifdef __cplusplus
extern "C" {
#endif
#include <glib.h>
typedef int TVFSResult;
/* Compatible with gio/GAskPasswordFlags */
typedef enum {
VFS_ASK_PASSWORD_NEED_PASSWORD = 1<<0,
VFS_ASK_PASSWORD_NEED_USERNAME = 1<<1,
VFS_ASK_PASSWORD_NEED_DOMAIN = 1<<2,
VFS_ASK_PASSWORD_SAVING_SUPPORTED = 1<<3,
VFS_ASK_PASSWORD_ANONYMOUS_SUPPORTED = 1<<4,
VFS_ASK_PASSWORD_SAVE_INTERNAL = 1<<14,
VFS_ASK_PASSWORD_ARCHIVE_MODE = 1<<15
} TVFSAskPasswordFlags;
/* Compatible with gio/GPasswordSave */
typedef enum {
VFS_PASSWORD_SAVE_NEVER,
VFS_PASSWORD_SAVE_FOR_SESSION,
VFS_PASSWORD_SAVE_PERMANENTLY
} TVFSPasswordSave;
typedef void (* TVFSLogFunc) (const char *s);
typedef void * TVFSFileDes;
/* Return FALSE to break the operation */
typedef gboolean (* TVFSProgressCallback)
(guint64 position,
guint64 max,
void *user_data);
/* Return index of the choice selected or negative number when dialog has been cancelled */
typedef void (* TVFSAskQuestionCallback)
(const char *message,
const char **choices,
int *choice,
int cancel_choice,
void *user_data);
typedef gboolean (* TVFSAskPasswordCallback)
(const char *message,
const char *default_user,
const char *default_domain,
const char *default_password,
TVFSAskPasswordFlags flags,
char **username,
char **password,
gboolean *anonymous,
char **domain,
TVFSPasswordSave *password_save,
void *user_data);
/* current version of the VFS API */
static const int cVFSVersion = 5;
/* 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
};
enum TVFSItemType {
vRegular = 0,
vChardev = 1,
vBlockdev = 2,
vDirectory = 3,
vFifo = 4,
vSock = 5,
vOther = 6
};
struct TVFSItem {
char *FName;
char *FDisplayName; /* valid UTF-8 string */
guint64 iSize;
gint64 iPackedSize; /* set to -1 if plugin doesn't support this feature */
guint64 inode_no; /* return 0 if not supported */
guint32 m_time;
guint32 a_time;
guint32 c_time;
guint32 iMode;
gboolean IsLink;
char *sLinkTo;
guint32 iUID;
guint32 iGID;
enum TVFSItemType ItemType;
};
struct TVFSInfo {
char *ID; /* unique identifier, not shown in GUI */
char *Name; /* plugin name, GUI string (UTF-8) */
char *About; /* GUI string (UTF-8) */
char *Copyright; /* GUI string (UTF-8) */
};
#ifdef __cplusplus
}
#endif
#endif /* __VFS_TYPES_H__ */
|