This source file includes following definitions.
- pcmk__out_prologue
- pcmk__out_epilogue
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11 #include <crm/common/results.h>
12 #include <crm/common/output_internal.h>
13 #include <libxml/tree.h>
14 #include <pacemaker-internal.h>
15
16 pcmk__supported_format_t pcmk__out_formats[] = {
17 PCMK__SUPPORTED_FORMAT_XML,
18 { NULL, NULL, NULL }
19 };
20
21 int
22 pcmk__out_prologue(pcmk__output_t **out, xmlNodePtr *xml) {
23 int rc = pcmk_rc_ok;
24
25 if (*xml != NULL) {
26 xmlFreeNode(*xml);
27 }
28
29 pcmk__register_formats(NULL, pcmk__out_formats);
30 rc = pcmk__output_new(out, "xml", NULL, NULL);
31 if (rc != pcmk_rc_ok) {
32 return rc;
33 }
34
35 return rc;
36 }
37
38 void
39 pcmk__out_epilogue(pcmk__output_t *out, xmlNodePtr *xml, int retval) {
40 if (retval == pcmk_rc_ok) {
41 out->finish(out, 0, FALSE, (void **) xml);
42 }
43
44 pcmk__output_free(out);
45 }