2424#include <crm/common/ipc.h>
2525#include <crm/cib.h>
2626
27- #define SUMMARY "Compare two Pacemaker configurations (in XML format) to produce a custom diff-like output, " \
28- "or apply such an output as a patch"
27+ #define SUMMARY "Compare two Pacemaker configurations (in XML format) to " \
28+ "produce a custom diff-like output, or apply such an output " \
29+ "as a patch"
2930
3031struct {
3132 gboolean apply ;
@@ -38,9 +39,32 @@ struct {
3839 char * xml_file_new ;
3940} options ;
4041
41- gboolean new_string_cb (const gchar * option_name , const gchar * optarg , gpointer data , GError * * error );
42- gboolean original_string_cb (const gchar * option_name , const gchar * optarg , gpointer data , GError * * error );
43- gboolean patch_cb (const gchar * option_name , const gchar * optarg , gpointer data , GError * * error );
42+ static gboolean
43+ new_string_cb (const gchar * option_name , const gchar * optarg , gpointer data ,
44+ GError * * error )
45+ {
46+ options .raw_new = TRUE;
47+ pcmk__str_update (& options .xml_file_new , optarg );
48+ return TRUE;
49+ }
50+
51+ static gboolean
52+ original_string_cb (const gchar * option_name , const gchar * optarg , gpointer data ,
53+ GError * * error )
54+ {
55+ options .raw_original = TRUE;
56+ pcmk__str_update (& options .xml_file_original , optarg );
57+ return TRUE;
58+ }
59+
60+ static gboolean
61+ patch_cb (const gchar * option_name , const gchar * optarg , gpointer data ,
62+ GError * * error )
63+ {
64+ options .apply = TRUE;
65+ pcmk__str_update (& options .xml_file_new , optarg );
66+ return TRUE;
67+ }
4468
4569static GOptionEntry original_xml_entries [] = {
4670 { "original" , 'o' , 0 , G_OPTION_ARG_STRING , & options .xml_file_original ,
@@ -81,27 +105,6 @@ static GOptionEntry addl_entries[] = {
81105 { NULL }
82106};
83107
84- gboolean
85- new_string_cb (const gchar * option_name , const gchar * optarg , gpointer data , GError * * error ) {
86- options .raw_new = TRUE;
87- pcmk__str_update (& options .xml_file_new , optarg );
88- return TRUE;
89- }
90-
91- gboolean
92- original_string_cb (const gchar * option_name , const gchar * optarg , gpointer data , GError * * error ) {
93- options .raw_original = TRUE;
94- pcmk__str_update (& options .xml_file_original , optarg );
95- return TRUE;
96- }
97-
98- gboolean
99- patch_cb (const gchar * option_name , const gchar * optarg , gpointer data , GError * * error ) {
100- options .apply = TRUE;
101- pcmk__str_update (& options .xml_file_new , optarg );
102- return TRUE;
103- }
104-
105108static void
106109print_patch (xmlNode * patch )
107110{
0 commit comments