include/libsmbclient.h

ソースコードを見る。

データ構造

struct  smbc_dirent
 Structure that represents a directory entry. [詳細]
struct  print_job_info
 Structure that represents a print job. [詳細]
struct  _SMBCCTX
 Structure that contains a client context information This structure is know as SMBCCTX [詳細]
struct  _SMBCCTX::_smbc_callbacks
struct  _SMBCCTX::_smbc_options
 user options selections that apply to this session [詳細]

型定義

typedef _SMBCSRV SMBCSRV
 Server handle
typedef _SMBCFILE SMBCFILE
 File or directory handle
typedef _SMBCCTX SMBCCTX
 File or directory handle
typedef void(*) smbc_get_auth_data_fn (const char *srv, const char *shr, char *wg, int wglen, char *un, int unlen, char *pw, int pwlen)
 Authentication callback function type (traditional method)
typedef void(*) smbc_get_auth_data_with_context_fn (SMBCCTX *c, const char *srv, const char *shr, char *wg, int wglen, char *un, int unlen, char *pw, int pwlen)
 Authentication callback function type (method that includes context)
typedef void(*) smbc_list_print_job_fn (struct print_job_info *i)
 Print job info callback function type.
typedef int(*) smbc_check_server_fn (SMBCCTX *c, SMBCSRV *srv)
 Check if a server is still good
typedef int(*) smbc_remove_unused_server_fn (SMBCCTX *c, SMBCSRV *srv)
 Remove a server if unused
typedef int(*) smbc_add_cached_srv_fn (SMBCCTX *c, SMBCSRV *srv, const char *server, const char *share, const char *workgroup, const char *username)
 Add a server to the cache system
typedef SMBCSRV *(*) smbc_get_cached_srv_fn (SMBCCTX *c, const char *server, const char *share, const char *workgroup, const char *username)
 Look up a server in the cache system
typedef int(*) smbc_remove_cached_srv_fn (SMBCCTX *c, SMBCSRV *srv)
 Check if a server is still good
typedef int(*) smbc_purge_cached_fn (SMBCCTX *c)
 Try to remove all servers from the cache system and disconnect

列挙型

enum  smbc_share_mode {
  SMBC_SHAREMODE_DENY_DOS = 0, SMBC_SHAREMODE_DENY_ALL = 1, SMBC_SHAREMODE_DENY_WRITE = 2,
  SMBC_SHAREMODE_DENY_READ = 3, SMBC_SHAREMODE_DENY_NONE = 4, SMBC_SHAREMODE_DENY_FCB = 7
}

関数

SMBCCTXsmbc_new_context (void)
 Create a new SBMCCTX (a context).
int smbc_free_context (SMBCCTX *context, int shutdown_ctx)
 Delete a SBMCCTX (a context) acquired from smbc_new_context().
void smbc_option_set (SMBCCTX *context, char *option_name,...)
 Each time the context structure is changed, we have binary backward compatibility issues.
void * smbc_option_get (SMBCCTX *context, char *option_name)
SMBCCTXsmbc_init_context (SMBCCTX *context)
 Initialize a SBMCCTX (a context).
int smbc_init (smbc_get_auth_data_fn fn, int debug)
 Initialize the samba client library.
SMBCCTXsmbc_set_context (SMBCCTX *new_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 *furl)
 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_chown (const char *url, uid_t owner, gid_t group)
 Change the ownership of a file or directory.
int smbc_chmod (const char *url, mode_t mode)
 Change the permissions of a file.
int smbc_utimes (const char *url, 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 *url, const char *name, const void *value, size_t size, int flags)
 Set extended attributes for a file.
int smbc_lsetxattr (const char *url, 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 *url, const char *name, const void *value, size_t size)
 Get extended attributes for a file.
int smbc_lgetxattr (const char *url, 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 *url, const char *name)
 Remove extended attributes for a file.
int smbc_lremovexattr (const char *url, 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 *url, char *list, size_t size)
 List the supported extended attribute names associated with a file
int smbc_llistxattr (const char *url, 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
int smbc_remove_unused_server (SMBCCTX *context, SMBCSRV *srv)
 Remove a server from the cached server list it's unused.
int smbc_urldecode (char *dest, char *src, size_t max_dest_len)
 Convert strings of xx to their single character equivalent.
int smbc_urlencode (char *dest, char *src, int max_dest_len)
const char * smbc_version (void)
 Return the version of the linked Samba code, and thus the version of the libsmbclient code.


列挙型

enum smbc_share_mode

列挙型の値:
SMBC_SHAREMODE_DENY_DOS 
SMBC_SHAREMODE_DENY_ALL 
SMBC_SHAREMODE_DENY_WRITE 
SMBC_SHAREMODE_DENY_READ 
SMBC_SHAREMODE_DENY_NONE 
SMBC_SHAREMODE_DENY_FCB 

libsmbclient.h148 行で定義されています。


関数

void* smbc_option_get ( SMBCCTX context,
char *  option_name 
)

libsmbclient.c6450 行で定義されています。

参照先 smbc_internal_data::_auth_fn_with_contextsmbc_internal_data::_debug_stderrsmbc_internal_data::_full_time_namessmbc_internal_data::_user_data_SMBCCTX::internal.

06452 {
06453         if (strcmp(option_name, "debug_stderr") == 0) {
06454                 /*
06455                  * Log to standard error instead of standard output.
06456                  */
06457 #if defined(__intptr_t_defined) || defined(HAVE_INTPTR_T)
06458                 return (void *) (intptr_t) context->internal->_debug_stderr;
06459 #else
06460                 return (void *) context->internal->_debug_stderr;
06461 #endif
06462         } else if (strcmp(option_name, "full_time_names") == 0) {
06463                 /*
06464                  * Use new-style time attribute names, e.g. WRITE_TIME rather
06465                  * than the old-style names such as M_TIME.  This allows also
06466                  * setting/getting CREATE_TIME which was previously
06467                  * unimplemented.  (Note that the old C_TIME was supposed to
06468                  * be CHANGE_TIME but was confused and sometimes referred to
06469                  * CREATE_TIME.)
06470                  */
06471 #if defined(__intptr_t_defined) || defined(HAVE_INTPTR_T)
06472                 return (void *) (intptr_t) context->internal->_full_time_names;
06473 #else
06474                 return (void *) context->internal->_full_time_names;
06475 #endif
06476 
06477         } else if (strcmp(option_name, "auth_function") == 0) {
06478                 /*
06479                  * Use the new-style authentication function which includes
06480                  * the context.
06481                  */
06482                 return (void *) context->internal->_auth_fn_with_context;
06483         } else if (strcmp(option_name, "user_data") == 0) {
06484                 /*
06485                  * Save a user data handle which may be retrieved by the user
06486                  * with smbc_option_get()
06487                  */
06488                 return context->internal->_user_data;
06489         }
06490 
06491         return NULL;
06492 }

int smbc_chown ( const char *  url,
uid_t  owner,
gid_t  group 
)

Change the ownership of a file or directory.

引数:
url The smb url of the file or directory to change ownership of.
owner I have no idea?
group I have not idea?
戻り値:
0 on success, < 0 on error with errno set:
  • EPERM The effective UID does not match the owner of the file, and is not zero; or the owner or group were specified incorrectly.
  • ENOENT The file does not exist.
  • ENOMEM Insufficient was available.
  • ENOENT file or directory does not exist
TODO:
Are we actually going to be able to implement this function
TODO:
How do we abstract owner and group uid and gid?

int smbc_urlencode ( char *  dest,
char *  src,
int  max_dest_len 
)

libsmbclient.c203 行で定義されています。

参照元 smbc_readdir_internal().

00204 {
00205         char hex[] = "0123456789ABCDEF";
00206 
00207         for (; *src != '\0' && max_dest_len >= 3; src++) {
00208 
00209                 if ((*src < '0' &&
00210                      *src != '-' &&
00211                      *src != '.') ||
00212                     (*src > '9' &&
00213                      *src < 'A') ||
00214                     (*src > 'Z' &&
00215                      *src < 'a' &&
00216                      *src != '_') ||
00217                     (*src > 'z')) {
00218                         *dest++ = '%';
00219                         *dest++ = hex[(*src >> 4) & 0x0f];
00220                         *dest++ = hex[*src & 0x0f];
00221                         max_dest_len -= 3;
00222                 } else {
00223                         *dest++ = *src;
00224                         max_dest_len--;
00225                 }
00226         }
00227 
00228         *dest++ = '\0';
00229         max_dest_len--;
00230         
00231         return max_dest_len;
00232 }


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