X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fcore%2Fstore-private.h;h=953a8826c741abbb21e0b8b3e9871922da3e00d8;hb=8915b40a414bfdc17f893056b523670d63ca3057;hp=7ce807bfa3d9807111453c7f958a5dd994fbb72b;hpb=914a0b5636a32a97c50f73e14ac7be16b2686860;p=sysdb.git diff --git a/src/core/store-private.h b/src/core/store-private.h index 7ce807b..953a882 100644 --- a/src/core/store-private.h +++ b/src/core/store-private.h @@ -106,6 +106,7 @@ typedef struct { /* * expressions */ + enum { ATTR_VALUE = -2, /* attr name stored in data.data.string */ FIELD_VALUE = -1, /* field type stored in data.data.integer */ @@ -117,6 +118,7 @@ struct sdb_store_expr { sdb_object_t super; int type; /* see above */ + int data_type; sdb_store_expr_t *left; sdb_store_expr_t *right; @@ -134,9 +136,8 @@ enum { MATCHER_OR, MATCHER_AND, MATCHER_NOT, - MATCHER_SERVICE, - MATCHER_METRIC, - MATCHER_ATTRIBUTE, + MATCHER_ANY, + MATCHER_ALL, MATCHER_LT, MATCHER_LE, MATCHER_EQ, @@ -154,10 +155,8 @@ enum { (((t) == MATCHER_OR) ? "OR" \ : ((t) == MATCHER_AND) ? "AND" \ : ((t) == MATCHER_NOT) ? "NOT" \ - : ((t) == MATCHER_NAME) ? "NAME" \ - : ((t) == MATCHER_SERVICE) ? "SERVICE" \ - : ((t) == MATCHER_METRIC) ? "METRIC" \ - : ((t) == MATCHER_ATTRIBUTE) ? "ATTRIBUTE" \ + : ((t) == MATCHER_ANY) ? "ANY" \ + : ((t) == MATCHER_ALL) ? "ALL" \ : ((t) == MATCHER_LT) ? "<" \ : ((t) == MATCHER_LE) ? "<=" \ : ((t) == MATCHER_EQ) ? "=" \ @@ -171,12 +170,6 @@ enum { : ((t) == MATCHER_ISNNULL) ? "IS NOT NULL" \ : "UNKNOWN") -/* match the name of something */ -typedef struct { - char *name; - regex_t *name_re; -} string_matcher_t; - /* matcher base type */ struct sdb_store_matcher { sdb_object_t super; @@ -204,12 +197,13 @@ typedef struct { } uop_matcher_t; #define UOP_M(m) ((uop_matcher_t *)(m)) -/* child matcher */ +/* iter matcher */ typedef struct { sdb_store_matcher_t super; + int type; sdb_store_matcher_t *m; -} child_matcher_t; -#define CHILD_M(m) ((child_matcher_t *)(m)) +} iter_matcher_t; +#define ITER_M(m) ((iter_matcher_t *)(m)) /* compare operator matcher */ typedef struct { @@ -221,15 +215,6 @@ typedef struct { } cmp_matcher_t; #define CMP_M(m) ((cmp_matcher_t *)(m)) -/* match any type of object by it's name */ -typedef struct { - sdb_store_matcher_t super; - - int obj_type; - string_matcher_t name; -} name_matcher_t; -#define NAME_M(m) ((name_matcher_t *)(m)) - typedef struct { sdb_store_matcher_t super; sdb_store_expr_t *expr;