MySQL 8.1.0
Source Code Documentation
pax_msg.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 2023, 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 also distributed 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 included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef PAX_MSG_H
24#define PAX_MSG_H
25
26#include "xcom/site_struct.h"
27#include "xdr_gen/xcom_vp.h"
28
29#ifdef PAX_MSG_SANITY_CHECK
30#define PAX_MSG_SANITY_CHECK(p) \
31 { \
32 if ((p) && !(p)->a && (p)->msg_type == normal) { \
33 assert((p)->op != client_msg); \
34 assert((p)->op != ack_prepare_op); \
35 assert((p)->op != accept_op); \
36 assert((p)->op != learn_op); \
37 } \
38 }
39#else
40#define PAX_MSG_SANITY_CHECK(p)
41#endif
42
43#define CLONE_PAX_MSG(target, msg) \
44 replace_pax_msg((&target), clone_pax_msg_no_app(msg))
45
46int eq_ballot(ballot x, ballot y);
47int gt_ballot(ballot x, ballot y);
48int ref_msg(pax_msg *p);
49int unref_msg(pax_msg **pp);
52ballot *init_ballot(ballot *bal, int cnt, node_no node);
53pax_msg *pax_msg_new(synode_no synode, site_def const *site);
54pax_msg *pax_msg_new_0(synode_no synode);
55void dbg_ballot(ballot const *p, char *s);
56void add_ballot_event(ballot const bal);
57char *dbg_pax_msg(pax_msg const *p);
59/* void replace_pax_msg(pax_msg **target, pax_msg *p); */
61
62#define replace_pax_msg(target, p) \
63 { \
64 PAX_MSG_SANITY_CHECK(p); \
65 unchecked_replace_pax_msg(target, p); \
66 }
67
68#endif
const char * p
Definition: ctype-mb.cc:1234
pax_msg * pax_msg_new_0(synode_no synode)
Definition: pax_msg.cc:84
void delete_pax_msg(pax_msg *p)
Definition: pax_msg.cc:114
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:102
pax_msg * clone_pax_msg_no_app(pax_msg *msg)
Definition: pax_msg.cc:90
int unref_msg(pax_msg **pp)
Definition: pax_msg.cc:125
void add_ballot_event(ballot const bal)
pax_msg * pax_msg_new(synode_no synode, site_def const *site)
Definition: pax_msg.cc:78
ballot * init_ballot(ballot *bal, int cnt, node_no node)
Definition: pax_msg.cc:180
void unchecked_replace_pax_msg(pax_msg **target, pax_msg *p)
Definition: pax_msg.cc:138
int gt_ballot(ballot x, ballot y)
Definition: pax_msg.cc:188
int eq_ballot(ballot x, ballot y)
Definition: pax_msg.cc:186
int ref_msg(pax_msg *p)
Definition: pax_msg.cc:119
struct pax_msg pax_msg
Definition: site_struct.h:36
Definition: site_struct.h:42