X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Finclude%2Fparser%2Fast.h;h=110ee082a93402d11319ac3b8a63145e8a145b88;hp=0736876ae1b464d0100958ad04c73b41a08e31b6;hb=HEAD;hpb=0012c03f12422094042bc1458000ac94a38e9efe;ds=sidebyside diff --git a/src/include/parser/ast.h b/src/include/parser/ast.h index 0736876..110ee08 100644 --- a/src/include/parser/ast.h +++ b/src/include/parser/ast.h @@ -257,6 +257,8 @@ typedef struct { sdb_ast_node_t super; int obj_type; char *hostname; /* optional */ + int parent_type; /* optional */ + char *parent; /* optional */ char *name; /* whether to include the full object, that is, * including all attributes and all children */ @@ -265,7 +267,7 @@ typedef struct { } sdb_ast_fetch_t; #define SDB_AST_FETCH(obj) ((sdb_ast_fetch_t *)(obj)) #define SDB_AST_FETCH_INIT \ - { { SDB_OBJECT_INIT, SDB_AST_TYPE_FETCH, -1 }, -1, NULL, NULL, 0, NULL } + { { SDB_OBJECT_INIT, SDB_AST_TYPE_FETCH, -1 }, -1, NULL, -1, NULL, NULL, 0, NULL } /* * sdb_ast_list_t represents a LIST command. @@ -307,6 +309,7 @@ typedef struct { /* metric specific */ char *store_type; char *store_id; + sdb_time_t store_last_update; /* attribute specific */ sdb_data_t value; @@ -314,7 +317,7 @@ typedef struct { #define SDB_AST_STORE(obj) ((sdb_ast_store_t *)(obj)) #define SDB_AST_STORE_INIT \ { { SDB_OBJECT_INIT, SDB_AST_TYPE_STORE, -1 }, \ - -1, NULL, -1, NULL, NULL, 0, NULL, NULL, SDB_DATA_INIT } + -1, NULL, -1, NULL, NULL, 0, NULL, NULL, 0, SDB_DATA_INIT } /* * sdb_ast_timeseries_t represents a TIMESERIES command. @@ -323,12 +326,14 @@ typedef struct { sdb_ast_node_t super; char *hostname; char *metric; + char **data_names; + size_t data_names_len; sdb_time_t start; sdb_time_t end; } sdb_ast_timeseries_t; #define SDB_AST_TIMESERIES(obj) ((sdb_ast_timeseries_t *)(obj)) #define SDB_AST_TIMESERIES_INIT \ - { { SDB_OBJECT_INIT, SDB_AST_TYPE_TIMESERIES, -1 }, NULL, NULL, 0, 0 } + { { SDB_OBJECT_INIT, SDB_AST_TYPE_TIMESERIES, -1 }, NULL, NULL, NULL, 0, 0, 0 } /* * AST constructors: @@ -387,8 +392,9 @@ sdb_ast_value_create(int type, char *name); * takes ownership of the strings and the filter node. */ sdb_ast_node_t * -sdb_ast_fetch_create(int obj_type, char *hostname, char *name, bool full, - sdb_ast_node_t *filter); +sdb_ast_fetch_create(int obj_type, char *hostname, + int parent_type, char *parent, char *name, + bool full, sdb_ast_node_t *filter); /* * sdb_ast_list_create: @@ -415,15 +421,17 @@ sdb_ast_lookup_create(int obj_type, sdb_ast_node_t *matcher, sdb_ast_node_t * sdb_ast_store_create(int obj_type, char *hostname, int parent_type, char *parent, char *name, sdb_time_t last_update, - char *store_type, char *store_id, sdb_data_t value); + char *store_type, char *store_id, sdb_time_t store_last_update, + sdb_data_t value); /* * sdb_ast_timeseries_create: * Creates an AST node representing a TIMESERIES command. The newly created - * node takes ownership of the strings. + * node takes ownership of the strings and string vectors. */ sdb_ast_node_t * sdb_ast_timeseries_create(char *hostname, char *metric, + char **data_names, size_t data_names_len, sdb_time_t start, sdb_time_t end); #ifdef __cplusplus