1 #define _XOPEN_SOURCE 500
8 #include <libxml/debugXML.h>
13 struct isds_ctx
*ctx
= NULL
;
16 setlocale(LC_ALL
, "");
20 printf("isds_init() failed: %s\n", isds_strerror(err
));
24 isds_set_logging(ILF_ALL
& ~ILF_HTTP
, ILL_ALL
);
26 ctx
= isds_ctx_create();
28 printf("isds_ctx_create() failed");
33 /* Load plain signed sent message with XML documents */
34 struct isds_message
*message
= NULL
;
40 "/server/messages/signed_sent_xml_message-376701.xml",
41 &fd
, &buffer
, &length
)) {
42 fprintf(stderr
, "Could not map file with message");
48 printf("Loading plain signed sent message\n");
49 err
= isds_load_message(ctx
, RAWTYPE_PLAIN_SIGNED_OUTGOING_MESSAGE
,
50 buffer
, length
, &message
, BUFFER_DONT_STORE
);
52 printf("isds_load_message() failed: %s: %s\n",
53 isds_strerror(err
), isds_long_message(ctx
));
55 printf("isds_load_message() succeeded:\n");
56 print_message(message
);
58 /* Dump XML documents */
60 for (struct isds_list
*item
= message
->documents
; item
;
61 item
= item
->next
, i
++) {
63 struct isds_document
*document
=
64 (struct isds_document
*)item
->data
;
65 if (document
->is_xml
) {
66 printf("* XML Document #%d dump:\n", i
);
67 xmlDebugDumpNodeList(stdout
,
68 document
->xml_node_list
, 2);
74 isds_message_free(&message
);
75 munmap_file(fd
, buffer
, length
);
79 err
= isds_ctx_free(&ctx
);
81 printf("isds_ctx_free() failed: %s\n", isds_strerror(err
));
86 printf("isds_cleanup() failed: %s\n", isds_strerror(err
));