Code

store_lookup: Simplified some internal checks.
[sysdb.git] / src / core / store-private.h
index cda98357cadaa114e0af20f956f9927dc7e9cf49..0db46f84b5d6c28393d8a7d49b8e8dd453471335 100644 (file)
@@ -89,15 +89,13 @@ enum {
        MATCHER_NOT,
        MATCHER_NAME,
        MATCHER_ATTR,
-       MATCHER_SERVICE,
-       MATCHER_HOST,
 };
 
 /* match the name of something */
 typedef struct {
        char    *name;
        regex_t *name_re;
-} name_matcher_t;
+} string_matcher_t;
 
 /* matcher base type */
 struct sdb_store_matcher {
@@ -107,7 +105,7 @@ struct sdb_store_matcher {
 };
 #define M(m) ((sdb_store_matcher_t *)(m))
 
-/* logical infix operator matcher */
+/* infix operator matcher */
 typedef struct {
        sdb_store_matcher_t super;
 
@@ -117,7 +115,7 @@ typedef struct {
 } op_matcher_t;
 #define OP_M(m) ((op_matcher_t *)(m))
 
-/* logical unary operator matcher */
+/* unary operator matcher */
 typedef struct {
        sdb_store_matcher_t super;
 
@@ -131,39 +129,20 @@ typedef struct {
        sdb_store_matcher_t super;
 
        int obj_type;
-
-       /* match by the name of the object */
-       name_matcher_t name;
-} obj_matcher_t;
-#define OBJ_M(m) ((obj_matcher_t *)(m))
+       string_matcher_t name;
+} name_matcher_t;
+#define NAME_M(m) ((name_matcher_t *)(m))
 
 /* match attributes */
 typedef struct {
-       obj_matcher_t super;
+       sdb_store_matcher_t super;
+       char *name;
        /* XXX: this needs to be more flexible;
         *      add support for type-specific operators */
-       name_matcher_t value;
+       string_matcher_t value;
 } 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;
-#define HOST_M(m) ((host_matcher_t *)(m))
-
 #ifdef __cplusplus
 } /* extern "C" */
 #endif