Skip to content

Commit 0c0db46

Browse files
tgross35grooverdan
authored andcommitted
Update doxygen annotations in plugin.h
Add doxygen markup so comments get picked up. Also fix minor typos and expand documentation where relevant. Signed-off-by: Trevor Gross <tmgross@umich.edu>
1 parent aba03ee commit 0c0db46

File tree

1 file changed

+59
-48
lines changed

1 file changed

+59
-48
lines changed

include/mysql/plugin.h

Lines changed: 59 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
along with this program; if not, write to the Free Software
1515
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
1616

17+
/**
18+
@file
19+
20+
Interfaces for creating server and client plugins.
21+
*/
22+
1723
#ifndef MYSQL_PLUGIN_INCLUDED
1824
#define MYSQL_PLUGIN_INCLUDED
1925

@@ -73,29 +79,33 @@ typedef struct st_mysql_xid MYSQL_XID;
7379
Plugin API. Common for all plugin types.
7480
*/
7581

76-
/* MySQL plugin interface version */
82+
/** MySQL plugin interface version */
7783
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0104
7884

79-
/* MariaDB plugin interface version */
85+
/** MariaDB plugin interface version */
8086
#define MARIA_PLUGIN_INTERFACE_VERSION 0x010f
8187

8288
/*
8389
The allowable types of plugins
8490
*/
85-
#define MYSQL_UDF_PLUGIN 0 /* not implemented */
91+
#define MYSQL_UDF_PLUGIN 0 /**< not implemented */
8692
#define MYSQL_STORAGE_ENGINE_PLUGIN 1
87-
#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */
93+
#define MYSQL_FTPARSER_PLUGIN 2 /**< Full-text parser plugin */
8894
#define MYSQL_DAEMON_PLUGIN 3
8995
#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4
9096
#define MYSQL_AUDIT_PLUGIN 5
9197
#define MYSQL_REPLICATION_PLUGIN 6
9298
#define MYSQL_AUTHENTICATION_PLUGIN 7
93-
#define MYSQL_MAX_PLUGIN_TYPE_NUM 12 /* The number of plugin types */
99+
#define MYSQL_MAX_PLUGIN_TYPE_NUM 12 /**< The number of plugin types */
94100

95101
/* MariaDB plugin types */
96-
#define MariaDB_PASSWORD_VALIDATION_PLUGIN 8
102+
/** Client and server password validation */
103+
#define MariaDB_PASSWORD_VALIDATION_PLUGIN 8
104+
/**< Encryption and key managment plugins */
97105
#define MariaDB_ENCRYPTION_PLUGIN 9
106+
/**< Plugins for SQL data storage types */
98107
#define MariaDB_DATA_TYPE_PLUGIN 10
108+
/**< Plugins for new native SQL functions */
99109
#define MariaDB_FUNCTION_PLUGIN 11
100110

101111
/* We use the following strings to define licenses for plugins */
@@ -220,8 +230,8 @@ struct st_mysql_show_var SHOW_FUNC_ENTRY(const char *name,
220230
Constants for plugin flags.
221231
*/
222232

223-
#define PLUGIN_OPT_NO_INSTALL 1UL /* Not dynamically loadable */
224-
#define PLUGIN_OPT_NO_UNINSTALL 2UL /* Not dynamically unloadable */
233+
#define PLUGIN_OPT_NO_INSTALL 1UL /**< Not dynamically loadable */
234+
#define PLUGIN_OPT_NO_UNINSTALL 2UL /**< Not dynamically unloadable */
225235

226236

227237
/*
@@ -238,20 +248,20 @@ struct st_mysql_show_var SHOW_FUNC_ENTRY(const char *name,
238248
#define PLUGIN_VAR_SET 0x0007
239249
#define PLUGIN_VAR_DOUBLE 0x0008
240250
#define PLUGIN_VAR_UNSIGNED 0x0080
241-
#define PLUGIN_VAR_THDLOCAL 0x0100 /* Variable is per-connection */
242-
#define PLUGIN_VAR_READONLY 0x0200 /* Server variable is read only */
243-
#define PLUGIN_VAR_NOSYSVAR 0x0400 /* Not a server variable */
244-
#define PLUGIN_VAR_NOCMDOPT 0x0800 /* Not a command line option */
245-
#define PLUGIN_VAR_NOCMDARG 0x1000 /* No argument for cmd line */
246-
#define PLUGIN_VAR_RQCMDARG 0x0000 /* Argument required for cmd line */
247-
#define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */
248-
#define PLUGIN_VAR_DEPRECATED 0x4000 /* Server variable is deprecated */
249-
#define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */
251+
#define PLUGIN_VAR_THDLOCAL 0x0100 /**< Variable is per-connection */
252+
#define PLUGIN_VAR_READONLY 0x0200 /**< Server variable is read only */
253+
#define PLUGIN_VAR_NOSYSVAR 0x0400 /**< Not a server variable */
254+
#define PLUGIN_VAR_NOCMDOPT 0x0800 /**< Not a command line option */
255+
#define PLUGIN_VAR_NOCMDARG 0x1000 /**< No argument for cmd line */
256+
#define PLUGIN_VAR_RQCMDARG 0x0000 /**< Argument required for cmd line */
257+
#define PLUGIN_VAR_OPCMDARG 0x2000 /**< Argument optional for cmd line */
258+
#define PLUGIN_VAR_DEPRECATED 0x4000 /**< Server variable is deprecated */
259+
#define PLUGIN_VAR_MEMALLOC 0x8000 /**< String needs memory allocated */
250260

251261
struct st_mysql_sys_var;
252262
struct st_mysql_value;
253263

254-
/*
264+
/**
255265
SYNOPSIS
256266
(*mysql_var_check_func)()
257267
thd thread handle
@@ -274,7 +284,7 @@ typedef int (*mysql_var_check_func)(MYSQL_THD thd,
274284
struct st_mysql_sys_var *var,
275285
void *save, struct st_mysql_value *value);
276286

277-
/*
287+
/**
278288
SYNOPSIS
279289
(*mysql_var_update_func)()
280290
thd thread handle
@@ -519,61 +529,61 @@ DECLARE_MYSQL_THDVAR_SIMPLE(name, double) = { \
519529
(*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset)))
520530

521531

522-
/*
532+
/**
523533
Plugin description structure.
524534
*/
525535

526536
struct st_mysql_plugin
527537
{
528-
int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */
529-
void *info; /* pointer to type-specific plugin descriptor */
530-
const char *name; /* plugin name */
531-
const char *author; /* plugin author (for I_S.PLUGINS) */
532-
const char *descr; /* general descriptive text (for I_S.PLUGINS) */
533-
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
534-
/*
538+
int type; /**< the plugin type (a MYSQL_XXX_PLUGIN value) */
539+
void *info; /**< pointer to type-specific plugin descriptor */
540+
const char *name; /**< plugin name */
541+
const char *author; /**< plugin author (for I_S.PLUGINS) */
542+
const char *descr; /**< general descriptive text (for I_S.PLUGINS) */
543+
int license; /**< the plugin license (PLUGIN_LICENSE_XXX) */
544+
/**
535545
The function to invoke when plugin is loaded. Plugin
536546
initialisation done here should defer any ALTER TABLE queries to
537547
after the ddl recovery is done, in the signal_ddl_recovery_done()
538548
callback called by ha_signal_ddl_recovery_done().
539549
*/
540550
int (*init)(void *);
541-
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
542-
unsigned int version; /* plugin version (for I_S.PLUGINS) */
551+
int (*deinit)(void *);/**< the function to invoke when plugin is unloaded */
552+
unsigned int version; /**< plugin version (for I_S.PLUGINS) */
543553
struct st_mysql_show_var *status_vars;
544554
struct st_mysql_sys_var **system_vars;
545-
void * __reserved1; /* reserved for dependency checking */
546-
unsigned long flags; /* flags for plugin */
555+
void * __reserved1; /**< reserved for dependency checking */
556+
unsigned long flags; /**< flags for plugin */
547557
};
548558

549-
/*
559+
/**
550560
MariaDB extension for plugins declaration structure.
551561
552-
It also copy current MySQL plugin fields to have more independency
562+
It also copies current MySQL plugin fields to have more independency
553563
in plugins extension
554564
*/
555565

556566
struct st_maria_plugin
557567
{
558-
int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */
559-
void *info; /* pointer to type-specific plugin descriptor */
560-
const char *name; /* plugin name */
561-
const char *author; /* plugin author (for SHOW PLUGINS) */
562-
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
563-
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
564-
/*
568+
int type; /**< the plugin type (a MYSQL_XXX_PLUGIN value) */
569+
void *info; /**< pointer to type-specific plugin descriptor */
570+
const char *name; /**< plugin name */
571+
const char *author; /**< plugin author (for SHOW PLUGINS) */
572+
const char *descr; /**< general descriptive text (for SHOW PLUGINS ) */
573+
int license; /**< the plugin license (PLUGIN_LICENSE_XXX) */
574+
/**
565575
The function to invoke when plugin is loaded. Plugin
566576
initialisation done here should defer any ALTER TABLE queries to
567577
after the ddl recovery is done, in the signal_ddl_recovery_done()
568578
callback called by ha_signal_ddl_recovery_done().
569579
*/
570580
int (*init)(void *);
571-
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
572-
unsigned int version; /* plugin version (for SHOW PLUGINS) */
581+
int (*deinit)(void *);/**< the function to invoke when plugin is unloaded */
582+
unsigned int version; /**< plugin version (for SHOW PLUGINS) */
573583
struct st_mysql_show_var *status_vars;
574584
struct st_mysql_sys_var **system_vars;
575-
const char *version_info; /* plugin version string */
576-
unsigned int maturity; /* MariaDB_PLUGIN_MATURITY_XXX */
585+
const char *version_info; /**< plugin version string */
586+
unsigned int maturity; /**< MariaDB_PLUGIN_MATURITY_XXX */
577587
};
578588

579589
/*************************************************************************
@@ -650,6 +660,10 @@ struct handlerton;
650660
int interface_version;
651661
};
652662

663+
#define MYSQL_VALUE_TYPE_STRING 0
664+
#define MYSQL_VALUE_TYPE_REAL 1
665+
#define MYSQL_VALUE_TYPE_INT 2
666+
653667
/*************************************************************************
654668
st_mysql_value struct for reading values from mysqld.
655669
Used by server variables framework to parse user-provided values.
@@ -660,10 +674,6 @@ struct handlerton;
660674
if you need it to persist.
661675
*/
662676

663-
#define MYSQL_VALUE_TYPE_STRING 0
664-
#define MYSQL_VALUE_TYPE_REAL 1
665-
#define MYSQL_VALUE_TYPE_INT 2
666-
667677
struct st_mysql_value
668678
{
669679
int (*value_type)(struct st_mysql_value *);
@@ -691,6 +701,7 @@ struct DDL_options_st *thd_ddl_options(const MYSQL_THD thd);
691701
void thd_storage_lock_wait(MYSQL_THD thd, long long value);
692702
int thd_tx_isolation(const MYSQL_THD thd);
693703
int thd_tx_is_read_only(const MYSQL_THD thd);
704+
694705
/**
695706
Create a temporary file.
696707

0 commit comments

Comments
 (0)