MySQL 8.4.3
Source Code Documentation
udf_registration_imp.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 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#if !defined(UDF_REGISTRATION_IMP_H)
25#define UDF_REGISTRATION_IMP_H
26
29
30struct udf_func;
31
32/**
33 A helper class for the implementation of the
34 udf_registration and udf_aggregate functions
35
36 Needed because we register these service implementations
37 as part of the mysql_server component.
38*/
40 public: /* service implementations */
41 /** udf_registration::udf_register */
43 (const char *name, Item_result return_type,
44 Udf_func_any func, Udf_func_init init_func,
45 Udf_func_deinit deinit_func));
46
47 /** udf_registration::udf_unregister
48 and udf_registration_aggregate::udf_register
49 */
51 (const char *name, int *was_present));
52
53 /** udf_registration_aggregate::udf_register */
55 (const char *func_name,
56 enum Item_result return_type, Udf_func_any func,
57 Udf_func_init init_func,
58 Udf_func_deinit deinit_func, Udf_func_add add_func,
59 Udf_func_clear clear_func));
60
61 private:
62 static bool udf_register_inner(udf_func *func);
63 static udf_func *alloc_udf(const char *func_name,
64 enum Item_result return_type, Udf_func_any func,
65 Udf_func_init init_func,
66 Udf_func_deinit deinit_func);
67};
68
69#endif
A helper class for the implementation of the udf_registration and udf_aggregate functions.
Definition: udf_registration_imp.h:39
static udf_func * alloc_udf(const char *func_name, enum Item_result return_type, Udf_func_any func, Udf_func_init init_func, Udf_func_deinit deinit_func)
Definition: sql_udf.cc:881
static mysql_service_status_t udf_register_aggregate(const char *func_name, enum Item_result return_type, Udf_func_any func, Udf_func_init init_func, Udf_func_deinit deinit_func, Udf_func_add add_func, Udf_func_clear clear_func) noexcept
udf_registration_aggregate::udf_register
Definition: sql_udf.cc:921
static mysql_service_status_t udf_register(const char *name, Item_result return_type, Udf_func_any func, Udf_func_init init_func, Udf_func_deinit deinit_func) noexcept
udf_registration::udf_register
Definition: sql_udf.cc:905
static bool udf_register_inner(udf_func *func)
Definition: sql_udf.cc:865
static mysql_service_status_t udf_unregister(const char *name, int *was_present) noexcept
udf_registration::udf_unregister and udf_registration_aggregate::udf_register
Definition: sql_udf.cc:937
Specifies macros to define Service Implementations.
#define DEFINE_BOOL_METHOD(name, args)
A short macro to define method that returns bool, which is the most common case.
Definition: service_implementation.h:88
case opt name
Definition: sslopt-case.h:29
Definition: sql_udf.h:44
void(* Udf_func_deinit)(UDF_INIT *)
Definition: udf_registration_types.h:80
Item_result
Type of the user defined function return slot and arguments.
Definition: udf_registration_types.h:39
bool(* Udf_func_init)(UDF_INIT *, UDF_ARGS *, char *)
Definition: udf_registration_types.h:81
void(* Udf_func_clear)(UDF_INIT *, unsigned char *, unsigned char *)
Definition: udf_registration_types.h:77
void(* Udf_func_add)(UDF_INIT *, UDF_ARGS *, unsigned char *, unsigned char *)
Definition: udf_registration_types.h:78
void(* Udf_func_any)(void)
Definition: udf_registration_types.h:82