+/** Parse the content of the text to fill the query.
+ * The text pointed by \p p is segmented (and modified to add
+ * a \0 at the end of each segment) and used to fill the query
+ * object.
+ */
+__attribute__((nonnull(1,2)))
+bool query_parse(query_t *query, char *p);
+
+/** Return the value of the field with the given name.
+ */
+__attribute__((nonnull(1,2)))
+const static_str_t *query_field_for_name(const query_t *query, const char *name);
+
+/** Returns the value of the field with the given id.
+ */
+__attribute__((nonnull))
+const static_str_t *query_field_for_id(const query_t *query, postlicyd_token id);
+
+/** Formats the given string by replacing ${field_name} with the content
+ * of the query.
+ * Unknown and empty fields are filled with (null).
+ */
+__attribute__((nonnull(3)))
+ssize_t query_format(char *dest, size_t len, const char* fmt, const query_t *query);
+
+/** Writes a query-formated string in a buffer.
+ */
+__attribute__((nonnull(1,2)))
+bool query_format_buffer(buffer_t *buf, const char *fmt, const query_t *query);
+
+/** Check the query-format string.
+ */
+#define query_format_check(fmt) (query_format(NULL, 0, fmt, NULL) >= 0)