summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 009f573)
raw | patch | inline | side by side (parent: 009f573)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 2 Aug 2014 18:13:49 +0000 (20:13 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 2 Aug 2014 18:13:49 +0000 (20:13 +0200) |
That name better describes what the function is doing.
src/frontend/connection.c | patch | blob | history | |
src/frontend/query.c | patch | blob | history | |
src/include/frontend/connection.h | patch | blob | history |
index 0bdafdc89b0dce2687d064db21e42f791c9f997e..2fdc5e9222d33449cb10709d090106f66c866e08 100644 (file)
char hostname[conn->cmd_len + 1];
strncpy(hostname, sdb_strbuf_string(conn->buf), conn->cmd_len);
hostname[sizeof(hostname) - 1] = '\0';
- status = sdb_fe_fetch(conn, hostname, /* filter = */ NULL);
+ status = sdb_fe_exec_fetch(conn, hostname, /* filter = */ NULL);
break;
}
case CONNECTION_LIST:
- status = sdb_fe_list(conn, /* filter = */ NULL);
+ status = sdb_fe_exec_list(conn, /* filter = */ NULL);
break;
case CONNECTION_LOOKUP:
{
break;
}
- status = sdb_fe_lookup(conn, m, /* filter = */ NULL);
+ status = sdb_fe_exec_lookup(conn, m, /* filter = */ NULL);
sdb_object_deref(SDB_OBJ(m));
break;
}
diff --git a/src/frontend/query.c b/src/frontend/query.c
index 6fa2a619dcaa3d635dc3201b5cbe85f6698c0139..fda93f6fb0ccd1e8e7d71be3864d67cc090bbb7d 100644 (file)
--- a/src/frontend/query.c
+++ b/src/frontend/query.c
switch (node->cmd) {
case CONNECTION_FETCH:
- return sdb_fe_fetch(conn, CONN_FETCH(node)->name,
+ return sdb_fe_exec_fetch(conn, CONN_FETCH(node)->name,
/* filter = */ NULL);
case CONNECTION_LIST:
- return sdb_fe_list(conn, /* filter = */ NULL);
+ return sdb_fe_exec_list(conn, /* filter = */ NULL);
case CONNECTION_LOOKUP:
{
sdb_store_matcher_t *m = NULL, *filter = NULL;
m = CONN_LOOKUP(node)->matcher->matcher;
if (CONN_LOOKUP(node)->filter)
filter = CONN_LOOKUP(node)->filter->matcher;
- return sdb_fe_lookup(conn, m, filter);
+ return sdb_fe_exec_lookup(conn, m, filter);
}
default:
} /* sdb_fe_exec */
int
-sdb_fe_fetch(sdb_conn_t *conn, const char *name, sdb_store_matcher_t *filter)
+sdb_fe_exec_fetch(sdb_conn_t *conn, const char *name,
+ sdb_store_matcher_t *filter)
{
sdb_strbuf_t *buf;
sdb_store_obj_t *host;
sdb_strbuf_destroy(buf);
sdb_object_deref(SDB_OBJ(host));
return 0;
-} /* sdb_fe_fetch */
+} /* sdb_fe_exec_fetch */
int
-sdb_fe_list(sdb_conn_t *conn, sdb_store_matcher_t *filter)
+sdb_fe_exec_list(sdb_conn_t *conn, sdb_store_matcher_t *filter)
{
sdb_strbuf_t *buf;
(uint32_t)sdb_strbuf_len(buf), sdb_strbuf_string(buf));
sdb_strbuf_destroy(buf);
return 0;
-} /* sdb_fe_list */
+} /* sdb_fe_exec_list */
int
-sdb_fe_lookup(sdb_conn_t *conn, sdb_store_matcher_t *m,
+sdb_fe_exec_lookup(sdb_conn_t *conn, sdb_store_matcher_t *m,
sdb_store_matcher_t *filter)
{
tojson_data_t data = { NULL, filter, 0 };
(uint32_t)sdb_strbuf_len(data.buf), sdb_strbuf_string(data.buf));
sdb_strbuf_destroy(data.buf);
return 0;
-} /* sdb_fe_lookup */
+} /* sdb_fe_exec_lookup */
/* vim: set tw=78 sw=4 ts=4 noexpandtab : */
index 30e6509b553e73b910c9d3b120d5b0c98bef42e6..bff3f3be7db1c2785c78c4fbcb7888d0cf914047 100644 (file)
*/
/*
- * sdb_fe_fetch:
- * Send the named host, serialized as JSON, to the client. If specified, only
- * objects matching the filter will be included. See sdb_store_tojson for
- * details.
+ * sdb_fe_exec_fetch:
+ * Execute the 'FETCH' command. Send the named host, serialized as JSON, to
+ * the client. If specified, only objects matching the filter will be
+ * included. See sdb_store_tojson for details.
*
* Returns:
* - 0 on success
* - a negative value else
*/
int
-sdb_fe_fetch(sdb_conn_t *conn, const char *name, sdb_store_matcher_t *filter);
+sdb_fe_exec_fetch(sdb_conn_t *conn, const char *name,
+ sdb_store_matcher_t *filter);
/*
- * sdb_fe_list:
- * Send a complete listing of the store, serialized as JSON, to the client. If
- * specified, only objects matching the filter will be included. See
- * sdb_store_tojson for details.
+ * sdb_fe_exec_list:
+ * Execute the 'LIST' command. Send a complete listing of the store,
+ * serialized as JSON, to the client. If specified, only objects matching the
+ * filter will be included. See sdb_store_tojson for details.
*
* Returns:
* - 0 on success
* - a negative value else
*/
int
-sdb_fe_list(sdb_conn_t *conn, sdb_store_matcher_t *filter);
+sdb_fe_exec_list(sdb_conn_t *conn, sdb_store_matcher_t *filter);
/*
- * sdb_fe_lookup:
- * Send a list of hosts matching 'm', serialized as JSON, to the client. If
- * specified, only objects matching the filter will be included. See
- * sdb_store_tojson for details.
+ * sdb_fe_exec_lookup:
+ * Execute the 'LOOKUP' command. Send a list of hosts matching 'm', serialized
+ * as JSON, to the client. If specified, only objects matching the filter will
+ * be included. See sdb_store_tojson for details.
*
* Returns:
* - 0 on success
* - a negative value else
*/
int
-sdb_fe_lookup(sdb_conn_t *conn, sdb_store_matcher_t *m,
+sdb_fe_exec_lookup(sdb_conn_t *conn, sdb_store_matcher_t *m,
sdb_store_matcher_t *filter);
#ifdef __cplusplus