1 #ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H
2 #define LIBATALK_ADOUBLE_AD_PRIVATE_H 1
4 #include <atalk/adouble.h>
6 /* this is so that we can keep lists of fds referencing the same file
7 * around. that way, we can honor locks created by the same process
8 * with the same file. */
10 #define adf_lock_init(a) do { \
11 (a)->adf_lockmax = 0; \
12 (a)->adf_lockcount = 0; \
13 (a)->adf_lock = NULL; \
16 #define adf_lock_free(a) do { \
20 for (i = 0; i < (a)->adf_lockcount; i++) { \
21 adf_lock_t *lock = (a)->adf_lock + i; \
22 if (--(*lock->refcount) < 1) \
23 free(lock->refcount); \
25 free((a)->adf_lock); \
29 #endif /* libatalk/adouble/ad_private.h */