summaryrefslogtreecommitdiffstats
path: root/lib/termtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/termtable.h')
-rw-r--r--lib/termtable.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/termtable.h b/lib/termtable.h
index 7258682b..d284c4f3 100644
--- a/lib/termtable.h
+++ b/lib/termtable.h
@@ -270,7 +270,7 @@ void ttable_rowseps(struct ttable *tt, unsigned int row,
*
* Caller must free this string after use with
*
- * XFREE (MTYPE_TMP, str);
+ * XFREE (MTYPE_TMP_TTABLE, str);
*
* @param tt the table to dump
* @param newline the desired newline sequence to use, null terminated.
@@ -289,6 +289,21 @@ char *ttable_dump(struct ttable *tt, const char *newline);
*/
json_object *ttable_json(struct ttable *tt, const char *const formats);
+/**
+ * Convert a table to a JSON array of objects.
+ *
+ * Caller must free the returned json_object structure.
+ *
+ * @param tt the table to convert
+ * @param formats an array of characters indicating what JSON type should be
+ * used.
+ * @param formats an optinal string of row headers that overrids the first row of the table.
+ * This is useful to get naming convention that align with caml Format.
+ */
+json_object *ttable_json_with_json_text(struct ttable *tt,
+ const char *const formats,
+ const char *json_override_text);
+
#ifdef __cplusplus
}
#endif