Merge branch 'master' of ctdb into 'master' of samba
[samba.git] / examples / libsmbclient / testbrowse.c
index a6e6395078f0b98124e75d14d33227600bd7cd30..2ae7ca1c49a6f285d0f259ddadba05b9dc61688a 100644 (file)
@@ -9,16 +9,6 @@
 #include <libsmbclient.h>
 #include "get_auth_data_fn.h"
 
-static void
-no_auth_data_fn(const char * pServer,
-                const char * pShare,
-                char * pWorkgroup,
-                int maxLenWorkgroup,
-                char * pUsername,
-                int maxLenUsername,
-                char * pPassword,
-                int maxLenPassword);
-
 static void browse(char * path,
                    int scan,
                    int indent);
@@ -44,10 +34,8 @@ main(int argc, char * argv[])
     int                         context_auth = 0;
     int                         scan = 0;
     int                         iterations = -1;
-    int                         again;
     int                         opt;
     char *                      p;
-    char *                      q;
     char                        buf[1024];
     poptContext                 pc;
     SMBCCTX *                   context;
@@ -112,7 +100,7 @@ main(int argc, char * argv[])
     if (context_auth) {
         smbc_setFunctionAuthDataWithContext(context,
                                             get_auth_data_with_context_fn);
-        smbc_setOptionUserData(context, "hello world");
+        smbc_setOptionUserData(context, (void *)"hello world");
     } else {
         smbc_setFunctionAuthData(context, get_auth_data_fn);
     }
@@ -171,21 +159,6 @@ main(int argc, char * argv[])
     exit(0);
 }
 
-
-static void
-no_auth_data_fn(const char * pServer,
-                const char * pShare,
-                char * pWorkgroup,
-                int maxLenWorkgroup,
-                char * pUsername,
-                int maxLenUsername,
-                char * pPassword,
-                int maxLenPassword)
-{
-    return;
-}
-
-
 static void
 get_auth_data_with_context_fn(SMBCCTX * context,
                               const char * pServer,
@@ -197,7 +170,7 @@ get_auth_data_with_context_fn(SMBCCTX * context,
                               char * pPassword,
                               int maxLenPassword)
 {
-    printf("Authenticating with context 0x%lx", context);
+    printf("Authenticating with context %p", context);
     if (context != NULL) {
         char *user_data = smbc_getOptionUserData(context);
         printf(" with user data %s", user_data);
@@ -213,7 +186,7 @@ static void browse(char * path, int scan, int indent)
     char *                      p;
     char                        buf[1024];
     int                         dir;
-    struct stat                 stat;
+    struct stat                 st;
     struct smbc_dirent *        dirent;
 
     if (! scan)
@@ -268,14 +241,14 @@ static void browse(char * path, int scan, int indent)
             p = path + strlen(path);
             strcat(p, "/");
             strcat(p+1, dirent->name);
-            if (smbc_stat(path, &stat) < 0)
+            if (smbc_stat(path, &st) < 0)
             {
                 printf(" unknown size (reason %d: %s)",
                        errno, strerror(errno));
             }
             else
             {
-                printf(" size %lu", (unsigned long) stat.st_size);
+                printf(" size %lu", (unsigned long) st.st_size);
             }
             *p = '\0';