mirror of
https://git.code.sf.net/p/zint/code
synced 2026-06-09 15:13:35 +00:00
Reinstate BARCODE_RAW_TEXT (note forgot to remove mention of
`ZINT_WARN_HRT_RAW_TEXT` in man page zint.1.pmd last time)
This commit is contained in:
@@ -42,10 +42,6 @@ extern "C" {
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define BARCODE_RAW_TEXT 0 /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
#define ZINT_WARN_HRT_RAW_TEXT -1 /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
#define ZINT_ERROR_HRT_RAW_TEXT 16 /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
/* Determine if C89 (excluding MSVC, which doesn't define __STDC_VERSION__) */
|
||||
#ifndef _MSC_VER
|
||||
# if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199000L
|
||||
|
||||
@@ -181,8 +181,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -143,8 +143,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -123,8 +123,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -196,8 +196,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -270,8 +270,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -779,9 +779,6 @@ static void test_hrt_cpy_iso8859_1(const testCtx *const p_ctx) {
|
||||
assert_zero(strcmp((char *) symbol->text, data[i].expected), "i:%d symbol->text (%s) != expected (%s)\n",
|
||||
i, symbol->text, data[i].expected);
|
||||
|
||||
#if 1 /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
(void)expected;
|
||||
#else
|
||||
memset(symbol, 0, sizeof(*symbol));
|
||||
symbol->output_options = BARCODE_RAW_TEXT;
|
||||
|
||||
@@ -800,7 +797,6 @@ static void test_hrt_cpy_iso8859_1(const testCtx *const p_ctx) {
|
||||
assert_equal(symbol->text_length, expected_length, "i:%d text_length %d != expected_length %d\n",
|
||||
i, symbol->text_length, expected_length);
|
||||
assert_zero(memcmp(symbol->text, expected, symbol->text_length), "i:%d symbol->text (%s) != expected (%s)\n", i, symbol->text, expected);
|
||||
#endif
|
||||
}
|
||||
|
||||
testFinish();
|
||||
|
||||
@@ -3290,8 +3290,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -68,8 +68,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -373,8 +373,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -187,8 +187,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -64,8 +64,6 @@ static void test_4s_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -148,8 +148,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -203,8 +203,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -260,8 +260,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -558,8 +558,6 @@ static void test_upcean_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
@@ -3172,8 +3170,6 @@ static void test_hrt_raw_text(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].ret == ZINT_WARN_HRT_RAW_TEXT || !data[i].show_hrt) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -1339,8 +1339,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -130,8 +130,6 @@ static void test_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
@@ -1006,8 +1006,6 @@ static void test_upcean_hrt(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
@@ -3177,8 +3175,6 @@ static void test_hrt_raw_text(const testCtx *const p_ctx) {
|
||||
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
if (data[i].ret == ZINT_WARN_HRT_RAW_TEXT || !data[i].show_hrt) continue; /* BARCODE_RAW_TEXT temporarily disabled */
|
||||
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
|
||||
+6
-1
@@ -123,7 +123,7 @@ extern "C" {
|
||||
int warn_level; /* Affects error/warning value returned by Zint API (see WARN_XXX below) */
|
||||
int debug; /* Debugging flags */
|
||||
unsigned char text[256]; /* Human Readable Text (HRT) (if any), UTF-8, NUL-terminated (output only) */
|
||||
int text_length; /* Length of text in bytes (output only) */
|
||||
int text_length; /* Length of text in bytes, useful if BARCODE_RAW_TEXT when may have NULs (output only) */
|
||||
int rows; /* Number of rows used by the symbol (output only) */
|
||||
int width; /* Width of the generated symbol (output only) */
|
||||
unsigned char encoded_data[200][144]; /* Encoded data (output only). Allows for rows of 1152 modules */
|
||||
@@ -299,6 +299,9 @@ extern "C" {
|
||||
#define EANUPC_GUARD_WHITESPACE 0x04000 /* Add quiet zone indicators ("<"/">") to HRT whitespace (EAN/UPC) */
|
||||
#define EMBED_VECTOR_FONT 0x08000 /* Embed font in vector output - currently only for SVG output */
|
||||
#define BARCODE_MEMORY_FILE 0x10000 /* Write output to in-memory buffer `memfile` instead of to `outfile` */
|
||||
#define BARCODE_RAW_TEXT 0x20000 /* Set HRT with no decoration (GS1 data will not have parentheses but GS
|
||||
separators as needed), complete with any control chars and check chars, and
|
||||
for all linear symbologies, including those that normally don't set it */
|
||||
|
||||
/* Input data types (`symbol->input_mode`) */
|
||||
#define DATA_MODE 0 /* Binary */
|
||||
@@ -326,6 +329,7 @@ extern "C" {
|
||||
#define ULTRA_COMPRESSION 128 /* Enable Ultracode compression (experimental) */
|
||||
|
||||
/* Warning and error conditions (API return values) */
|
||||
#define ZINT_WARN_HRT_RAW_TEXT -1 /* Human Readable Text outputted with BARCODE_RAW_TEXT */
|
||||
#define ZINT_WARN_HRT_TRUNCATED 1 /* Human Readable Text was truncated (max 199 bytes) */
|
||||
#define ZINT_WARN_INVALID_OPTION 2 /* Invalid option given but overridden by Zint */
|
||||
#define ZINT_WARN_USES_ECI 3 /* Automatic ECI inserted by Zint */
|
||||
@@ -342,6 +346,7 @@ extern "C" {
|
||||
#define ZINT_ERROR_USES_ECI 13 /* Error counterpart of warning if WARN_FAIL_ALL set (see below) */
|
||||
#define ZINT_ERROR_NONCOMPLIANT 14 /* Error counterpart of warning if WARN_FAIL_ALL set */
|
||||
#define ZINT_ERROR_HRT_TRUNCATED 15 /* Error counterpart of warning if WARN_FAIL_ALL set */
|
||||
#define ZINT_ERROR_HRT_RAW_TEXT 16 /* Error counterpart of warning if WARN_FAIL_ALL set */
|
||||
|
||||
/* Warning level (`symbol->warn_level`) */
|
||||
#define WARN_DEFAULT 0 /* Default behaviour */
|
||||
|
||||
Reference in New Issue
Block a user