From a8c1c1f01c0443e5ed884316da618634c7aebe93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Fri, 5 Dec 2025 21:50:06 +0000 Subject: Add JSON output --- include/ql.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/ql.h b/include/ql.h index 5e32fda..e1e2b11 100644 --- a/include/ql.h +++ b/include/ql.h @@ -115,6 +115,12 @@ typedef struct { bool first_page; // used for autocut pagination } ql_print_cfg_t; +typedef struct { + const char *printer; + const char *image; + bool output_json; +} ql_print_json_t; + #define QL_PRINT_CFG_MEDIA_TYPE 0x02 #define QL_PRINT_CFG_MEDIA_WIDTH 0x04 #define QL_PRINT_CFG_MEDIA_LENGTH 0x08 @@ -150,6 +156,7 @@ const char *ql_decode_media_type(const ql_status_t * status); #define QL_DECODE_ERROR 0x02 #define QL_DECODE_MEDIA 0x04 #define QL_DECODE_MODE 0x08 -void ql_decode_print_status(FILE * out, const ql_status_t * status, unsigned flags); - +void ql_decode_print_status(FILE * out, const ql_status_t * status, + const ql_print_json_t * json_ctx, unsigned flags); +const char *ql_json_escape(const char *src); #endif -- cgit v1.2.1