MySQL 9.1.0
Source Code Documentation
pax_msg.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef PAX_MSG_H
25#define PAX_MSG_H
26
27#include "xcom/site_struct.h"
28#include "xdr_gen/xcom_vp.h"
29
30#ifdef PAX_MSG_SANITY_CHECK
31#define PAX_MSG_SANITY_CHECK(p) \
32 { \
33 if ((p) && !(p)->a && (p)->msg_type == normal) { \
34 assert((p)->op != client_msg); \
35 assert((p)->op != ack_prepare_op); \
36 assert((p)->op != accept_op); \
37 assert((p)->op != learn_op); \
38 } \
39 }
40#else
41#define PAX_MSG_SANITY_CHECK(p)
42#endif
43
44#define CLONE_PAX_MSG(target, msg) \
45 replace_pax_msg((&target), clone_pax_msg_no_app(msg))
46
47int eq_ballot(ballot x, ballot y);
48int gt_ballot(ballot x, ballot y);
49int ref_msg(pax_msg *p);
50int unref_msg(pax_msg **pp);
53ballot *init_ballot(ballot *bal, int cnt, node_no node);
54pax_msg *pax_msg_new(synode_no synode, site_def const *site);
55pax_msg *pax_msg_new_0(synode_no synode);
56void dbg_ballot(ballot const *p, char *s);
57void add_ballot_event(ballot const bal);
58char *dbg_pax_msg(pax_msg const *p);
60/* void replace_pax_msg(pax_msg **target, pax_msg *p); */
62
63#define replace_pax_msg(target, p) \
64 { \
65 PAX_MSG_SANITY_CHECK(p); \
66 unchecked_replace_pax_msg(target, p); \
67 }
68
69#endif
const char * p
Definition: ctype-mb.cc:1225
pax_msg * pax_msg_new_0(synode_no synode)
Definition: pax_msg.cc:85
void delete_pax_msg(pax_msg *p)
Definition: pax_msg.cc:115
void dbg_ballot(ballot const *p, char *s)
char * dbg_pax_msg(pax_msg const *p)
pax_msg * clone_pax_msg(pax_msg *msg)
Definition: pax_msg.cc:103
pax_msg * clone_pax_msg_no_app(pax_msg *msg)
Definition: pax_msg.cc:91
int unref_msg(pax_msg **pp)
Definition: pax_msg.cc:126
void add_ballot_event(ballot const bal)
pax_msg * pax_msg_new(synode_no synode, site_def const *site)
Definition: pax_msg.cc:79
ballot * init_ballot(ballot *bal, int cnt, node_no node)
Definition: pax_msg.cc:181
void unchecked_replace_pax_msg(pax_msg **target, pax_msg *p)
Definition: pax_msg.cc:139
int gt_ballot(ballot x, ballot y)
Definition: pax_msg.cc:189
int eq_ballot(ballot x, ballot y)
Definition: pax_msg.cc:187
int ref_msg(pax_msg *p)
Definition: pax_msg.cc:120
struct pax_msg pax_msg
Definition: site_struct.h:37
Definition: site_struct.h:43