summaryrefslogtreecommitdiffstats
path: root/include/ql.h
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <ast@2e8.dk>2023-07-08 22:40:00 +0000
committerAsbjørn Sloth Tønnesen <ast@2e8.dk>2023-07-10 19:53:57 +0000
commite8ea33f5c777874b25b858df3ef61ca7ebed60ff (patch)
tree1b1ead3a046d8dbeb7645c24743a85df0f4f0473 /include/ql.h
parent5a72605339cbb275277be76d1259589137d5db6b (diff)
downloadqlprint-e8ea33f5c777874b25b858df3ef61ca7ebed60ff.tar.gz
qlprint-e8ea33f5c777874b25b858df3ef61ca7ebed60ff.tar.xz
qlprint-e8ea33f5c777874b25b858df3ef61ca7ebed60ff.zip
fix coding style
Diffstat (limited to 'include/ql.h')
-rw-r--r--include/ql.h94
1 files changed, 47 insertions, 47 deletions
diff --git a/include/ql.h b/include/ql.h
index b854c06..5e32fda 100644
--- a/include/ql.h
+++ b/include/ql.h
@@ -23,33 +23,32 @@
*
*/
-typedef struct
-{
- uint8_t print_head_mark;
- uint8_t sz;
- uint8_t rsvd_2; // 'B'
- uint8_t model_class;
- uint8_t model_code;
- uint8_t rsvd_5; // '0'
- uint8_t rsvd_6; // '0'
- uint8_t rsvd_7; // 0x00
- uint8_t err_info_1;
- uint8_t err_info_2;
- uint8_t media_width_mm;
- uint8_t media_type;
- uint8_t rsvd_12; // 0x00
- uint8_t rsvd_13; // 0x00
- uint8_t rsvd_14; // 0x3f
- uint8_t mode;
- uint8_t rsvd_16; // 0x00
- uint8_t media_length_mm;
- uint8_t status_type;
- uint8_t phase_type;
- uint8_t phase_hi;
- uint8_t phase_lo;
- uint8_t notification;
- uint8_t rsvd_23; // 0x00
- uint8_t rsvd_24[8]; // 0x00...
+typedef struct {
+ uint8_t print_head_mark;
+ uint8_t sz;
+ uint8_t rsvd_2; // 'B'
+ uint8_t model_class;
+ uint8_t model_code;
+ uint8_t rsvd_5; // '0'
+ uint8_t rsvd_6; // '0'
+ uint8_t rsvd_7; // 0x00
+ uint8_t err_info_1;
+ uint8_t err_info_2;
+ uint8_t media_width_mm;
+ uint8_t media_type;
+ uint8_t rsvd_12; // 0x00
+ uint8_t rsvd_13; // 0x00
+ uint8_t rsvd_14; // 0x3f
+ uint8_t mode;
+ uint8_t rsvd_16; // 0x00
+ uint8_t media_length_mm;
+ uint8_t status_type;
+ uint8_t phase_type;
+ uint8_t phase_hi;
+ uint8_t phase_lo;
+ uint8_t notification;
+ uint8_t rsvd_23; // 0x00
+ uint8_t rsvd_24[8]; // 0x00...
} ql_status_t;
#define QL_ERR_1_NO_MEDIA 0x01
@@ -98,22 +97,22 @@ typedef struct
#define QL_NOTIFICATION_COOLING_DONE 0x04
// Flags for expanded mode
-#define QL_EXPANDED_MODE_CUT_AT_END 0x10 /* Gah, 710 doc claims 0x08! */
-#define QL_EXPANDED_MODE_HIGH_RES 0x40 /* QL-570/580N/700 */
+#define QL_EXPANDED_MODE_CUT_AT_END 0x10 /* Gah, 710 doc claims 0x08! */
+#define QL_EXPANDED_MODE_HIGH_RES 0x40 /* QL-570/580N/700 */
typedef struct {
- uint16_t width;
- uint16_t height;
- uint8_t data[];
+ uint16_t width;
+ uint16_t height;
+ uint8_t data[];
} ql_raster_image_t;
typedef struct {
- uint8_t threshold; // pixel values below threshold deemed black
- uint8_t flags; // QL_PRINT_CFG_xxx flags, indicating which other fields valid
- uint8_t media_type;
- uint8_t media_width;
- uint8_t media_length;
- bool first_page; // used for autocut pagination
+ uint8_t threshold; // pixel values below threshold deemed black
+ uint8_t flags; // QL_PRINT_CFG_xxx flags, indicating which other fields valid
+ uint8_t media_type;
+ uint8_t media_width;
+ uint8_t media_length;
+ bool first_page; // used for autocut pagination
} ql_print_cfg_t;
#define QL_PRINT_CFG_MEDIA_TYPE 0x02
@@ -126,11 +125,11 @@ typedef struct ql_ctx *ql_ctx_t;
ql_ctx_t ql_open(const char *printer);
void ql_close(ql_ctx_t ctx);
-bool ql_init(ql_ctx_t ctx); // also cancel
+bool ql_init(ql_ctx_t ctx); // also cancel
bool ql_request_status(ql_ctx_t ctx);
-bool ql_read_status(ql_ctx_t ctx, ql_status_t *status);
+bool ql_read_status(ql_ctx_t ctx, ql_status_t * status);
-bool ql_needs_mode_switch(const ql_status_t *status);
+bool ql_needs_mode_switch(const ql_status_t * status);
bool ql_switch_to_raster_mode(ql_ctx_t ctx);
bool ql_set_mode(ql_ctx_t ctx, unsigned mode);
@@ -139,17 +138,18 @@ bool ql_set_autocut_every_n(ql_ctx_t ctx, uint8_t n);
bool ql_set_margin(ql_ctx_t ctx, uint16_t dots);
// Note: status needed for 1050/1060N detection to adjust command format
-bool ql_print_raster_image(ql_ctx_t ctx, const ql_status_t *status, const ql_raster_image_t *img, const ql_print_cfg_t *cfg);
+bool ql_print_raster_image(ql_ctx_t ctx, const ql_status_t * status,
+ const ql_raster_image_t * img, const ql_print_cfg_t * cfg);
// Caution: ql_decode_*() are *not* multi-thread safe
-const char *ql_decode_mode(const ql_status_t *status);
-const char *ql_decode_errors(const ql_status_t *status);
-const char *ql_decode_model(const ql_status_t *status);
-const char *ql_decode_media_type(const ql_status_t *status);
+const char *ql_decode_mode(const ql_status_t * status);
+const char *ql_decode_errors(const ql_status_t * status);
+const char *ql_decode_model(const ql_status_t * status);
+const char *ql_decode_media_type(const ql_status_t * status);
#define QL_DECODE_MODEL 0x01
#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, unsigned flags);
#endif