]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/fork.h
remove pre ansi declarations
[netatalk.git] / etc / afpd / fork.h
1 /*
2  * $Id: fork.h,v 1.14 2009-10-13 22:55:37 didg Exp $
3  *
4  * Copyright (c) 1990,1993 Regents of The University of Michigan.
5  * All Rights Reserved.  See COPYRIGHT.
6  */
7
8 #ifndef AFPD_FORK_H
9 #define AFPD_FORK_H 1
10
11 #include <stdio.h>
12 #include <sys/cdefs.h>
13
14 #include <netatalk/endian.h>
15 #include <atalk/adouble.h>
16 #include "volume.h"
17 #include "directory.h"
18
19 struct file_key {
20     dev_t               dev;
21     ino_t               inode;
22 };
23
24 struct ofork {
25     struct file_key     key;
26     struct adouble      *of_ad;
27     struct vol          *of_vol;
28     struct dir          *of_dir;
29
30     u_int16_t           of_refnum;
31     int                 of_flags;
32
33     struct ofork        **prevp, *next;
34     struct ofork        *of_d_prev, *of_d_next;
35 };
36
37 #define OPENFORK_DATA   (0)
38 #define OPENFORK_RSCS   (1<<7)
39
40 #define OPENACC_RD      (1<<0)
41 #define OPENACC_WR      (1<<1)
42 #define OPENACC_DRD     (1<<4)
43 #define OPENACC_DWR     (1<<5)
44
45 /* ofork.of_flags bits */
46 #define AFPFORK_OPEN    (1<<0)
47 #define AFPFORK_RSRC    (1<<1)
48 #define AFPFORK_DATA    (1<<2)
49 #define AFPFORK_DIRTY   (1<<3)
50 #define AFPFORK_ACCRD   (1<<4)
51 #define AFPFORK_ACCWR   (1<<5)
52 #define AFPFORK_ACCMASK (AFPFORK_ACCRD | AFPFORK_ACCWR)
53
54 #define of_name(a) (a)->of_ad->ad_m_name
55 /* in ofork.c */
56 extern struct ofork *of_alloc    (struct vol *, struct dir *,
57                                                       char *, u_int16_t *, const int,
58                                                       struct adouble *,
59                                                       struct stat *);
60 extern void         of_dealloc   (struct ofork *);
61 extern struct ofork *of_find     (const u_int16_t);
62 extern struct ofork *of_findname (struct path *);
63 extern int          of_rename    (const struct vol *,
64                                           struct ofork *,
65                                           struct dir *, const char *,
66                                           struct dir *, const char *);
67 extern int          of_flush     (const struct vol *);
68 extern void         of_pforkdesc (FILE *);
69 extern int          of_stat      (struct path *);
70 extern int          of_statdir   (const struct vol *vol, struct path *);
71 extern int          of_closefork (struct ofork *ofork);
72 extern void         of_closevol  (const struct vol *vol);
73 extern struct adouble *of_ad     (const struct vol *, struct path *, struct adouble *);
74 /* in fork.c */
75 extern int          flushfork    (struct ofork *);
76 extern int          getforkmode  (struct adouble *, int , int );
77
78 /* FP functions */
79 extern int      afp_openfork (AFPObj *, char *, int, char *, int *);
80 extern int      afp_bytelock (AFPObj *, char *, int, char *, int *);
81 extern int      afp_getforkparams (AFPObj *, char *, int, char *, int *);
82 extern int      afp_setforkparams (AFPObj *, char *, int, char *, int *);
83 extern int      afp_read (AFPObj *, char *, int, char *, int *);
84 extern int      afp_write (AFPObj *, char *, int, char *, int *);
85 extern int      afp_flushfork (AFPObj *, char *, int, char *, int *);
86 extern int      afp_flush (AFPObj *, char *, int, char *, int *);
87 extern int      afp_closefork (AFPObj *, char *, int, char *, int *);
88
89 extern int      afp_bytelock_ext (AFPObj *, char *, int, char *, int *);
90 extern int      afp_read_ext (AFPObj *, char *, int, char *, int *);
91 extern int      afp_write_ext (AFPObj *, char *, int, char *, int *);
92 extern int  afp_syncfork (AFPObj *, char *, int, char *, int *);
93 #endif