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

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