MySQL  8.0.19
Source Code Documentation
app_data.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 APP_DATA_H
24 #define APP_DATA_H
25 
26 #include <stddef.h>
27 
29 #include "plugin/group_replication/libmysqlgcs/xdr_gen/xcom_vp.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #define copy_app_data(target, source) \
36  { \
37  MAY_DBG(FN; STRLIT(" copy_app_data "); PTREXP(target); PTREXP(*target); \
38  PTREXP(source)); \
39  _replace_app_data_list(target, source); \
40  }
41 
42 #define steal_app_data(target, source) \
43  { \
44  (target) = (source); \
45  (source) = NULL; \
46  }
47 
48 app_data_ptr clone_app_data(app_data_ptr a);
49 app_data_ptr clone_app_data_single(app_data_ptr a);
50 app_data_ptr new_app_data();
51 app_data_ptr init_app_data(app_data_ptr a);
52 
53 app_data_ptr new_data(u_int n, char *val, cons_type consensus);
54 app_data_ptr new_exit();
55 app_data_ptr new_nodes(u_int n, node_address *names, cargo_type cargo);
56 app_data_ptr new_reset(cargo_type type);
57 
58 void _replace_app_data_list(app_data_list target, app_data_ptr source);
59 char *dbg_app_data(app_data_ptr a);
60 void follow(app_data_list l, app_data_ptr p);
61 void sort_app_data(app_data_ptr x[], int n);
62 size_t app_data_size(app_data const *a);
63 size_t app_data_list_size(app_data const *a);
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif
app_data_size
size_t app_data_size(app_data const *a)
Return size of an app_data.
Definition: app_data.c:254
init_app_data
app_data_ptr init_app_data(app_data_ptr a)
Definition: app_data.c:330
xdr_utils.h
_replace_app_data_list
void _replace_app_data_list(app_data_list target, app_data_ptr source)
Definition: app_data.c:359
new_nodes
app_data_ptr new_nodes(u_int n, node_address *names, cargo_type cargo)
Definition: app_data.c:413
dbg_app_data
char * dbg_app_data(app_data_ptr a)
Definition: app_data.c:338
clone_app_data
app_data_ptr clone_app_data(app_data_ptr a)
Definition: app_data.c:137
clone_app_data_single
app_data_ptr clone_app_data_single(app_data_ptr a)
Clone an app_data struct.
Definition: app_data.c:157
new_reset
app_data_ptr new_reset(cargo_type type)
Definition: app_data.c:443
app_data_list_size
size_t app_data_list_size(app_data const *a)
Definition: app_data.c:307
sort_app_data
void sort_app_data(app_data_ptr x[], int n)
Sort an array of app_data pointers.
Definition: app_data.c:405
follow
void follow(app_data_list l, app_data_ptr p)
Insert p after l.
Definition: app_data.c:370
HttpMethod::type
int type
Definition: http_common.h:411
new_data
app_data_ptr new_data(u_int n, char *val, cons_type consensus)
Definition: app_data.c:426
n
int n
Definition: xcom_base.c:425
new_app_data
app_data_ptr new_app_data()
Constructor for app_data.
Definition: app_data.c:324
u_int
__u_int u_int
Definition: types.h:73
p
const char * p
Definition: ctype-mb.cc:1233
new_exit
app_data_ptr new_exit()
Definition: app_data.c:453