migrate peerstore to new service MQ API
[oweals/gnunet.git] / src / include / gnunet_pq_lib.h
index 8483b72cf0e9f6ea21795e4ea4f74af63d9aaa55..33a3e54254cfe2fa47995b5e3c76992b9e7262dd 100644 (file)
@@ -199,8 +199,7 @@ GNUNET_PQ_query_param_uint64 (const uint64_t *x);
  * @param[out] dst where to store the result
  * @return
  *   #GNUNET_YES if all results could be extracted
- *   #GNUNET_NO if at least one result was NULL
- *   #GNUNET_SYSERR if a result was invalid (non-existing field)
+ *   #GNUNET_SYSERR if a result was invalid (non-existing field or NULL)
  */
 typedef int
 (*GNUNET_PQ_ResultConverter)(void *cls,
@@ -331,6 +330,18 @@ GNUNET_PQ_result_spec_variable_size (const char *name,
                                     size_t *sptr);
 
 
+/**
+ * 0-terminated string expected.
+ *
+ * @param name name of the field in the table
+ * @param[out] dst where to store the result, allocated
+ * @return array entry for the result specification to use
+ */
+struct GNUNET_PQ_ResultSpec
+GNUNET_PQ_result_spec_string (const char *name,
+                              char **dst);
+
+
 /**
  * RSA public key expected.
  *
@@ -431,15 +442,12 @@ GNUNET_PQ_exec_prepared (PGconn *db_conn,
 
 /**
  * Extract results from a query result according to the given specification.
- * If colums are NULL, the destination is not modified, and #GNUNET_NO
- * is returned.
  *
  * @param result result to process
  * @param[in,out] rs result specification to extract for
  * @param row row from the result to extract
  * @return
  *   #GNUNET_YES if all results could be extracted
- *   #GNUNET_NO if at least one result was NULL
  *   #GNUNET_SYSERR if a result was invalid (non-existing field)
  */
 int