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 <crm/stonith-ng.h>
14 #include <crm/fencing/internal.h>
15 #include <libxml/tree.h>
16 #include <pcmki/pcmki_output.h>
17
18 pcmk__supported_format_t pcmk__out_formats[] = {
19 PCMK__SUPPORTED_FORMAT_XML,
20 { NULL, NULL, NULL }
21 };
22
23 int
24 pcmk__out_prologue(pcmk__output_t **out, xmlNodePtr *xml) {
25 int rc = pcmk_rc_ok;
26
27 if (*xml != NULL) {
28 xmlFreeNode(*xml);
29 }
30
31 pcmk__register_formats(NULL, pcmk__out_formats);
32 rc = pcmk__output_new(out, "xml", NULL, NULL);
33 if (rc != pcmk_rc_ok) {
34 return rc;
35 }
36
37 stonith__register_messages(*out);
38 return rc;
39 }
40
41 void
42 pcmk__out_epilogue(pcmk__output_t *out, xmlNodePtr *xml, int retval) {
43 if (retval == pcmk_rc_ok) {
44 out->finish(out, 0, FALSE, (void **) xml);
45 }
46
47 pcmk__output_free(out);
48 }