]> arthur.barton.de Git - netatalk.git/blob - include/atalk/vfs.h
Convert afp_moveandrename and all called funcs to XXXat semantics if available
[netatalk.git] / include / atalk / vfs.h
1 /*
2    Copyright (c) 2004 Didier Gautheron
3  
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2 of the License, or
7    (at your option) any later version.
8  
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13  
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18    vfs layer for afp
19 */
20
21 #ifndef ATALK_VFS_H
22 #define ATALK_VFS_H
23
24 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif /* HAVE_CONFIG_H */
27
28 #include <atalk/adouble.h>
29 #include <atalk/volume.h>
30
31 #define VFS_FUNC_ARGS_VALIDUPATH const struct vol *vol, const char *name
32 #define VFS_FUNC_VARS_VALIDUPATH vol, name
33
34 #define VFS_FUNC_ARGS_CHOWN const struct vol *vol, const char *path, uid_t uid, gid_t gid
35 #define VFS_FUNC_VARS_CHOWN vol, path, uid, gid
36
37 #define VFS_FUNC_ARGS_RENAMEDIR const struct vol *vol, int dirfd, const char *oldpath, const char *newpath
38 #define VFS_FUNC_VARS_RENAMEDIR vol, dirfd, oldpath, newpath
39
40 #define VFS_FUNC_ARGS_DELETECURDIR const struct vol *vol
41 #define VFS_FUNC_VARS_DELETECURDIR vol
42
43 #define VFS_FUNC_ARGS_SETFILEMODE const struct vol *vol, const char *name, mode_t mode, struct stat *st
44 #define VFS_FUNC_VARS_SETFILEMODE vol, name, mode, st
45
46 #define VFS_FUNC_ARGS_SETDIRMODE const struct vol *vol,  const char *name, mode_t mode, struct stat *st
47 #define VFS_FUNC_VARS_SETDIRMODE vol, name, mode, st
48
49 #define VFS_FUNC_ARGS_SETDIRUNIXMODE const struct vol *vol, const char *name, mode_t mode, struct stat *st
50 #define VFS_FUNC_VARS_SETDIRUNIXMODE vol, name, mode, st
51
52 #define VFS_FUNC_ARGS_SETDIROWNER const struct vol *vol, const char *name, uid_t uid, gid_t gid
53 #define VFS_FUNC_VARS_SETDIROWNER vol, name, uid, gid
54
55 #define VFS_FUNC_ARGS_DELETEFILE const struct vol *vol, int dirfd, const char *file
56 #define VFS_FUNC_VARS_DELETEFILE vol, dirfd, file
57
58 #define VFS_FUNC_ARGS_RENAMEFILE const struct vol *vol, int dirfd, const char *src, const char *dst
59 #define VFS_FUNC_VARS_RENAMEFILE vol, dirfd, src, dst
60
61 #define VFS_FUNC_ARGS_COPYFILE const struct vol *vol, int sfd, const char *src, const char *dst
62 #define VFS_FUNC_VARS_COPYFILE vol, sfd, src, dst
63
64 #define VFS_FUNC_ARGS_ACL const struct vol *vol, const char *path, int cmd, int count, void *aces
65 #define VFS_FUNC_VARS_ACL vol, path, cmd, count, aces
66
67 #define VFS_FUNC_ARGS_REMOVE_ACL const struct vol *vol, const char *path, int dir
68 #define VFS_FUNC_VARS_REMOVE_ACL vol, path, dir
69
70 #define VFS_FUNC_ARGS_EA_GETSIZE const struct vol * restrict vol, char * restrict rbuf, size_t * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname
71 #define VFS_FUNC_VARS_EA_GETSIZE vol, rbuf, rbuflen, uname, oflag, attruname
72
73 #define VFS_FUNC_ARGS_EA_GETCONTENT const struct vol * restrict vol, char * restrict rbuf, size_t * restrict rbuflen,  const char * restrict uname, int oflag, const char * restrict attruname, int maxreply
74 #define VFS_FUNC_VARS_EA_GETCONTENT vol, rbuf, rbuflen, uname, oflag, attruname, maxreply
75
76 #define VFS_FUNC_ARGS_EA_LIST const struct vol * restrict vol, char * restrict attrnamebuf, size_t * restrict buflen, const char * restrict uname, int oflag
77 #define VFS_FUNC_VARS_EA_LIST vol, attrnamebuf, buflen, uname, oflag
78
79 #define VFS_FUNC_ARGS_EA_SET const struct vol * restrict vol, const char * restrict uname, const char * restrict attruname, const char * restrict ibuf, size_t attrsize, int oflag
80 #define VFS_FUNC_VARS_EA_SET vol, uname, attruname, ibuf, attrsize, oflag
81
82 #define VFS_FUNC_ARGS_EA_REMOVE const struct vol * restrict vol, const char * restrict uname, const char * restrict attruname, int oflag
83 #define VFS_FUNC_VARS_EA_REMOVE vol, uname, attruname, oflag
84
85 /*
86  * Forward declaration. We need it because of the circular inclusion of
87  * of vfs.h <-> volume.h. 
88  */
89 struct vol;
90
91 struct vfs_ops {
92     int (*vfs_validupath)    (VFS_FUNC_ARGS_VALIDUPATH);
93     int (*vfs_chown)         (VFS_FUNC_ARGS_CHOWN);
94     int (*vfs_renamedir)     (VFS_FUNC_ARGS_RENAMEDIR);
95     int (*vfs_deletecurdir)  (VFS_FUNC_ARGS_DELETECURDIR);
96     int (*vfs_setfilmode)    (VFS_FUNC_ARGS_SETFILEMODE);
97     int (*vfs_setdirmode)    (VFS_FUNC_ARGS_SETDIRMODE);
98     int (*vfs_setdirunixmode)(VFS_FUNC_ARGS_SETDIRUNIXMODE);
99     int (*vfs_setdirowner)   (VFS_FUNC_ARGS_SETDIROWNER);
100     int (*vfs_deletefile)    (VFS_FUNC_ARGS_DELETEFILE);
101     int (*vfs_renamefile)    (VFS_FUNC_ARGS_RENAMEFILE);
102     int (*vfs_copyfile)      (VFS_FUNC_ARGS_COPYFILE);
103
104     /* ACLs */
105     int (*vfs_acl)           (VFS_FUNC_ARGS_ACL);
106     int (*vfs_remove_acl)    (VFS_FUNC_ARGS_REMOVE_ACL);
107
108     /* Extended Attributes */
109     int (*vfs_ea_getsize)    (VFS_FUNC_ARGS_EA_GETSIZE);
110     int (*vfs_ea_getcontent) (VFS_FUNC_ARGS_EA_GETCONTENT);
111     int (*vfs_ea_list)       (VFS_FUNC_ARGS_EA_LIST);
112     int (*vfs_ea_set)        (VFS_FUNC_ARGS_EA_SET);
113     int (*vfs_ea_remove)     (VFS_FUNC_ARGS_EA_REMOVE);
114 };
115
116 extern void initvol_vfs(struct vol * restrict vol);
117
118 #endif /* ATALK_VFS_H */