Add the fuse_version() static method. This is the basis of version
authorDerrik Pates <demon@now.ai>
Wed, 18 May 2011 15:45:45 +0000 (09:45 -0600)
committerDerrik Pates <demon@now.ai>
Wed, 18 May 2011 15:45:45 +0000 (09:45 -0600)
checking required for later changes.

Fuse.pm
Fuse.xs

diff --git a/Fuse.pm b/Fuse.pm
index 2352161..dbe77ba 100755 (executable)
--- 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 (executable)
--- 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: