libsmbclient
Data Structures | Defines | Typedefs | Enumerations | Functions
/home/adnan/Downloads/libsmbclient/libsmbclient-dev_2%3a3.5.11~dfsg-1ubuntu2.1_amd64/usr/include/libsmbclient.h File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <fcntl.h>
#include <utime.h>

Go to the source code of this file.

Data Structures

struct  smbc_dirent
struct  print_job_info
struct  _SMBCCTX
struct  _SMBCCTX::_smbc_callbacks
struct  _SMBCCTX::_smbc_options

Defines

#define DEPRECATED_SMBC_INTERFACE
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS   64
#define SMBC_BASE_FD   10000
#define SMBC_WORKGROUP   1
#define SMBC_SERVER   2
#define SMBC_FILE_SHARE   3
#define SMBC_PRINTER_SHARE   4
#define SMBC_COMMS_SHARE   5
#define SMBC_IPC_SHARE   6
#define SMBC_DIR   7
#define SMBC_FILE   8
#define SMBC_LINK   9
#define SMBC_XATTR_FLAG_CREATE   0x1
#define SMBC_XATTR_FLAG_REPLACE   0x2
#define SMBC_DOS_MODE_READONLY   0x01
#define SMBC_DOS_MODE_HIDDEN   0x02
#define SMBC_DOS_MODE_SYSTEM   0x04
#define SMBC_DOS_MODE_VOLUME_ID   0x08
#define SMBC_DOS_MODE_DIRECTORY   0x10
#define SMBC_DOS_MODE_ARCHIVE   0x20
#define ENOATTR   ENOENT
#define SMB_CTX_FLAG_USE_KERBEROS   (1 << 0)
#define SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS   (1 << 1)
#define SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON   (1 << 2)
#define SMB_CTX_FLAG_USE_CCACHE   (1 << 3)

Typedefs

typedef enum smbc_share_mode smbc_share_mode
typedef enum smbc_smb_encrypt_level smbc_smb_encrypt_level
typedef enum smbc_vfs_feature smbc_vfs_feature
typedef int smbc_bool
typedef struct _SMBCSRV SMBCSRV
typedef struct _SMBCFILE SMBCFILE
typedef struct _SMBCCTX SMBCCTX
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)
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)
typedef void(* smbc_list_print_job_fn )(struct print_job_info *i)
typedef int(* smbc_check_server_fn )(SMBCCTX *c, SMBCSRV *srv)
typedef int(* smbc_remove_unused_server_fn )(SMBCCTX *c, SMBCSRV *srv)
typedef int(* smbc_add_cached_srv_fn )(SMBCCTX *c, SMBCSRV *srv, const char *server, const char *share, const char *workgroup, const char *username)
typedef SMBCSRV *(* smbc_get_cached_srv_fn )(SMBCCTX *c, const char *server, const char *share, const char *workgroup, const char *username)
typedef int(* smbc_remove_cached_srv_fn )(SMBCCTX *c, SMBCSRV *srv)
typedef int(* smbc_purge_cached_fn )(SMBCCTX *c)
typedef SMBCFILE *(* smbc_open_fn )(SMBCCTX *c, const char *fname, int flags, mode_t mode)
typedef SMBCFILE *(* smbc_creat_fn )(SMBCCTX *c, const char *path, mode_t mode)
typedef ssize_t(* smbc_read_fn )(SMBCCTX *c, SMBCFILE *file, void *buf, size_t count)
typedef ssize_t(* smbc_write_fn )(SMBCCTX *c, SMBCFILE *file, const void *buf, size_t count)
typedef int(* smbc_unlink_fn )(SMBCCTX *c, const char *fname)
typedef int(* smbc_rename_fn )(SMBCCTX *ocontext, const char *oname, SMBCCTX *ncontext, const char *nname)
typedef off_t(* smbc_lseek_fn )(SMBCCTX *c, SMBCFILE *file, off_t offset, int whence)
typedef int(* smbc_stat_fn )(SMBCCTX *c, const char *fname, struct stat *st)
typedef int(* smbc_fstat_fn )(SMBCCTX *c, SMBCFILE *file, struct stat *st)
typedef int(* smbc_statvfs_fn )(SMBCCTX *c, char *path, struct statvfs *st)
typedef int(* smbc_fstatvfs_fn )(SMBCCTX *c, SMBCFILE *file, struct statvfs *st)
typedef int(* smbc_ftruncate_fn )(SMBCCTX *c, SMBCFILE *f, off_t size)
typedef int(* smbc_close_fn )(SMBCCTX *c, SMBCFILE *file)
typedef SMBCFILE *(* smbc_opendir_fn )(SMBCCTX *c, const char *fname)
typedef int(* smbc_closedir_fn )(SMBCCTX *c, SMBCFILE *dir)
typedef struct smbc_dirent *(* smbc_readdir_fn )(SMBCCTX *c, SMBCFILE *dir)
typedef int(* smbc_getdents_fn )(SMBCCTX *c, SMBCFILE *dir, struct smbc_dirent *dirp, int count)
typedef int(* smbc_mkdir_fn )(SMBCCTX *c, const char *fname, mode_t mode)
typedef int(* smbc_rmdir_fn )(SMBCCTX *c, const char *fname)
typedef off_t(* smbc_telldir_fn )(SMBCCTX *c, SMBCFILE *dir)
typedef int(* smbc_lseekdir_fn )(SMBCCTX *c, SMBCFILE *dir, off_t offset)
typedef int(* smbc_fstatdir_fn )(SMBCCTX *c, SMBCFILE *dir, struct stat *st)
typedef int(* smbc_chmod_fn )(SMBCCTX *c, const char *fname, mode_t mode)
typedef int(* smbc_utimes_fn )(SMBCCTX *c, const char *fname, struct timeval *tbuf)
typedef int(* smbc_setxattr_fn )(SMBCCTX *context, const char *fname, const char *name, const void *value, size_t size, int flags)
typedef int(* smbc_getxattr_fn )(SMBCCTX *context, const char *fname, const char *name, const void *value, size_t size)
typedef int(* smbc_removexattr_fn )(SMBCCTX *context, const char *fname, const char *name)
typedef int(* smbc_listxattr_fn )(SMBCCTX *context, const char *fname, char *list, size_t size)
typedef int(* smbc_print_file_fn )(SMBCCTX *c_file, const char *fname, SMBCCTX *c_print, const char *printq)
typedef SMBCFILE *(* smbc_open_print_job_fn )(SMBCCTX *c, const char *fname)
typedef int(* smbc_list_print_jobs_fn )(SMBCCTX *c, const char *fname, smbc_list_print_job_fn fn)
typedef int(* smbc_unlink_print_job_fn )(SMBCCTX *c, const char *fname, int id)

Enumerations

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
}
enum  smbc_smb_encrypt_level { SMBC_ENCRYPTLEVEL_NONE = 0, SMBC_ENCRYPTLEVEL_REQUEST = 1, SMBC_ENCRYPTLEVEL_REQUIRE = 2 }
enum  smbc_vfs_feature { SMBC_VFS_FEATURE_RDONLY = (1 << 0), SMBC_VFS_FEATURE_DFS = (1 << 28), SMBC_VFS_FEATURE_CASE_INSENSITIVE = (1 << 29), SMBC_VFS_FEATURE_NO_UNIXCIFS = (1 << 30) }

Functions

int smbc_getDebug (SMBCCTX *c)
void smbc_setDebug (SMBCCTX *c, int debug)
char * smbc_getNetbiosName (SMBCCTX *c)
void smbc_setNetbiosName (SMBCCTX *c, char *netbios_name)
char * smbc_getWorkgroup (SMBCCTX *c)
void smbc_setWorkgroup (SMBCCTX *c, char *workgroup)
char * smbc_getUser (SMBCCTX *c)
void smbc_setUser (SMBCCTX *c, char *user)
int smbc_getTimeout (SMBCCTX *c)
void smbc_setTimeout (SMBCCTX *c, int timeout)
smbc_bool smbc_getOptionDebugToStderr (SMBCCTX *c)
void smbc_setOptionDebugToStderr (SMBCCTX *c, smbc_bool b)
smbc_bool smbc_getOptionFullTimeNames (SMBCCTX *c)
void smbc_setOptionFullTimeNames (SMBCCTX *c, smbc_bool b)
smbc_share_mode smbc_getOptionOpenShareMode (SMBCCTX *c)
void smbc_setOptionOpenShareMode (SMBCCTX *c, smbc_share_mode share_mode)
void * smbc_getOptionUserData (SMBCCTX *c)
void smbc_setOptionUserData (SMBCCTX *c, void *user_data)
smbc_smb_encrypt_level smbc_getOptionSmbEncryptionLevel (SMBCCTX *c)
void smbc_setOptionSmbEncryptionLevel (SMBCCTX *c, smbc_smb_encrypt_level level)
smbc_bool smbc_getOptionCaseSensitive (SMBCCTX *c)
void smbc_setOptionCaseSensitive (SMBCCTX *c, smbc_bool b)
int smbc_getOptionBrowseMaxLmbCount (SMBCCTX *c)
void smbc_setOptionBrowseMaxLmbCount (SMBCCTX *c, int count)
smbc_bool smbc_getOptionUrlEncodeReaddirEntries (SMBCCTX *c)
void smbc_setOptionUrlEncodeReaddirEntries (SMBCCTX *c, smbc_bool b)
smbc_bool smbc_getOptionOneSharePerServer (SMBCCTX *c)
void smbc_setOptionOneSharePerServer (SMBCCTX *c, smbc_bool b)
smbc_bool smbc_getOptionUseKerberos (SMBCCTX *c)
void smbc_setOptionUseKerberos (SMBCCTX *c, smbc_bool b)
smbc_bool smbc_getOptionFallbackAfterKerberos (SMBCCTX *c)
void smbc_setOptionFallbackAfterKerberos (SMBCCTX *c, smbc_bool b)
smbc_bool smbc_getOptionNoAutoAnonymousLogin (SMBCCTX *c)
void smbc_setOptionNoAutoAnonymousLogin (SMBCCTX *c, smbc_bool b)
smbc_bool smbc_getOptionUseCCache (SMBCCTX *c)
void smbc_setOptionUseCCache (SMBCCTX *c, smbc_bool b)
smbc_get_auth_data_fn smbc_getFunctionAuthData (SMBCCTX *c)
void smbc_setFunctionAuthData (SMBCCTX *c, smbc_get_auth_data_fn fn)
smbc_get_auth_data_with_context_fn smbc_getFunctionAuthDataWithContext (SMBCCTX *c)
void smbc_setFunctionAuthDataWithContext (SMBCCTX *c, smbc_get_auth_data_with_context_fn fn)
smbc_check_server_fn smbc_getFunctionCheckServer (SMBCCTX *c)
void smbc_setFunctionCheckServer (SMBCCTX *c, smbc_check_server_fn fn)
smbc_remove_unused_server_fn smbc_getFunctionRemoveUnusedServer (SMBCCTX *c)
void smbc_setFunctionRemoveUnusedServer (SMBCCTX *c, smbc_remove_unused_server_fn fn)
smbc_add_cached_srv_fn smbc_getFunctionAddCachedServer (SMBCCTX *c)
void smbc_setFunctionAddCachedServer (SMBCCTX *c, smbc_add_cached_srv_fn fn)
smbc_get_cached_srv_fn smbc_getFunctionGetCachedServer (SMBCCTX *c)
void smbc_setFunctionGetCachedServer (SMBCCTX *c, smbc_get_cached_srv_fn fn)
smbc_remove_cached_srv_fn smbc_getFunctionRemoveCachedServer (SMBCCTX *c)
void smbc_setFunctionRemoveCachedServer (SMBCCTX *c, smbc_remove_cached_srv_fn fn)
smbc_purge_cached_fn smbc_getFunctionPurgeCachedServers (SMBCCTX *c)
void smbc_setFunctionPurgeCachedServers (SMBCCTX *c, smbc_purge_cached_fn fn)
struct smbc_server_cache * smbc_getServerCacheData (SMBCCTX *c)
void smbc_setServerCacheData (SMBCCTX *c, struct smbc_server_cache *cache)
smbc_open_fn smbc_getFunctionOpen (SMBCCTX *c)
void smbc_setFunctionOpen (SMBCCTX *c, smbc_open_fn fn)
smbc_creat_fn smbc_getFunctionCreat (SMBCCTX *c)
void smbc_setFunctionCreat (SMBCCTX *c, smbc_creat_fn)
smbc_read_fn smbc_getFunctionRead (SMBCCTX *c)
void smbc_setFunctionRead (SMBCCTX *c, smbc_read_fn fn)
smbc_write_fn smbc_getFunctionWrite (SMBCCTX *c)
void smbc_setFunctionWrite (SMBCCTX *c, smbc_write_fn fn)
smbc_unlink_fn smbc_getFunctionUnlink (SMBCCTX *c)
void smbc_setFunctionUnlink (SMBCCTX *c, smbc_unlink_fn fn)
smbc_rename_fn smbc_getFunctionRename (SMBCCTX *c)
void smbc_setFunctionRename (SMBCCTX *c, smbc_rename_fn fn)
smbc_lseek_fn smbc_getFunctionLseek (SMBCCTX *c)
void smbc_setFunctionLseek (SMBCCTX *c, smbc_lseek_fn fn)
smbc_stat_fn smbc_getFunctionStat (SMBCCTX *c)
void smbc_setFunctionStat (SMBCCTX *c, smbc_stat_fn fn)
smbc_fstat_fn smbc_getFunctionFstat (SMBCCTX *c)
void smbc_setFunctionFstat (SMBCCTX *c, smbc_fstat_fn fn)
smbc_statvfs_fn smbc_getFunctionStatVFS (SMBCCTX *c)
void smbc_setFunctionStatVFS (SMBCCTX *c, smbc_statvfs_fn fn)
smbc_fstatvfs_fn smbc_getFunctionFstatVFS (SMBCCTX *c)
void smbc_setFunctionFstatVFS (SMBCCTX *c, smbc_fstatvfs_fn fn)
smbc_ftruncate_fn smbc_getFunctionFtruncate (SMBCCTX *c)
void smbc_setFunctionFtruncate (SMBCCTX *c, smbc_ftruncate_fn fn)
smbc_close_fn smbc_getFunctionClose (SMBCCTX *c)
void smbc_setFunctionClose (SMBCCTX *c, smbc_close_fn fn)
smbc_opendir_fn smbc_getFunctionOpendir (SMBCCTX *c)
void smbc_setFunctionOpendir (SMBCCTX *c, smbc_opendir_fn fn)
smbc_closedir_fn smbc_getFunctionClosedir (SMBCCTX *c)
void smbc_setFunctionClosedir (SMBCCTX *c, smbc_closedir_fn fn)
smbc_readdir_fn smbc_getFunctionReaddir (SMBCCTX *c)
void smbc_setFunctionReaddir (SMBCCTX *c, smbc_readdir_fn fn)
smbc_getdents_fn smbc_getFunctionGetdents (SMBCCTX *c)
void smbc_setFunctionGetdents (SMBCCTX *c, smbc_getdents_fn fn)
smbc_mkdir_fn smbc_getFunctionMkdir (SMBCCTX *c)
void smbc_setFunctionMkdir (SMBCCTX *c, smbc_mkdir_fn fn)
smbc_rmdir_fn smbc_getFunctionRmdir (SMBCCTX *c)
void smbc_setFunctionRmdir (SMBCCTX *c, smbc_rmdir_fn fn)
smbc_telldir_fn smbc_getFunctionTelldir (SMBCCTX *c)
void smbc_setFunctionTelldir (SMBCCTX *c, smbc_telldir_fn fn)
smbc_lseekdir_fn smbc_getFunctionLseekdir (SMBCCTX *c)
void smbc_setFunctionLseekdir (SMBCCTX *c, smbc_lseekdir_fn fn)
smbc_fstatdir_fn smbc_getFunctionFstatdir (SMBCCTX *c)
void smbc_setFunctionFstatdir (SMBCCTX *c, smbc_fstatdir_fn fn)
smbc_chmod_fn smbc_getFunctionChmod (SMBCCTX *c)
void smbc_setFunctionChmod (SMBCCTX *c, smbc_chmod_fn fn)
smbc_utimes_fn smbc_getFunctionUtimes (SMBCCTX *c)
void smbc_setFunctionUtimes (SMBCCTX *c, smbc_utimes_fn fn)
smbc_setxattr_fn smbc_getFunctionSetxattr (SMBCCTX *c)
void smbc_setFunctionSetxattr (SMBCCTX *c, smbc_setxattr_fn fn)
smbc_getxattr_fn smbc_getFunctionGetxattr (SMBCCTX *c)
void smbc_setFunctionGetxattr (SMBCCTX *c, smbc_getxattr_fn fn)
smbc_removexattr_fn smbc_getFunctionRemovexattr (SMBCCTX *c)
void smbc_setFunctionRemovexattr (SMBCCTX *c, smbc_removexattr_fn fn)
smbc_listxattr_fn smbc_getFunctionListxattr (SMBCCTX *c)
void smbc_setFunctionListxattr (SMBCCTX *c, smbc_listxattr_fn fn)
smbc_print_file_fn smbc_getFunctionPrintFile (SMBCCTX *c)
void smbc_setFunctionPrintFile (SMBCCTX *c, smbc_print_file_fn fn)
smbc_open_print_job_fn smbc_getFunctionOpenPrintJob (SMBCCTX *c)
void smbc_setFunctionOpenPrintJob (SMBCCTX *c, smbc_open_print_job_fn fn)
smbc_list_print_jobs_fn smbc_getFunctionListPrintJobs (SMBCCTX *c)
void smbc_setFunctionListPrintJobs (SMBCCTX *c, smbc_list_print_jobs_fn fn)
smbc_unlink_print_job_fn smbc_getFunctionUnlinkPrintJob (SMBCCTX *c)
void smbc_setFunctionUnlinkPrintJob (SMBCCTX *c, smbc_unlink_print_job_fn fn)
SMBCCTXsmbc_new_context (void)
int smbc_free_context (SMBCCTX *context, int shutdown_ctx)
void smbc_option_set (SMBCCTX *context, char *option_name,...)
void * smbc_option_get (SMBCCTX *context, char *option_name)
SMBCCTXsmbc_init_context (SMBCCTX *context)
int smbc_init (smbc_get_auth_data_fn fn, int debug)
SMBCCTXsmbc_set_context (SMBCCTX *new_context)
int smbc_open (const char *furl, int flags, mode_t mode)
int smbc_creat (const char *furl, mode_t mode)
ssize_t smbc_read (int fd, void *buf, size_t bufsize)
ssize_t smbc_write (int fd, const void *buf, size_t bufsize)
off_t smbc_lseek (int fd, off_t offset, int whence)
int smbc_close (int fd)
int smbc_unlink (const char *furl)
int smbc_rename (const char *ourl, const char *nurl)
int smbc_opendir (const char *durl)
int smbc_closedir (int dh)
int smbc_getdents (unsigned int dh, struct smbc_dirent *dirp, int count)
struct smbc_direntsmbc_readdir (unsigned int dh)
off_t smbc_telldir (int dh)
int smbc_lseekdir (int fd, off_t offset)
int smbc_mkdir (const char *durl, mode_t mode)
int smbc_rmdir (const char *durl)
int smbc_stat (const char *url, struct stat *st)
int smbc_fstat (int fd, struct stat *st)
int smbc_statvfs (char *url, struct statvfs *st)
int smbc_fstatvfs (int fd, struct statvfs *st)
int smbc_ftruncate (int fd, off_t size)
int smbc_chmod (const char *url, mode_t mode)
int smbc_utimes (const char *url, struct timeval *tbuf)
int smbc_setxattr (const char *url, const char *name, const void *value, size_t size, int flags)
int smbc_lsetxattr (const char *url, const char *name, const void *value, size_t size, int flags)
int smbc_fsetxattr (int fd, const char *name, const void *value, size_t size, int flags)
int smbc_getxattr (const char *url, const char *name, const void *value, size_t size)
int smbc_lgetxattr (const char *url, const char *name, const void *value, size_t size)
int smbc_fgetxattr (int fd, const char *name, const void *value, size_t size)
int smbc_removexattr (const char *url, const char *name)
int smbc_lremovexattr (const char *url, const char *name)
int smbc_fremovexattr (int fd, const char *name)
int smbc_listxattr (const char *url, char *list, size_t size)
int smbc_llistxattr (const char *url, char *list, size_t size)
int smbc_flistxattr (int fd, char *list, size_t size)
int smbc_print_file (const char *fname, const char *printq)
int smbc_open_print_job (const char *fname)
int smbc_list_print_jobs (const char *purl, smbc_list_print_job_fn fn)
int smbc_unlink_print_job (const char *purl, int id)
int smbc_remove_unused_server (SMBCCTX *context, SMBCSRV *srv)
int smbc_urldecode (char *dest, char *src, size_t max_dest_len)
int smbc_urlencode (char *dest, char *src, int max_dest_len)
const char * smbc_version (void)
void smbc_set_credentials (const char *workgroup, const char *user, const char *password, smbc_bool use_kerberos, const char *signing_state)
void smbc_set_credentials_with_fallback (SMBCCTX *ctx, const char *workgroup, const char *user, const char *password)
void smbc_thread_posix (void)
void smbc_thread_impl (int(*create_mutex)(const char *lockname, void **pplock, const char *location), void(*destroy_mutex)(void *plock, const char *location), int(*lock_mutex)(void *plock, int lock_type, const char *location), int(*create_tls)(const char *keyname, void **ppkey, const char *location), void(*destroy_tls)(void **ppkey, const char *location), int(*set_tls)(void *pkey, const void *pval, const char *location), void *(*get_tls)(void *pkey, const char *location))

Define Documentation

#define _FILE_OFFSET_BITS   64

Definition at line 84 of file libsmbclient.h.

#define _LARGEFILE64_SOURCE

Definition at line 83 of file libsmbclient.h.

#define DEPRECATED_SMBC_INTERFACE

Definition at line 32 of file libsmbclient.h.

#define ENOATTR   ENOENT

Definition at line 202 of file libsmbclient.h.

#define SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS   (1 << 1)

Definition at line 274 of file libsmbclient.h.

#define SMB_CTX_FLAG_USE_CCACHE   (1 << 3)

Definition at line 276 of file libsmbclient.h.

#define SMB_CTX_FLAG_USE_KERBEROS   (1 << 0)

Definition at line 273 of file libsmbclient.h.

#define SMBC_BASE_FD   10000

Definition at line 86 of file libsmbclient.h.

#define SMBC_COMMS_SHARE   5

Definition at line 92 of file libsmbclient.h.

#define SMBC_DIR   7

Definition at line 94 of file libsmbclient.h.

#define SMBC_DOS_MODE_ARCHIVE   0x20

Definition at line 153 of file libsmbclient.h.

#define SMBC_DOS_MODE_DIRECTORY   0x10

Definition at line 152 of file libsmbclient.h.

#define SMBC_DOS_MODE_HIDDEN   0x02

Definition at line 149 of file libsmbclient.h.

#define SMBC_DOS_MODE_READONLY   0x01

Definition at line 148 of file libsmbclient.h.

#define SMBC_DOS_MODE_SYSTEM   0x04

Definition at line 150 of file libsmbclient.h.

#define SMBC_DOS_MODE_VOLUME_ID   0x08

Definition at line 151 of file libsmbclient.h.

#define SMBC_FILE   8

Definition at line 95 of file libsmbclient.h.

#define SMBC_FILE_SHARE   3

Definition at line 90 of file libsmbclient.h.

#define SMBC_IPC_SHARE   6

Definition at line 93 of file libsmbclient.h.

#define SMBC_LINK   9

Definition at line 96 of file libsmbclient.h.

#define SMBC_PRINTER_SHARE   4

Definition at line 91 of file libsmbclient.h.

#define SMBC_SERVER   2

Definition at line 89 of file libsmbclient.h.

#define SMBC_WORKGROUP   1

Definition at line 88 of file libsmbclient.h.

#define SMBC_XATTR_FLAG_CREATE   0x1

Definition at line 139 of file libsmbclient.h.

#define SMBC_XATTR_FLAG_REPLACE   0x2

Definition at line 140 of file libsmbclient.h.

#define SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON   (1 << 2)

Definition at line 275 of file libsmbclient.h.


Typedef Documentation

typedef int smbc_bool

Definition at line 198 of file libsmbclient.h.

typedef int(* smbc_chmod_fn)(SMBCCTX *c, const char *fname, mode_t mode)

Definition at line 977 of file libsmbclient.h.

typedef int(* smbc_close_fn)(SMBCCTX *c, SMBCFILE *file)

Definition at line 906 of file libsmbclient.h.

typedef int(* smbc_closedir_fn)(SMBCCTX *c, SMBCFILE *dir)

Definition at line 924 of file libsmbclient.h.

typedef SMBCFILE*(* smbc_creat_fn)(SMBCCTX *c, const char *path, mode_t mode)

Definition at line 837 of file libsmbclient.h.

typedef int(* smbc_fstat_fn)(SMBCCTX *c, SMBCFILE *file, struct stat *st)

Definition at line 882 of file libsmbclient.h.

typedef int(* smbc_fstatdir_fn)(SMBCCTX *c, SMBCFILE *dir, struct stat *st)

Definition at line 963 of file libsmbclient.h.

typedef int(* smbc_fstatvfs_fn)(SMBCCTX *c, SMBCFILE *file, struct statvfs *st)

Definition at line 894 of file libsmbclient.h.

typedef int(* smbc_ftruncate_fn)(SMBCCTX *c, SMBCFILE *f, off_t size)

Definition at line 900 of file libsmbclient.h.

typedef int(* smbc_getdents_fn)(SMBCCTX *c, SMBCFILE *dir, struct smbc_dirent *dirp, int count)

Definition at line 934 of file libsmbclient.h.

typedef int(* smbc_getxattr_fn)(SMBCCTX *context, const char *fname, const char *name, const void *value, size_t size)

Definition at line 998 of file libsmbclient.h.

typedef int(* smbc_list_print_jobs_fn)(SMBCCTX *c, const char *fname, smbc_list_print_job_fn fn)

Definition at line 1040 of file libsmbclient.h.

typedef int(* smbc_listxattr_fn)(SMBCCTX *context, const char *fname, char *list, size_t size)

Definition at line 1012 of file libsmbclient.h.

typedef off_t(* smbc_lseek_fn)(SMBCCTX *c, SMBCFILE *file, off_t offset, int whence)

Definition at line 869 of file libsmbclient.h.

typedef int(* smbc_lseekdir_fn)(SMBCCTX *c, SMBCFILE *dir, off_t offset)

Definition at line 957 of file libsmbclient.h.

typedef int(* smbc_mkdir_fn)(SMBCCTX *c, const char *fname, mode_t mode)

Definition at line 941 of file libsmbclient.h.

typedef SMBCFILE*(* smbc_open_fn)(SMBCCTX *c, const char *fname, int flags, mode_t mode)

Definition at line 830 of file libsmbclient.h.

typedef SMBCFILE*(* smbc_open_print_job_fn)(SMBCCTX *c, const char *fname)

Definition at line 1034 of file libsmbclient.h.

typedef SMBCFILE*(* smbc_opendir_fn)(SMBCCTX *c, const char *fname)

Definition at line 919 of file libsmbclient.h.

typedef int(* smbc_print_file_fn)(SMBCCTX *c_file, const char *fname, SMBCCTX *c_print, const char *printq)

Definition at line 1027 of file libsmbclient.h.

typedef ssize_t(* smbc_read_fn)(SMBCCTX *c, SMBCFILE *file, void *buf, size_t count)

Definition at line 843 of file libsmbclient.h.

typedef struct smbc_dirent*(* smbc_readdir_fn)(SMBCCTX *c, SMBCFILE *dir)

Definition at line 929 of file libsmbclient.h.

typedef int(* smbc_removexattr_fn)(SMBCCTX *context, const char *fname, const char *name)

Definition at line 1006 of file libsmbclient.h.

typedef int(* smbc_rename_fn)(SMBCCTX *ocontext, const char *oname, SMBCCTX *ncontext, const char *nname)

Definition at line 862 of file libsmbclient.h.

typedef int(* smbc_rmdir_fn)(SMBCCTX *c, const char *fname)

Definition at line 947 of file libsmbclient.h.

typedef int(* smbc_setxattr_fn)(SMBCCTX *context, const char *fname, const char *name, const void *value, size_t size, int flags)

Definition at line 989 of file libsmbclient.h.

Values for option SMB Encryption Level, as set and retrieved with smbc_setOptionSmbEncryptionLevel() and smbc_getOptionSmbEncryptionLevel()

typedef int(* smbc_stat_fn)(SMBCCTX *c, const char *fname, struct stat *st)

Definition at line 876 of file libsmbclient.h.

typedef int(* smbc_statvfs_fn)(SMBCCTX *c, char *path, struct statvfs *st)

Definition at line 888 of file libsmbclient.h.

typedef off_t(* smbc_telldir_fn)(SMBCCTX *c, SMBCFILE *dir)

Definition at line 952 of file libsmbclient.h.

typedef int(* smbc_unlink_fn)(SMBCCTX *c, const char *fname)

Definition at line 857 of file libsmbclient.h.

typedef int(* smbc_unlink_print_job_fn)(SMBCCTX *c, const char *fname, int id)

Definition at line 1047 of file libsmbclient.h.

typedef int(* smbc_utimes_fn)(SMBCCTX *c, const char *fname, struct timeval *tbuf)

Definition at line 983 of file libsmbclient.h.

Capabilities set in the f_flag field of struct statvfs, from smbc_statvfs(). These may be OR-ed together to reflect a full set of available capabilities.

typedef ssize_t(* smbc_write_fn)(SMBCCTX *c, SMBCFILE *file, const void *buf, size_t count)

Definition at line 850 of file libsmbclient.h.


Enumeration Type Documentation

Enumerator:
SMBC_SHAREMODE_DENY_DOS 
SMBC_SHAREMODE_DENY_ALL 
SMBC_SHAREMODE_DENY_WRITE 
SMBC_SHAREMODE_DENY_READ 
SMBC_SHAREMODE_DENY_NONE 
SMBC_SHAREMODE_DENY_FCB 

Definition at line 159 of file libsmbclient.h.

Values for option SMB Encryption Level, as set and retrieved with smbc_setOptionSmbEncryptionLevel() and smbc_getOptionSmbEncryptionLevel()

Enumerator:
SMBC_ENCRYPTLEVEL_NONE 
SMBC_ENCRYPTLEVEL_REQUEST 
SMBC_ENCRYPTLEVEL_REQUIRE 

Definition at line 174 of file libsmbclient.h.

Capabilities set in the f_flag field of struct statvfs, from smbc_statvfs(). These may be OR-ed together to reflect a full set of available capabilities.

Enumerator:
SMBC_VFS_FEATURE_RDONLY 
SMBC_VFS_FEATURE_DFS 
SMBC_VFS_FEATURE_CASE_INSENSITIVE 
SMBC_VFS_FEATURE_NO_UNIXCIFS 

Definition at line 187 of file libsmbclient.h.


Function Documentation

int smbc_getDebug ( SMBCCTX c)

Get the debug level

smbc_add_cached_srv_fn smbc_getFunctionAddCachedServer ( SMBCCTX c)

Get the function for adding a cached server

smbc_get_auth_data_fn smbc_getFunctionAuthData ( SMBCCTX c)

Get the function for obtaining authentication data

smbc_get_auth_data_with_context_fn smbc_getFunctionAuthDataWithContext ( SMBCCTX c)

Get the new-style authentication function which includes the context.

smbc_check_server_fn smbc_getFunctionCheckServer ( SMBCCTX c)

Get the function for checking if a server is still good

smbc_chmod_fn smbc_getFunctionChmod ( SMBCCTX c)
smbc_close_fn smbc_getFunctionClose ( SMBCCTX c)
smbc_closedir_fn smbc_getFunctionClosedir ( SMBCCTX c)
smbc_creat_fn smbc_getFunctionCreat ( SMBCCTX c)
smbc_fstat_fn smbc_getFunctionFstat ( SMBCCTX c)
smbc_fstatdir_fn smbc_getFunctionFstatdir ( SMBCCTX c)
smbc_fstatvfs_fn smbc_getFunctionFstatVFS ( SMBCCTX c)
smbc_ftruncate_fn smbc_getFunctionFtruncate ( SMBCCTX c)
smbc_get_cached_srv_fn smbc_getFunctionGetCachedServer ( SMBCCTX c)

Get the function for server cache lookup

smbc_getdents_fn smbc_getFunctionGetdents ( SMBCCTX c)
smbc_getxattr_fn smbc_getFunctionGetxattr ( SMBCCTX c)
smbc_list_print_jobs_fn smbc_getFunctionListPrintJobs ( SMBCCTX c)
smbc_listxattr_fn smbc_getFunctionListxattr ( SMBCCTX c)
smbc_lseek_fn smbc_getFunctionLseek ( SMBCCTX c)
smbc_lseekdir_fn smbc_getFunctionLseekdir ( SMBCCTX c)
smbc_mkdir_fn smbc_getFunctionMkdir ( SMBCCTX c)
smbc_open_fn smbc_getFunctionOpen ( SMBCCTX c)
smbc_opendir_fn smbc_getFunctionOpendir ( SMBCCTX c)
smbc_open_print_job_fn smbc_getFunctionOpenPrintJob ( SMBCCTX c)
smbc_print_file_fn smbc_getFunctionPrintFile ( SMBCCTX c)
smbc_purge_cached_fn smbc_getFunctionPurgeCachedServers ( SMBCCTX c)

Get the function for server cache purging. This function tries to remove all cached servers (e.g. on disconnect)

smbc_read_fn smbc_getFunctionRead ( SMBCCTX c)
smbc_readdir_fn smbc_getFunctionReaddir ( SMBCCTX c)
smbc_remove_cached_srv_fn smbc_getFunctionRemoveCachedServer ( SMBCCTX c)

Get the function for server cache removal

smbc_remove_unused_server_fn smbc_getFunctionRemoveUnusedServer ( SMBCCTX c)

Get the function for removing a server if unused

smbc_removexattr_fn smbc_getFunctionRemovexattr ( SMBCCTX c)
smbc_rename_fn smbc_getFunctionRename ( SMBCCTX c)
smbc_rmdir_fn smbc_getFunctionRmdir ( SMBCCTX c)
smbc_setxattr_fn smbc_getFunctionSetxattr ( SMBCCTX c)
smbc_stat_fn smbc_getFunctionStat ( SMBCCTX c)
smbc_statvfs_fn smbc_getFunctionStatVFS ( SMBCCTX c)
smbc_telldir_fn smbc_getFunctionTelldir ( SMBCCTX c)
smbc_unlink_fn smbc_getFunctionUnlink ( SMBCCTX c)
smbc_unlink_print_job_fn smbc_getFunctionUnlinkPrintJob ( SMBCCTX c)
smbc_utimes_fn smbc_getFunctionUtimes ( SMBCCTX c)
smbc_write_fn smbc_getFunctionWrite ( SMBCCTX c)
char* smbc_getNetbiosName ( SMBCCTX c)

Get the netbios name used for making connections

int smbc_getOptionBrowseMaxLmbCount ( SMBCCTX c)

Get from how many local master browsers should the list of workgroups be retrieved. It can take up to 12 minutes or longer after a server becomes a local master browser, for it to have the entire browse list (the list of workgroups/domains) from an entire network. Since a client never knows which local master browser will be found first, the one which is found first and used to retrieve a browse list may have an incomplete or empty browse list. By requesting the browse list from multiple local master browsers, a more complete list can be generated. For small networks (few workgroups), it is recommended that this value be set to 0, causing the browse lists from all found local master browsers to be retrieved and merged. For networks with many workgroups, a suitable value for this variable is probably somewhere around 3. (Default: 3).

smbc_bool smbc_getOptionCaseSensitive ( SMBCCTX c)

Get whether to treat file names as case-sensitive if we can't determine when connecting to the remote share whether the file system is case sensitive. This defaults to FALSE since it's most likely that if we can't retrieve the file system attributes, it's a very old file system that does not support case sensitivity.

smbc_bool smbc_getOptionDebugToStderr ( SMBCCTX c)

Get whether to log to standard error instead of standard output

smbc_bool smbc_getOptionFallbackAfterKerberos ( SMBCCTX c)

Get whether to fallback after kerberos

smbc_bool smbc_getOptionFullTimeNames ( SMBCCTX c)

Get whether to use new-style time attribute names, e.g. WRITE_TIME rather than the old-style names such as M_TIME. This allows also setting/getting CREATE_TIME which was previously unimplemented. (Note that the old C_TIME was supposed to be CHANGE_TIME but was confused and sometimes referred to CREATE_TIME.)

smbc_bool smbc_getOptionNoAutoAnonymousLogin ( SMBCCTX c)

Get whether to automatically select anonymous login

smbc_bool smbc_getOptionOneSharePerServer ( SMBCCTX c)

Get whether to use the same connection for all shares on a server.

Some Windows versions appear to have a limit to the number of concurrent SESSIONs and/or TREE CONNECTions. In one-shot programs (i.e. the program runs and then quickly ends, thereby shutting down all connections), it is probably reasonable to establish a new connection for each share. In long-running applications, the limitation can be avoided by using only a single connection to each server, and issuing a new TREE CONNECT when the share is accessed.

smbc_share_mode smbc_getOptionOpenShareMode ( SMBCCTX c)

Get the share mode to use for files opened with SMBC_open_ctx(). The default is SMBC_SHAREMODE_DENY_NONE.

smbc_smb_encrypt_level smbc_getOptionSmbEncryptionLevel ( SMBCCTX c)

Get the encoded value for encryption level.

smbc_bool smbc_getOptionUrlEncodeReaddirEntries ( SMBCCTX c)

Get whether to url-encode readdir entries.

There is a difference in the desired return strings from smbc_readdir() depending upon whether the filenames are to be displayed to the user, or whether they are to be appended to the path name passed to smbc_opendir() to call a further smbc_ function (e.g. open the file with smbc_open()). In the former case, the filename should be in "human readable" form. In the latter case, the smbc_ functions expect a URL which must be url-encoded. Those functions decode the URL. If, for example, smbc_readdir() returned a file name of "abc%20def.txt", passing a path with this file name attached to smbc_open() would cause smbc_open to attempt to open the file "abc def.txt" since the %20 is decoded into a space.

Set this option to True if the names returned by smbc_readdir() should be url-encoded such that they can be passed back to another smbc_ call. Set it to False if the names returned by smbc_readdir() are to be presented to the user.

For backwards compatibility, this option defaults to False.

smbc_bool smbc_getOptionUseCCache ( SMBCCTX c)

Get whether to enable use of the winbind ccache

smbc_bool smbc_getOptionUseKerberos ( SMBCCTX c)

Get whether to enable use of kerberos

void* smbc_getOptionUserData ( SMBCCTX c)

Retrieve a previously saved user data handle

struct smbc_server_cache* smbc_getServerCacheData ( SMBCCTX c) [read]

Get the function to store private data of the server cache

int smbc_getTimeout ( SMBCCTX c)

Get the timeout used for waiting on connections and response data (in milliseconds)

char* smbc_getUser ( SMBCCTX c)

Get the username used for making connections

char* smbc_getWorkgroup ( SMBCCTX c)

Get the workgroup used for making connections

void* smbc_option_get ( SMBCCTX context,
char *  option_name 
)
void smbc_set_credentials_with_fallback ( SMBCCTX ctx,
const char *  workgroup,
const char *  user,
const char *  password 
)
void smbc_setDebug ( SMBCCTX c,
int  debug 
)

Set the debug level

void smbc_setFunctionAddCachedServer ( SMBCCTX c,
smbc_add_cached_srv_fn  fn 
)

Set the function for adding a cached server

void smbc_setFunctionAuthData ( SMBCCTX c,
smbc_get_auth_data_fn  fn 
)

Set the function for obtaining authentication data

void smbc_setFunctionAuthDataWithContext ( SMBCCTX c,
smbc_get_auth_data_with_context_fn  fn 
)

Set the new-style authentication function which includes the context.

void smbc_setFunctionCheckServer ( SMBCCTX c,
smbc_check_server_fn  fn 
)

Set the function for checking if a server is still good

void smbc_setFunctionChmod ( SMBCCTX c,
smbc_chmod_fn  fn 
)
void smbc_setFunctionClose ( SMBCCTX c,
smbc_close_fn  fn 
)
void smbc_setFunctionClosedir ( SMBCCTX c,
smbc_closedir_fn  fn 
)
void smbc_setFunctionCreat ( SMBCCTX c,
smbc_creat_fn   
)
void smbc_setFunctionFstat ( SMBCCTX c,
smbc_fstat_fn  fn 
)
void smbc_setFunctionFstatdir ( SMBCCTX c,
smbc_fstatdir_fn  fn 
)
void smbc_setFunctionFstatVFS ( SMBCCTX c,
smbc_fstatvfs_fn  fn 
)
void smbc_setFunctionFtruncate ( SMBCCTX c,
smbc_ftruncate_fn  fn 
)
void smbc_setFunctionGetCachedServer ( SMBCCTX c,
smbc_get_cached_srv_fn  fn 
)

Set the function for server cache lookup

void smbc_setFunctionGetdents ( SMBCCTX c,
smbc_getdents_fn  fn 
)
void smbc_setFunctionGetxattr ( SMBCCTX c,
smbc_getxattr_fn  fn 
)
void smbc_setFunctionListPrintJobs ( SMBCCTX c,
smbc_list_print_jobs_fn  fn 
)
void smbc_setFunctionListxattr ( SMBCCTX c,
smbc_listxattr_fn  fn 
)
void smbc_setFunctionLseek ( SMBCCTX c,
smbc_lseek_fn  fn 
)
void smbc_setFunctionLseekdir ( SMBCCTX c,
smbc_lseekdir_fn  fn 
)
void smbc_setFunctionMkdir ( SMBCCTX c,
smbc_mkdir_fn  fn 
)
void smbc_setFunctionOpen ( SMBCCTX c,
smbc_open_fn  fn 
)
void smbc_setFunctionOpendir ( SMBCCTX c,
smbc_opendir_fn  fn 
)
void smbc_setFunctionOpenPrintJob ( SMBCCTX c,
smbc_open_print_job_fn  fn 
)
void smbc_setFunctionPrintFile ( SMBCCTX c,
smbc_print_file_fn  fn 
)
void smbc_setFunctionPurgeCachedServers ( SMBCCTX c,
smbc_purge_cached_fn  fn 
)

Set the function for server cache purging. This function tries to remove all cached servers (e.g. on disconnect)

void smbc_setFunctionRead ( SMBCCTX c,
smbc_read_fn  fn 
)
void smbc_setFunctionReaddir ( SMBCCTX c,
smbc_readdir_fn  fn 
)
void smbc_setFunctionRemoveCachedServer ( SMBCCTX c,
smbc_remove_cached_srv_fn  fn 
)

Set the function for server cache removal

void smbc_setFunctionRemoveUnusedServer ( SMBCCTX c,
smbc_remove_unused_server_fn  fn 
)

Set the function for removing a server if unused

void smbc_setFunctionRemovexattr ( SMBCCTX c,
smbc_removexattr_fn  fn 
)
void smbc_setFunctionRename ( SMBCCTX c,
smbc_rename_fn  fn 
)
void smbc_setFunctionRmdir ( SMBCCTX c,
smbc_rmdir_fn  fn 
)
void smbc_setFunctionSetxattr ( SMBCCTX c,
smbc_setxattr_fn  fn 
)
void smbc_setFunctionStat ( SMBCCTX c,
smbc_stat_fn  fn 
)
void smbc_setFunctionStatVFS ( SMBCCTX c,
smbc_statvfs_fn  fn 
)
void smbc_setFunctionTelldir ( SMBCCTX c,
smbc_telldir_fn  fn 
)
void smbc_setFunctionUnlink ( SMBCCTX c,
smbc_unlink_fn  fn 
)
void smbc_setFunctionUnlinkPrintJob ( SMBCCTX c,
smbc_unlink_print_job_fn  fn 
)
void smbc_setFunctionUtimes ( SMBCCTX c,
smbc_utimes_fn  fn 
)
void smbc_setFunctionWrite ( SMBCCTX c,
smbc_write_fn  fn 
)
void smbc_setNetbiosName ( SMBCCTX c,
char *  netbios_name 
)

Set the netbios name used for making connections

void smbc_setOptionBrowseMaxLmbCount ( SMBCCTX c,
int  count 
)

Set from how many local master browsers should the list of workgroups be retrieved. It can take up to 12 minutes or longer after a server becomes a local master browser, for it to have the entire browse list (the list of workgroups/domains) from an entire network. Since a client never knows which local master browser will be found first, the one which is found first and used to retrieve a browse list may have an incomplete or empty browse list. By requesting the browse list from multiple local master browsers, a more complete list can be generated. For small networks (few workgroups), it is recommended that this value be set to 0, causing the browse lists from all found local master browsers to be retrieved and merged. For networks with many workgroups, a suitable value for this variable is probably somewhere around 3. (Default: 3).

void smbc_setOptionCaseSensitive ( SMBCCTX c,
smbc_bool  b 
)

Set whether to treat file names as case-sensitive if we can't determine when connecting to the remote share whether the file system is case sensitive. This defaults to FALSE since it's most likely that if we can't retrieve the file system attributes, it's a very old file system that does not support case sensitivity.

void smbc_setOptionDebugToStderr ( SMBCCTX c,
smbc_bool  b 
)

Set whether to log to standard error instead of standard output

void smbc_setOptionFallbackAfterKerberos ( SMBCCTX c,
smbc_bool  b 
)

Set whether to fallback after kerberos

void smbc_setOptionFullTimeNames ( SMBCCTX c,
smbc_bool  b 
)

Set whether to use new-style time attribute names, e.g. WRITE_TIME rather than the old-style names such as M_TIME. This allows also setting/getting CREATE_TIME which was previously unimplemented. (Note that the old C_TIME was supposed to be CHANGE_TIME but was confused and sometimes referred to CREATE_TIME.)

void smbc_setOptionNoAutoAnonymousLogin ( SMBCCTX c,
smbc_bool  b 
)

Set whether to automatically select anonymous login

void smbc_setOptionOneSharePerServer ( SMBCCTX c,
smbc_bool  b 
)

Set whether to use the same connection for all shares on a server.

Some Windows versions appear to have a limit to the number of concurrent SESSIONs and/or TREE CONNECTions. In one-shot programs (i.e. the program runs and then quickly ends, thereby shutting down all connections), it is probably reasonable to establish a new connection for each share. In long-running applications, the limitation can be avoided by using only a single connection to each server, and issuing a new TREE CONNECT when the share is accessed.

void smbc_setOptionOpenShareMode ( SMBCCTX c,
smbc_share_mode  share_mode 
)

Set the share mode to use for files opened with SMBC_open_ctx(). The default is SMBC_SHAREMODE_DENY_NONE.

void smbc_setOptionSmbEncryptionLevel ( SMBCCTX c,
smbc_smb_encrypt_level  level 
)

Set the encoded value for encryption level.

void smbc_setOptionUrlEncodeReaddirEntries ( SMBCCTX c,
smbc_bool  b 
)

Set whether to url-encode readdir entries.

There is a difference in the desired return strings from smbc_readdir() depending upon whether the filenames are to be displayed to the user, or whether they are to be appended to the path name passed to smbc_opendir() to call a further smbc_ function (e.g. open the file with smbc_open()). In the former case, the filename should be in "human readable" form. In the latter case, the smbc_ functions expect a URL which must be url-encoded. Those functions decode the URL. If, for example, smbc_readdir() returned a file name of "abc%20def.txt", passing a path with this file name attached to smbc_open() would cause smbc_open to attempt to open the file "abc def.txt" since the %20 is decoded into a space.

Set this option to True if the names returned by smbc_readdir() should be url-encoded such that they can be passed back to another smbc_ call. Set it to False if the names returned by smbc_readdir() are to be presented to the user.

For backwards compatibility, this option defaults to False.

void smbc_setOptionUseCCache ( SMBCCTX c,
smbc_bool  b 
)

Set whether to enable use of the winbind ccache

void smbc_setOptionUseKerberos ( SMBCCTX c,
smbc_bool  b 
)

Set whether to enable use of kerberos

void smbc_setOptionUserData ( SMBCCTX c,
void *  user_data 
)

Save a user data handle

void smbc_setServerCacheData ( SMBCCTX c,
struct smbc_server_cache *  cache 
)

Set the function to store private data of the server cache

void smbc_setTimeout ( SMBCCTX c,
int  timeout 
)

Set the timeout used for waiting on connections and response data (in milliseconds)

void smbc_setUser ( SMBCCTX c,
char *  user 
)

Set the username used for making connections

void smbc_setWorkgroup ( SMBCCTX c,
char *  workgroup 
)

Set the workgroup used for making connections

void smbc_thread_impl ( int(*)(const char *lockname, void **pplock, const char *location)  create_mutex,
void(*)(void *plock, const char *location)  destroy_mutex,
int(*)(void *plock, int lock_type, const char *location)  lock_mutex,
int(*)(const char *keyname, void **ppkey, const char *location)  create_tls,
void(*)(void **ppkey, const char *location)  destroy_tls,
int(*)(void *pkey, const void *pval, const char *location)  set_tls,
void *(*)(void *pkey, const char *location)  get_tls 
)

Initialize for an arbitrary thread implementation. The caller should provide, as parameters, pointers to functions to implement the requisite low-level thread functionality. A function must be provided for each parameter; none may be null.

If the thread implementation is POSIX Threads (pthreads), then the much simpler smbc_thread_pthread() function may be used instead of this one.

Parameters:
create_mutexCreate a mutex. This function should expect three parameters: lockname, pplock, and location. It should create a unique mutex for each unique lockname it is provided, and return the mutex identifier in *pplock. The location parameter can be used for debugging, as it contains the compiler-provided __location__ of the call.
destroy_mutexDestroy a mutex. This function should expect two parameters: plock and location. It should destroy the mutex associated with the identifier plock. The location parameter can be used for debugging, as it contains the compiler-provided __location__ of the call.
lock_mutexLock a mutex. This function should expect three parameters: plock, lock_type, and location. The mutex aassociated with identifier plock should be locked if lock_type is 1, and unlocked if lock_type is 2. The location parameter can be used for debugging, as it contains the compiler-provided __location__ of the call.
create_tlsCreate thread local storage. This function should expect three parameters: keyname, ppkey, and location. It should allocate an implementation-specific amount of memory and assign the pointer to that allocated memory to *ppkey. The location parameter can be used for debugging, as it contains the compiler-provided __location__ of the call. This function should return 0 upon success, non-zero upon failure.
destroy_tlsDestroy thread local storage. This function should expect two parameters: ppkey and location. The ppkey parameter points to a variable containing a thread local storage key previously provided by the create_tls function. The location parameter can be used for debugging, as it contains the compiler-provided __location__ of the call.
set_tlsSet a thread local storage variable's value. This function should expect three parameters: pkey, pval, and location. The pkey parameter is a thread local storage key previously provided by the create_tls function. The (void *) pval parameter contains the value to be placed in the thread local storage variable identified by pkey. The location parameter can be used for debugging, as it contains the compiler-provided __location__ of the call. This function should return 0 upon success; non-zero otherwise.
get_tlsRetrieve a thread local storage variable's value. This function should expect two parameters: pkey and location. The pkey parameter is a thread local storage key previously provided by the create_tls function, and which has previously been used in a call to the set_tls function to initialize a thread local storage variable. The location parameter can be used for debugging, as it contains the compiler-provided __location__ of the call. This function should return the (void *) value stored in the variable identified by pkey.
Returns:
{void}
void smbc_thread_posix ( void  )

Initialize for threads using the Posix Threads (pthread) implementation. This is a built-in implementation, avoiding the need to implement the component functions of the thread interface. If this function is used, it is not necessary to call smbc_thread_impl().

Returns:
{void}
int smbc_urlencode ( char *  dest,
char *  src,
int  max_dest_len 
)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines