r12579: r12122@cabra: derrell | 2005-12-29 12:03:00 -0500
authorDerrell Lipman <derrell@samba.org>
Thu, 29 Dec 2005 17:03:39 +0000 (17:03 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:06:00 +0000 (11:06 -0500)
 allow for arbitrary option value types
(This used to be commit 64c8e32b6382e48bce5c1f18179e66ca765a70af)

examples/libsmbclient/testbrowse.c
source3/libsmb/libsmbclient.c

index eba6fff4ebf0e92ca72ae9ad482dcb22787b00e8..b5337ae983ad0fb7b95c8973747fe2c8aa6b7eab 100644 (file)
@@ -89,7 +89,7 @@ main(int argc, char * argv[])
     /* If we've been asked to log to stderr instead of stdout... */
     if (debug_stderr) {
         /* ... then set the option to do so */
-        smbc_option_set(context, "debug_stderr", NULL);
+        smbc_option_set(context, "debug_stderr");
     }
        
     /* Initialize the context using the previously specified options */
index 6eca3946d8f6de450de0083b92cf6c75c76b27aa..51f94e42e37bb78a05965f69507a8c8650adc9a5 100644 (file)
@@ -5947,14 +5947,22 @@ smbc_free_context(SMBCCTX *context,
 void
 smbc_option_set(SMBCCTX *context,
                 char *option_name,
-                void *option_value)
+                ...)
 {
+        va_list args;
+
+        va_start(args, option_name);
+
         if (strcmp(option_name, "debug_stderr") == 0) {
                 /*
                  * Log to standard error instead of standard output.
+                 *
+                 *  optional parameters: none (it can't be turned off once on)
                  */
                 context->internal->_debug_stderr = True;
         }
+
+        va_end(args);
 }