compile/plugin table callback function normalization
This commit is contained in:
@@ -33,9 +33,9 @@ void bool_plugin_schema_free(void *bool_plugin_schema);
|
||||
struct ex_data_schema *bool_plugin_table_get_ex_data_schema(void *bool_plugin_schema);
|
||||
|
||||
int bool_plugin_table_set_ex_data_schema(void *bool_plugin_schema,
|
||||
maat_plugin_ex_new_func_t *new_func,
|
||||
maat_plugin_ex_free_func_t *free_func,
|
||||
maat_plugin_ex_dup_func_t *dup_func,
|
||||
maat_ex_new_func_t *new_func,
|
||||
maat_ex_free_func_t *free_func,
|
||||
maat_ex_dup_func_t *dup_func,
|
||||
long argl, void *argp,
|
||||
struct log_handle *logger);
|
||||
|
||||
|
||||
@@ -21,16 +21,6 @@ extern "C"
|
||||
#include "maat_kv.h"
|
||||
#include "maat_rule.h"
|
||||
|
||||
struct compile_ex_data_schema {
|
||||
maat_rule_ex_new_func_t *new_func;
|
||||
maat_rule_ex_free_func_t *free_func;
|
||||
maat_rule_ex_dup_func_t *dup_func;
|
||||
long argl;
|
||||
void *argp;
|
||||
int idx;
|
||||
int table_id;
|
||||
};
|
||||
|
||||
struct compile_schema;
|
||||
struct compile_runtime;
|
||||
struct maat_compile_state;
|
||||
@@ -46,17 +36,14 @@ void *group2compile_schema_new(cJSON *json, struct table_manager *tbl_mgr,
|
||||
void group2compile_schema_free(void *g2c_schema);
|
||||
int group2compile_associated_compile_table_id(void *g2c_schema);
|
||||
|
||||
int compile_table_set_rule_ex_data_schema(struct compile_schema *compile_schema,
|
||||
int table_id,
|
||||
maat_rule_ex_new_func_t *new_func,
|
||||
maat_rule_ex_free_func_t *free_func,
|
||||
maat_rule_ex_dup_func_t *dup_func,
|
||||
long argl, void *argp,
|
||||
struct log_handle *logger);
|
||||
void *compile_table_get_rule_ex_data(struct compile_schema *compile_schema, long long compile_id, size_t idx);
|
||||
void compile_table_rule_ex_data_iterate(struct compile_schema *compile_schema, int idx);
|
||||
|
||||
size_t compile_table_rule_ex_data_schema_count(struct compile_schema *compile_schema);
|
||||
int compile_table_set_ex_data_schema(struct compile_schema *compile_schema, int table_id,
|
||||
maat_ex_new_func_t *new_func,
|
||||
maat_ex_free_func_t *free_func,
|
||||
maat_ex_dup_func_t *dup_func,
|
||||
long argl, void *argp,
|
||||
struct log_handle *logger);
|
||||
void *compile_table_get_ex_data(struct compile_schema *compile_schema, long long compile_id);
|
||||
void compile_table_ex_data_iterate(struct compile_schema *compile_schema);
|
||||
|
||||
/* compile runtime API */
|
||||
void *compile_runtime_new(void *compile_schema, int max_thread_num,
|
||||
|
||||
@@ -30,6 +30,14 @@ struct ex_container_ctx {
|
||||
struct ex_data_schema *ex_schema;
|
||||
};
|
||||
|
||||
struct ex_data_schema {
|
||||
maat_ex_new_func_t *new_func;
|
||||
maat_ex_free_func_t *free_func;
|
||||
maat_ex_dup_func_t *dup_func;
|
||||
long argl;
|
||||
void *argp;
|
||||
};
|
||||
|
||||
struct ex_data_runtime;
|
||||
|
||||
/* ex_data_runtime API */
|
||||
@@ -49,9 +57,9 @@ size_t ex_data_runtime_cached_row_count(struct ex_data_runtime *ex_data_rt);
|
||||
void ex_data_runtime_clear_row_cache(struct ex_data_runtime *ex_data_rt);
|
||||
|
||||
/* set schema API */
|
||||
struct ex_data_schema *ex_data_schema_new(maat_plugin_ex_new_func_t *new_func,
|
||||
maat_plugin_ex_free_func_t *free_func,
|
||||
maat_plugin_ex_dup_func_t *dup_func,
|
||||
struct ex_data_schema *ex_data_schema_new(maat_ex_new_func_t *new_func,
|
||||
maat_ex_free_func_t *free_func,
|
||||
maat_ex_dup_func_t *dup_func,
|
||||
long argl, void *argp);
|
||||
void ex_data_schema_free(struct ex_data_schema *ex_schema);
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ void fqdn_plugin_schema_free(void *fqdn_plugin_schema);
|
||||
struct ex_data_schema *fqdn_plugin_table_get_ex_data_schema(void *fqdn_plugin_schema);
|
||||
|
||||
int fqdn_plugin_table_set_ex_data_schema(void *fqdn_plugin_schema,
|
||||
maat_plugin_ex_new_func_t *new_func,
|
||||
maat_plugin_ex_free_func_t *free_func,
|
||||
maat_plugin_ex_dup_func_t *dup_func,
|
||||
maat_ex_new_func_t *new_func,
|
||||
maat_ex_free_func_t *free_func,
|
||||
maat_ex_dup_func_t *dup_func,
|
||||
long argl, void *argp,
|
||||
struct log_handle *logger);
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ void ip_plugin_schema_free(void *ip_plugin_schema);
|
||||
struct ex_data_schema *ip_plugin_table_get_ex_data_schema(void *ip_plugin_schema);
|
||||
|
||||
void ip_plugin_table_set_ex_data_schema(void *ip_plugin_schema,
|
||||
maat_plugin_ex_new_func_t *new_func,
|
||||
maat_plugin_ex_free_func_t *free_func,
|
||||
maat_plugin_ex_dup_func_t *dup_func,
|
||||
maat_ex_new_func_t *new_func,
|
||||
maat_ex_free_func_t *free_func,
|
||||
maat_ex_dup_func_t *dup_func,
|
||||
long argl, void *argp,
|
||||
struct log_handle *logger);
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ int plugin_table_get_foreign_column(struct plugin_schema *plugin_schema, int *fo
|
||||
|
||||
/* plugin table ex data API */
|
||||
void plugin_table_set_ex_data_schema(void *plugin_schema,
|
||||
maat_plugin_ex_new_func_t *new_func,
|
||||
maat_plugin_ex_free_func_t *free_func,
|
||||
maat_plugin_ex_dup_func_t *dup_func,
|
||||
maat_ex_new_func_t *new_func,
|
||||
maat_ex_free_func_t *free_func,
|
||||
maat_ex_dup_func_t *dup_func,
|
||||
long argl, void *argp,
|
||||
struct log_handle *logger);
|
||||
struct ex_data_schema *plugin_table_get_ex_data_schema(void *custom_schema);
|
||||
|
||||
@@ -60,12 +60,6 @@ enum tag_match {
|
||||
TAG_MATCH_MATCHED
|
||||
};
|
||||
|
||||
struct maat_rule_head {
|
||||
long long config_id;
|
||||
char resevered;
|
||||
int serv_def_len;
|
||||
};
|
||||
|
||||
#define ITEM_RULE_MAGIC 0x4d3c2b1a
|
||||
struct maat_item_inner {
|
||||
long long magic_num;
|
||||
@@ -88,8 +82,8 @@ struct maat_item {
|
||||
struct compile_rule {
|
||||
long long magic_num;
|
||||
long long compile_id;
|
||||
struct maat_rule_head head;// fix len of Maat_rule_t
|
||||
char *service_defined;
|
||||
char *table_line;
|
||||
size_t table_line_len;
|
||||
int declared_clause_num;
|
||||
double evaluation_order;
|
||||
struct compile_schema *ref_table;
|
||||
|
||||
Reference in New Issue
Block a user