MySQL 8.1.0
Source Code Documentation
minimal_chassis.h
Go to the documentation of this file.
1/* Copyright (c) 2020, 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 MINIMAL_CHASSIS_H
24#define MINIMAL_CHASSIS_H
25
27
28/**
29 This is the entry function for minimal_chassis static library, which has to be
30 called by the application code.
31 Bootstraps service registry and dynamic loader. And registry handle will be
32 assigned, if provided empty handle address. And loads provided component
33 services into the registry, if provided component reference which is
34 statically linked to this library.
35
36 @param [out] registry A service handle to registry service.
37 @param [in] comp_ref A component structure referance name.
38 @return Status of performed operation
39 @retval false success
40 @retval true failure
41*/
42bool minimal_chassis_init(SERVICE_TYPE_NO_CONST(registry) * *registry,
43 mysql_component_t *comp_ref);
44
45/**
46 This is the exit function for minimal_chassis static library, which has to be
47 called just before the exit of the application.
48 Releases the service registry and dynamic loader services.
49 Releases the registry handle, which is acquired at the time of
50 minimal_chassis_init(), if provided the handle address.
51 And un-registers the component services, if provided component
52 reference which is statically linked to this library.
53
54 @param [in] registry A service handle to registry service.
55 @param [in] comp_ref A component structure referance name.
56 @return Status of performed operation
57 @retval false success
58 @retval true failure
59*/
60bool minimal_chassis_deinit(SERVICE_TYPE_NO_CONST(registry) * registry,
61 mysql_component_t *comp_ref);
62
63/**
64 This function refreshes the global service handles based on the use_related
65 flag.
66 The global services are mysql_runtime_error, mysql_psi_system_v1 and
67 mysql_rwlock_v1.
68 If the use_related is ON then the globals are loaded with minimal chassis
69 service implementations else they are loaded with the default service
70 implementations
71
72 @param use_related Used to decide which service implementation to load
73 for globals.
74*/
75void minimal_chassis_services_refresh(bool use_related);
76
77void mysql_components_handle_std_exception(const char *funcname);
78#endif /* MINIMAL_CHASSIS_H */
Specifies macros to define Components.
void minimal_chassis_services_refresh(bool use_related)
This function refreshes the global service handles based on the use_related flag.
Definition: minimal_chassis.cc:271
bool minimal_chassis_init(mysql_service_registry_t **registry, mysql_component_t *comp_ref)
This is the entry function for minimal_chassis static library, which has to be called by the applicat...
Definition: minimal_chassis.cc:147
bool minimal_chassis_deinit(mysql_service_registry_t *registry, mysql_component_t *comp_ref)
This is the exit function for minimal_chassis static library, which has to be called just before the ...
Definition: minimal_chassis.cc:222
void mysql_components_handle_std_exception(const char *funcname)
Checks if last thrown exception is any kind of standard exceptions, i.e.
Definition: component_common.cc:37
#define SERVICE_TYPE_NO_CONST(name)
Generates the standard Service type name.
Definition: service.h:70
Carries information on the specific Component, all Service Implementations it provides,...
Definition: dynamic_loader.h:262