1#include "plugin.h"
2typedef void * MYSQL_PLUGIN;
3struct st_mysql_xid {
4  long formatID;
5  long gtrid_length;
6  long bqual_length;
7  char data[128];
8};
9typedef struct st_mysql_xid MYSQL_XID;
10enum enum_mysql_show_type
11{
12  SHOW_UNDEF, SHOW_BOOL,
13  SHOW_INT,
14  SHOW_LONG,
15  SHOW_LONGLONG,
16  SHOW_CHAR, SHOW_CHAR_PTR,
17  SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
18};
19enum enum_mysql_show_scope
20{
21  SHOW_SCOPE_UNDEF,
22  SHOW_SCOPE_GLOBAL
23};
24struct st_mysql_show_var
25{
26  const char *name;
27  char *value;
28  enum enum_mysql_show_type type;
29  enum enum_mysql_show_scope scope;
30};
31typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
32struct st_mysql_sys_var;
33struct st_mysql_value;
34typedef int (*mysql_var_check_func)(void* thd,
35                                    struct st_mysql_sys_var *var,
36                                    void *save, struct st_mysql_value *value);
37typedef void (*mysql_var_update_func)(void* thd,
38                                      struct st_mysql_sys_var *var,
39                                      void *var_ptr, const void *save);
40struct st_mysql_plugin
41{
42  int type;
43  void *info;
44  const char *name;
45  const char *author;
46  const char *descr;
47  int license;
48  int (*init)(MYSQL_PLUGIN);
49  int (*deinit)(MYSQL_PLUGIN);
50  unsigned int version;
51  struct st_mysql_show_var *status_vars;
52  struct st_mysql_sys_var **system_vars;
53  void * __reserved1;
54  unsigned long flags;
55};
56struct st_mysql_daemon
57{
58  int interface_version;
59};
60struct st_mysql_information_schema
61{
62  int interface_version;
63};
64struct st_mysql_storage_engine
65{
66  int interface_version;
67};
68struct handlerton;
69 struct Mysql_replication {
70   int interface_version;
71 };
72struct st_mysql_value
73{
74  int (*value_type)(struct st_mysql_value *);
75  const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
76  int (*val_real)(struct st_mysql_value *, double *realbuf);
77  int (*val_int)(struct st_mysql_value *, long long *intbuf);
78  int (*is_unsigned)(struct st_mysql_value *);
79};
80int thd_in_lock_tables(const void* thd);
81int thd_tablespace_op(const void* thd);
82long long thd_test_options(const void* thd, long long test_options);
83int thd_sql_command(const void* thd);
84const char *set_thd_proc_info(void* thd, const char *info,
85                              const char *calling_func,
86                              const char *calling_file,
87                              const unsigned int calling_line);
88void **thd_ha_data(const void* thd, const struct handlerton *hton);
89void thd_storage_lock_wait(void* thd, long long value);
90int thd_tx_isolation(const void* thd);
91int thd_tx_is_read_only(const void* thd);
92void* thd_tx_arbitrate(void* requestor, void* holder);
93int thd_tx_priority(const void* thd);
94int thd_tx_is_dd_trx(const void* thd);
95char *thd_security_context(void* thd, char *buffer, size_t length,
96                           size_t max_query_len);
97void thd_inc_row_count(void* thd);
98int thd_allow_batch(void* thd);
99void thd_mark_transaction_to_rollback(void* thd, int all);
100int mysql_tmpfile(const char *prefix);
101int thd_killed(const void* thd);
102void thd_set_kill_status(const void* thd);
103void thd_binlog_pos(const void* thd,
104                    const char **file_var,
105                    unsigned long long *pos_var);
106unsigned long thd_get_thread_id(const void* thd);
107void thd_get_xid(const void* thd, MYSQL_XID *xid);
108void mysql_query_cache_invalidate4(void* thd,
109                                   const char *key, unsigned int key_length,
110                                   int using_trx);
111void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
112void thd_set_ha_data(void* thd, const struct handlerton *hton,
113                     const void *ha_data);
114enum enum_ftparser_mode
115{
116  MYSQL_FTPARSER_SIMPLE_MODE= 0,
117  MYSQL_FTPARSER_WITH_STOPWORDS= 1,
118  MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2
119};
120enum enum_ft_token_type
121{
122  FT_TOKEN_EOF= 0,
123  FT_TOKEN_WORD= 1,
124  FT_TOKEN_LEFT_PAREN= 2,
125  FT_TOKEN_RIGHT_PAREN= 3,
126  FT_TOKEN_STOPWORD= 4
127};
128typedef struct st_mysql_ftparser_boolean_info
129{
130  enum enum_ft_token_type type;
131  int yesno;
132  int weight_adjust;
133  char wasign;
134  char trunc;
135  int position;
136  char prev;
137  char *quot;
138} MYSQL_FTPARSER_BOOLEAN_INFO;
139typedef struct st_mysql_ftparser_param
140{
141  int (*mysql_parse)(struct st_mysql_ftparser_param *,
142                     char *doc, int doc_len);
143  int (*mysql_add_word)(struct st_mysql_ftparser_param *,
144                        char *word, int word_len,
145                        MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
146  void *ftparser_state;
147  void *mysql_ftparam;
148  const struct charset_info_st *cs;
149  char *doc;
150  int length;
151  int flags;
152  enum enum_ftparser_mode mode;
153} MYSQL_FTPARSER_PARAM;
154struct st_mysql_ftparser
155{
156  int interface_version;
157  int (*parse)(MYSQL_FTPARSER_PARAM *param);
158  int (*init)(MYSQL_FTPARSER_PARAM *param);
159  int (*deinit)(MYSQL_FTPARSER_PARAM *param);
160};
161