This source file includes following definitions.
- blank_screen
- compare_attribute
- append_attr_list
- crm_mon_get_parameters
- get_resource_display_options
1
2
3
4
5
6
7
8
9
10 #include <glib.h>
11 #include <stdio.h>
12 #include <stdlib.h>
13
14 #include <crm/crm.h>
15 #include <crm/msg_xml.h>
16 #include <crm/common/curses_internal.h>
17 #include <crm/pengine/common.h>
18 #include <crm/pengine/internal.h>
19 #include <crm/pengine/pe_types.h>
20 #include <crm/stonith-ng.h>
21 #include <crm/common/internal.h>
22 #include <crm/common/util.h>
23
24 #include "crm_mon.h"
25
26 void
27 blank_screen(void)
28 {
29 #if CURSES_ENABLED
30 int lpc = 0;
31
32 for (lpc = 0; lpc < LINES; lpc++) {
33 move(lpc, 0);
34 clrtoeol();
35 }
36 move(0, 0);
37 refresh();
38 #endif
39 }
40
41 static int
42 compare_attribute(gconstpointer a, gconstpointer b)
43 {
44 int rc;
45
46 rc = strcmp((const char *)a, (const char *)b);
47
48 return rc;
49 }
50
51 GList *
52 append_attr_list(GList *attr_list, char *name)
53 {
54 int i;
55 const char *filt_str[] = FILTER_STR;
56
57 CRM_CHECK(name != NULL, return attr_list);
58
59
60 for (i = 0; filt_str[i] != NULL; i++) {
61 if (g_str_has_prefix(name, filt_str[i])) {
62 return attr_list;
63 }
64 }
65
66 return g_list_insert_sorted(attr_list, name, compare_attribute);
67 }
68
69 void
70 crm_mon_get_parameters(pe_resource_t *rsc, pe_working_set_t * data_set)
71 {
72 get_rsc_attributes(rsc->parameters, rsc, NULL, data_set);
73 if(rsc->children) {
74 GListPtr gIter = NULL;
75
76 for (gIter = rsc->children; gIter != NULL; gIter = gIter->next) {
77 crm_mon_get_parameters(gIter->data, data_set);
78 }
79 }
80 }
81
82
83
84
85
86
87
88 unsigned int
89 get_resource_display_options(unsigned int mon_ops)
90 {
91 int print_opts = 0;
92
93 if (pcmk_is_set(mon_ops, mon_op_print_pending)) {
94 print_opts |= pe_print_pending;
95 }
96 if (pcmk_is_set(mon_ops, mon_op_print_clone_detail)) {
97 print_opts |= pe_print_clone_details|pe_print_implicit;
98 }
99 if (!pcmk_is_set(mon_ops, mon_op_inactive_resources)) {
100 print_opts |= pe_print_clone_active;
101 }
102 if (pcmk_is_set(mon_ops, mon_op_print_brief)) {
103 print_opts |= pe_print_brief;
104 }
105 return print_opts;
106 }