libadouble_la_SOURCES = ad_open.c ad_flush.c ad_read.c ad_write.c ad_size.c \
ad_mmap.c ad_lock.c ad_date.c ad_attr.c ad_sendfile.c
-noinst_HEADERS = ad_private.h
+noinst_HEADERS = ad_lock.h
#include <string.h>
-#include "ad_private.h"
+#include "ad_lock.h"
/* translate between ADLOCK styles and specific locking mechanisms */
#define XLATE_FLOCK(type) ((type) == ADLOCK_RD ? LOCK_SH : \
--- /dev/null
+#ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H
+#define LIBATALK_ADOUBLE_AD_PRIVATE_H 1
+
+#include <atalk/adouble.h>
+
+/* this is so that we can keep lists of fds referencing the same file
+ * around. that way, we can honor locks created by the same process
+ * with the same file. */
+
+#define adf_lock_init(a) \
+ do { \
+ (a)->adf_lockmax = (a)->adf_lockcount = 0; \
+ (a)->adf_excl = 0;(a)->adf_lock = NULL; \
+ } while (0)
+
+#define adf_lock_free(a) \
+ do { \
+ int i; \
+ if ((a)->adf_lock != NULL) { \
+ for (i = 0; i < (a)->adf_lockcount; i++) { \
+ adf_lock_t *lock = (a)->adf_lock + i; \
+ if (--(*lock->refcount) < 1) \
+ free(lock->refcount); \
+ } \
+ free((a)->adf_lock); \
+ adf_lock_init(a); \
+ } \
+ } while (0)
+
+#endif /* libatalk/adouble/ad_private.h */
/*
- * $Id: ad_mmap.c,v 1.6 2008-12-03 18:35:44 didg Exp $
- *
* ad_mmap provides interfaces to memory mapped files. as this is the
* case, we don't have to deal w/ temporary buffers such as
* ad_data. the ad_mmap routines are designed to not interact w/ the
#include <atalk/adouble.h>
#include <string.h>
-#include "ad_private.h"
+#include "ad_lock.h"
static void *ad_mmap(const size_t length, const int prot,
const int flags, const int fd,
#include <atalk/bstrlib.h>
#include <atalk/bstradd.h>
-#include "ad_private.h"
+#include "ad_lock.h"
#ifndef MAX
#define MAX(a, b) ((a) < (b) ? (b) : (a))
+++ /dev/null
-#ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H
-#define LIBATALK_ADOUBLE_AD_PRIVATE_H 1
-
-#include <atalk/adouble.h>
-
-/* this is so that we can keep lists of fds referencing the same file
- * around. that way, we can honor locks created by the same process
- * with the same file. */
-
-#define adf_lock_init(a) \
- do { \
- (a)->adf_lockmax = (a)->adf_lockcount = 0; \
- (a)->adf_excl = 0;(a)->adf_lock = NULL; \
- } while (0)
-
-#define adf_lock_free(a) \
- do { \
- int i; \
- if ((a)->adf_lock != NULL) { \
- for (i = 0; i < (a)->adf_lockcount; i++) { \
- adf_lock_t *lock = (a)->adf_lock + i; \
- if (--(*lock->refcount) < 1) \
- free(lock->refcount); \
- } \
- free((a)->adf_lock); \
- adf_lock_init(a); \
- } \
- } while (0)
-
-#endif /* libatalk/adouble/ad_private.h */
/*
- * $Id: ad_sendfile.c,v 1.11 2010-01-21 14:14:49 didg Exp $
- *
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
*
#endif /* HAVE_CONFIG_H */
#ifdef WITH_SENDFILE
-
-#include <atalk/adouble.h>
-
#include <stdio.h>
-
#include <sys/socket.h>
#include <sys/uio.h>
-
#include <errno.h>
+#include <atalk/adouble.h>
#include <atalk/logger.h>
-#include "ad_private.h"
+
+#include "ad_lock.h"
#if defined(LINUX_BROKEN_SENDFILE_API)