/*
- * $Id: adouble.h,v 1.47 2009-10-21 13:28:17 didg Exp $
+ * $Id: adouble.h,v 1.55 2010-03-30 12:55:26 franklahm Exp $
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
* netatalk@itd.umich.edu
*/
+/*!
+ * @file
+ * @brief Part of Netatalk's AppleDouble implementatation
+ */
+
#ifndef _ATALK_ADOUBLE_H
#define _ATALK_ADOUBLE_H
} adf_lock_t;
struct ad_fd {
- int adf_fd;
+ int adf_fd; /* -1: invalid, -2: symlink */
#ifndef HAVE_PREAD
off_t adf_off;
#endif
+ char *adf_syml;
int adf_flags;
int adf_excl;
adf_lock_t *adf_lock;
#define ADFLAGS_DF (1<<0)
#define ADFLAGS_HF (1<<1)
#define ADFLAGS_DIR (1<<2)
+/*
#define ADFLAGS_NOADOUBLE (1<<3)
+*/
#define ADFLAGS_V1COMPAT (1<<4)
#define ADFLAGS_NOHF (1<<5) /* not an error if no ressource fork */
#define ADFLAGS_RDONLY (1<<6) /* don't try readwrite */
/* adouble v2 cnid cache */
#define ADVOL_NODEV (1 << 0)
#define ADVOL_CACHE (1 << 1)
-/* adouble unix priv */
-#define ADVOL_UNIXPRIV (1 << 2)
-/* dot files (.DS_Store) are invisible) */
-#define ADVOL_INVDOTS (1 << 3)
+#define ADVOL_UNIXPRIV (1 << 2) /* adouble unix priv */
+#define ADVOL_INVDOTS (1 << 3) /* dot files (.DS_Store) are invisible) */
+#define ADVOL_NOADOUBLE (1 << 4)
/* lock flags */
#define ADLOCK_CLR (0)
extern int ad_mkdir (const char *, int);
extern void ad_init (struct adouble *, int, int );
extern int ad_open (const char *, int, int, int, struct adouble *);
+extern int ad_openat (int dirfd, const char *, int, int, int, struct adouble *);
extern int ad_refresh (struct adouble *);
extern int ad_stat (const char *, struct stat *);
extern int ad_metadata (const char *, int, struct adouble *);
+extern int ad_metadataat (int, const char *, int, struct adouble *);
#define ad_open_metadata(name, flags, mode, adp)\
ad_open(name, ADFLAGS_MD|(flags), O_RDWR |(mode), 0666, (adp))
return mode;
}
+/* ad_ea.c */
+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);
+
/* ad_read.c/ad_write.c */
extern int sys_ftruncate(int fd, off_t length);
+
extern ssize_t ad_read (struct adouble *, const u_int32_t,
const off_t, char *, const size_t);
extern ssize_t ad_pread (struct ad_fd *, void *, size_t, off_t);
#endif
#ifdef WITH_SENDFILE
-extern ssize_t ad_readfile (const struct adouble *, const int,
- const int, off_t, const size_t);
+extern int ad_readfile_init(const struct adouble *ad,
+ const int eid, off_t *off,
+ const int end);
#endif
#if 0