MySQL  8.0.19
Source Code Documentation
pax_msg.h
Go to the documentation of this file.
1 /* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
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 
27 #include "plugin/group_replication/libmysqlgcs/xdr_gen/xcom_vp.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #if 0
34 #define PAX_MSG_SANITY_CHECK(p) \
35  { \
36  if ((p) && !(p)->a && (p)->msg_type == normal) { \
37  assert((p)->op != client_msg); \
38  assert((p)->op != ack_prepare_op); \
39  assert((p)->op != accept_op); \
40  assert((p)->op != learn_op); \
41  } \
42  }
43 #else
44 #define PAX_MSG_SANITY_CHECK(p)
45 #endif
46 
47 #define CLONE_PAX_MSG(target, msg) \
48  replace_pax_msg((&target), clone_pax_msg_no_app(msg))
49 
50 int eq_ballot(ballot x, ballot y);
51 int gt_ballot(ballot x, ballot y);
52 int ref_msg(pax_msg *p);
53 int unref_msg(pax_msg **pp);
54 pax_msg *clone_pax_msg_no_app(pax_msg *msg);
55 pax_msg *clone_pax_msg(pax_msg *msg);
56 ballot *init_ballot(ballot *bal, int cnt, node_no node);
57 pax_msg *pax_msg_new(synode_no synode, site_def const *site);
58 pax_msg *pax_msg_new_0(synode_no synode);
59 void dbg_ballot(ballot const *p, char *s);
60 char *dbg_pax_msg(pax_msg const *p);
61 void delete_pax_msg(pax_msg *p);
62 /* void replace_pax_msg(pax_msg **target, pax_msg *p); */
63 void unchecked_replace_pax_msg(pax_msg **target, pax_msg *p);
64 
65 #define replace_pax_msg(target, p) \
66  { \
67  PAX_MSG_SANITY_CHECK(p); \
68  unchecked_replace_pax_msg(target, p); \
69  }
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif
ref_msg
int ref_msg(pax_msg *p)
Definition: pax_msg.c:118
eq_ballot
int eq_ballot(ballot x, ballot y)
Definition: pax_msg.c:192
msg
char msg[1024]
Definition: test_sql_9_sessions.cc:281
unchecked_replace_pax_msg
void unchecked_replace_pax_msg(pax_msg **target, pax_msg *p)
Definition: pax_msg.c:137
clone_pax_msg
pax_msg * clone_pax_msg(pax_msg *msg)
Definition: pax_msg.c:101
dbg_pax_msg
char * dbg_pax_msg(pax_msg const *p)
Definition: pax_msg.c:156
init_ballot
ballot * init_ballot(ballot *bal, int cnt, node_no node)
Definition: pax_msg.c:186
clone_pax_msg_no_app
pax_msg * clone_pax_msg_no_app(pax_msg *msg)
Definition: pax_msg.c:89
dbg_ballot
void dbg_ballot(ballot const *p, char *s)
pax_msg_new
pax_msg * pax_msg_new(synode_no synode, site_def const *site)
Definition: pax_msg.c:77
pax_msg_new_0
pax_msg * pax_msg_new_0(synode_no synode)
Definition: pax_msg.c:83
site_def
Definition: site_struct.h:33
gt_ballot
int gt_ballot(ballot x, ballot y)
Definition: pax_msg.c:194
unref_msg
int unref_msg(pax_msg **pp)
Definition: pax_msg.c:124
site_struct.h
p
const char * p
Definition: ctype-mb.cc:1233
delete_pax_msg
void delete_pax_msg(pax_msg *p)
Definition: pax_msg.c:113