summaryrefslogtreecommitdiff
path: root/libfusepp/fuseAppBase.cpp
blob: 49f2d6b97e78dafd773b482129a8a0503b86071f (plain)
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
#include "fuseAppBase.h"
#include <errno.h>
#include <assert.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <typeinfo>

FuseAppBase * FuseAppBase::fuseApp;

FuseAppBase::FuseAppBase()
{
}
FuseAppBase::~FuseAppBase()
{
}
void * FuseAppBase::init(fuse_conn_info*)
{
	return NULL;
}
int FuseAppBase::opt_parse(void*, const char *, int, fuse_args*)
{
	return 1;
}
int FuseAppBase::access(const char *, int)
{
	return -ENOSYS;
}
int FuseAppBase::chmod(const char *, mode_t)
{
	return -ENOSYS;
}
int FuseAppBase::chown(const char *, uid_t, gid_t)
{
	return -ENOSYS;
}
int FuseAppBase::create(const char *, mode_t, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::fgetattr(const char *, struct stat *, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::flush(const char *, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::fsync(const char *, int, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::fsyncdir(const char *, int, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::ftruncate(const char *, off_t, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::getattr(const char *, struct stat *)
{
	return -ENOSYS;
}
int FuseAppBase::getxattr(const char *, const char *, char *, size_t)
{
	return -ENOSYS;
}
int FuseAppBase::link(const char *, const char *)
{
	return -ENOSYS;
}
int FuseAppBase::listxattr(const char *, char *, size_t)
{
	return -ENOSYS;
}
int FuseAppBase::mkdir(const char *, mode_t)
{
	return -ENOSYS;
}
int FuseAppBase::mknod(const char *, mode_t, dev_t)
{
	return -ENOSYS;
}
int FuseAppBase::open(const char *, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::opendir(const char *, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::read(const char *, char *, size_t, off_t, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::readdir(const char *, void *, fuse_fill_dir_t, off_t, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::readlink(const char *, char *, size_t)
{
	return -ENOSYS;
}
int FuseAppBase::release(const char *, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::releasedir(const char *, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::removexattr(const char *, const char *)
{
	return -ENOSYS;
}
int FuseAppBase::rename(const char *, const char *)
{
	return -ENOSYS;
}
int FuseAppBase::rmdir(const char *)
{
	return -ENOSYS;
}
int FuseAppBase::setxattr(const char *, const char *, const char *, size_t, int)
{
	return -ENOSYS;
}
int FuseAppBase::statfs(const char *, struct statvfs *)
{
	return -ENOSYS;
}
int FuseAppBase::symlink(const char *, const char *)
{
	return -ENOSYS;
}
int FuseAppBase::truncate(const char *, off_t)
{
	return -ENOSYS;
}
int FuseAppBase::unlink(const char *)
{
	return -ENOSYS;
}
int FuseAppBase::write(const char *, const char *, size_t, off_t, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::lock(const char *, struct fuse_file_info *, int, struct flock *)
{
	return -ENOSYS;
}
int FuseAppBase::utimens(const char *, const struct timespec[2])
{
	return -ENOSYS;
}
int FuseAppBase::bmap(const char *, size_t, uint64_t *)
{
	return -ENOSYS;
}
int FuseAppBase::ioctl(const char *, int, void *, struct fuse_file_info *, unsigned int, void *)
{
	return -ENOSYS;
}
int FuseAppBase::poll(const char *, struct fuse_file_info *, struct fuse_pollhandle *, unsigned *)
{
	return -ENOSYS;
}
int FuseAppBase::write_buf(const char *, struct fuse_bufvec *, off_t, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::read_buf(const char *, struct fuse_bufvec **, size_t, off_t, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::flock(const char *, struct fuse_file_info *, int)
{
	return -ENOSYS;
}
int FuseAppBase::fallocate(const char *, int, off_t, off_t, struct fuse_file_info *)
{
	return -ENOSYS;
}
int FuseAppBase::onError(const std::exception & e) throw()
{
	fprintf(stderr, "Unknown exception (what: %s)\n", e.what());
	return -ENOSYS;
}

void * FuseAppBase::fuseInit (struct fuse_conn_info *conn)
{
	return fuseApp->init(conn);
}
void FuseAppBase::fuseDestroy(void *)
{
	delete fuseApp;
}

struct fuse_args
FuseAppBase::runint(int argc, char ** argv)
{
	struct fuse_opt fuse_opts[] = {
		{ NULL, 0, 0 }
	};
	fuseApp = this;
	struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
	if (fuse_opt_parse(&args, fuseApp, fuse_opts,
			fuseCall<void *, const char *, int, struct fuse_args *>::helper<&FuseAppBase::opt_parse>) == -1) {
		exit(1);
	}
	return args;
}