MySQL 8.3.0
Source Code Documentation
example_services.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2023, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is also distributed with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef EXAMPLE_SERVICES_H
24#define EXAMPLE_SERVICES_H
25
27
28/**
29 A Service to get greeting message.
30*/
32/**
33 Retrieves a greeting message.
34
35 @param [out] hello_string A pointer to string data pointer to store result
36 in.
37 @return Status of performed operation
38 @retval false success
39 @retval true failure
40*/
41DECLARE_BOOL_METHOD(say_hello, (const char **hello_string));
43
44/**
45 A Service to get localization information on related greetings Service.
46*/
47BEGIN_SERVICE_DEFINITION(greetings_localization)
48/**
49 Retrieves a greeting message language of related greeting Service.
50
51 @param [out] language_string A pointer to string data pointer to store name
52 of the language in.
53 @return Status of performed operation
54 @retval false success
55 @retval true failure
56*/
57DECLARE_BOOL_METHOD(get_language, (const char **language_string));
58END_SERVICE_DEFINITION(greetings_localization)
59
60/**
61 A Service for example basic math functionality.
62*/
64/**
65 Calculates Greatest Common Divisor for given two non-negative numbers.
66
67 @param a First number to calculate GCD of.
68 @param b Second number to calculate GCD of.
69 @param [out] result A pointer to integer variable to store result in.
70 @return Status of performed operation
71 @retval false success
72 @retval true failure
73*/
74DECLARE_BOOL_METHOD(calculate_gcd, (int a, int b, int *result));
76
77#endif /* EXAMPLE_SERVICES_H */
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:90
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:85
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:111
Definition: result.h:29