Move XATTR_{CREATE,REPLACE} into the XS code, so we can get the
authorDerrik Pates <demon@now.ai>
Thu, 19 May 2011 15:08:48 +0000 (09:08 -0600)
committerDerrik Pates <demon@now.ai>
Thu, 19 May 2011 15:08:48 +0000 (09:08 -0600)
definitions of the constants from sys/xattr.h instead of setting them
to arbitrary platform-specific constant values.

Fuse.pm
Fuse.xs

diff --git a/Fuse.pm b/Fuse.pm
index 1d83039..f8200e8 100755 (executable)
--- a/Fuse.pm
+++ b/Fuse.pm
@@ -62,16 +62,6 @@ sub AUTOLOAD {
     goto &$AUTOLOAD;
 }
 
-sub XATTR_CREATE {
-    # See <sys/xattr.h>.
-    return 1;
-}
-
-sub XATTR_REPLACE {
-    # See <sys/xattr.h>.
-    return 2;
-}
-
 bootstrap Fuse $VERSION;
 
 sub main {
diff --git a/Fuse.xs b/Fuse.xs
index cb24269..8f448a8 100755 (executable)
--- a/Fuse.xs
+++ b/Fuse.xs
@@ -3,6 +3,7 @@
 #include "perl.h"
 #include "XSUB.h"
 
+#include <sys/xattr.h>
 #include <fuse.h>
 
 /* Determine if threads support should be included */
@@ -1575,6 +1576,20 @@ fuse_version()
        OUTPUT:
        RETVAL
 
+SV *
+XATTR_CREATE()
+       CODE:
+       RETVAL = newSViv(XATTR_CREATE);
+       OUTPUT:
+       RETVAL
+
+SV *
+XATTR_REPLACE()
+       CODE:
+       RETVAL = newSViv(XATTR_REPLACE);
+       OUTPUT:
+       RETVAL
+
 void
 perl_fuse_main(...)
        PREINIT: