]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/unix.h
Check for sys/quota.h and include it if and only if this is defined in unix.h.
[netatalk.git] / etc / afpd / unix.h
1 /*
2  * $Id: unix.h,v 1.15 2003-12-15 04:59:45 srittau Exp $
3  */
4
5 #ifndef AFPD_UNIX_H
6 #define AFPD_UNIX_H
7
8 #ifdef HAVE_SYS_CDEFS_H
9 #include <sys/cdefs.h>
10 #endif /* HAVE_SYS_CDEFS_H */
11 #include <netatalk/endian.h>
12 #include "volume.h"
13
14 #if defined( sun ) && !defined( __svr4__ )
15 #ifdef i386
16 typedef int     mode_t;
17 #endif /*i386*/
18 #endif /*sun __svr4__*/
19
20 #if defined(HAVE_SYS_VFS_H) || defined( sun ) || defined( ibm032 ) 
21 #include <sys/vfs.h>
22 #endif /* HAVE_SYS_VFS_H || sun || ibm032 */
23
24 #if defined(_IBMR2) || defined(HAVE_STATFS_H) 
25 #include <sys/statfs.h>
26 /* this might not be right. */
27 #define f_mntfromname f_fname
28 #endif /* _IBMR2 || HAVE_STATFS_H */
29
30 #if defined(TRU64)
31 #define f_frsize f_fsize
32 #else /* TRU64 */
33 #if defined(HAVE_SYS_STATVFS_H) || defined(__svr4__)
34 #include <sys/statvfs.h>
35 #define statfs statvfs
36 #else /* HAVE_SYS_STATVFS || __svr4__ */
37 #define f_frsize f_bsize
38 #endif /* USE_STATVFS_H */
39 #endif /* TRU64 */
40
41 #if defined(__svr4__) || defined(HAVE_SYS_MNTTAB_H)
42 #include <sys/mnttab.h>
43 #endif /* __svr4__ || HAVE_SYS_MNTTAB_H */
44
45 #if defined(HAVE_SYS_MOUNT_H) || defined(BSD4_4) || \
46     defined(linux) || defined(ultrix)
47 #include <sys/mount.h>
48 #endif /* HAVE_SYS_MOUNT_H || BSD4_4 || linux || ultrix */
49
50 #if defined(linux) || defined(HAVE_MNTENT_H)
51 #include <mntent.h>
52 #endif /* linux || HAVE_MNTENT_H */
53
54
55 #ifndef NO_QUOTA_SUPPORT
56
57 #if !(defined(__svr4__) || defined(HAVE_DQB_BTIMELIMIT))
58 #define dqb_btimelimit  dqb_btime
59 #endif /* ! __svr4__ || HAVE_DQB_BTIMELIMIT */
60
61 #if defined(HAVE_SYS_QUOTA_H)
62 #include <sys/quota.h>
63 #endif /* HAVE_SYS_QUOTA_H */
64
65 #ifdef __svr4__ 
66 #include <sys/fs/ufs_quota.h>
67 #endif /* __svr4__ */
68
69 #ifdef BSD4_4
70 #include <ufs/ufs/quota.h>
71 #endif /* BSD4_4 */
72
73 #ifdef HAVE_UFS_QUOTA_H
74 #include <ufs/quota.h>
75 #endif /* HAVE_UFS_QUOTA_H */
76
77 #include <unistd.h>
78 #include <sys/types.h>
79 #include <sys/stat.h>
80 #include "directory.h"
81
82 extern int getnfsquota __P((const struct vol *, const int, const u_int32_t,
83                                 struct dqblk *));
84
85 extern int uquota_getvolspace __P((const struct vol *, VolSpace *, VolSpace *,
86                                        const u_int32_t));
87 #endif /* NO_QUOTA_SUPPORT */
88
89 extern struct afp_options default_options;
90
91 extern int gmem            __P((const gid_t));
92 extern int setdeskmode      __P((const mode_t));
93 extern int setdirunixmode   __P((const mode_t, const int, const int));
94 extern int setdirmode       __P((const mode_t, const int, const int));
95 extern int setdeskowner     __P((const uid_t, const gid_t));
96 extern int setdirowner      __P((const uid_t, const gid_t, const int));
97 extern int setfilmode       __P((char *, mode_t , struct stat *));
98 extern int setfilemode      __P((struct path*, const mode_t));
99 extern int unix_rename      __P((const char *oldpath, const char *newpath));
100
101 extern void accessmode      __P((char *, struct maccess *, struct dir *, struct stat *));
102
103 #ifdef AFS      
104     #define accessmode afsmode
105 #endif 
106
107 #endif /* UNIX_H */