summaryrefslogtreecommitdiffstats
path: root/src/include/k5-json.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/k5-json.h')
-rw-r--r--src/include/k5-json.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/include/k5-json.h b/src/include/k5-json.h
index 4b9b8fec3b..b01b8b847e 100644
--- a/src/include/k5-json.h
+++ b/src/include/k5-json.h
@@ -109,6 +109,9 @@ typedef struct k5_json_null_st *k5_json_null;
int k5_json_null_create(k5_json_null *null_out);
+/* Create a null value as a k5_json_value, for polymorphic convenience. */
+int k5_json_null_create_val(k5_json_value *val_out);
+
/*
* Boolean
*/
@@ -136,6 +139,21 @@ void k5_json_array_set(k5_json_array array, size_t idx, k5_json_value val);
k5_json_value k5_json_array_get(k5_json_array array, size_t idx);
/*
+ * Create an array from a template and a variable argument list. template
+ * characters are:
+ * v: a k5_json_value argument is read, retained, and stored
+ * n: no argument is read; a null value is stored
+ * b: an int argument is read and stored as a boolean value
+ * i: an int argument is read and stored as a number value
+ * L: a long long argument is read and stored as a number value
+ * s: a const char * argument is read and stored as a null or string value
+ * B: const void * and size_t arguments are read and stored as a base64
+ * string value
+ */
+int
+k5_json_array_fmt(k5_json_array *array_out, const char *template, ...);
+
+/*
* Object
*/