-GNUNET_PSYC_member_story_tell_cancel (struct GNUNET_PSYC_Story *story);
-
-
-/**
- * Call the given callback on all matching values (including variables) in the
- * channel state.
- *
- * The callback is invoked synchronously on all matching states (as the state is
- * fully replicated in the library in this process; channel states should be
- * small, large data is to be passed as streaming data to methods).
- *
- * A name matches if it includes the @a state_name prefix, thus requesting the
- * empty state ("") will match all values; requesting "_a_b" will also return
- * values stored under "_a_b_c".
- *
- * @param member Membership handle.
- * @param state_name Name of the state to query (full name
- * might be longer, this is only the prefix that must match).
- * @param cb Function to call on the matching state values.
- * @param cb_cls Closure for @a cb.
- * @return Message ID for which the state was returned (last seen
- * message ID).
- */
-uint64_t
-GNUNET_PSYC_member_state_get_all (struct GNUNET_PSYC_Member *member,
- const char *state_name,
- GNUNET_PSYC_StateCallback cb,
- void *cb_cls);
-
-
-/**
- * Obtain the current value of the best-matching value in the state
- * (including variables).
- *
- * Note that variables are only valid during a #GNUNET_PSYC_Method invocation, as
- * variables are only valid for the duration of a method invocation.
- *
- * If the requested variable name does not have an exact state in
- * the state, the nearest less-specific name is matched; for example,
- * requesting "_a_b" will match "_a" if "_a_b" does not exist.
- *
- * @param member Membership handle.
- * @param variable_name Name of the variable to query.
- * @param[out] return_value_size Set to number of bytes in variable,
- * needed as variables might contain binary data and
- * might also not be 0-terminated; set to 0 on errors.
- * @return NULL on error (no matching state or variable), pointer
- to the respective value otherwise.
- */
-const void *
-GNUNET_PSYC_member_state_get (struct GNUNET_PSYC_Member *member,
- const char *variable_name,
- size_t *return_value_size);
+GNUNET_PSYC_channel_story_tell_cancel (struct GNUNET_PSYC_Story *story);
+
+
+/**
+ * Handle for a state query operation.
+ */
+struct GNUNET_PSYC_StateQuery;
+
+
+/**
+ * Retrieve the best matching channel state variable.
+ *
+ * If the requested variable name is not present in the state, the nearest
+ * less-specific name is matched; for example, requesting "_a_b" will match "_a"
+ * if "_a_b" does not exist.
+ *
+ * @param channel Channel handle.
+ * @param full_name Full name of the requested variable, the actual variable
+ * returned might have a shorter name..
+ * @param cb Function called once when a matching state variable is found.
+ * Not called if there's no matching state variable.
+ * @param cb_cls Closure for the callbacks.
+ * @return Handle that can be used to cancel the query operation.
+ */
+struct GNUNET_PSYC_StateQuery *
+GNUNET_PSYC_channel_state_get (struct GNUNET_PSYC_Channel *channel,
+ const char *full_name,
+ GNUNET_PSYC_StateCallback cb,
+ void *cb_cls);
+
+
+/**
+ * Return all channel state variables whose name matches a given prefix.
+ *
+ * A name matches if it starts with the given @a name_prefix, thus requesting
+ * the empty prefix ("") will match all values; requesting "_a_b" will also
+ * return values stored under "_a_b_c".
+ *
+ * The @a state_cb is invoked on all matching state variables asynchronously, as
+ * the state is stored in and retrieved from the PSYCstore,
+ *
+ * @param channel Channel handle.
+ * @param name_prefix Prefix of the state variable name to match.
+ * @param cb Function to call with the matching state variables.
+ * @param cb_cls Closure for the callbacks.
+ * @return Handle that can be used to cancel the query operation.
+ */
+struct GNUNET_PSYC_StateQuery *
+GNUNET_PSYC_channel_state_get_prefix (struct GNUNET_PSYC_Channel *channel,
+ const char *name_prefix,
+ GNUNET_PSYC_StateCallback cb,
+ void *cb_cls);
+
+
+/**
+ * Cancel a state query operation.
+ *
+ * @param query Handle for the operation to cancel.
+ */
+void
+GNUNET_PSYC_channel_state_get_cancel (struct GNUNET_PSYC_StateQuery *query);