aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2004-11-26 12:15:06 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2004-11-26 12:15:06 +0000
commitfb28c5ebe1efdc3e3b125aad1a19f1a240519345 (patch)
treecfe63db63bc515c36886dad956ee8c171167d496 /example
parent97de5118b5c240063f634e9fa41998dc72708b56 (diff)
API change
Diffstat (limited to 'example')
-rw-r--r--example/fusexmp.c21
-rw-r--r--example/hello.c8
-rw-r--r--example/null.c6
3 files changed, 21 insertions, 14 deletions
diff --git a/example/fusexmp.c b/example/fusexmp.c
index 02d0363..40af830 100644
--- a/example/fusexmp.c
+++ b/example/fusexmp.c
@@ -191,11 +191,11 @@ static int xmp_utime(const char *path, struct utimbuf *buf)
}
-static int xmp_open(const char *path, int flags)
+static int xmp_open(const char *path, struct fuse_file_info *fi)
{
int res;
- res = open(path, flags);
+ res = open(path, fi->flags);
if(res == -1)
return -errno;
@@ -203,11 +203,13 @@ static int xmp_open(const char *path, int flags)
return 0;
}
-static int xmp_read(const char *path, char *buf, size_t size, off_t offset)
+static int xmp_read(const char *path, char *buf, size_t size, off_t offset,
+ struct fuse_file_info *fi)
{
int fd;
int res;
+ (void) fi;
fd = open(path, O_RDONLY);
if(fd == -1)
return -errno;
@@ -221,11 +223,12 @@ static int xmp_read(const char *path, char *buf, size_t size, off_t offset)
}
static int xmp_write(const char *path, const char *buf, size_t size,
- off_t offset)
+ off_t offset, struct fuse_file_info *fi)
{
int fd;
int res;
+ (void) fi;
fd = open(path, O_WRONLY);
if(fd == -1)
return -errno;
@@ -249,23 +252,25 @@ static int xmp_statfs(const char *path, struct statfs *stbuf)
return 0;
}
-static int xmp_release(const char *path, int flags)
+static int xmp_release(const char *path, struct fuse_file_info *fi)
{
/* Just a stub. This method is optional and can safely be left
unimplemented */
-
+
(void) path;
- (void) flags;
+ (void) fi;
return 0;
}
-static int xmp_fsync(const char *path, int isdatasync)
+static int xmp_fsync(const char *path, int isdatasync,
+ struct fuse_file_info *fi)
{
/* Just a stub. This method is optional and can safely be left
unimplemented */
(void) path;
(void) isdatasync;
+ (void) fi;
return 0;
}
diff --git a/example/hello.c b/example/hello.c
index 5065fb7..75196ff 100644
--- a/example/hello.c
+++ b/example/hello.c
@@ -47,20 +47,22 @@ static int hello_getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler)
return 0;
}
-static int hello_open(const char *path, int flags)
+static int hello_open(const char *path, struct fuse_file_info *fi)
{
if(strcmp(path, hello_path) != 0)
return -ENOENT;
- if((flags & 3) != O_RDONLY)
+ if((fi->flags & 3) != O_RDONLY)
return -EACCES;
return 0;
}
-static int hello_read(const char *path, char *buf, size_t size, off_t offset)
+static int hello_read(const char *path, char *buf, size_t size, off_t offset,
+ struct fuse_file_info *fi)
{
size_t len;
+ (void) fi;
if(strcmp(path, hello_path) != 0)
return -ENOENT;
diff --git a/example/null.c b/example/null.c
index b854289..fd88a05 100644
--- a/example/null.c
+++ b/example/null.c
@@ -38,7 +38,7 @@ static int null_truncate(const char *path, off_t UNUSED(size))
return 0;
}
-static int null_open(const char *path, int UNUSED(flags))
+static int null_open(const char *path, struct fuse_file_info *UNUSED(fi))
{
if(strcmp(path, "/") != 0)
return -ENOENT;
@@ -47,7 +47,7 @@ static int null_open(const char *path, int UNUSED(flags))
}
static int null_read(const char *path, char *UNUSED(buf), size_t size,
- off_t UNUSED(offset))
+ off_t UNUSED(offset), struct fuse_file_info *UNUSED(fi))
{
if(strcmp(path, "/") != 0)
return -ENOENT;
@@ -56,7 +56,7 @@ static int null_read(const char *path, char *UNUSED(buf), size_t size,
}
static int null_write(const char *path, const char *UNUSED(buf), size_t size,
- off_t UNUSED(offset))
+ off_t UNUSED(offset), struct fuse_file_info *UNUSED(fi))
{
if(strcmp(path, "/") != 0)
return -ENOENT;