X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fatalk%2Fea.h;h=fbbafafabef4169cc746e72dc3afa2aad2905a91;hb=3a84db87064922ad10ac10cc1d6833380e575995;hp=c0165a1a257f210999055d8a271bc81dadf9e2a8;hpb=8ea9eaad323ec8ea180ffc277cd409d713a5895f;p=netatalk.git diff --git a/include/atalk/ea.h b/include/atalk/ea.h index c0165a1a..fbbafafa 100644 --- a/include/atalk/ea.h +++ b/include/atalk/ea.h @@ -1,5 +1,4 @@ /* - $Id: ea.h,v 1.11 2010-03-12 15:16:49 franklahm Exp $ Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify @@ -20,9 +19,31 @@ #include #endif +#if HAVE_ATTR_XATTR_H +#include +#elif HAVE_SYS_XATTR_H +#include +#endif + +#ifdef HAVE_SYS_EA_H +#include +#endif + +#ifdef HAVE_SYS_EXTATTR_H +#include +#endif + +/* FIXME: are the ACL includes really neccessary here ? */ #ifdef HAVE_SOLARIS_ACLS #include #endif +#ifdef HAVE_FREEBSD_SUNACL +#include +#endif + +#ifndef ENOATTR +#define ENOATTR ENODATA +#endif #include @@ -56,6 +77,28 @@ enum { #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ #endif +/* Names for our Extended Attributes adouble data */ +#define AD_EA_META "org.netatalk.Metadata" +#define AD_EA_RESO "org.netatalk.ResourceFork" +#define NOT_NETATALK_EA(a) (strcmp((a), AD_EA_META) != 0) && (strcmp((a), AD_EA_RESO) != 0) + +/**************************************************************************************** + * Wrappers for native EA functions taken from Samba + ****************************************************************************************/ +ssize_t sys_getxattr (const char *path, const char *name, void *value, size_t size); +ssize_t sys_lgetxattr (const char *path, const char *name, void *value, size_t size); +ssize_t sys_fgetxattr (int filedes, const char *name, void *value, size_t size); +ssize_t sys_listxattr (const char *path, char *list, size_t size); +ssize_t sys_llistxattr (const char *path, char *list, size_t size); +ssize_t sys_flistxattr (int filedes, char *list, size_t size); +int sys_removexattr (const char *path, const char *name); +int sys_lremovexattr (const char *path, const char *name); +int sys_fremovexattr (int filedes, const char *name); +int sys_setxattr (const char *path, const char *name, const void *value, size_t size, int flags); +int sys_lsetxattr (const char *path, const char *name, const void *value, size_t size, int flags); +int sys_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags); +int sys_copyxattr (const char *src, const char *dst); +int sys_getxattrfd(int fd, const char *uname, int oflag, ...); /**************************************************************************************** * Stuff for our implementation of storing EAs in files in .AppleDouble dirs