Rename functions to avoid name clashes
This commit is contained in:
parent
d38480b234
commit
560d304fb8
@ -13,185 +13,185 @@ using namespace fusepp;
|
|||||||
#define FUSE_OBJ ((Fuse *) fuse_get_context()->private_data)
|
#define FUSE_OBJ ((Fuse *) fuse_get_context()->private_data)
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
int getattr(const char *path, struct stat *stbuf) {
|
int fusepp_getattr(const char *path, struct stat *stbuf) {
|
||||||
return FUSE_OBJ->getattr(bf::path(path), stbuf);
|
return FUSE_OBJ->getattr(bf::path(path), stbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
int fgetattr(const char *path, struct stat *stbuf, fuse_file_info *fileinfo) {
|
int fusepp_fgetattr(const char *path, struct stat *stbuf, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->fgetattr(bf::path(path), stbuf, fileinfo);
|
return FUSE_OBJ->fgetattr(bf::path(path), stbuf, fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int readlink(const char *path, char *buf, size_t size) {
|
int fusepp_readlink(const char *path, char *buf, size_t size) {
|
||||||
return FUSE_OBJ->readlink(bf::path(path), buf, size);
|
return FUSE_OBJ->readlink(bf::path(path), buf, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mknod(const char *path, mode_t mode, dev_t rdev) {
|
int fusepp_mknod(const char *path, mode_t mode, dev_t rdev) {
|
||||||
return FUSE_OBJ->mknod(bf::path(path), mode, rdev);
|
return FUSE_OBJ->mknod(bf::path(path), mode, rdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mkdir(const char *path, mode_t mode) {
|
int fusepp_mkdir(const char *path, mode_t mode) {
|
||||||
return FUSE_OBJ->mkdir(bf::path(path), mode);
|
return FUSE_OBJ->mkdir(bf::path(path), mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
int unlink(const char *path) {
|
int fusepp_unlink(const char *path) {
|
||||||
return FUSE_OBJ->unlink(bf::path(path));
|
return FUSE_OBJ->unlink(bf::path(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
int rmdir(const char *path) {
|
int fusepp_rmdir(const char *path) {
|
||||||
return FUSE_OBJ->rmdir(bf::path(path));
|
return FUSE_OBJ->rmdir(bf::path(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
int symlink(const char *from, const char *to) {
|
int fusepp_symlink(const char *from, const char *to) {
|
||||||
return FUSE_OBJ->symlink(bf::path(from), bf::path(to));
|
return FUSE_OBJ->symlink(bf::path(from), bf::path(to));
|
||||||
}
|
}
|
||||||
|
|
||||||
int rename(const char *from, const char *to) {
|
int fusepp_rename(const char *from, const char *to) {
|
||||||
return FUSE_OBJ->rename(bf::path(from), bf::path(to));
|
return FUSE_OBJ->rename(bf::path(from), bf::path(to));
|
||||||
}
|
}
|
||||||
|
|
||||||
int link(const char *from, const char *to) {
|
int fusepp_link(const char *from, const char *to) {
|
||||||
return FUSE_OBJ->link(bf::path(from), bf::path(to));
|
return FUSE_OBJ->link(bf::path(from), bf::path(to));
|
||||||
}
|
}
|
||||||
|
|
||||||
int chmod(const char *path, mode_t mode) {
|
int fusepp_chmod(const char *path, mode_t mode) {
|
||||||
return FUSE_OBJ->chmod(bf::path(path), mode);
|
return FUSE_OBJ->chmod(bf::path(path), mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
int chown(const char *path, uid_t uid, gid_t gid) {
|
int fusepp_chown(const char *path, uid_t uid, gid_t gid) {
|
||||||
return FUSE_OBJ->chown(bf::path(path), uid, gid);
|
return FUSE_OBJ->chown(bf::path(path), uid, gid);
|
||||||
}
|
}
|
||||||
|
|
||||||
int truncate(const char *path, off_t size) {
|
int fusepp_truncate(const char *path, off_t size) {
|
||||||
return FUSE_OBJ->truncate(bf::path(path), size);
|
return FUSE_OBJ->truncate(bf::path(path), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ftruncate(const char *path, off_t size, fuse_file_info *fileinfo) {
|
int fusepp_ftruncate(const char *path, off_t size, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->ftruncate(bf::path(path), size, fileinfo);
|
return FUSE_OBJ->ftruncate(bf::path(path), size, fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int utimens(const char *path, const timespec times[2]) {
|
int fusepp_utimens(const char *path, const timespec times[2]) {
|
||||||
return FUSE_OBJ->utimens(bf::path(path), times);
|
return FUSE_OBJ->utimens(bf::path(path), times);
|
||||||
}
|
}
|
||||||
|
|
||||||
int open(const char *path, fuse_file_info *fileinfo) {
|
int fusepp_open(const char *path, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->open(bf::path(path), fileinfo);
|
return FUSE_OBJ->open(bf::path(path), fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int release(const char *path, fuse_file_info *fileinfo) {
|
int fusepp_release(const char *path, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->release(bf::path(path), fileinfo);
|
return FUSE_OBJ->release(bf::path(path), fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int read(const char *path, char *buf, size_t size, off_t offset, fuse_file_info *fileinfo) {
|
int fusepp_read(const char *path, char *buf, size_t size, off_t offset, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->read(bf::path(path), buf, size, offset, fileinfo);
|
return FUSE_OBJ->read(bf::path(path), buf, size, offset, fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int write(const char *path, const char *buf, size_t size, off_t offset, fuse_file_info *fileinfo) {
|
int fusepp_write(const char *path, const char *buf, size_t size, off_t offset, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->write(bf::path(path), buf, size, offset, fileinfo);
|
return FUSE_OBJ->write(bf::path(path), buf, size, offset, fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int statfs(const char *path, struct statvfs *fsstat) {
|
int fusepp_statfs(const char *path, struct statvfs *fsstat) {
|
||||||
return FUSE_OBJ->statfs(bf::path(path), fsstat);
|
return FUSE_OBJ->statfs(bf::path(path), fsstat);
|
||||||
}
|
}
|
||||||
|
|
||||||
int flush(const char *path, fuse_file_info *fileinfo) {
|
int fusepp_flush(const char *path, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->flush(bf::path(path), fileinfo);
|
return FUSE_OBJ->flush(bf::path(path), fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int fsync(const char *path, int flags, fuse_file_info *fileinfo) {
|
int fusepp_fsync(const char *path, int flags, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->fsync(bf::path(path), flags, fileinfo);
|
return FUSE_OBJ->fsync(bf::path(path), flags, fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
//int setxattr(const char*, const char*, const char*, size_t, int)
|
//int fusepp_setxattr(const char*, const char*, const char*, size_t, int)
|
||||||
//int getxattr(const char*, const char*, char*, size_t)
|
//int fusepp_getxattr(const char*, const char*, char*, size_t)
|
||||||
//int listxattr(const char*, char*, size_t)
|
//int fusepp_listxattr(const char*, char*, size_t)
|
||||||
//int removexattr(const char*, const char*)
|
//int fusepp_removexattr(const char*, const char*)
|
||||||
|
|
||||||
int opendir(const char *path, fuse_file_info *fileinfo) {
|
int fusepp_opendir(const char *path, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->opendir(bf::path(path), fileinfo);
|
return FUSE_OBJ->opendir(bf::path(path), fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, fuse_file_info *fileinfo) {
|
int fusepp_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->readdir(bf::path(path), buf, filler, offset, fileinfo);
|
return FUSE_OBJ->readdir(bf::path(path), buf, filler, offset, fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int releasedir(const char *path, fuse_file_info *fileinfo) {
|
int fusepp_releasedir(const char *path, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->releasedir(bf::path(path), fileinfo);
|
return FUSE_OBJ->releasedir(bf::path(path), fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
int fsyncdir(const char *path, int datasync, fuse_file_info *fileinfo) {
|
int fusepp_fsyncdir(const char *path, int datasync, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->fsyncdir(bf::path(path), datasync, fileinfo);
|
return FUSE_OBJ->fsyncdir(bf::path(path), datasync, fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* init(fuse_conn_info *conn) {
|
void* fusepp_init(fuse_conn_info *conn) {
|
||||||
auto f = FUSE_OBJ;
|
auto f = FUSE_OBJ;
|
||||||
f->init(conn);
|
f->init(conn);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void destroy(void *userdata) {
|
void fusepp_destroy(void *userdata) {
|
||||||
auto f = FUSE_OBJ;
|
auto f = FUSE_OBJ;
|
||||||
assert(userdata == f);
|
assert(userdata == f);
|
||||||
f->destroy();
|
f->destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
int access(const char *path, int mask) {
|
int fusepp_access(const char *path, int mask) {
|
||||||
return FUSE_OBJ->access(bf::path(path), mask);
|
return FUSE_OBJ->access(bf::path(path), mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
int create(const char *path, mode_t mode, fuse_file_info *fileinfo) {
|
int fusepp_create(const char *path, mode_t mode, fuse_file_info *fileinfo) {
|
||||||
return FUSE_OBJ->create(bf::path(path), mode, fileinfo);
|
return FUSE_OBJ->create(bf::path(path), mode, fileinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*int lock(const char*, fuse_file_info*, int cmd, flock*)
|
/*int fusepp_lock(const char*, fuse_file_info*, int cmd, flock*)
|
||||||
int bmap(const char*, size_t blocksize, uint64_t *idx)
|
int fusepp_bmap(const char*, size_t blocksize, uint64_t *idx)
|
||||||
int ioctl(const char*, int cmd, void *arg, fuse_file_info*, unsigned int flags, void *data)
|
int fusepp_ioctl(const char*, int cmd, void *arg, fuse_file_info*, unsigned int flags, void *data)
|
||||||
int poll(const char*, fuse_file_info*, fuse_pollhandle *ph, unsigned *reventsp)
|
int fusepp_poll(const char*, fuse_file_info*, fuse_pollhandle *ph, unsigned *reventsp)
|
||||||
int write_buf(const char*, fuse_bufvec *buf, off_t off, fuse_file_info*)
|
int fusepp_write_buf(const char*, fuse_bufvec *buf, off_t off, fuse_file_info*)
|
||||||
int read_buf(const chas*, struct fuse_bufvec **bufp, size_t size, off_T off, fuse_file_info*)
|
int fusepp_read_buf(const chas*, struct fuse_bufvec **bufp, size_t size, off_T off, fuse_file_info*)
|
||||||
int flock(const char*, fuse_file_info*, int op)
|
int fusepp_flock(const char*, fuse_file_info*, int op)
|
||||||
int fallocate(const char*, int, off_t, off_t, fuse_file_info*)*/
|
int fusepp_fallocate(const char*, int, off_t, off_t, fuse_file_info*)*/
|
||||||
|
|
||||||
fuse_operations *operations() {
|
fuse_operations *operations() {
|
||||||
static unique_ptr<fuse_operations> singleton(nullptr);
|
static unique_ptr<fuse_operations> singleton(nullptr);
|
||||||
|
|
||||||
if (!singleton) {
|
if (!singleton) {
|
||||||
singleton = make_unique<fuse_operations>();
|
singleton = make_unique<fuse_operations>();
|
||||||
singleton->getattr = &getattr;
|
singleton->getattr = &fusepp_getattr;
|
||||||
singleton->fgetattr = &fgetattr;
|
singleton->fgetattr = &fusepp_fgetattr;
|
||||||
singleton->readlink = &readlink;
|
singleton->readlink = &fusepp_readlink;
|
||||||
singleton->mknod = &mknod;
|
singleton->mknod = &fusepp_mknod;
|
||||||
singleton->mkdir = &mkdir;
|
singleton->mkdir = &fusepp_mkdir;
|
||||||
singleton->unlink = &unlink;
|
singleton->unlink = &fusepp_unlink;
|
||||||
singleton->rmdir = &rmdir;
|
singleton->rmdir = &fusepp_rmdir;
|
||||||
singleton->symlink = &symlink;
|
singleton->symlink = &fusepp_symlink;
|
||||||
singleton->rename = &rename;
|
singleton->rename = &fusepp_rename;
|
||||||
singleton->link = &link;
|
singleton->link = &fusepp_link;
|
||||||
singleton->chmod = &chmod;
|
singleton->chmod = &fusepp_chmod;
|
||||||
singleton->chown = &chown;
|
singleton->chown = &fusepp_chown;
|
||||||
singleton->truncate = &truncate;
|
singleton->truncate = &fusepp_truncate;
|
||||||
singleton->utimens = &utimens;
|
singleton->utimens = &fusepp_utimens;
|
||||||
singleton->open = &open;
|
singleton->open = &fusepp_open;
|
||||||
singleton->read = &read;
|
singleton->read = &fusepp_read;
|
||||||
singleton->write = &write;
|
singleton->write = &fusepp_write;
|
||||||
singleton->statfs = &statfs;
|
singleton->statfs = &fusepp_statfs;
|
||||||
singleton->flush = &flush;
|
singleton->flush = &fusepp_flush;
|
||||||
singleton->release = &release;
|
singleton->release = &fusepp_release;
|
||||||
singleton->fsync = &fsync;
|
singleton->fsync = &fusepp_fsync;
|
||||||
/*#ifdef HAVE_SYS_XATTR_H
|
/*#ifdef HAVE_SYS_XATTR_H
|
||||||
singleton->setxattr = &setxattr;
|
singleton->setxattr = &fusepp_setxattr;
|
||||||
singleton->getxattr = &getxattr;
|
singleton->getxattr = &fusepp_getxattr;
|
||||||
singleton->listxattr = &listxattr;
|
singleton->listxattr = &fusepp_listxattr;
|
||||||
singleton->removexattr = &removexattr;
|
singleton->removexattr = &fusepp_removexattr;
|
||||||
#endif*/
|
#endif*/
|
||||||
singleton->opendir = &opendir;
|
singleton->opendir = &fusepp_opendir;
|
||||||
singleton->readdir = &readdir;
|
singleton->readdir = &fusepp_readdir;
|
||||||
singleton->releasedir = &releasedir;
|
singleton->releasedir = &fusepp_releasedir;
|
||||||
singleton->fsyncdir = &fsyncdir;
|
singleton->fsyncdir = &fusepp_fsyncdir;
|
||||||
singleton->init = &init;
|
singleton->init = &fusepp_init;
|
||||||
singleton->destroy = &destroy;
|
singleton->destroy = &fusepp_destroy;
|
||||||
singleton->access = &access;
|
singleton->access = &fusepp_access;
|
||||||
singleton->create = &create;
|
singleton->create = &fusepp_create;
|
||||||
singleton->ftruncate = &ftruncate;
|
singleton->ftruncate = &fusepp_ftruncate;
|
||||||
}
|
}
|
||||||
|
|
||||||
return singleton.get();
|
return singleton.get();
|
||||||
|
Loading…
Reference in New Issue
Block a user