1 #define _XOPEN_SOURCE 500
11 int main(int argc
, char **argv
) {
12 struct isds_ctx
*ctx
= NULL
;
15 setlocale(LC_ALL
, "");
19 printf("isds_init() failed: %s\n", isds_strerror(err
));
23 isds_set_logging(ILF_ALL
& ~ILF_HTTP
, ILL_ALL
);
25 ctx
= isds_ctx_create();
27 printf("isds_ctx_create() failed");
33 /* Load signed delivery info */
34 struct isds_message
*message
= NULL
;
39 if (mmap_file(SRCDIR
"/server/messages/signed_delivered-DD_170272.zfo",
40 &fd
, &buffer
, &length
)) {
41 fprintf(stderr
, "Could not open map file with signed delivery info\n");
47 printf("Loading signed delivery info\n");
48 err
= isds_load_delivery_info(ctx
, RAWTYPE_CMS_SIGNED_DELIVERYINFO
,
49 buffer
, length
, &message
, BUFFER_DONT_STORE
);
51 printf("isds_load_delivery_info() failed: %s: %s\n",
52 isds_strerror(err
), isds_long_message(ctx
));
54 printf("isds_load_delivery_info() succeeded:\n");
55 print_envelope(message
->envelope
);
58 isds_message_free(&message
);
59 munmap_file(fd
, buffer
, length
);
64 /* Load plain delivery info */
65 struct isds_message
*message
= NULL
;
70 if (mmap_file(SRCDIR
"/server/messages/signed_delivered-DD_170272.xml",
71 &fd
, &buffer
, &length
)) {
72 fprintf(stderr
, "Could not map file with delivery info");
78 printf("Loading plain signed delivery info\n");
79 err
= isds_load_delivery_info(ctx
, RAWTYPE_PLAIN_SIGNED_DELIVERYINFO
,
80 buffer
, length
, &message
, BUFFER_DONT_STORE
);
82 printf("isds_load_delivery_info() failed: %s: %s\n",
83 isds_strerror(err
), isds_long_message(ctx
));
85 printf("isds_load_delivery_info() succeeded:\n");
86 print_envelope(message
->envelope
);
89 isds_message_free(&message
);
90 munmap_file(fd
, buffer
, length
);
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
));