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. pcmk__mk_none_output

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

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