MySQL 8.0.39
Source Code Documentation
xcom_input_request.h
Go to the documentation of this file.
1/* Copyright (c) 2018, 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 XCOM_INPUT_REQUEST_H
25#define XCOM_INPUT_REQUEST_H
26
27#include "xcom/pax_msg.h"
28
29/**
30 * A request directed to XCom through the input channel.
31 */
34
35/**
36 * The function type that XCom will use to reply to a request.
37 */
39 pax_msg *payload);
40
41/**
42 * Creates a new XCom request.
43 *
44 * Takes ownership of @c a.
45 *
46 * @param a the request's app_data payload
47 * @param reply_function the function used to reply to the request
48 * @param reply_arg opaque argument to the reply_function
49 * @retval xcom_input_request_ptr if successful
50 * @retval NULL if unsuccessful
51 */
54 void *reply_arg);
55
56/**
57 * Frees the given request and its payload.
58 *
59 * @param request the request to free
60 */
62
63/**
64 * Links @c request to the list of requests @c next.
65 *
66 * @param request the request to link
67 * @param next the list to be linked to
68 */
71
72/**
73 * Unlinks @c request from its list.
74 *
75 * @param request the request to unlink
76 * @returns the tail of the list the request was unlinked from
77 */
80
81/**
82 * Extract the given request's payload.
83 *
84 * Transfers ownership of the result to the caller.
85 *
86 * @param request the request from which to extract the payload
87 * @returns the request's app_data payload
88 */
91
92/**
93 * Replies to the request using the strategy chosen by the request's origin.
94 *
95 * @param request the request to reply to
96 * @param payload the payload of the reply
97 */
99
100#endif /* XCOM_INPUT_REQUEST_H */
struct pax_msg pax_msg
Definition: site_struct.h:37
Definition: xcom_input_request.cc:31
xcom_input_reply_function_ptr reply_function
Definition: xcom_input_request.cc:33
app_data_ptr a
Definition: xcom_input_request.cc:32
void * reply_arg
Definition: xcom_input_request.cc:34
struct xcom_input_request * next
Definition: xcom_input_request.cc:35
void xcom_input_request_set_next(xcom_input_request_ptr request, xcom_input_request_ptr next)
Links request to the list of requests next.
Definition: xcom_input_request.cc:63
xcom_input_request_ptr xcom_input_request_extract_next(xcom_input_request_ptr request)
Unlinks request from its list.
Definition: xcom_input_request.cc:68
void xcom_input_request_reply(xcom_input_request_ptr request, pax_msg *payload)
Replies to the request using the strategy chosen by the request's origin.
Definition: xcom_input_request.cc:82
xcom_input_request_ptr xcom_input_request_new(app_data_ptr a, xcom_input_reply_function_ptr reply_function, void *reply_arg)
Creates a new XCom request.
Definition: xcom_input_request.cc:38
app_data_ptr xcom_input_request_extract_app_data(xcom_input_request_ptr request)
Extract the given request's payload.
Definition: xcom_input_request.cc:75
void xcom_input_request_free(xcom_input_request_ptr request)
Frees the given request and its payload.
Definition: xcom_input_request.cc:51
struct xcom_input_request * xcom_input_request_ptr
Definition: xcom_input_request.h:33
void(* xcom_input_reply_function_ptr)(void *reply_arg, pax_msg *payload)
The function type that XCom will use to reply to a request.
Definition: xcom_input_request.h:38