4 * Copyright (C) Tim Potter, 1999
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 * $Id: skel.c,v 1.1 2000/02/03 04:40:56 tpot Exp $
41 /* Function prototypes */
43 int skel_connect(struct vfs_connection_struct *conn, char *svc, char *user);
44 void skel_disconnect(void);
45 SMB_BIG_UINT skel_disk_free(char *path, SMB_BIG_UINT *bsize,
46 SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
48 DIR *skel_opendir(char *fname);
49 struct dirent *skel_readdir(DIR *dirp);
50 int skel_mkdir(char *path, mode_t mode);
51 int skel_rmdir(char *path);
52 int skel_closedir(DIR *dir);
54 int skel_open(char *fname, int flags, mode_t mode);
55 int skel_close(int fd);
56 ssize_t skel_read(int fd, char *data, size_t n);
57 ssize_t skel_write(int fd, char *data, size_t n);
58 SMB_OFF_T skel_lseek(int filedes, SMB_OFF_T offset, int whence);
59 int skel_rename(char *old, char *new);
60 void skel_sync(int fd);
61 int skel_stat(char *fname, SMB_STRUCT_STAT *sbuf);
62 int skel_fstat(int fd, SMB_STRUCT_STAT *sbuf);
63 int skel_lstat(char *path, SMB_STRUCT_STAT *sbuf);
64 BOOL skel_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
65 int skel_unlink(char *path);
66 int skel_chmod(char *path, mode_t mode);
67 int skel_utime(char *path, struct utimbuf *times);
69 /* VFS operations structure */
71 struct vfs_ops skel_ops = {
79 /* Directory operations */
105 /* VFS initialisation - return vfs_ops function pointer structure */
107 struct vfs_ops *vfs_init(void)
112 /* Implementation of VFS functions. Insert your useful stuff here */
114 extern struct vfs_ops default_vfs_ops; /* For passthrough operation */
116 int skel_connect(struct vfs_connection_struct *conn, char *svc, char *user)
118 return default_vfs_ops.connect(conn, svc, user);
121 void skel_disconnect(void)
123 default_vfs_ops.disconnect();
126 SMB_BIG_UINT skel_disk_free(char *path, SMB_BIG_UINT *bsize,
127 SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
129 return default_vfs_ops.disk_free(path, bsize, dfree, dsize);
132 DIR *skel_opendir(char *fname)
134 return default_vfs_ops.opendir(fname);
137 struct dirent *skel_readdir(DIR *dirp)
139 return default_vfs_ops.readdir(dirp);
142 int skel_mkdir(char *path, mode_t mode)
144 return default_vfs_ops.mkdir(path, mode);
147 int skel_rmdir(char *path)
149 return default_vfs_ops.rmdir(path);
152 int skel_closedir(DIR *dir)
154 return default_vfs_ops.closedir(dir);
157 int skel_open(char *fname, int flags, mode_t mode)
159 return default_vfs_ops.open(fname, flags, mode);
162 int skel_close(int fd)
164 return default_vfs_ops.close(fd);
167 ssize_t skel_read(int fd, char *data, size_t n)
169 return default_vfs_ops.read(fd, data, n);
172 ssize_t skel_write(int fd, char *data, size_t n)
174 return default_vfs_ops.write(fd, data, n);
177 SMB_OFF_T skel_lseek(int filedes, SMB_OFF_T offset, int whence)
179 return default_vfs_ops.lseek(filedes, offset, whence);
182 int skel_rename(char *old, char *new)
184 return default_vfs_ops.rename(old, new);
187 void skel_sync(int fd)
189 default_vfs_ops.sync(fd);
192 int skel_stat(char *fname, SMB_STRUCT_STAT *sbuf)
194 return default_vfs_ops.stat(fname, sbuf);
197 int skel_fstat(int fd, SMB_STRUCT_STAT *sbuf)
199 return default_vfs_ops.fstat(fd, sbuf);
202 int skel_lstat(char *path, SMB_STRUCT_STAT *sbuf)
204 return default_vfs_ops.lstat(path, sbuf);
207 BOOL skel_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
209 return default_vfs_ops.lock(fd, op, offset, count, type);
212 int skel_unlink(char *path)
214 return default_vfs_ops.unlink(path);
217 int skel_chmod(char *path, mode_t mode)
219 return default_vfs_ops.chmod(path, mode);
222 int skel_utime(char *path, struct utimbuf *times)
224 return default_vfs_ops.utime(path, times);