summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4bc282b)
raw | patch | inline | side by side (parent: 4bc282b)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 30 Sep 2014 12:43:42 +0000 (05:43 -0700) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 30 Sep 2014 12:45:10 +0000 (05:45 -0700) |
src/core/store_lookup.c | patch | blob | history | |
src/include/core/store.h | patch | blob | history |
index c3029c75078db3c0ee6d35b0fcbe602a799f41f6..86acd10ea17ccf0a05ca7a7d1faeda5b09c52446 100644 (file)
--- a/src/core/store_lookup.c
+++ b/src/core/store_lookup.c
MATCHER_ISNULL, attr_name));
} /* sdb_store_isnull_matcher */
+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;
+ return -1;
+} /* sdb_store_parse_object_type_plural */
+
int
sdb_store_parse_field_name(const char *name)
{
index 7c94a974297d46cb4107df7ea8773e036343a8d8..fa974bbd1f7f93656992423ad3891f3b66d6b645 100644 (file)
--- a/src/include/core/store.h
+++ b/src/include/core/store.h
sdb_store_matcher_t *
sdb_store_gt_matcher(sdb_store_cond_t *cond);
+/*
+ * 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.