source: vendor/current/examples/libsmbclient/testctx.c

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 760 bytes
Line 
1#include <libsmbclient.h>
2#include <stdlib.h>
3#include <stdio.h>
4#include <string.h>
5
6static void create_and_destroy_context (void)
7{
8 int i;
9 SMBCCTX *ctx;
10 ctx = smbc_new_context ();
11 /* Both should do the same thing */
12 smbc_setOptionDebugToStderr(ctx, 1);
13 smbc_option_set(ctx, strdup("debug_to_stderr"), 1);
14 smbc_setDebug(ctx, 1);
15 i = smbc_getDebug(ctx);
16 if (i != 1) {
17 printf("smbc_getDebug() did not return debug level set\n");
18 exit(1);
19 }
20 if (!smbc_getOptionDebugToStderr(ctx)) {
21 printf("smbc_setOptionDebugToStderr() did not stick\n");
22 exit(1);
23 }
24 smbc_init_context (ctx);
25 smbc_free_context (ctx, 1);
26}
27
28int main (int argc, char **argv)
29{
30 create_and_destroy_context ();
31 create_and_destroy_context ();
32 return 0;
33}
Note: See TracBrowser for help on using the repository browser.