Initial revamp of the libsmbclient interface.
[samba.git] / examples / libsmbclient / smbwrapper / smbw.c
index a44f2f4046a2fe9524cbbb97447ebfd0889e76dc..d3439e436dda1dea30e9a0f5a96d9e88e14502d4 100644 (file)
@@ -7,7 +7,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -16,8 +16,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include <stdio.h>
@@ -175,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");