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");
34 /* Load signed delivery info */
35 struct isds_message
*message
= NULL
;
40 if (mmap_file(SRCDIR
"/server/messages/signed_delivered-DD_170272.zfo",
41 &fd
, &buffer
, &length
)) {
42 fprintf(stderr
, "Could not open map file with signed delivery info\n");
48 printf("Loading signed delivery info\n");
49 err
= isds_load_signed_delivery_info(ctx
, buffer
, length
,
50 &message
, BUFFER_DONT_STORE
);
52 printf("isds_load_signed_delivery_info() failed: %s: %s\n",
53 isds_strerror(err
), isds_long_message(ctx
));
55 printf("isds_load_signed_delivery_info() succeeded:\n");
56 print_envelope(message
->envelope
);
59 isds_message_free(&message
);
60 munmap_file(fd
, buffer
, length
);
66 /* Load plain received message */
67 struct isds_message
*message
= NULL
;
72 if (mmap_file(SRCDIR
"/server/messages/received_message-151916.xml",
73 &fd
, &buffer
, &length
)) {
74 fprintf(stderr
, "Could not map file with message");
80 printf("Loading plain received message\n");
81 err
= isds_load_message(ctx
, RAWTYPE_INCOMING_MESSAGE
, buffer
, length
,
82 &message
, BUFFER_DONT_STORE
);
84 printf("isds_load_message() failed: %s: %s\n",
85 isds_strerror(err
), isds_long_message(ctx
));
87 printf("isds_load_message() succeeded:\n");
88 print_message(message
);
91 isds_message_free(&message
);
92 munmap_file(fd
, buffer
, length
);
97 err
= isds_ctx_free(&ctx
);
99 printf("isds_ctx_free() failed: %s\n", isds_strerror(err
));
103 err
= isds_cleanup();
105 printf("isds_cleanup() failed: %s\n", isds_strerror(err
));