X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Fparser%2Fast.c;h=dcfe7862bd0b73c891ea017796a28cc626cf0589;hp=a64178bdd6e35e6fce4f43b2db4dace1d899806a;hb=07dada8e5c614f0ef90fed8e86183ba7acd0e6e8;hpb=c1ebabaddb0c56ee34843f358c12d4a2536796f8 diff --git a/src/parser/ast.c b/src/parser/ast.c index a64178b..dcfe786 100644 --- a/src/parser/ast.c +++ b/src/parser/ast.c @@ -85,6 +85,8 @@ fetch_destroy(sdb_object_t *obj) sdb_ast_fetch_t *fetch = SDB_AST_FETCH(obj); if (fetch->hostname) free(fetch->hostname); + if (fetch->parent) + free(fetch->parent); if (fetch->name) free(fetch->name); fetch->hostname = fetch->name = NULL; @@ -223,8 +225,7 @@ sdb_ast_op_create(int kind, sdb_ast_node_t *left, sdb_ast_node_t *right) } /* sdb_ast_op_create */ sdb_ast_node_t * -sdb_ast_iter_create(int kind, int op, - sdb_ast_node_t *iter, sdb_ast_node_t *expr) +sdb_ast_iter_create(int kind, sdb_ast_node_t *iter, sdb_ast_node_t *expr) { sdb_ast_iter_t *i; i = SDB_AST_ITER(sdb_object_create(SDB_AST_OP_TO_STRING(kind), iter_type)); @@ -234,7 +235,6 @@ sdb_ast_iter_create(int kind, int op, i->super.type = SDB_AST_TYPE_ITERATOR; i->kind = kind; - i->op = op; i->iter = iter; i->expr = expr; return SDB_AST_NODE(i); @@ -291,8 +291,9 @@ sdb_ast_value_create(int type, char *name) } /* sdb_ast_value_create */ sdb_ast_node_t * -sdb_ast_fetch_create(int obj_type, char *hostname, char *name, - 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_fetch_t *fetch; fetch = SDB_AST_FETCH(sdb_object_create("FETCH", fetch_type)); @@ -303,7 +304,10 @@ sdb_ast_fetch_create(int obj_type, char *hostname, char *name, fetch->obj_type = obj_type; fetch->hostname = hostname; + fetch->parent_type = parent_type; + fetch->parent = parent; fetch->name = name; + fetch->full = full; fetch->filter = filter; return SDB_AST_NODE(fetch); } /* sdb_ast_fetch_create */