]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/termtable.h
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / lib / termtable.h
index 3aa8caee89bd726888b09a735957c95a30818832..7258682bd80a680f047095ace134434443b62d56 100644 (file)
@@ -8,6 +8,7 @@
 #define _TERMTABLE_H_
 
 #include <zebra.h>
+#include "lib/json.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -277,6 +278,17 @@ void ttable_rowseps(struct ttable *tt, unsigned int row,
  */
 char *ttable_dump(struct ttable *tt, const char *newline);
 
+/**
+ * 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.
+ */
+json_object *ttable_json(struct ttable *tt, const char *const formats);
+
 #ifdef __cplusplus
 }
 #endif