aboutsummaryrefslogtreecommitdiffstats
path: root/src/cyn.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cyn.h')
-rw-r--r--src/cyn.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/cyn.h b/src/cyn.h
index 5b4c76f..5772608 100644
--- a/src/cyn.h
+++ b/src/cyn.h
@@ -18,6 +18,8 @@
#pragma once
+#define CYN_VERSION 99
+
/**
* Callback for entering asynchronousely the critical section
* When called it receives the 'magic' argument given when
@@ -50,6 +52,12 @@ typedef void (list_cb_t)(
const data_value_t *value);
/**
+ * Opaque structure for agent subqueries and responses.
+ */
+typedef struct cyn_query cyn_query_t;
+
+
+/**
* Callback for querying agents
*/
typedef int (agent_cb_t)(
@@ -57,8 +65,7 @@ typedef int (agent_cb_t)(
void *agent_closure,
const data_key_t *key,
const char *value,
- on_result_cb_t *on_result_cb,
- void *on_result_closure);
+ cyn_query_t *query);
/**
* Enter in the critical recoverable section if possible
@@ -226,6 +233,22 @@ cyn_check_async(
extern
int
+cyn_subquery_async(
+ cyn_query_t *query,
+ on_result_cb_t *on_result_cb,
+ void *closure,
+ const data_key_t *key
+);
+
+extern
+void
+cyn_reply_query(
+ cyn_query_t *query,
+ const data_value_t *value
+);
+
+extern
+int
cyn_agent_add(
const char *name,
agent_cb_t *agent_cb,