1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

Reworked plugin interface

Plugin configuration happens now in CMakeLists.txt files in corresponding plugin directories.

plugins.cmake now contains REGISTER_PLUGIN_FUNCTION which accepts the following parameters:
  - TARGET: the name of the plugin (dynamic plugins will be named ${TARGET}.so (or .dll)
  - SOURCES: source files
  - LIBRARIES: additional libraries for linking
  - INCLUDES: include directories
  - CONFIGURATIONS: possible plugin configurations: valid arguments are DYNAMIC, STATIC, OFF
  - DEFAULT: default configuration (see CONFIGURATIONS)
  - COMPILE_OPTIONS: compiler flags

The default plugin configuration can be specified via cmake parameter -DCLIENT_PLUGIN_${TARGET}=[DYNAMIC|STATIC|OFF]
This commit is contained in:
Georg Richter
2018-02-26 19:15:55 +01:00
parent 6e1dd7a41f
commit 50d48e91fa
25 changed files with 269 additions and 353 deletions

View File

@@ -2616,7 +2616,7 @@ uchar *ma_get_hash_keyval(const uchar *hash_entry,
return p;
}
void ma_hash_free(void *p)
void ma_int_hash_free(void *p)
{
free(p);
}
@@ -2855,7 +2855,7 @@ mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...)
if (!hash_inited(&mysql->options.extension->userdata))
{
if (_hash_init(&mysql->options.extension->userdata,
0, 0, 0, ma_get_hash_keyval, ma_hash_free, 0))
0, 0, 0, ma_get_hash_keyval, ma_int_hash_free, 0))
{
SET_CLIENT_ERROR(mysql, CR_OUT_OF_MEMORY, SQLSTATE_UNKNOWN, 0);
goto end;
@@ -2917,7 +2917,7 @@ mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...)
if (!hash_inited(&mysql->options.extension->connect_attrs))
{
if (_hash_init(&mysql->options.extension->connect_attrs,
0, 0, 0, ma_get_hash_keyval, ma_hash_free, 0))
0, 0, 0, ma_get_hash_keyval, ma_int_hash_free, 0))
{
SET_CLIENT_ERROR(mysql, CR_OUT_OF_MEMORY, SQLSTATE_UNKNOWN, 0);
goto end;
@@ -4113,5 +4113,6 @@ struct st_mariadb_methods MARIADB_DEFAULT_METHODS = {
my_set_error,
/* invalidate statements */
ma_invalidate_stmts,
/* API functions */
&MARIADB_API
};