11 # define CRM_OUTPUT__H 24 # include <libxml/tree.h> 25 # include <libxml/HTMLtree.h> 30 # define PCMK__API_VERSION "2.3" 32 #if defined(PCMK__WITH_ATTRIBUTE_OUTPUT_ARGS) 33 # define PCMK__OUTPUT_ARGS(ARGS...) __attribute__((output_args(ARGS))) 35 # define PCMK__OUTPUT_ARGS(ARGS...) 155 #define PCMK__SUPPORTED_FORMAT_HTML { "html", pcmk__mk_html_output, pcmk__html_output_entries } 156 #define PCMK__SUPPORTED_FORMAT_LOG { "log", pcmk__mk_log_output, pcmk__log_output_entries } 157 #define PCMK__SUPPORTED_FORMAT_NONE { "none", pcmk__mk_none_output, pcmk__none_output_entries } 158 #define PCMK__SUPPORTED_FORMAT_TEXT { "text", pcmk__mk_text_output, pcmk__text_output_entries } 159 #define PCMK__SUPPORTED_FORMAT_XML { "xml", pcmk__mk_xml_output, pcmk__xml_output_entries } 340 const char *proc_stdout,
const char *proc_stderr);
410 const char *plural_noun,
const char *format, ...)
509 const char *filename,
char **argv);
725 const
char *class_name, const
char *text);
744 G_GNUC_NULL_TERMINATED;
746 #define PCMK__OUTPUT_SPACER_IF(out_obj, cond) \ 748 out_obj->info(out_obj, "%s", ""); \ 751 #define PCMK__OUTPUT_LIST_HEADER(out_obj, cond, retcode, title...) \ 752 if (retcode == pcmk_rc_no_output) { \ 753 PCMK__OUTPUT_SPACER_IF(out_obj, cond); \ 754 retcode = pcmk_rc_ok; \ 755 out_obj->begin_list(out_obj, NULL, NULL, title); \ 758 #define PCMK__OUTPUT_LIST_FOOTER(out_obj, retcode) \ 759 if (retcode == pcmk_rc_ok) { \ 760 out_obj->end_list(out_obj); \ int(* pcmk__message_fn_t)(pcmk__output_t *out, va_list args)
void(* end_list)(pcmk__output_t *out)
pcmk__output_t * pcmk__mk_text_output(char **argv)
void void pcmk__indented_vprintf(pcmk__output_t *out, const char *format, va_list args) G_GNUC_PRINTF(2
pcmk__message_fn_t fn
The function to be called for message_id given a match on fmt_name. See comments on pcmk__message_fn_...
int(* message)(pcmk__output_t *out, const char *message_id,...)
void pcmk__html_add_header(const char *name,...) G_GNUC_NULL_TERMINATED
const char * fmt_name
The name of this output formatter.
bool(* is_quiet)(pcmk__output_t *out)
void pcmk__register_message(pcmk__output_t *out, const char *message_id, pcmk__message_fn_t fn)
struct pcmk__message_entry_s pcmk__message_entry_t
pcmk__output_t * pcmk__mk_html_output(char **argv)
xmlNodePtr pcmk__output_xml_peek_parent(pcmk__output_t *out)
void pcmk__output_xml_add_node(pcmk__output_t *out, xmlNodePtr node)
enum crm_exit_e crm_exit_t
void(*) void(* err)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
xmlNodePtr pcmk__output_create_html_node(pcmk__output_t *out, const char *element_name, const char *id, const char *class_name, const char *text)
void pcmk__register_formats(GOptionGroup *group, pcmk__supported_format_t *table)
GOptionEntry pcmk__html_output_entries[]
pcmk__output_t * pcmk__mk_log_output(char **argv)
GOptionEntry pcmk__xml_output_entries[]
int pcmk__call_message(pcmk__output_t *out, const char *message_id,...)
GHashTable * messages
Custom messages that are currently registered on this formatter.
void(* info)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
void * priv
Implementation-specific private data.
void(* register_message)(pcmk__output_t *out, const char *message_id, pcmk__message_fn_t fn)
void pcmk__output_xml_push_parent(pcmk__output_t *out, xmlNodePtr node)
pcmk__output_t * pcmk__mk_none_output(char **argv)
const char * fmt_name
The format type this handler is for.
bool quiet
Should this formatter supress most output?
int pcmk__register_format(GOptionGroup *group, const char *name, pcmk__output_factory_t create, GOptionEntry *options)
void(* free_priv)(pcmk__output_t *out)
bool(* init)(pcmk__output_t *out)
GOptionEntry pcmk__log_output_entries[]
void(* finish)(pcmk__output_t *out, crm_exit_t exit_status, bool print, void **copy_dest)
void pcmk__indented_printf(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
void(*) void(*) void(* output_xml)(pcmk__output_t *out, const char *name, const char *buf)
void pcmk__output_xml_pop_parent(pcmk__output_t *out)
Function and executable result codes.
pcmk__output_t * pcmk__mk_xml_output(char **argv)
FILE * dest
Where output should be written.
void pcmk__output_free(pcmk__output_t *out)
void pcmk__unregister_formats(void)
void void xmlNodePtr pcmk__output_xml_create_parent(pcmk__output_t *out, const char *name)
GOptionEntry pcmk__text_output_entries[]
GOptionEntry pcmk__none_output_entries[]
pcmk__output_t *(* pcmk__output_factory_t)(char **argv)
void(*) void(* list_item)(pcmk__output_t *out, const char *name, const char *format,...) G_GNUC_PRINTF(3
gchar * request
A copy of the request that generated this output.
This structure contains everything that makes up a single output formatter.
void(* version)(pcmk__output_t *out, bool extended)
void(* begin_list)(pcmk__output_t *out, const char *singular_noun, const char *plural_noun, const char *format,...) G_GNUC_PRINTF(4
void pcmk__register_messages(pcmk__output_t *out, pcmk__message_entry_t *table)
xmlNodePtr pcmk__output_create_xml_node(pcmk__output_t *out, const char *name)
void(* reset)(pcmk__output_t *out)
int pcmk__output_new(pcmk__output_t **out, const char *fmt_name, const char *filename, char **argv)
xmlNodePtr pcmk__output_create_xml_text_node(pcmk__output_t *out, const char *name, const char *content)
const char * message_id
The message to be handled.
void(*) void(*) void(* increment_list)(pcmk__output_t *out)
void(* subprocess_output)(pcmk__output_t *out, int exit_status, const char *proc_stdout, const char *proc_stderr)
struct pcmk__supported_format_s pcmk__supported_format_t