1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/examples/libsmbclient/testctx.c
Volker Lendecke 556e1a5ee4 examples: Make libsmbclient samples look a *bit* less ugly
Remove trailing whitespace, indent to tabs. Yes, this introduces long
lines, but makes review with "git show -w" trivial.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26 18:54:37 +00:00

34 lines
738 B
C

#include <libsmbclient.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
static void create_and_destroy_context (void)
{
int i;
SMBCCTX *ctx;
ctx = smbc_new_context ();
/* Both should do the same thing */
smbc_setOptionDebugToStderr(ctx, 1);
smbc_option_set(ctx, strdup("debug_to_stderr"), 1);
smbc_setDebug(ctx, 1);
i = smbc_getDebug(ctx);
if (i != 1) {
printf("smbc_getDebug() did not return debug level set\n");
exit(1);
}
if (!smbc_getOptionDebugToStderr(ctx)) {
printf("smbc_setOptionDebugToStderr() did not stick\n");
exit(1);
}
smbc_init_context (ctx);
smbc_free_context (ctx, 1);
}
int main (int argc, char **argv)
{
create_and_destroy_context ();
create_and_destroy_context ();
return 0;
}