Remove config.status implicit rule.
[usmb.git] / samba3x-compat.h
blob9c6f58eab725421ffbea42ed153ddbe61903ea1f
1 /* usmb - mount SMB shares via FUSE and Samba
2 * Copyright (C) 2006-2009 Geoff Johnstone
4 * Portions of this file are taken from Samba 3.2's libsmbclient.h:
5 * Copyright (C) Andrew Tridgell 1998
6 * Copyright (C) Richard Sharpe 2000
7 * Copyright (C) John Terpsra 2000
8 * Copyright (C) Tom Jansen (Ninja ISD) 2002
9 * Copyright (C) Derrell Lipman 2003-2008
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 3 of the License, or (at your
14 * option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #ifndef SAMBA_30_COMPAT_H
26 #define SAMBA_30_COMPAT_H
28 #include "config.h"
29 #include <libsmbclient.h>
30 #include <sys/statvfs.h>
33 int usmb_statfs (const char *path UNUSED, struct statvfs *vfs UNUSED);
34 int compat_truncate (const char *path, SMBCFILE *file, off_t size);
37 #ifndef HAVE_SAMBA32
39 typedef int (*smbc_chmod_fn) (SMBCCTX *c, const char *fname, mode_t mode);
41 static inline smbc_chmod_fn smbc_getFunctionChmod (SMBCCTX *c)
43 return c->chmod;
47 typedef int (*smbc_close_fn) (SMBCCTX *c, SMBCFILE *file);
49 static inline smbc_close_fn smbc_getFunctionClose (SMBCCTX *c)
51 return c->close_fn;
55 typedef int (*smbc_closedir_fn) (SMBCCTX *c, SMBCFILE *dir);
57 static inline smbc_closedir_fn smbc_getFunctionClosedir (SMBCCTX *c)
59 return c->closedir;
63 typedef SMBCFILE * (*smbc_creat_fn) (SMBCCTX *c,
64 const char *path,
65 mode_t mode);
67 static inline smbc_creat_fn smbc_getFunctionCreat (SMBCCTX *c)
69 return c->creat;
73 typedef int (*smbc_fstat_fn) (SMBCCTX *c, SMBCFILE *file, struct stat *st);
75 static inline smbc_fstat_fn smbc_getFunctionFstat (SMBCCTX *c)
77 return c->fstat;
81 typedef int (*smbc_getxattr_fn) (SMBCCTX *context,
82 const char *fname,
83 const char *name,
84 const void *value,
85 size_t size);
87 static inline smbc_getxattr_fn smbc_getFunctionGetxattr (SMBCCTX *c)
89 return c->getxattr;
93 typedef int (*smbc_listxattr_fn) (SMBCCTX *context,
94 const char *fname,
95 char *list,
96 size_t size);
98 static inline smbc_listxattr_fn smbc_getFunctionListxattr (SMBCCTX *c)
100 return c->listxattr;
104 typedef off_t (*smbc_lseek_fn) (SMBCCTX *c,
105 SMBCFILE *file,
106 off_t offset,
107 int whence);
109 static inline smbc_lseek_fn smbc_getFunctionLseek (SMBCCTX *c)
111 return c->lseek;
115 typedef int (*smbc_mkdir_fn) (SMBCCTX *c, const char *fname, mode_t mode);
117 static inline smbc_mkdir_fn smbc_getFunctionMkdir (SMBCCTX *c)
119 return c->mkdir;
123 typedef SMBCFILE * (*smbc_open_fn) (SMBCCTX *c,
124 const char *fname,
125 int flags,
126 mode_t mode);
128 static inline smbc_open_fn smbc_getFunctionOpen (SMBCCTX *c)
130 return c->open;
134 typedef SMBCFILE * (*smbc_opendir_fn) (SMBCCTX *c, const char *fname);
136 static inline smbc_opendir_fn smbc_getFunctionOpendir (SMBCCTX *c)
138 return c->opendir;
142 typedef ssize_t (*smbc_read_fn) (SMBCCTX *c,
143 SMBCFILE *file,
144 void *buf,
145 size_t count);
147 static inline smbc_read_fn smbc_getFunctionRead (SMBCCTX *c)
149 return c->read;
153 typedef struct smbc_dirent * (*smbc_readdir_fn) (SMBCCTX *c, SMBCFILE *dir);
155 static inline smbc_readdir_fn smbc_getFunctionReaddir (SMBCCTX *c)
157 return c->readdir;
161 typedef int (*smbc_removexattr_fn) (SMBCCTX *context,
162 const char *fname,
163 const char *name);
165 static inline smbc_removexattr_fn smbc_getFunctionRemovexattr (SMBCCTX *c)
167 return c->removexattr;
171 typedef int (*smbc_rename_fn) (SMBCCTX *ocontext,
172 const char *oname,
173 SMBCCTX *ncontext,
174 const char *nname);
176 static inline smbc_rename_fn smbc_getFunctionRename (SMBCCTX *c)
178 return c->rename;
182 typedef int (*smbc_rmdir_fn) (SMBCCTX *c, const char *fname);
184 static inline smbc_rmdir_fn smbc_getFunctionRmdir (SMBCCTX *c)
186 return c->rmdir;
190 typedef int (*smbc_lseekdir_fn)(SMBCCTX *c,
191 SMBCFILE *dir,
192 off_t offset);
194 static inline smbc_lseekdir_fn smbc_getFunctionLseekdir (SMBCCTX *c)
196 return c->lseekdir;
200 typedef int (*smbc_setxattr_fn) (SMBCCTX *context,
201 const char *fname,
202 const char *name,
203 const void *value,
204 size_t size,
205 int flags);
207 static inline smbc_setxattr_fn smbc_getFunctionSetxattr (SMBCCTX *c)
209 return c->setxattr;
213 typedef int (*smbc_stat_fn) (SMBCCTX *c, const char *fname, struct stat *s);
215 static inline smbc_stat_fn smbc_getFunctionStat (SMBCCTX *c)
217 return c->stat;
221 typedef int (*smbc_unlink_fn) (SMBCCTX *c, const char *fname);
223 static inline smbc_unlink_fn smbc_getFunctionUnlink (SMBCCTX *c)
225 return c->unlink;
229 typedef int (*smbc_utimes_fn) (SMBCCTX *c,
230 const char *fname,
231 struct timeval *tbuf);
233 static inline smbc_utimes_fn smbc_getFunctionUtimes (SMBCCTX *c)
235 return c->utimes;
239 typedef ssize_t (*smbc_write_fn) (SMBCCTX *c,
240 SMBCFILE *file,
241 void *buf,
242 size_t count);
244 static inline smbc_write_fn smbc_getFunctionWrite (SMBCCTX *c)
246 return c->write;
250 typedef void (*smbc_get_auth_fn) (const char *srv,
251 const char *shr,
252 char *wg, int wglen,
253 char *un, int unlen,
254 char *pw, int pwlen);
256 static inline void smbc_setFunctionAuthData (SMBCCTX *c,
257 smbc_get_auth_data_fn fn)
259 c->callbacks.auth_fn = fn;
263 static inline void smbc_setTimeout (SMBCCTX *c, int timeout)
265 c->timeout = timeout;
269 static inline void smbc_setUser (SMBCCTX *c, char *user)
271 c->user = user;
275 static inline void smbc_setWorkgroup (SMBCCTX *c, char *workgroup)
277 c->workgroup = workgroup;
280 #endif
282 #endif