root/lib/common/output_none.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. none_free_priv
  2. none_init
  3. none_finish
  4. none_reset
  5. none_subprocess_output
  6. none_version
  7. G_GNUC_PRINTF
  8. G_GNUC_PRINTF
  9. none_output_xml
  10. G_GNUC_PRINTF
  11. G_GNUC_PRINTF
  12. none_increment_list
  13. none_end_list
  14. none_is_quiet
  15. none_spacer
  16. none_progress
  17. none_prompt
  18. pcmk__mk_none_output

   1 /*
   2  * Copyright 2019-2024 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 <crm_internal.h>
  11 
  12 #include <stdlib.h>
  13 #include <glib.h>
  14 
  15 #include <crm/crm.h>
  16 #include <crm/common/cmdline_internal.h>
  17 
  18 static void
  19 none_free_priv(pcmk__output_t *out) {
     /* [previous][next][first][last][top][bottom][index][help] */
  20     /* This function intentionally left blank */
  21 }
  22 
  23 static bool
  24 none_init(pcmk__output_t *out) {
     /* [previous][next][first][last][top][bottom][index][help] */
  25     return true;
  26 }
  27 
  28 static void
  29 none_finish(pcmk__output_t *out, crm_exit_t exit_status, bool print, void **copy_dest) {
     /* [previous][next][first][last][top][bottom][index][help] */
  30     /* This function intentionally left blank */
  31 }
  32 
  33 static void
  34 none_reset(pcmk__output_t *out) {
     /* [previous][next][first][last][top][bottom][index][help] */
  35     pcmk__assert(out != NULL);
  36     none_free_priv(out);
  37     none_init(out);
  38 }
  39 
  40 static void
  41 none_subprocess_output(pcmk__output_t *out, int exit_status,
     /* [previous][next][first][last][top][bottom][index][help] */
  42                        const char *proc_stdout, const char *proc_stderr) {
  43     /* This function intentionally left blank */
  44 }
  45 
  46 static void
  47 none_version(pcmk__output_t *out, bool extended) {
     /* [previous][next][first][last][top][bottom][index][help] */
  48     /* This function intentionally left blank */
  49 }
  50 
  51 G_GNUC_PRINTF(2, 3)
     /* [previous][next][first][last][top][bottom][index][help] */
  52 static void
  53 none_err(pcmk__output_t *out, const char *format, ...) {
  54     /* This function intentionally left blank */
  55 }
  56 
  57 G_GNUC_PRINTF(2, 3)
     /* [previous][next][first][last][top][bottom][index][help] */
  58 static int
  59 none_info(pcmk__output_t *out, const char *format, ...) {
  60     return pcmk_rc_no_output;
  61 }
  62 
  63 static void
  64 none_output_xml(pcmk__output_t *out, const char *name, const char *buf) {
     /* [previous][next][first][last][top][bottom][index][help] */
  65     /* This function intentionally left blank */
  66 }
  67 
  68 G_GNUC_PRINTF(4, 5)
     /* [previous][next][first][last][top][bottom][index][help] */
  69 static void
  70 none_begin_list(pcmk__output_t *out, const char *singular_noun, const char *plural_noun,
  71                 const char *format, ...) {
  72     /* This function intentionally left blank */
  73 }
  74 
  75 G_GNUC_PRINTF(3, 4)
     /* [previous][next][first][last][top][bottom][index][help] */
  76 static void
  77 none_list_item(pcmk__output_t *out, const char *id, const char *format, ...) {
  78     /* This function intentionally left blank */
  79 }
  80 
  81 static void
  82 none_increment_list(pcmk__output_t *out) {
     /* [previous][next][first][last][top][bottom][index][help] */
  83     /* This function intentionally left blank */
  84 }
  85 
  86 static void
  87 none_end_list(pcmk__output_t *out) {
     /* [previous][next][first][last][top][bottom][index][help] */
  88     /* This function intentionally left blank */
  89 }
  90 
  91 static bool
  92 none_is_quiet(pcmk__output_t *out) {
     /* [previous][next][first][last][top][bottom][index][help] */
  93     return out->quiet;
  94 }
  95 
  96 static void
  97 none_spacer(pcmk__output_t *out) {
     /* [previous][next][first][last][top][bottom][index][help] */
  98     /* This function intentionally left blank */
  99 }
 100 
 101 static void
 102 none_progress(pcmk__output_t *out, bool end) {
     /* [previous][next][first][last][top][bottom][index][help] */
 103     /* This function intentionally left blank */
 104 }
 105 
 106 static void
 107 none_prompt(const char *prompt, bool echo, char **dest) {
     /* [previous][next][first][last][top][bottom][index][help] */
 108     /* This function intentionally left blank */
 109 }
 110 
 111 pcmk__output_t *
 112 pcmk__mk_none_output(char **argv) {
     /* [previous][next][first][last][top][bottom][index][help] */
 113     pcmk__output_t *retval = calloc(1, sizeof(pcmk__output_t));
 114 
 115     if (retval == NULL) {
 116         return NULL;
 117     }
 118 
 119     retval->fmt_name = PCMK_VALUE_NONE;
 120     retval->request = pcmk__quote_cmdline(argv);
 121 
 122     retval->init = none_init;
 123     retval->free_priv = none_free_priv;
 124     retval->finish = none_finish;
 125     retval->reset = none_reset;
 126 
 127     retval->register_message = pcmk__register_message;
 128     retval->message = pcmk__call_message;
 129 
 130     retval->subprocess_output = none_subprocess_output;
 131     retval->version = none_version;
 132     retval->info = none_info;
 133     retval->transient = none_info;
 134     retval->err = none_err;
 135     retval->output_xml = none_output_xml;
 136 
 137     retval->begin_list = none_begin_list;
 138     retval->list_item = none_list_item;
 139     retval->increment_list = none_increment_list;
 140     retval->end_list = none_end_list;
 141 
 142     retval->is_quiet = none_is_quiet;
 143     retval->spacer = none_spacer;
 144     retval->progress = none_progress;
 145     retval->prompt = none_prompt;
 146 
 147     return retval;
 148 }

/* [previous][next][first][last][top][bottom][index][help] */