aboutsummaryrefslogtreecommitdiffstats
path: root/lib/helper.c
diff options
context:
space:
mode:
authorBernd Schubert <bernd.schubert@fastmail.fm>2024-05-13 12:32:06 +0200
committerGitHub <noreply@github.com>2024-05-13 12:32:06 +0200
commit58f85bfa9b7dca9a216cd0bb4e38e9cdf4b661da (patch)
tree6b731982629b96315c70bca87280141e3240fcd7 /lib/helper.c
parent2bdec0bc22ce39b307e299ee9ec19d1c58b640de (diff)
downloadlibfuse-58f85bfa9b7dca9a216cd0bb4e38e9cdf4b661da.tar.gz
Add in the libfuse version a program was compiled with (#942)
The API stays the same, the libfuse version comes from inlined functions, which are defined fuse_lowlevel.h and fuse.h. As these inlined functions are defined in the header files they get added into the application, similar as if these were preprocessor macros. Macro vs inlined function is then just a style issue - I personally prefer the latter. fuse_session_new() -> static inlinei, in the application _fuse_session_new -> inside of libfuse fuse_new() -> static inline, in the application _fuse_new() -> inside of libfuse Note: Entirely untested is the fuse 30 api - we need a test for it. And we do not have any ABI tests at all. Signed-off-by: Bernd Schubert <bernd.schubert@fastmail.fm>
Diffstat (limited to 'lib/helper.c')
-rw-r--r--lib/helper.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/helper.c b/lib/helper.c
index 14a0df3..e84c857 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -304,8 +304,11 @@ int fuse_daemonize(int foreground)
return 0;
}
-int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op,
- size_t op_size, void *user_data)
+int fuse_main_real_317(int argc, char *argv[], const struct fuse_operations *op,
+ size_t op_size, struct libfuse_version *version, void *user_data);
+FUSE_SYMVER("fuse_main_real_317", "fuse_main_real@@FUSE_3.17")
+int fuse_main_real_317(int argc, char *argv[], const struct fuse_operations *op,
+ size_t op_size, struct libfuse_version *version, void *user_data)
{
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
struct fuse *fuse;
@@ -341,8 +344,7 @@ int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op,
goto out1;
}
-
- fuse = fuse_new_31(&args, op, op_size, user_data);
+ fuse = _fuse_new(&args, op, op_size, version, user_data);
if (fuse == NULL) {
res = 3;
goto out1;
@@ -394,6 +396,16 @@ out1:
return res;
}
+int fuse_main_real_30(int argc, char *argv[], const struct fuse_operations *op,
+ size_t op_size, void *user_data);
+FUSE_SYMVER("fuse_main_real_30", "fuse_main_real@FUSE_3.0")
+int fuse_main_real_30(int argc, char *argv[], const struct fuse_operations *op,
+ size_t op_size, void *user_data)
+{
+ struct libfuse_version version = { 0 };
+
+ return fuse_main_real_317(argc, argv, op, op_size, &version, user_data);
+}
void fuse_apply_conn_info_opts(struct fuse_conn_info_opts *opts,
struct fuse_conn_info *conn)