summaryrefslogtreecommitdiffstats
path: root/libsmartcols/src/libsmartcols.h.in
diff options
context:
space:
mode:
authorKarel Zak2018-04-03 15:08:40 +0200
committerKarel Zak2018-04-03 15:10:10 +0200
commitb2c871f97844f6be248a417c2482d0665edc0cfe (patch)
tree86f6d6b077f460664bb8c377adccbadf52bf8e4c /libsmartcols/src/libsmartcols.h.in
parentdocs: add choom to TODO (diff)
downloadkernel-qcow2-util-linux-b2c871f97844f6be248a417c2482d0665edc0cfe.tar.gz
kernel-qcow2-util-linux-b2c871f97844f6be248a417c2482d0665edc0cfe.tar.xz
kernel-qcow2-util-linux-b2c871f97844f6be248a417c2482d0665edc0cfe.zip
libsmartcols: improve JSON support (add types)
This commit add SCOLS_JSON_{NUMBER,STRING,BOOLEAN} to specify column type for JSON output formatting. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libsmartcols/src/libsmartcols.h.in')
-rw-r--r--libsmartcols/src/libsmartcols.h.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/libsmartcols/src/libsmartcols.h.in b/libsmartcols/src/libsmartcols.h.in
index d99d52ba0..f8be0bc04 100644
--- a/libsmartcols/src/libsmartcols.h.in
+++ b/libsmartcols/src/libsmartcols.h.in
@@ -88,6 +88,15 @@ enum {
};
/*
+ * Column JSON types
+ */
+enum {
+ SCOLS_JSON_STRING = 0, /* default */
+ SCOLS_JSON_NUMBER = 1,
+ SCOLS_JSON_BOOLEAN = 2
+};
+
+/*
* Cell flags, see scols_cell_set_flags() before use
*/
enum {
@@ -154,6 +163,9 @@ extern size_t scols_column_get_width(const struct libscols_column *cl);
extern int scols_column_set_safechars(struct libscols_column *cl, const char *safe);
extern const char *scols_column_get_safechars(const struct libscols_column *cl);
+extern int scols_column_set_json_type(struct libscols_column *cl, int type);
+extern int scols_column_get_json_type(const struct libscols_column *cl);
+
extern int scols_column_set_flags(struct libscols_column *cl, int flags);
extern int scols_column_get_flags(const struct libscols_column *cl);
extern struct libscols_column *scols_new_column(void);