]> gitweb.michael.orlitzky.com - apply-default-acl.git/blobdiff - src/libadacl.h
Split most functions off into a separate shared library.
[apply-default-acl.git] / src / libadacl.h
diff --git a/src/libadacl.h b/src/libadacl.h
new file mode 100644 (file)
index 0000000..d2c9785
--- /dev/null
@@ -0,0 +1,25 @@
+/**
+ * @file libadacl.h
+ *
+ * @brief The public API for libadacl.
+ *
+ */
+
+/* Most of the libacl functions return 1 for success, 0 for failure,
+   and -1 on error */
+#define ACL_ERROR -1
+#define ACL_FAILURE 0
+#define ACL_SUCCESS 1
+
+/* Even though most other library functions reliably return -1 for
+ * error, it feels a little wrong to re-use the ACL_ERROR constant.
+ */
+#define CLOSE_ERROR -1
+#define NFTW_ERROR -1
+#define OPEN_ERROR -1
+#define SNPRINTF_ERROR -1
+#define STAT_ERROR -1
+
+int apply_default_acl(const char* path,
+                     const struct stat* sp,
+                     bool no_exec_mask);