#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
+
#include <sys/mman.h>
+
#include <sys/time.h>
-#include <netatalk/endian.h>
#include <atalk/bstrlib.h>
+#include <atalk/locking.h>
/* version info */
#define AD_VERSION2 0x00020000
#define RFORK_EA_ALLOCSIZE (128*1024) /* 128k */
-typedef u_int32_t cnid_t;
+typedef uint32_t cnid_t;
struct ad_entry {
uint32_t ade_off;
};
struct adouble {
- u_int32_t ad_magic; /* Official adouble magic */
- u_int32_t ad_version; /* Official adouble version number */
+ uint32_t ad_magic; /* Official adouble magic */
+ uint32_t ad_version; /* Official adouble version number */
char ad_filler[16];
struct ad_entry ad_eid[ADEID_MAX];
struct ad_fd ad_data_fork; /* the data fork */
extern int ad_close (struct adouble *, int);
/* ad_lock.c */
-extern int ad_fcntl_lock (struct adouble *, const u_int32_t /*eid*/,
- const int /*type*/, const off_t /*offset*/,
- const off_t /*len*/, const int /*user*/);
-extern void ad_fcntl_unlock (struct adouble *, const int /*user*/);
-extern int ad_fcntl_tmplock (struct adouble *, const u_int32_t /*eid*/,
- const int /*type*/, const off_t /*offset*/,
- const off_t /*len*/, const int /*user*/);
-extern int ad_testlock (struct adouble * /*adp*/, int /*eid*/, off_t /*off*/);
-
-extern u_int16_t ad_openforks (struct adouble * /*adp*/, u_int16_t);
-extern int ad_excl_lock (struct adouble * /*adp*/, const u_int32_t /*eid*/);
-
-#define ad_lock ad_fcntl_lock
-#define ad_tmplock ad_fcntl_tmplock
-#define ad_unlock ad_fcntl_unlock
+extern int ad_testlock (struct adouble *adp, int eid, off_t off);
+extern uint16_t ad_openforks(struct adouble *adp, uint16_t);
+extern int ad_excl_lock (struct adouble *adp, uint32_t eid);
+
+extern int ad_lock(struct adouble *, uint32_t eid, int type, off_t off, off_t len, int user);
+extern void ad_unlock(struct adouble *, int user);
+extern int ad_tmplock(struct adouble *, uint32_t eid, int type, off_t off, off_t len, int user);
/* ad_open.c */
extern const char *oflags2logstr(int oflags);
extern int ad_getattr(const struct adouble *, uint16_t *);
extern int ad_setname(struct adouble *, const char *);
extern int ad_setid(struct adouble *, dev_t dev, ino_t ino, uint32_t, uint32_t, const void *);
-extern u_int32_t ad_getid(struct adouble *, dev_t, ino_t, cnid_t, const void *);
-extern u_int32_t ad_forcegetid(struct adouble *adp);
+extern uint32_t ad_getid(struct adouble *, dev_t, ino_t, cnid_t, const void *);
+extern uint32_t ad_forcegetid(struct adouble *adp);
#ifdef WITH_SENDFILE
extern int ad_readfile_init(const struct adouble *ad, int eid, off_t *off, int end);