]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/file.h
4848b5069e1338a79fe85e4a1c0556ccbc2c845d
[netatalk.git] / etc / afpd / file.h
1 /*
2  * Copyright (c) 1990,1991 Regents of The University of Michigan.
3  * All Rights Reserved.
4  *
5  * Permission to use, copy, modify, and distribute this software and
6  * its documentation for any purpose and without fee is hereby granted,
7  * provided that the above copyright notice appears in all copies and
8  * that both that copyright notice and this permission notice appear
9  * in supporting documentation, and that the name of The University
10  * of Michigan not be used in advertising or publicity pertaining to
11  * distribution of the software without specific, written prior
12  * permission. This software is supplied as is without expressed or
13  * implied warranties of any kind.
14  *
15  *      Research Systems Unix Group
16  *      The University of Michigan
17  *      c/o Mike Clark
18  *      535 W. William Street
19  *      Ann Arbor, Michigan
20  *      +1-313-763-0525
21  *      netatalk@itd.umich.edu
22  */
23
24 #ifndef AFPD_FILE_H 
25 #define AFPD_FILE_H 1
26
27 /*#include <sys/stat.h>*/ /* including it here causes some confusion */
28 #include <sys/param.h>
29 #include <sys/cdefs.h>
30 #include <netatalk/endian.h>
31 #include <atalk/adouble.h>
32
33 #include "globals.h"
34 #include "volume.h"
35 #include "directory.h"
36
37 extern const u_char     ufinderi[];
38
39 #define FILPBIT_ATTR    0
40 #define FILPBIT_PDID    1
41 #define FILPBIT_CDATE   2
42 #define FILPBIT_MDATE   3
43 #define FILPBIT_BDATE   4
44 #define FILPBIT_FINFO   5
45 #define FILPBIT_LNAME   6
46 #define FILPBIT_SNAME   7
47 #define FILPBIT_FNUM    8
48 #define FILPBIT_DFLEN   9
49 #define FILPBIT_RFLEN   10
50 #define FILPBIT_PDINFO  13    /* ProDOS Info */
51
52 /* attribute bits. (d) = directory attribute bit as well. */
53 #define ATTRBIT_INVISIBLE (1<<0)  /* invisible (d) */
54 #define ATTRBIT_MULTIUSER (1<<1)  /* multiuser */
55 #define ATTRBIT_SYSTEM    (1<<2)  /* system (d) */
56 #define ATTRBIT_DOPEN     (1<<3)  /* data fork already open */
57 #define ATTRBIT_ROPEN     (1<<4)  /* resource fork already open */
58 #define ATTRBIT_NOWRITE   (1<<5)  /* write inhibit(v2)/read-only(v1) bit */
59 #define ATTRBIT_BACKUP    (1<<6)  /* backup needed (d) */
60 #define ATTRBIT_NORENAME  (1<<7)  /* rename inhibit (d) */
61 #define ATTRBIT_NODELETE  (1<<8)  /* delete inhibit (d) */
62 #define ATTRBIT_NOCOPY    (1<<10) /* copy protect */
63 #define ATTRBIT_SETCLR    (1<<15) /* set/clear bits (d) */
64
65 struct extmap {
66     struct extmap       *em_next;
67     char                em_ext[ MAXPATHLEN + 1];
68     char                em_creator[ 4 ];
69     char                em_type[ 4 ];
70 };
71
72 extern struct extmap    *extmap;
73 extern struct extmap    *getextmap __P((const char *));
74
75 extern int getfilparams __P((struct vol *, u_int16_t, char *, 
76                              struct dir *, struct stat *, char *buf, 
77                              int *));
78 extern int setfilparams __P((struct vol *, char *, u_int16_t, char *));
79 extern int renamefile   __P((char *, char *, char *, const int));
80 extern int copyfile     __P((char *, char *, char *, const int));
81 extern int deletefile   __P((char *));
82
83 /* FP functions */
84 extern int      afp_exchangefiles __P((AFPObj *, char *, int, char *, int *));
85 extern int      afp_setfilparams __P((AFPObj *, char *, int, char *, int *));
86 extern int      afp_copyfile __P((AFPObj *, char *, int, char *, int *));
87 extern int      afp_createfile __P((AFPObj *, char *, int, char *, int *));
88 #if AD_VERSION > AD_VERSION1
89 extern int      afp_createid __P((AFPObj *, char *, int, char *, int *));
90 extern int      afp_resolveid __P((AFPObj *, char *, int, char *, int *));
91 extern int      afp_deleteid __P((AFPObj *, char *, int, char *, int *));
92 #else
93 #define afp_createid      afp_null
94 #define afp_resolveid     afp_null
95 #define afp_deleteid      afp_null
96 #endif
97
98 #endif