MySQL 9.1.0
Source Code Documentation
app_data.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef APP_DATA_H
25#define APP_DATA_H
26
27#include <stddef.h>
28
29#include "xdr_gen/xcom_vp.h"
30
31#define copy_app_data(target, source) \
32 { \
33 IFDBG(D_NONE, FN; STRLIT(" copy_app_data "); PTREXP(target); \
34 PTREXP(*target); PTREXP(source)); \
35 _replace_app_data_list(target, source); \
36 }
37
38#define steal_app_data(target, source) \
39 { \
40 (target) = (source); \
41 (source) = NULL; \
42 }
43
44app_data_ptr clone_app_data(app_data_ptr a);
45app_data_ptr clone_app_data_single(app_data_ptr a);
46app_data_ptr new_app_data();
47app_data_ptr init_app_data(app_data_ptr a);
48
49app_data_ptr new_data(u_int n, char *val, cons_type consensus);
50app_data_ptr new_exit();
51app_data_ptr new_nodes(u_int n, node_address *names, cargo_type cargo);
52app_data_ptr new_reset(cargo_type type);
53
54void _replace_app_data_list(app_data_list target, app_data_ptr source);
55char *dbg_app_data(app_data_ptr a);
56void follow(app_data_list l, app_data_ptr p);
57size_t app_data_size(app_data const *a);
58size_t app_data_list_size(app_data const *a);
59unsigned long msg_count(app_data_ptr a);
60
61#endif
void _replace_app_data_list(app_data_list target, app_data_ptr source)
Definition: app_data.cc:340
unsigned long msg_count(app_data_ptr a)
Count the number of messages in a list.
Definition: app_data.cc:368
size_t app_data_list_size(app_data const *a)
Definition: app_data.cc:289
void follow(app_data_list l, app_data_ptr p)
Insert p after l.
Definition: app_data.cc:349
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:247
app_data_ptr clone_app_data_single(app_data_ptr a)
Clone an app_data struct.
Definition: app_data.cc:156
app_data_ptr new_app_data()
Constructor for app_data.
Definition: app_data.cc:306
app_data_ptr clone_app_data(app_data_ptr a)
Definition: app_data.cc:136
char * dbg_app_data(app_data_ptr a)
Definition: app_data.cc:320
app_data_ptr init_app_data(app_data_ptr a)
Definition: app_data.cc:312
app_data_ptr new_exit()
const char * p
Definition: ctype-mb.cc:1225
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:42
required string type
Definition: replication_group_member_actions.proto:34
__u_int u_int
Definition: types.h:73
int n
Definition: xcom_base.cc:509