pacemaker  2.1.8-3980678f03
Scalable High-Availability cluster resource manager
Data Structures | Macros | Typedefs | Functions | Variables
output_internal.h File Reference

Formatted output for pacemaker tools. More...

#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <libxml/tree.h>
#include <libxml/HTMLtree.h>
#include <glib.h>
#include <crm/common/results.h>
Include dependency graph for output_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pcmk__message_entry_s
 
struct  pcmk__supported_format_s
 
struct  pcmk__output_s
 This structure contains everything that makes up a single output formatter. More...
 

Macros

#define PCMK__OUTPUT_ARGS(ARGS...)
 
#define PCMK__SUPPORTED_FORMAT_HTML   { "html", pcmk__mk_html_output, pcmk__html_output_entries }
 
#define PCMK__SUPPORTED_FORMAT_LOG   { "log", pcmk__mk_log_output, NULL }
 
#define PCMK__SUPPORTED_FORMAT_NONE   { PCMK_VALUE_NONE, pcmk__mk_none_output, NULL }
 
#define PCMK__SUPPORTED_FORMAT_TEXT   { "text", pcmk__mk_text_output, pcmk__text_output_entries }
 
#define PCMK__SUPPORTED_FORMAT_XML   { "xml", pcmk__mk_xml_output, NULL }
 
#define PCMK__OUTPUT_SPACER_IF(out_obj, cond)
 
#define PCMK__OUTPUT_LIST_HEADER(out_obj, cond, retcode, title...)
 
#define PCMK__OUTPUT_LIST_FOOTER(out_obj, retcode)
 

Typedefs

typedef struct pcmk__output_s pcmk__output_t
 
typedef pcmk__output_t *(* pcmk__output_factory_t) (char **argv)
 
typedef int(* pcmk__message_fn_t) (pcmk__output_t *out, va_list args)
 
typedef struct pcmk__message_entry_s pcmk__message_entry_t
 
typedef struct pcmk__supported_format_s pcmk__supported_format_t
 

Functions

pcmk__output_tpcmk__mk_html_output (char **argv)
 
pcmk__output_tpcmk__mk_log_output (char **argv)
 
pcmk__output_tpcmk__mk_none_output (char **argv)
 
pcmk__output_tpcmk__mk_text_output (char **argv)
 
pcmk__output_tpcmk__mk_xml_output (char **argv)
 
int pcmk__call_message (pcmk__output_t *out, const char *message_id,...)
 
void pcmk__output_free (pcmk__output_t *out)
 
int pcmk__output_new (pcmk__output_t **out, const char *fmt_name, const char *filename, char **argv)
 
int pcmk__register_format (GOptionGroup *group, const char *name, pcmk__output_factory_t create, const GOptionEntry *options)
 
void pcmk__register_formats (GOptionGroup *group, const pcmk__supported_format_t *table)
 
void pcmk__unregister_formats (void)
 
void pcmk__register_message (pcmk__output_t *out, const char *message_id, pcmk__message_fn_t fn)
 
void pcmk__register_messages (pcmk__output_t *out, const pcmk__message_entry_t *table)
 
void pcmk__output_text_set_fancy (pcmk__output_t *out, bool enabled)
 
void pcmk__indented_printf (pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
 
void void pcmk__indented_vprintf (pcmk__output_t *out, const char *format, va_list args) G_GNUC_PRINTF(2
 
void void void pcmk__formatted_printf (pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
 
void void void void pcmk__formatted_vprintf (pcmk__output_t *out, const char *format, va_list args) G_GNUC_PRINTF(2
 
void void void void void pcmk__text_prompt (const char *prompt, bool echo, char **dest)
 
uint8_t pcmk__output_get_log_level (const pcmk__output_t *out)
 
void pcmk__output_set_log_level (pcmk__output_t *out, uint8_t log_level)
 
void pcmk__output_set_log_filter (pcmk__output_t *out, const char *file, const char *function, uint32_t line, uint32_t tags)
 
xmlNodePtr pcmk__output_xml_create_parent (pcmk__output_t *out, const char *name,...) G_GNUC_NULL_TERMINATED
 
void pcmk__output_xml_add_node_copy (pcmk__output_t *out, xmlNodePtr node)
 
xmlNodePtr pcmk__output_create_xml_node (pcmk__output_t *out, const char *name,...) G_GNUC_NULL_TERMINATED
 
xmlNodePtr pcmk__output_create_xml_text_node (pcmk__output_t *out, const char *name, const char *content)
 
void pcmk__output_xml_push_parent (pcmk__output_t *out, xmlNodePtr parent)
 
void pcmk__output_xml_pop_parent (pcmk__output_t *out)
 
xmlNodePtr pcmk__output_xml_peek_parent (pcmk__output_t *out)
 
xmlNodePtr pcmk__output_create_html_node (pcmk__output_t *out, const char *element_name, const char *id, const char *class_name, const char *text)
 
xmlNode * pcmk__html_create (xmlNode *parent, const char *name, const char *id, const char *class)
 
void pcmk__html_add_header (const char *name,...) G_GNUC_NULL_TERMINATED
 
void pcmk__output_and_clear_error (GError **error, pcmk__output_t *out)
 
int pcmk__xml_output_new (pcmk__output_t **out, xmlNodePtr *xml)
 
void pcmk__xml_output_finish (pcmk__output_t *out, crm_exit_t exit_status, xmlNodePtr *xml)
 
int pcmk__log_output_new (pcmk__output_t **out)
 
int pcmk__text_output_new (pcmk__output_t **out, const char *filename)
 
bool pcmk__output_get_legacy_xml (pcmk__output_t *out)
 
void pcmk__output_set_legacy_xml (pcmk__output_t *out)
 
void pcmk__output_enable_list_element (pcmk__output_t *out)
 

Variables

GOptionEntry pcmk__html_output_entries []
 
GOptionEntry pcmk__text_output_entries []
 

Detailed Description

Formatted output for pacemaker tools.

Definition in file output_internal.h.

Macro Definition Documentation

◆ PCMK__OUTPUT_ARGS

#define PCMK__OUTPUT_ARGS (   ARGS...)

Definition at line 34 of file output_internal.h.

◆ PCMK__OUTPUT_LIST_FOOTER

#define PCMK__OUTPUT_LIST_FOOTER (   out_obj,
  retcode 
)
Value:
if (retcode == pcmk_rc_ok) { \
out_obj->end_list(out_obj); \
}

Definition at line 1010 of file output_internal.h.

◆ PCMK__OUTPUT_LIST_HEADER

#define PCMK__OUTPUT_LIST_HEADER (   out_obj,
  cond,
  retcode,
  title... 
)
Value:
if (retcode == pcmk_rc_no_output) { \
PCMK__OUTPUT_SPACER_IF(out_obj, cond); \
retcode = pcmk_rc_ok; \
out_obj->begin_list(out_obj, NULL, NULL, title); \
}

Definition at line 1003 of file output_internal.h.

◆ PCMK__OUTPUT_SPACER_IF

#define PCMK__OUTPUT_SPACER_IF (   out_obj,
  cond 
)
Value:
if (cond) { \
out->spacer(out); \
}

Definition at line 998 of file output_internal.h.

◆ PCMK__SUPPORTED_FORMAT_HTML

#define PCMK__SUPPORTED_FORMAT_HTML   { "html", pcmk__mk_html_output, pcmk__html_output_entries }

Definition at line 154 of file output_internal.h.

◆ PCMK__SUPPORTED_FORMAT_LOG

#define PCMK__SUPPORTED_FORMAT_LOG   { "log", pcmk__mk_log_output, NULL }

Definition at line 155 of file output_internal.h.

◆ PCMK__SUPPORTED_FORMAT_NONE

#define PCMK__SUPPORTED_FORMAT_NONE   { PCMK_VALUE_NONE, pcmk__mk_none_output, NULL }

Definition at line 156 of file output_internal.h.

◆ PCMK__SUPPORTED_FORMAT_TEXT

#define PCMK__SUPPORTED_FORMAT_TEXT   { "text", pcmk__mk_text_output, pcmk__text_output_entries }

Definition at line 157 of file output_internal.h.

◆ PCMK__SUPPORTED_FORMAT_XML

#define PCMK__SUPPORTED_FORMAT_XML   { "xml", pcmk__mk_xml_output, NULL }

Definition at line 158 of file output_internal.h.

Typedef Documentation

◆ pcmk__message_entry_t

◆ pcmk__message_fn_t

typedef int(* pcmk__message_fn_t) (pcmk__output_t *out, va_list args)

Definition at line 68 of file output_internal.h.

◆ pcmk__output_factory_t

typedef pcmk__output_t*(* pcmk__output_factory_t) (char **argv)

Definition at line 49 of file output_internal.h.

◆ pcmk__output_t

Definition at line 37 of file output_internal.h.

◆ pcmk__supported_format_t

Function Documentation

◆ pcmk__call_message()

int pcmk__call_message ( pcmk__output_t out,
const char *  message_id,
  ... 
)

Definition at line 174 of file output.c.

◆ pcmk__formatted_printf()

void void void pcmk__formatted_printf ( pcmk__output_t out,
const char *  format,
  ... 
)

◆ pcmk__formatted_vprintf()

void void void void pcmk__formatted_vprintf ( pcmk__output_t out,
const char *  format,
va_list  args 
)

◆ pcmk__html_add_header()

void pcmk__html_add_header ( const char *  name,
  ... 
)

Definition at line 497 of file output_html.c.

◆ pcmk__html_create()

xmlNode* pcmk__html_create ( xmlNode *  parent,
const char *  name,
const char *  id,
const char *  class 
)

Definition at line 484 of file output_html.c.

◆ pcmk__indented_printf()

void pcmk__indented_printf ( pcmk__output_t out,
const char *  format,
  ... 
)

◆ pcmk__indented_vprintf()

void void pcmk__indented_vprintf ( pcmk__output_t out,
const char *  format,
va_list  args 
)

◆ pcmk__log_output_new()

int pcmk__log_output_new ( pcmk__output_t **  out)

Definition at line 291 of file output.c.

◆ pcmk__mk_html_output()

pcmk__output_t* pcmk__mk_html_output ( char **  argv)

Definition at line 411 of file output_html.c.

◆ pcmk__mk_log_output()

pcmk__output_t* pcmk__mk_log_output ( char **  argv)

Definition at line 315 of file output_log.c.

◆ pcmk__mk_none_output()

pcmk__output_t* pcmk__mk_none_output ( char **  argv)

Definition at line 112 of file output_none.c.

◆ pcmk__mk_text_output()

pcmk__output_t* pcmk__mk_text_output ( char **  argv)

Definition at line 325 of file output_text.c.

◆ pcmk__mk_xml_output()

pcmk__output_t* pcmk__mk_xml_output ( char **  argv)

Definition at line 439 of file output_xml.c.

◆ pcmk__output_and_clear_error()

void pcmk__output_and_clear_error ( GError **  error,
pcmk__output_t out 
)

Definition at line 215 of file output.c.

◆ pcmk__output_create_html_node()

xmlNodePtr pcmk__output_create_html_node ( pcmk__output_t out,
const char *  element_name,
const char *  id,
const char *  class_name,
const char *  text 
)

Definition at line 450 of file output_html.c.

◆ pcmk__output_create_xml_node()

xmlNodePtr pcmk__output_create_xml_node ( pcmk__output_t out,
const char *  name,
  ... 
)

Definition at line 516 of file output_xml.c.

◆ pcmk__output_create_xml_text_node()

xmlNodePtr pcmk__output_create_xml_text_node ( pcmk__output_t out,
const char *  name,
const char *  content 
)

Definition at line 537 of file output_xml.c.

◆ pcmk__output_enable_list_element()

void pcmk__output_enable_list_element ( pcmk__output_t out)

Definition at line 629 of file output_xml.c.

◆ pcmk__output_free()

void pcmk__output_free ( pcmk__output_t out)

Definition at line 30 of file output.c.

◆ pcmk__output_get_legacy_xml()

bool pcmk__output_get_legacy_xml ( pcmk__output_t out)

Definition at line 595 of file output_xml.c.

◆ pcmk__output_get_log_level()

uint8_t pcmk__output_get_log_level ( const pcmk__output_t out)

Definition at line 363 of file output_log.c.

◆ pcmk__output_new()

int pcmk__output_new ( pcmk__output_t **  out,
const char *  fmt_name,
const char *  filename,
char **  argv 
)

Definition at line 113 of file output.c.

◆ pcmk__output_set_legacy_xml()

void pcmk__output_set_legacy_xml ( pcmk__output_t out)

Definition at line 612 of file output_xml.c.

◆ pcmk__output_set_log_filter()

void pcmk__output_set_log_filter ( pcmk__output_t out,
const char *  file,
const char *  function,
uint32_t  line,
uint32_t  tags 
)

Definition at line 419 of file output_log.c.

◆ pcmk__output_set_log_level()

void pcmk__output_set_log_level ( pcmk__output_t out,
uint8_t  log_level 
)

Definition at line 390 of file output_log.c.

◆ pcmk__output_text_set_fancy()

void pcmk__output_text_set_fancy ( pcmk__output_t out,
bool  enabled 
)

Definition at line 397 of file output_text.c.

◆ pcmk__output_xml_add_node_copy()

void pcmk__output_xml_add_node_copy ( pcmk__output_t out,
xmlNodePtr  node 
)

Definition at line 496 of file output_xml.c.

◆ pcmk__output_xml_create_parent()

xmlNodePtr pcmk__output_xml_create_parent ( pcmk__output_t out,
const char *  name,
  ... 
)

Definition at line 478 of file output_xml.c.

◆ pcmk__output_xml_peek_parent()

xmlNodePtr pcmk__output_xml_peek_parent ( pcmk__output_t out)

Definition at line 580 of file output_xml.c.

◆ pcmk__output_xml_pop_parent()

void pcmk__output_xml_pop_parent ( pcmk__output_t out)

Definition at line 564 of file output_xml.c.

◆ pcmk__output_xml_push_parent()

void pcmk__output_xml_push_parent ( pcmk__output_t out,
xmlNodePtr  parent 
)

Definition at line 549 of file output_xml.c.

◆ pcmk__register_format()

int pcmk__register_format ( GOptionGroup *  group,
const char *  name,
pcmk__output_factory_t  create,
const GOptionEntry *  options 
)

Definition at line 127 of file output.c.

◆ pcmk__register_formats()

void pcmk__register_formats ( GOptionGroup *  group,
const pcmk__supported_format_t table 
)

Definition at line 153 of file output.c.

◆ pcmk__register_message()

void pcmk__register_message ( pcmk__output_t out,
const char *  message_id,
pcmk__message_fn_t  fn 
)

Definition at line 196 of file output.c.

◆ pcmk__register_messages()

void pcmk__register_messages ( pcmk__output_t out,
const pcmk__message_entry_t table 
)

Definition at line 204 of file output.c.

◆ pcmk__text_output_new()

int pcmk__text_output_new ( pcmk__output_t **  out,
const char *  filename 
)

Definition at line 320 of file output.c.

◆ pcmk__text_prompt()

void void void void void pcmk__text_prompt ( const char *  prompt,
bool  echo,
char **  dest 
)

Definition at line 476 of file output_text.c.

◆ pcmk__unregister_formats()

void pcmk__unregister_formats ( void  )

Definition at line 166 of file output.c.

◆ pcmk__xml_output_finish()

void pcmk__xml_output_finish ( pcmk__output_t out,
crm_exit_t  exit_status,
xmlNodePtr *  xml 
)

Definition at line 271 of file output.c.

◆ pcmk__xml_output_new()

int pcmk__xml_output_new ( pcmk__output_t **  out,
xmlNodePtr *  xml 
)

Definition at line 244 of file output.c.

Variable Documentation

◆ pcmk__html_output_entries

GOptionEntry pcmk__html_output_entries[]

Definition at line 44 of file output_html.c.

◆ pcmk__text_output_entries

GOptionEntry pcmk__text_output_entries[]

Definition at line 24 of file output_text.c.