pacemaker  2.0.4-2deceaa
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
output_none.c
Go to the documentation of this file.
1 /*
2  * Copyright 2019 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This source code is licensed under the GNU Lesser General Public License
7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8  */
9 
10 #include <stdlib.h>
11 #include <crm/crm.h>
12 #include <crm/common/output.h>
13 #include <glib.h>
14 
15 GOptionEntry pcmk__none_output_entries[] = {
16  { NULL }
17 };
18 
19 static void
20 none_free_priv(pcmk__output_t *out) {
21  /* This function intentionally left blank */
22 }
23 
24 static bool
25 none_init(pcmk__output_t *out) {
26  return true;
27 }
28 
29 static void
30 none_finish(pcmk__output_t *out, crm_exit_t exit_status, bool print, void **copy_dest) {
31  /* This function intentionally left blank */
32 }
33 
34 static void
35 none_reset(pcmk__output_t *out) {
36  CRM_ASSERT(out != NULL);
37  none_free_priv(out);
38  none_init(out);
39 }
40 
41 static void
42 none_subprocess_output(pcmk__output_t *out, int exit_status,
43  const char *proc_stdout, const char *proc_stderr) {
44  /* This function intentionally left blank */
45 }
46 
47 static void
48 none_version(pcmk__output_t *out, bool extended) {
49  /* This function intentionally left blank */
50 }
51 
52 G_GNUC_PRINTF(2, 3)
53 static void
54 none_err(pcmk__output_t *out, const char *format, ...) {
55  /* This function intentionally left blank */
56 }
57 
58 G_GNUC_PRINTF(2, 3)
59 static void
60 none_info(pcmk__output_t *out, const char *format, ...) {
61  /* This function intentionally left blank */
62 }
63 
64 static void
65 none_output_xml(pcmk__output_t *out, const char *name, const char *buf) {
66  /* This function intentionally left blank */
67 }
68 
69 G_GNUC_PRINTF(4, 5)
70 static void
71 none_begin_list(pcmk__output_t *out, const char *singular_noun, const char *plural_noun,
72  const char *format, ...) {
73  /* This function intentionally left blank */
74 }
75 
76 G_GNUC_PRINTF(3, 4)
77 static void
78 none_list_item(pcmk__output_t *out, const char *id, const char *format, ...) {
79  /* This function intentionally left blank */
80 }
81 
82 static void
83 none_increment_list(pcmk__output_t *out) {
84  /* This function intentionally left blank */
85 }
86 
87 static void
88 none_end_list(pcmk__output_t *out) {
89  /* This function intentionally left blank */
90 }
91 
93 pcmk__mk_none_output(char **argv) {
94  pcmk__output_t *retval = calloc(1, sizeof(pcmk__output_t));
95 
96  if (retval == NULL) {
97  return NULL;
98  }
99 
100  retval->fmt_name = "none";
101  retval->request = argv == NULL ? NULL : g_strjoinv(" ", argv);
102  retval->supports_quiet = true;
103 
104  retval->init = none_init;
105  retval->free_priv = none_free_priv;
106  retval->finish = none_finish;
107  retval->reset = none_reset;
108 
110  retval->message = pcmk__call_message;
111 
112  retval->subprocess_output = none_subprocess_output;
113  retval->version = none_version;
114  retval->info = none_info;
115  retval->err = none_err;
116  retval->output_xml = none_output_xml;
117 
118  retval->begin_list = none_begin_list;
119  retval->list_item = none_list_item;
120  retval->increment_list = none_increment_list;
121  retval->end_list = none_end_list;
122 
123  return retval;
124 }
pcmk__output_t * pcmk__mk_none_output(char **argv)
Definition: output_none.c:93
bool(* init)(pcmk__output_t *out)
Definition: output.h:215
A dumping ground.
Formatted output for pacemaker tools.
void(* register_message)(pcmk__output_t *out, const char *message_id, pcmk__message_fn_t fn)
Definition: output.h:293
const char * fmt_name
The name of this output formatter.
Definition: output.h:157
void(* reset)(pcmk__output_t *out)
Definition: output.h:280
void(*) void(* err)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
Definition: output.h:361
bool supports_quiet
Does this formatter support a special quiet mode?
Definition: output.h:174
int(* message)(pcmk__output_t *out, const char *message_id,...)
Definition: output.h:311
enum crm_exit_e crm_exit_t
int pcmk__call_message(pcmk__output_t *out, const char *message_id,...)
Definition: output.c:116
void(* end_list)(pcmk__output_t *out)
Definition: output.h:432
void(* begin_list)(pcmk__output_t *out, const char *singular_noun, const char *plural_noun, const char *format,...) G_GNUC_PRINTF(4
Definition: output.h:392
void(* subprocess_output)(pcmk__output_t *out, int exit_status, const char *proc_stdout, const char *proc_stderr)
Definition: output.h:322
GOptionEntry pcmk__none_output_entries[]
Definition: output_none.c:15
void(*) void(*) void(* increment_list)(pcmk__output_t *out)
Definition: output.h:420
void(* info)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
Definition: output.h:347
#define CRM_ASSERT(expr)
Definition: results.h:42
void(* finish)(pcmk__output_t *out, crm_exit_t exit_status, bool print, void **copy_dest)
Definition: output.h:262
void(* free_priv)(pcmk__output_t *out)
Definition: output.h:226
gchar * request
A copy of the request that generated this output.
Definition: output.h:165
This structure contains everything that makes up a single output formatter.
Definition: output.h:153
void(* version)(pcmk__output_t *out, bool extended)
Definition: output.h:333
void(*) void(*) void(* output_xml)(pcmk__output_t *out, const char *name, const char *buf)
Definition: output.h:371
char * name
Definition: pcmk_fence.c:30
void pcmk__register_message(pcmk__output_t *out, const char *message_id, pcmk__message_fn_t fn)
Definition: output.c:134
void(*) void(* list_item)(pcmk__output_t *out, const char *name, const char *format,...) G_GNUC_PRINTF(3
Definition: output.h:405