1 #define _XOPEN_SOURCE 500
10 int main(int argc
, char **argv
) {
11 struct isds_ctx
*ctx
= NULL
;
14 setlocale(LC_ALL
, "");
18 printf("isds_init() failed: %s\n", isds_strerror(err
));
22 isds_set_logging(ILF_ALL
& ~ILF_HTTP
& ~ILF_SOAP
, ILL_ALL
);
24 ctx
= isds_ctx_create();
26 printf("isds_ctx_create() failed");
29 err
= isds_set_timeout(ctx
, 10000);
31 printf("isds_set_timeout() failed: %s\n", isds_strerror(err
));
34 /* err = isds_set_tls(ctx, ITLS_VERIFY_SERVER, 0);
36 printf("isds_set_tls(ITLS_VERIFY_SERVER) failed: %s\n",
40 err = isds_set_tls(ctx, ITLS_CA_FILE, "/etc/ssl/certs/ca-certificates.crt");
42 printf("isds_set_tls(ITLS_CA_FILE) failed: %s\n",
47 /* Register progresbar */
48 err
= isds_set_progress_callback(ctx
, progressbar
, NULL
);
50 printf("isds_set_progress_callback() failed: %s: %s\n",
51 isds_strerror(err
), isds_long_message(ctx
));
53 printf("isds_set_progress_callback() succeeded.\n");
57 err
= isds_login(ctx
, url
, username
, password
, NULL
, NULL
);
59 printf("isds_login() failed: %s: %s\n", isds_strerror(err
),
60 isds_long_message(ctx
));
62 printf("Logged in :)\n");
66 err
= isds_logout(ctx
);
68 printf("isds_logout() failed: %s\n", isds_strerror(err
));
72 err
= isds_ctx_free(&ctx
);
74 printf("isds_ctx_free() failed: %s\n", isds_strerror(err
));
80 printf("isds_cleanup() failed: %s\n", isds_strerror(err
));