summaryrefslogtreecommitdiff
path: root/examples/libsmbclient
diff options
context:
space:
mode:
Diffstat (limited to 'examples/libsmbclient')
-rw-r--r--examples/libsmbclient/smbwrapper/smbw.c10
-rw-r--r--examples/libsmbclient/testbrowse.c8
-rw-r--r--examples/libsmbclient/testbrowse2.c17
3 files changed, 21 insertions, 14 deletions
diff --git a/examples/libsmbclient/smbwrapper/smbw.c b/examples/libsmbclient/smbwrapper/smbw.c
index b88290ff6d..d3439e436d 100644
--- a/examples/libsmbclient/smbwrapper/smbw.c
+++ b/examples/libsmbclient/smbwrapper/smbw.c
@@ -174,11 +174,11 @@ static void do_init(StartupType startupType)
exit(1);
}
- smbw_ctx->debug = debug_level;
- smbw_ctx->callbacks.auth_fn = get_auth_data_fn;
- smbw_ctx->options.browse_max_lmb_count = 0;
- smbw_ctx->options.urlencode_readdir_entries = 1;
- smbw_ctx->options.one_share_per_server = 1;
+ smbc_setDebug(smbw_ctx, debug_level);
+ smbc_setFunctionAuthData(smbw_ctx, get_auth_data_fn);
+ smbc_option_set(smbw_ctx, "browse_max_lmb_count", 0);
+ smbc_option_set(smbw_ctx, "urlencode_readdir_entries", 1);
+ smbc_option_set(smbw_ctx, "one_share_per_server", 1);
if (smbc_init_context(smbw_ctx) == NULL) {
fprintf(stderr, "Could not initialize context.\n");
diff --git a/examples/libsmbclient/testbrowse.c b/examples/libsmbclient/testbrowse.c
index 562d2c2aeb..495cf0fbec 100644
--- a/examples/libsmbclient/testbrowse.c
+++ b/examples/libsmbclient/testbrowse.c
@@ -108,7 +108,8 @@ main(int argc, char * argv[])
}
/* Set mandatory options (is that a contradiction in terms?) */
- context->debug = debug;
+ smbc_setDebug(context, debug);
+#if 0
if (context_auth) {
context->callbacks.auth_fn = NULL;
smbc_option_set(context,
@@ -119,6 +120,11 @@ main(int argc, char * argv[])
context->callbacks.auth_fn =
(no_auth ? no_auth_data_fn : get_auth_data_fn);
}
+#else
+#warning "temporarily remove setting alternate auth function"
+ smbc_setFunctionAuthData(context,
+ (no_auth ? no_auth_data_fn : get_auth_data_fn));
+#endif
/* If we've been asked to log to stderr instead of stdout, ... */
if (debug_stderr) {
diff --git a/examples/libsmbclient/testbrowse2.c b/examples/libsmbclient/testbrowse2.c
index 76d98b9602..0ac1d72bb4 100644
--- a/examples/libsmbclient/testbrowse2.c
+++ b/examples/libsmbclient/testbrowse2.c
@@ -93,8 +93,8 @@ SMBCCTX* create_smbctx(){
if ((ctx = smbc_new_context()) == NULL) return NULL;
- ctx->debug = debuglevel;
- ctx->callbacks.auth_fn = smbc_auth_fn;
+ smbc_setDebug(ctx, debuglevel);
+ smbc_setFunctionAuthData(ctx, smbc_auth_fn);
if (smbc_init_context(ctx) == NULL){
smbc_free_context(ctx, 1);
@@ -105,7 +105,7 @@ SMBCCTX* create_smbctx(){
}
void delete_smbctx(SMBCCTX* ctx){
- ctx->callbacks.purge_cached_fn(ctx);
+ smbc_getFunctionPurgeCachedServers(ctx)(ctx);
smbc_free_context(ctx, 1);
}
@@ -114,8 +114,9 @@ smbitem* get_smbitem_list(SMBCCTX *ctx, char *smb_path){
struct smbc_dirent *dirent;
smbitem *list = NULL, *item;
- if ((fd = ctx->opendir(ctx, smb_path)) == NULL) return NULL;
- while((dirent = ctx->readdir(ctx, fd)) != NULL){
+ if ((fd = smbc_getFunctionOpendir(ctx)(ctx, smb_path)) == NULL)
+ return NULL;
+ while((dirent = smbc_getFunctionReaddir(ctx)(ctx, fd)) != NULL){
if (strcmp(dirent->name, "") == 0) continue;
if (strcmp(dirent->name, ".") == 0) continue;
if (strcmp(dirent->name, "..") == 0) continue;
@@ -128,7 +129,7 @@ smbitem* get_smbitem_list(SMBCCTX *ctx, char *smb_path){
strcpy(item->name, dirent->name);
list = item;
}
- ctx->close_fn(ctx, fd);
+ smbc_getFunctionClose(ctx)(ctx, fd);
return /* smbitem_list_sort */ (list);
}
@@ -167,7 +168,7 @@ void recurse(SMBCCTX *ctx, char *smb_group, char *smb_path, int maxlen){
delete_smbctx(ctx1);
}else{
recurse(ctx, smb_group, smb_path, maxlen);
- ctx->callbacks.purge_cached_fn(ctx);
+ smbc_getFunctionPurgeCachedServers(ctx)(ctx);
}
break;
case SMBC_FILE_SHARE:
@@ -181,7 +182,7 @@ void recurse(SMBCCTX *ctx, char *smb_group, char *smb_path, int maxlen){
if (list->type != SMBC_FILE){
recurse(ctx, smb_group, smb_path, maxlen);
if (list->type == SMBC_FILE_SHARE)
- ctx->callbacks.purge_cached_fn(ctx);
+ smbc_getFunctionPurgeCachedServers(ctx)(ctx);
}
break;
}