X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fcore%2Fstore-private.h;h=64a70c31059f519f432a5ea40227441956bd7d25;hb=b0af45ebf920955095b9fdeaddbde0107c6e519f;hp=22f6e07c43259671664053e3f88647f4a666c846;hpb=5e3ba235ca69e67baa9945a2c0be8a7270485656;p=sysdb.git diff --git a/src/core/store-private.h b/src/core/store-private.h index 22f6e07..64a70c3 100644 --- a/src/core/store-private.h +++ b/src/core/store-private.h @@ -72,16 +72,6 @@ typedef struct { #define SDB_STORE_OBJ(obj) ((sdb_store_obj_t *)(obj)) #define SDB_CONST_STORE_OBJ(obj) ((const sdb_store_obj_t *)(obj)) -enum { - SDB_HOST = 1, - SDB_SERVICE, - SDB_ATTRIBUTE, -}; -#define TYPE_TO_NAME(t) \ - (((t) == SDB_HOST) ? "host" \ - : ((t) == SDB_SERVICE) ? "service" \ - : ((t) == SDB_ATTRIBUTE) ? "attribute" : "unknown") - /* shortcuts for accessing the sdb_store_obj_t attributes * of inheriting objects */ #define _last_update super.last_update @@ -91,12 +81,14 @@ enum { * matchers */ -/* when adding to this, also update 'matchers' in store_lookup.c */ +/* when adding to this, also update 'matchers' and 'matchers_tostring' + * in store_lookup.c */ enum { MATCHER_OR, MATCHER_AND, + MATCHER_NOT, + MATCHER_NAME, MATCHER_ATTR, - MATCHER_SERVICE, MATCHER_HOST, }; @@ -114,7 +106,7 @@ struct sdb_store_matcher { }; #define M(m) ((sdb_store_matcher_t *)(m)) -/* logical operator matcher */ +/* logical infix operator matcher */ typedef struct { sdb_store_matcher_t super; @@ -124,10 +116,21 @@ typedef struct { } op_matcher_t; #define OP_M(m) ((op_matcher_t *)(m)) -/* match any type of object by it's base information */ +/* logical unary operator matcher */ +typedef struct { + sdb_store_matcher_t super; + + /* operand */ + sdb_store_matcher_t *op; +} uop_matcher_t; +#define UOP_M(m) ((uop_matcher_t *)(m)) + +/* match any type of object by it's name */ typedef struct { sdb_store_matcher_t super; + int obj_type; + /* match by the name of the object */ name_matcher_t name; } obj_matcher_t; @@ -142,19 +145,9 @@ typedef struct { } attr_matcher_t; #define ATTR_M(m) ((attr_matcher_t *)(m)) -/* match services */ -typedef struct { - obj_matcher_t super; - /* match by attributes assigned to the service */ - attr_matcher_t *attr; -} service_matcher_t; -#define SERVICE_M(m) ((service_matcher_t *)(m)) - /* match hosts */ typedef struct { obj_matcher_t super; - /* match by services assigned to the host */ - service_matcher_t *service; /* match by attributes assigned to the host */ attr_matcher_t *attr; } host_matcher_t;