Initial release, version 0.0.0.
[gsasl.git] / doc / gsasl-example1.c
blob0a71b10acbc32172b223124e04f54bb78f43ce2e
1 #include <locale.h>
2 #include <stdio.h>
3 #include <gsasl.h>
5 /* Build using the following command:
6 * gcc -o foo foo.c `libgsasl-config --cflags --libs`
7 */
9 int
10 main (int argc, char *argv[])
12 Gsasl_ctx *ctx;
13 int res;
15 setlocale (LC_ALL, "");
17 if (gsasl_check_version(GSASL_VERSION) == NULL)
19 fprintf(stderr, "Libgsasl is %s expected %s\n",
20 gsasl_check_version(NULL), GSASL_VERSION);
21 return 1;
24 res = gsasl_init (&ctx);
25 if (res != GSASL_OK)
27 fprintf(stderr, "Cannot initialize libgsasl: %s\n",
28 gsasl_strerror(res));
29 return 1;
32 /* Do things here ... */
34 gsasl_done(ctx);
36 return 0;