MySQL 8.0.40
Source Code Documentation
minimal_chassis.h
Go to the documentation of this file.
1/* Copyright (c) 2020, 2024, 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 designed to work 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 either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MINIMAL_CHASSIS_H
25#define MINIMAL_CHASSIS_H
26
28
29/**
30 This is the entry function for minimal_chassis static library, which has to be
31 called by the application code.
32 Bootstraps service registry and dynamic loader. And registry handle will be
33 assigned, if provided empty handle address. And loads provided component
34 services into the registry, if provided component reference which is
35 statically linked to this library.
36
37 @param [out] registry A service handle to registry service.
38 @param [in] comp_ref A component structure referance name.
39 @return Status of performed operation
40 @retval false success
41 @retval true failure
42*/
43bool minimal_chassis_init(SERVICE_TYPE_NO_CONST(registry) * *registry,
44 mysql_component_t *comp_ref);
45
46/**
47 This is the exit function for minimal_chassis static library, which has to be
48 called just before the exit of the application.
49 Releases the service registry and dynamic loader services.
50 Releases the registry handle, which is acquired at the time of
51 minimal_chassis_init(), if provided the handle address.
52 And un-registers the component services, if provided component
53 reference which is statically linked to this library.
54
55 @param [in] registry A service handle to registry service.
56 @param [in] comp_ref A component structure referance name.
57 @return Status of performed operation
58 @retval false success
59 @retval true failure
60*/
61bool minimal_chassis_deinit(SERVICE_TYPE_NO_CONST(registry) * registry,
62 mysql_component_t *comp_ref);
63
64/**
65 This function refreshes the global service handles based on the use_related
66 flag.
67 The global services are mysql_runtime_error, mysql_psi_system_v1 and
68 mysql_rwlock_v1.
69 If the use_related is ON then the globals are loaded with minimal chassis
70 service implementations else they are loaded with the default service
71 implementations
72
73 @param use_related Used to decide which service implementation to load
74 for globals.
75*/
76void minimal_chassis_services_refresh(bool use_related);
77
78void mysql_components_handle_std_exception(const char *funcname);
79#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:272
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:148
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:223
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:38
#define SERVICE_TYPE_NO_CONST(name)
Generates the standard Service type name.
Definition: service.h:71
Carries information on the specific Component, all Service Implementations it provides,...
Definition: dynamic_loader.h:263