1 #ifndef MARIADB_PLUGIN_FUNCTION_INCLUDED
2 #define MARIADB_PLUGIN_FUNCTION_INCLUDED
3 /* Copyright (C) 2019, Alexander Barkov and MariaDB
4 
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; version 2 of the License.
8 
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13 
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335  USA */
17 
18 /**
19   @file
20 
21   Function Plugin API.
22 
23   This file defines the API for server plugins that manage functions.
24 */
25 
26 #ifdef __cplusplus
27 
28 #include <mysql/plugin.h>
29 
30 /*
31   API for function plugins. (MariaDB_FUNCTION_PLUGIN)
32 */
33 #define MariaDB_FUNCTION_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
34 
35 
36 class Plugin_function
37 {
38   int m_interface_version;
39   Create_func *m_builder;
40 public:
Plugin_function(Create_func * builder)41   Plugin_function(Create_func *builder)
42    :m_interface_version(MariaDB_FUNCTION_INTERFACE_VERSION),
43     m_builder(builder)
44   { }
create_func()45   Create_func *create_func()
46   {
47     return m_builder;
48   }
49 };
50 
51 
52 #endif /* __cplusplus */
53 
54 #endif /* MARIADB_PLUGIN_FUNCTION_INCLUDED */
55