MySQL 8.2.0
Source Code Documentation
udf_registration_imp.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 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#if !defined(UDF_REGISTRATION_IMP_H)
24#define UDF_REGISTRATION_IMP_H
25
28
29struct udf_func;
30
31/**
32 A helper class for the implementation of the
33 udf_registration and udf_aggregate functions
34
35 Needed because we register these service implementations
36 as part of the mysql_server component.
37*/
39 public: /* service implementations */
40 /** udf_registration::udf_register */
42 (const char *name, Item_result return_type,
43 Udf_func_any func, Udf_func_init init_func,
44 Udf_func_deinit deinit_func));
45
46 /** udf_registration::udf_unregister
47 and udf_registration_aggregate::udf_register
48 */
50 (const char *name, int *was_present));
51
52 /** udf_registration_aggregate::udf_register */
54 (const char *func_name,
55 enum Item_result return_type, Udf_func_any func,
56 Udf_func_init init_func,
57 Udf_func_deinit deinit_func, Udf_func_add add_func,
58 Udf_func_clear clear_func));
59
60 private:
61 static bool udf_register_inner(udf_func *func);
62 static udf_func *alloc_udf(const char *func_name,
63 enum Item_result return_type, Udf_func_any func,
64 Udf_func_init init_func,
65 Udf_func_deinit deinit_func);
66};
67
68#endif
A helper class for the implementation of the udf_registration and udf_aggregate functions.
Definition: udf_registration_imp.h:38
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:880
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:920
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:904
static bool udf_register_inner(udf_func *func)
Definition: sql_udf.cc:864
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:936
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:87
case opt name
Definition: sslopt-case.h:32
Definition: sql_udf.h:43
void(* Udf_func_deinit)(UDF_INIT *)
Definition: udf_registration_types.h:79
Item_result
Type of the user defined function return slot and arguments.
Definition: udf_registration_types.h:38
bool(* Udf_func_init)(UDF_INIT *, UDF_ARGS *, char *)
Definition: udf_registration_types.h:80
void(* Udf_func_clear)(UDF_INIT *, unsigned char *, unsigned char *)
Definition: udf_registration_types.h:76
void(* Udf_func_add)(UDF_INIT *, UDF_ARGS *, unsigned char *, unsigned char *)
Definition: udf_registration_types.h:77
void(* Udf_func_any)(void)
Definition: udf_registration_types.h:81