1 #define _XOPEN_SOURCE 500
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
, 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_login(ctx
, url
, username(), password(), NULL
, NULL
);
36 printf("isds_login() failed: %s: %s\n", isds_strerror(err
),
37 isds_long_message(ctx
));
39 printf("Logged in :)\n");
44 char *user_id
= NULL
, *password
= NULL
;
45 /* Try a call, not our box as we do not know what does it */
46 err
= isds_activate(ctx
, "kuqcfr6", "token", &user_id
, &password
);
48 printf("isds_activate() failed: %s: %s\n",
49 isds_strerror(err
), isds_long_message(ctx
));
51 printf("isds_activate() succeeded:\n");
52 printf("user_id = %s\n", user_id
);
53 printf("password = %s\n", password
);
62 err
= isds_logout(ctx
);
64 printf("isds_logout() failed: %s\n", isds_strerror(err
));
68 err
= isds_ctx_free(&ctx
);
70 printf("isds_ctx_free() failed: %s\n", isds_strerror(err
));
76 printf("isds_cleanup() failed: %s\n", isds_strerror(err
));