]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/xattr.h
fix #1938 about PATH_MAX on hurd
[bacula/bacula] / bacula / src / filed / xattr.h
index 16056165e72aaf11725b3742c62a301eaf36d651..cb1c68e45117d36c67e5b0895a765be9b346c450 100644 (file)
@@ -6,7 +6,7 @@
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
    Switzerland, email:ftf@fsfeurope.org.
 */
 
-#ifndef _BACULA_XATTR_
-#define _BACULA_XATTR_
+#ifndef __XATTR_H
+#define __XATTR_H
+
+#if defined(HAVE_LINUX_OS)
+#define BXATTR_ENOTSUP EOPNOTSUPP
+#elif defined(HAVE_DARWIN_OS)
+#define BXATTR_ENOTSUP ENOTSUP
+#endif
 
 /*
  * Magic used in the magic field of the xattr struct.
@@ -51,7 +57,34 @@ struct xattr_t {
  */
 struct xattr_link_cache_entry_t {
    uint32_t inum;
-   char target[PATH_MAX];
+   char *target;
+};
+
+#define BXATTR_FLAG_SAVE_NATIVE    0x01
+#define BXATTR_FLAG_RESTORE_NATIVE 0x02
+
+struct xattr_build_data_t {
+   uint32_t nr_errors;
+   uint32_t nr_saved;
+   POOLMEM *content;
+   uint32_t content_length;
+   alist *link_cache;
+};
+
+struct xattr_parse_data_t {
+   uint32_t nr_errors;
+};
+
+/*
+ * Internal tracking data.
+ */
+struct xattr_data_t {
+   uint32_t flags;              /* See BXATTR_FLAG_* */
+   uint32_t current_dev;
+   union {
+      struct xattr_build_data_t *build;
+      struct xattr_parse_data_t *parse;
+   } u;
 };
 
 /*
@@ -59,4 +92,9 @@ struct xattr_link_cache_entry_t {
  */
 #define MAX_XATTR_STREAM  (1 * 1024 * 1024) /* 1 Mb */
 
+/*
+ * Upperlimit on a xattr internal buffer
+ */
+#define XATTR_BUFSIZ   1024
+
 #endif