From ea7227db439cc0e02a7ed69feae75fac6dfcc637 Mon Sep 17 00:00:00 2001 From: Joachim Schiele Date: Thu, 20 Jun 2013 19:18:18 +0200 Subject: - added a doxygen main page - modified all examples to be included in doxygen - modified the API documentation to have more details - added the 490px_FUSE_structure.svg.png (c) wikipedia --- example/hello.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) mode change 100644 => 100755 example/hello.c (limited to 'example/hello.c') diff --git a/example/hello.c b/example/hello.c old mode 100644 new mode 100755 index b31fbe5..c8b4a48 --- a/example/hello.c +++ b/example/hello.c @@ -4,10 +4,35 @@ This program can be distributed under the terms of the GNU GPL. See the file COPYING. - - gcc -Wall hello.c `pkg-config fuse --cflags --libs` -o hello */ +/** @file + * + * hello.c - minimal FUSE example featuring fuse_main usage + * +* \section section_compile compiling this example + * + * gcc -Wall hello.c `pkg-config fuse --cflags --libs` -o hello + * + * \section section_usage usage + \verbatim + % mkdir mnt + % ./hello mnt # program will vanish into the background + % ls -la mnt + total 4 + drwxr-xr-x 2 root root 0 Jan 1 1970 ./ + drwxrwx--- 1 root vboxsf 4096 Jun 16 23:12 ../ + -r--r--r-- 1 root root 13 Jan 1 1970 hello + % cat mnt/hello + Hello World! + % fusermount -u mnt + \endverbatim + * + * \section section_source the complete source + * \include hello.c + */ + + #define FUSE_USE_VERSION 30 #include @@ -83,6 +108,7 @@ static int hello_read(const char *path, char *buf, size_t size, off_t offset, return size; } +// fuse_operations hello_oper is redirecting function-calls to _our_ functions implemented above static struct fuse_operations hello_oper = { .getattr = hello_getattr, .readdir = hello_readdir, @@ -90,6 +116,7 @@ static struct fuse_operations hello_oper = { .read = hello_read, }; +// in the main function we call the blocking fuse_main(..) function with &hello_oper int main(int argc, char *argv[]) { return fuse_main(argc, argv, &hello_oper, NULL); -- cgit v1.2.3 From f4f87bba1266e6135e300ac6853efb9708aabce9 Mon Sep 17 00:00:00 2001 From: Joachim Schiele Date: Tue, 2 Jul 2013 17:37:29 +0200 Subject: rewrote c++ style comments to c style coments mentioned by Miklos Szeredi --- example/hello.c | 2 +- example/hello_ll.c | 6 +++--- lib/fuse_lowlevel.c | 0 lib/fuse_signals.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 lib/fuse_lowlevel.c mode change 100644 => 100755 lib/fuse_signals.c (limited to 'example/hello.c') diff --git a/example/hello.c b/example/hello.c index c8b4a48..580bff2 100755 --- a/example/hello.c +++ b/example/hello.c @@ -10,7 +10,7 @@ * * hello.c - minimal FUSE example featuring fuse_main usage * -* \section section_compile compiling this example + * \section section_compile compiling this example * * gcc -Wall hello.c `pkg-config fuse --cflags --libs` -o hello * diff --git a/example/hello_ll.c b/example/hello_ll.c index 687c6f1..06c881b 100755 --- a/example/hello_ll.c +++ b/example/hello_ll.c @@ -180,7 +180,7 @@ static struct fuse_lowlevel_ops hello_ll_oper = { .read = hello_ll_read, }; -//! [doxygen_fuse_lowlevel_usage] +/*! [doxygen_fuse_lowlevel_usage] */ int main(int argc, char *argv[]) { struct fuse_args args = FUSE_ARGS_INIT(argc, argv); @@ -197,7 +197,7 @@ int main(int argc, char *argv[]) if (fuse_set_signal_handlers(se) != -1) { fuse_session_add_chan(se, ch); - // fuse_session_loop(..) blocks until ctrl+c or fusermount -u + /* fuse_session_loop(..) blocks until ctrl+c or fusermount -u */ err = fuse_session_loop(se); fuse_remove_signal_handlers(se); @@ -211,4 +211,4 @@ int main(int argc, char *argv[]) return err ? 1 : 0; } -//! [doxygen_fuse_lowlevel_usage] +/*! [doxygen_fuse_lowlevel_usage] */ diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c old mode 100644 new mode 100755 diff --git a/lib/fuse_signals.c b/lib/fuse_signals.c old mode 100644 new mode 100755 index cab9951..8cdc17d --- a/lib/fuse_signals.c +++ b/lib/fuse_signals.c @@ -14,14 +14,14 @@ static struct fuse_session *fuse_instance; -//! [doxygen_exit_handler] +/*! [doxygen_exit_handler] */ static void exit_handler(int sig) { (void) sig; if (fuse_instance) fuse_session_exit(fuse_instance); } -//! [doxygen_exit_handler] +/*! [doxygen_exit_handler] */ static int set_one_signal_handler(int sig, void (*handler)(int)) { -- cgit v1.2.3