From dbba6b8562bd2a13e77c5381b2fc85931dcaab5d Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 20 May 2015 08:49:38 +0200 Subject: [PATCH] store: Remove (now unused) sdb_store_parse_*() helpers. --- src/core/store_lookup.c | 68 ---------------------------------------- src/include/core/store.h | 45 -------------------------- 2 files changed, 113 deletions(-) diff --git a/src/core/store_lookup.c b/src/core/store_lookup.c index 82bb3d6..b43b1ef 100644 --- a/src/core/store_lookup.c +++ b/src/core/store_lookup.c @@ -649,74 +649,6 @@ sdb_store_isfalse_matcher(sdb_store_expr_t *expr) 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) { diff --git a/src/include/core/store.h b/src/include/core/store.h index c8b7941..c051252 100644 --- a/src/include/core/store.h +++ b/src/include/core/store.h @@ -651,51 +651,6 @@ sdb_store_matcher_matches(sdb_store_matcher_t *m, sdb_store_obj_t *obj, 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 -- 2.30.2