pacemaker  1.1.15-e174ec8
Scalable High-Availability cluster resource manager
unpack.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 #ifndef PENGINE_UNPACK__H
19 # define PENGINE_UNPACK__H
20 
21 extern gboolean unpack_remote_nodes(xmlNode * xml_resources, pe_working_set_t * data_set);
22 
23 extern gboolean unpack_resources(xmlNode * xml_resources, pe_working_set_t * data_set);
24 
25 extern gboolean unpack_config(xmlNode * config, pe_working_set_t * data_set);
26 
27 extern gboolean unpack_nodes(xmlNode * xml_nodes, pe_working_set_t * data_set);
28 
29 extern gboolean unpack_domains(xmlNode * xml_domains, pe_working_set_t * data_set);
30 
31 extern gboolean unpack_tags(xmlNode * xml_tags, pe_working_set_t * data_set);
32 
33 extern gboolean unpack_status(xmlNode * status, pe_working_set_t * data_set);
34 
35 extern gboolean unpack_remote_status(xmlNode * status, pe_working_set_t * data_set);
36 
37 extern gint sort_op_by_callid(gconstpointer a, gconstpointer b);
38 
39 extern gboolean unpack_lrm_resources(node_t * node, xmlNode * lrm_state,
40  pe_working_set_t * data_set);
41 
42 extern gboolean add_node_attrs(xmlNode * attrs, node_t * node, gboolean overwrite,
43  pe_working_set_t * data_set);
44 
45 extern gboolean determine_online_status(xmlNode * node_state, node_t * this_node,
46  pe_working_set_t * data_set);
47 
48 extern const char *param_value(GHashTable * hash, xmlNode * parent, const char *name);
49 
50 /*
51  * The man pages for both curses and ncurses suggest inclusion of "curses.h".
52  * We believe the following to be acceptable and portable.
53  */
54 
55 # if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBCURSES)
56 # if defined(HAVE_NCURSES_H) && !defined(HAVE_INCOMPATIBLE_PRINTW)
57 # include <ncurses.h>
58 # define CURSES_ENABLED 1
59 # elif defined(HAVE_NCURSES_NCURSES_H) && !defined(HAVE_INCOMPATIBLE_PRINTW)
60 # include <ncurses/ncurses.h>
61 # define CURSES_ENABLED 1
62 # elif defined(HAVE_CURSES_H) && !defined(HAVE_INCOMPATIBLE_PRINTW)
63 # include <curses.h>
64 # define CURSES_ENABLED 1
65 # elif defined(HAVE_CURSES_CURSES_H) && !defined(HAVE_INCOMPATIBLE_PRINTW)
66 # include <curses/curses.h>
67 # define CURSES_ENABLED 1
68 # else
69 # define CURSES_ENABLED 0
70 # endif
71 # else
72 # define CURSES_ENABLED 0
73 # endif
74 
75 # if CURSES_ENABLED
76 # define status_printw(fmt, args...) printw(fmt, ##args)
77 # else
78 # define status_printw(fmt, args...) \
79  crm_err("printw support requires ncurses to be available during configure"); \
80  do_crm_log(LOG_WARNING, fmt, ##args);
81 # endif
82 
83 # define status_print(fmt, args...) \
84  if(options & pe_print_html) { \
85  FILE *stream = print_data; \
86  fprintf(stream, fmt, ##args); \
87  } else if(options & pe_print_ncurses) { \
88  status_printw(fmt, ##args); \
89  } else if(options & pe_print_printf) { \
90  FILE *stream = print_data; \
91  fprintf(stream, fmt, ##args); \
92  } else if(options & pe_print_xml) { \
93  FILE *stream = print_data; \
94  fprintf(stream, fmt, ##args); \
95  } else if(options & pe_print_log) { \
96  int log_level = *(int*)print_data; \
97  do_crm_log(log_level, fmt, ##args); \
98  }
99 
100 #endif
gboolean unpack_remote_status(xmlNode *status, pe_working_set_t *data_set)
Definition: unpack.c:1149
gboolean unpack_domains(xmlNode *xml_domains, pe_working_set_t *data_set)
gboolean unpack_lrm_resources(node_t *node, xmlNode *lrm_state, pe_working_set_t *data_set)
Definition: unpack.c:2265
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
Definition: utils.c:1326
gboolean unpack_config(xmlNode *config, pe_working_set_t *data_set)
Definition: unpack.c:108
gboolean unpack_nodes(xmlNode *xml_nodes, pe_working_set_t *data_set)
Definition: unpack.c:536
const char * param_value(GHashTable *hash, xmlNode *parent, const char *name)
gboolean determine_online_status(xmlNode *node_state, node_t *this_node, pe_working_set_t *data_set)
Definition: unpack.c:1444
gboolean add_node_attrs(xmlNode *attrs, node_t *node, gboolean overwrite, pe_working_set_t *data_set)
Definition: unpack.c:3264
gboolean unpack_resources(xmlNode *xml_resources, pe_working_set_t *data_set)
Definition: unpack.c:735
gboolean unpack_tags(xmlNode *xml_tags, pe_working_set_t *data_set)
Definition: unpack.c:799
gboolean unpack_remote_nodes(xmlNode *xml_resources, pe_working_set_t *data_set)
Definition: unpack.c:620
Definition: status.h:165
gboolean unpack_status(xmlNode *status, pe_working_set_t *data_set)
Definition: unpack.c:1009