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");
47 err
= isds_get_box_list_archive(ctx
, "UPG", &archive
, &length
);
49 printf("isds_get_box_list_archive() failed: %s: %s\n",
50 isds_strerror(err
), isds_long_message(ctx
));
52 printf("isds_get_box_list_archive() succeeded:\n");
53 printf("length = %zu B\n", length
);
54 save_data("Saving ZIP archive", archive
, length
);
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
));