MCPcopy Create free account
hub / github.com/corosync/corosync / display_groups

Function display_groups

tools/corosync-cpgtool.c:115–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115static int display_groups (char delimiter, int escape)
116{
117 cs_error_t res;
118 cpg_iteration_handle_t iter_handle;
119 struct cpg_iteration_description_t description;
120
121 res = cpg_iteration_initialize (cpg_handle, CPG_ITERATION_NAME_ONLY, NULL, &iter_handle);
122 if (res != CS_OK) {
123 fprintf (stderr, "Cannot initialize cpg iterator error %d\n", res);
124
125 return 0;
126 }
127
128 while ((res = cpg_iteration_next (iter_handle, &description)) == CS_OK) {
129 fprint_group (stdout, escape, &description.group);
130 fputc ((delimiter ? delimiter : '\n'), stdout);
131 }
132
133 if (delimiter)
134 putc ('\n', stdout);
135
136 cpg_iteration_finalize (iter_handle);
137
138 return 1;
139}
140
141static inline int group_name_compare (
142 const struct cpg_name *g1,

Callers 1

mainFunction · 0.85

Calls 4

cpg_iteration_initializeFunction · 0.85
cpg_iteration_nextFunction · 0.85
fprint_groupFunction · 0.85
cpg_iteration_finalizeFunction · 0.85

Tested by

no test coverage detected