Skip to content

Commit 35c967d

Browse files
committed
Refactor: based: New based_notify.h
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
1 parent 337db29 commit 35c967d

5 files changed

Lines changed: 26 additions & 9 deletions

File tree

daemons/based/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ halibdir = $(CRM_DAEMON_DIR)
1515
halib_PROGRAMS = pacemaker-based
1616

1717
noinst_HEADERS = based_io.h \
18+
based_notify.h \
1819
based_operation.h \
1920
based_transaction.h \
2021
pacemaker-based.h

daemons/based/based_callbacks.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,8 +1183,8 @@ cib_process_command(xmlNode *request, const cib__operation_t *operation,
11831183
cib_dryrun|cib_inhibit_notify|cib_transaction)) {
11841184
pcmk__trace("Sending notifications %d",
11851185
pcmk__is_set(call_options, cib_dryrun));
1186-
cib_diff_notify(op, pcmk_rc2legacy(rc), call_id, client_id, client_name,
1187-
originator, input, cib_diff);
1186+
based_diff_notify(op, pcmk_rc2legacy(rc), call_id, client_id,
1187+
client_name, originator, input, cib_diff);
11881188
}
11891189

11901190
pcmk__log_xml_patchset(LOG_TRACE, cib_diff);

daemons/based/based_notify.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ cib_notify_send(const xmlNode *xml)
151151
}
152152

153153
void
154-
cib_diff_notify(const char *op, int result, const char *call_id,
155-
const char *client_id, const char *client_name,
156-
const char *origin, xmlNode *update, xmlNode *diff)
154+
based_diff_notify(const char *op, int result, const char *call_id,
155+
const char *client_id, const char *client_name,
156+
const char *origin, xmlNode *update, xmlNode *diff)
157157
{
158158
int add_updates = 0;
159159
int add_epoch = 0;

daemons/based/based_notify.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright 2025 the Pacemaker project contributors
3+
*
4+
* The version control history for this file may have further details.
5+
*
6+
* This source code is licensed under the GNU Lesser General Public License
7+
* version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8+
*/
9+
10+
#ifndef BASED_NOTIFY__H
11+
#define BASED_NOTIFY__H
12+
13+
#include <libxml/tree.h> // xmlNode
14+
15+
void based_diff_notify(const char *op, int result, const char *call_id,
16+
const char *client_id, const char *client_name,
17+
const char *origin, xmlNode *update, xmlNode *diff);
18+
19+
#endif // BASED_NOTIFY__H

daemons/based/pacemaker-based.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
#include "based_io.h"
3434
#include "based_operation.h"
35+
#include "based_notify.h"
3536
#include "based_transaction.h"
3637

3738
#include <gnutls/gnutls.h>
@@ -119,10 +120,6 @@ int cib_process_schemas(const char *op, int options, const char *section,
119120
void send_sync_request(const char *host);
120121
int sync_our_cib(xmlNode *request, bool all);
121122

122-
void cib_diff_notify(const char *op, int result, const char *call_id,
123-
const char *client_id, const char *client_name,
124-
const char *origin, xmlNode *update, xmlNode *diff);
125-
126123
static inline const char *
127124
cib_config_lookup(const char *opt)
128125
{

0 commit comments

Comments
 (0)