From 3f39c3230defc67d23cf078fcc16f376cd4c49f4 Mon Sep 17 00:00:00 2001 From: Derrik Pates Date: Wed, 18 May 2011 09:45:45 -0600 Subject: [PATCH] Add the fuse_version() static method. This is the basis of version checking required for later changes. --- Fuse.pm | 8 +++++++- Fuse.xs | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Fuse.pm b/Fuse.pm index 2352161..dbe77ba 100755 --- a/Fuse.pm +++ b/Fuse.pm @@ -21,7 +21,7 @@ our @ISA = qw(Exporter DynaLoader); # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK # will save memory. our %EXPORT_TAGS = ( - 'all' => [ qw(XATTR_CREATE XATTR_REPLACE fuse_get_context) ], + 'all' => [ qw(XATTR_CREATE XATTR_REPLACE fuse_get_context fuse_version) ], 'xattr' => [ qw(XATTR_CREATE XATTR_REPLACE) ] ); @@ -237,6 +237,12 @@ threads::shared.) Access context information about the current Fuse operation. +=head3 Fuse::fuse_version + +Indicates the Fuse version in use; more accurately, indicates the version +of the Fuse API in use at build time. Returned as a decimal value; i.e., +for Fuse API v2.6, will return "2.6". + =head2 FUNCTIONS YOUR FILESYSTEM MAY IMPLEMENT =head3 getattr diff --git a/Fuse.xs b/Fuse.xs index 440d603..b235f17 100755 --- a/Fuse.xs +++ b/Fuse.xs @@ -1053,6 +1053,13 @@ fuse_get_context() OUTPUT: RETVAL +SV * +fuse_version() + CODE: + RETVAL = newSVpvf("%d.%d", FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION); + OUTPUT: + RETVAL + void perl_fuse_main(...) PREINIT: -- 2.20.1