2 Unix SMB/Netbios implementation.
4 SMB client library API definitions
5 Copyright (C) Andrew Tridgell 1998
6 Copyright (C) Richard Sharpe 2000
7 Copyright (C) John Terpsra 2000
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 /* Make sure we have the following includes for now ... */
29 #include <sys/types.h>
34 #define SMBC_FILE_MODE (S_IFREG | 0444)
35 #define SMBC_DIR_MODE (S_IFDIR | 0555)
37 typedef void (*smbc_get_auth_data_fn)(char *server, char *share,
38 char **workgroup, char **username,
42 * Init the smbc package
44 int smbc_init(smbc_get_auth_data_fn fn, const char *workgroup, int debug);
47 * Open a file on an SMB server, this has the same form as normal open
48 * but the fname is a URL of the form smb://server/share/path
51 int smbc_open(const char *fname, int flags, mode_t mode);
54 * Create a file on an SMB server, similar to smbc_open
57 int smbc_creat(const char *fname, mode_t mode);
60 * Read from a file, what about pread?
63 ssize_t smbc_read(int fd, void *buf, size_t count);
66 * Write to a file, what about pwrite?
69 ssize_t smbc_write(int fd, void *buf, size_t count);
75 int smbc_close(int fd);
78 * Unlink a file on server, share, dir, file ...
81 int smbc_unlink(const char *fname);
84 * rename oname to nname ... probably need to be on the same
85 * server initially. Later can copy between servers ...
88 int smbc_rename(const char *oname, const char *nname);
91 * Seek to a specific location in a file on an SMB server
94 off_t smbc_lseek(int fd, off_t offset, int whence);
97 * Stat a file to get info via file name
100 int smbc_stat(const char *fname, struct stat *st);
103 * Stat a file to get info via an fd
106 int smbc_fstat(int fd, struct stat *st);
112 int smbc_chown(const *fname, uid_t owner, gid_t group);
118 int smbc_chmod(const char *fname, mode_t newmode);
121 * Open a directory on a URL (server and share and dir)
124 int smbc_opendir(const char *fname);
130 int smbc_closedir(int fd);
133 * Get a directory entry
136 int smbc_getdents(unsigned int fd, struct dirent *dirp, int count);
139 * Create a directory on a server, share, dir in fname URL
142 int smbc_mkdir(const char *fname, mode_t mode);
145 * lseek on directories, rewind by smbc_lseekdir(fd, 0, SEEK_SET)
148 int smbc_lseekdir(int fd, off_t offset, int whence);
151 * Must also provide print functions ... soon