pacemaker  1.1.17-b36b869ca8
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_tags(xmlNode * xml_tags, pe_working_set_t * data_set);
30 
31 extern gboolean unpack_status(xmlNode * status, pe_working_set_t * data_set);
32 
33 extern gboolean unpack_remote_status(xmlNode * status, pe_working_set_t * data_set);
34 
35 extern gint sort_op_by_callid(gconstpointer a, gconstpointer b);
36 
37 extern gboolean unpack_lrm_resources(node_t * node, xmlNode * lrm_state,
38  pe_working_set_t * data_set);
39 
40 extern gboolean add_node_attrs(xmlNode * attrs, node_t * node, gboolean overwrite,
41  pe_working_set_t * data_set);
42 
43 extern gboolean determine_online_status(xmlNode * node_state, node_t * this_node,
44  pe_working_set_t * data_set);
45 
46 /*
47  * The man pages for both curses and ncurses suggest inclusion of "curses.h".
48  * We believe the following to be acceptable and portable.
49  */
50 
51 # if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBCURSES)
52 # if defined(HAVE_NCURSES_H) && !defined(HAVE_INCOMPATIBLE_PRINTW)
53 # include <ncurses.h>
54 # define CURSES_ENABLED 1
55 # elif defined(HAVE_NCURSES_NCURSES_H) && !defined(HAVE_INCOMPATIBLE_PRINTW)
56 # include <ncurses/ncurses.h>
57 # define CURSES_ENABLED 1
58 # elif defined(HAVE_CURSES_H) && !defined(HAVE_INCOMPATIBLE_PRINTW)
59 # include <curses.h>
60 # define CURSES_ENABLED 1
61 # elif defined(HAVE_CURSES_CURSES_H) && !defined(HAVE_INCOMPATIBLE_PRINTW)
62 # include <curses/curses.h>
63 # define CURSES_ENABLED 1
64 # else
65 # define CURSES_ENABLED 0
66 # endif
67 # else
68 # define CURSES_ENABLED 0
69 # endif
70 
71 # if CURSES_ENABLED
72 # define status_printw(fmt, args...) printw(fmt, ##args)
73 # else
74 # define status_printw(fmt, args...) \
75  crm_err("printw support requires ncurses to be available during configure"); \
76  do_crm_log(LOG_WARNING, fmt, ##args);
77 # endif
78 
79 # define status_print(fmt, args...) \
80  if(options & pe_print_html) { \
81  FILE *stream = print_data; \
82  fprintf(stream, fmt, ##args); \
83  } else if(options & pe_print_ncurses) { \
84  status_printw(fmt, ##args); \
85  } else if(options & pe_print_printf) { \
86  FILE *stream = print_data; \
87  fprintf(stream, fmt, ##args); \
88  } else if(options & pe_print_xml) { \
89  FILE *stream = print_data; \
90  fprintf(stream, fmt, ##args); \
91  } else if(options & pe_print_log) { \
92  int log_level = *(int*)print_data; \
93  do_crm_log(log_level, fmt, ##args); \
94  }
95 
96 #endif
gboolean unpack_remote_status(xmlNode *status, 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:2346
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
Definition: utils.c:1353
gboolean unpack_config(xmlNode *config, pe_working_set_t *data_set)
Definition: unpack.c:141
gboolean unpack_nodes(xmlNode *xml_nodes, pe_working_set_t *data_set)
Definition: unpack.c:584
gboolean determine_online_status(xmlNode *node_state, node_t *this_node, pe_working_set_t *data_set)
Definition: unpack.c:1511
gboolean add_node_attrs(xmlNode *attrs, node_t *node, gboolean overwrite, pe_working_set_t *data_set)
Definition: unpack.c:3349
gboolean unpack_resources(xmlNode *xml_resources, pe_working_set_t *data_set)
Definition: unpack.c:782
gboolean unpack_tags(xmlNode *xml_tags, pe_working_set_t *data_set)
Definition: unpack.c:842
gboolean unpack_remote_nodes(xmlNode *xml_resources, pe_working_set_t *data_set)
Definition: unpack.c:669
Definition: status.h:169
gboolean unpack_status(xmlNode *status, pe_working_set_t *data_set)
Definition: unpack.c:1179