summaryrefslogtreecommitdiff
path: root/include/mysql/plugin_audit.h.pp
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2018-12-12 01:49:39 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2018-12-12 01:49:39 +0400
commitb1527ef51ccf5c4d7a4a3847c542ef9a81a97240 (patch)
tree3d4ff816a77e34be669b21d4c44171d1b18f456d /include/mysql/plugin_audit.h.pp
parentdc6ad597656e8173dd73edb58a967152df70dc9e (diff)
downloadmariadb-git-b1527ef51ccf5c4d7a4a3847c542ef9a81a97240.tar.gz
MDEV-5313 Improving audit api.
Service added to handle json.
Diffstat (limited to 'include/mysql/plugin_audit.h.pp')
-rw-r--r--include/mysql/plugin_audit.h.pp45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp
index 89f7dcc36c4..0588b211b81 100644
--- a/include/mysql/plugin_audit.h.pp
+++ b/include/mysql/plugin_audit.h.pp
@@ -374,6 +374,51 @@ extern struct thd_wait_service_st {
} *thd_wait_service;
void thd_wait_begin(void* thd, int wait_type);
void thd_wait_end(void* thd);
+enum json_types
+{
+ JSV_BAD_JSON=-1,
+ JSV_NOTHING=0,
+ JSV_OBJECT=1,
+ JSV_ARRAY=2,
+ JSV_STRING=3,
+ JSV_NUMBER=4,
+ JSV_TRUE=5,
+ JSV_FALSE=6,
+ JSV_NULL=7
+};
+extern struct json_service_st {
+ enum json_types (*json_type)(const char *js, const char *js_end,
+ const char **v, int *vlen);
+ enum json_types (*json_get_array_item)(const char *js, const char *js_end,
+ int n_item,
+ const char **v, int *vlen);
+ enum json_types (*json_get_object_key)(const char *js, const char *js_end,
+ const char *key,
+ const char **v, int *vlen);
+ enum json_types (*json_get_object_nkey)(const char *js,const char *js_end,
+ int nkey,
+ const char **keyname, const char **keyname_end,
+ const char **v, int *vlen);
+ int (*json_escape_string)(const char *str,const char *str_end,
+ char *json, char *json_end);
+ int (*json_unescape_json)(const char *json_str, const char *json_end,
+ char *res, char *res_end);
+} *json_service;
+enum json_types json_type(const char *js, const char *js_end,
+ const char **v, int *vlen);
+enum json_types json_get_array_item(const char *js, const char *js_end,
+ int n_item,
+ const char **v, int *vlen);
+enum json_types json_get_object_key(const char *js, const char *js_end,
+ const char *key,
+ const char **v, int *vlen);
+enum json_types json_get_object_nkey(const char *js,const char *js_end, int nkey,
+ const char **keyname, const char **keyname_end,
+ const char **v, int *vlen);
+int json_escape_string(const char *str,const char *str_end,
+ char *json, char *json_end);
+int json_unescape_json(const char *json_str, const char *json_end,
+ char *res, char *res_end);
struct st_mysql_xid {
long formatID;
long gtrid_length;