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

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