2 * $Id: ad_private.h,v 1.5 2003-01-31 11:26:36 didg Exp $
5 #ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H
6 #define LIBATALK_ADOUBLE_AD_PRIVATE_H 1
8 #include <atalk/adouble.h>
11 #define MAP_FAILED ((void *) -1)
12 #endif /* ! MAP_FAILED */
16 #endif /* ! __inline__ */
18 /* this is so that we can keep lists of fds referencing the same file
19 * around. that way, we can honor locks created by the same process
20 * with the same file. */
22 #define adf_lock_init(a) do { \
23 (a)->adf_lockmax = (a)->adf_lockcount = 0; \
24 (a)->adf_excl = 0;(a)->adf_lock = NULL; \
27 #define adf_lock_free(a) do { \
31 for (i = 0; i < (a)->adf_lockcount; i++) {\
32 adf_lock_t *lock = (a)->adf_lock + i;\
33 if (--(*lock->refcount) < 1)free(lock->refcount); \
35 free((a)->adf_lock); \
39 #endif /* libatalk/adouble/ad_private.h */