MySQL 8.1.0
Source Code Documentation
app_data.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 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
43app_data_ptr clone_app_data(app_data_ptr a);
44app_data_ptr clone_app_data_single(app_data_ptr a);
45app_data_ptr new_app_data();
46app_data_ptr init_app_data(app_data_ptr a);
47
48app_data_ptr new_data(u_int n, char *val, cons_type consensus);
49app_data_ptr new_exit();
50app_data_ptr new_nodes(u_int n, node_address *names, cargo_type cargo);
51app_data_ptr new_reset(cargo_type type);
52
53void _replace_app_data_list(app_data_list target, app_data_ptr source);
54char *dbg_app_data(app_data_ptr a);
55void follow(app_data_list l, app_data_ptr p);
56size_t app_data_size(app_data const *a);
57size_t app_data_list_size(app_data const *a);
58unsigned long msg_count(app_data_ptr a);
59
60#endif
void _replace_app_data_list(app_data_list target, app_data_ptr source)
Definition: app_data.cc:339
unsigned long msg_count(app_data_ptr a)
Count the number of messages in a list.
Definition: app_data.cc:367
size_t app_data_list_size(app_data const *a)
Definition: app_data.cc:288
void follow(app_data_list l, app_data_ptr p)
Insert p after l.
Definition: app_data.cc:348
app_data_ptr new_nodes(u_int n, node_address *names, cargo_type cargo)
app_data_ptr new_data(u_int n, char *val, cons_type consensus)
app_data_ptr new_reset(cargo_type type)
size_t app_data_size(app_data const *a)
Return size of an app_data.
Definition: app_data.cc:246
app_data_ptr clone_app_data_single(app_data_ptr a)
Clone an app_data struct.
Definition: app_data.cc:155
app_data_ptr new_app_data()
Constructor for app_data.
Definition: app_data.cc:305
app_data_ptr clone_app_data(app_data_ptr a)
Definition: app_data.cc:135
char * dbg_app_data(app_data_ptr a)
Definition: app_data.cc:319
app_data_ptr init_app_data(app_data_ptr a)
Definition: app_data.cc:311
app_data_ptr new_exit()
const char * p
Definition: ctype-mb.cc:1234
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:41
required string type
Definition: replication_group_member_actions.proto:33
__u_int u_int
Definition: types.h:72
int n
Definition: xcom_base.cc:508