libsmb/libsmb_compat.c

ソースコードを見る。

データ構造

struct  smbc_compat_fdlist

関数

static SMBCFILEfind_fd (int fd)
static int add_fd (SMBCFILE *file)
static int del_fd (int fd)
int smbc_init (smbc_get_auth_data_fn fn, int debug)
 Initialize the samba client library.
SMBCCTXsmbc_set_context (SMBCCTX *context)
 Set or retrieve the compatibility library's context pointer
int smbc_open (const char *furl, int flags, mode_t mode)
 Open a file on an SMB server.
int smbc_creat (const char *furl, mode_t mode)
 Create a file on an SMB server.
ssize_t smbc_read (int fd, void *buf, size_t bufsize)
 Read from a file using an opened file handle.
ssize_t smbc_write (int fd, void *buf, size_t bufsize)
 Write to a file using an opened file handle.
off_t smbc_lseek (int fd, off_t offset, int whence)
 Seek to a specific location in a file.
int smbc_close (int fd)
 Close an open file handle.
int smbc_unlink (const char *fname)
 Unlink (delete) a file or directory.
int smbc_rename (const char *ourl, const char *nurl)
 Rename or move a file or directory.
int smbc_opendir (const char *durl)
 Open a directory used to obtain directory entries.
int smbc_closedir (int dh)
 Close a directory handle opened by smbc_opendir().
int smbc_getdents (unsigned int dh, struct smbc_dirent *dirp, int count)
 Get multiple directory entries.
smbc_direntsmbc_readdir (unsigned int dh)
 Get a single directory entry.
off_t smbc_telldir (int dh)
 Get the current directory offset.
int smbc_lseekdir (int fd, off_t offset)
 lseek on directories.
int smbc_mkdir (const char *durl, mode_t mode)
 Create a directory.
int smbc_rmdir (const char *durl)
 Remove a directory.
int smbc_stat (const char *url, struct stat *st)
 Get information about a file or directory.
int smbc_fstat (int fd, struct stat *st)
 Get file information via an file descriptor.
int smbc_chmod (const char *url, mode_t mode)
 Change the permissions of a file.
int smbc_utimes (const char *fname, struct timeval *tbuf)
 Change the last modification time on a file
int smbc_utime (const char *fname, struct utimbuf *utbuf)
 Change the last modification time on a file
int smbc_setxattr (const char *fname, const char *name, const void *value, size_t size, int flags)
 Set extended attributes for a file.
int smbc_lsetxattr (const char *fname, const char *name, const void *value, size_t size, int flags)
 Set extended attributes for a file.
int smbc_fsetxattr (int fd, const char *name, const void *value, size_t size, int flags)
 Set extended attributes for a file.
int smbc_getxattr (const char *fname, const char *name, const void *value, size_t size)
 Get extended attributes for a file.
int smbc_lgetxattr (const char *fname, const char *name, const void *value, size_t size)
 Get extended attributes for a file.
int smbc_fgetxattr (int fd, const char *name, const void *value, size_t size)
 Get extended attributes for a file.
int smbc_removexattr (const char *fname, const char *name)
 Remove extended attributes for a file.
int smbc_lremovexattr (const char *fname, const char *name)
 Remove extended attributes for a file.
int smbc_fremovexattr (int fd, const char *name)
 Remove extended attributes for a file.
int smbc_listxattr (const char *fname, char *list, size_t size)
 List the supported extended attribute names associated with a file
int smbc_llistxattr (const char *fname, char *list, size_t size)
 List the supported extended attribute names associated with a file The POSIX function which this maps to would act on a symbolic link rather than acting on what the symbolic link points to, but with no symbolic links in SMB file systems, this function is functionally identical to smbc_listxattr().
int smbc_flistxattr (int fd, char *list, size_t size)
 List the supported extended attribute names associated with a file
int smbc_print_file (const char *fname, const char *printq)
 Print a file given the name in fname.
int smbc_open_print_job (const char *fname)
 Open a print file that can be written to by other calls.
int smbc_list_print_jobs (const char *purl, smbc_list_print_job_fn fn)
 List the print jobs on a print share, for the moment, pass a callback
int smbc_unlink_print_job (const char *purl, int id)
 Delete a print job

変数

static SMBCCTXstatcont = NULL
static int smbc_compat_initialized = 0
static int smbc_compat_nextfd = 0
static struct smbc_compat_fdlistsmbc_compat_fd_in_use = NULL
static struct smbc_compat_fdlistsmbc_compat_fd_avail = NULL


関数

static SMBCFILE* find_fd ( int  fd  )  [static]

libsmb_compat.c43 行で定義されています。

参照先 smbc_compat_fdlist::fdsmbc_compat_fdlist::filesmbc_compat_fdlist::nextsmbc_compat_fd_in_use.

参照元 smbc_close()smbc_closedir()smbc_fgetxattr()smbc_flistxattr()smbc_fremovexattr()smbc_fsetxattr()smbc_fstat()smbc_getdents()smbc_lseek()smbc_lseekdir()smbc_read()smbc_readdir()smbc_telldir()smbc_write().

00044 {
00045         struct smbc_compat_fdlist * f = smbc_compat_fd_in_use;
00046         while (f) {
00047                 if (f->fd == fd) 
00048                         return f->file;
00049                 f = f->next;
00050         }
00051         return NULL;
00052 }

static int add_fd ( SMBCFILE file  )  [static]

libsmb_compat.c55 行で定義されています。

参照先 errnosmbc_compat_fdlist::fdsmbc_compat_fdlist::filesmbc_compat_fd_availsmbc_compat_fd_in_usesmbc_compat_nextfd.

参照元 smbc_creat()smbc_open()smbc_opendir().

00056 {
00057         struct smbc_compat_fdlist * f = smbc_compat_fd_avail;
00058 
00059         if (f) {
00060                 /* We found one that's available */
00061                 DLIST_REMOVE(smbc_compat_fd_avail, f);
00062 
00063         } else {
00064                 /*
00065                  * None were available, so allocate one.  Keep the number of
00066                  * file descriptors determinate.  This allows the application
00067                  * to allocate bitmaps or mapping of file descriptors based on
00068                  * a known maximum number of file descriptors that will ever
00069                  * be returned.
00070                  */
00071                 if (smbc_compat_nextfd >= FD_SETSIZE) {
00072                         errno = EMFILE;
00073                         return -1;
00074                 }
00075 
00076                 f = SMB_MALLOC_P(struct smbc_compat_fdlist);
00077                 if (!f) {
00078                         errno = ENOMEM;
00079                         return -1;
00080                 }
00081         
00082                 f->fd = SMBC_BASE_FD + smbc_compat_nextfd++;
00083         }
00084 
00085         f->file = file;
00086         DLIST_ADD(smbc_compat_fd_in_use, f);
00087 
00088         return f->fd;
00089 }

static int del_fd ( int  fd  )  [static]

libsmb_compat.c94 行で定義されています。

参照先 smbc_compat_fdlist::fdsmbc_compat_fdlist::filesmbc_compat_fdlist::nextsmbc_compat_fd_availsmbc_compat_fd_in_use.

参照元 smbc_close()smbc_closedir().

00095 {
00096         struct smbc_compat_fdlist * f = smbc_compat_fd_in_use;
00097 
00098         while (f) {
00099                 if (f->fd == fd) 
00100                         break;
00101                 f = f->next;
00102         }
00103 
00104         if (f) {
00105                 /* found */
00106                 DLIST_REMOVE(smbc_compat_fd_in_use, f);
00107                 f->file = NULL;
00108                 DLIST_ADD(smbc_compat_fd_avail, f);
00109                 return 0;
00110         }
00111         return 1;
00112 }


変数

SMBCCTX* statcont = NULL [static]

libsmb_compat.c36 行で定義されています。

参照元 smbc_chmod()smbc_close()smbc_closedir()smbc_creat()smbc_fgetxattr()smbc_flistxattr()smbc_fremovexattr()smbc_fsetxattr()smbc_fstat()smbc_getdents()smbc_getxattr()smbc_init()smbc_lgetxattr()smbc_list_print_jobs()smbc_listxattr()smbc_llistxattr()smbc_lremovexattr()smbc_lseek()smbc_lseekdir()smbc_lsetxattr()smbc_mkdir()smbc_open()smbc_open_print_job()smbc_opendir()smbc_print_file()smbc_read()smbc_readdir()smbc_removexattr()smbc_rename()smbc_rmdir()smbc_set_context()smbc_setxattr()smbc_stat()smbc_telldir()smbc_unlink()smbc_unlink_print_job()smbc_utime()smbc_utimes()smbc_write().

int smbc_compat_initialized = 0 [static]

libsmb_compat.c37 行で定義されています。

参照元 smbc_init()smbc_set_context().

int smbc_compat_nextfd = 0 [static]

libsmb_compat.c38 行で定義されています。

参照元 add_fd().

struct smbc_compat_fdlist* smbc_compat_fd_in_use = NULL [static]

libsmb_compat.c39 行で定義されています。

参照元 add_fd()del_fd()find_fd().

struct smbc_compat_fdlist* smbc_compat_fd_avail = NULL [static]

libsmb_compat.c40 行で定義されています。

参照元 add_fd()del_fd().


Sambaに対してSat Aug 29 21:23:48 2009に生成されました。  doxygen 1.4.7