1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-22 20:37:08 +00:00

general: raw_segs -> content_segs, BARCODE_RAW_TEXT ->

`BARCODE_CONTENT_SEGS`, `z_rt_XXX()` -> `z_ct_XXX()`;
  move `encoded_data`/`row_height` to end of `zint_symbol`
  (see ZXing-C++ issue #883)
manual: update re `content_segs`; `my_symbol` -> `symbol`;
  improve MicroPDF417 description
This commit is contained in:
gitlost
2025-11-04 23:02:10 +00:00
parent 543696cb06
commit f0c7248b62
82 changed files with 2203 additions and 2187 deletions

View File

@@ -192,7 +192,7 @@ INTERNAL int zint_mailmark_4s(struct zint_symbol *symbol, unsigned char source[]
int i, j, len;
rs_t rs;
int error_number = 0;
const int raw_text = symbol->output_options & BARCODE_RAW_TEXT;
const int content_segs = symbol->output_options & BARCODE_CONTENT_SEGS;
if (length > 26) {
return z_errtxtf(ZINT_ERROR_TOO_LONG, symbol, 580, "Input length %d too long (maximum 26)", length);
@@ -501,8 +501,8 @@ INTERNAL int zint_mailmark_4s(struct zint_symbol *symbol, unsigned char source[]
symbol->rows = 3;
symbol->width = j - 1;
if (raw_text && z_rt_cpy(symbol, local_source, length)) {
return ZINT_ERROR_MEMORY; /* `z_rt_cpy()` only fails with OOM */
if (content_segs && z_ct_cpy(symbol, local_source, length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
}
return error_number;
@@ -518,7 +518,7 @@ INTERNAL int zint_mailmark_2d(struct zint_symbol *symbol, unsigned char source[]
char postcode[10];
int i;
struct zint_seg segs[1];
const int raw_text = symbol->output_options & BARCODE_RAW_TEXT;
const int content_segs = symbol->output_options & BARCODE_CONTENT_SEGS;
if (length > 90) {
return z_errtxtf(ZINT_ERROR_TOO_LONG, symbol, 589, "Input length %d too long (maximum 90)", length);
@@ -661,13 +661,13 @@ INTERNAL int zint_mailmark_2d(struct zint_symbol *symbol, unsigned char source[]
segs[0].source = local_source;
segs[0].length = length;
if (raw_text) {
if (content_segs) {
if ((symbol->input_mode & 0x07) == DATA_MODE) {
if (z_rt_cpy(symbol, local_source, length)) {
return ZINT_ERROR_MEMORY; /* `z_rt_cpy()` only fails with OOM */
if (z_ct_cpy(symbol, local_source, length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
}
} else if (z_rt_cpy_iso8859_1(symbol, local_source, length)) {
return ZINT_ERROR_MEMORY; /* `z_rt_cpy_iso8859_1()` only fails with OOM */
} else if (z_ct_cpy_iso8859_1(symbol, local_source, length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy_iso8859_1()` only fails with OOM */
}
}