]> arthur.barton.de Git - netatalk.git/blobdiff - include/atalk/adouble.h
Whoops, forgot two files from my last commit.
[netatalk.git] / include / atalk / adouble.h
index 931a40b04714330a9e909851aa159ae819ef9f39..cc5cd15d69a68bfb9acc3e2328d205b3557f49b0 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * $Id: adouble.h,v 1.8 2002-05-13 07:21:55 jmarcus Exp $
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
 
 #include <unistd.h>
 
-#if defined(sun) && defined(__svr4__)
-#include </usr/ucbinclude/sys/file.h>
-#else
+#ifdef HAVE_FLOCK
 #include <sys/file.h>
+#else
+#define LOCK_SH 1
+#define LOCK_EX 2
+#define LOCK_NB 4
+#define LOCK_UN 8
+extern int flock (int /*fd*/, int /*operation*/);
 #endif
 #include <fcntl.h>
 #include <sys/cdefs.h>
@@ -120,10 +125,24 @@ static inline int sendfile(int fdout, int fdin, off_t *off, size_t count)
 #define AD_DATASZ_MAX   1024
 #if AD_VERSION == AD_VERSION1
 #define AD_DATASZ      AD_DATASZ1 /* hold enough for the entries */
-#else if AD_VERSION == AD_VERSION2
+#elif AD_VERSION == AD_VERSION2
 #define AD_DATASZ       AD_DATASZ2
 #endif
 
+/*
+ * some legacy defines from netatalk-990130
+ * (to keep from breaking certain packages)
+ *
+ */
+
+#define ADEDOFF_RFORK  589
+#define ADEDOFF_NAME   86
+#define ADEDOFF_COMMENT        341
+#define ADEDOFF_FINDERI        557
+#ifndef ADEDOFF_FILEI
+#define ADEDOFF_FILEI  541
+#endif
+
 /*
  * The header of the AppleDouble Header File looks like this:
  *
@@ -167,6 +186,7 @@ struct adouble {
     struct ad_entry    ad_eid[ ADEID_MAX ];
     struct ad_fd       ad_df, ad_hf;
     int                 ad_flags, ad_inited;
+    int             ad_refcount; /* used in afpd/ofork.c */
 #ifdef USE_MMAPPED_HEADERS
     char                *ad_data;
 #else
@@ -195,13 +215,14 @@ struct adouble {
 #if defined(TRY_64BITOFF_T) && (~0UL > 0xFFFFFFFFU)
 /* synchronization locks */
 #define AD_FILELOCK_BASE (0x80000000)
-#define AD_FILELOCK_WR   (AD_FILELOCK_BASE + 0)
-#define AD_FILELOCK_RD   (AD_FILELOCK_BASE + 1)
 #else
-#define AD_FILELOCK_BASE (0x7FFFFFFE)
-#define AD_FILELOCK_WR   (AD_FILELOCK_BASE + 0)
-#define AD_FILELOCK_RD   (AD_FILELOCK_BASE + 1)
+#define AD_FILELOCK_BASE (0x7FFFFFFF -4)
 #endif
+#define AD_FILELOCK_OPEN_WR        (AD_FILELOCK_BASE + 0)
+#define AD_FILELOCK_OPEN_RD       (AD_FILELOCK_BASE + 1)
+#define AD_FILELOCK_DENY_WR       (AD_FILELOCK_BASE + 2)
+#define AD_FILELOCK_DENY_RD        (AD_FILELOCK_BASE + 3)
+#define AD_FILELOCK_OPEN_NONE      (AD_FILELOCK_BASE + 4)
 
 /* time stuff. we overload the bits a little.  */
 #define AD_DATE_CREATE        0