libdsm 0.4.3
Minimalist and read-only SMB client lib
|
List and connect to SMB shares. More...
Functions | |
BDSM_EXPORT int | smb_share_get_list (smb_session *s, smb_share_list *list, size_t *p_count) |
List the existing share of this sessions's machine. | |
BDSM_EXPORT size_t | smb_share_list_count (smb_share_list list) |
Get the number of share in the list. | |
BDSM_EXPORT const char * | smb_share_list_at (smb_share_list list, size_t index) |
Get the name of the share in the list at the given index. | |
BDSM_EXPORT void | smb_share_list_destroy (smb_share_list list) |
Destroy an opaque share list object. | |
BDSM_EXPORT int | smb_tree_connect (smb_session *s, const char *name, smb_tid *tid) |
Connects to a SMB share. | |
BDSM_EXPORT int | smb_tree_disconnect (smb_session *s, smb_tid tid) |
Disconnect from a share. | |
List and connect to SMB shares.
BDSM_EXPORT int smb_share_get_list | ( | smb_session * | s, |
smb_share_list * | list, | ||
size_t * | p_count ) |
List the existing share of this sessions's machine.
This function makes a RPC to the machine this session is currently authenticated to and list all the existing shares of this machines. The share starting with a $ are supposed to be system/hidden share.
[in] | s | The session object |
[out] | list | A pointer to an opaque share_list object. |
[out] | pointer | to the number of elements in the list |
BDSM_EXPORT const char * smb_share_list_at | ( | smb_share_list | list, |
size_t | index ) |
Get the name of the share in the list at the given index.
list | An opaque share list object |
index | The index of the returned item in the list |
BDSM_EXPORT size_t smb_share_list_count | ( | smb_share_list | list | ) |
Get the number of share in the list.
list | An opaque share list returned by smb_share_list() |
BDSM_EXPORT void smb_share_list_destroy | ( | smb_share_list | list | ) |
Destroy an opaque share list object.
list | The list to destroy. The object is not usable anymore afterward, you can set it to 'NULL' |
BDSM_EXPORT int smb_tree_connect | ( | smb_session * | s, |
const char * | name, | ||
smb_tid * | tid ) |
Connects to a SMB share.
Before being able to list/read files on a SMB file server, you have to be connected to the share containing the files you want to read or the directories you want to list
s | The session object |
name | The share name |
tid | The pointer to an opaque open share |
BDSM_EXPORT int smb_tree_disconnect | ( | smb_session * | s, |
smb_tid | tid ) |
Disconnect from a share.
UNIMPLEMENTED