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
));
35 /* Register progresbar */
36 err
= isds_set_progress_callback(ctx
, progressbar
, NULL
);
38 printf("isds_set_progress_callback() failed: %s: %s\n",
39 isds_strerror(err
), isds_long_message(ctx
));
41 printf("isds_set_progress_callback() succeeded.\n");
44 err
= isds_login(ctx
, url
, username(), password(), NULL
, NULL
);
46 printf("isds_login() failed: %s: %s\n", isds_strerror(err
),
47 isds_long_message(ctx
));
49 printf("Logged in :)\n");
53 /* Register aborting progresbar */
54 printf("\nTesting aborting progress callback\n");
55 err
= isds_set_progress_callback(ctx
, progressbar
, (void *)1);
57 printf("isds_set_progress_callback() failed: %s: %s\n",
58 isds_strerror(err
), isds_long_message(ctx
));
60 printf("isds_set_progress_callback() succeeded.\n");
64 printf("isds_ping() failed: %s: %s\n", isds_strerror(err
),
65 isds_long_message(ctx
));
67 printf("Ping succeded\n");
71 /* Register normal progresbar */
72 printf("\nTesting non-aborting progress callback\n");
73 err
= isds_set_progress_callback(ctx
, progressbar
, NULL
);
75 printf("isds_set_progress_callback() failed: %s: %s\n",
76 isds_strerror(err
), isds_long_message(ctx
));
78 printf("isds_set_progress_callback() succeeded.\n");
82 printf("isds_ping() failed: %s: %s\n", isds_strerror(err
),
83 isds_long_message(ctx
));
85 printf("Ping succeded\n");
89 err
= isds_logout(ctx
);
91 printf("isds_logout() failed: %s\n", isds_strerror(err
));
95 err
= isds_ctx_free(&ctx
);
97 printf("isds_ctx_free() failed: %s\n", isds_strerror(err
));
101 err
= isds_cleanup();
103 printf("isds_cleanup() failed: %s\n", isds_strerror(err
));