summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6db7512)
raw | patch | inline | side by side (parent: 6db7512)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 20 May 2015 06:49:38 +0000 (08:49 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 20 May 2015 06:49:38 +0000 (08:49 +0200) |
src/core/store_lookup.c | patch | blob | history | |
src/include/core/store.h | patch | blob | history |
index 82bb3d6d6cf1e50f9cc0b3c748a797e37bbb0fb6..b43b1ef6785930cf1550fdec7b917aa22e081eff 100644 (file)
--- a/src/core/store_lookup.c
+++ b/src/core/store_lookup.c
MATCHER_ISFALSE, expr));
} /* sdb_store_isfalse_matcher */
-sdb_store_matcher_op_cb
-sdb_store_parse_matcher_op(const char *op)
-{
- if (! strcasecmp(op, "<"))
- return sdb_store_lt_matcher;
- else if (! strcasecmp(op, "<="))
- return sdb_store_le_matcher;
- else if (! strcasecmp(op, "="))
- return sdb_store_eq_matcher;
- else if (! strcasecmp(op, "!="))
- return sdb_store_ne_matcher;
- else if (! strcasecmp(op, ">="))
- return sdb_store_ge_matcher;
- else if (! strcasecmp(op, ">"))
- return sdb_store_gt_matcher;
- else if (! strcasecmp(op, "=~"))
- return sdb_store_regex_matcher;
- else if (! strcasecmp(op, "!~"))
- return sdb_store_nregex_matcher;
- return NULL;
-} /* sdb_store_parse_matcher_op */
-
-int
-sdb_store_parse_object_type(const char *name)
-{
- if (! strcasecmp(name, "host"))
- return SDB_HOST;
- else if (! strcasecmp(name, "service"))
- return SDB_SERVICE;
- else if (! strcasecmp(name, "metric"))
- return SDB_METRIC;
- else if (! strcasecmp(name, "attribute"))
- return SDB_ATTRIBUTE;
- return -1;
-} /* sdb_store_parse_object_type */
-
-int
-sdb_store_parse_object_type_plural(const char *name)
-{
- if (! strcasecmp(name, "hosts"))
- return SDB_HOST;
- else if (! strcasecmp(name, "services"))
- return SDB_SERVICE;
- else if (! strcasecmp(name, "metrics"))
- return SDB_METRIC;
- else if (! strcasecmp(name, "attributes"))
- return SDB_ATTRIBUTE;
- return -1;
-} /* sdb_store_parse_object_type_plural */
-
-int
-sdb_store_parse_field_name(const char *name)
-{
- if (! strcasecmp(name, "name"))
- return SDB_FIELD_NAME;
- else if (! strcasecmp(name, "last_update"))
- return SDB_FIELD_LAST_UPDATE;
- else if (! strcasecmp(name, "age"))
- return SDB_FIELD_AGE;
- else if (! strcasecmp(name, "interval"))
- return SDB_FIELD_INTERVAL;
- else if (! strcasecmp(name, "backend"))
- return SDB_FIELD_BACKEND;
- else if (! strcasecmp(name, "value"))
- return SDB_FIELD_VALUE;
- return -1;
-} /* sdb_store_parse_field_name */
-
sdb_store_matcher_t *
sdb_store_dis_matcher(sdb_store_matcher_t *left, sdb_store_matcher_t *right)
{
index c8b7941b1d6e1bcaecf264cc994d2b7b041ef6ab..c051252f771616ad3df65eba06fbf9fe1bd3f447 100644 (file)
--- a/src/include/core/store.h
+++ b/src/include/core/store.h
typedef sdb_store_matcher_t *(*sdb_store_matcher_op_cb)
(sdb_store_expr_t *, sdb_store_expr_t *);
-/*
- * sdb_store_parse_matcher_op:
- * Parse a matcher operator and return a constructor for the respective
- * matcher.
- *
- * Returns:
- * - matcher operator constructor on success
- * - NULL else
- */
-sdb_store_matcher_op_cb
-sdb_store_parse_matcher_op(const char *op);
-
-/*
- * sdb_store_parse_object_type:
- * Parse the type name of a stored object.
- *
- * Returns:
- * - the object type on success
- * - a negative value else
- */
-int
-sdb_store_parse_object_type(const char *name);
-
-/*
- * sdb_store_parse_object_type_plural:
- * Parse the type name (plural) of a stored object.
- *
- * Returns:
- * - the object type on success
- * - a negative value else
- */
-int
-sdb_store_parse_object_type_plural(const char *name);
-
-/*
- * sdb_store_parse_field_name:
- * Parse the name of a stored object's queryable field.
- *
- * Returns:
- * - the field id on success
- * - a negative value else
- */
-int
-sdb_store_parse_field_name(const char *name);
-
/*
* sdb_store_lookup_cb:
* Lookup callback. It is called for each matching object when looking up data