EtiennePerot/fuse-jna

fuse_get_context() wanted

Closed this issue · 2 comments

Hi!

First of all, thank you for fuse-jna. Saved me a lot of work, true.

For the project I'm working on I need access to the data provided by fuse_get_context(). But I was not able to find a way to get them! Even reading sources :)

So I made a simple patch attached below. I still think I've missed something and there must be a standard way to call fuse_get_context(), but just in case...

diff --git a/src/net/fusejna/Platform.java b/src/net/fusejna/Platform.java
index 33cae9f..2e2c91a 100644
--- a/src/net/fusejna/Platform.java
+++ b/src/net/fusejna/Platform.java
@@ -28,6 +28,14 @@ public final class Platform
        return libFuse;
    }

+   public static final StructFuseContext.ByReference fuse_get_context()
+   {
+       if (libFuse == null) {
+           init();
+       }
+       return libFuse.fuse_get_context();
+   }
+
    private static final void init()
    {
        if (libFuse != null) {

I'll look at that in a moment, thanks

I forgot that I had written StructFuseContext... Added some getter methods for it and usage example in 9dab949, thanks for the report.