MySQL
8.0.33
Source Code Documentation
example_services.h
Go to the documentation of this file.
1
/* Copyright (c) 2016, 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 EXAMPLE_SERVICES_H
24
#define EXAMPLE_SERVICES_H
25
26
#include <
mysql/components/service.h
>
27
28
/**
29
A Service to get greeting message.
30
*/
31
BEGIN_SERVICE_DEFINITION
(greetings)
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
*/
41
DECLARE_BOOL_METHOD
(say_hello, (const
char
**hello_string));
42
END_SERVICE_DEFINITION
(greetings)
43
44
/**
45
A Service to get localization information on related greetings Service.
46
*/
47
BEGIN_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
*/
57
DECLARE_BOOL_METHOD
(get_language, (const
char
**language_string));
58
END_SERVICE_DEFINITION
(greetings_localization)
59
60
/**
61
A Service for example basic math functionality.
62
*/
63
BEGIN_SERVICE_DEFINITION
(example_math)
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
*/
74
DECLARE_BOOL_METHOD
(calculate_gcd, (
int
a,
int
b,
int
*
result
));
75
END_SERVICE_DEFINITION
(example_math)
76
77
#endif
/* EXAMPLE_SERVICES_H */
service.h
END_SERVICE_DEFINITION
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition:
service.h:90
BEGIN_SERVICE_DEFINITION
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition:
service.h:85
DECLARE_BOOL_METHOD
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition:
service.h:111
result
Definition:
result.h:29
components
example
example_services.h
Generated by
1.9.2