2 Unix SMB/Netbios implementation.
4 SMB wrapper functions - definitions
5 Copyright (C) Andrew Tridgell 1998
6 Copyright (C) Derrell Lipman 2003-2005
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include <sys/types.h>
33 #include "config.h" /* must come before libsmbclient.h */
34 #include "libsmbclient.h"
38 #define DEBUG(level, s) do { if (level <= debug_level) printf s; } while (0)
41 #define SMBW_PREFIX "/smb"
42 #define SMBW_DUMMY "/dev/null"
44 extern int smbw_initialized;
45 #define SMBW_INIT() do { if (! smbw_initialized) smbw_init(); } while (0)
47 #if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T)
48 # define SMBW_OFF_T off64_t
50 # define SMBW_OFF_T off_t
54 /* The following definitions come from smbwrapper/smbw.c */
63 int smbw_ref(int client_fd, Ref_Count_Type type, ...);
66 int smbw_path(const char *path);
67 void smbw_clean_fname(char *name);
68 void smbw_fix_path(const char *src, char *dest);
69 void smbw_set_auth_data_fn(smbc_get_auth_data_fn fn);
70 int smbw_open(const char *fname, int flags, mode_t mode);
71 ssize_t smbw_pread(int fd, void *buf, size_t count, SMBW_OFF_T ofs);
72 ssize_t smbw_read(int fd, void *buf, size_t count);
73 ssize_t smbw_write(int fd, void *buf, size_t count);
74 ssize_t smbw_pwrite(int fd, void *buf, size_t count, SMBW_OFF_T ofs);
75 int smbw_close(int fd);
76 int smbw_fcntl(int fd, int cmd, long arg);
77 int smbw_access(const char *name, int mode);
78 int smbw_readlink(const char *path, char *buf, size_t bufsize);
79 int smbw_unlink(const char *fname);
80 int smbw_rename(const char *oldname, const char *newname);
81 int smbw_utime(const char *fname, void *buf);
82 int smbw_utimes(const char *fname, void *buf);
83 int smbw_chown(const char *fname, uid_t owner, gid_t group);
84 int smbw_chmod(const char *fname, mode_t newmode);
85 SMBW_OFF_T smbw_lseek(int smbw_fd, SMBW_OFF_T offset, int whence);
87 int smbw_dup2(int fd, int fd2);
90 /* The following definitions come from smbwrapper/smbw_dir.c */
92 int smbw_dirp(DIR * dirp);
93 int smbw_dir_open(const char *fname);
94 int smbw_dir_fstat(int fd, SMBW_stat *st);
95 int smbw_dir_close(int fd);
96 int smbw_getdents(unsigned int fd, SMBW_dirent *dirp, int count);
97 int smbw_chdir(const char *name);
98 int smbw_mkdir(const char *fname, mode_t mode);
99 int smbw_rmdir(const char *fname);
100 char *smbw_getcwd(char *buf, size_t size);
101 int smbw_fchdir(int fd);
102 DIR *smbw_opendir(const char *fname);
103 SMBW_dirent *smbw_readdir(DIR *dirp);
104 int smbw_readdir_r(DIR *dirp,
105 struct SMBW_dirent *__restrict entry,
106 struct SMBW_dirent **__restrict result);
107 int smbw_closedir(DIR *dirp);
108 void smbw_seekdir(DIR *dirp, long long offset);
109 long long smbw_telldir(DIR *dirp);
110 int smbw_setxattr(const char *fname,
115 int smbw_lsetxattr(const char *fname,
120 int smbw_fsetxattr(int smbw_fd,
125 int smbw_getxattr(const char *fname,
129 int smbw_lgetxattr(const char *fname,
133 int smbw_fgetxattr(int smbw_fd,
137 int smbw_removexattr(const char *fname,
139 int smbw_lremovexattr(const char *fname,
141 int smbw_fremovexattr(int smbw_fd,
143 int smbw_listxattr(const char *fname,
146 int smbw_llistxattr(const char *fname,
149 int smbw_flistxattr(int smbw_fd,
153 /* The following definitions come from smbwrapper/smbw_stat.c */
155 int smbw_fstat(int fd, SMBW_stat *st);
156 int smbw_stat(const char *fname, SMBW_stat *st);
158 /* The following definitions come from smbwrapper/cache.c */
160 smbw_cache_functions(SMBCCTX * context);