MySQL  8.0.22
Source Code Documentation
app_data.h
Go to the documentation of this file.
1 /* Copyright (c) 2015, 2020, 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 
28 #include "xdr_gen/xcom_vp.h"
29 
30 #define copy_app_data(target, source) \
31  { \
32  IFDBG(D_NONE, FN; STRLIT(" copy_app_data "); PTREXP(target); \
33  PTREXP(*target); PTREXP(source)); \
34  _replace_app_data_list(target, source); \
35  }
36 
37 #define steal_app_data(target, source) \
38  { \
39  (target) = (source); \
40  (source) = NULL; \
41  }
42 
43 app_data_ptr clone_app_data(app_data_ptr a);
44 app_data_ptr clone_app_data_single(app_data_ptr a);
45 app_data_ptr new_app_data();
46 app_data_ptr init_app_data(app_data_ptr a);
47 
48 app_data_ptr new_data(u_int n, char *val, cons_type consensus);
49 app_data_ptr new_exit();
50 app_data_ptr new_nodes(u_int n, node_address *names, cargo_type cargo);
51 app_data_ptr new_reset(cargo_type type);
52 
53 void _replace_app_data_list(app_data_list target, app_data_ptr source);
54 char *dbg_app_data(app_data_ptr a);
55 void follow(app_data_list l, app_data_ptr p);
56 size_t app_data_size(app_data const *a);
57 size_t app_data_list_size(app_data const *a);
58 unsigned long msg_count(app_data_ptr a);
59 
60 #endif
app_data_ptr new_exit()
Definition: app_data.cc:385
app_data_ptr new_app_data()
Constructor for app_data.
Definition: app_data.cc:276
app_data_ptr clone_app_data(app_data_ptr a)
Definition: app_data.cc:120
void _replace_app_data_list(app_data_list target, app_data_ptr source)
Definition: app_data.cc:310
char * dbg_app_data(app_data_ptr a)
Definition: app_data.cc:290
app_data_ptr init_app_data(app_data_ptr a)
Definition: app_data.cc:282
app_data_ptr new_reset(cargo_type type)
Definition: app_data.cc:375
size_t app_data_size(app_data const *a)
Return size of an app_data.
Definition: app_data.cc:221
app_data_ptr new_data(u_int n, char *val, cons_type consensus)
Definition: app_data.cc:360
app_data_ptr new_nodes(u_int n, node_address *names, cargo_type cargo)
Definition: app_data.cc:349
unsigned long msg_count(app_data_ptr a)
Count the number of messages in a list.
Definition: app_data.cc:338
__u_int u_int
Definition: types.h:72
app_data_ptr clone_app_data_single(app_data_ptr a)
Clone an app_data struct.
Definition: app_data.cc:140
void follow(app_data_list l, app_data_ptr p)
Insert p after l.
Definition: app_data.cc:319
int n
Definition: xcom_base.cc:442
const char * p
Definition: ctype-mb.cc:1235
size_t app_data_list_size(app_data const *a)
Definition: app_data.cc:259