Add text_length (length of text) to zint_symbol, and new

`BARCODE_PLAIN_HRT` option for `output_options` - for use
  primarily by ZXing-C++ but may be generally useful;
  centralize setting of HRT using new common `hrt_cpy_nochk()` etc.
  routines to ensure `text_length` always set
PLESSEY: add show default check characters option
CODE32: ignore `option_2` (check digit options)
PZN: ignore `option_2` (check digit options) except when indicates
  PZN7 only
DPD: exclude DEL from ident tag also
out_maybe_mkdir: fix `utf8_to_wide()` return (Windows only)
general: replace use of `strcpy()` etc. (except for test suite)
  with `memcpy()`, `hrt_()` etc. in lib & `cpy_str()` etc. in CLI
  & `cpy_bytearray_left()` in backend_qt
clang-tidy: update README reflecting above
backend_tcl: use sizeof(primary) to check length; tabs -> spaces
general: various code fiddling
docs: pandoc 3.6.2 -> 3.6.3
This commit is contained in:
gitlost 2025-02-15 20:32:55 +00:00
parent ddedd00d2d
commit fef8b083b4
82 changed files with 2873 additions and 1671 deletions

View file

@ -1,7 +1,7 @@
/* dmatrix_trace.h - Trace routines for DM_COMPRESSION algorithm */
/*
libzint - the open source barcode library
Copyright (C) 2021-2022 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2021-2025 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -33,12 +33,6 @@
#ifndef Z_DMATRIX_TRACE_H
#define Z_DMATRIX_TRACE_H
#ifndef DM_TRACE
#define DM_TRACE_Edges(px, s, l, p, v)
#define DM_TRACE_AddEdge(s, l, es, p, v, e)
#define DM_TRACE_NotAddEdge(s, l, es, p, v, ij, e)
#else
static int DM_TRACE_getPreviousMode(struct dm_edge *edges, struct dm_edge *edge) {
struct dm_edge *previous = DM_PREVIOUS(edges, edge);
return previous == NULL ? DM_ASCII : previous->endMode;
@ -70,8 +64,9 @@ static void DM_TRACE_EdgeToString(char *buf, const unsigned char *source, const
static void DM_TRACE_Path(const unsigned char *source, const int length, struct dm_edge *edges,
struct dm_edge *edge, char *result, const int result_size) {
struct dm_edge *current;
DM_TRACE_EdgeToString(result, source, length, edges, edge);
struct dm_edge *current = DM_PREVIOUS(edges, edge);
current = DM_PREVIOUS(edges, edge);
while (current) {
char s[256];
char *pos;
@ -81,8 +76,7 @@ static void DM_TRACE_Path(const unsigned char *source, const int length, struct
assert(pos);
len = strlen(result);
if ((pos - s) + 1 + len + 1 >= result_size) {
result[result_size - 4] = '\0';
strcat(result, "...");
memcpy(result + result_size - 4, "...", 4); /* Include terminating NUL */
break;
}
memmove(result + (pos - s) + 1, result, len + 1);
@ -150,6 +144,5 @@ static void DM_TRACE_NotAddEdge(const unsigned char *source, const int length, s
}
}
#endif /* DM_TRACE */
/* vim: set ts=4 sw=4 et : */
#endif /* Z_DMATRIX_TRACE_H */