diff --git a/backend/aztec.c b/backend/aztec.c index c9c72236..466c6bfd 100644 --- a/backend/aztec.c +++ b/backend/aztec.c @@ -980,7 +980,7 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], const siz char binary_string[AZTEC_BIN_CAPACITY + 1], bit_pattern[20045], descriptor[42]; char adjusted_string[AZTEC_MAX_CAPACITY + 1]; unsigned char desc_data[4], desc_ecc[6]; - int err_code, ecc_level, compact, data_length, data_maxsize, codeword_size, adjusted_length; + int error_number, ecc_level, compact, data_length, data_maxsize, codeword_size, adjusted_length; int remainder, padbits, count, gs1, adjustment_size; int debug = (symbol->debug & ZINT_DEBUG_PRINT), reader = 0; int comp_loop = 4; @@ -1009,11 +1009,11 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], const siz populate_map(); - err_code = aztec_text_process(source, length, binary_string, gs1, symbol->eci, symbol->debug); + error_number = aztec_text_process(source, length, binary_string, gs1, symbol->eci, debug); - if (err_code != 0) { + if (error_number != 0) { strcpy(symbol->errtxt, "502: Input too long or too many extended ASCII characters"); - return err_code; + return error_number; } if (!((symbol->option_1 >= -1) && (symbol->option_1 <= 4))) { @@ -1021,7 +1021,7 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], const siz if (symbol->warn_level == WARN_FAIL_ALL) { return ZINT_ERROR_INVALID_OPTION; } else { - err_code = ZINT_WARN_INVALID_OPTION; + error_number = ZINT_WARN_INVALID_OPTION; } symbol->option_1 = -1; } @@ -1573,7 +1573,7 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], const siz symbol->width = 151 - (2 * AztecOffset[layers - 1]); } - return err_code; + return error_number; } /* Encodes Aztec runes as specified in ISO/IEC 24778:2008 Annex A */ diff --git a/backend/codablock.c b/backend/codablock.c index 2eef2a70..d45fe7e7 100644 --- a/backend/codablock.c +++ b/backend/codablock.c @@ -629,7 +629,7 @@ static void SumASCII(uchar **ppOutPos, int Sum, int CharacterSet) */ INTERNAL int codablock(struct zint_symbol *symbol,const unsigned char source[], const size_t length) { int charCur, dataLength; - int Error; + int error_number; int rows, columns, useColumns; int fillings; int Sum1,Sum2; @@ -652,14 +652,15 @@ INTERNAL int codablock(struct zint_symbol *symbol,const unsigned char source[], /* option1: rows <= 0: automatic, 1..44 */ rows = symbol->option_1; if (rows == 1) { - Error = code_128(symbol, source, length); - if (Error < 5) { + error_number = code_128(symbol, source, length); /* Only returns errors, not warnings */ + if (error_number < ZINT_ERROR) { symbol->output_options |= BARCODE_BIND; if (symbol->border_width == 0) { /* Allow override if non-zero */ symbol->border_width = 1; /* AIM ISS-X-24 Section 4.6.1 b) (note change from previous default 2) */ } + symbol->text[0] = '\0'; /* Disable HRT for compatibility with CODABLOCKF */ } - return Error; + return error_number; } if (rows > 44) { strcpy(symbol->errtxt, "410: Rows parameter not in 0..44"); @@ -723,14 +724,14 @@ INTERNAL int codablock(struct zint_symbol *symbol,const unsigned char source[], useColumns = columns - 5; if ( rows > 0 ) { /* row count given */ - Error = Rows2Columns(symbol, T, dataLength, &rows, &useColumns, pSet, &fillings); + error_number = Rows2Columns(symbol, T, dataLength, &rows, &useColumns, pSet, &fillings); } else { /* column count given */ - Error = Columns2Rows(symbol, T, dataLength, &rows, &useColumns, pSet, &fillings); + error_number = Columns2Rows(symbol, T, dataLength, &rows, &useColumns, pSet, &fillings); } - if (Error != 0) { + if (error_number != 0) { strcpy(symbol->errtxt, "413: Data string too long"); - return Error; + return error_number; } /* Suppresses clang-analyzer-core.VLASize warning */ assert(rows >= 2 && useColumns >= 4); @@ -984,5 +985,5 @@ INTERNAL int codablock(struct zint_symbol *symbol,const unsigned char source[], symbol->border_width = 1; /* AIM ISS-X-24 Section 4.6.1 b) (note change from previous default 2) */ } - return 0; + return error_number; } diff --git a/backend/code16k.c b/backend/code16k.c index c7394c5d..a0e4ff04 100644 --- a/backend/code16k.c +++ b/backend/code16k.c @@ -109,7 +109,7 @@ static void c16k_set_c(const unsigned char source_a, unsigned char source_b, int INTERNAL int code16k(struct zint_symbol *symbol, unsigned char source[], const size_t length) { char width_pattern[100]; - int current_row, rows_needed, looper, first_check, second_check; + int current_row, rows, looper, first_check, second_check; int indexchaine; int list[2][C128_MAX] = {{0}}; char set[C128_MAX] = {0}, fset[C128_MAX], mode, last_set, current_set; @@ -117,14 +117,14 @@ INTERNAL int code16k(struct zint_symbol *symbol, unsigned char source[], const s int values[C128_MAX] = {0}; int bar_characters; float glyph_count; - int errornum, first_sum, second_sum; + int error_number, first_sum, second_sum; int input_length; int gs1, c_count; /* Suppresses clang-analyzer-core.UndefinedBinaryOperatorResult warning on fset which is fully set */ assert(length > 0); - errornum = 0; + error_number = 0; strcpy(width_pattern, ""); input_length = length; @@ -287,13 +287,13 @@ INTERNAL int code16k(struct zint_symbol *symbol, unsigned char source[], const s /* Calculate how tall the symbol will be */ glyph_count = glyph_count + 2.0; i = (int)glyph_count; - rows_needed = (i / 5); + rows = (i / 5); if (i % 5 > 0) { - rows_needed++; + rows++; } - if (rows_needed == 1) { - rows_needed = 2; + if (rows == 1) { + rows = 2; } /* start with the mode character - Table 2 */ @@ -319,7 +319,7 @@ INTERNAL int code16k(struct zint_symbol *symbol, unsigned char source[], const s m = 6; } } - values[bar_characters] = (7 * (rows_needed - 2)) + m; /* see 4.3.4.2 */ + values[bar_characters] = (7 * (rows - 2)) + m; /* see 4.3.4.2 */ values[bar_characters + 1] = 96; /* FNC3 */ bar_characters += 2; } else { @@ -339,7 +339,7 @@ INTERNAL int code16k(struct zint_symbol *symbol, unsigned char source[], const s m = 6; } } - values[bar_characters] = (7 * (rows_needed - 2)) + m; /* see 4.3.4.2 */ + values[bar_characters] = (7 * (rows - 2)) + m; /* see 4.3.4.2 */ bar_characters++; } @@ -457,7 +457,7 @@ INTERNAL int code16k(struct zint_symbol *symbol, unsigned char source[], const s } #endif - for (current_row = 0; current_row < rows_needed; current_row++) { + for (current_row = 0; current_row < rows; current_row++) { int writer; int flip_flop; int len; @@ -491,7 +491,7 @@ INTERNAL int code16k(struct zint_symbol *symbol, unsigned char source[], const s symbol->row_height[current_row] = 10; } - symbol->rows = rows_needed; + symbol->rows = rows; symbol->width = 70; symbol->output_options |= BARCODE_BIND; @@ -500,5 +500,5 @@ INTERNAL int code16k(struct zint_symbol *symbol, unsigned char source[], const s symbol->border_width = 1; /* BS EN 12323:2005 Section 4.3.7 minimum (note change from previous default 2) */ } - return errornum; + return error_number; } diff --git a/backend/common.c b/backend/common.c index 3690d83b..533bd028 100644 --- a/backend/common.c +++ b/backend/common.c @@ -135,7 +135,7 @@ INTERNAL int posn(const char set_string[], const char data) { return -1; } -/* Return true (1) if a module is dark/black/colour, otherwise false (0) */ +/* Return true (1-8) if a module is dark/black/colour, otherwise false (0) */ INTERNAL int module_is_set(const struct zint_symbol *symbol, const int y_coord, const int x_coord) { if (symbol->symbology == BARCODE_ULTRA) { return symbol->encoded_data[y_coord][x_coord]; @@ -154,7 +154,7 @@ INTERNAL void set_module_colour(struct zint_symbol *symbol, const int y_coord, c symbol->encoded_data[y_coord][x_coord] = colour; } -/* Set (or unset) a module to white */ +/* Set a dark/black module to white (i.e. unset) */ INTERNAL void unset_module(struct zint_symbol *symbol, const int y_coord, const int x_coord) { symbol->encoded_data[y_coord][x_coord / 8] &= ~(1 << (x_coord % 8)); } @@ -193,10 +193,9 @@ INTERNAL void expand(struct zint_symbol *symbol, const char data[]) { symbol->rows = symbol->rows + 1; } -/* Indicates which symbologies can have row binding - * Note: if change this must also change version in frontend/main.c */ +/* Indicates which symbologies can have row binding */ INTERNAL int is_stackable(const int symbology) { - if (symbology < BARCODE_PDF417) { + if (symbology < BARCODE_PHARMA_TWO && symbology != BARCODE_POSTNET) { return 1; } @@ -218,8 +217,7 @@ INTERNAL int is_stackable(const int symbology) { return 0; } -/* Indicates which symbols can have addon (EAN-2 and EAN-5) - * Note: if change this must also change version in frontend/main.c */ +/* Indicates which symbols can have addon (EAN-2 and EAN-5) */ INTERNAL int is_extendable(const int symbology) { switch (symbology) { diff --git a/backend/common.h b/backend/common.h index 2ad54d9e..52b59cdf 100644 --- a/backend/common.h +++ b/backend/common.h @@ -89,7 +89,8 @@ extern "C" { INTERNAL int is_composite(const int symbology); INTERNAL int istwodigits(const unsigned char source[], const int length, const int position); INTERNAL unsigned int decode_utf8(unsigned int *state, unsigned int *codep, const unsigned char byte); - INTERNAL int utf8_to_unicode(struct zint_symbol *symbol, const unsigned char source[], unsigned int vals[], size_t *length, int disallow_4byte); + INTERNAL int utf8_to_unicode(struct zint_symbol *symbol, const unsigned char source[], unsigned int vals[], + size_t *length, int disallow_4byte); INTERNAL void set_minimum_height(struct zint_symbol *symbol, const int min_height); typedef unsigned int *(*pn_head_costs)(unsigned int state[]); diff --git a/backend/composite.c b/backend/composite.c index 682a5338..d41619cf 100644 --- a/backend/composite.c +++ b/backend/composite.c @@ -1349,7 +1349,7 @@ static int cc_binary_string(struct zint_symbol *symbol, const char source[], cha return 0; } -static int linear_dummy_run(unsigned char *source, int length) { +static int linear_dummy_run(unsigned char *source, int length, char *errtxt) { struct zint_symbol *dummy; int error_number; int linear_width; @@ -1359,6 +1359,9 @@ static int linear_dummy_run(unsigned char *source, int length) { dummy->option_1 = 3; error_number = ean_128(dummy, source, length); linear_width = dummy->width; + if (error_number != 0) { + strcpy(errtxt, dummy->errtxt); + } ZBarcode_Delete(dummy); if (error_number == 0) { @@ -1404,9 +1407,9 @@ INTERNAL int composite(struct zint_symbol *symbol, unsigned char source[], int l if (symbol->symbology == BARCODE_GS1_128_CC) { /* Do a test run of encoding the linear component to establish its width */ - linear_width = linear_dummy_run((unsigned char *) symbol->primary, pri_len); + linear_width = linear_dummy_run((unsigned char *) symbol->primary, pri_len, symbol->errtxt); if (linear_width == 0) { - strcpy(symbol->errtxt, "448: Invalid data"); + strcat(symbol->errtxt, " in linear component"); return ZINT_ERROR_INVALID_DATA; } if (symbol->debug & ZINT_DEBUG_PRINT) { @@ -1557,7 +1560,7 @@ INTERNAL int composite(struct zint_symbol *symbol, unsigned char source[], int l if (error_number != 0) { strcpy(symbol->errtxt, linear->errtxt); - strcat(symbol->errtxt, " in linear component "); + strcat(symbol->errtxt, " in linear component"); ZBarcode_Delete(linear); return error_number; } diff --git a/backend/dmatrix.c b/backend/dmatrix.c index 2fe14a65..639d6d21 100644 --- a/backend/dmatrix.c +++ b/backend/dmatrix.c @@ -55,7 +55,7 @@ #include "reedsol.h" #include "dmatrix.h" -/* Annex M placement alorithm low level */ +/* Annex M placement algorithm low level */ static void ecc200placementbit(int *array, const int NR, const int NC, int r, int c, const int p, const char b) { if (r < 0) { r += NR; diff --git a/backend/eci.c b/backend/eci.c index 42277904..d07ae347 100644 --- a/backend/eci.c +++ b/backend/eci.c @@ -45,8 +45,8 @@ INTERNAL int utf_to_eci(const int eci, const unsigned char source[], unsigned ch int ext; int done; - if (eci == 26) { - /* Unicode mode, do not process - just copy data across */ + if (eci == 26 || eci == 899) { + /* Unicode or 8-bit binary data, do not process - just copy data across */ memcpy(dest, source, *length); dest[*length] = '\0'; return 0; diff --git a/backend/emf.c b/backend/emf.c index 4d068700..d66640f1 100644 --- a/backend/emf.c +++ b/backend/emf.c @@ -81,12 +81,28 @@ static int count_hexagons(struct zint_symbol *symbol) { return hexagons; } -static int count_strings(struct zint_symbol *symbol) { +static int count_strings(struct zint_symbol *symbol, int *fsize, int *fsize2, int *halign, int *halign1, int *halign2) { int strings = 0; struct zint_vector_string *str; + *fsize = *fsize2 = *halign = *halign1 = *halign2 = 0; + str = symbol->vector->strings; while (str) { + /* Allow 2 font sizes */ + if (*fsize == 0) { + *fsize = (int) str->fsize; + } else if (str->fsize != *fsize && *fsize2 == 0) { + *fsize2 = (int) str->fsize; + } + /* Only 3 haligns possible */ + if (str->halign) { + if (str->halign == 1) { + *halign1 = str->halign; + } else { + *halign2 = str->halign; + } + } strings++; str = str->next; } @@ -126,8 +142,22 @@ static int bump_up(int input) { return input; } -INTERNAL int emf_plot(struct zint_symbol *symbol) { - int i,j; +static int utfle_length(unsigned char *input, int length) { + int result = 0; + int i; + + for (i = 0; i < length; i++) { + result++; + if (input[i] >= 0x80) { /* 2 byte UTF-8 counts as one UTF-16LE character */ + i++; + } + } + + return result; +} + +INTERNAL int emf_plot(struct zint_symbol *symbol, int rotate_angle) { + int i; FILE *emf_file; int fgred, fggrn, fgblu, bgred, bggrn, bgblu; int error_number = 0; @@ -140,8 +170,11 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) { int colours_used = 0; int rectangle_count_bycolour[9]; unsigned char *this_string[6]; - uint32_t spacing; + int width, height; + int utfle_len; + int bumped_len; int draw_background = 1; + int bold; float ax, ay, bx, by, cx, cy, dx, dy, ex, ey, fx, fy; @@ -152,6 +185,8 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) { emr_header_t emr_header; emr_eof_t emr_eof; + emr_mapmode_t emr_mapmode; + emr_setworldtransform_t emr_setworldtransform; emr_createbrushindirect_t emr_createbrushindirect_fg; emr_createbrushindirect_t emr_createbrushindirect_bg; emr_createbrushindirect_t emr_createbrushindirect_colour[8]; // Used for colour symbols only @@ -161,17 +196,31 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) { emr_createpen_t emr_createpen; emr_selectobject_t emr_selectobject_pen; emr_rectangle_t background; - emr_extcreatefontindirectw_t emr_extcreatefontindirectw; emr_settextcolor_t emr_settextcolor; + + int fsize; + emr_extcreatefontindirectw_t emr_extcreatefontindirectw; emr_selectobject_t emr_selectobject_font; - //emr_extcreatefontindirectw_t emr_extcreatefontindirectw_big; - //emr_selectobject_t emr_selectobject_font_big; + int fsize2; + emr_extcreatefontindirectw_t emr_extcreatefontindirectw2; + emr_selectobject_t emr_selectobject_font2; + int halign; + emr_settextalign_t emr_settextalign; + int halign1; + emr_settextalign_t emr_settextalign1; + int halign2; + emr_settextalign_t emr_settextalign2; + + int current_fsize; + int current_halign; #ifdef _MSC_VER emr_rectangle_t *rectangle; emr_ellipse_t *circle; emr_polygon_t *hexagon; emr_exttextoutw_t *text; + int *text_fsizes; + int *text_haligns; #endif fgred = (16 * ctoi(symbol->fgcolour[0])) + ctoi(symbol->fgcolour[1]); @@ -190,18 +239,22 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) { rectangle_count = count_rectangles(symbol); circle_count = count_circles(symbol); hexagon_count = count_hexagons(symbol); - string_count = count_strings(symbol); + string_count = count_strings(symbol, &fsize, &fsize2, &halign, &halign1, &halign2); #ifndef _MSC_VER emr_rectangle_t rectangle[rectangle_count ? rectangle_count : 1]; // Avoid sanitize runtime error by making always non-zero emr_ellipse_t circle[circle_count ? circle_count : 1]; emr_polygon_t hexagon[hexagon_count ? hexagon_count : 1]; emr_exttextoutw_t text[string_count ? string_count: 1]; + int text_fsizes[string_count ? string_count: 1]; + int text_haligns[string_count ? string_count: 1]; #else rectangle = (emr_rectangle_t*) _alloca(rectangle_count * sizeof (emr_rectangle_t)); circle = (emr_ellipse_t*) _alloca(circle_count * sizeof (emr_ellipse_t)); hexagon = (emr_polygon_t*) _alloca(hexagon_count * sizeof (emr_polygon_t)); text = (emr_exttextoutw_t*) _alloca(string_count * sizeof (emr_exttextoutw_t)); + text_fsizes = (int *) _alloca(string_count * sizeof (int)); + text_haligns = (int *) _alloca(string_count * sizeof (int)); #endif //Calculate how many coloured rectangles @@ -220,12 +273,15 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) { } } + width = ceil(symbol->vector->width); + height = ceil(symbol->vector->height); + /* Header */ emr_header.type = 0x00000001; // EMR_HEADER emr_header.size = 108; // Including extensions emr_header.emf_header.bounds.left = 0; - emr_header.emf_header.bounds.right = ceil(symbol->vector->width); - emr_header.emf_header.bounds.bottom = ceil(symbol->vector->height); + emr_header.emf_header.bounds.right = rotate_angle == 90 || rotate_angle == 270 ? height : width; + emr_header.emf_header.bounds.bottom = rotate_angle == 90 || rotate_angle == 270 ? width : height; emr_header.emf_header.bounds.top = 0; emr_header.emf_header.frame.left = 0; emr_header.emf_header.frame.right = emr_header.emf_header.bounds.right * 30; @@ -236,7 +292,7 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) { if (symbol->symbology == BARCODE_ULTRA) { emr_header.emf_header.handles = 11; // Number of graphics objects } else { - emr_header.emf_header.handles = 4; + emr_header.emf_header.handles = fsize2 ? 5 : 4; } emr_header.emf_header.reserved = 0x0000; emr_header.emf_header.n_description = 0; @@ -256,6 +312,25 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) { bytecount = 108; recordcount = 1; + emr_mapmode.type = 0x00000011; // EMR_SETMAPMODE + emr_mapmode.size = 12; + emr_mapmode.mapmode = 0x01; // MM_TEXT + bytecount += 12; + recordcount++; + + if (rotate_angle) { + emr_setworldtransform.type = 0x00000023; // EMR_SETWORLDTRANSFORM + emr_setworldtransform.size = 32; + emr_setworldtransform.m11 = rotate_angle == 90 ? 0.0f : rotate_angle == 180 ? -1.0f : 0.0f; + emr_setworldtransform.m12 = rotate_angle == 90 ? 1.0f : rotate_angle == 180 ? 0.0f : -1.0f; + emr_setworldtransform.m21 = rotate_angle == 90 ? -1.0f : rotate_angle == 180 ? 0.0f : 1.0f; + emr_setworldtransform.m22 = rotate_angle == 90 ? 0.0f : rotate_angle == 180 ? -1.0f : 0.0f; + emr_setworldtransform.dx = rotate_angle == 90 ? height : rotate_angle == 180 ? width : 0.0f; + emr_setworldtransform.dy = rotate_angle == 90 ? 0.0f : rotate_angle == 180 ? height : width; + bytecount += 32; + recordcount++; + } + /* Create Brushes */ emr_createbrushindirect_bg.type = 0x00000027; // EMR_CREATEBRUSHINDIRECT emr_createbrushindirect_bg.size = 24; @@ -444,37 +519,60 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) { hex = hex->next; } - /* Create font records */ + /* Create font records, alignment records and text color */ if (symbol->vector->strings) { + bold = (symbol->output_options & BOLD_TEXT) && (!is_extendable(symbol->symbology) || (symbol->output_options & SMALL_TEXT)); + memset(&emr_extcreatefontindirectw, 0, sizeof(emr_extcreatefontindirectw)); emr_extcreatefontindirectw.type = 0x00000052; // EMR_EXTCREATEFONTINDIRECTW emr_extcreatefontindirectw.size = 104; - emr_extcreatefontindirectw.ih_fonts = 4; - emr_extcreatefontindirectw.elw.height = 16 * symbol->scale; + emr_extcreatefontindirectw.ih_fonts = 11; + emr_extcreatefontindirectw.elw.height = fsize; emr_extcreatefontindirectw.elw.width = 0; // automatic - emr_extcreatefontindirectw.elw.escapement = 0; - emr_extcreatefontindirectw.elw.orientation = 0; - emr_extcreatefontindirectw.elw.weight = 400; - emr_extcreatefontindirectw.elw.italic = 0x00; - emr_extcreatefontindirectw.elw.underline = 0x00; - emr_extcreatefontindirectw.elw.strike_out = 0x00; - emr_extcreatefontindirectw.elw.char_set = 0x01; + emr_extcreatefontindirectw.elw.weight = bold ? 700 : 400; + emr_extcreatefontindirectw.elw.char_set = 0x00; // ANSI_CHARSET emr_extcreatefontindirectw.elw.out_precision = 0x00; // OUT_DEFAULT_PRECIS emr_extcreatefontindirectw.elw.clip_precision = 0x00; // CLIP_DEFAULT_PRECIS - emr_extcreatefontindirectw.elw.quality = 0x00; - emr_extcreatefontindirectw.elw.pitch_and_family = 0x00; - for (i = 0; i < 64; i++) { - emr_extcreatefontindirectw.elw.facename[i] = '\0'; - } + emr_extcreatefontindirectw.elw.pitch_and_family = 0x02 | (0x02 << 6); // FF_SWISS | VARIABLE_PITCH utfle_copy(emr_extcreatefontindirectw.elw.facename, (unsigned char*) "sans-serif", 10); bytecount += 104; recordcount++; - + emr_selectobject_font.type = 0x00000025; // EMR_SELECTOBJECT emr_selectobject_font.size = 12; - emr_selectobject_font.ih_object = 4; + emr_selectobject_font.ih_object = 11; bytecount += 12; recordcount++; - + + if (fsize2) { + memcpy(&emr_extcreatefontindirectw2, &emr_extcreatefontindirectw, sizeof(emr_extcreatefontindirectw)); + emr_extcreatefontindirectw2.ih_fonts = 12; + emr_extcreatefontindirectw2.elw.height = fsize2; + bytecount += 104; + recordcount++; + + emr_selectobject_font2.type = 0x00000025; // EMR_SELECTOBJECT + emr_selectobject_font2.size = 12; + emr_selectobject_font2.ih_object = 12; + bytecount += 12; + recordcount++; + } + + /* Note select aligns counted below in strings loop */ + + emr_settextalign.type = 0x00000016; // EMR_SETTEXTALIGN + emr_settextalign.size = 12; + emr_settextalign.text_alignment_mode = 0x0006 | 0x0018; // TA_CENTER | TA_BASELINE + if (halign1) { + emr_settextalign1.type = 0x00000016; // EMR_SETTEXTALIGN + emr_settextalign1.size = 12; + emr_settextalign1.text_alignment_mode = 0x0000 | 0x0018; // TA_LEFT | TA_BASELINE + } + if (halign2) { + emr_settextalign2.type = 0x00000016; // EMR_SETTEXTALIGN + emr_settextalign2.size = 12; + emr_settextalign2.text_alignment_mode = 0x0002 | 0x0018; // TA_RIGHT | TA_BASELINE + } + emr_settextcolor.type = 0x0000018; // EMR_SETTEXTCOLOR emr_settextcolor.size = 12; emr_settextcolor.color.red = fgred; @@ -486,38 +584,57 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) { } //Text - str = symbol->vector->strings; this_text = 0; - while (str) { - this_string[this_text] = (unsigned char *) malloc(bump_up(str->length + 1) * 2); - text[this_text].type = 0x00000054; // EMR_EXTTEXTOUTW - text[this_text].size = 76 + (6 * bump_up(str->length + 1)); - text[this_text].bounds.top = 0; // ignored - text[this_text].bounds.left = 0; // ignored - text[this_text].bounds.right = 0xffffffff; // ignored - text[this_text].bounds.bottom = 0xffffffff; // ignored - text[this_text].i_graphics_mode = 0x00000001; // GM_COMPATIBLE - text[this_text].ex_scale = 1.0; - text[this_text].ey_scale = 1.0; - text[this_text].w_emr_text.reference.x = str->x - (4 * str->length * symbol->scale); // text left - text[this_text].w_emr_text.reference.y = str->y - (16 * symbol->scale); // text top - text[this_text].w_emr_text.chars = str->length; - text[this_text].w_emr_text.off_string = 76; - text[this_text].w_emr_text.options = 0; - text[this_text].w_emr_text.rectangle.top = 0; - text[this_text].w_emr_text.rectangle.left = 0; - text[this_text].w_emr_text.rectangle.right = 0xffffffff; - text[this_text].w_emr_text.rectangle.bottom = 0xffffffff; - text[this_text].w_emr_text.off_dx = 76 + (2 * bump_up(str->length + 1)); - for (i = 0; i < bump_up(str->length + 1) * 2; i++) { - this_string[this_text][i] = '\0'; - } - utfle_copy(this_string[this_text], str->text, str->length); - bytecount += 76 + (6 * bump_up(str->length + 1)); - recordcount++; + // Loop over font sizes so that they're grouped together, so only have to select font twice at most + for (current_fsize = fsize; current_fsize; current_fsize = fsize2) { + str = symbol->vector->strings; + current_halign = -1; + while (str) { + if (str->fsize != current_fsize) { + str = str->next; + continue; + } + text_fsizes[this_text] = str->fsize; + text_haligns[this_text] = str->halign; + if (text_haligns[this_text] != current_halign) { + current_halign = text_haligns[this_text]; + bytecount += 12; + recordcount++; + } + assert(str->length > 0); + utfle_len = utfle_length(str->text, str->length); + bumped_len = bump_up(utfle_len) * 2; + this_string[this_text] = (unsigned char *) malloc(bumped_len); + memset(this_string[this_text], 0, bumped_len); + text[this_text].type = 0x00000054; // EMR_EXTTEXTOUTW + text[this_text].size = 76 + bumped_len; + text[this_text].bounds.top = 0; // ignored + text[this_text].bounds.left = 0; // ignored + text[this_text].bounds.right = 0xffffffff; // ignored + text[this_text].bounds.bottom = 0xffffffff; // ignored + text[this_text].i_graphics_mode = 0x00000002; // GM_ADVANCED + text[this_text].ex_scale = 1.0f; + text[this_text].ey_scale = 1.0f; + text[this_text].w_emr_text.reference.x = str->x; + text[this_text].w_emr_text.reference.y = str->y; + text[this_text].w_emr_text.chars = utfle_len; + text[this_text].w_emr_text.off_string = 76; + text[this_text].w_emr_text.options = 0; + text[this_text].w_emr_text.rectangle.top = 0; + text[this_text].w_emr_text.rectangle.left = 0; + text[this_text].w_emr_text.rectangle.right = 0xffffffff; + text[this_text].w_emr_text.rectangle.bottom = 0xffffffff; + text[this_text].w_emr_text.off_dx = 0; + utfle_copy(this_string[this_text], str->text, str->length); + bytecount += 76 + bumped_len; + recordcount++; - this_text++; - str = str->next; + this_text++; + str = str->next; + } + if (current_fsize == fsize2) { + break; + } } /* Create EOF record */ @@ -551,6 +668,12 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) { fwrite(&emr_header, sizeof (emr_header_t), 1, emf_file); + fwrite(&emr_mapmode, sizeof (emr_mapmode_t), 1, emf_file); + + if (rotate_angle) { + fwrite(&emr_setworldtransform, sizeof (emr_setworldtransform_t), 1, emf_file); + } + fwrite(&emr_createbrushindirect_bg, sizeof (emr_createbrushindirect_t), 1, emf_file); if (symbol->symbology == BARCODE_ULTRA) { @@ -567,6 +690,9 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) { if (symbol->vector->strings) { fwrite(&emr_extcreatefontindirectw, sizeof (emr_extcreatefontindirectw_t), 1, emf_file); + if (fsize2) { + fwrite(&emr_extcreatefontindirectw2, sizeof (emr_extcreatefontindirectw_t), 1, emf_file); + } } fwrite(&emr_selectobject_bgbrush, sizeof (emr_selectobject_t), 1, emf_file); @@ -633,14 +759,26 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) { /* Suppresses clang-tidy clang-analyzer-core.UndefinedBinaryOperatorResult warning */ assert((symbol->vector->strings == NULL && string_count == 0) || (symbol->vector->strings != NULL && string_count > 0)); + current_fsize = fsize; + current_halign = -1; for (i = 0; i < string_count; i++) { - spacing = 8 * symbol->scale; - fwrite(&text[i], sizeof (emr_exttextoutw_t), 1, emf_file); - fwrite(this_string[i], bump_up(text[i].w_emr_text.chars + 1) * 2, 1, emf_file); - free(this_string[i]); - for (j = 0; j < bump_up(text[i].w_emr_text.chars + 1); j++) { - fwrite(&spacing, 4, 1, emf_file); + if (text_fsizes[i] != current_fsize) { + current_fsize = text_fsizes[i]; + fwrite(&emr_selectobject_font2, sizeof (emr_selectobject_t), 1, emf_file); } + if (text_haligns[i] != current_halign) { + current_halign = text_haligns[i]; + if (current_halign == 0) { + fwrite(&emr_settextalign, sizeof (emr_settextalign_t), 1, emf_file); + } else if (current_halign == 1) { + fwrite(&emr_settextalign1, sizeof (emr_settextalign_t), 1, emf_file); + } else { + fwrite(&emr_settextalign2, sizeof (emr_settextalign_t), 1, emf_file); + } + } + fwrite(&text[i], sizeof (emr_exttextoutw_t), 1, emf_file); + fwrite(this_string[i], bump_up(text[i].w_emr_text.chars) * 2, 1, emf_file); + free(this_string[i]); } fwrite(&emr_eof, sizeof (emr_eof_t), 1, emf_file); diff --git a/backend/emf.h b/backend/emf.h index 4182e187..cef437a5 100644 --- a/backend/emf.h +++ b/backend/emf.h @@ -135,6 +135,23 @@ extern "C" { emf_header_t emf_header; } emr_header_t; + typedef struct emr_mapmode { + uint32_t type; + uint32_t size; + uint32_t mapmode; + } emr_mapmode_t; + + typedef struct emr_setworldtransform { + uint32_t type; + uint32_t size; + float m11; + float m12; + float m21; + float m22; + float dx; + float dy; + } emr_setworldtransform_t; + typedef struct emr_createbrushindirect { uint32_t type; uint32_t size; @@ -187,6 +204,12 @@ extern "C" { log_font_t elw; } emr_extcreatefontindirectw_t; + typedef struct emr_settextalign { + uint32_t type; + uint32_t size; + uint32_t text_alignment_mode; + } emr_settextalign_t; + typedef struct emr_settextcolor { uint32_t type; uint32_t size; diff --git a/backend/font.h b/backend/font.h index 2ae76c3a..d4c3ced9 100644 --- a/backend/font.h +++ b/backend/font.h @@ -132,7 +132,6 @@ static font_item ascii_font[] = { 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, /* | */ 0, 48, 8, 8, 8, 8, 8, 4, 8, 8, 8, 8, 8, 48, /* } */ 0, 32, 82, 74, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ~ */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*  */ 0, 0, 8, 8, 0, 8, 8, 8, 8, 8, 8, 8, 0, 0, /* ¡ */ 0, 0, 0, 0, 16, 60, 82, 80, 80, 80, 82, 60, 16, 0, /* ¢ */ 0, 0, 0, 12, 18, 16, 16, 60, 16, 16, 60, 18, 0, 0, /* £ */ @@ -329,7 +328,6 @@ static font_item small_font[] = { 0, 2, 2, 2, 2, 2, 2, 0, 0, /* | */ 0, 4, 2, 3, 2, 2, 4, 0, 0, /* } */ 0, 5, 10, 0, 0, 0, 0, 0, 0, /* ~ */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, /*  */ 0, 2, 0, 2, 2, 2, 2, 0, 0, /* ¡ */ 0, 0, 2, 7, 10, 10, 7, 2, 0, /* ¢ */ 0, 0, 3, 4, 14, 4, 11, 0, 0, /* £ */ diff --git a/backend/gridmtx.c b/backend/gridmtx.c index a7642856..bfb04bef 100644 --- a/backend/gridmtx.c +++ b/backend/gridmtx.c @@ -221,7 +221,7 @@ static void gm_cur_cost(unsigned int state[], const unsigned int gbdata[], const /* Calculate optimized encoding modes */ static void define_mode(char* mode, const unsigned int gbdata[], const size_t length, const int debug) { - static const char mode_types[] = { GM_CHINESE, GM_NUMBER, GM_LOWER, GM_UPPER, GM_MIXED, GM_BYTE }; /* Must be in same order as GM_H etc */ + static const char mode_types[] = { GM_CHINESE, GM_NUMBER, GM_LOWER, GM_UPPER, GM_MIXED, GM_BYTE, '\0' }; /* Must be in same order as GM_H etc */ unsigned int state[3] = { 0 /*numeral_end*/, 0 /*numeral_cost*/, 0 /*byte_count*/ }; pn_define_mode(mode, gbdata, length, debug, state, mode_types, GM_NUM_MODES, gm_head_costs, gm_switch_cost, gm_eod_cost, gm_cur_cost); diff --git a/backend/hanxin.c b/backend/hanxin.c index 15dff6bf..25db2743 100644 --- a/backend/hanxin.c +++ b/backend/hanxin.c @@ -438,7 +438,7 @@ static void hx_cur_cost(unsigned int state[], const unsigned int gbdata[], const /* Calculate optimized encoding modes */ static void hx_define_mode(char* mode, const unsigned int gbdata[], const size_t length, const int debug) { - static const char mode_types[] = { 'n', 't', 'b', '1', '2', 'd', 'f' }; /* Must be in same order as HX_N etc */ + static const char mode_types[] = { 'n', 't', 'b', '1', '2', 'd', 'f', '\0' }; /* Must be in same order as HX_N etc */ unsigned int state[5] = { 0 /*numeric_end*/, 0 /*numeric_cost*/, 1 /*text_submode*/, 0 /*fourbyte_end*/, 0 /*fourbyte_cost*/ }; pn_define_mode(mode, gbdata, length, debug, state, mode_types, HX_NUM_MODES, hx_head_costs, hx_switch_cost, hx_eod_cost, hx_cur_cost); diff --git a/backend/library.c b/backend/library.c index 86f75ade..62513921 100644 --- a/backend/library.c +++ b/backend/library.c @@ -59,7 +59,7 @@ struct zint_symbol *ZBarcode_Create() { strcpy(symbol->bgcolour, "ffffff"); symbol->bgcolor = &symbol->bgcolour[0]; strcpy(symbol->outfile, "out.png"); - symbol->scale = 1.0; + symbol->scale = 1.0f; symbol->option_1 = -1; symbol->option_2 = 0; symbol->option_3 = 0; @@ -71,7 +71,7 @@ struct zint_symbol *ZBarcode_Create() { symbol->bitmap_height = 0; symbol->alphamap = NULL; symbol->eci = 0; // Default 0 uses ECI 3 - symbol->dot_size = 4.0 / 5.0; + symbol->dot_size = 4.0f / 5.0f; symbol->vector = NULL; symbol->debug = 0; symbol->warn_level = WARN_DEFAULT; @@ -83,6 +83,8 @@ INTERNAL void vector_free(struct zint_symbol *symbol); /* Free vector structures void ZBarcode_Clear(struct zint_symbol *symbol) { int i, j; + if (!symbol) return; + for (i = 0; i < symbol->rows; i++) { for (j = 0; j < symbol->width; j++) { unset_module(symbol, i, j); @@ -108,6 +110,8 @@ void ZBarcode_Clear(struct zint_symbol *symbol) { } void ZBarcode_Delete(struct zint_symbol *symbol) { + if (!symbol) return; + if (symbol->bitmap != NULL) free(symbol->bitmap); if (symbol->alphamap != NULL) @@ -196,7 +200,7 @@ static void error_tag(char error_string[], int error_number) { char error_buffer[100]; strcpy(error_buffer, error_string); - if (error_number > 4) { + if (error_number >= ZINT_ERROR) { strcpy(error_string, "Error "); } else { strcpy(error_string, "Warning "); @@ -426,12 +430,13 @@ static int gs1_compliant(const int symbology) { return result; } -static int is_matrix(const int symbology) { - /* Returns 1 if symbology is a matrix design */ +static int is_dotty(const int symbology) { + /* Returns 1 if symbology is a matrix design renderable as dots */ int result = 0; switch (symbology) { + /* Note MAXICODE and ULTRA absent */ case BARCODE_QRCODE: case BARCODE_DATAMATRIX: case BARCODE_MICROQR: @@ -453,6 +458,25 @@ static int is_matrix(const int symbology) { return result; } +static int is_fixed_ratio(const int symbology) { + /* Returns 1 if symbology has fixed aspect ratio (matrix design) */ + + int result = 0; + + if (is_dotty(symbology)) { + return 1; + } + + switch (symbology) { + case BARCODE_MAXICODE: + case BARCODE_ULTRA: + result = 1; + break; + } + + return result; +} + static int is_linear(const int symbology) { /* Returns 1 if symbology is linear (1 dimensional) */ @@ -541,6 +565,119 @@ static int supports_eci(const int symbology) { return result; } +static int has_hrt(const int symbology) { + /* Returns 1 if symbology supports HRT */ + + if (is_fixed_ratio(symbology)) { + return 0; + } + + switch (symbology) { /* These don't support HRT */ + case BARCODE_CODE16K: + case BARCODE_CODE49: + case BARCODE_FLAT: + case BARCODE_POSTNET: + case BARCODE_FIM: + case BARCODE_PHARMA: + case BARCODE_PHARMA_TWO: + case BARCODE_PDF417: + case BARCODE_PDF417COMP: + case BARCODE_AUSPOST: + case BARCODE_AUSREPLY: + case BARCODE_AUSROUTE: + case BARCODE_AUSREDIRECT: + case BARCODE_RM4SCC: + case BARCODE_CODABLOCKF: + case BARCODE_JAPANPOST: + case BARCODE_DBAR_STK: + case BARCODE_DBAR_OMNSTK: + case BARCODE_DBAR_EXPSTK: + case BARCODE_PLANET: + case BARCODE_MICROPDF417: + case BARCODE_USPS_IMAIL: + case BARCODE_KIX: + case BARCODE_DAFT: + case BARCODE_HIBC_PDF: + case BARCODE_HIBC_MICPDF: + case BARCODE_HIBC_BLOCKF: + case BARCODE_MAILMARK: + case BARCODE_DBAR_STK_CC: + case BARCODE_DBAR_OMNSTK_CC: + case BARCODE_DBAR_EXPSTK_CC: + return 0; + break; + } + + return 1; +} + +unsigned int ZBarcode_Cap(int symbol_id, unsigned int cap_flag) { + unsigned int result = 0; + + if (!ZBarcode_ValidID(symbol_id)) { + return 0; + } + + if ((cap_flag & ZINT_CAP_HRT) && has_hrt(symbol_id)) { + result |= ZINT_CAP_HRT; + } + if ((cap_flag & ZINT_CAP_STACKABLE) && is_stackable(symbol_id)) { + result |= ZINT_CAP_STACKABLE; + } + if ((cap_flag & ZINT_CAP_EXTENDABLE) && is_extendable(symbol_id)) { + result |= ZINT_CAP_EXTENDABLE; + } + if ((cap_flag & ZINT_CAP_COMPOSITE) && is_composite(symbol_id)) { + result |= ZINT_CAP_COMPOSITE; + } + if ((cap_flag & ZINT_CAP_ECI) && supports_eci(symbol_id)) { + result |= ZINT_CAP_ECI; + } + if ((cap_flag & ZINT_CAP_GS1) && gs1_compliant(symbol_id)) { + result |= ZINT_CAP_GS1; + } + if ((cap_flag & ZINT_CAP_DOTTY) && is_dotty(symbol_id)) { + result |= ZINT_CAP_DOTTY; + } + if ((cap_flag & ZINT_CAP_FIXED_RATIO) && is_fixed_ratio(symbol_id)) { + result |= ZINT_CAP_FIXED_RATIO; + } + if (cap_flag & ZINT_CAP_READER_INIT) { + /* Note does not include HIBC versions */ + switch (symbol_id) { + case BARCODE_CODE128: /* Note does not include GS1_128 or NVE18 */ + case BARCODE_CODE128B: + case BARCODE_CODE16K: + case BARCODE_CODABLOCKF: + case BARCODE_PDF417: + case BARCODE_PDF417COMP: + case BARCODE_DATAMATRIX: + case BARCODE_MICROPDF417: + case BARCODE_AZTEC: + case BARCODE_DOTCODE: + case BARCODE_GRIDMATRIX: + case BARCODE_ULTRA: + result |= ZINT_CAP_READER_INIT; + break; + } + } + if (cap_flag & ZINT_CAP_FULL_MULTIBYTE) { + switch (symbol_id) { + case BARCODE_QRCODE: + case BARCODE_MICROQR: + //case BARCODE_HIBC_QR: Note character set restricted to ASCII subset + //case BARCODE_UPNQR: Note does not use Kanji mode + case BARCODE_RMQR: + case BARCODE_HANXIN: + case BARCODE_GRIDMATRIX: + result |= ZINT_CAP_FULL_MULTIBYTE; + break; + } + } + + return result; +} + int ZBarcode_ValidID(int symbol_id) { /* Checks whether a symbology is supported */ @@ -1019,8 +1156,16 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int #ifdef _MSC_VER unsigned char* local_source; #endif + + if (!symbol) return ZINT_ERROR_INVALID_DATA; + error_number = 0; + if (source == NULL) { + strcpy(symbol->errtxt, "200: Input data NULL"); + error_tag(symbol->errtxt, ZINT_ERROR_INVALID_DATA); + return ZINT_ERROR_INVALID_DATA; + } if (in_length <= 0) { in_length = (int)ustrlen(source); } @@ -1208,7 +1353,7 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int error_number = ZINT_ERROR_INVALID_OPTION; } - if ((symbol->dot_size < 0.01) || (symbol->dot_size > 20.0)) { + if ((symbol->dot_size < 0.01f) || (symbol->dot_size > 20.0f)) { strcpy(symbol->errtxt, "221: Invalid dot size"); error_number = ZINT_ERROR_INVALID_OPTION; } @@ -1217,7 +1362,7 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int symbol->input_mode = DATA_MODE; /* Reset completely */ } - if (error_number > 4) { + if (error_number >= ZINT_ERROR) { error_tag(symbol->errtxt, error_number); return error_number; } else { @@ -1251,6 +1396,9 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int #endif error_number = gs1_verify(symbol, local_source, in_length, reduced); if (error_number != 0) { + if (is_composite(symbol->symbology)) { + strcat(symbol->errtxt, " in 2D component"); + } error_tag(symbol->errtxt, error_number); return error_number; } @@ -1287,7 +1435,7 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int } error_tag(symbol->errtxt, error_number); - if (error_number < 5) { + if (error_number < ZINT_ERROR) { check_row_heights(symbol); } @@ -1297,6 +1445,8 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int int ZBarcode_Print(struct zint_symbol *symbol, int rotate_angle) { int error_number; + if (!symbol) return ZINT_ERROR_INVALID_DATA; + switch (rotate_angle) { case 0: case 90: @@ -1310,7 +1460,7 @@ int ZBarcode_Print(struct zint_symbol *symbol, int rotate_angle) { } if (symbol->output_options & BARCODE_DOTTY_MODE) { - if (!(is_matrix(symbol->symbology))) { + if (!(is_dotty(symbol->symbology))) { strcpy(symbol->errtxt, "224: Selected symbology cannot be rendered as dots"); error_tag(symbol->errtxt, ZINT_ERROR_INVALID_OPTION); return ZINT_ERROR_INVALID_OPTION; @@ -1326,31 +1476,31 @@ int ZBarcode_Print(struct zint_symbol *symbol, int rotate_angle) { to_upper((unsigned char*) output); if (!(strcmp(output, "PNG"))) { - if (symbol->scale < 1.0) { + if (symbol->scale < 1.0f) { symbol->text[0] = '\0'; } error_number = plot_raster(symbol, rotate_angle, OUT_PNG_FILE); } else if (!(strcmp(output, "BMP"))) { - if (symbol->scale < 1.0) { + if (symbol->scale < 1.0f) { symbol->text[0] = '\0'; } error_number = plot_raster(symbol, rotate_angle, OUT_BMP_FILE); } else if (!(strcmp(output, "PCX"))) { - if (symbol->scale < 1.0) { + if (symbol->scale < 1.0f) { symbol->text[0] = '\0'; } error_number = plot_raster(symbol, rotate_angle, OUT_PCX_FILE); } else if (!(strcmp(output, "GIF"))) { - if (symbol->scale < 1.0) { + if (symbol->scale < 1.0f) { symbol->text[0] = '\0'; } error_number = plot_raster(symbol, rotate_angle, OUT_GIF_FILE); } else if (!(strcmp(output, "TIF"))) { - if (symbol->scale < 1.0) { + if (symbol->scale < 1.0f) { symbol->text[0] = '\0'; } error_number = plot_raster(symbol, rotate_angle, OUT_TIF_FILE); @@ -1384,6 +1534,8 @@ int ZBarcode_Print(struct zint_symbol *symbol, int rotate_angle) { int ZBarcode_Buffer(struct zint_symbol *symbol, int rotate_angle) { int error_number; + if (!symbol) return ZINT_ERROR_INVALID_DATA; + switch (rotate_angle) { case 0: case 90: @@ -1397,7 +1549,7 @@ int ZBarcode_Buffer(struct zint_symbol *symbol, int rotate_angle) { } if (symbol->output_options & BARCODE_DOTTY_MODE) { - if (!(is_matrix(symbol->symbology))) { + if (!(is_dotty(symbol->symbology))) { strcpy(symbol->errtxt, "237: Selected symbology cannot be rendered as dots"); error_tag(symbol->errtxt, ZINT_ERROR_INVALID_OPTION); return ZINT_ERROR_INVALID_OPTION; @@ -1412,6 +1564,8 @@ int ZBarcode_Buffer(struct zint_symbol *symbol, int rotate_angle) { int ZBarcode_Buffer_Vector(struct zint_symbol *symbol, int rotate_angle) { int error_number; + if (!symbol) return ZINT_ERROR_INVALID_DATA; + switch (rotate_angle) { case 0: case 90: @@ -1425,7 +1579,7 @@ int ZBarcode_Buffer_Vector(struct zint_symbol *symbol, int rotate_angle) { } if (symbol->output_options & BARCODE_DOTTY_MODE) { - if (!(is_matrix(symbol->symbology))) { + if (!(is_dotty(symbol->symbology))) { strcpy(symbol->errtxt, "238: Selected symbology cannot be rendered as dots"); error_tag(symbol->errtxt, ZINT_ERROR_INVALID_OPTION); return ZINT_ERROR_INVALID_OPTION; @@ -1442,7 +1596,7 @@ int ZBarcode_Encode_and_Print(struct zint_symbol *symbol, unsigned char *input, int first_err; error_number = ZBarcode_Encode(symbol, input, length); - if (error_number >= 5) { + if (error_number >= ZINT_ERROR) { return error_number; } @@ -1459,7 +1613,7 @@ int ZBarcode_Encode_and_Buffer(struct zint_symbol *symbol, unsigned char *input, int first_err; error_number = ZBarcode_Encode(symbol, input, length); - if (error_number >= 5) { + if (error_number >= ZINT_ERROR) { return error_number; } @@ -1477,7 +1631,7 @@ int ZBarcode_Encode_and_Buffer_Vector(struct zint_symbol *symbol, unsigned char int first_err; error_number = ZBarcode_Encode(symbol, input, length); - if (error_number >= 5) { + if (error_number >= ZINT_ERROR) { return error_number; } @@ -1498,6 +1652,14 @@ int ZBarcode_Encode_File(struct zint_symbol *symbol, char *filename) { int nRead = 0; int ret; + if (!symbol) return ZINT_ERROR_INVALID_DATA; + + if (!filename) { + strcpy(symbol->errtxt, "239: Filename NULL"); + error_tag(symbol->errtxt, ZINT_ERROR_INVALID_OPTION); + return ZINT_ERROR_INVALID_DATA; + } + if (!strcmp(filename, "-")) { file = stdin; fileLen = 7900; @@ -1568,7 +1730,7 @@ int ZBarcode_Encode_File_and_Print(struct zint_symbol *symbol, char *filename, i int first_err; error_number = ZBarcode_Encode_File(symbol, filename); - if (error_number >= 5) { + if (error_number >= ZINT_ERROR) { return error_number; } @@ -1586,7 +1748,7 @@ int ZBarcode_Encode_File_and_Buffer(struct zint_symbol *symbol, char *filename, int first_err; error_number = ZBarcode_Encode_File(symbol, filename); - if (error_number >= 5) { + if (error_number >= ZINT_ERROR) { return error_number; } @@ -1604,7 +1766,7 @@ int ZBarcode_Encode_File_and_Buffer_Vector(struct zint_symbol *symbol, char *fil int first_err; error_number = ZBarcode_Encode_File(symbol, filename); - if (error_number >= 5) { + if (error_number >= ZINT_ERROR) { return error_number; } diff --git a/backend/maxicode.c b/backend/maxicode.c index 8773c57f..b1f2db22 100644 --- a/backend/maxicode.c +++ b/backend/maxicode.c @@ -36,10 +36,8 @@ #include "maxicode.h" #include "reedsol.h" -static int maxi_codeword[144]; - /* Handles error correction of primary message */ -static void maxi_do_primary_check() { +static void maxi_do_primary_check(int maxi_codeword[144]) { unsigned char data[15]; unsigned char results[15]; int j; @@ -60,7 +58,7 @@ static void maxi_do_primary_check() { } /* Handles error correction of odd characters in secondary */ -static void maxi_do_secondary_chk_odd(int ecclen) { +static void maxi_do_secondary_chk_odd(int maxi_codeword[144], int ecclen) { unsigned char data[100]; unsigned char results[30]; int j; @@ -84,7 +82,7 @@ static void maxi_do_secondary_chk_odd(int ecclen) { } /* Handles error correction of even characters in secondary */ -static void maxi_do_secondary_chk_even(int ecclen) { +static void maxi_do_secondary_chk_even(int maxi_codeword[144], int ecclen) { unsigned char data[100]; unsigned char results[30]; int j; @@ -145,7 +143,7 @@ static int bestSurroundingSet(int index, int length, int set[], int setval[], in } /* Format text according to Appendix A */ -static int maxi_text_process(int mode, unsigned char source[], int length, int eci) { +static int maxi_text_process(int maxi_codeword[144], int mode, unsigned char source[], int length, int eci) { /* This code doesn't make use of [Lock in C], [Lock in D] and [Lock in E] and so is not always the most efficient at compressing data, but should suffice for most applications */ @@ -532,7 +530,7 @@ static int maxi_text_process(int mode, unsigned char source[], int length, int e } /* Format structured primary for Mode 2 */ -static void maxi_do_primary_2(char postcode[], int country, int service) { +static void maxi_do_primary_2(int maxi_codeword[144], char postcode[], int country, int service) { size_t postcode_length; int postcode_num, i; @@ -558,7 +556,7 @@ static void maxi_do_primary_2(char postcode[], int country, int service) { } /* Format structured primary for Mode 3 */ -static void maxi_do_primary_3(char postcode[], int country, int service) { +static void maxi_do_primary_3(int maxi_codeword[144], char postcode[], int country, int service) { int i, h; h = strlen(postcode); @@ -590,7 +588,8 @@ static void maxi_do_primary_3(char postcode[], int country, int service) { INTERNAL int maxicode(struct zint_symbol *symbol, unsigned char local_source[], const int length) { int i, j, block, bit, mode, lp = 0; - int bit_pattern[7], internal_error = 0, eclen; + int bit_pattern[7], error_number = 0, eclen; + int maxi_codeword[144] = {0}; char postcode[12], countrystr[4], servicestr[4]; mode = symbol->option_1; @@ -598,8 +597,6 @@ INTERNAL int maxicode(struct zint_symbol *symbol, unsigned char local_source[], strcpy(countrystr, ""); strcpy(servicestr, ""); - memset(maxi_codeword, 0, sizeof (maxi_codeword)); - if (mode == -1) { /* If mode is unspecified */ lp = strlen(symbol->primary); if (lp == 0) { @@ -627,13 +624,13 @@ INTERNAL int maxicode(struct zint_symbol *symbol, unsigned char local_source[], lp = strlen(symbol->primary); } if (lp != 15) { - strcpy(symbol->errtxt, "551: Invalid Primary String"); + strcpy(symbol->errtxt, "551: Invalid Primary Message"); return ZINT_ERROR_INVALID_DATA; } for (i = 9; i < 15; i++) { /* check that country code and service are numeric */ if ((symbol->primary[i] < '0') || (symbol->primary[i] > '9')) { - strcpy(symbol->errtxt, "552: Invalid Primary String"); + strcpy(symbol->errtxt, "552: Invalid Primary Message"); return ZINT_ERROR_INVALID_DATA; } } @@ -665,31 +662,31 @@ INTERNAL int maxicode(struct zint_symbol *symbol, unsigned char local_source[], service = atoi(servicestr); if (mode == 2) { - maxi_do_primary_2(postcode, countrycode, service); + maxi_do_primary_2(maxi_codeword, postcode, countrycode, service); } if (mode == 3) { - maxi_do_primary_3(postcode, countrycode, service); + maxi_do_primary_3(maxi_codeword, postcode, countrycode, service); } } else { maxi_codeword[0] = mode; } - i = maxi_text_process(mode, local_source, length, symbol->eci); + i = maxi_text_process(maxi_codeword, mode, local_source, length, symbol->eci); if (i == ZINT_ERROR_TOO_LONG) { strcpy(symbol->errtxt, "553: Input data too long"); return i; } /* All the data is sorted - now do error correction */ - maxi_do_primary_check(); /* always EEC */ + maxi_do_primary_check(maxi_codeword); /* always EEC */ if (mode == 5) eclen = 56; // 68 data codewords , 56 error corrections else eclen = 40; // 84 data codewords, 40 error corrections - maxi_do_secondary_chk_even(eclen / 2); // do error correction of even - maxi_do_secondary_chk_odd(eclen / 2); // do error correction of odd + maxi_do_secondary_chk_even(maxi_codeword, eclen / 2); // do error correction of even + maxi_do_secondary_chk_odd(maxi_codeword, eclen / 2); // do error correction of odd /* Copy data into symbol grid */ for (i = 0; i < 33; i++) { @@ -731,5 +728,5 @@ INTERNAL int maxicode(struct zint_symbol *symbol, unsigned char local_source[], symbol->width = 30; symbol->rows = 33; - return internal_error; + return error_number; } diff --git a/backend/medical.c b/backend/medical.c index 51e77ebd..af50b2e2 100644 --- a/backend/medical.c +++ b/backend/medical.c @@ -58,7 +58,8 @@ INTERNAL int pharma_one(struct zint_symbol *symbol, unsigned char source[], int - http://en.wikipedia.org/wiki/Pharmacode */ /* This code uses the One Track Pharamacode calculating algorithm as recommended by - the specification at http://www.laetus.com/laetus.php?request=file&id=69 */ + the specification at http://www.laetus.com/laetus.php?request=file&id=69 + (http://www.gomaro.ch/ftproot/Laetus_PHARMA-CODE.pdf) */ unsigned long int tester; int counter, error_number, h; diff --git a/backend/pdf417.c b/backend/pdf417.c index 713ec056..60185201 100644 --- a/backend/pdf417.c +++ b/backend/pdf417.c @@ -537,6 +537,7 @@ static int pdf417(struct zint_symbol *symbol, unsigned char chaine[], const size int total, chainemc[PDF417_MAX_LEN], mclength, c1, c2, c3, dummy[35], calcheight; int liste[2][PDF417_MAX_LEN] = {{0}}; char pattern[580]; + int error_number = 0; int debug = symbol->debug & ZINT_DEBUG_PRINT; if (length > PDF417_MAX_LEN) { @@ -760,13 +761,15 @@ static int pdf417(struct zint_symbol *symbol, unsigned char chaine[], const size } #endif + symbol->rows = mclength / symbol->option_2; + /* 818 - The CW string is finished */ - c1 = (mclength / symbol->option_2 - 1) / 3; - c2 = symbol->option_1 * 3 + (mclength / symbol->option_2 - 1) % 3; + c1 = (symbol->rows - 1) / 3; + c2 = symbol->option_1 * 3 + (symbol->rows - 1) % 3; c3 = symbol->option_2 - 1; /* we now encode each row */ - for (i = 0; i <= (mclength / symbol->option_2) - 1; i++) { + for (i = 0; i < symbol->rows; i++) { for (j = 0; j < symbol->option_2; j++) { dummy[j + 1] = chainemc[i * symbol->option_2 + j]; } @@ -821,11 +824,10 @@ static int pdf417(struct zint_symbol *symbol, unsigned char chaine[], const size symbol->row_height[j] = calcheight; } - symbol->rows = (mclength / symbol->option_2); - symbol->width =(int)strlen(pattern); + symbol->width = (int) strlen(pattern); /* 843 */ - return 0; + return error_number; } /* 345 */ diff --git a/backend/postal.c b/backend/postal.c index b90743d8..fec8f374 100644 --- a/backend/postal.c +++ b/backend/postal.c @@ -135,7 +135,7 @@ INTERNAL int post_plot(struct zint_symbol *symbol, unsigned char source[], int l set_module(symbol, 0, writer); } set_module(symbol, 1, writer); - writer += 3; + writer += 2; } symbol->row_height[0] = 6; symbol->row_height[1] = 6; @@ -145,7 +145,7 @@ INTERNAL int post_plot(struct zint_symbol *symbol, unsigned char source[], int l return error_number; } -/* Handles the PLANET system used for item tracking in the US */ +/* Handles the PLANET system used for item tracking in the US */ static int planet(struct zint_symbol *symbol, unsigned char source[], char dest[], int length) { int i, sum, check_digit; int error_number; @@ -197,12 +197,13 @@ INTERNAL int planet_plot(struct zint_symbol *symbol, unsigned char source[], int set_module(symbol, 0, writer); } set_module(symbol, 1, writer); - writer += 3; + writer += 2; } symbol->row_height[0] = 6; symbol->row_height[1] = 6; symbol->rows = 2; symbol->width = writer - 1; + return error_number; } @@ -241,13 +242,13 @@ INTERNAL int korea_post(struct zint_symbol *symbol, unsigned char source[], int lookup(NEON, KoreaTable, localstr[6], dest); expand(symbol, dest); ustrcpy(symbol->text, (unsigned char*) localstr); + return error_number; } /* The simplest barcode symbology ever! Supported by MS Word, so here it is! glyphs from http://en.wikipedia.org/wiki/Facing_Identification_Mark */ INTERNAL int fim(struct zint_symbol *symbol, unsigned char source[], int length) { - char dest[16] = {0}; if (length > 1) { @@ -279,11 +280,12 @@ INTERNAL int fim(struct zint_symbol *symbol, unsigned char source[], int length) } expand(symbol, dest); + return 0; } /* Handles the 4 State barcodes used in the UK by Royal Mail */ -static char rm4scc(char source[], unsigned char dest[], int length) { +static char rm4scc(unsigned char source[], char dest[], int length) { int i; int top, bottom, row, column, check_digit; char values[3], set_copy[] = KRSET; @@ -292,10 +294,10 @@ static char rm4scc(char source[], unsigned char dest[], int length) { bottom = 0; /* start character */ - strcpy((char*) dest, "1"); + strcpy(dest, "1"); for (i = 0; i < length; i++) { - lookup(KRSET, RoyalTable, source[i], (char*) dest); + lookup(KRSET, RoyalTable, source[i], dest); strcpy(values, RoyalValues[posn(KRSET, source[i])]); top += ctoi(values[0]); bottom += ctoi(values[1]); @@ -311,10 +313,10 @@ static char rm4scc(char source[], unsigned char dest[], int length) { column = 5; } check_digit = (6 * row) + column; - strcat((char*) dest, RoyalTable[check_digit]); + strcat(dest, RoyalTable[check_digit]); /* stop character */ - strcat((char*) dest, "0"); + strcat(dest, "0"); return set_copy[check_digit]; } @@ -337,7 +339,7 @@ INTERNAL int royal_plot(struct zint_symbol *symbol, unsigned char source[], int strcpy(symbol->errtxt, "489: Invalid characters in data"); return error_number; } - /*check = */rm4scc((char*) source, (unsigned char*) height_pattern, length); + /*check = */rm4scc(source, height_pattern, length); writer = 0; h = strlen(height_pattern); @@ -487,6 +489,7 @@ INTERNAL int flattermarken(struct zint_symbol *symbol, unsigned char source[], i } expand(symbol, dest); + return error_number; } diff --git a/backend/ps.c b/backend/ps.c index fd3a37ab..7fe4f2f7 100644 --- a/backend/ps.c +++ b/backend/ps.c @@ -32,13 +32,14 @@ /* vim: set ts=4 sw=4 et : */ #include -#include -#include #include #include +#ifdef _MSC_VER +#include +#endif #include "common.h" -void colour_to_pscolor(int option, int colour, char* output) { +static void colour_to_pscolor(int option, int colour, char* output) { strcpy(output, ""); if ((option & CMYK_COLOUR) == 0) { // Use RGB colour space @@ -101,6 +102,35 @@ void colour_to_pscolor(int option, int colour, char* output) { } } +STATIC_UNLESS_ZINT_TEST void ps_convert(const unsigned char *string, unsigned char *ps_string) { + const unsigned char *s; + unsigned char *p = ps_string; + + for (s = string; *s; s++) { + switch (*s) { + case '(': + case ')': + case '\\': + *p++ = '\\'; + *p++ = *s; + break; + case 0xC2: /* See `to_iso8859_1()` in raster.c */ + *p++ = *++s; + break; + case 0xC3: + *p++ = *++s + 64; + break; + default: + if (*s < 0x80) { + *p++ = *s; + } + break; + + } + } + *p = '\0'; +} + INTERNAL int ps_plot(struct zint_symbol *symbol) { FILE *feps; int fgred, fggrn, fgblu, bgred, bggrn, bgblu; @@ -118,6 +148,13 @@ INTERNAL int ps_plot(struct zint_symbol *symbol) { struct zint_vector_circle *circle; struct zint_vector_string *string; const char *locale = NULL; + const char *font; + int i, len; + int ps_len = 0; + int iso_latin1 = 0; +#ifdef _MSC_VER + unsigned char *ps_string; +#endif if (strlen(symbol->bgcolour) > 6) { if ((ctoi(symbol->bgcolour[6]) == 0) && (ctoi(symbol->bgcolour[7]) == 0)) { @@ -197,6 +234,28 @@ INTERNAL int ps_plot(struct zint_symbol *symbol) { yellow_paper = 0.0; } + for (i = 0, len = (int) ustrlen(symbol->text); i < len; i++) { + switch (symbol->text[i]) { + case '(': + case ')': + case '\\': + ps_len += 2; + break; + default: + if (!iso_latin1 && symbol->text[i] >= 0x80) { + iso_latin1 = 1; + } + ps_len++; /* Will overcount 2 byte UTF-8 chars */ + break; + } + } + +#ifndef _MSC_VER + unsigned char ps_string[ps_len + 1]; +#else + ps_string = (unsigned char *) _alloca(ps_len + 1); +#endif + /* Start writing the header */ fprintf(feps, "%%!PS-Adobe-3.0 EPSF-3.0\n"); if (ZINT_VERSION_BUILD) { @@ -330,21 +389,44 @@ INTERNAL int ps_plot(struct zint_symbol *symbol) { } // Text + string = symbol->vector->strings; + if (string) { + if ((symbol->output_options & BOLD_TEXT) && (!is_extendable(symbol->symbology) || (symbol->output_options & SMALL_TEXT))) { + font = "Helvetica-Bold"; + } else { + font = "Helvetica"; + } + if (iso_latin1) { /* Change encoding to ISO 8859-1, see Postscript Language Reference Manual 2nd Edition Example 5.6 */ + fprintf(feps, "/%s findfont\n", font); + fprintf(feps, "dup length dict begin\n"); + fprintf(feps, "{1 index /FID ne {def} {pop pop} ifelse} forall\n"); + fprintf(feps, "/Encoding ISOLatin1Encoding def\n"); + fprintf(feps, "currentdict\n"); + fprintf(feps, "end\n"); + fprintf(feps, "/Helvetica-ISOLatin1 exch definefont pop\n"); + font = "Helvetica-ISOLatin1"; + } + } while (string) { + ps_convert(string->text, ps_string); fprintf(feps, "matrix currentmatrix\n"); - fprintf(feps, "/Helvetica findfont\n"); + fprintf(feps, "/%s findfont\n", font); fprintf(feps, "%.2f scalefont setfont\n", string->fsize); fprintf(feps, " 0 0 moveto %.2f %.2f translate 0.00 rotate 0 0 moveto\n", string->x, (symbol->vector->height - string->y)); - fprintf(feps, " (%s) stringwidth\n", string->text); + if (string->halign == 0 || string->halign == 2) { /* Need width for middle or right align */ + fprintf(feps, " (%s) stringwidth\n", ps_string); + } if (string->rotation != 0) { fprintf(feps, "gsave\n"); fprintf(feps, "%d rotate\n", 360 - string->rotation); } - fprintf(feps, "pop\n"); - fprintf(feps, "-2 div 0 rmoveto\n"); - fprintf(feps, " (%s) show\n", string->text); + if (string->halign == 0 || string->halign == 2) { + fprintf(feps, "pop\n"); + fprintf(feps, "%s 0 rmoveto\n", string->halign == 2 ? "neg" : "-2 div"); + } + fprintf(feps, " (%s) show\n", ps_string); if (string->rotation != 0) { fprintf(feps, "grestore\n"); } diff --git a/backend/qr.c b/backend/qr.c index 0346d33c..e82c8fb8 100644 --- a/backend/qr.c +++ b/backend/qr.c @@ -138,7 +138,7 @@ static int in_alpha(const unsigned int jisdata[], const size_t length, const uns #define QR_B 2 /* Byte */ #define QR_K 3 /* Kanji */ -static const char mode_types[] = { 'N', 'A', 'B', 'K', }; /* Must be in same order as QR_N etc */ +static const char mode_types[] = { 'N', 'A', 'B', 'K', '\0' }; /* Must be in same order as QR_N etc */ #define QR_NUM_MODES 4 diff --git a/backend/raster.c b/backend/raster.c index 80127e1c..34a5c889 100644 --- a/backend/raster.c +++ b/backend/raster.c @@ -67,14 +67,14 @@ static int buffer_plot(struct zint_symbol *symbol, char *pixelbuf) { int fgalpha, bgalpha; int row, column, i; int plot_alpha = 0; - + if (strlen(symbol->fgcolour) > 6) { fgalpha = (16 * ctoi(symbol->fgcolour[6])) + ctoi(symbol->fgcolour[7]); plot_alpha = 1; } else { fgalpha = 0xff; } - + if (strlen(symbol->bgcolour) > 6) { bgalpha = (16 * ctoi(symbol->bgcolour[6])) + ctoi(symbol->bgcolour[7]); plot_alpha = 1; @@ -359,7 +359,7 @@ static void draw_letter(char *pixelbuf, unsigned char letter, int xposn, int ypo skip = 1; } - if ((letter > 127) && (letter < 161)) { + if ((letter >= 127) && (letter < 161)) { skip = 1; } @@ -384,8 +384,8 @@ static void draw_letter(char *pixelbuf, unsigned char letter, int xposn, int ypo char *linePtr, *maxPtr; int x_start = 0; - if (letter > 128) { - glyph_no = letter - 66; + if (letter > 127) { + glyph_no = letter - 67; /* 161 - (127 - 33) */ } else { glyph_no = letter - 33; } @@ -432,7 +432,7 @@ static void draw_letter(char *pixelbuf, unsigned char letter, int xposn, int ypo linePtr = pixelbuf + (yposn * image_width) + xposn; for (y = 0; y < max_y; y++) { int x_si, y_si; - char *pixelPtr; + char *pixelPtr = linePtr; /* Avoid warning */ for (y_si = 0; y_si < half_si; y_si++) { int extra_dot = 0; pixelPtr = linePtr; @@ -586,8 +586,7 @@ static int plot_raster_maxicode(struct zint_symbol *symbol, int rotate_angle, in int image_height, image_width; char *pixelbuf; int error_number; - int xoffset, yoffset; - int roffset, boffset; + int xoffset, yoffset, roffset, boffset; float scaler = symbol->scale; char *scaled_hexagon; int hexagon_size; @@ -664,26 +663,32 @@ static int plot_raster_maxicode(struct zint_symbol *symbol, int rotate_angle, in static int plot_raster_dotty(struct zint_symbol *symbol, int rotate_angle, int file_type) { float scaler = 2 * symbol->scale; - float half_scaler, dot_size_scaled; char *scaled_pixelbuf; int r, i; int scale_width, scale_height; int error_number = 0; - int xoffset, yoffset, image_width, image_height; - int roffset, boffset; + int image_width, image_height; + int xoffset, yoffset, roffset, boffset; + int dot_overspill = 0; + float dotradius_scaled; symbol->height = symbol->rows; // This is true because only 2d matrix symbols are processed here output_set_whitespace_offsets(symbol, &xoffset, &yoffset, &roffset, &boffset); - image_width = symbol->width + xoffset + roffset; - image_height = symbol->height + yoffset + boffset; + dot_overspill = (int) ceil(symbol->dot_size - 1); /* Allow for exceeding 1X */ + if (dot_overspill < 0) { + dot_overspill = 0; + } + + image_width = symbol->width + dot_overspill + xoffset + roffset; + image_height = symbol->height + dot_overspill + yoffset + boffset; if (scaler < 2.0f) { scaler = 2.0f; } - scale_width = (image_width * scaler) + 1; - scale_height = (image_height * scaler) + 1; + scale_width = image_width * scaler; + scale_height = image_height * scaler; /* Apply scale options by creating another pixel buffer */ if (!(scaled_pixelbuf = (char *) malloc(scale_width * scale_height))) { @@ -693,21 +698,22 @@ static int plot_raster_dotty(struct zint_symbol *symbol, int rotate_angle, int f memset(scaled_pixelbuf, DEFAULT_PAPER, scale_width * scale_height); /* Plot the body of the symbol to the pixel buffer */ - half_scaler = scaler / 2.0f; - dot_size_scaled = (symbol->dot_size * scaler) / 2.0f; + dotradius_scaled = (symbol->dot_size * scaler) / 2.0f; for (r = 0; r < symbol->rows; r++) { - float row_scaled = (r + yoffset) * scaler + half_scaler; + float row_scaled = (r + yoffset) * scaler + dotradius_scaled; for (i = 0; i < symbol->width; i++) { if (module_is_set(symbol, r, i)) { draw_circle(scaled_pixelbuf, scale_width, scale_height, - (i + xoffset) * scaler + half_scaler, + (i + xoffset) * scaler + dotradius_scaled, row_scaled, - dot_size_scaled, + dotradius_scaled, DEFAULT_INK); } } } + // TODO: bind/box + error_number = save_raster_image_to_file(symbol, scale_height, scale_width, scaled_pixelbuf, rotate_angle, file_type); if (rotate_angle || file_type != OUT_BUFFER || !(symbol->output_options & OUT_BUFFER_INTERMEDIATE)) { free(scaled_pixelbuf); @@ -759,12 +765,14 @@ static void to_iso8859_1(const unsigned char source[], unsigned char preprocesse static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int file_type) { int error_number; - float large_bar_height; - int textdone; - int main_width, comp_offset, addon_gap; + int large_bar_height; + int textdone = 0; + int main_width; + int comp_offset = 0; unsigned char addon[6]; + int addon_gap; + float addon_text_posn = 0.0f; int xoffset, yoffset, roffset, boffset; - float addon_text_posn; int textoffset; int default_text_posn; float row_height, row_posn; @@ -772,12 +780,13 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int int addon_latch = 0; unsigned char textpart1[5], textpart2[7], textpart3[7], textpart4[2]; int textpos; - int hide_text = 0; + int hide_text; int i, r; - int text_height; /* Font size */ + int text_height; /* Font pixel size (so whole integers) */ int text_gap; /* Gap between barcode and text */ int textflags = 0; + int guardoffset = 0; int image_width, image_height; char *pixelbuf; int next_yposn; @@ -789,7 +798,6 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int int scale_width, scale_height; char *scaled_pixelbuf; int horiz, vert; - int guardoffset = 0; /* Ignore scaling < 0.5 for raster as would drop modules */ if (scaler < 0.5f) { @@ -804,10 +812,8 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int } large_bar_height = output_large_bar_height(symbol); - textdone = 0; main_width = symbol->width; - comp_offset = 0; if (is_extendable(symbol->symbology)) { upceanflag = output_process_upcean(symbol, &main_width, &comp_offset, addon, &addon_gap); @@ -815,36 +821,32 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int output_set_whitespace_offsets(symbol, &xoffset, &yoffset, &roffset, &boffset); - addon_text_posn = 0.0f; hide_text = ((!symbol->show_hrt) || (ustrlen(symbol->text) == 0)); + /* Note font sizes halved as in pixels */ if (upceanflag) { textflags = UPCEAN_TEXT; /* Small and bold not available for UPC/EAN */ + text_height = (UPCEAN_FONT_HEIGHT + 1) / 2; + text_gap = 1; } else { textflags = symbol->output_options & (SMALL_TEXT | BOLD_TEXT); + text_height = textflags & SMALL_TEXT ? (SMALL_FONT_HEIGHT + 1) / 2 : (NORMAL_FONT_HEIGHT + 1) / 2; + text_gap = 1; } if (hide_text) { - text_gap = 0; textoffset = upceanflag && upceanflag != 2 && upceanflag != 5 ? 5 : 0; /* Need 5X from bottom for guard bars */ } else { - /* Note font sizes halved as in pixels */ if (upceanflag) { - text_height = (UPCEAN_FONT_HEIGHT + 1) / 2; - } else if (textflags & SMALL_TEXT) { - text_height = (SMALL_FONT_HEIGHT + 1) / 2; - } else { - text_height = (NORMAL_FONT_HEIGHT + 1) / 2; - } - if (upceanflag) { - text_gap = 1; textoffset = (text_height > 5 ? text_height : 5) + text_gap; /* Need at least 5X for guard bars */ - guardoffset = textoffset - 5 + yoffset; } else { - text_gap = 1; textoffset = text_height + text_gap; } } + if (upceanflag) { + guardoffset = textoffset - 5 + boffset; + } + image_width = (symbol->width + xoffset + roffset) * si; image_height = (symbol->height + textoffset + yoffset + boffset) * si; @@ -857,22 +859,18 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int default_text_posn = image_height - (textoffset - text_gap) * si; row_height = 0.0f; - row_posn = textoffset + yoffset; - next_yposn = textoffset + yoffset; + row_posn = textoffset + boffset; /* Bottom up */ + next_yposn = textoffset + boffset; /* Plot the body of the symbol to the pixel buffer */ for (r = 0; r < symbol->rows; r++) { int plot_yposn; - int plot_height; + float plot_height; int this_row = symbol->rows - r - 1; /* invert r otherwise plots upside down */ int module_fill; row_posn += row_height; plot_yposn = next_yposn; - if (symbol->row_height[this_row] == 0) { - row_height = large_bar_height; - } else { - row_height = symbol->row_height[this_row]; - } + row_height = symbol->row_height[this_row] ? symbol->row_height[this_row] : large_bar_height; next_yposn = (int) (row_posn + row_height); plot_height = next_yposn - plot_yposn; @@ -886,13 +884,20 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int } while ((i + block_width < symbol->width) && module_is_set(symbol, this_row, i + block_width) == module_is_set(symbol, this_row, i)); if ((addon_latch == 0) && (r == 0) && (i > main_width)) { - if (upceanflag == 12 || upceanflag == 6) { /* UPC-A/E add-ons don't descend */ - plot_height = row_height > 8.0f ? row_height - 8.0f : 1; - plot_yposn = row_posn; - } else { - plot_height = row_height > 3.0f ? row_height - 3.0f : 1; - plot_yposn = row_posn - 5.0f; + plot_height = row_height - (text_height + text_gap) + 5.0f; + plot_yposn = row_posn - 5.0f; + if (plot_yposn < 0.0f) { + plot_yposn = 0.0f; } + if (upceanflag == 12 || upceanflag == 6) { /* UPC-A/E add-ons don't descend */ + plot_height -= 5.0f; + plot_yposn += 5.0f; + } + if (plot_height < 0.5f) { + plot_height = 0.5f; + } + /* Need to invert composite position */ + addon_text_posn = is_composite(symbol->symbology) ? image_height - (plot_yposn + plot_height + text_height + text_gap) * si : yoffset * si; addon_latch = 1; } if (module_fill) { @@ -1086,12 +1091,14 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int /* row binding */ if (symbol->symbology != BARCODE_CODABLOCKF && symbol->symbology != BARCODE_HIBC_BLOCKF) { for (r = 1; r < symbol->rows; r++) { + row_height = symbol->row_height[r - 1] ? symbol->row_height[r - 1] : large_bar_height; draw_bar(pixelbuf, xoffset * si, symbol->width * si, ((r * row_height) + textoffset + yoffset - sep_height / 2) * si, sep_height * si, image_width, image_height, DEFAULT_INK); } } else { for (r = 1; r < symbol->rows; r++) { /* Avoid 11-module start and 13-module stop chars */ + row_height = symbol->row_height[r - 1] ? symbol->row_height[r - 1] : large_bar_height; draw_bar(pixelbuf, (xoffset + 11) * si, (symbol->width - 24) * si, ((r * row_height) + textoffset + yoffset - sep_height / 2) * si, sep_height * si, image_width, image_height, DEFAULT_INK); } diff --git a/backend/svg.c b/backend/svg.c index bb42ac6c..ead5440c 100644 --- a/backend/svg.c +++ b/backend/svg.c @@ -125,6 +125,8 @@ INTERNAL int svg_plot(struct zint_symbol *symbol) { char bgcolour_string[7]; int bg_alpha = 0xff; int fg_alpha = 0xff; + const char *font_family = "Helvetica, sans-serif"; + int bold; struct zint_vector_rect *rect; struct zint_vector_hexagon *hex; @@ -278,10 +280,15 @@ INTERNAL int svg_plot(struct zint_symbol *symbol) { circle = circle->next; } + bold = (symbol->output_options & BOLD_TEXT) && (!is_extendable(symbol->symbology) || (symbol->output_options & SMALL_TEXT)); string = symbol->vector->strings; while (string) { - fprintf(fsvg, " x, string->y); - fprintf(fsvg, " font-family=\"Helvetica\" font-size=\"%.1f\"", string->fsize); + const char *halign = string->halign == 2 ? "end" : string->halign == 1 ? "start" : "middle"; + fprintf(fsvg, " x, string->y, halign); + fprintf(fsvg, " font-family=\"%s\" font-size=\"%.1f\"", font_family, string->fsize); + if (bold) { + fprintf(fsvg, " font-weight=\"bold\""); + } if (fg_alpha != 0xff) { fprintf(fsvg, " opacity=\"%.3f\"", (float) fg_alpha / 255.0); } diff --git a/backend/tests/data/emf/code128_egrave_bold.emf b/backend/tests/data/emf/code128_egrave_bold.emf new file mode 100644 index 00000000..1979555b Binary files /dev/null and b/backend/tests/data/emf/code128_egrave_bold.emf differ diff --git a/backend/tests/data/emf/ean13_5addon_ggs_5.2.2.5.2-2.emf b/backend/tests/data/emf/ean13_5addon_ggs_5.2.2.5.2-2.emf new file mode 100644 index 00000000..78bbb49c Binary files /dev/null and b/backend/tests/data/emf/ean13_5addon_ggs_5.2.2.5.2-2.emf differ diff --git a/backend/tests/data/emf/itf14_bold.emf b/backend/tests/data/emf/itf14_bold.emf new file mode 100644 index 00000000..bd967497 Binary files /dev/null and b/backend/tests/data/emf/itf14_bold.emf differ diff --git a/backend/tests/data/emf/telenum_fg_bg.emf b/backend/tests/data/emf/telenum_fg_bg.emf index 1192c339..f9c78727 100644 Binary files a/backend/tests/data/emf/telenum_fg_bg.emf and b/backend/tests/data/emf/telenum_fg_bg.emf differ diff --git a/backend/tests/data/emf/ultracode_fg_bg.emf b/backend/tests/data/emf/ultracode_fg_bg.emf index 2f38b656..8f9da669 100644 Binary files a/backend/tests/data/emf/ultracode_fg_bg.emf and b/backend/tests/data/emf/ultracode_fg_bg.emf differ diff --git a/backend/tests/data/emf/upca_2addon_ggs_5.2.6.6-5.emf b/backend/tests/data/emf/upca_2addon_ggs_5.2.6.6-5.emf new file mode 100644 index 00000000..9d29c327 Binary files /dev/null and b/backend/tests/data/emf/upca_2addon_ggs_5.2.6.6-5.emf differ diff --git a/backend/tests/data/emf/upce_2addon.emf b/backend/tests/data/emf/upce_2addon.emf new file mode 100644 index 00000000..73848cea Binary files /dev/null and b/backend/tests/data/emf/upce_2addon.emf differ diff --git a/backend/tests/data/emf/upce_2addon_small_bold.emf b/backend/tests/data/emf/upce_2addon_small_bold.emf new file mode 100644 index 00000000..b9e69908 Binary files /dev/null and b/backend/tests/data/emf/upce_2addon_small_bold.emf differ diff --git a/backend/tests/data/eps/code128_egrave_bold.eps b/backend/tests/data/eps/code128_egrave_bold.eps new file mode 100644 index 00000000..bc068f2d --- /dev/null +++ b/backend/tests/data/eps/code128_egrave_bold.eps @@ -0,0 +1,95 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: Zint 2.9.1.9 +%%Title: Zint Generated Symbol +%%Pages: 0 +%%BoundingBox: 0 0 224 119 +%%EndComments +/TL { setlinewidth moveto lineto stroke } bind def +/TD { newpath 0 360 arc fill } bind def +/TH { 0 setlinewidth moveto lineto lineto lineto lineto lineto closepath fill } bind def +/TB { 2 copy } bind def +/TR { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def +/TE { pop pop } bind def +newpath +1.00 1.00 1.00 setrgbcolor +118.90 0.00 TB 0.00 224.00 TR +TE +0.00 0.00 0.00 setrgbcolor +100.00 18.90 TB 0.00 4.00 TR +TE +100.00 18.90 TB 6.00 2.00 TR +TE +100.00 18.90 TB 12.00 2.00 TR +TE +100.00 18.90 TB 22.00 2.00 TR +TE +100.00 18.90 TB 26.00 8.00 TR +TE +100.00 18.90 TB 36.00 6.00 TR +TE +100.00 18.90 TB 44.00 4.00 TR +TE +100.00 18.90 TB 54.00 2.00 TR +TE +100.00 18.90 TB 62.00 2.00 TR +TE +100.00 18.90 TB 66.00 2.00 TR +TE +100.00 18.90 TB 72.00 4.00 TR +TE +100.00 18.90 TB 78.00 2.00 TR +TE +100.00 18.90 TB 88.00 2.00 TR +TE +100.00 18.90 TB 98.00 4.00 TR +TE +100.00 18.90 TB 106.00 2.00 TR +TE +100.00 18.90 TB 110.00 2.00 TR +TE +100.00 18.90 TB 114.00 2.00 TR +TE +100.00 18.90 TB 120.00 8.00 TR +TE +100.00 18.90 TB 132.00 2.00 TR +TE +100.00 18.90 TB 138.00 2.00 TR +TE +100.00 18.90 TB 142.00 8.00 TR +TE +100.00 18.90 TB 154.00 4.00 TR +TE +100.00 18.90 TB 160.00 4.00 TR +TE +100.00 18.90 TB 166.00 8.00 TR +TE +100.00 18.90 TB 176.00 2.00 TR +TE +100.00 18.90 TB 184.00 4.00 TR +TE +100.00 18.90 TB 194.00 2.00 TR +TE +100.00 18.90 TB 198.00 4.00 TR +TE +100.00 18.90 TB 208.00 6.00 TR +TE +100.00 18.90 TB 216.00 2.00 TR +TE +100.00 18.90 TB 220.00 4.00 TR +TE +/Helvetica-Bold findfont +dup length dict begin +{1 index /FID ne {def} {pop pop} ifelse} forall +/Encoding ISOLatin1Encoding def +currentdict +end +/Helvetica-ISOLatin1 exch definefont pop +matrix currentmatrix +/Helvetica-ISOLatin1 findfont +14.00 scalefont setfont + 0 0 moveto 112.00 3.50 translate 0.00 rotate 0 0 moveto + (Égjpqy) stringwidth +pop +-2 div 0 rmoveto + (Égjpqy) show +setmatrix diff --git a/backend/tests/data/eps/code128_escape_latin1.eps b/backend/tests/data/eps/code128_escape_latin1.eps new file mode 100644 index 00000000..7cf28451 --- /dev/null +++ b/backend/tests/data/eps/code128_escape_latin1.eps @@ -0,0 +1,101 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: Zint 2.9.1.9 +%%Title: Zint Generated Symbol +%%Pages: 0 +%%BoundingBox: 0 0 246 119 +%%EndComments +/TL { setlinewidth moveto lineto stroke } bind def +/TD { newpath 0 360 arc fill } bind def +/TH { 0 setlinewidth moveto lineto lineto lineto lineto lineto closepath fill } bind def +/TB { 2 copy } bind def +/TR { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def +/TE { pop pop } bind def +newpath +1.00 1.00 1.00 setrgbcolor +118.90 0.00 TB 0.00 246.00 TR +TE +0.00 0.00 0.00 setrgbcolor +100.00 18.90 TB 0.00 4.00 TR +TE +100.00 18.90 TB 6.00 2.00 TR +TE +100.00 18.90 TB 12.00 2.00 TR +TE +100.00 18.90 TB 22.00 2.00 TR +TE +100.00 18.90 TB 26.00 2.00 TR +TE +100.00 18.90 TB 34.00 4.00 TR +TE +100.00 18.90 TB 44.00 6.00 TR +TE +100.00 18.90 TB 52.00 8.00 TR +TE +100.00 18.90 TB 62.00 2.00 TR +TE +100.00 18.90 TB 66.00 2.00 TR +TE +100.00 18.90 TB 74.00 2.00 TR +TE +100.00 18.90 TB 78.00 4.00 TR +TE +100.00 18.90 TB 88.00 4.00 TR +TE +100.00 18.90 TB 96.00 2.00 TR +TE +100.00 18.90 TB 102.00 2.00 TR +TE +100.00 18.90 TB 110.00 2.00 TR +TE +100.00 18.90 TB 114.00 8.00 TR +TE +100.00 18.90 TB 124.00 6.00 TR +TE +100.00 18.90 TB 132.00 2.00 TR +TE +100.00 18.90 TB 138.00 4.00 TR +TE +100.00 18.90 TB 144.00 2.00 TR +TE +100.00 18.90 TB 154.00 2.00 TR +TE +100.00 18.90 TB 162.00 4.00 TR +TE +100.00 18.90 TB 170.00 2.00 TR +TE +100.00 18.90 TB 176.00 2.00 TR +TE +100.00 18.90 TB 180.00 4.00 TR +TE +100.00 18.90 TB 190.00 2.00 TR +TE +100.00 18.90 TB 198.00 2.00 TR +TE +100.00 18.90 TB 204.00 6.00 TR +TE +100.00 18.90 TB 214.00 4.00 TR +TE +100.00 18.90 TB 220.00 4.00 TR +TE +100.00 18.90 TB 230.00 6.00 TR +TE +100.00 18.90 TB 238.00 2.00 TR +TE +100.00 18.90 TB 242.00 4.00 TR +TE +/Helvetica findfont +dup length dict begin +{1 index /FID ne {def} {pop pop} ifelse} forall +/Encoding ISOLatin1Encoding def +currentdict +end +/Helvetica-ISOLatin1 exch definefont pop +matrix currentmatrix +/Helvetica-ISOLatin1 findfont +14.00 scalefont setfont + 0 0 moveto 123.00 3.50 translate 0.00 rotate 0 0 moveto + (A\\B\)ç\(D) stringwidth +pop +-2 div 0 rmoveto + (A\\B\)ç\(D) show +setmatrix diff --git a/backend/tests/data/eps/code39_fg_bg.eps b/backend/tests/data/eps/code39_fg_bg.eps index 59959e74..89f6cd31 100644 --- a/backend/tests/data/eps/code39_fg_bg.eps +++ b/backend/tests/data/eps/code39_fg_bg.eps @@ -1,8 +1,8 @@ %!PS-Adobe-3.0 EPSF-3.0 -%%Creator: Zint 2.9.0 +%%Creator: Zint 2.9.1.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 128 118 +%%BoundingBox: 0 0 128 119 %%EndComments /TL { setlinewidth moveto lineto stroke } bind def /TD { newpath 0 360 arc fill } bind def @@ -12,63 +12,63 @@ /TE { pop pop } bind def newpath 0.98 0.59 0.19 setrgbcolor -118.00 0.00 TB 0.00 128.00 TR +118.90 0.00 TB 0.00 128.00 TR TE 0.08 0.48 0.81 setrgbcolor -100.00 18.00 TB 0.00 2.00 TR +100.00 18.90 TB 0.00 2.00 TR TE -100.00 18.00 TB 6.00 2.00 TR +100.00 18.90 TB 6.00 2.00 TR TE -100.00 18.00 TB 10.00 4.00 TR +100.00 18.90 TB 10.00 4.00 TR TE -100.00 18.00 TB 16.00 4.00 TR +100.00 18.90 TB 16.00 4.00 TR TE -100.00 18.00 TB 22.00 2.00 TR +100.00 18.90 TB 22.00 2.00 TR TE -100.00 18.00 TB 26.00 4.00 TR +100.00 18.90 TB 26.00 4.00 TR TE -100.00 18.00 TB 32.00 2.00 TR +100.00 18.90 TB 32.00 2.00 TR TE -100.00 18.00 TB 38.00 2.00 TR +100.00 18.90 TB 38.00 2.00 TR TE -100.00 18.00 TB 42.00 2.00 TR +100.00 18.90 TB 42.00 2.00 TR TE -100.00 18.00 TB 46.00 4.00 TR +100.00 18.90 TB 46.00 4.00 TR TE -100.00 18.00 TB 52.00 2.00 TR +100.00 18.90 TB 52.00 2.00 TR TE -100.00 18.00 TB 56.00 4.00 TR +100.00 18.90 TB 56.00 4.00 TR TE -100.00 18.00 TB 64.00 2.00 TR +100.00 18.90 TB 64.00 2.00 TR TE -100.00 18.00 TB 68.00 2.00 TR +100.00 18.90 TB 68.00 2.00 TR TE -100.00 18.00 TB 72.00 4.00 TR +100.00 18.90 TB 72.00 4.00 TR TE -100.00 18.00 TB 78.00 4.00 TR +100.00 18.90 TB 78.00 4.00 TR TE -100.00 18.00 TB 84.00 4.00 TR +100.00 18.90 TB 84.00 4.00 TR TE -100.00 18.00 TB 92.00 2.00 TR +100.00 18.90 TB 92.00 2.00 TR TE -100.00 18.00 TB 96.00 2.00 TR +100.00 18.90 TB 96.00 2.00 TR TE -100.00 18.00 TB 100.00 2.00 TR +100.00 18.90 TB 100.00 2.00 TR TE -100.00 18.00 TB 104.00 2.00 TR +100.00 18.90 TB 104.00 2.00 TR TE -100.00 18.00 TB 110.00 2.00 TR +100.00 18.90 TB 110.00 2.00 TR TE -100.00 18.00 TB 114.00 4.00 TR +100.00 18.90 TB 114.00 4.00 TR TE -100.00 18.00 TB 120.00 4.00 TR +100.00 18.90 TB 120.00 4.00 TR TE -100.00 18.00 TB 126.00 2.00 TR +100.00 18.90 TB 126.00 2.00 TR TE matrix currentmatrix /Helvetica findfont -18.00 scalefont setfont - 0 0 moveto 64.00 0.00 translate 0.00 rotate 0 0 moveto +14.00 scalefont setfont + 0 0 moveto 64.00 3.50 translate 0.00 rotate 0 0 moveto (*123*) stringwidth pop -2 div 0 rmoveto diff --git a/backend/tests/data/eps/dbar_ltd_24724_fig7_bold.eps b/backend/tests/data/eps/dbar_ltd_24724_fig7_bold.eps new file mode 100644 index 00000000..86be5e40 --- /dev/null +++ b/backend/tests/data/eps/dbar_ltd_24724_fig7_bold.eps @@ -0,0 +1,72 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: Zint 2.9.1.9 +%%Title: Zint Generated Symbol +%%Pages: 0 +%%BoundingBox: 0 0 158 119 +%%EndComments +/TL { setlinewidth moveto lineto stroke } bind def +/TD { newpath 0 360 arc fill } bind def +/TH { 0 setlinewidth moveto lineto lineto lineto lineto lineto closepath fill } bind def +/TB { 2 copy } bind def +/TR { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def +/TE { pop pop } bind def +newpath +1.00 1.00 1.00 setrgbcolor +118.90 0.00 TB 0.00 158.00 TR +TE +0.00 0.00 0.00 setrgbcolor +100.00 18.90 TB 2.00 2.00 TR +TE +100.00 18.90 TB 10.00 4.00 TR +TE +100.00 18.90 TB 18.00 4.00 TR +TE +100.00 18.90 TB 28.00 4.00 TR +TE +100.00 18.90 TB 34.00 4.00 TR +TE +100.00 18.90 TB 40.00 2.00 TR +TE +100.00 18.90 TB 44.00 2.00 TR +TE +100.00 18.90 TB 50.00 6.00 TR +TE +100.00 18.90 TB 58.00 2.00 TR +TE +100.00 18.90 TB 64.00 2.00 TR +TE +100.00 18.90 TB 68.00 2.00 TR +TE +100.00 18.90 TB 72.00 4.00 TR +TE +100.00 18.90 TB 78.00 2.00 TR +TE +100.00 18.90 TB 84.00 4.00 TR +TE +100.00 18.90 TB 90.00 2.00 TR +TE +100.00 18.90 TB 96.00 2.00 TR +TE +100.00 18.90 TB 102.00 2.00 TR +TE +100.00 18.90 TB 106.00 4.00 TR +TE +100.00 18.90 TB 116.00 4.00 TR +TE +100.00 18.90 TB 122.00 6.00 TR +TE +100.00 18.90 TB 132.00 4.00 TR +TE +100.00 18.90 TB 140.00 4.00 TR +TE +100.00 18.90 TB 146.00 2.00 TR +TE +matrix currentmatrix +/Helvetica-Bold findfont +14.00 scalefont setfont + 0 0 moveto 79.00 3.50 translate 0.00 rotate 0 0 moveto + (\(01\)15012345678907) stringwidth +pop +-2 div 0 rmoveto + (\(01\)15012345678907) show +setmatrix diff --git a/backend/tests/data/eps/ean13_2addon_ggs_5.2.2.5.1-2.eps b/backend/tests/data/eps/ean13_2addon_ggs_5.2.2.5.1-2.eps new file mode 100644 index 00000000..6d12ac6e --- /dev/null +++ b/backend/tests/data/eps/ean13_2addon_ggs_5.2.2.5.1-2.eps @@ -0,0 +1,127 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: Zint 2.9.1.9 +%%Title: Zint Generated Symbol +%%Pages: 0 +%%BoundingBox: 0 0 276 117 +%%EndComments +/TL { setlinewidth moveto lineto stroke } bind def +/TD { newpath 0 360 arc fill } bind def +/TH { 0 setlinewidth moveto lineto lineto lineto lineto lineto closepath fill } bind def +/TB { 2 copy } bind def +/TR { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def +/TE { pop pop } bind def +newpath +1.00 1.00 1.00 setrgbcolor +116.40 0.00 TB 0.00 276.00 TR +TE +0.00 0.00 0.00 setrgbcolor +110.00 6.40 TB 22.00 2.00 TR +TE +110.00 6.40 TB 26.00 2.00 TR +TE +100.00 16.40 TB 30.00 6.00 TR +TE +100.00 16.40 TB 38.00 4.00 TR +TE +100.00 16.40 TB 46.00 2.00 TR +TE +100.00 16.40 TB 54.00 2.00 TR +TE +100.00 16.40 TB 58.00 4.00 TR +TE +100.00 16.40 TB 66.00 4.00 TR +TE +100.00 16.40 TB 72.00 8.00 TR +TE +100.00 16.40 TB 82.00 2.00 TR +TE +100.00 16.40 TB 90.00 2.00 TR +TE +100.00 16.40 TB 96.00 2.00 TR +TE +100.00 16.40 TB 100.00 2.00 TR +TE +100.00 16.40 TB 108.00 4.00 TR +TE +110.00 6.40 TB 114.00 2.00 TR +TE +110.00 6.40 TB 118.00 2.00 TR +TE +100.00 16.40 TB 122.00 2.00 TR +TE +100.00 16.40 TB 128.00 6.00 TR +TE +100.00 16.40 TB 136.00 4.00 TR +TE +100.00 16.40 TB 142.00 4.00 TR +TE +100.00 16.40 TB 150.00 2.00 TR +TE +100.00 16.40 TB 154.00 6.00 TR +TE +100.00 16.40 TB 164.00 6.00 TR +TE +100.00 16.40 TB 174.00 2.00 TR +TE +100.00 16.40 TB 178.00 4.00 TR +TE +100.00 16.40 TB 186.00 4.00 TR +TE +100.00 16.40 TB 192.00 2.00 TR +TE +100.00 16.40 TB 200.00 2.00 TR +TE +110.00 6.40 TB 206.00 2.00 TR +TE +110.00 6.40 TB 210.00 2.00 TR +TE +91.00 6.40 TB 226.00 2.00 TR +TE +91.00 6.40 TB 230.00 4.00 TR +TE +91.00 6.40 TB 238.00 4.00 TR +TE +91.00 6.40 TB 246.00 2.00 TR +TE +91.00 6.40 TB 250.00 2.00 TR +TE +91.00 6.40 TB 256.00 2.00 TR +TE +91.00 6.40 TB 262.00 4.00 TR +TE +matrix currentmatrix +/Helvetica findfont +20.00 scalefont setfont + 0 0 moveto 12.00 0.40 translate 0.00 rotate 0 0 moveto + (9) stringwidth +pop +neg 0 rmoveto + (9) show +setmatrix +matrix currentmatrix +/Helvetica findfont +20.00 scalefont setfont + 0 0 moveto 70.00 0.40 translate 0.00 rotate 0 0 moveto + (771384) stringwidth +pop +-2 div 0 rmoveto + (771384) show +setmatrix +matrix currentmatrix +/Helvetica findfont +20.00 scalefont setfont + 0 0 moveto 164.00 0.40 translate 0.00 rotate 0 0 moveto + (524017) stringwidth +pop +-2 div 0 rmoveto + (524017) show +setmatrix +matrix currentmatrix +/Helvetica findfont +20.00 scalefont setfont + 0 0 moveto 246.00 101.40 translate 0.00 rotate 0 0 moveto + (12) stringwidth +pop +-2 div 0 rmoveto + (12) show +setmatrix diff --git a/backend/tests/data/eps/ultra_fg_bg.eps b/backend/tests/data/eps/ultra_fg_bg.eps index fcc301b9..d6ad740b 100644 --- a/backend/tests/data/eps/ultra_fg_bg.eps +++ b/backend/tests/data/eps/ultra_fg_bg.eps @@ -1,8 +1,8 @@ %!PS-Adobe-3.0 EPSF-3.0 -%%Creator: Zint 2.9.0 +%%Creator: Zint 2.9.1.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 32 26 +%%BoundingBox: 0 0 28 26 %%EndComments /TL { setlinewidth moveto lineto stroke } bind def /TD { newpath 0 360 arc fill } bind def @@ -12,164 +12,195 @@ /TE { pop pop } bind def newpath 0.98 0.59 0.19 setrgbcolor -26.00 0.00 TB 0.00 32.00 TR +26.00 0.00 TB 0.00 28.00 TR TE 0.00 1.00 1.00 setrgbcolor -2.00 22.00 TB 18.00 4.00 TR +2.00 22.00 TB 16.00 4.00 TR TE -2.00 22.00 TB 24.00 4.00 TR -TE -2.00 20.00 TB 14.00 2.00 TR -TE -2.00 18.00 TB 6.00 2.00 TR -TE -2.00 18.00 TB 18.00 2.00 TR -TE -2.00 18.00 TB 24.00 4.00 TR -TE -2.00 14.00 TB 12.00 2.00 TR -TE -2.00 10.00 TB 12.00 2.00 TR -TE -2.00 10.00 TB 16.00 2.00 TR -TE -2.00 10.00 TB 20.00 8.00 TR -TE -2.00 8.00 TB 6.00 2.00 TR -TE -2.00 8.00 TB 18.00 2.00 TR -TE -2.00 6.00 TB 22.00 4.00 TR -TE -2.00 4.00 TB 12.00 6.00 TR -TE -2.00 4.00 TB 26.00 2.00 TR -TE -2.00 2.00 TB 6.00 2.00 TR -TE -1.00 0.00 1.00 setrgbcolor -2.00 22.00 TB 16.00 2.00 TR -TE -2.00 20.00 TB 6.00 2.00 TR +2.00 22.00 TB 22.00 4.00 TR TE 2.00 20.00 TB 12.00 2.00 TR TE -2.00 20.00 TB 18.00 4.00 TR -TE -2.00 18.00 TB 14.00 2.00 TR -TE -2.00 16.00 TB 16.00 2.00 TR -TE -2.00 16.00 TB 20.00 2.00 TR -TE -2.00 14.00 TB 6.00 2.00 TR -TE -2.00 14.00 TB 18.00 2.00 TR -TE -2.00 14.00 TB 24.00 2.00 TR -TE -2.00 8.00 TB 12.00 2.00 TR -TE -2.00 8.00 TB 20.00 4.00 TR -TE -2.00 8.00 TB 26.00 2.00 TR -TE -2.00 6.00 TB 16.00 2.00 TR -TE -2.00 2.00 TB 12.00 12.00 TR -TE -1.00 1.00 0.00 setrgbcolor -2.00 22.00 TB 6.00 2.00 TR -TE -2.00 22.00 TB 14.00 2.00 TR -TE -2.00 22.00 TB 22.00 2.00 TR +2.00 18.00 TB 4.00 2.00 TR TE 2.00 18.00 TB 16.00 2.00 TR TE -2.00 18.00 TB 22.00 2.00 TR +2.00 18.00 TB 22.00 4.00 TR TE -2.00 16.00 TB 6.00 2.00 TR +2.00 14.00 TB 10.00 2.00 TR TE -2.00 16.00 TB 12.00 2.00 TR +2.00 10.00 TB 10.00 2.00 TR TE -2.00 16.00 TB 18.00 2.00 TR +2.00 10.00 TB 14.00 2.00 TR TE -2.00 16.00 TB 24.00 2.00 TR +2.00 10.00 TB 18.00 8.00 TR TE -2.00 14.00 TB 14.00 4.00 TR +2.00 8.00 TB 4.00 2.00 TR TE -2.00 14.00 TB 22.00 2.00 TR +2.00 8.00 TB 16.00 2.00 TR TE -2.00 14.00 TB 26.00 2.00 TR +2.00 6.00 TB 20.00 4.00 TR TE -2.00 10.00 TB 18.00 2.00 TR -TE -2.00 8.00 TB 14.00 4.00 TR -TE -2.00 6.00 TB 6.00 2.00 TR -TE -2.00 6.00 TB 12.00 2.00 TR -TE -2.00 6.00 TB 18.00 4.00 TR -TE -2.00 6.00 TB 26.00 2.00 TR +2.00 4.00 TB 10.00 6.00 TR TE 2.00 4.00 TB 24.00 2.00 TR TE -2.00 2.00 TB 26.00 2.00 TR +2.00 2.00 TB 4.00 2.00 TR TE -0.00 1.00 0.00 setrgbcolor -2.00 22.00 TB 12.00 2.00 TR +1.00 0.00 1.00 setrgbcolor +2.00 22.00 TB 14.00 2.00 TR TE -2.00 20.00 TB 16.00 2.00 TR +2.00 20.00 TB 4.00 2.00 TR TE -2.00 20.00 TB 22.00 6.00 TR +2.00 20.00 TB 10.00 2.00 TR +TE +2.00 20.00 TB 16.00 4.00 TR TE 2.00 18.00 TB 12.00 2.00 TR TE -2.00 18.00 TB 20.00 2.00 TR -TE 2.00 16.00 TB 14.00 2.00 TR TE -2.00 16.00 TB 22.00 2.00 TR +2.00 16.00 TB 18.00 2.00 TR TE -2.00 16.00 TB 26.00 2.00 TR +2.00 14.00 TB 4.00 2.00 TR TE -2.00 14.00 TB 20.00 2.00 TR +2.00 14.00 TB 16.00 2.00 TR TE -2.00 10.00 TB 6.00 2.00 TR +2.00 14.00 TB 22.00 2.00 TR TE -2.00 10.00 TB 14.00 2.00 TR +2.00 8.00 TB 10.00 2.00 TR +TE +2.00 8.00 TB 18.00 4.00 TR TE 2.00 8.00 TB 24.00 2.00 TR TE 2.00 6.00 TB 14.00 2.00 TR TE -2.00 4.00 TB 6.00 2.00 TR +2.00 2.00 TB 10.00 12.00 TR TE -2.00 4.00 TB 18.00 6.00 TR +1.00 1.00 0.00 setrgbcolor +2.00 22.00 TB 4.00 2.00 TR +TE +2.00 22.00 TB 12.00 2.00 TR +TE +2.00 22.00 TB 20.00 2.00 TR +TE +2.00 18.00 TB 14.00 2.00 TR +TE +2.00 18.00 TB 20.00 2.00 TR +TE +2.00 16.00 TB 4.00 2.00 TR +TE +2.00 16.00 TB 10.00 2.00 TR +TE +2.00 16.00 TB 16.00 2.00 TR +TE +2.00 16.00 TB 22.00 2.00 TR +TE +2.00 14.00 TB 12.00 4.00 TR +TE +2.00 14.00 TB 20.00 2.00 TR +TE +2.00 14.00 TB 24.00 2.00 TR +TE +2.00 10.00 TB 16.00 2.00 TR +TE +2.00 8.00 TB 12.00 4.00 TR +TE +2.00 6.00 TB 4.00 2.00 TR +TE +2.00 6.00 TB 10.00 2.00 TR +TE +2.00 6.00 TB 16.00 4.00 TR +TE +2.00 6.00 TB 24.00 2.00 TR +TE +2.00 4.00 TB 22.00 2.00 TR TE 2.00 2.00 TB 24.00 2.00 TR TE -0.00 0.00 0.00 setrgbcolor -2.00 24.00 TB 2.00 28.00 TR +0.00 1.00 0.00 setrgbcolor +2.00 22.00 TB 10.00 2.00 TR TE +2.00 20.00 TB 14.00 2.00 TR +TE +2.00 20.00 TB 20.00 6.00 TR +TE +2.00 18.00 TB 10.00 2.00 TR +TE +2.00 18.00 TB 18.00 2.00 TR +TE +2.00 16.00 TB 12.00 2.00 TR +TE +2.00 16.00 TB 20.00 2.00 TR +TE +2.00 16.00 TB 24.00 2.00 TR +TE +2.00 14.00 TB 18.00 2.00 TR +TE +2.00 10.00 TB 4.00 2.00 TR +TE +2.00 10.00 TB 12.00 2.00 TR +TE +2.00 8.00 TB 22.00 2.00 TR +TE +2.00 6.00 TB 12.00 2.00 TR +TE +2.00 4.00 TB 4.00 2.00 TR +TE +2.00 4.00 TB 16.00 6.00 TR +TE +2.00 2.00 TB 22.00 2.00 TR +TE +0.00 0.00 0.00 setrgbcolor +2.00 24.00 TB 0.00 28.00 TR +TE +2.00 22.00 TB 0.00 2.00 TR +TE +22.00 2.00 TB 6.00 2.00 TR +TE +22.00 2.00 TB 26.00 2.00 TR +TE +2.00 20.00 TB 0.00 4.00 TR +TE +2.00 18.00 TB 0.00 2.00 TR +TE +2.00 16.00 TB 0.00 4.00 TR +TE +2.00 14.00 TB 0.00 2.00 TR +TE +2.00 12.00 TB 0.00 4.00 TR +TE +2.00 12.00 TB 10.00 2.00 TR +TE +2.00 12.00 TB 14.00 2.00 TR +TE +2.00 12.00 TB 18.00 2.00 TR +TE +2.00 12.00 TB 22.00 2.00 TR +TE +2.00 10.00 TB 0.00 2.00 TR +TE +2.00 8.00 TB 0.00 4.00 TR +TE +2.00 6.00 TB 0.00 2.00 TR +TE +2.00 4.00 TB 0.00 4.00 TR +TE +2.00 2.00 TB 0.00 2.00 TR +TE +2.00 0.00 TB 0.00 28.00 TR +TE +1.00 1.00 1.00 setrgbcolor 2.00 22.00 TB 2.00 2.00 TR TE 22.00 2.00 TB 8.00 2.00 TR TE -22.00 2.00 TB 28.00 2.00 TR -TE -2.00 20.00 TB 2.00 4.00 TR -TE 2.00 18.00 TB 2.00 2.00 TR TE -2.00 16.00 TB 2.00 4.00 TR -TE 2.00 14.00 TB 2.00 2.00 TR TE -2.00 12.00 TB 2.00 4.00 TR +2.00 12.00 TB 4.00 2.00 TR TE 2.00 12.00 TB 12.00 2.00 TR TE @@ -181,38 +212,7 @@ TE TE 2.00 10.00 TB 2.00 2.00 TR TE -2.00 8.00 TB 2.00 4.00 TR -TE 2.00 6.00 TB 2.00 2.00 TR TE -2.00 4.00 TB 2.00 4.00 TR -TE 2.00 2.00 TB 2.00 2.00 TR TE -2.00 0.00 TB 2.00 28.00 TR -TE -1.00 1.00 1.00 setrgbcolor -2.00 22.00 TB 4.00 2.00 TR -TE -22.00 2.00 TB 10.00 2.00 TR -TE -2.00 18.00 TB 4.00 2.00 TR -TE -2.00 14.00 TB 4.00 2.00 TR -TE -2.00 12.00 TB 6.00 2.00 TR -TE -2.00 12.00 TB 14.00 2.00 TR -TE -2.00 12.00 TB 18.00 2.00 TR -TE -2.00 12.00 TB 22.00 2.00 TR -TE -2.00 12.00 TB 26.00 2.00 TR -TE -2.00 10.00 TB 4.00 2.00 TR -TE -2.00 6.00 TB 4.00 2.00 TR -TE -2.00 2.00 TB 4.00 2.00 TR -TE diff --git a/backend/tests/data/eps/upca_2addon_ggs_5.2.6.6-5.eps b/backend/tests/data/eps/upca_2addon_ggs_5.2.6.6-5.eps new file mode 100644 index 00000000..926272d4 --- /dev/null +++ b/backend/tests/data/eps/upca_2addon_ggs_5.2.6.6-5.eps @@ -0,0 +1,133 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: Zint 2.9.1.9 +%%Title: Zint Generated Symbol +%%Pages: 0 +%%BoundingBox: 0 0 276 117 +%%EndComments +/TL { setlinewidth moveto lineto stroke } bind def +/TD { newpath 0 360 arc fill } bind def +/TH { 0 setlinewidth moveto lineto lineto lineto lineto lineto closepath fill } bind def +/TB { 2 copy } bind def +/TR { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def +/TE { pop pop } bind def +newpath +1.00 1.00 1.00 setrgbcolor +116.40 0.00 TB 0.00 276.00 TR +TE +0.00 0.00 0.00 setrgbcolor +110.00 6.40 TB 18.00 2.00 TR +TE +110.00 6.40 TB 22.00 2.00 TR +TE +110.00 6.40 TB 30.00 4.00 TR +TE +110.00 6.40 TB 36.00 2.00 TR +TE +100.00 16.40 TB 42.00 4.00 TR +TE +100.00 16.40 TB 50.00 2.00 TR +TE +100.00 16.40 TB 56.00 2.00 TR +TE +100.00 16.40 TB 62.00 4.00 TR +TE +100.00 16.40 TB 68.00 8.00 TR +TE +100.00 16.40 TB 78.00 2.00 TR +TE +100.00 16.40 TB 82.00 2.00 TR +TE +100.00 16.40 TB 90.00 4.00 TR +TE +100.00 16.40 TB 96.00 4.00 TR +TE +100.00 16.40 TB 106.00 2.00 TR +TE +110.00 6.40 TB 110.00 2.00 TR +TE +110.00 6.40 TB 114.00 2.00 TR +TE +100.00 16.40 TB 118.00 2.00 TR +TE +100.00 16.40 TB 122.00 2.00 TR +TE +100.00 16.40 TB 132.00 2.00 TR +TE +100.00 16.40 TB 140.00 2.00 TR +TE +100.00 16.40 TB 146.00 2.00 TR +TE +100.00 16.40 TB 152.00 2.00 TR +TE +100.00 16.40 TB 160.00 6.00 TR +TE +100.00 16.40 TB 168.00 2.00 TR +TE +100.00 16.40 TB 174.00 6.00 TR +TE +100.00 16.40 TB 184.00 2.00 TR +TE +110.00 6.40 TB 188.00 2.00 TR +TE +110.00 6.40 TB 194.00 6.00 TR +TE +110.00 6.40 TB 202.00 2.00 TR +TE +110.00 6.40 TB 206.00 2.00 TR +TE +81.00 16.40 TB 226.00 2.00 TR +TE +81.00 16.40 TB 230.00 4.00 TR +TE +81.00 16.40 TB 238.00 2.00 TR +TE +81.00 16.40 TB 244.00 4.00 TR +TE +81.00 16.40 TB 250.00 2.00 TR +TE +81.00 16.40 TB 254.00 2.00 TR +TE +81.00 16.40 TB 262.00 4.00 TR +TE +matrix currentmatrix +/Helvetica findfont +14.00 scalefont setfont + 0 0 moveto 8.00 0.40 translate 0.00 rotate 0 0 moveto + (0) stringwidth +pop +neg 0 rmoveto + (0) show +setmatrix +matrix currentmatrix +/Helvetica findfont +20.00 scalefont setfont + 0 0 moveto 72.00 0.40 translate 0.00 rotate 0 0 moveto + (12345) stringwidth +pop +-2 div 0 rmoveto + (12345) show +setmatrix +matrix currentmatrix +/Helvetica findfont +20.00 scalefont setfont + 0 0 moveto 152.00 0.40 translate 0.00 rotate 0 0 moveto + (67890) stringwidth +pop +-2 div 0 rmoveto + (67890) show +setmatrix +matrix currentmatrix +/Helvetica findfont +14.00 scalefont setfont + 0 0 moveto 218.00 0.40 translate 0.00 rotate 0 0 moveto + (5) show +setmatrix +matrix currentmatrix +/Helvetica findfont +20.00 scalefont setfont + 0 0 moveto 246.00 101.40 translate 0.00 rotate 0 0 moveto + (24) stringwidth +pop +-2 div 0 rmoveto + (24) show +setmatrix diff --git a/backend/tests/data/eps/upce_5addon.eps b/backend/tests/data/eps/upce_5addon.eps new file mode 100644 index 00000000..005bfd45 --- /dev/null +++ b/backend/tests/data/eps/upce_5addon.eps @@ -0,0 +1,116 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: Zint 2.9.1.9 +%%Title: Zint Generated Symbol +%%Pages: 0 +%%BoundingBox: 0 0 238 117 +%%EndComments +/TL { setlinewidth moveto lineto stroke } bind def +/TD { newpath 0 360 arc fill } bind def +/TH { 0 setlinewidth moveto lineto lineto lineto lineto lineto closepath fill } bind def +/TB { 2 copy } bind def +/TR { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def +/TE { pop pop } bind def +newpath +1.00 1.00 1.00 setrgbcolor +116.40 0.00 TB 0.00 238.00 TR +TE +0.00 0.00 0.00 setrgbcolor +110.00 6.40 TB 18.00 2.00 TR +TE +110.00 6.40 TB 22.00 2.00 TR +TE +100.00 16.40 TB 26.00 4.00 TR +TE +100.00 16.40 TB 34.00 4.00 TR +TE +100.00 16.40 TB 42.00 2.00 TR +TE +100.00 16.40 TB 48.00 4.00 TR +TE +100.00 16.40 TB 54.00 8.00 TR +TE +100.00 16.40 TB 64.00 2.00 TR +TE +100.00 16.40 TB 70.00 6.00 TR +TE +100.00 16.40 TB 78.00 2.00 TR +TE +100.00 16.40 TB 82.00 6.00 TR +TE +100.00 16.40 TB 92.00 2.00 TR +TE +100.00 16.40 TB 96.00 2.00 TR +TE +100.00 16.40 TB 100.00 8.00 TR +TE +110.00 6.40 TB 110.00 2.00 TR +TE +110.00 6.40 TB 114.00 2.00 TR +TE +110.00 6.40 TB 118.00 2.00 TR +TE +81.00 16.40 TB 134.00 2.00 TR +TE +81.00 16.40 TB 138.00 4.00 TR +TE +81.00 16.40 TB 144.00 4.00 TR +TE +81.00 16.40 TB 152.00 4.00 TR +TE +81.00 16.40 TB 158.00 2.00 TR +TE +81.00 16.40 TB 164.00 2.00 TR +TE +81.00 16.40 TB 170.00 4.00 TR +TE +81.00 16.40 TB 176.00 2.00 TR +TE +81.00 16.40 TB 180.00 2.00 TR +TE +81.00 16.40 TB 190.00 2.00 TR +TE +81.00 16.40 TB 194.00 2.00 TR +TE +81.00 16.40 TB 198.00 2.00 TR +TE +81.00 16.40 TB 206.00 4.00 TR +TE +81.00 16.40 TB 212.00 2.00 TR +TE +81.00 16.40 TB 216.00 4.00 TR +TE +81.00 16.40 TB 226.00 2.00 TR +TE +matrix currentmatrix +/Helvetica findfont +14.00 scalefont setfont + 0 0 moveto 8.00 0.40 translate 0.00 rotate 0 0 moveto + (0) stringwidth +pop +neg 0 rmoveto + (0) show +setmatrix +matrix currentmatrix +/Helvetica findfont +20.00 scalefont setfont + 0 0 moveto 66.00 0.40 translate 0.00 rotate 0 0 moveto + (123456) stringwidth +pop +-2 div 0 rmoveto + (123456) show +setmatrix +matrix currentmatrix +/Helvetica findfont +14.00 scalefont setfont + 0 0 moveto 126.00 0.40 translate 0.00 rotate 0 0 moveto + (5) show +setmatrix +matrix currentmatrix +/Helvetica findfont +20.00 scalefont setfont + 0 0 moveto 182.00 101.40 translate 0.00 rotate 0 0 moveto + (12345) stringwidth +pop +-2 div 0 rmoveto + (12345) show +setmatrix diff --git a/backend/tests/data/eps/upce_5addon_small_bold.eps b/backend/tests/data/eps/upce_5addon_small_bold.eps new file mode 100644 index 00000000..5ab0d2da --- /dev/null +++ b/backend/tests/data/eps/upce_5addon_small_bold.eps @@ -0,0 +1,116 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: Zint 2.9.1.9 +%%Title: Zint Generated Symbol +%%Pages: 0 +%%BoundingBox: 0 0 238 112 +%%EndComments +/TL { setlinewidth moveto lineto stroke } bind def +/TD { newpath 0 360 arc fill } bind def +/TH { 0 setlinewidth moveto lineto lineto lineto lineto lineto closepath fill } bind def +/TB { 2 copy } bind def +/TR { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def +/TE { pop pop } bind def +newpath +1.00 1.00 1.00 setrgbcolor +111.90 0.00 TB 0.00 238.00 TR +TE +0.00 0.00 0.00 setrgbcolor +110.00 1.90 TB 18.00 2.00 TR +TE +110.00 1.90 TB 22.00 2.00 TR +TE +100.00 11.90 TB 26.00 4.00 TR +TE +100.00 11.90 TB 34.00 4.00 TR +TE +100.00 11.90 TB 42.00 2.00 TR +TE +100.00 11.90 TB 48.00 4.00 TR +TE +100.00 11.90 TB 54.00 8.00 TR +TE +100.00 11.90 TB 64.00 2.00 TR +TE +100.00 11.90 TB 70.00 6.00 TR +TE +100.00 11.90 TB 78.00 2.00 TR +TE +100.00 11.90 TB 82.00 6.00 TR +TE +100.00 11.90 TB 92.00 2.00 TR +TE +100.00 11.90 TB 96.00 2.00 TR +TE +100.00 11.90 TB 100.00 8.00 TR +TE +110.00 1.90 TB 110.00 2.00 TR +TE +110.00 1.90 TB 114.00 2.00 TR +TE +110.00 1.90 TB 118.00 2.00 TR +TE +87.00 11.90 TB 134.00 2.00 TR +TE +87.00 11.90 TB 138.00 4.00 TR +TE +87.00 11.90 TB 144.00 4.00 TR +TE +87.00 11.90 TB 152.00 4.00 TR +TE +87.00 11.90 TB 158.00 2.00 TR +TE +87.00 11.90 TB 164.00 2.00 TR +TE +87.00 11.90 TB 170.00 4.00 TR +TE +87.00 11.90 TB 176.00 2.00 TR +TE +87.00 11.90 TB 180.00 2.00 TR +TE +87.00 11.90 TB 190.00 2.00 TR +TE +87.00 11.90 TB 194.00 2.00 TR +TE +87.00 11.90 TB 198.00 2.00 TR +TE +87.00 11.90 TB 206.00 4.00 TR +TE +87.00 11.90 TB 212.00 2.00 TR +TE +87.00 11.90 TB 216.00 4.00 TR +TE +87.00 11.90 TB 226.00 2.00 TR +TE +matrix currentmatrix +/Helvetica-Bold findfont +12.00 scalefont setfont + 0 0 moveto 8.00 0.40 translate 0.00 rotate 0 0 moveto + (0) stringwidth +pop +neg 0 rmoveto + (0) show +setmatrix +matrix currentmatrix +/Helvetica-Bold findfont +14.00 scalefont setfont + 0 0 moveto 66.00 0.40 translate 0.00 rotate 0 0 moveto + (123456) stringwidth +pop +-2 div 0 rmoveto + (123456) show +setmatrix +matrix currentmatrix +/Helvetica-Bold findfont +12.00 scalefont setfont + 0 0 moveto 126.00 0.40 translate 0.00 rotate 0 0 moveto + (5) show +setmatrix +matrix currentmatrix +/Helvetica-Bold findfont +14.00 scalefont setfont + 0 0 moveto 182.00 101.40 translate 0.00 rotate 0 0 moveto + (12345) stringwidth +pop +-2 div 0 rmoveto + (12345) show +setmatrix diff --git a/backend/tests/data/png/codablockf_3rows.png b/backend/tests/data/png/codablockf_3rows.png index cc18fc8b..90ef5c07 100644 Binary files a/backend/tests/data/png/codablockf_3rows.png and b/backend/tests/data/png/codablockf_3rows.png differ diff --git a/backend/tests/data/png/code128_egrave_bold.png b/backend/tests/data/png/code128_egrave_bold.png new file mode 100644 index 00000000..dccdfb59 Binary files /dev/null and b/backend/tests/data/png/code128_egrave_bold.png differ diff --git a/backend/tests/data/png/code128_egrave_bold_box3.png b/backend/tests/data/png/code128_egrave_bold_box3.png new file mode 100644 index 00000000..6edfb65b Binary files /dev/null and b/backend/tests/data/png/code128_egrave_bold_box3.png differ diff --git a/backend/tests/data/png/code39_small.png b/backend/tests/data/png/code39_small.png new file mode 100644 index 00000000..09985dc4 Binary files /dev/null and b/backend/tests/data/png/code39_small.png differ diff --git a/backend/tests/data/png/ean13_cc_2addon_cca_4x4.png b/backend/tests/data/png/ean13_cc_2addon_cca_4x4.png new file mode 100644 index 00000000..3fb571c0 Binary files /dev/null and b/backend/tests/data/png/ean13_cc_2addon_cca_4x4.png differ diff --git a/backend/tests/data/png/ean13_cc_5addon_ccb_3x4.png b/backend/tests/data/png/ean13_cc_5addon_ccb_3x4.png new file mode 100644 index 00000000..2bcf13cb Binary files /dev/null and b/backend/tests/data/png/ean13_cc_5addon_ccb_3x4.png differ diff --git a/backend/tests/data/png/ean13_cc_5addon_ccb_3x4_notext.png b/backend/tests/data/png/ean13_cc_5addon_ccb_3x4_notext.png new file mode 100644 index 00000000..89fc6b00 Binary files /dev/null and b/backend/tests/data/png/ean13_cc_5addon_ccb_3x4_notext.png differ diff --git a/backend/tests/data/png/ean8_cc_2addon_cca_4x3.png b/backend/tests/data/png/ean8_cc_2addon_cca_4x3.png new file mode 100644 index 00000000..8f524706 Binary files /dev/null and b/backend/tests/data/png/ean8_cc_2addon_cca_4x3.png differ diff --git a/backend/tests/data/png/ean8_cc_5addon_ccb_8x3.png b/backend/tests/data/png/ean8_cc_5addon_ccb_8x3.png new file mode 100644 index 00000000..572f914e Binary files /dev/null and b/backend/tests/data/png/ean8_cc_5addon_ccb_8x3.png differ diff --git a/backend/tests/data/png/gs1_128_cc_fig12.png b/backend/tests/data/png/gs1_128_cc_fig12.png new file mode 100644 index 00000000..38a44e0f Binary files /dev/null and b/backend/tests/data/png/gs1_128_cc_fig12.png differ diff --git a/backend/tests/data/png/postnet_zip.png b/backend/tests/data/png/postnet_zip.png new file mode 100644 index 00000000..90e72123 Binary files /dev/null and b/backend/tests/data/png/postnet_zip.png differ diff --git a/backend/tests/data/png/upca_5addon_bind3.png b/backend/tests/data/png/upca_5addon_bind3.png new file mode 100644 index 00000000..11da1cf6 Binary files /dev/null and b/backend/tests/data/png/upca_5addon_bind3.png differ diff --git a/backend/tests/data/png/upca_5addon_notext.png b/backend/tests/data/png/upca_5addon_notext.png new file mode 100644 index 00000000..faf3b144 Binary files /dev/null and b/backend/tests/data/png/upca_5addon_notext.png differ diff --git a/backend/tests/data/png/upca_cc_2addon_cca_3x4.png b/backend/tests/data/png/upca_cc_2addon_cca_3x4.png new file mode 100644 index 00000000..262ec095 Binary files /dev/null and b/backend/tests/data/png/upca_cc_2addon_cca_3x4.png differ diff --git a/backend/tests/data/png/upca_cc_5addon_ccb_4x4.png b/backend/tests/data/png/upca_cc_5addon_ccb_4x4.png new file mode 100644 index 00000000..cb914998 Binary files /dev/null and b/backend/tests/data/png/upca_cc_5addon_ccb_4x4.png differ diff --git a/backend/tests/data/png/upca_cc_5addon_ccb_4x4_bind3.png b/backend/tests/data/png/upca_cc_5addon_ccb_4x4_bind3.png new file mode 100644 index 00000000..6783d167 Binary files /dev/null and b/backend/tests/data/png/upca_cc_5addon_ccb_4x4_bind3.png differ diff --git a/backend/tests/data/png/upca_cc_5addon_ccb_4x4_notext.png b/backend/tests/data/png/upca_cc_5addon_ccb_4x4_notext.png new file mode 100644 index 00000000..d098f7db Binary files /dev/null and b/backend/tests/data/png/upca_cc_5addon_ccb_4x4_notext.png differ diff --git a/backend/tests/data/png/upce_cc_2addon_cca_5x2.png b/backend/tests/data/png/upce_cc_2addon_cca_5x2.png new file mode 100644 index 00000000..5508fbed Binary files /dev/null and b/backend/tests/data/png/upce_cc_2addon_cca_5x2.png differ diff --git a/backend/tests/data/png/upce_cc_5addon_ccb_8x2.png b/backend/tests/data/png/upce_cc_5addon_ccb_8x2.png new file mode 100644 index 00000000..b93ef461 Binary files /dev/null and b/backend/tests/data/png/upce_cc_5addon_ccb_8x2.png differ diff --git a/backend/tests/data/png/upce_cc_5addon_ccb_8x2_notext.png b/backend/tests/data/png/upce_cc_5addon_ccb_8x2_notext.png new file mode 100644 index 00000000..8874016f Binary files /dev/null and b/backend/tests/data/png/upce_cc_5addon_ccb_8x2_notext.png differ diff --git a/backend/tests/data/print/bmp/dotcode_aim_fig7.bmp b/backend/tests/data/print/bmp/dotcode_aim_fig7.bmp index bb0133b5..69bb9520 100644 Binary files a/backend/tests/data/print/bmp/dotcode_aim_fig7.bmp and b/backend/tests/data/print/bmp/dotcode_aim_fig7.bmp differ diff --git a/backend/tests/data/print/emf/code128_aim.emf b/backend/tests/data/print/emf/code128_aim.emf index a6466462..8ea27995 100644 Binary files a/backend/tests/data/print/emf/code128_aim.emf and b/backend/tests/data/print/emf/code128_aim.emf differ diff --git a/backend/tests/data/print/emf/dotcode_aim_fig7.emf b/backend/tests/data/print/emf/dotcode_aim_fig7.emf index 05e65d47..741e222b 100644 Binary files a/backend/tests/data/print/emf/dotcode_aim_fig7.emf and b/backend/tests/data/print/emf/dotcode_aim_fig7.emf differ diff --git a/backend/tests/data/print/emf/qr_v1_m.emf b/backend/tests/data/print/emf/qr_v1_m.emf index 33041d57..2493b9fd 100644 Binary files a/backend/tests/data/print/emf/qr_v1_m.emf and b/backend/tests/data/print/emf/qr_v1_m.emf differ diff --git a/backend/tests/data/print/emf/ultracode_a.emf b/backend/tests/data/print/emf/ultracode_a.emf index 2e1296e9..9cc2caa1 100644 Binary files a/backend/tests/data/print/emf/ultracode_a.emf and b/backend/tests/data/print/emf/ultracode_a.emf differ diff --git a/backend/tests/data/print/eps/code128_aim.eps b/backend/tests/data/print/eps/code128_aim.eps index 78f277d1..b97fb02f 100644 --- a/backend/tests/data/print/eps/code128_aim.eps +++ b/backend/tests/data/print/eps/code128_aim.eps @@ -1,8 +1,8 @@ %!PS-Adobe-3.0 EPSF-3.0 -%%Creator: Zint 2.9.0 +%%Creator: Zint 2.9.1.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 136 118 +%%BoundingBox: 0 0 136 119 %%EndComments /TL { setlinewidth moveto lineto stroke } bind def /TD { newpath 0 360 arc fill } bind def @@ -12,51 +12,51 @@ /TE { pop pop } bind def newpath 1.00 1.00 1.00 setrgbcolor -118.00 0.00 TB 0.00 136.00 TR +118.90 0.00 TB 0.00 136.00 TR TE 0.00 0.00 0.00 setrgbcolor -100.00 18.00 TB 0.00 4.00 TR +100.00 18.90 TB 0.00 4.00 TR TE -100.00 18.00 TB 6.00 2.00 TR +100.00 18.90 TB 6.00 2.00 TR TE -100.00 18.00 TB 12.00 2.00 TR +100.00 18.90 TB 12.00 2.00 TR TE -100.00 18.00 TB 22.00 2.00 TR +100.00 18.90 TB 22.00 2.00 TR TE -100.00 18.00 TB 26.00 2.00 TR +100.00 18.90 TB 26.00 2.00 TR TE -100.00 18.00 TB 34.00 4.00 TR +100.00 18.90 TB 34.00 4.00 TR TE -100.00 18.00 TB 44.00 4.00 TR +100.00 18.90 TB 44.00 4.00 TR TE -100.00 18.00 TB 54.00 2.00 TR +100.00 18.90 TB 54.00 2.00 TR TE -100.00 18.00 TB 62.00 2.00 TR +100.00 18.90 TB 62.00 2.00 TR TE -100.00 18.00 TB 66.00 2.00 TR +100.00 18.90 TB 66.00 2.00 TR TE -100.00 18.00 TB 70.00 6.00 TR +100.00 18.90 TB 70.00 6.00 TR TE -100.00 18.00 TB 78.00 4.00 TR +100.00 18.90 TB 78.00 4.00 TR TE -100.00 18.00 TB 88.00 2.00 TR +100.00 18.90 TB 88.00 2.00 TR TE -100.00 18.00 TB 92.00 6.00 TR +100.00 18.90 TB 92.00 6.00 TR TE -100.00 18.00 TB 100.00 4.00 TR +100.00 18.90 TB 100.00 4.00 TR TE -100.00 18.00 TB 110.00 4.00 TR +100.00 18.90 TB 110.00 4.00 TR TE -100.00 18.00 TB 120.00 6.00 TR +100.00 18.90 TB 120.00 6.00 TR TE -100.00 18.00 TB 128.00 2.00 TR +100.00 18.90 TB 128.00 2.00 TR TE -100.00 18.00 TB 132.00 4.00 TR +100.00 18.90 TB 132.00 4.00 TR TE matrix currentmatrix /Helvetica findfont -18.00 scalefont setfont - 0 0 moveto 68.00 0.00 translate 0.00 rotate 0 0 moveto +14.00 scalefont setfont + 0 0 moveto 68.00 3.50 translate 0.00 rotate 0 0 moveto (AIM) stringwidth pop -2 div 0 rmoveto diff --git a/backend/tests/data/print/eps/dotcode_aim_fig7.eps b/backend/tests/data/print/eps/dotcode_aim_fig7.eps index 7b207422..61730583 100644 --- a/backend/tests/data/print/eps/dotcode_aim_fig7.eps +++ b/backend/tests/data/print/eps/dotcode_aim_fig7.eps @@ -1,8 +1,8 @@ %!PS-Adobe-3.0 EPSF-3.0 -%%Creator: Zint 2.9.0 +%%Creator: Zint 2.9.1.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 26 20 +%%BoundingBox: 0 0 130 100 %%EndComments /TL { setlinewidth moveto lineto stroke } bind def /TD { newpath 0 360 arc fill } bind def @@ -12,45 +12,45 @@ /TE { pop pop } bind def newpath 1.00 1.00 1.00 setrgbcolor -20.00 0.00 TB 0.00 26.00 TR +100.00 0.00 TB 0.00 130.00 TR TE 0.00 0.00 0.00 setrgbcolor -1.00 19.00 1.00 TD -5.00 19.00 1.00 TD -13.00 19.00 1.00 TD -17.00 19.00 1.00 TD -21.00 19.00 1.00 TD -25.00 19.00 1.00 TD -7.00 17.00 1.00 TD -1.00 15.00 1.00 TD -9.00 15.00 1.00 TD -17.00 15.00 1.00 TD -21.00 15.00 1.00 TD -25.00 15.00 1.00 TD -3.00 13.00 1.00 TD -15.00 13.00 1.00 TD -19.00 13.00 1.00 TD -9.00 11.00 1.00 TD -13.00 11.00 1.00 TD -21.00 11.00 1.00 TD -3.00 9.00 1.00 TD -11.00 9.00 1.00 TD -23.00 9.00 1.00 TD -1.00 7.00 1.00 TD -9.00 7.00 1.00 TD -13.00 7.00 1.00 TD -17.00 7.00 1.00 TD -25.00 7.00 1.00 TD -3.00 5.00 1.00 TD -7.00 5.00 1.00 TD -11.00 5.00 1.00 TD -19.00 5.00 1.00 TD -1.00 3.00 1.00 TD -9.00 3.00 1.00 TD -17.00 3.00 1.00 TD -21.00 3.00 1.00 TD -25.00 3.00 1.00 TD -3.00 1.00 1.00 TD -7.00 1.00 1.00 TD -15.00 1.00 1.00 TD -23.00 1.00 1.00 TD +4.00 96.00 4.00 TD +24.00 96.00 4.00 TD +64.00 96.00 4.00 TD +84.00 96.00 4.00 TD +104.00 96.00 4.00 TD +124.00 96.00 4.00 TD +34.00 86.00 4.00 TD +4.00 76.00 4.00 TD +44.00 76.00 4.00 TD +84.00 76.00 4.00 TD +104.00 76.00 4.00 TD +124.00 76.00 4.00 TD +14.00 66.00 4.00 TD +74.00 66.00 4.00 TD +94.00 66.00 4.00 TD +44.00 56.00 4.00 TD +64.00 56.00 4.00 TD +104.00 56.00 4.00 TD +14.00 46.00 4.00 TD +54.00 46.00 4.00 TD +114.00 46.00 4.00 TD +4.00 36.00 4.00 TD +44.00 36.00 4.00 TD +64.00 36.00 4.00 TD +84.00 36.00 4.00 TD +124.00 36.00 4.00 TD +14.00 26.00 4.00 TD +34.00 26.00 4.00 TD +54.00 26.00 4.00 TD +94.00 26.00 4.00 TD +4.00 16.00 4.00 TD +44.00 16.00 4.00 TD +84.00 16.00 4.00 TD +104.00 16.00 4.00 TD +124.00 16.00 4.00 TD +14.00 6.00 4.00 TD +34.00 6.00 4.00 TD +74.00 6.00 4.00 TD +114.00 6.00 4.00 TD diff --git a/backend/tests/data/print/eps/qr_v1_m.eps b/backend/tests/data/print/eps/qr_v1_m.eps index cf473d3a..ab46ffdc 100644 --- a/backend/tests/data/print/eps/qr_v1_m.eps +++ b/backend/tests/data/print/eps/qr_v1_m.eps @@ -1,5 +1,5 @@ %!PS-Adobe-3.0 EPSF-3.0 -%%Creator: Zint 2.9.0 +%%Creator: Zint 2.9.1.9 %%Title: Zint Generated Symbol %%Pages: 0 %%BoundingBox: 0 0 42 42 diff --git a/backend/tests/data/print/eps/ultracode_a.eps b/backend/tests/data/print/eps/ultracode_a.eps index 59a5b773..96b1a147 100644 --- a/backend/tests/data/print/eps/ultracode_a.eps +++ b/backend/tests/data/print/eps/ultracode_a.eps @@ -1,5 +1,5 @@ %!PS-Adobe-3.0 EPSF-3.0 -%%Creator: Zint 2.9.0 +%%Creator: Zint 2.9.1.9 %%Title: Zint Generated Symbol %%Pages: 0 %%BoundingBox: 0 0 26 26 diff --git a/backend/tests/data/print/gif/dotcode_aim_fig7.gif b/backend/tests/data/print/gif/dotcode_aim_fig7.gif index a61fee6a..e82f1425 100644 Binary files a/backend/tests/data/print/gif/dotcode_aim_fig7.gif and b/backend/tests/data/print/gif/dotcode_aim_fig7.gif differ diff --git a/backend/tests/data/print/pcx/dotcode_aim_fig7.pcx b/backend/tests/data/print/pcx/dotcode_aim_fig7.pcx index 9fa0bfe6..7b6bf7b8 100644 Binary files a/backend/tests/data/print/pcx/dotcode_aim_fig7.pcx and b/backend/tests/data/print/pcx/dotcode_aim_fig7.pcx differ diff --git a/backend/tests/data/print/png/dotcode_aim_fig7.png b/backend/tests/data/print/png/dotcode_aim_fig7.png index 3d7b7119..3a38e294 100644 Binary files a/backend/tests/data/print/png/dotcode_aim_fig7.png and b/backend/tests/data/print/png/dotcode_aim_fig7.png differ diff --git a/backend/tests/data/print/svg/code128_aim.svg b/backend/tests/data/print/svg/code128_aim.svg index dbafcbb1..4f20b887 100644 --- a/backend/tests/data/print/svg/code128_aim.svg +++ b/backend/tests/data/print/svg/code128_aim.svg @@ -1,13 +1,13 @@ - Zint Generated Symbol - + @@ -27,8 +27,8 @@ - + AIM diff --git a/backend/tests/data/print/svg/dotcode_aim_fig7.svg b/backend/tests/data/print/svg/dotcode_aim_fig7.svg index 6273525f..7966d67c 100644 --- a/backend/tests/data/print/svg/dotcode_aim_fig7.svg +++ b/backend/tests/data/print/svg/dotcode_aim_fig7.svg @@ -1,51 +1,51 @@ - Zint Generated Symbol - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/tests/data/print/tif/dotcode_aim_fig7.tif b/backend/tests/data/print/tif/dotcode_aim_fig7.tif index 83b548fd..74f4dcc2 100644 Binary files a/backend/tests/data/print/tif/dotcode_aim_fig7.tif and b/backend/tests/data/print/tif/dotcode_aim_fig7.tif differ diff --git a/backend/tests/data/svg/codablockf_3rows.svg b/backend/tests/data/svg/codablockf_3rows.svg index ece7188d..0645033f 100644 --- a/backend/tests/data/svg/codablockf_3rows.svg +++ b/backend/tests/data/svg/codablockf_3rows.svg @@ -1,63 +1,63 @@ - Zint Generated Symbol - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/tests/data/svg/code128_amperands.svg b/backend/tests/data/svg/code128_amperands.svg index 071b7c66..28c0ee97 100644 --- a/backend/tests/data/svg/code128_amperands.svg +++ b/backend/tests/data/svg/code128_amperands.svg @@ -1,13 +1,13 @@ - Zint Generated Symbol - + @@ -33,8 +33,8 @@ - + <>"&' diff --git a/backend/tests/data/svg/code128_egrave_bold.svg b/backend/tests/data/svg/code128_egrave_bold.svg new file mode 100644 index 00000000..0981b05f --- /dev/null +++ b/backend/tests/data/svg/code128_egrave_bold.svg @@ -0,0 +1,47 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Égjpqy + + + diff --git a/backend/tests/data/svg/code128_egrave_bold_box3.svg b/backend/tests/data/svg/code128_egrave_bold_box3.svg new file mode 100644 index 00000000..23d66bcd --- /dev/null +++ b/backend/tests/data/svg/code128_egrave_bold_box3.svg @@ -0,0 +1,51 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Égjpqy + + + diff --git a/backend/tests/data/svg/code39_small.svg b/backend/tests/data/svg/code39_small.svg new file mode 100644 index 00000000..c93b6d41 --- /dev/null +++ b/backend/tests/data/svg/code39_small.svg @@ -0,0 +1,41 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + *123* + + + diff --git a/backend/tests/data/svg/ean13_2addon_ggs_5.2.2.5.1-2.svg b/backend/tests/data/svg/ean13_2addon_ggs_5.2.2.5.1-2.svg index 27a04678..f735e419 100644 --- a/backend/tests/data/svg/ean13_2addon_ggs_5.2.2.5.1-2.svg +++ b/backend/tests/data/svg/ean13_2addon_ggs_5.2.2.5.1-2.svg @@ -1,13 +1,13 @@ - Zint Generated Symbol - + @@ -38,27 +38,27 @@ - - - - - - - - + + + + + + + + 9 - + 771384 - + 524017 - + 12 diff --git a/backend/tests/data/svg/ean13_5addon_ggs_5.2.2.5.2-2.svg b/backend/tests/data/svg/ean13_5addon_ggs_5.2.2.5.2-2.svg index 6865935e..9186e92c 100644 --- a/backend/tests/data/svg/ean13_5addon_ggs_5.2.2.5.2-2.svg +++ b/backend/tests/data/svg/ean13_5addon_ggs_5.2.2.5.2-2.svg @@ -1,13 +1,13 @@ - Zint Generated Symbol - + @@ -38,36 +38,36 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + 9 - + 780877 - + 799306 - + 54321 diff --git a/backend/tests/data/svg/ean13_cc_2addon_cca_4x4.svg b/backend/tests/data/svg/ean13_cc_2addon_cca_4x4.svg new file mode 100644 index 00000000..866b9d09 --- /dev/null +++ b/backend/tests/data/svg/ean13_cc_2addon_cca_4x4.svg @@ -0,0 +1,147 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + 234567 + + + 890128 + + + 12 + + + diff --git a/backend/tests/data/svg/ean13_cc_5addon_ccb_3x4.svg b/backend/tests/data/svg/ean13_cc_5addon_ccb_3x4.svg new file mode 100644 index 00000000..f57b25b4 --- /dev/null +++ b/backend/tests/data/svg/ean13_cc_5addon_ccb_3x4.svg @@ -0,0 +1,154 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + 234567 + + + 890128 + + + 54321 + + + diff --git a/backend/tests/data/svg/ean13_cc_5addon_ccb_3x4_notext.svg b/backend/tests/data/svg/ean13_cc_5addon_ccb_3x4_notext.svg new file mode 100644 index 00000000..c56eeb39 --- /dev/null +++ b/backend/tests/data/svg/ean13_cc_5addon_ccb_3x4_notext.svg @@ -0,0 +1,138 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/tests/data/svg/ean2.svg b/backend/tests/data/svg/ean2.svg index 25b31406..ac209e03 100644 --- a/backend/tests/data/svg/ean2.svg +++ b/backend/tests/data/svg/ean2.svg @@ -1,13 +1,13 @@ - Zint Generated Symbol - + @@ -15,8 +15,8 @@ - + 12 diff --git a/backend/tests/data/svg/ean5.svg b/backend/tests/data/svg/ean5.svg index 30fd272f..4ced2d75 100644 --- a/backend/tests/data/svg/ean5.svg +++ b/backend/tests/data/svg/ean5.svg @@ -1,13 +1,13 @@ - Zint Generated Symbol - + @@ -24,8 +24,8 @@ - + 12345 diff --git a/backend/tests/data/svg/ean8_2addon.svg b/backend/tests/data/svg/ean8_2addon.svg index a61763ff..1639f733 100644 --- a/backend/tests/data/svg/ean8_2addon.svg +++ b/backend/tests/data/svg/ean8_2addon.svg @@ -1,13 +1,13 @@ - Zint Generated Symbol - + @@ -30,23 +30,23 @@ - - - - - - - - + + + + + + + + 1234 - + 5670 - + 12 diff --git a/backend/tests/data/svg/ean8_5addon.svg b/backend/tests/data/svg/ean8_5addon.svg index 4d010166..01e82906 100644 --- a/backend/tests/data/svg/ean8_5addon.svg +++ b/backend/tests/data/svg/ean8_5addon.svg @@ -1,13 +1,13 @@ - Zint Generated Symbol - + @@ -30,32 +30,32 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + 1234 - + 5670 - + 12345 diff --git a/backend/tests/data/svg/ean8_cc_2addon_cca_4x3.svg b/backend/tests/data/svg/ean8_cc_2addon_cca_4x3.svg new file mode 100644 index 00000000..f6c85896 --- /dev/null +++ b/backend/tests/data/svg/ean8_cc_2addon_cca_4x3.svg @@ -0,0 +1,116 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 9876 + + + 5430 + + + 65 + + + diff --git a/backend/tests/data/svg/ean8_cc_5addon_ccb_8x3.svg b/backend/tests/data/svg/ean8_cc_5addon_ccb_8x3.svg new file mode 100644 index 00000000..2807b850 --- /dev/null +++ b/backend/tests/data/svg/ean8_cc_5addon_ccb_8x3.svg @@ -0,0 +1,182 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 9876 + + + 5430 + + + 74083 + + + diff --git a/backend/tests/data/svg/gs1_128_cc_fig12.svg b/backend/tests/data/svg/gs1_128_cc_fig12.svg new file mode 100644 index 00000000..9ade7617 --- /dev/null +++ b/backend/tests/data/svg/gs1_128_cc_fig12.svg @@ -0,0 +1,252 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (00)030123456789012340 + + + diff --git a/backend/tests/data/svg/postnet_zip.svg b/backend/tests/data/svg/postnet_zip.svg new file mode 100644 index 00000000..cef9a9d8 --- /dev/null +++ b/backend/tests/data/svg/postnet_zip.svg @@ -0,0 +1,44 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/tests/data/svg/upca_2addon_ggs_5.2.6.6-5.svg b/backend/tests/data/svg/upca_2addon_ggs_5.2.6.6-5.svg index f7898ce9..cd62aa7f 100644 --- a/backend/tests/data/svg/upca_2addon_ggs_5.2.6.6-5.svg +++ b/backend/tests/data/svg/upca_2addon_ggs_5.2.6.6-5.svg @@ -1,13 +1,13 @@ - Zint Generated Symbol - + @@ -38,31 +38,31 @@ - - - - - - - - + + + + + + + + 0 - + 12345 - + 67890 - + 5 - + 24 diff --git a/backend/tests/data/svg/upca_5addon.svg b/backend/tests/data/svg/upca_5addon.svg index ade5bb02..e0d489f7 100644 --- a/backend/tests/data/svg/upca_5addon.svg +++ b/backend/tests/data/svg/upca_5addon.svg @@ -1,13 +1,13 @@ - Zint Generated Symbol - + @@ -38,40 +38,40 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + 6 - + 14141 - + 23441 - + 7 - + 12345 diff --git a/backend/tests/data/svg/upca_5addon_bind3.svg b/backend/tests/data/svg/upca_5addon_bind3.svg new file mode 100644 index 00000000..ade6f752 --- /dev/null +++ b/backend/tests/data/svg/upca_5addon_bind3.svg @@ -0,0 +1,80 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6 + + + 14141 + + + 23441 + + + 7 + + + 12345 + + + diff --git a/backend/tests/data/svg/upca_5addon_small_bold.svg b/backend/tests/data/svg/upca_5addon_small_bold.svg new file mode 100644 index 00000000..35d676f4 --- /dev/null +++ b/backend/tests/data/svg/upca_5addon_small_bold.svg @@ -0,0 +1,78 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6 + + + 14141 + + + 23441 + + + 7 + + + 12345 + + + diff --git a/backend/tests/data/svg/upca_cc_2addon_cca_3x4.svg b/backend/tests/data/svg/upca_cc_2addon_cca_3x4.svg new file mode 100644 index 00000000..d8b7d2e6 --- /dev/null +++ b/backend/tests/data/svg/upca_cc_2addon_cca_3x4.svg @@ -0,0 +1,134 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + 23456 + + + 78901 + + + 2 + + + 12 + + + diff --git a/backend/tests/data/svg/upca_cc_5addon_ccb_4x4.svg b/backend/tests/data/svg/upca_cc_5addon_ccb_4x4.svg new file mode 100644 index 00000000..92a8abca --- /dev/null +++ b/backend/tests/data/svg/upca_cc_5addon_ccb_4x4.svg @@ -0,0 +1,158 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + 23456 + + + 78901 + + + 2 + + + 12121 + + + diff --git a/backend/tests/data/svg/upca_cc_5addon_ccb_4x4_bind3.svg b/backend/tests/data/svg/upca_cc_5addon_ccb_4x4_bind3.svg new file mode 100644 index 00000000..7d39e0ec --- /dev/null +++ b/backend/tests/data/svg/upca_cc_5addon_ccb_4x4_bind3.svg @@ -0,0 +1,160 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + 23456 + + + 78901 + + + 2 + + + 12121 + + + diff --git a/backend/tests/data/svg/upca_cc_5addon_ccb_4x4_notext.svg b/backend/tests/data/svg/upca_cc_5addon_ccb_4x4_notext.svg new file mode 100644 index 00000000..0fc3fda0 --- /dev/null +++ b/backend/tests/data/svg/upca_cc_5addon_ccb_4x4_notext.svg @@ -0,0 +1,138 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/tests/data/svg/upce_2addon.svg b/backend/tests/data/svg/upce_2addon.svg index 6676ab04..d41ddf07 100644 --- a/backend/tests/data/svg/upce_2addon.svg +++ b/backend/tests/data/svg/upce_2addon.svg @@ -1,13 +1,13 @@ - Zint Generated Symbol - + @@ -25,27 +25,27 @@ - - - - - - - - + + + + + + + + 1 - + 234567 - + 0 - + 12 diff --git a/backend/tests/data/svg/upce_5addon.svg b/backend/tests/data/svg/upce_5addon.svg index 8bbec68b..545e6b0f 100644 --- a/backend/tests/data/svg/upce_5addon.svg +++ b/backend/tests/data/svg/upce_5addon.svg @@ -1,13 +1,13 @@ - Zint Generated Symbol - + @@ -25,36 +25,36 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + 1 - + 234567 - + 0 - + 12345 diff --git a/backend/tests/data/svg/upce_5addon_notext.svg b/backend/tests/data/svg/upce_5addon_notext.svg new file mode 100644 index 00000000..7c7f359d --- /dev/null +++ b/backend/tests/data/svg/upce_5addon_notext.svg @@ -0,0 +1,45 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/tests/data/svg/upce_cc_2addon_cca_5x2.svg b/backend/tests/data/svg/upce_cc_2addon_cca_5x2.svg new file mode 100644 index 00000000..8c8d334e --- /dev/null +++ b/backend/tests/data/svg/upce_cc_2addon_cca_5x2.svg @@ -0,0 +1,107 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 654321 + + + 7 + + + 89 + + + diff --git a/backend/tests/data/svg/upce_cc_5addon_ccb_8x2.svg b/backend/tests/data/svg/upce_cc_5addon_ccb_8x2.svg new file mode 100644 index 00000000..0a071432 --- /dev/null +++ b/backend/tests/data/svg/upce_cc_5addon_ccb_8x2.svg @@ -0,0 +1,142 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + 876543 + + + 5 + + + 56789 + + + diff --git a/backend/tests/data/svg/upce_cc_5addon_ccb_8x2_notext.svg b/backend/tests/data/svg/upce_cc_5addon_ccb_8x2_notext.svg new file mode 100644 index 00000000..5a16d4cb --- /dev/null +++ b/backend/tests/data/svg/upce_cc_5addon_ccb_8x2_notext.svg @@ -0,0 +1,126 @@ + + + + Zint Generated Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/tests/test_2of5.c b/backend/tests/test_2of5.c index 29add982..d6170b5d 100644 --- a/backend/tests/test_2of5.c +++ b/backend/tests/test_2of5.c @@ -280,19 +280,17 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); - } + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, -1, -1, debug)) { - ret = testUtilBwipp(symbol, -1, -1, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + ret = testUtilBwipp(i, symbol, -1, -1, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_auspost.c b/backend/tests/test_auspost.c index 54263dcd..499474f2 100644 --- a/backend/tests/test_auspost.c +++ b/backend/tests/test_auspost.c @@ -196,6 +196,8 @@ static void test_encode(int index, int generate, int debug) { testStart(""); + int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise + int ret; struct item { int symbology; @@ -208,22 +210,42 @@ static void test_encode(int index, int generate, int debug) { char *expected; }; struct item data[] = { - /* 0*/ { BARCODE_AUSPOST, "119618420932573854", 0, 3, 133, "Australia Post Customer Barcoding Tech Specs Diagram 1; verified manually against tec-it", - "1000001010001010101000100010101000001010100000000000000000100000101000101000001000100000001000101000101000101000101000001000100010100" - "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" - "0000101010101000100000101010100010100000101010101000101000101000100000000000101000101000100000000000001000000010100010001010101000000" + /* 0*/ { BARCODE_AUSPOST, "96184209", 0, 3, 73, "Australia Post Customer Barcoding Tech Specs Diagram 1; verified manually against tec-it", + "1000101010100010001010100000101010001010001000001010000010001000001000100" + "1010101010101010101010101010101010101010101010101010101010101010101010101" + "0000100010000010101010001010000010101010001000101010001000100010000010000" }, - /* 1*/ { BARCODE_AUSREPLY, "12345678", 0, 3, 73, "Verified manually against tec-it", + /* 1*/ { BARCODE_AUSPOST, "3221132412345678", 0, 3, 103, "59 Custom 2 N encoding", + "1000100000101010100010001010101010101000101010101000101010101000001000100000101000000000001000000000100" + "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" + "0000001000100010101010101000100000101010000010001010001000000010101010001010000010001010101000100000000" + }, + /* 2*/ { BARCODE_AUSPOST, "32211324Ab #2", 0, 3, 103, "59 Custom 2 C encoding", + "1000100000101010100010001010101010101000101010101010001010100010100000101000100000000010100000100010100" + "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" + "0000001000100010101010101000100000101010000010101010001010100010000000100000001000101010000010000000000" + }, + /* 3*/ { BARCODE_AUSPOST, "32211324123456789012345", 0, 3, 133, "62 Custom 3 N encoding", + "1000001010001010100010001010101010101000101010101000101010101000001000100000001010101010100010101010100000100000100010101010100010100" + "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" + "0000101010100010101010101000100000101010000010001010001000000010101010001010001010101000101000100000001000001010000010001010100010000" + }, + /* 4*/ { BARCODE_AUSPOST, "32211324aBCd#F hIz", 0, 3, 133, "62 Custom 3 C encoding", + "1000001010001010100010001010101010101000101010000010101010100010000010100010100010100010000010000000000000100010100010101010000000100" + "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" + "0000101010100010101010101000100000101010000010100010100010101010001010000010001010100000100010101000000000101000001010100000000010000" + }, + /* 5*/ { BARCODE_AUSREPLY, "12345678", 0, 3, 73, "Verified manually against tec-it", "1000101010001010100010101010100000100010000000001000001000000000100010100" "1010101010101010101010101010101010101010101010101010101010101010101010101" "0000000000101000101000100000001010101000101000000000100010101000101000000" }, - /* 2*/ { BARCODE_AUSROUTE, "34567890", 0, 3, 73, "Verified manually against tec-it", + /* 6*/ { BARCODE_AUSROUTE, "34567890", 0, 3, 73, "Verified manually against tec-it", "1000000000101010101010000010001000000010101000100010101010000000101000100" "1010101010101010101010101010101010101010101010101010101010101010101010101" "0000101010000010000000101010100010100010101000100010101010001010001000000" }, - /* 3*/ { BARCODE_AUSREDIRECT, "98765432", 0, 3, 73, "Verified manually against tec-it", + /* 7*/ { BARCODE_AUSREDIRECT, "98765432", 0, 3, 73, "Verified manually against tec-it", "1000001010000010000000100010100010101010100000101010101000100010100010100" "1010101010101010101010101010101010101010101010101010101010101010101010101" "0000001010100010101010001010001000000010101000000000001010101000001010000" @@ -232,6 +254,8 @@ static void test_encode(int index, int generate, int debug) { int data_size = ARRAY_SIZE(data); char escaped[1024]; + char bwipp_buf[8192]; + char bwipp_msg[1024]; for (int i = 0; i < data_size; i++) { @@ -256,10 +280,17 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + + if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, -1, -1, debug)) { + ret = testUtilBwipp(i, symbol, -1, -1, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); + + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_bmp.c b/backend/tests/test_bmp.c index 36d1639a..40683b0b 100644 --- a/backend/tests/test_bmp.c +++ b/backend/tests/test_bmp.c @@ -158,10 +158,10 @@ static void test_print(int index, int generate, int debug) { if (data[i].whitespace_width != -1) { symbol->whitespace_width = data[i].whitespace_width; } - if (data[i].fgcolour != NULL) { + if (*data[i].fgcolour) { strcpy(symbol->fgcolour, data[i].fgcolour); } - if (data[i].bgcolour != NULL) { + if (*data[i].bgcolour) { strcpy(symbol->bgcolour, data[i].bgcolour); } diff --git a/backend/tests/test_channel.c b/backend/tests/test_channel.c index 6eaf2643..dc9fb50f 100644 --- a/backend/tests/test_channel.c +++ b/backend/tests/test_channel.c @@ -247,103 +247,103 @@ static void test_encode(int index, int generate, int debug) { /* 36*/ { -1, "7742862", 0, 1, 39, "ANSI/AIM BC12-1998 Figure F1 Channel 8 bottom", "101010101000000001111110101101010110101" }, - /* 37*/ { -1, "01", 0, 1, 19, "Edge case for initial_precalcs table; verified manually against bwipp", + /* 37*/ { -1, "01", 0, 1, 19, "Edge case for initial_precalcs table", "1010101010110110001" }, - /* 38*/ { -1, "001", 0, 1, 23, "Edge case for initial_precalcs table; verified manually against bwipp", + /* 38*/ { -1, "001", 0, 1, 23, "Edge case for initial_precalcs table", "10101010101101011000011" }, - /* 39*/ { -1, "0001", 0, 1, 27, "Edge case for initial_precalcs table; verified manually against bwipp", + /* 39*/ { -1, "0001", 0, 1, 27, "Edge case for initial_precalcs table", "101010101011010101110000011" }, - /* 40*/ { -1, "00001", 0, 1, 31, "Edge case for initial_precalcs table; verified manually against bwipp", + /* 40*/ { -1, "00001", 0, 1, 31, "Edge case for initial_precalcs table", "1010101010110101011011000000111" }, - /* 41*/ { -1, "000001", 0, 1, 35, "Edge case for initial_precalcs table; verified manually against bwipp", + /* 41*/ { -1, "000001", 0, 1, 35, "Edge case for initial_precalcs table", "10101010101101010110101100000001111" }, - /* 42*/ { -1, "0000001", 0, 1, 39, "Edge case for initial_precalcs table; verified manually against bwipp", + /* 42*/ { -1, "0000001", 0, 1, 39, "Edge case for initial_precalcs table", "101010101011010101101010111000000001111" }, - /* 43*/ { -1, "115337", 0, 1, 35, "Edge case for channel_precalcs7 table; verified manually against bwipp", + /* 43*/ { -1, "115337", 0, 1, 35, "Edge case for channel_precalcs7 table", "10101010101110100101001000111100011" }, - /* 44*/ { -1, "115338", 0, 1, 35, "Edge case for channel_precalcs7 table; verified manually against bwipp", + /* 44*/ { -1, "115338", 0, 1, 35, "Edge case for channel_precalcs7 table", "10101010101110100101001000111110001" }, - /* 45*/ { -1, "115339", 0, 1, 35, "Edge case for channel_precalcs7 table; verified manually against bwipp", + /* 45*/ { -1, "115339", 0, 1, 35, "Edge case for channel_precalcs7 table", "10101010101110100101001000010011111" }, - /* 46*/ { -1, "230675", 0, 1, 35, "Edge case for channel_precalcs7 table; verified manually against bwipp", + /* 46*/ { -1, "230675", 0, 1, 35, "Edge case for channel_precalcs7 table", "10101010100101100011001111010011001" }, - /* 47*/ { -1, "230676", 0, 1, 35, "Edge case for channel_precalcs7 table; verified manually against bwipp", + /* 47*/ { -1, "230676", 0, 1, 35, "Edge case for channel_precalcs7 table", "10101010100101100011001111010001011" }, - /* 48*/ { -1, "230677", 0, 1, 35, "Edge case for channel_precalcs7 table; verified manually against bwipp", + /* 48*/ { -1, "230677", 0, 1, 35, "Edge case for channel_precalcs7 table", "10101010100101100011001111010001101" }, - /* 49*/ { -1, "346013", 0, 1, 35, "Edge case for channel_precalcs7 table; verified manually against bwipp", + /* 49*/ { -1, "346013", 0, 1, 35, "Edge case for channel_precalcs7 table", "10101010100110011101010001011000111" }, - /* 50*/ { -1, "346014", 0, 1, 35, "Edge case for channel_precalcs7 table; verified manually against bwipp", + /* 50*/ { -1, "346014", 0, 1, 35, "Edge case for channel_precalcs7 table", "10101010100110011101010001011100011" }, - /* 51*/ { -1, "346015", 0, 1, 35, "Edge case for channel_precalcs7 table; verified manually against bwipp", + /* 51*/ { -1, "346015", 0, 1, 35, "Edge case for channel_precalcs7 table", "10101010100110011101010001011110001" }, - /* 52*/ { -1, "0119120", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 52*/ { -1, "0119120", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101011010111000011000100111010011" }, - /* 53*/ { -1, "0119121", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 53*/ { -1, "0119121", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101011010111000011000100111011001" }, - /* 54*/ { -1, "0119122", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 54*/ { -1, "0119122", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101011010111000011000100111001011" }, - /* 55*/ { -1, "0238241", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 55*/ { -1, "0238241", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101011010001011011001100011110001" }, - /* 56*/ { -1, "0238242", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 56*/ { -1, "0238242", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101011010001011011001100001001111" }, - /* 57*/ { -1, "0238243", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 57*/ { -1, "0238243", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101011010001011011001100001100111" }, - /* 58*/ { -1, "1072088", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 58*/ { -1, "1072088", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101011001111101000101100011001001" }, - /* 59*/ { -1, "1072089", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 59*/ { -1, "1072089", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101011001111101000101100011000101" }, - /* 60*/ { -1, "1072090", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 60*/ { -1, "1072090", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101011001111101000101100001010011" }, - /* 61*/ { -1, "4169234", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 61*/ { -1, "4169234", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101001101001101101111011000100001" }, - /* 62*/ { -1, "4169235", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 62*/ { -1, "4169235", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101001101001101101111011000010001" }, - /* 63*/ { -1, "4169236", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 63*/ { -1, "4169236", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101001101001101101111011000001001" }, - /* 64*/ { -1, "6075170", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 64*/ { -1, "6075170", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101000100011101010001110111001011" }, - /* 65*/ { -1, "6075171", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 65*/ { -1, "6075171", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101000100011101010001110111001101" }, - /* 66*/ { -1, "6075172", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 66*/ { -1, "6075172", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101000100011101010001110111101001" }, - /* 67*/ { -1, "7623743", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 67*/ { -1, "7623743", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101000001110010101101100101001111" }, - /* 68*/ { -1, "7623744", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 68*/ { -1, "7623744", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101000001110010101101100101100111" }, - /* 69*/ { -1, "7623745", 0, 1, 39, "Edge case for channel_precalcs8 table; verified manually against bwipp", + /* 69*/ { -1, "7623745", 0, 1, 39, "Edge case for channel_precalcs8 table", "101010101000001110010101101100101110011" }, }; @@ -376,14 +376,12 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); - } + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, data[i].option_2, -1, debug)) { - ret = testUtilBwipp(symbol, -1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + ret = testUtilBwipp(i, symbol, -1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); diff --git a/backend/tests/test_codablock.c b/backend/tests/test_codablock.c index b9b8cb80..f0da6be4 100644 --- a/backend/tests/test_codablock.c +++ b/backend/tests/test_codablock.c @@ -440,22 +440,20 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); - } + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, data[i].option_2, -1, debug)) { if (!data[i].bwipp_cmp) { - if (debug & ZINT_DEBUG_TEST_PRINT) printf("%d: %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment); + if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment); } else { - ret = testUtilBwipp(symbol, data[i].option_1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + ret = testUtilBwipp(i, symbol, data[i].option_1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_code.c b/backend/tests/test_code.c index 3c287b12..1d915ed7 100644 --- a/backend/tests/test_code.c +++ b/backend/tests/test_code.c @@ -119,29 +119,30 @@ static void test_hrt(int index, int debug) { /* 0*/ { BARCODE_CODE11, -1, "123-45", -1, "123-4552" }, // 2 checksums /* 1*/ { BARCODE_CODE11, 1, "123-45", -1, "123-455" }, // 1 checksum /* 2*/ { BARCODE_CODE11, 2, "123-45", -1, "123-45" }, // No checksums - /* 3*/ { BARCODE_CODE39, -1, "ABC1234", -1, "*ABC1234*" }, - /* 4*/ { BARCODE_CODE39, -1, "abc1234", -1, "*ABC1234*" }, // Converts to upper - /* 5*/ { BARCODE_CODE39, -1, "123456789", -1, "*123456789*" }, - /* 6*/ { BARCODE_CODE39, 1, "123456789", -1, "*1234567892*" }, // With checksum - /* 7*/ { BARCODE_EXCODE39, -1, "ABC1234", -1, "ABC1234" }, - /* 8*/ { BARCODE_EXCODE39, -1, "abc1234", -1, "abc1234" }, - /* 9*/ { BARCODE_EXCODE39, 1, "abc1234", -1, "abc1234" }, // With checksum (not displayed) - /* 10*/ { BARCODE_EXCODE39, -1, "a%\000\001$\177z\033\037!+/\\@A~", 16, "a% $ z !+/\\@A~" }, // NUL, ctrls and DEL replaced with spaces - /* 11*/ { BARCODE_LOGMARS, -1, "ABC1234", -1, "ABC1234" }, - /* 12*/ { BARCODE_LOGMARS, -1, "abc1234", -1, "ABC1234" }, // Converts to upper - /* 13*/ { BARCODE_LOGMARS, 1, "abc1234", -1, "ABC12340" }, // With checksum - /* 14*/ { BARCODE_LOGMARS, 1, "12345/ABCDE", -1, "12345/ABCDET" }, // With checksum - /* 15*/ { BARCODE_CODE93, -1, "ABC1234", -1, "ABC1234S5" }, // 2 checksums added (note check digits not shown by bwipp or tec-it) - /* 16*/ { BARCODE_CODE93, -1, "abc1234", -1, "abc1234ZG" }, - /* 17*/ { BARCODE_CODE93, -1, "A\001a\000b\177d\037e", 9, "A a b d e1R" }, // NUL, ctrls and DEL replaced with spaces - /* 18*/ { BARCODE_PZN, -1, "12345", -1, "PZN -00123458" }, // Pads with zeroes if length < 7 - /* 19*/ { BARCODE_PZN, -1, "123456", -1, "PZN -01234562" }, - /* 20*/ { BARCODE_PZN, -1, "1234567", -1, "PZN -12345678" }, - /* 21*/ { BARCODE_VIN, -1, "1FTCR10UXTPA78180", -1, "1FTCR10UXTPA78180" }, - /* 22*/ { BARCODE_VIN, 1, "2FTPX28L0XCA15511", -1, "2FTPX28L0XCA15511" }, // Include Import char - no change - /* 23*/ { BARCODE_HIBC_39, -1, "ABC1234", -1, "*+ABC1234+*" }, - /* 24*/ { BARCODE_HIBC_39, -1, "abc1234", -1, "*+ABC1234+*" }, // Converts to upper - /* 25*/ { BARCODE_HIBC_39, -1, "123456789", -1, "*+1234567890*" }, + /* 3*/ { BARCODE_CODE11, -1, "123456789012", -1, "123456789012-8" }, // First checksum 10 (A) goes to hyphen + /* 4*/ { BARCODE_CODE39, -1, "ABC1234", -1, "*ABC1234*" }, + /* 5*/ { BARCODE_CODE39, -1, "abc1234", -1, "*ABC1234*" }, // Converts to upper + /* 6*/ { BARCODE_CODE39, -1, "123456789", -1, "*123456789*" }, + /* 7*/ { BARCODE_CODE39, 1, "123456789", -1, "*1234567892*" }, // With checksum + /* 8*/ { BARCODE_EXCODE39, -1, "ABC1234", -1, "ABC1234" }, + /* 9*/ { BARCODE_EXCODE39, -1, "abc1234", -1, "abc1234" }, + /* 10*/ { BARCODE_EXCODE39, 1, "abc1234", -1, "abc1234" }, // With checksum (not displayed) + /* 11*/ { BARCODE_EXCODE39, -1, "a%\000\001$\177z\033\037!+/\\@A~", 16, "a% $ z !+/\\@A~" }, // NUL, ctrls and DEL replaced with spaces + /* 12*/ { BARCODE_LOGMARS, -1, "ABC1234", -1, "ABC1234" }, + /* 13*/ { BARCODE_LOGMARS, -1, "abc1234", -1, "ABC1234" }, // Converts to upper + /* 14*/ { BARCODE_LOGMARS, 1, "abc1234", -1, "ABC12340" }, // With checksum + /* 15*/ { BARCODE_LOGMARS, 1, "12345/ABCDE", -1, "12345/ABCDET" }, // With checksum + /* 16*/ { BARCODE_CODE93, -1, "ABC1234", -1, "ABC1234S5" }, // 2 checksums added (note check digits not shown by bwipp or tec-it) + /* 17*/ { BARCODE_CODE93, -1, "abc1234", -1, "abc1234ZG" }, + /* 18*/ { BARCODE_CODE93, -1, "A\001a\000b\177d\037e", 9, "A a b d e1R" }, // NUL, ctrls and DEL replaced with spaces + /* 19*/ { BARCODE_PZN, -1, "12345", -1, "PZN -00123458" }, // Pads with zeroes if length < 7 + /* 20*/ { BARCODE_PZN, -1, "123456", -1, "PZN -01234562" }, + /* 21*/ { BARCODE_PZN, -1, "1234567", -1, "PZN -12345678" }, + /* 22*/ { BARCODE_VIN, -1, "1FTCR10UXTPA78180", -1, "1FTCR10UXTPA78180" }, + /* 23*/ { BARCODE_VIN, 1, "2FTPX28L0XCA15511", -1, "2FTPX28L0XCA15511" }, // Include Import char - no change + /* 24*/ { BARCODE_HIBC_39, -1, "ABC1234", -1, "*+ABC1234+*" }, + /* 25*/ { BARCODE_HIBC_39, -1, "abc1234", -1, "*+ABC1234+*" }, // Converts to upper + /* 26*/ { BARCODE_HIBC_39, -1, "123456789", -1, "*+1234567890*" }, }; int data_size = ARRAY_SIZE(data); @@ -263,13 +264,13 @@ static void test_encode(int index, int generate, int debug) { /* 1*/ { BARCODE_CODE11, 1, "123-455", -1, 0, 1, 78, "1 check digit (2); verified manually against tec-it", "101100101101011010010110110010101011010101101101101101011011010100101101011001" }, - /* 2*/ { BARCODE_CODE11, 2, "123-4552", -1, 0, 1, 78, "0 check digits; verified manually against bwipp and tec-it", + /* 2*/ { BARCODE_CODE11, 2, "123-4552", -1, 0, 1, 78, "0 check digits; verified manually against tec-it", "101100101101011010010110110010101011010101101101101101011011010100101101011001" }, /* 3*/ { BARCODE_CODE11, 1, "123-45", -1, 0, 1, 70, "1 check digit; verified manually against tec-it", "1011001011010110100101101100101010110101011011011011010110110101011001" }, - /* 4*/ { BARCODE_CODE11, 2, "123-45", -1, 0, 1, 62, "0 check digits; verified manually against bwipp and tec-it", + /* 4*/ { BARCODE_CODE11, 2, "123-45", -1, 0, 1, 62, "0 check digits; verified manually against tec-it", "10110010110101101001011011001010101101010110110110110101011001" }, /* 5*/ { BARCODE_CODE39, -1, "1A", -1, 0, 1, 51, "ISO/IEC 16388:2007 Figure 1", @@ -287,10 +288,10 @@ static void test_encode(int index, int generate, int debug) { /* 9*/ { BARCODE_EXCODE39, 1, "1A", -1, 0, 1, 64, "With checksum", "1001011011010110100101011011010100101101011010010110100101101101" }, - /* 10*/ { BARCODE_EXCODE39, -1, "a%\000\001$\177z", 7, 0, 1, 207, "Verified manually against bwipp and tec-it", + /* 10*/ { BARCODE_EXCODE39, -1, "a%\000\001$\177z", 7, 0, 1, 207, "Verified manually against tec-it", "100101101101010010100100101101010010110100100101001011010110010101010010010010110010101011010010010010101101010010110100100101001010101100101101010010010010101011011001010010100100101001101101010100101101101" }, - /* 11*/ { BARCODE_EXCODE39, -1, "\033\037!+/\\@A~", -1, 0, 1, 246, "Verified manually against bwipp and tec-it", + /* 11*/ { BARCODE_EXCODE39, -1, "\033\037!+/\\@A~", -1, 0, 1, 246, "Verified manually against tec-it", "100101101101010100100100101101010010110101001001001011010110010101001001010010110101001011010010010100101101010100110100100101001011010110100101010010010010101101010011010100100100101001101010110110101001011010100100100101011010110010100101101101" }, /* 12*/ { BARCODE_LOGMARS, -1, "1A", -1, 0, 1, 63, "Verified manually against tec-it", @@ -308,19 +309,19 @@ static void test_encode(int index, int generate, int debug) { /* 16*/ { BARCODE_LOGMARS, 1, "12345/ABCDE", -1, 0, 1, 223, "MIL-STD-1189 Rev. B Section 6.2.1 check character example; verified manually against tec-it", "1000101110111010111010001010111010111000101011101110111000101010101000111010111011101000111010101000100010100010111010100010111010111010001011101110111010001010101011100010111011101011100010101010111011100010100010111011101" }, - /* 17*/ { BARCODE_CODE93, -1, "1A", -1, 0, 1, 55, "Verified manually against bwipp (includecheck) and tec-it", + /* 17*/ { BARCODE_CODE93, -1, "1A", -1, 0, 1, 55, "Verified manually against tec-it", "1010111101010010001101010001101000101001110101010111101" }, - /* 18*/ { BARCODE_CODE93, -1, "TEST93", -1, 0, 1, 91, "Verified manually against bwipp (includecheck) and tec-it", + /* 18*/ { BARCODE_CODE93, -1, "TEST93", -1, 0, 1, 91, "Verified manually against tec-it", "1010111101101001101100100101101011001101001101000010101010000101011101101001000101010111101" }, - /* 19*/ { BARCODE_CODE93, -1, "\000a\177", 3, 0, 1, 91, "Verified manually against bwipp (code93ext, includecheck) and tec-it", + /* 19*/ { BARCODE_CODE93, -1, "\000a\177", 3, 0, 1, 91, "Verified manually against tec-it", "1010111101110110101100101101001100101101010001110110101101001101011011101010010001010111101" }, - /* 20*/ { BARCODE_PZN, -1, "1234567", -1, 0, 1, 142, "Example from IFA Info Code 39 EN V2.1; verified manually against bwipp (pzn8) and tec-it", + /* 20*/ { BARCODE_PZN, -1, "1234567", -1, 0, 1, 142, "Example from IFA Info Code 39 EN V2.1; verified manually against tec-it", "1001011011010100101011011011010010101101011001010110110110010101010100110101101101001101010101100110101010100101101101101001011010100101101101" }, - /* 21*/ { BARCODE_PZN, -1, "2758089", -1, 0, 1, 142, "Example from IFA Info Check Digit Calculations EN 15 July 2019; verified manually against bwipp (pzn8) and tec-it", + /* 21*/ { BARCODE_PZN, -1, "2758089", -1, 0, 1, 142, "Example from IFA Info Check Digit Calculations EN 15 July 2019; verified manually against tec-it", "1001011011010100101011011010110010101101010010110110110100110101011010010110101010011011010110100101101010110010110101011001011010100101101101" }, /* 22*/ { BARCODE_VIN, -1, "1FTCR10UXTPA78180", -1, 0, 1, 246, "https://www.vinquery.com/img/vinbarcode/vinbarcode4.jpg", @@ -365,19 +366,17 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); - } + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, data[i].option_2, -1, debug)) { - ret = testUtilBwipp(symbol, -1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + ret = testUtilBwipp(i, symbol, -1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_code1.c b/backend/tests/test_code1.c index fa4fe2f8..aa82c882 100644 --- a/backend/tests/test_code1.c +++ b/backend/tests/test_code1.c @@ -167,6 +167,8 @@ static void test_encode(int index, int generate, int debug) { testStart(""); + int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise + int ret; struct item { int option_2; @@ -180,7 +182,7 @@ static void test_encode(int index, int generate, int debug) { char *expected; }; struct item data[] = { - /* 0*/ { -1, "123456789012", -1, 0, 16, 18, "Verified manually against bwipp", + /* 0*/ { -1, "123456789012", -1, 0, 16, 18, "", "100011101010111101" "111010010010100000" "110110100010001000" @@ -202,6 +204,8 @@ static void test_encode(int index, int generate, int debug) { int data_size = ARRAY_SIZE(data); char escaped[1024]; + char bwipp_buf[8192]; + char bwipp_msg[1024]; for (int i = 0; i < data_size; i++) { @@ -226,10 +230,17 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + + if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, data[i].option_2, -1, debug)) { + ret = testUtilBwipp(i, symbol, -1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); + + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_code128.c b/backend/tests/test_code128.c index b59ebb9f..cb574048 100644 --- a/backend/tests/test_code128.c +++ b/backend/tests/test_code128.c @@ -664,22 +664,20 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); - } + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, -1, -1, debug)) { if (!data[i].bwipp_cmp) { - if (debug & ZINT_DEBUG_TEST_PRINT) printf("%d: %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment); + if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment); } else { - ret = testUtilBwipp(symbol, -1, -1, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + ret = testUtilBwipp(i, symbol, -1, -1, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_code16k.c b/backend/tests/test_code16k.c index 916707a7..aececf27 100644 --- a/backend/tests/test_code16k.c +++ b/backend/tests/test_code16k.c @@ -220,6 +220,8 @@ static void test_encode(int index, int generate, int debug) { testStart(""); + int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise + int ret; struct item { int input_mode; @@ -236,7 +238,7 @@ static void test_encode(int index, int generate, int debug) { "1110010101100110111011010011110110111100100110010011000100100010001101" "1100110101000100111011110100110010010000100110100011010010001110011001" }, - /* 1*/ { UNICODE_MODE, "www.wikipedia.de", 0, 4, 70, "Verified manually against bwipp", + /* 1*/ { UNICODE_MODE, "www.wikipedia.de", 0, 4, 70, "https://commons.wikimedia.org/wiki/File:Code_16K_wikipedia.png", "1110010101000110011000011010110000110101100001101011011001100010001101" "1100110100001101011011110010110011110110101111001011010110000110011001" "1101100101001101111011110110010111100101101101001111011001100010010011" @@ -246,6 +248,8 @@ static void test_encode(int index, int generate, int debug) { int data_size = ARRAY_SIZE(data); char escaped[1024]; + char bwipp_buf[8192]; + char bwipp_msg[1024]; for (int i = 0; i < data_size; i++) { @@ -270,10 +274,17 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + + if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, -1, -1, debug)) { + ret = testUtilBwipp(i, symbol, -1, -1, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); + + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_code49.c b/backend/tests/test_code49.c index 55bf0ead..962260d4 100644 --- a/backend/tests/test_code49.c +++ b/backend/tests/test_code49.c @@ -153,6 +153,8 @@ static void test_encode(int index, int generate, int debug) { testStart(""); + int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise + int ret; struct item { int input_mode; @@ -180,6 +182,8 @@ static void test_encode(int index, int generate, int debug) { int data_size = ARRAY_SIZE(data); char escaped[1024]; + char bwipp_buf[8192]; + char bwipp_msg[1024]; for (int i = 0; i < data_size; i++) { @@ -204,10 +208,17 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + + if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, -1, -1, debug)) { + ret = testUtilBwipp(i, symbol, -1, -1, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); + + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_composite.c b/backend/tests/test_composite.c index 8485551d..726bb8a9 100644 --- a/backend/tests/test_composite.c +++ b/backend/tests/test_composite.c @@ -1225,7 +1225,7 @@ static void test_examples(int index, int generate, int debug) { for (int i = 0; i < data_size; i++) { if (index != -1 && i != index) continue; - if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d\n", i); + if ((debug & ZINT_DEBUG_TEST_PRINT) && !(debug & ZINT_DEBUG_TEST_LESS_NOISY)) printf("i:%d\n", i); struct zint_symbol *symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); @@ -1249,19 +1249,17 @@ static void test_examples(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); - if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, -1, -1, debug)) { - ret = testUtilBwipp(symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, -1, -1, debug)) { + ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); - ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); - assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); - } + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } @@ -1393,7 +1391,7 @@ static void test_odd_numbered_numeric(int index, int generate, int debug) { for (int i = 0; i < data_size; i++) { if (index != -1 && i != index) continue; - if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d\n", i); + if ((debug & ZINT_DEBUG_TEST_PRINT) && !(debug & ZINT_DEBUG_TEST_LESS_NOISY)) printf("i:%d\n", i); struct zint_symbol *symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); @@ -1417,19 +1415,17 @@ static void test_odd_numbered_numeric(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); - if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, -1, -1, debug)) { - ret = testUtilBwipp(symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, -1, -1, debug)) { + ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); - ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); - assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); - } + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } @@ -1549,22 +1545,20 @@ static void test_ean128_cc_shift(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); - if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, -1, -1, debug)) { - if (!data[i].bwipp_cmp) { - if (debug & ZINT_DEBUG_TEST_PRINT) printf("%d: %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment); - } else { - ret = testUtilBwipp(symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, -1, -1, debug)) { + if (!data[i].bwipp_cmp) { + if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment); + } else { + ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); - ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); - assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); - } + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } @@ -2102,19 +2096,17 @@ static void test_encodation_0(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); - if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, -1, -1, debug)) { - ret = testUtilBwipp(symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, -1, -1, debug)) { + ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); - ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); - assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); - } + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } @@ -2243,19 +2235,17 @@ static void test_encodation_10(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); - if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, -1, -1, debug)) { - ret = testUtilBwipp(symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, -1, -1, debug)) { + ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); - ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); - assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); - } + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } @@ -2626,18 +2616,18 @@ static void test_encodation_11(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { + if (ret < 5) { int width, row; ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, -1, -1, debug)) { - ret = testUtilBwipp(symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + ret = testUtilBwipp(i, symbol, data[i].option_1, -1, -1, data[i].composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } @@ -2780,19 +2770,17 @@ static void test_addongap(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d %s symbol->rows %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d %s symbol->width %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); - if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, data[i].option_2, -1, debug)) { - ret = testUtilBwipp(symbol, data[i].option_1, data[i].option_2, -1, composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, data[i].option_2, -1, debug)) { + ret = testUtilBwipp(i, symbol, data[i].option_1, data[i].option_2, -1, composite, composite_length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); - ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); - assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); - } + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } diff --git a/backend/tests/test_emf.c b/backend/tests/test_emf.c index e2ce81a9..4e29e22b 100644 --- a/backend/tests/test_emf.c +++ b/backend/tests/test_emf.c @@ -53,7 +53,7 @@ static void test_emf(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_EANX, -1, -1, NULL, NULL, 0, "210987654321+54321" }, // #185 Byte count, font data, HeaderExtension1/2 + /* 0*/ { BARCODE_EANX, -1, -1, "", "", 0, "210987654321+54321" }, // #185 Byte count, font data, HeaderExtension1/2 /* 1*/ { BARCODE_MAXICODE, -1, 20, "E0E0E0", "700070", 0, "THIS IS A 93 CHARACTER CODE SET A MESSAGE THAT FILLS A MODE 4, UNAPPENDED, MAXICODE SYMBOL..." }, // #185 Maxicode scaling }; int data_size = ARRAY_SIZE(data); @@ -66,10 +66,10 @@ static void test_emf(int index, int debug) { assert_nonnull(symbol, "Symbol not created\n"); int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); - if (data[i].fgcolour != NULL) { + if (*data[i].fgcolour) { strcpy(symbol->fgcolour, data[i].fgcolour); } - if (data[i].bgcolour != NULL) { + if (*data[i].bgcolour) { strcpy(symbol->bgcolour, data[i].bgcolour); } if (data[i].scale != 0) { @@ -104,6 +104,8 @@ static void test_print(int index, int generate, int debug) { int ret; struct item { int symbology; + int input_mode; + int output_options; int whitespace_width; int option_1; int option_2; @@ -113,8 +115,14 @@ static void test_print(int index, int generate, int debug) { char* expected_file; }; struct item data[] = { - /* 0*/ { BARCODE_TELEPEN, -1, -1, -1, "147AD0", "FC9630", "123", "../data/emf/telenum_fg_bg.emf" }, - /* 1*/ { BARCODE_ULTRA, 5, -1, -1, "147AD0", "FC9630", "123", "../data/emf/ultracode_fg_bg.emf" }, + /* 0*/ { BARCODE_CODE128, UNICODE_MODE, BOLD_TEXT, -1, -1, -1, "", "", "Égjpqy", "../data/emf/code128_egrave_bold.emf" }, + /* 1*/ { BARCODE_TELEPEN, -1, -1, -1, -1, -1, "147AD0", "FC9630", "123", "../data/emf/telenum_fg_bg.emf" }, + /* 2*/ { BARCODE_ULTRA, -1, -1, 5, -1, -1, "147AD0", "FC9630", "123", "../data/emf/ultracode_fg_bg.emf" }, + /* 3*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "", "", "9780877799306+54321", "../data/emf/ean13_5addon_ggs_5.2.2.5.2-2.emf" }, + /* 4*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, "", "", "012345678905+24", "../data/emf/upca_2addon_ggs_5.2.6.6-5.emf" }, + /* 5*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, "", "", "0123456+12", "../data/emf/upce_2addon.emf" }, + /* 6*/ { BARCODE_UPCE, -1, SMALL_TEXT | BOLD_TEXT, -1, -1, -1, "", "", "0123456+12", "../data/emf/upce_2addon_small_bold.emf" }, + /* 7*/ { BARCODE_ITF14, -1, BOLD_TEXT, -1, -1, -1, "", "", "123", "../data/emf/itf14_bold.emf" }, }; int data_size = ARRAY_SIZE(data); @@ -137,14 +145,14 @@ static void test_print(int index, int generate, int debug) { struct zint_symbol* symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); - int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); + int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, data[i].output_options, data[i].data, -1, debug); if (data[i].whitespace_width != -1) { symbol->whitespace_width = data[i].whitespace_width; } - if (data[i].fgcolour != NULL) { + if (*data[i].fgcolour) { strcpy(symbol->fgcolour, data[i].fgcolour); } - if (data[i].bgcolour != NULL) { + if (*data[i].bgcolour) { strcpy(symbol->bgcolour, data[i].bgcolour); } @@ -156,9 +164,9 @@ static void test_print(int index, int generate, int debug) { assert_zero(ret, "i:%d %s ZBarcode_Print %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret); if (generate) { - printf(" /*%3d*/ { %s, %d, %d, %d, \"%s\", \"%s\", \"%s\", \"%s\"},\n", - i, testUtilBarcodeName(data[i].symbology), data[i].whitespace_width, data[i].option_1, data[i].option_2, data[i].fgcolour, data[i].bgcolour, - testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].expected_file); + printf(" /*%3d*/ { %s, %s, %s, %d, %d, %d, \"%s\", \"%s\", \"%s\", \"%s\"},\n", + i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), testUtilOutputOptionsName(data[i].output_options), data[i].whitespace_width, + data[i].option_1, data[i].option_2, data[i].fgcolour, data[i].bgcolour, testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].expected_file); ret = rename(symbol->outfile, data[i].expected_file); assert_zero(ret, "i:%d rename(%s, %s) ret %d != 0\n", i, symbol->outfile, data[i].expected_file, ret); if (have_inkscape) { diff --git a/backend/tests/test_gs1.c b/backend/tests/test_gs1.c index 8e2794af..54976636 100644 --- a/backend/tests/test_gs1.c +++ b/backend/tests/test_gs1.c @@ -208,18 +208,18 @@ static void test_gs1_reduce(int index, int generate, int debug) { } else { assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d %s\n", i, ret, data[i].ret, symbol->errtxt); - if (ret == 0) { + if (ret < 5) { int width, row; ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, -1, -1, debug)) { - ret = testUtilBwipp(symbol, -1, -1, -1, text, length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + ret = testUtilBwipp(i, symbol, -1, -1, -1, text, length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_imail.c b/backend/tests/test_imail.c index 4e0fd18f..c8f84e0d 100644 --- a/backend/tests/test_imail.c +++ b/backend/tests/test_imail.c @@ -217,6 +217,8 @@ static void test_encode(int index, int generate, int debug) { testStart(""); + int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise + int ret; struct item { unsigned char *data; @@ -237,6 +239,8 @@ static void test_encode(int index, int generate, int debug) { int data_size = ARRAY_SIZE(data); char escaped[1024]; + char bwipp_buf[8192]; + char bwipp_msg[1024]; for (int i = 0; i < data_size; i++) { @@ -261,10 +265,17 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + + if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, -1, -1, debug)) { + ret = testUtilBwipp(i, symbol, -1, -1, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); + + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_library.c b/backend/tests/test_library.c index 27fcfc69..2d3a4597 100644 --- a/backend/tests/test_library.c +++ b/backend/tests/test_library.c @@ -174,6 +174,15 @@ static void test_escape_char_process(int index, int generate, int debug) { /* 4*/ { DATA_MODE, "\\x1", ZINT_ERROR_INVALID_DATA, 0, "Error 232: Incomplete escape character in input data", "" }, /* 5*/ { DATA_MODE, "\\x1g", ZINT_ERROR_INVALID_DATA, 0, "Error 233: Corrupt escape character in input data", "" }, /* 6*/ { UNICODE_MODE, "\\xA01\\xFF", 0, 90, "(8) 104 100 0 17 100 95 100 106", "" }, + /* 7*/ { UNICODE_MODE, "\\u00A01\\u00FF", 0, 90, "(8) 104 100 0 17 100 95 100 106", "" }, + /* 8*/ { DATA_MODE, "\\xc3\\xbF", 0, 79, "(7) 104 100 35 100 31 80 106", "" }, + /* 9*/ { DATA_MODE, "\\u00fF", 0, 79, "(7) 104 100 35 100 31 80 106", "" }, + /* 10*/ { DATA_MODE, "\\u", ZINT_ERROR_INVALID_DATA, 0, "Error 235: Incomplete unicode escape character in input data", "" }, + /* 11*/ { DATA_MODE, "\\uF", ZINT_ERROR_INVALID_DATA, 0, "Error 235: Incomplete unicode escape character in input data", "" }, + /* 12*/ { DATA_MODE, "\\u0F", ZINT_ERROR_INVALID_DATA, 0, "Error 235: Incomplete unicode escape character in input data", "" }, + /* 13*/ { DATA_MODE, "\\uFG", ZINT_ERROR_INVALID_DATA, 0, "Error 235: Incomplete unicode escape character in input data", "" }, + /* 14*/ { DATA_MODE, "\\u00F", ZINT_ERROR_INVALID_DATA, 0, "Error 235: Incomplete unicode escape character in input data", "" }, + /* 15*/ { DATA_MODE, "\\u00FG", ZINT_ERROR_INVALID_DATA, 0, "Error 236: Corrupt unicode escape character in input data", "" }, }; int data_size = ARRAY_SIZE(data); @@ -210,6 +219,41 @@ static void test_escape_char_process(int index, int generate, int debug) { testFinish(); } +static void test_cap(int index, int debug) { + + testStart(""); + + unsigned int ret; + struct item { + int symbology; + unsigned cap_flag; + unsigned int expected; + }; + // s/\/\*[ 0-9]*\*\//\=printf("\/*%2d*\/", line(".") - line("'<")) + struct item data[] = { + /* 0*/ { BARCODE_CODE128, ZINT_CAP_HRT, ZINT_CAP_HRT }, + /* 1*/ { BARCODE_CODE128, ZINT_CAP_HRT | ZINT_CAP_STACKABLE | ZINT_CAP_GS1, ZINT_CAP_HRT | ZINT_CAP_STACKABLE }, + /* 2*/ { BARCODE_PDF417, ZINT_CAP_HRT | ZINT_CAP_ECI | ZINT_CAP_GS1 | ZINT_CAP_READER_INIT | ZINT_CAP_FULL_MULTIBYTE, ZINT_CAP_ECI | ZINT_CAP_READER_INIT }, + /* 3*/ { BARCODE_QRCODE, ZINT_CAP_HRT | ZINT_CAP_ECI | ZINT_CAP_GS1 | ZINT_CAP_DOTTY | ZINT_CAP_READER_INIT | ZINT_CAP_FULL_MULTIBYTE, ZINT_CAP_ECI | ZINT_CAP_GS1 | ZINT_CAP_DOTTY | ZINT_CAP_FULL_MULTIBYTE }, + /* 4*/ { BARCODE_EANX_CC, ZINT_CAP_HRT | ZINT_CAP_COMPOSITE | ZINT_CAP_EXTENDABLE | ZINT_CAP_ECI | ZINT_CAP_GS1, ZINT_CAP_HRT | ZINT_CAP_COMPOSITE | ZINT_CAP_EXTENDABLE | ZINT_CAP_GS1 }, + /* 5*/ { BARCODE_HANXIN, ZINT_CAP_DOTTY | ZINT_CAP_FIXED_RATIO | ZINT_CAP_FULL_MULTIBYTE, ZINT_CAP_DOTTY | ZINT_CAP_FIXED_RATIO | ZINT_CAP_FULL_MULTIBYTE }, + /* 6*/ { BARCODE_CODE11, ZINT_CAP_DOTTY | ZINT_CAP_FIXED_RATIO | ZINT_CAP_READER_INIT | ZINT_CAP_FULL_MULTIBYTE, 0 }, + /* 7*/ { BARCODE_POSTNET, ZINT_CAP_HRT | ZINT_CAP_STACKABLE | ZINT_CAP_EXTENDABLE | ZINT_CAP_COMPOSITE | ZINT_CAP_ECI | ZINT_CAP_GS1 | ZINT_CAP_DOTTY | ZINT_CAP_FIXED_RATIO | ZINT_CAP_READER_INIT | ZINT_CAP_FULL_MULTIBYTE, 0 }, + /* 8*/ { 0, 0, 0 }, + }; + int data_size = ARRAY_SIZE(data); + + for (int i = 0; i < data_size; i++) { + + if (index != -1 && i != index) continue; + + ret = ZBarcode_Cap(data[i].symbology, data[i].cap_flag); + assert_equal(ret, data[i].expected, "i:%d ZBarcode_Cap(%s, 0x%X) 0x%X != 0x%X\n", i, testUtilBarcodeName(data[i].symbology), data[i].cap_flag, ret, data[i].expected); + } + + testFinish(); +} + // #181 Nico Gunkel OSS-Fuzz static void test_encode_file_zero_length(void) { @@ -262,14 +306,99 @@ static void test_encode_file_directory(void) { testFinish(); } +static void test_bad_args(void) { + + testStart(""); + + int ret; + char *data = "1"; + char *filename = "1.png"; + char *empty = ""; + + // These just return, no error + ZBarcode_Clear(NULL); + ZBarcode_Delete(NULL); + + ret = ZBarcode_Version(); + assert_nonzero(ret >= 20901, "ZBarcode_Version() %d <= 20901\n", ret); + + assert_zero(ZBarcode_ValidID(0), "ZBarcode_ValidID(0) non-zero\n"); + assert_zero(ZBarcode_ValidID(10), "ZBarcode_ValidID(10) non-zero\n"); // Note 10 remapped to BARCODE_EANX in ZBarcode_Encode() for tbarcode compat but not counted as valid + + ret = ZBarcode_Cap(0, ~0); + assert_zero(ret, "ZBarcode_Cap(0, ~0) ret 0x%X != 0\n", ret); + ret = ZBarcode_Cap(10, ~0); + assert_zero(ret, "ZBarcode_Cap(10, ~0) ret 0x%X != 0\n", ret); + + // NULL symbol + assert_equal(ZBarcode_Encode(NULL, data, 1), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode(NULL, data, 1) != ZINT_ERROR_INVALID_DATA\n"); + assert_equal(ZBarcode_Print(NULL, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Print(NULL, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_equal(ZBarcode_Buffer(NULL, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Buffer(NULL, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_equal(ZBarcode_Buffer_Vector(NULL, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Buffer_Vector(NULL, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_equal(ZBarcode_Encode_and_Print(NULL, data, 1, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Print(NULL, data, 1, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_equal(ZBarcode_Encode_and_Buffer(NULL, data, 1, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Buffer(NULL, data, 1, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_equal(ZBarcode_Encode_File(NULL, filename), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File(NULL, filename) != ZINT_ERROR_INVALID_DATA\n"); + assert_equal(ZBarcode_Encode_File_and_Print(NULL, filename, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File_and_Print(NULL, filename, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_equal(ZBarcode_Encode_File_and_Buffer(NULL, filename, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File_and_Buffer(NULL, filename, 0) != ZINT_ERROR_INVALID_DATA\n"); + + struct zint_symbol *symbol = ZBarcode_Create(); + assert_nonnull(symbol, "Symbol not created\n"); + + // NULL data/filename + symbol->errtxt[0] = '\0'; + assert_equal(ZBarcode_Encode(symbol, NULL, 1), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode(symbol, NULL, 1) != ZINT_ERROR_INVALID_DATA\n"); + assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode(symbol, NULL, 1) no errtxt\n"); + symbol->errtxt[0] = '\0'; + assert_equal(ZBarcode_Encode_and_Print(symbol, NULL, 1, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Print(symbol, NULL, 1, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_and_Print(symbol, NULL, 1, 0) no errtxt\n"); + symbol->errtxt[0] = '\0'; + assert_equal(ZBarcode_Encode_and_Buffer(symbol, NULL, 1, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Buffer(symbol, NULL, 1, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_and_Buffer(symbol, NULL, 1, 0) no errtxt\n"); + symbol->errtxt[0] = '\0'; + assert_equal(ZBarcode_Encode_File(symbol, NULL), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File(symbol, NULL) != ZINT_ERROR_INVALID_DATA\n"); + assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_File(symbol, NULL) no errtxt\n"); + symbol->errtxt[0] = '\0'; + assert_equal(ZBarcode_Encode_File_and_Print(symbol, NULL, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File_and_Print(symbol, NULL, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_File_and_Print(symbol, NULL, 0) no errtxt\n"); + symbol->errtxt[0] = '\0'; + assert_equal(ZBarcode_Encode_File_and_Buffer(symbol, NULL, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File_and_Buffer(symbol, NULL, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_File_and_Buffer(symbol, NULL, 0) no errtxt\n"); + + // Empty data/filename + symbol->errtxt[0] = '\0'; + assert_equal(ZBarcode_Encode(symbol, empty, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode(symbol, empty, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode(symbol, empty, 0) no errtxt\n"); + symbol->errtxt[0] = '\0'; + assert_equal(ZBarcode_Encode_and_Print(symbol, empty, 0, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Print(symbol, empty, 0, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_and_Print(symbol, empty, 0, 0) no errtxt\n"); + symbol->errtxt[0] = '\0'; + assert_equal(ZBarcode_Encode_and_Buffer(symbol, empty, 0, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_and_Buffer(symbol, empty, 0, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_and_Buffer(symbol, empty, 0, 0) no errtxt\n"); + symbol->errtxt[0] = '\0'; + assert_equal(ZBarcode_Encode_File(symbol, empty), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File(symbol, empty) != ZINT_ERROR_INVALID_DATA\n"); + assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_File(symbol, empty) no errtxt\n"); + symbol->errtxt[0] = '\0'; + assert_equal(ZBarcode_Encode_File_and_Print(symbol, empty, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File_and_Print(symbol, empty, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_File_and_Print(symbol, empty, 0) no errtxt\n"); + symbol->errtxt[0] = '\0'; + assert_equal(ZBarcode_Encode_File_and_Buffer(symbol, empty, 0), ZINT_ERROR_INVALID_DATA, "ZBarcode_Encode_File_and_Buffer(symbol, empty, 0) != ZINT_ERROR_INVALID_DATA\n"); + assert_nonzero(strlen(symbol->errtxt), "ZBarcode_Encode_File_and_Buffer(symbol, empty, 0) no errtxt\n"); + + ZBarcode_Delete(symbol); + + testFinish(); +} + int main(int argc, char *argv[]) { testFunction funcs[] = { /* name, func, has_index, has_generate, has_debug */ { "test_checks", test_checks, 1, 0, 1 }, { "test_input_mode", test_input_mode, 1, 0, 1 }, { "test_escape_char_process", test_escape_char_process, 1, 1, 1 }, + { "test_cap", test_cap, 1, 0, 1 }, { "test_encode_file_zero_length", test_encode_file_zero_length, 0, 0, 0 }, { "test_encode_file_directory", test_encode_file_directory, 0, 0, 0 }, + { "test_bad_args", test_bad_args, 0, 0, 0 }, }; testRun(argc, argv, funcs, ARRAY_SIZE(funcs)); diff --git a/backend/tests/test_mailmark.c b/backend/tests/test_mailmark.c index 9aa4cb96..d4d098da 100644 --- a/backend/tests/test_mailmark.c +++ b/backend/tests/test_mailmark.c @@ -197,11 +197,72 @@ static void test_encode_vector(int index, int debug) { testFinish(); } +static void test_encode(int index, int generate, int debug) { + + testStart(""); + + int ret; + struct item { + unsigned char *data; + int ret; + + int expected_rows; + int expected_width; + char *comment; + char *expected; + }; + struct item data[] = { + /* 0*/ { "1100000000000XY11 ", 0, 3, 131, "Verified manually against tec-it", + "00000000001000000000101000000000101000000000101000000000000000101000101000001000101000000010101000000000101000000000101010001010101" + "10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" + "00001000000000001000000000001000000000001000000000001000001010000000000010100000000000101010001000101000000010101000000010101000101" + }, + }; + int data_size = ARRAY_SIZE(data); + + char escaped[1024]; + + for (int i = 0; i < data_size; i++) { + + if (index != -1 && i != index) continue; + + struct zint_symbol *symbol = ZBarcode_Create(); + assert_nonnull(symbol, "Symbol not created\n"); + + int length = testUtilSetSymbol(symbol, BARCODE_MAILMARK, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, -1 /*output_options*/, data[i].data, -1, debug); + + ret = ZBarcode_Encode(symbol, data[i].data, length); + assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); + + if (generate) { + printf(" /*%3d*/ { \"%s\", %s, %d, %d, \"%s\",\n", + i, testUtilEscape(data[i].data, length, escaped, sizeof(escaped)), + testUtilErrorName(data[i].ret), symbol->rows, symbol->width, data[i].comment); + testUtilModulesDump(symbol, " ", "\n"); + printf(" },\n"); + } else { + if (ret < 5) { + assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); + assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); + + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + } + } + + ZBarcode_Delete(symbol); + } + + testFinish(); +} + int main(int argc, char *argv[]) { testFunction funcs[] = { /* name, func, has_index, has_generate, has_debug */ { "test_input", test_input, 1, 0, 1 }, { "test_encode_vector", test_encode_vector, 1, 0, 1 }, + { "test_encode", test_encode, 1, 1, 1 }, }; testRun(argc, argv, funcs, ARRAY_SIZE(funcs)); diff --git a/backend/tests/test_medical.c b/backend/tests/test_medical.c index 3b888593..d21342fe 100644 --- a/backend/tests/test_medical.c +++ b/backend/tests/test_medical.c @@ -204,6 +204,8 @@ static void test_encode(int index, int generate, int debug) { testStart(""); + int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise + int ret; struct item { int symbology; @@ -220,39 +222,41 @@ static void test_encode(int index, int generate, int debug) { /* 0*/ { BARCODE_CODABAR, -1, "A37859B", 0, 1, 72, "BS EN 798:1995 Figure 1", "101100100101100101010100101101010011010101101010010110100101010010010110" }, - /* 1*/ { BARCODE_CODABAR, -1, "A0123456789-$:/.+D", 0, 1, 186, "Verified manually against bwipp and tec-it", + /* 1*/ { BARCODE_CODABAR, -1, "A0123456789-$:/.+D", 0, 1, 186, "Verified manually against tec-it", "101100100101010100110101011001010100101101100101010101101001011010100101001010110100101101010011010101101001010101001101010110010101101011011011011010110110110110101011011011010100110010" }, - /* 2*/ { BARCODE_CODABAR, 1, "A1B", 0, 1, 43, "Verified manually against bwipp and tect-it", + /* 2*/ { BARCODE_CODABAR, 1, "A1B", 0, 1, 43, "Verified manually against tec-it", "1011001001010101100101101101101010010010110" }, - /* 3*/ { BARCODE_CODABAR, 1, "A+B", 0, 1, 43, "Verified manually against bwipp and tect-it", + /* 3*/ { BARCODE_CODABAR, 1, "A+B", 0, 1, 43, "Verified manually against tec-it", "1011001001010110110110101010011010010010110" }, - /* 4*/ { BARCODE_CODABAR, 1, "B0123456789-$:/.+B", 0, 1, 196, "Verified manually against bwipp and tec-it", + /* 4*/ { BARCODE_CODABAR, 1, "B0123456789-$:/.+B", 0, 1, 196, "Verified manually against tec-it", "1001001011010101001101010110010101001011011001010101011010010110101001010010101101001011010100110101011010010101010011010101100101011010110110110110101101101101101010110110110100101011010010010110" }, - /* 5*/ { BARCODE_PHARMA, -1, "131070", 0, 1, 78, "Verified manually against bwipp and tec-it", + /* 5*/ { BARCODE_PHARMA, -1, "131070", 0, 1, 78, "", "111001110011100111001110011100111001110011100111001110011100111001110011100111" }, - /* 6*/ { BARCODE_PHARMA, -1, "123456", 0, 1, 58, "Verified manually against bwipp and tec-it", + /* 6*/ { BARCODE_PHARMA, -1, "123456", 0, 1, 58, "", "1110011100111001001001001110010010011100100100100100100111" }, - /* 7*/ { BARCODE_PHARMA_TWO, -1, "64570080", 0, 2, 31, "Verified manually against bwipp and tec-it", + /* 7*/ { BARCODE_PHARMA_TWO, -1, "64570080", 0, 2, 31, "Verified manually against tec-it", "1010101010101010101010101010101" "1010101010101010101010101010101" }, - /* 8*/ { BARCODE_PHARMA_TWO, -1, "29876543", 0, 2, 31, "Verified manually against bwipp and tec-it", + /* 8*/ { BARCODE_PHARMA_TWO, -1, "29876543", 0, 2, 31, "Verified manually against tec-it", "0010100010001010001010001000101" "1000101010100000100000101010000" }, - /* 9*/ { BARCODE_CODE32, -1, "34567890", 0, 1, 103, "Verified manually against bwipp and tec-it", + /* 9*/ { BARCODE_CODE32, -1, "34567890", 0, 1, 103, "Verified manually against tec-it", "1001011011010101101001011010110010110101011011010010101100101101011010010101101010101100110100101101101" }, }; int data_size = ARRAY_SIZE(data); char escaped[1024]; + char bwipp_buf[8192]; + char bwipp_msg[1024]; for (int i = 0; i < data_size; i++) { @@ -277,10 +281,17 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + + if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, data[i].option_2, -1, debug)) { + ret = testUtilBwipp(i, symbol, -1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); + + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_pcx.c b/backend/tests/test_pcx.c index 2e1b72b6..a150b5bc 100644 --- a/backend/tests/test_pcx.c +++ b/backend/tests/test_pcx.c @@ -52,16 +52,16 @@ static void test_pcx(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_CODE128, -1, -1, NULL, NULL, 0, "AIM" }, - /* 1*/ { BARCODE_QRCODE, 2, 1, NULL, NULL, 0, "1234567890" }, - /* 2*/ { BARCODE_DOTCODE, -1, -1, NULL, NULL, 0, "2741" }, - /* 3*/ { BARCODE_MAXICODE, -1, -1, NULL, NULL, 0, "1" }, - /* 4*/ { BARCODE_GRIDMATRIX, -1, -1, NULL, NULL, 0.75, "Grid Matrix" }, + /* 0*/ { BARCODE_CODE128, -1, -1, "", "", 0, "AIM" }, + /* 1*/ { BARCODE_QRCODE, 2, 1, "", "", 0, "1234567890" }, + /* 2*/ { BARCODE_DOTCODE, -1, -1, "", "", 0, "2741" }, + /* 3*/ { BARCODE_MAXICODE, -1, -1, "", "", 0, "1" }, + /* 4*/ { BARCODE_GRIDMATRIX, -1, -1, "", "", 0.75, "Grid Matrix" }, /* 5*/ { BARCODE_CODABLOCKF, -1, 20, "FFFFFF", "000000", 0, "1234567890123456789012345678901234567890" }, - /* 6*/ { BARCODE_CODE128, -1, -1, "C3C3C3", NULL, 0, "AIM" }, - /* 7*/ { BARCODE_QRCODE, 2, 1, NULL, "D2E3F4", 0, "1234567890" }, + /* 6*/ { BARCODE_CODE128, -1, -1, "C3C3C3", "", 0, "AIM" }, + /* 7*/ { BARCODE_QRCODE, 2, 1, "", "D2E3F4", 0, "1234567890" }, /* 8*/ { BARCODE_DOTCODE, -1, -1, "C2C100", "E0E1F2", 0, "2741" }, - /* 9*/ { BARCODE_ULTRA, -1, -1, NULL, NULL, 0, "ULTRACODE_123456789!" }, + /* 9*/ { BARCODE_ULTRA, -1, -1, "", "", 0, "ULTRACODE_123456789!" }, }; int data_size = ARRAY_SIZE(data); @@ -79,10 +79,10 @@ static void test_pcx(int index, int debug) { if (data[i].option_2 != -1) { symbol->option_2 = data[i].option_2; } - if (data[i].fgcolour != NULL) { + if (*data[i].fgcolour) { strcpy(symbol->fgcolour, data[i].fgcolour); } - if (data[i].bgcolour != NULL) { + if (*data[i].bgcolour) { strcpy(symbol->bgcolour, data[i].bgcolour); } if (data[i].scale != 0) { diff --git a/backend/tests/test_pdf417.c b/backend/tests/test_pdf417.c index 7da093f4..ef36de7e 100644 --- a/backend/tests/test_pdf417.c +++ b/backend/tests/test_pdf417.c @@ -637,22 +637,20 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); - } + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); if (do_bwipp && testUtilCanBwipp(symbol->symbology, data[i].option_1, data[i].option_2, -1, debug)) { if (!data[i].bwipp_cmp) { - if (debug & ZINT_DEBUG_TEST_PRINT) printf("%d: %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment); + if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not BWIPP compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment); } else { - ret = testUtilBwipp(symbol, data[i].option_1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + ret = testUtilBwipp(i, symbol, data[i].option_1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } @@ -924,6 +922,14 @@ static void test_fuzz(int index, int debug) { "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" "1234567890123456789012345678901234567890123456789012345678901234567", 367, -1, ZINT_ERROR_TOO_LONG }, + /*12*/ { BARCODE_MICROPDF417, + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP", + 250, -1, 0 }, // Max text + /*13*/ { BARCODE_MICROPDF417, + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQ", + 251, -1, ZINT_ERROR_TOO_LONG }, }; int data_size = sizeof(data) / sizeof(struct item); diff --git a/backend/tests/test_png.c b/backend/tests/test_png.c index 8c66b4bd..a33df6a1 100644 --- a/backend/tests/test_png.c +++ b/backend/tests/test_png.c @@ -118,23 +118,49 @@ static void test_print(int index, int generate, int debug) { int ret; struct item { int symbology; + int input_mode; + int output_options; + int show_hrt; int option_1; int option_2; - unsigned char* data; - char* expected_file; + int height; + float scale; + unsigned char *data; + char *composite; + char *expected_file; + char *comment; }; struct item data[] = { - /* 0*/ { BARCODE_CODABLOCKF, 3, -1, "AAAAAAAAA", "../data/png/codablockf_3rows.png" }, - /* 1*/ { BARCODE_EANX, -1, -1, "9771384524017+12", "../data/png/ean13_2addon_ggs_5.2.2.5.1-2.png" }, - /* 2*/ { BARCODE_EANX, -1, -1, "9780877799306+54321", "../data/png/ean13_5addon_ggs_5.2.2.5.2-2.png" }, - /* 3*/ { BARCODE_UPCA, -1, -1, "012345678905+24", "../data/png/upca_2addon_ggs_5.2.6.6-5.png" }, - /* 4*/ { BARCODE_UPCA, -1, -1, "614141234417+12345", "../data/png/upca_5addon.png" }, - /* 5*/ { BARCODE_UPCE, -1, -1, "1234567+12", "../data/png/upce_2addon.png" }, - /* 6*/ { BARCODE_UPCE, -1, -1, "1234567+12345", "../data/png/upce_5addon.png" }, - /* 7*/ { BARCODE_EANX, -1, -1, "1234567+12", "../data/png/ean8_2addon.png" }, - /* 8*/ { BARCODE_EANX, -1, -1, "1234567+12345", "../data/png/ean8_5addon.png" }, - /* 9*/ { BARCODE_EANX, -1, -1, "12345", "../data/png/ean5.png" }, - /* 10*/ { BARCODE_EANX, -1, -1, "12", "../data/png/ean2.png" }, + /* 0*/ { BARCODE_CODE128, UNICODE_MODE, BOLD_TEXT, -1, -1, -1, 0, 0, "Égjpqy", "", "../data/png/code128_egrave_bold.png", "" }, + /* 1*/ { BARCODE_CODE128, UNICODE_MODE, BOLD_TEXT | BARCODE_BOX, -1, -1, -1, 0, 0, "Égjpqy", "", "../data/png/code128_egrave_bold_box3.png", "" }, + /* 2*/ { BARCODE_GS1_128_CC, -1, -1, -1, 3, -1, 0, 0, "[00]030123456789012340", "[02]13012345678909[37]24[10]1234567ABCDEFG", "../data/png/gs1_128_cc_fig12.png", "" }, + /* 3*/ { BARCODE_CODABLOCKF, -1, -1, -1, 3, -1, 0, 0, "AAAAAAAAA", "", "../data/png/codablockf_3rows.png", "" }, + /* 4*/ { BARCODE_EANX, -1, -1, -1, -1, -1, 0, 0, "9771384524017+12", "", "../data/png/ean13_2addon_ggs_5.2.2.5.1-2.png", "" }, + /* 5*/ { BARCODE_EANX, -1, -1, -1, -1, -1, 0, 0, "9780877799306+54321", "", "../data/png/ean13_5addon_ggs_5.2.2.5.2-2.png", "" }, + /* 6*/ { BARCODE_EANX_CC, -1, -1, -1, 1, -1, 0, 0, "123456789012+12", "[91]123456789012345678901", "../data/png/ean13_cc_2addon_cca_4x4.png", "" }, + /* 7*/ { BARCODE_EANX_CC, -1, -1, -1, 2, -1, 0, 0, "123456789012+54321", "[91]1234567890", "../data/png/ean13_cc_5addon_ccb_3x4.png", "" }, + /* 8*/ { BARCODE_EANX_CC, -1, -1, 0, 2, -1, 0, 0, "123456789012+54321", "[91]1234567890", "../data/png/ean13_cc_5addon_ccb_3x4_notext.png", "" }, + /* 9*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, 0, 0, "012345678905+24", "", "../data/png/upca_2addon_ggs_5.2.6.6-5.png", "" }, + /* 10*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, 0, 0, "614141234417+12345", "", "../data/png/upca_5addon.png", "" }, + /* 11*/ { BARCODE_UPCA, -1, -1, 0, -1, -1, 0, 0, "614141234417+12345", "", "../data/png/upca_5addon_notext.png", "" }, + /* 12*/ { BARCODE_UPCA, -1, BARCODE_BIND, -1, -1, -1, 0, 0, "614141234417+12345", "", "../data/png/upca_5addon_bind3.png", "" }, + /* 13*/ { BARCODE_UPCA_CC, -1, -1, -1, 1, -1, 0, 0, "12345678901+12", "[91]123456789", "../data/png/upca_cc_2addon_cca_3x4.png", "" }, + /* 14*/ { BARCODE_UPCA_CC, -1, -1, -1, 2, -1, 0, 0, "12345678901+12121", "[91]1234567890123", "../data/png/upca_cc_5addon_ccb_4x4.png", "" }, + /* 15*/ { BARCODE_UPCA_CC, -1, -1, 0, 2, -1, 0, 0, "12345678901+12121", "[91]1234567890123", "../data/png/upca_cc_5addon_ccb_4x4_notext.png", "" }, + /* 16*/ { BARCODE_UPCA_CC, -1, BARCODE_BIND, -1, 2, -1, 0, 0, "12345678901+12121", "[91]1234567890123", "../data/png/upca_cc_5addon_ccb_4x4_bind3.png", "" }, + /* 17*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, 0, 0, "1234567+12", "", "../data/png/upce_2addon.png", "" }, + /* 18*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, 0, 0, "1234567+12345", "", "../data/png/upce_5addon.png", "" }, + /* 19*/ { BARCODE_UPCE_CC, -1, -1, -1, 1, -1, 0, 0, "0654321+89", "[91]1", "../data/png/upce_cc_2addon_cca_5x2.png", "" }, + /* 20*/ { BARCODE_UPCE_CC, -1, -1, -1, 2, -1, 0, 0, "1876543+56789", "[91]12345", "../data/png/upce_cc_5addon_ccb_8x2.png", "" }, + /* 21*/ { BARCODE_UPCE_CC, -1, -1, 0, 2, -1, 0, 0, "1876543+56789", "[91]12345", "../data/png/upce_cc_5addon_ccb_8x2_notext.png", "" }, + /* 22*/ { BARCODE_EANX, -1, -1, -1, -1, -1, 0, 0, "1234567+12", "", "../data/png/ean8_2addon.png", "" }, + /* 23*/ { BARCODE_EANX, -1, -1, -1, -1, -1, 0, 0, "1234567+12345", "", "../data/png/ean8_5addon.png", "" }, + /* 24*/ { BARCODE_EANX_CC, -1, -1, -1, -1, -1, 0, 0, "9876543+65", "[91]1234567", "../data/png/ean8_cc_2addon_cca_4x3.png", "" }, + /* 25*/ { BARCODE_EANX_CC, -1, -1, -1, -1, -1, 0, 0, "9876543+74083", "[91]123456789012345678", "../data/png/ean8_cc_5addon_ccb_8x3.png", "" }, + /* 26*/ { BARCODE_EANX, -1, -1, -1, -1, -1, 0, 0, "12345", "", "../data/png/ean5.png", "" }, + /* 27*/ { BARCODE_EANX, -1, -1, -1, -1, -1, 0, 0, "12", "", "../data/png/ean2.png", "" }, + /* 28*/ { BARCODE_CODE39, -1, SMALL_TEXT, -1, -1, -1, 0, 0, "123", "", "../data/png/code39_small.png", "" }, + /* 29*/ { BARCODE_POSTNET, -1, -1, -1, -1, -1, 0, 3.5, "12345", "", "../data/png/postnet_zip.png", "300 dpi, using 1/43in X, 300 / 43 / 2 = ~3.5 scale" }, }; int data_size = ARRAY_SIZE(data); @@ -142,6 +168,7 @@ static void test_print(int index, int generate, int debug) { char* png = "out.png"; char escaped[1024]; int escaped_size = 1024; + char *text; if (generate) { if (!testUtilExists(data_dir)) { @@ -157,18 +184,28 @@ static void test_print(int index, int generate, int debug) { struct zint_symbol* symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); - symbol->symbology = data[i].symbology; - if (data[i].option_1 != -1) { - symbol->option_1 = data[i].option_1; + int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, data[i].output_options, data[i].data, -1, debug); + if (data[i].show_hrt != -1) { + symbol->show_hrt = data[i].show_hrt; } - if (data[i].option_2 != -1) { - symbol->option_2 = data[i].option_2; + if (data[i].height) { + symbol->height = data[i].height; } - symbol->debug |= debug; + if (data[i].scale) { + symbol->scale = data[i].scale; + } + if (data[i].output_options & (BARCODE_BOX | BARCODE_BIND)) { + symbol->border_width = 3; + } + if (strlen(data[i].composite)) { + text = data[i].composite; + strcpy(symbol->primary, data[i].data); + } else { + text = data[i].data; + } + int text_length = strlen(text); - int length = strlen(data[i].data); - - ret = ZBarcode_Encode(symbol, data[i].data, length); + ret = ZBarcode_Encode(symbol, text, text_length); assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); strcpy(symbol->outfile, png); @@ -176,9 +213,10 @@ static void test_print(int index, int generate, int debug) { assert_zero(ret, "i:%d %s ZBarcode_Print %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret); if (generate) { - printf(" /*%3d*/ { %s, %d, %d, \"%s\", \"%s\"},\n", - i, testUtilBarcodeName(data[i].symbology), data[i].option_1, data[i].option_2, - testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].expected_file); + printf(" /*%3d*/ { %s, %s, %s, %d, %d, %d, %d, %.5g, \"%s\", \"%s\", \"%s\", \"%s\" },\n", + i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), testUtilOutputOptionsName(data[i].output_options), + data[i].show_hrt, data[i].option_1, data[i].option_2, data[i].height, data[i].scale, testUtilEscape(data[i].data, length, escaped, escaped_size), + data[i].composite, data[i].expected_file, data[i].comment); ret = rename(symbol->outfile, data[i].expected_file); assert_zero(ret, "i:%d rename(%s, %s) ret %d != 0\n", i, symbol->outfile, data[i].expected_file, ret); if (have_identify) { diff --git a/backend/tests/test_postal.c b/backend/tests/test_postal.c index 9ee1c6ec..9c5ac147 100644 --- a/backend/tests/test_postal.c +++ b/backend/tests/test_postal.c @@ -52,7 +52,7 @@ static void test_large(int index, int debug) { struct item data[] = { /* 0*/ { BARCODE_FLAT, "1", 90, 0, 1, 810 }, /* 1*/ { BARCODE_FLAT, "1", 91, ZINT_ERROR_TOO_LONG, -1, -1 }, - /* 2*/ { BARCODE_POSTNET, "1", 11, 0, 2, 185 }, + /* 2*/ { BARCODE_POSTNET, "1", 11, 0, 2, 123 }, /* 3*/ { BARCODE_POSTNET, "1", 12, ZINT_ERROR_TOO_LONG, -1, -1 }, /* 4*/ { BARCODE_FIM, "D", 1, 0, 1, 17 }, /* 5*/ { BARCODE_FIM, "D", 2, ZINT_ERROR_TOO_LONG, -1, -1 }, @@ -62,7 +62,7 @@ static void test_large(int index, int debug) { /* 9*/ { BARCODE_JAPANPOST, "1", 21, ZINT_ERROR_TOO_LONG, -1, -1 }, /* 10*/ { BARCODE_KOREAPOST, "1", 6, 0, 1, 162 }, /* 11*/ { BARCODE_KOREAPOST, "1", 7, ZINT_ERROR_TOO_LONG, -1, -1 }, - /* 12*/ { BARCODE_PLANET, "1", 13, 0, 2, 215 }, + /* 12*/ { BARCODE_PLANET, "1", 13, 0, 2, 143 }, /* 13*/ { BARCODE_PLANET, "1", 14, ZINT_ERROR_TOO_LONG, -1, -1 }, /* 14*/ { BARCODE_KIX, "1", 18, 0, 3, 143 }, /* 15*/ { BARCODE_KIX, "1", 19, ZINT_ERROR_TOO_LONG, -1, -1 }, @@ -216,9 +216,9 @@ static void test_input(int index, int debug) { struct item data[] = { /* 0*/ { BARCODE_FLAT, "1234567890", 0, 1, 90 }, /* 1*/ { BARCODE_FLAT, "A", ZINT_ERROR_INVALID_DATA, -1, -1 }, - /* 2*/ { BARCODE_POSTNET, "12345", 0, 2, 95 }, - /* 3*/ { BARCODE_POSTNET, "123457689", 0, 2, 155 }, - /* 4*/ { BARCODE_POSTNET, "12345768901", 0, 2, 185 }, + /* 2*/ { BARCODE_POSTNET, "12345", 0, 2, 63 }, + /* 3*/ { BARCODE_POSTNET, "123457689", 0, 2, 103 }, + /* 4*/ { BARCODE_POSTNET, "12345768901", 0, 2, 123 }, /* 5*/ { BARCODE_POSTNET, "1234", ZINT_ERROR_TOO_LONG, -1, -1 }, /* 6*/ { BARCODE_POSTNET, "123456", ZINT_ERROR_TOO_LONG, -1, -1 }, /* 7*/ { BARCODE_POSTNET, "123456789012", ZINT_ERROR_TOO_LONG, -1, -1 }, @@ -237,8 +237,8 @@ static void test_input(int index, int debug) { /* 20*/ { BARCODE_JAPANPOST, ",", ZINT_ERROR_INVALID_DATA, -1, -1 }, /* 21*/ { BARCODE_KOREAPOST, "123456", 0, 1, 167 }, /* 22*/ { BARCODE_KOREAPOST, "A", ZINT_ERROR_INVALID_DATA, -1, -1 }, - /* 23*/ { BARCODE_PLANET, "12345678901", 0, 2, 185 }, - /* 24*/ { BARCODE_PLANET, "1234567890123", 0, 2, 215 }, + /* 23*/ { BARCODE_PLANET, "12345678901", 0, 2, 123 }, + /* 24*/ { BARCODE_PLANET, "1234567890123", 0, 2, 143 }, /* 25*/ { BARCODE_PLANET, "1234567890", ZINT_ERROR_TOO_LONG, -1, -1 }, /* 26*/ { BARCODE_PLANET, "123456789012", ZINT_ERROR_TOO_LONG, -1, -1 }, /* 27*/ { BARCODE_PLANET, "12345678901234", ZINT_ERROR_TOO_LONG, -1, -1 }, @@ -279,6 +279,8 @@ static void test_encode(int index, int generate, int debug) { testStart(""); + int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise + int ret; struct item { int symbology; @@ -291,67 +293,81 @@ static void test_encode(int index, int generate, int debug) { char *expected; }; struct item data[] = { - /* 0*/ { BARCODE_FLAT, "1304056", 0, 1, 63, "Verified manually against bwipp and tec-it", + /* 0*/ { BARCODE_FLAT, "1304056", 0, 1, 63, "Verified manually against tec-it", "100000000001000000000000000000100000000000000000010000000001000" }, - /* 1*/ { BARCODE_POSTNET, "12345678901", 0, 2, 185, "USPS Publication 25 (2003) Exhibit 4-1", - "10000000000010010000000010000010000000010010000000010000000010000010000010000000010010000000010000000000010010000000010000010000010000000010010000000000000000000010010000010000000010010" - "10010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010" + /* 1*/ { BARCODE_POSTNET, "12345678901", 0, 2, 123, "USPS Publication 25 (2003) Exhibit 4-1", + "100000001010000010001000001010000010000010001000100000101000001000000010100000100010001000001010000000000000101000100000101" + "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" }, - /* 2*/ { BARCODE_POSTNET, "555551237", 0, 2, 155, "Verified manually against bwipp and tec-it", - "10000010000010000000010000010000000010000010000000010000010000000010000010000000000000010010000000010000010000000010010000010000000000010000000010000010010" - "10010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010" + /* 2*/ { BARCODE_POSTNET, "555551237", 0, 2, 103, "Verified manually against tec-it", + "1000100010000010001000001000100000100010000010001000000000101000001000100000101000100000001000001000101" + "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" }, /* 3*/ { BARCODE_FIM, "C", 0, 1, 17, "USPS DMM Exhibit 8.2.0 FIM C", "10100010001000101" }, - /* 4*/ { BARCODE_RM4SCC, "BX11LT1A", 0, 3, 75, "Verified manually against bwipp and tec-it", + /* 4*/ { BARCODE_RM4SCC, "BX11LT1A", 0, 3, 75, "Verified manually against tec-it", "100010001010100000000010100000101010000010100010000000101000100010100000101" "101010101010101010101010101010101010101010101010101010101010101010101010101" "001010000010000010001000100010001010000010101000000010001010001000000010101" }, - /* 5*/ { BARCODE_RM4SCC, "W1J0TR01", 0, 3, 75, "Verified manually against bwipp and tec-it", + /* 5*/ { BARCODE_RM4SCC, "W1J0TR01", 0, 3, 75, "Verified manually against tec-it", "101010000000001010100000100000101010001000100010000000101000001010101000001" "101010101010101010101010101010101010101010101010101010101010101010101010101" "000010100000100010001000100000101010100000100000100000101000100010001010001" }, - /* 6*/ { BARCODE_JAPANPOST, "12345671-2-3", 0, 3, 133, "Verified manually against bwipp and tec-it", + /* 6*/ { BARCODE_JAPANPOST, "15400233-16-4-205", 0, 3, 133, "Zip/Barcode Manual p.6 1st example; verified manually against tec-it", + "1000101000100010101000100000100000100010001010001010001000101000001010001000101000001000100010100000100010000010000010000010001010001" + "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" + "1010101000100010100010100000100000101000101000101000001000101000100010001000100010001000101000100000100010001000001000001000100010101" + }, + /* 7*/ { BARCODE_JAPANPOST, "350110622-1A308", 0, 3, 133, "Zip/Barcode Manual p.6 2nd example; verified manually against tec-it", + "1000001010100010100000101000101000100000001010100010100010001000101000001000100000001010100000100010000010000010000010000010100010001" + "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" + "1010101000100010100000101000101000100000100010101000101000001000101000100000100000101000100000001010001000001000001000001000100010101" + }, + /* 8*/ { BARCODE_JAPANPOST, "12345671-2-3", 0, 3, 133, "Verified manually against tec-it", "1000101000100010001010101000100010001010101000101000001000100010001000001010000010000010000010000010000010000010000010000010100010001" "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" "1010101000101000101000100010100010100010001010101000001000101000001000101000001000001000001000001000001000001000001000001000100010101" }, - /* 7*/ { BARCODE_KOREAPOST, "010230", 0, 1, 167, "Verified manually against tec-it", + /* 9*/ { BARCODE_KOREAPOST, "010230", 0, 1, 167, "Verified manually against tec-it", "10001000100000000000100010000000000010001000100000001000000010001000100010001000100000000000100000000001000100010001000100010001000000000001000000010001000000010001000" }, - /* 8*/ { BARCODE_PLANET, "4012345235636", 0, 2, 215, "USPS Publication 197 (2004) Exhibit 5; verified manually against bwipp and tec-it", - "10010000010010000000000010010010010010010000000010010000010000010010000000010010000010010000010000010000010010010000010000010010000000010010000010000010010000000010010010010000000010010000000010010010000000010010010" - "10010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010" + /* 10*/ { BARCODE_PLANET, "4012345235636", 0, 2, 143, "USPS Publication 197 (2004) Exhibit 4; verified manually against tec-it", + "10100010100000001010101010100000101000100010100000101000101000100010001010100010001010000010100010001010000010101010000010100000101010000010101" + "10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" }, - /* 9*/ { BARCODE_PLANET, "40123452356", 0, 2, 185, "Verified manually against bwipp and tec-it", - "10010000010010000000000010010010010010010000000010010000010000010010000000010010000010010000010000010000010010010000010000010010000000010010000010000010010000000010010010000010000010010" - "10010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010" + /* 11*/ { BARCODE_PLANET, "40123452356", 0, 2, 123, "Verified manually against tec-it", + "101000101000000010101010101000001010001000101000001010001010001000100010101000100010100000101000100010100000101010001000101" + "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" }, - /* 10*/ { BARCODE_KIX, "2500GG30250", 0, 3, 87, "PostNL Handleiding KIX code Section 2.1 Example 1", + /* 12*/ { BARCODE_PLANET, "5020140235635", 0, 2, 143, "USPS Publication 197 (2004) Exhibit 6; verified manually against tec-it", + "10100010001000001010101010001000000010101010101000001000101000000010101010100010001010000010100010001010000010101010000010100010001010001010001" + "10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" + }, + /* 13*/ { BARCODE_KIX, "2500GG30250", 0, 3, 87, "PostNL Handleiding KIX code Section 2.1 Example 1", "000010100000101000001010000010100010100000101000000010100000101000001010000010100000101" "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" "001010001010000000001010000010101000100010001000100000100000101000101000101000000000101" }, - /* 11*/ { BARCODE_KIX, "2130VA80430", 0, 3, 87, "PostNL Handleiding KIX code Section 2.1 Example 2", + /* 14*/ { BARCODE_KIX, "2130VA80430", 0, 3, 87, "PostNL Handleiding KIX code Section 2.1 Example 2", "000010100000101000001010000010101010000000100010001000100000101000001010000010100000101" "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" "001010000010001010000010000010100010001010001000001010000000101010001000100000100000101" }, - /* 12*/ { BARCODE_KIX, "1231GF156X2", 0, 3, 87, "PostNL Handleiding KIX code Section 2.1 Example 3", + /* 15*/ { BARCODE_KIX, "1231GF156X2", 0, 3, 87, "PostNL Handleiding KIX code Section 2.1 Example 3", "000010100000101000001010000010100010100000101000000010100000101000100010101000000000101" "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" "001000100010100010000010001000101000100010000010001000101010000000001010100000100010100" }, - /* 13*/ { BARCODE_KIX, "1231FZ13Xhs", 0, 3, 87, "PostNL Handleiding KIX code Section 2.1 Example 4", + /* 16*/ { BARCODE_KIX, "1231FZ13Xhs", 0, 3, 87, "PostNL Handleiding KIX code Section 2.1 Example 4", "000010100000101000001010000010100010100010100000000010100000101010100000001010001000100" "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" "001000100010100010000010001000101000001010100000001000101000001010000010101000001000100" }, - /* 14*/ { BARCODE_DAFT, "DAFTTFADFATDTATFT", 0, 3, 33, "Verified manually against bwipp and tec-it", + /* 17*/ { BARCODE_DAFT, "DAFTTFADFATDTATFT", 0, 3, 33, "Verified manually against tec-it", "001010000010100010100000001000100" "101010101010101010101010101010101" "100010000010001010000010000000100" @@ -360,6 +376,8 @@ static void test_encode(int index, int generate, int debug) { int data_size = ARRAY_SIZE(data); char escaped[1024]; + char bwipp_buf[8192]; + char bwipp_msg[1024]; for (int i = 0; i < data_size; i++) { @@ -384,10 +402,17 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); + + if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, -1, -1, debug)) { + ret = testUtilBwipp(i, symbol, -1, -1, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); + + ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); + assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_print.c b/backend/tests/test_print.c index 4864d83f..148f6486 100644 --- a/backend/tests/test_print.c +++ b/backend/tests/test_print.c @@ -47,14 +47,15 @@ static void test_print(int index, int generate, int debug) { int symbology; int option_1; int option_2; + float scale; unsigned char *data; char *expected_file; }; struct item data[] = { - /* 0*/ { BARCODE_CODE128, -1, -1, "AIM", "code128_aim" }, - /* 1*/ { BARCODE_QRCODE, 2, 1, "1234567890", "qr_v1_m" }, - /* 2*/ { BARCODE_DOTCODE, -1, -1, "2741", "dotcode_aim_fig7" }, - /* 3*/ { BARCODE_ULTRA, -1, -1, "A", "ultracode_a" }, + /* 0*/ { BARCODE_CODE128, -1, -1, -1, "AIM", "code128_aim" }, + /* 1*/ { BARCODE_QRCODE, 2, 1, -1, "1234567890", "qr_v1_m" }, + /* 2*/ { BARCODE_DOTCODE, -1, -1, 5, "2741", "dotcode_aim_fig7" }, + /* 3*/ { BARCODE_ULTRA, -1, -1, -1, "A", "ultracode_a" }, }; int data_size = sizeof(data) / sizeof(struct item); @@ -98,16 +99,10 @@ static void test_print(int index, int generate, int debug) { struct zint_symbol *symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); - symbol->symbology = data[i].symbology; - if (data[i].option_1 != -1) { - symbol->option_1 = data[i].option_1; + int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); + if (data[i].scale != -1) { + symbol->scale = data[i].scale; } - if (data[i].option_2 != -1) { - symbol->option_2 = data[i].option_2; - } - symbol->debug |= debug; - - int length = strlen(data[i].data); ret = ZBarcode_Encode(symbol, data[i].data, length); assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); @@ -126,8 +121,9 @@ static void test_print(int index, int generate, int debug) { if (generate) { if (j == 0) { - printf(" /*%3d*/ { %s, %d, %d, \"%s\", \"%s\" },\n", - i, testUtilBarcodeName(data[i].symbology), data[i].option_1, data[i].option_2, testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].expected_file); + printf(" /*%3d*/ { %s, %d, %d, %.8g, \"%s\", \"%s\" },\n", + i, testUtilBarcodeName(data[i].symbology), data[i].option_1, data[i].option_2, data[i].scale, + testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].expected_file); } if (strstr(TEST_PRINT_OVERWRITE_EXPECTED, exts[j])) { ret = rename(symbol->outfile, expected_file); diff --git a/backend/tests/test_ps.c b/backend/tests/test_ps.c index 14057c78..95f4922b 100644 --- a/backend/tests/test_ps.c +++ b/backend/tests/test_ps.c @@ -41,6 +41,8 @@ static void test_print(int index, int generate, int debug) { int ret; struct item { int symbology; + int input_mode; + int output_options; int whitespace_width; int option_1; int option_2; @@ -50,8 +52,15 @@ static void test_print(int index, int generate, int debug) { char *expected_file; }; struct item data[] = { - /* 0*/ { BARCODE_CODE39, -1, -1, -1, "147AD0", "FC9630", "123", "../data/eps/code39_fg_bg.eps" }, - /* 1*/ { BARCODE_ULTRA, 1, -1, -1, "147AD0", "FC9630", "123", "../data/eps/ultra_fg_bg.eps" }, + /* 0*/ { BARCODE_CODE128, UNICODE_MODE, BOLD_TEXT, -1, -1, -1, "", "", "Égjpqy", "../data/eps/code128_egrave_bold.eps" }, + /* 1*/ { BARCODE_CODE39, -1, -1, -1, -1, -1, "147AD0", "FC9630", "123", "../data/eps/code39_fg_bg.eps" }, + /* 2*/ { BARCODE_ULTRA, -1, 1, -1, -1, -1, "147AD0", "FC9630", "123", "../data/eps/ultra_fg_bg.eps" }, + /* 3*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "", "", "9771384524017+12", "../data/eps/ean13_2addon_ggs_5.2.2.5.1-2.eps" }, + /* 4*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, "", "", "012345678905+24", "../data/eps/upca_2addon_ggs_5.2.6.6-5.eps" }, + /* 5*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, "", "", "0123456+12345", "../data/eps/upce_5addon.eps" }, + /* 6*/ { BARCODE_UPCE, -1, SMALL_TEXT | BOLD_TEXT, -1, -1, -1, "", "", "0123456+12345", "../data/eps/upce_5addon_small_bold.eps" }, + /* 7*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, -1, -1, "", "", "A\\B)ç(D", "../data/eps/code128_escape_latin1.eps" }, + /* 8*/ { BARCODE_DBAR_LTD, -1, BOLD_TEXT, -1, -1, -1, "", "", "1501234567890", "../data/eps/dbar_ltd_24724_fig7_bold.eps" }, }; int data_size = ARRAY_SIZE(data); @@ -74,14 +83,14 @@ static void test_print(int index, int generate, int debug) { struct zint_symbol *symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); - int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); + int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, data[i].output_options, data[i].data, -1, debug); if (data[i].whitespace_width != -1) { symbol->whitespace_width = data[i].whitespace_width; } - if (data[i].fgcolour != NULL) { + if (*data[i].fgcolour) { strcpy(symbol->fgcolour, data[i].fgcolour); } - if (data[i].bgcolour != NULL) { + if (*data[i].bgcolour) { strcpy(symbol->bgcolour, data[i].bgcolour); } @@ -93,9 +102,9 @@ static void test_print(int index, int generate, int debug) { assert_zero(ret, "i:%d %s ZBarcode_Print %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret); if (generate) { - printf(" /*%3d*/ { %s, %d, %d, %d, \"%s\", \"%s\", \"%s\", \"%s\"},\n", - i, testUtilBarcodeName(data[i].symbology), data[i].whitespace_width, data[i].option_1, data[i].option_2, data[i].fgcolour, data[i].bgcolour, - testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].expected_file); + printf(" /*%3d*/ { %s, %s, %s, %d, %d, %d, \"%s\", \"%s\", \"%s\", \"%s\"},\n", + i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), testUtilOutputOptionsName(data[i].output_options), data[i].whitespace_width, + data[i].option_1, data[i].option_2, data[i].fgcolour, data[i].bgcolour, testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].expected_file); ret = rename(symbol->outfile, data[i].expected_file); assert_zero(ret, "i:%d rename(%s, %s) ret %d != 0\n", i, symbol->outfile, data[i].expected_file, ret); if (have_inkscape) { @@ -117,10 +126,40 @@ static void test_print(int index, int generate, int debug) { testFinish(); } +void ps_convert(const unsigned char *string, unsigned char *ps_string); + +static void test_ps_convert(int index, int debug) { + + testStart(""); + + int ret; + struct item { + unsigned char *data; + unsigned char *expected; + }; + struct item data[] = { + /* 0*/ { "1\\(é)2€3", "1\\\\\\(\351\\)23" }, + }; + int data_size = ARRAY_SIZE(data); + + unsigned char converted[256]; + + for (int i = 0; i < data_size; i++) { + + if (index != -1 && i != index) continue; + + ps_convert(data[i].data, converted); + assert_zero(strcmp(converted, data[i].expected), "i:%d ps_convert(%s) %s != %s\n", i, data[i].data, converted, data[i].expected); + } + + testFinish(); +} + int main(int argc, char *argv[]) { testFunction funcs[] = { /* name, func, has_index, has_generate, has_debug */ { "test_print", test_print, 1, 1, 1 }, + { "test_ps_convert", test_ps_convert, 1, 0, 1 }, }; testRun(argc, argv, funcs, ARRAY_SIZE(funcs)); diff --git a/backend/tests/test_raster.c b/backend/tests/test_raster.c index d36fcf27..ae50690f 100644 --- a/backend/tests/test_raster.c +++ b/backend/tests/test_raster.c @@ -121,14 +121,14 @@ static void test_buffer(int index, int generate, int debug) { int expected_bitmap_height; }; struct item data[] = { - /* 0*/ { BARCODE_CODE11, "0000000000", "", 50, 1, 99, 198, 116 }, - /* 1*/ { BARCODE_C25STANDARD, "0000000000", "", 50, 1, 117, 234, 116 }, - /* 2*/ { BARCODE_C25INTER, "0000000000", "", 50, 1, 99, 198, 116 }, - /* 3*/ { BARCODE_C25IATA, "0000000000", "", 50, 1, 149, 298, 116 }, - /* 4*/ { BARCODE_C25LOGIC, "0000000000", "", 50, 1, 109, 218, 116 }, - /* 5*/ { BARCODE_C25IND, "0000000000", "", 50, 1, 159, 318, 116 }, - /* 6*/ { BARCODE_CODE39, "0000000000", "", 50, 1, 155, 310, 116 }, - /* 7*/ { BARCODE_EXCODE39, "0000000000", "", 50, 1, 155, 310, 116 }, + /* 0*/ { BARCODE_CODE11, "1234567890", "", 50, 1, 108, 216, 116 }, + /* 1*/ { BARCODE_C25STANDARD, "1234567890", "", 50, 1, 117, 234, 116 }, + /* 2*/ { BARCODE_C25INTER, "1234567890", "", 50, 1, 99, 198, 116 }, + /* 3*/ { BARCODE_C25IATA, "1234567890", "", 50, 1, 149, 298, 116 }, + /* 4*/ { BARCODE_C25LOGIC, "1234567890", "", 50, 1, 109, 218, 116 }, + /* 5*/ { BARCODE_C25IND, "1234567890", "", 50, 1, 159, 318, 116 }, + /* 6*/ { BARCODE_CODE39, "1234567890", "", 50, 1, 155, 310, 116 }, + /* 7*/ { BARCODE_EXCODE39, "1234567890", "", 50, 1, 155, 310, 116 }, /* 8*/ { BARCODE_EANX, "123456789012", "", 50, 1, 95, 226, 116 }, /* 9*/ { BARCODE_EANX_CHK, "1234567890128", "", 50, 1, 95, 226, 116 }, /* 10*/ { BARCODE_EANX, "123456789012+12", "", 50, 1, 122, 276, 116 }, @@ -147,41 +147,41 @@ static void test_buffer(int index, int generate, int debug) { /* 23*/ { BARCODE_EANX_CHK, "12", "", 50, 1, 20, 64, 116 }, /* 24*/ { BARCODE_GS1_128, "[01]12345678901234", "", 50, 1, 134, 268, 116 }, /* 25*/ { BARCODE_CODABAR, "A00000000B", "", 50, 1, 102, 204, 116 }, - /* 26*/ { BARCODE_CODE128, "0000000000", "", 50, 1, 90, 180, 116 }, + /* 26*/ { BARCODE_CODE128, "1234567890", "", 50, 1, 90, 180, 116 }, /* 27*/ { BARCODE_DPLEIT, "1234567890123", "", 50, 1, 135, 270, 116 }, /* 28*/ { BARCODE_DPIDENT, "12345678901", "", 50, 1, 117, 234, 116 }, - /* 29*/ { BARCODE_CODE16K, "0000000000", "", 20, 2, 70, 162, 44 }, - /* 30*/ { BARCODE_CODE49, "0000000000", "", 20, 2, 70, 162, 44 }, - /* 31*/ { BARCODE_CODE93, "0000000000", "", 50, 1, 127, 254, 116 }, + /* 29*/ { BARCODE_CODE16K, "1234567890", "", 20, 2, 70, 162, 44 }, + /* 30*/ { BARCODE_CODE49, "1234567890", "", 20, 2, 70, 162, 44 }, + /* 31*/ { BARCODE_CODE93, "1234567890", "", 50, 1, 127, 254, 116 }, /* 32*/ { BARCODE_FLAT, "1234567890", "", 50, 1, 90, 180, 100 }, /* 33*/ { BARCODE_DBAR_OMN, "1234567890123", "", 50, 1, 96, 192, 116 }, /* 34*/ { BARCODE_DBAR_LTD, "1234567890123", "", 50, 1, 79, 158, 116 }, /* 35*/ { BARCODE_DBAR_EXP, "[01]12345678901234", "", 34, 1, 134, 268, 84 }, - /* 36*/ { BARCODE_TELEPEN, "0000000000", "", 50, 1, 208, 416, 116 }, - /* 37*/ { BARCODE_UPCA, "12345678904", "", 50, 1, 95, 226, 116 }, - /* 38*/ { BARCODE_UPCA_CHK, "123456789043", "", 50, 1, 95, 226, 116 }, - /* 39*/ { BARCODE_UPCA, "12345678904+12", "", 50, 1, 124, 276, 116 }, - /* 40*/ { BARCODE_UPCA_CHK, "123456789043+12", "", 50, 1, 124, 276, 116 }, - /* 41*/ { BARCODE_UPCA, "12345678904+12345", "", 50, 1, 151, 330, 116 }, - /* 42*/ { BARCODE_UPCA_CHK, "123456789043+12345", "", 50, 1, 151, 330, 116 }, + /* 36*/ { BARCODE_TELEPEN, "1234567890", "", 50, 1, 208, 416, 116 }, + /* 37*/ { BARCODE_UPCA, "12345678901", "", 50, 1, 95, 226, 116 }, + /* 38*/ { BARCODE_UPCA_CHK, "123456789012", "", 50, 1, 95, 226, 116 }, + /* 39*/ { BARCODE_UPCA, "12345678901+12", "", 50, 1, 124, 276, 116 }, + /* 40*/ { BARCODE_UPCA_CHK, "123456789012+12", "", 50, 1, 124, 276, 116 }, + /* 41*/ { BARCODE_UPCA, "12345678901+12345", "", 50, 1, 151, 330, 116 }, + /* 42*/ { BARCODE_UPCA_CHK, "123456789012+12345", "", 50, 1, 151, 330, 116 }, /* 43*/ { BARCODE_UPCE, "1234567", "", 50, 1, 51, 134, 116 }, /* 44*/ { BARCODE_UPCE_CHK, "12345670", "", 50, 1, 51, 134, 116 }, /* 45*/ { BARCODE_UPCE, "1234567+12", "", 50, 1, 78, 184, 116 }, /* 46*/ { BARCODE_UPCE_CHK, "12345670+12", "", 50, 1, 78, 184, 116 }, /* 47*/ { BARCODE_UPCE, "1234567+12345", "", 50, 1, 105, 238, 116 }, /* 48*/ { BARCODE_UPCE_CHK, "12345670+12345", "", 50, 1, 105, 238, 116 }, - /* 49*/ { BARCODE_POSTNET, "00000000000", "", 12, 2, 185, 370, 24 }, - /* 50*/ { BARCODE_MSI_PLESSEY, "0000000000", "", 50, 1, 127, 254, 116 }, + /* 49*/ { BARCODE_POSTNET, "12345678901", "", 12, 2, 123, 246, 24 }, + /* 50*/ { BARCODE_MSI_PLESSEY, "1234567890", "", 50, 1, 127, 254, 116 }, /* 51*/ { BARCODE_FIM, "A", "", 50, 1, 17, 34, 100 }, - /* 52*/ { BARCODE_LOGMARS, "0000000000", "", 50, 1, 191, 382, 116 }, + /* 52*/ { BARCODE_LOGMARS, "1234567890", "", 50, 1, 191, 382, 116 }, /* 53*/ { BARCODE_PHARMA, "123456", "", 50, 1, 58, 116, 100 }, /* 54*/ { BARCODE_PZN, "123456", "", 50, 1, 142, 284, 116 }, /* 55*/ { BARCODE_PHARMA_TWO, "12345678", "", 10, 2, 29, 58, 20 }, - /* 56*/ { BARCODE_PDF417, "0000000000", "", 21, 7, 103, 206, 42 }, - /* 57*/ { BARCODE_PDF417COMP, "0000000000", "", 21, 7, 69, 138, 42 }, - /* 58*/ { BARCODE_MAXICODE, "0000000000", "", 165, 33, 30, 300, 300 }, + /* 56*/ { BARCODE_PDF417, "1234567890", "", 21, 7, 103, 206, 42 }, + /* 57*/ { BARCODE_PDF417COMP, "1234567890", "", 21, 7, 69, 138, 42 }, + /* 58*/ { BARCODE_MAXICODE, "1234567890", "", 165, 33, 30, 300, 300 }, /* 59*/ { BARCODE_QRCODE, "1234567890AB", "", 21, 21, 21, 42, 42 }, - /* 60*/ { BARCODE_CODE128B, "0000000000", "", 50, 1, 145, 290, 116 }, + /* 60*/ { BARCODE_CODE128B, "1234567890", "", 50, 1, 145, 290, 116 }, /* 61*/ { BARCODE_AUSPOST, "12345678901234567890123", "", 8, 3, 133, 266, 16 }, /* 62*/ { BARCODE_AUSREPLY, "12345678", "", 8, 3, 73, 146, 16 }, /* 63*/ { BARCODE_AUSROUTE, "12345678", "", 8, 3, 73, 146, 16 }, @@ -189,37 +189,37 @@ static void test_buffer(int index, int generate, int debug) { /* 65*/ { BARCODE_ISBNX, "123456789", "", 50, 1, 95, 226, 116 }, /* 66*/ { BARCODE_ISBNX, "123456789+12", "", 50, 1, 122, 276, 116 }, /* 67*/ { BARCODE_ISBNX, "123456789+12345", "", 50, 1, 149, 330, 116 }, - /* 68*/ { BARCODE_RM4SCC, "0000000000", "", 8, 3, 91, 182, 16 }, + /* 68*/ { BARCODE_RM4SCC, "1234567890", "", 8, 3, 91, 182, 16 }, /* 69*/ { BARCODE_DATAMATRIX, "ABC", "", 10, 10, 10, 20, 20 }, /* 70*/ { BARCODE_EAN14, "1234567890123", "", 50, 1, 134, 268, 116 }, - /* 71*/ { BARCODE_VIN, "00000000000000000", "", 50, 1, 246, 492, 116 }, - /* 72*/ { BARCODE_CODABLOCKF, "0000000000", "", 20, 2, 101, 242, 44 }, + /* 71*/ { BARCODE_VIN, "12345678701234567", "", 50, 1, 246, 492, 116 }, + /* 72*/ { BARCODE_CODABLOCKF, "1234567890", "", 20, 2, 101, 242, 44 }, /* 73*/ { BARCODE_NVE18, "12345678901234567", "", 50, 1, 156, 312, 116 }, - /* 74*/ { BARCODE_JAPANPOST, "0000000000", "", 8, 3, 133, 266, 16 }, + /* 74*/ { BARCODE_JAPANPOST, "1234567890", "", 8, 3, 133, 266, 16 }, /* 75*/ { BARCODE_KOREAPOST, "123456", "", 50, 1, 167, 334, 116 }, - /* 76*/ { BARCODE_DBAR_STK, "0000000000000", "", 13, 3, 50, 100, 26 }, - /* 77*/ { BARCODE_DBAR_OMNSTK, "0000000000000", "", 69, 5, 50, 100, 138 }, + /* 76*/ { BARCODE_DBAR_STK, "1234567890123", "", 13, 3, 50, 100, 26 }, + /* 77*/ { BARCODE_DBAR_OMNSTK, "1234567890123", "", 69, 5, 50, 100, 138 }, /* 78*/ { BARCODE_DBAR_EXPSTK, "[01]12345678901234", "", 71, 5, 102, 204, 142 }, - /* 79*/ { BARCODE_PLANET, "00000000000", "", 12, 2, 185, 370, 24 }, - /* 80*/ { BARCODE_MICROPDF417, "0000000000", "", 12, 6, 82, 164, 24 }, + /* 79*/ { BARCODE_PLANET, "12345678901", "", 12, 2, 123, 246, 24 }, + /* 80*/ { BARCODE_MICROPDF417, "1234567890", "", 12, 6, 82, 164, 24 }, /* 81*/ { BARCODE_USPS_IMAIL, "12345678901234567890", "", 8, 3, 129, 258, 16 }, - /* 82*/ { BARCODE_PLESSEY, "0000000000", "", 50, 1, 227, 454, 116 }, - /* 83*/ { BARCODE_TELEPEN_NUM, "0000000000", "", 50, 1, 128, 256, 116 }, - /* 84*/ { BARCODE_ITF14, "0000000000", "", 50, 1, 135, 330, 136 }, + /* 82*/ { BARCODE_PLESSEY, "1234567890", "", 50, 1, 227, 454, 116 }, + /* 83*/ { BARCODE_TELEPEN_NUM, "1234567890", "", 50, 1, 128, 256, 116 }, + /* 84*/ { BARCODE_ITF14, "1234567890", "", 50, 1, 135, 330, 136 }, /* 85*/ { BARCODE_KIX, "123456ABCDE", "", 8, 3, 87, 174, 16 }, /* 86*/ { BARCODE_AZTEC, "1234567890AB", "", 15, 15, 15, 30, 30 }, /* 87*/ { BARCODE_DAFT, "DAFTDAFTDAFTDAFT", "", 8, 3, 31, 62, 16 }, /* 88*/ { BARCODE_DPD, "0123456789012345678901234567", "", 50, 1, 189, 378, 116 }, /* 89*/ { BARCODE_MICROQR, "12345", "", 11, 11, 11, 22, 22 }, - /* 90*/ { BARCODE_HIBC_128, "0000000000", "", 50, 1, 134, 268, 116 }, - /* 91*/ { BARCODE_HIBC_39, "0000000000", "", 50, 1, 223, 446, 116 }, + /* 90*/ { BARCODE_HIBC_128, "1234567890", "", 50, 1, 123, 246, 116 }, + /* 91*/ { BARCODE_HIBC_39, "1234567890", "", 50, 1, 223, 446, 116 }, /* 92*/ { BARCODE_HIBC_DM, "ABC", "", 12, 12, 12, 24, 24 }, /* 93*/ { BARCODE_HIBC_QR, "1234567890AB", "", 21, 21, 21, 42, 42 }, - /* 94*/ { BARCODE_HIBC_PDF, "0000000000", "", 27, 9, 103, 206, 54 }, - /* 95*/ { BARCODE_HIBC_MICPDF, "0000000000", "", 34, 17, 38, 76, 68 }, - /* 96*/ { BARCODE_HIBC_BLOCKF, "0000000000", "", 30, 3, 101, 242, 64 }, + /* 94*/ { BARCODE_HIBC_PDF, "1234567890", "", 24, 8, 103, 206, 48 }, + /* 95*/ { BARCODE_HIBC_MICPDF, "1234567890", "", 28, 14, 38, 76, 56 }, + /* 96*/ { BARCODE_HIBC_BLOCKF, "1234567890", "", 30, 3, 101, 242, 64 }, /* 97*/ { BARCODE_HIBC_AZTEC, "1234567890AB", "", 19, 19, 19, 38, 38 }, - /* 98*/ { BARCODE_DOTCODE, "ABC", "", 11, 11, 16, 33, 23 }, + /* 98*/ { BARCODE_DOTCODE, "ABC", "", 11, 11, 16, 32, 22 }, /* 99*/ { BARCODE_HANXIN, "1234567890AB", "", 23, 23, 23, 46, 46 }, /*100*/ { BARCODE_MAILMARK, "01000000000000000AA00AA0A", "", 10, 3, 155, 310, 20 }, /*101*/ { BARCODE_AZRUNE, "255", "", 11, 11, 11, 22, 22 }, @@ -227,25 +227,28 @@ static void test_buffer(int index, int generate, int debug) { /*103*/ { BARCODE_EANX_CC, "123456789012", "[20]01", 50, 7, 99, 234, 116 }, /*104*/ { BARCODE_EANX_CC, "123456789012+12", "[20]01", 50, 7, 126, 284, 116 }, /*105*/ { BARCODE_EANX_CC, "123456789012+12345", "[20]01", 50, 7, 153, 338, 116 }, - /*106*/ { BARCODE_GS1_128_CC, "[01]12345678901234", "[20]01", 50, 5, 145, 290, 116 }, - /*107*/ { BARCODE_DBAR_OMN_CC, "1234567890123", "[20]01", 21, 5, 100, 200, 58 }, - /*108*/ { BARCODE_DBAR_LTD_CC, "1234567890123", "[20]01", 19, 6, 79, 158, 54 }, - /*109*/ { BARCODE_DBAR_EXP_CC, "[01]12345678901234", "[20]01", 41, 5, 134, 268, 98 }, - /*110*/ { BARCODE_UPCA_CC, "12345678901", "[20]01", 50, 7, 99, 234, 116 }, - /*111*/ { BARCODE_UPCA_CC, "12345678901+12", "[20]01", 50, 7, 128, 284, 116 }, - /*112*/ { BARCODE_UPCA_CC, "12345678901+12345", "[20]01", 50, 7, 155, 338, 116 }, - /*113*/ { BARCODE_UPCE_CC, "1234567", "[20]01", 50, 9, 55, 142, 116 }, - /*114*/ { BARCODE_UPCE_CC, "1234567+12", "[20]01", 50, 9, 82, 192, 116 }, - /*115*/ { BARCODE_UPCE_CC, "1234567+12345", "[20]01", 50, 9, 109, 246, 116 }, - /*116*/ { BARCODE_DBAR_STK_CC, "0000000000000", "[20]01", 24, 9, 56, 112, 48 }, - /*117*/ { BARCODE_DBAR_OMNSTK_CC, "0000000000000", "[20]01", 80, 11, 56, 112, 160 }, - /*118*/ { BARCODE_DBAR_EXPSTK_CC, "[01]12345678901234", "[20]01", 78, 9, 102, 204, 156 }, - /*119*/ { BARCODE_CHANNEL, "00", "", 50, 1, 19, 38, 116 }, - /*120*/ { BARCODE_CODEONE, "12345678901234567890", "", 22, 22, 22, 44, 44 }, - /*121*/ { BARCODE_GRIDMATRIX, "ABC", "", 18, 18, 18, 36, 36 }, - /*122*/ { BARCODE_UPNQR, "1234567890AB", "", 77, 77, 77, 154, 154 }, - /*123*/ { BARCODE_ULTRA, "0000000000", "", 13, 13, 18, 36, 26 }, - /*124*/ { BARCODE_RMQR, "12345", "", 11, 11, 27, 54, 22 }, + /*106*/ { BARCODE_EANX_CC, "1234567", "[20]01", 50, 8, 72, 172, 116 }, + /*107*/ { BARCODE_EANX_CC, "1234567+12", "[20]01", 50, 8, 99, 226, 116 }, + /*108*/ { BARCODE_EANX_CC, "1234567+12345", "[20]01", 50, 8, 126, 280, 116 }, + /*109*/ { BARCODE_GS1_128_CC, "[01]12345678901234", "[20]01", 50, 5, 145, 290, 116 }, + /*110*/ { BARCODE_DBAR_OMN_CC, "1234567890123", "[20]01", 21, 5, 100, 200, 58 }, + /*111*/ { BARCODE_DBAR_LTD_CC, "1234567890123", "[20]01", 19, 6, 79, 158, 54 }, + /*112*/ { BARCODE_DBAR_EXP_CC, "[01]12345678901234", "[20]01", 41, 5, 134, 268, 98 }, + /*113*/ { BARCODE_UPCA_CC, "12345678901", "[20]01", 50, 7, 99, 234, 116 }, + /*114*/ { BARCODE_UPCA_CC, "12345678901+12", "[20]01", 50, 7, 128, 284, 116 }, + /*115*/ { BARCODE_UPCA_CC, "12345678901+12345", "[20]01", 50, 7, 155, 338, 116 }, + /*116*/ { BARCODE_UPCE_CC, "1234567", "[20]01", 50, 9, 55, 142, 116 }, + /*117*/ { BARCODE_UPCE_CC, "1234567+12", "[20]01", 50, 9, 82, 192, 116 }, + /*118*/ { BARCODE_UPCE_CC, "1234567+12345", "[20]01", 50, 9, 109, 246, 116 }, + /*119*/ { BARCODE_DBAR_STK_CC, "1234567890123", "[20]01", 24, 9, 56, 112, 48 }, + /*120*/ { BARCODE_DBAR_OMNSTK_CC, "1234567890123", "[20]01", 80, 11, 56, 112, 160 }, + /*121*/ { BARCODE_DBAR_EXPSTK_CC, "[01]12345678901234", "[20]01", 78, 9, 102, 204, 156 }, + /*122*/ { BARCODE_CHANNEL, "01", "", 50, 1, 19, 38, 116 }, + /*123*/ { BARCODE_CODEONE, "12345678901234567890", "", 22, 22, 22, 44, 44 }, + /*124*/ { BARCODE_GRIDMATRIX, "ABC", "", 18, 18, 18, 36, 36 }, + /*125*/ { BARCODE_UPNQR, "1234567890AB", "", 77, 77, 77, 154, 154 }, + /*126*/ { BARCODE_ULTRA, "1234567890", "", 13, 13, 18, 36, 26 }, + /*127*/ { BARCODE_RMQR, "12345", "", 11, 11, 27, 54, 22 }, }; int data_size = ARRAY_SIZE(data); @@ -254,6 +257,7 @@ static void test_buffer(int index, int generate, int debug) { for (int i = 0; i < data_size; i++) { if (index != -1 && i != index) continue; + if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d\n", i); struct zint_symbol *symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); @@ -271,11 +275,13 @@ static void test_buffer(int index, int generate, int debug) { int length = strlen(text); ret = ZBarcode_Encode(symbol, text, length); - assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt); + assert_zero(ret, "i:%d ZBarcode_Encode(%s) ret %d != 0 (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); ret = ZBarcode_Buffer(symbol, 0); - assert_zero(ret, "i:%d ZBarcode_Buffer(%d) ret %d != 0\n", i, data[i].symbology, ret); - assert_nonnull(symbol->bitmap, "i:%d ZBarcode_Buffer(%d) bitmap NULL\n", i, data[i].symbology); + assert_zero(ret, "i:%d ZBarcode_Buffer(%s) ret %d != 0 (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); + assert_nonnull(symbol->bitmap, "i:%d ZBarcode_Buffer(%s) bitmap NULL\n", i, testUtilBarcodeName(data[i].symbology)); + + if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) testUtilBitmapPrint(symbol); if (generate) { printf(" /*%3d*/ { %s, \"%s\", \"%s\", %d, %d, %d, %d, %d },\n", @@ -360,6 +366,7 @@ static void test_upcean_hrt(int index, int debug) { for (int i = 0; i < data_size; i++) { if (index != -1 && i != index) continue; + if ((debug & ZINT_DEBUG_TEST_PRINT) && !(debug & ZINT_DEBUG_TEST_LESS_NOISY)) printf("i:%d\n", i); struct zint_symbol *symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); @@ -386,8 +393,14 @@ static void test_upcean_hrt(int index, int debug) { assert_equal(symbol->bitmap_height, data[i].expected_bitmap_height, "i:%d (%s) symbol->bitmap_height %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->bitmap_height, data[i].expected_bitmap_height); - if (data[i].expected_text_row != -1) { - assert_nonzero(symbol->bitmap_height > data[i].expected_text_row, "i:%d symbol->bitmap_height %d <= data[i].expected_text_row %d\n", i, symbol->bitmap_height, data[i].expected_text_row); + assert_nonzero(symbol->bitmap_height > data[i].expected_text_row, "i:%d symbol->bitmap_height %d <= data[i].expected_text_row %d\n", i, symbol->bitmap_height, data[i].expected_text_row); + if (data[i].expected_text_row == -1) { /* EAN-2/5 just truncates bitmap if no text */ + assert_zero(data[i].show_hrt, "i:%d Expected text row -1 but show_hrt set\n", i); + if (i && data[i - 1].symbology == symbol->symbology && data[i - 1].show_hrt && data[i - 1].expected_text_row != -1) { + assert_nonzero(data[i].expected_bitmap_height < data[i - 1].expected_text_row, "i:%d (%s) expected_bitmap_height %d >= previous expected_text_row %d\n", + i, testUtilBarcodeName(data[i].symbology), data[i].expected_bitmap_height, data[i - 1].expected_text_row); + } + } else { int text_bits_set = 0; int row = data[i].expected_text_row; for (int column = data[i].expected_text_col; column < data[i].expected_text_col + data[i].expected_text_len; column++) { @@ -456,7 +469,7 @@ static void test_row_separator(int index, int debug) { /* 4*/ { BARCODE_CODABLOCKF, -1, -1, 3, "A", 0, 20, 2, 101, 242, 44, 19, 42, 6 }, /* 5*/ { BARCODE_CODABLOCKF, -1, -1, 4, "A", 0, 20, 2, 101, 242, 44, 18, 42, 8 }, /* 6*/ { BARCODE_CODABLOCKF, -1, -1, 5, "A", 0, 20, 2, 101, 242, 44, 21, 42, 2 }, // > 4 ignored, same as default - /* 7*/ { BARCODE_CODABLOCKF, -1, 1, -1, "A", 0, 5, 1, 46, 132, 30, 0, 20 + 2, 2 }, // CODE128 top separator, add 2 to skip over end of start char; note now includes HRT + /* 7*/ { BARCODE_CODABLOCKF, -1, 1, -1, "A", 0, 5, 1, 46, 132, 14, 0, 20 + 2, 2 }, // CODE128 top separator, add 2 to skip over end of start char; note no longer includes HRT /* 8*/ { BARCODE_CODABLOCKF, 0, -1, -1, "A", 0, 20, 2, 101, 242, 44, 21, 42, 2 }, // Border width zero, same as default }; int data_size = ARRAY_SIZE(data); @@ -474,14 +487,16 @@ static void test_row_separator(int index, int debug) { } ret = ZBarcode_Encode_and_Buffer(symbol, data[i].data, length, 0); - assert_equal(ret, data[i].ret, "i:%d ret %d != %d\n", i, ret, data[i].ret); - assert_nonnull(symbol->bitmap, "i:%d (%d) symbol->bitmap NULL\n", i, data[i].symbology); + assert_equal(ret, data[i].ret, "i:%d ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt); + assert_nonnull(symbol->bitmap, "i:%d (%s) symbol->bitmap NULL\n", i, testUtilBarcodeName(data[i].symbology)); - assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %d != %d\n", i, data[i].symbology, symbol->height, data[i].expected_height); - assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); - assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); - assert_equal(symbol->bitmap_width, data[i].expected_bitmap_width, "i:%d (%d) symbol->bitmap_width %d != %d\n", i, data[i].symbology, symbol->bitmap_width, data[i].expected_bitmap_width); - assert_equal(symbol->bitmap_height, data[i].expected_bitmap_height, "i:%d (%d) symbol->bitmap_height %d != %d\n", i, data[i].symbology, symbol->bitmap_height, data[i].expected_bitmap_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->height, data[i].expected_height); + assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%s) symbol->rows %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows); + assert_equal(symbol->width, data[i].expected_width, "i:%d (%s) symbol->width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width); + assert_equal(symbol->bitmap_width, data[i].expected_bitmap_width, "i:%d (%s) symbol->bitmap_width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), + symbol->bitmap_width, data[i].expected_bitmap_width); + assert_equal(symbol->bitmap_height, data[i].expected_bitmap_height, "i:%d (%s) symbol->bitmap_height %d != %d\n", i, testUtilBarcodeName(data[i].symbology), + symbol->bitmap_height, data[i].expected_bitmap_height); int j, separator_bits_set; @@ -489,18 +504,18 @@ static void test_row_separator(int index, int debug) { for (j = data[i].expected_separator_row; j < data[i].expected_separator_row + data[i].expected_separator_height; j++) { separator_bits_set = is_row_column_black(symbol, j, data[i].expected_separator_col); - assert_nonzero(separator_bits_set, "i:%d (%d) separator_bits_set (%d, %d) zero\n", i, data[i].symbology, j, data[i].expected_separator_col); + assert_nonzero(separator_bits_set, "i:%d (%s) separator_bits_set (%d, %d) zero\n", i, testUtilBarcodeName(data[i].symbology), j, data[i].expected_separator_col); } if (symbol->rows > 1) { j = data[i].expected_separator_row - 1; separator_bits_set = is_row_column_black(symbol, j, data[i].expected_separator_col + 2); // Need to add 2 to skip to 1st blank of start row character - assert_zero(separator_bits_set, "i:%d (%d) separator_bits_set (%d, %d) before non-zero\n", i, data[i].symbology, j, data[i].expected_separator_col); + assert_zero(separator_bits_set, "i:%d (%s) separator_bits_set (%d, %d) before non-zero\n", i, testUtilBarcodeName(data[i].symbology), j, data[i].expected_separator_col); } j = data[i].expected_separator_row + data[i].expected_separator_height; separator_bits_set = is_row_column_black(symbol, j, data[i].expected_separator_col + 2); // Need to add 2 to skip to 1st blank of start row character - assert_zero(separator_bits_set, "i:%d (%d) separator_bits_set (%d, %d) after non-zero\n", i, data[i].symbology, j, data[i].expected_separator_col); + assert_zero(separator_bits_set, "i:%d (%s) separator_bits_set (%d, %d) after non-zero\n", i, testUtilBarcodeName(data[i].symbology), j, data[i].expected_separator_col); ZBarcode_Delete(symbol); } @@ -645,14 +660,14 @@ static void test_output_options(int index, int debug) { /* 27*/ { BARCODE_QRCODE, 5, 6, BARCODE_BIND, 0, "A123", 0, 21, 21, 21, 62, 66, 1, 0, 0 }, /* 28*/ { BARCODE_QRCODE, 5, 6, BARCODE_BIND, 0, "A123", 0, 21, 21, 21, 62, 66, 0, 12, 0 }, /* 29*/ { BARCODE_QRCODE, 5, 6, BARCODE_BOX, 0, "A123", 0, 21, 21, 21, 86, 66, 1, 12, 0 }, - /* 30*/ { BARCODE_QRCODE, -1, -1, BARCODE_DOTTY_MODE, 0, "A123", 0, 21, 21, 21, 43, 43, 1, 1, 1 }, // TODO: investigate +1 size - /* 31*/ { BARCODE_QRCODE, -1, -1, BARCODE_DOTTY_MODE, 0, "A123", 0, 21, 21, 21, 43, 43, 0, 0, 0 }, // TODO: investigate +1 size - /* 32*/ { BARCODE_QRCODE, -1, 4, BARCODE_DOTTY_MODE, 0, "A123", 0, 21, 21, 21, 43, 43, 1, 1, 1 }, - /* 33*/ { BARCODE_QRCODE, -1, 4, BARCODE_BIND | BARCODE_DOTTY_MODE, 0, "A123", 0, 21, 21, 21, 43, 59, -1, -1, -1 }, // TODO: fix (bind/box in dotty mode) - /* 34*/ { BARCODE_QRCODE, 1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, "A123", 0, 21, 21, 21, 63, 59, -1, -1, -1 }, // TODO: fix (bind/box in dotty mode) + /* 30*/ { BARCODE_QRCODE, -1, -1, BARCODE_DOTTY_MODE, 0, "A123", 0, 21, 21, 21, 42, 42, 1, 0, 0 }, + /* 31*/ { BARCODE_QRCODE, -1, -1, BARCODE_DOTTY_MODE, 0, "A123", 0, 21, 21, 21, 42, 42, 0, 1, 1 }, + /* 32*/ { BARCODE_QRCODE, -1, 4, BARCODE_DOTTY_MODE, 0, "A123", 0, 21, 21, 21, 42, 42, 1, 0, 0 }, + /* 33*/ { BARCODE_QRCODE, -1, 4, BARCODE_BIND | BARCODE_DOTTY_MODE, 0, "A123", 0, 21, 21, 21, 42, 58, -1, -1, -1 }, // TODO: fix (bind/box in dotty mode) + /* 34*/ { BARCODE_QRCODE, 1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, "A123", 0, 21, 21, 21, 62, 58, -1, -1, -1 }, // TODO: fix (bind/box in dotty mode) /* 35*/ { BARCODE_QRCODE, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, "A123", 0, 21, 21, 21, 42, 42, 0, 2, 2 }, - /* 36*/ { BARCODE_QRCODE, -1, -1, BARCODE_DOTTY_MODE | OUT_BUFFER_INTERMEDIATE, 0, "A123", 0, 21, 21, 21, 43, 43, 1, 1, 1 }, // TODO: investigate +1 size - /* 37*/ { BARCODE_QRCODE, -1, -1, BARCODE_DOTTY_MODE | OUT_BUFFER_INTERMEDIATE, 180, "A123", 0, 21, 21, 21, 43, 43, 0, 39, 2 }, // TODO: investigate +1 size + /* 36*/ { BARCODE_QRCODE, -1, -1, BARCODE_DOTTY_MODE | OUT_BUFFER_INTERMEDIATE, 0, "A123", 0, 21, 21, 21, 42, 42, 1, 0, 0 }, + /* 37*/ { BARCODE_QRCODE, -1, -1, BARCODE_DOTTY_MODE | OUT_BUFFER_INTERMEDIATE, 180, "A123", 0, 21, 21, 21, 42, 42, 0, 40, 1 }, /* 38*/ { BARCODE_MAXICODE, -1, -1, -1, 0, "A123", 0, 165, 33, 30, 300, 300, 0, 0, 0 }, /* 39*/ { BARCODE_MAXICODE, -1, -1, -1, 270, "A123", 0, 165, 33, 30, 300, 300, 0, 0, 0 }, /* 40*/ { BARCODE_MAXICODE, -1, 5, -1, 0, "A123", 0, 165, 33, 30, 300, 300, 0, 0, 0 }, @@ -695,28 +710,32 @@ static void test_output_options(int index, int debug) { } ret = ZBarcode_Encode(symbol, data[i].data, length); - assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt); + assert_zero(ret, "i:%d ZBarcode_Encode(%s) ret %d != 0 (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); ret = ZBarcode_Buffer(symbol, data[i].rotate_angle); - assert_equal(ret, data[i].ret, "i:%d ZBarcode_Buffer(%d) ret %d != %d\n", i, data[i].symbology, ret, data[i].ret); + assert_equal(ret, data[i].ret, "i:%d ZBarcode_Buffer(%s) ret %d != %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, data[i].ret, symbol->errtxt); if (ret < 5) { - assert_nonnull(symbol->bitmap, "i:%d (%d) symbol->bitmap NULL\n", i, data[i].symbology); + assert_nonnull(symbol->bitmap, "i:%d (%s) symbol->bitmap NULL\n", i, testUtilBarcodeName(data[i].symbology)); if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) testUtilBitmapPrint(symbol); - assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %d != %d\n", i, data[i].symbology, symbol->height, data[i].expected_height); - assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); - assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); - assert_equal(symbol->bitmap_width, data[i].expected_bitmap_width, "i:%d (%d) symbol->bitmap_width %d != %d\n", i, data[i].symbology, symbol->bitmap_width, data[i].expected_bitmap_width); - assert_equal(symbol->bitmap_height, data[i].expected_bitmap_height, "i:%d (%d) symbol->bitmap_height %d != %d\n", i, data[i].symbology, symbol->bitmap_height, data[i].expected_bitmap_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->height, data[i].expected_height); + assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%s) symbol->rows %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows); + assert_equal(symbol->width, data[i].expected_width, "i:%d (%s) symbol->width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width); + assert_equal(symbol->bitmap_width, data[i].expected_bitmap_width, "i:%d (%s) symbol->bitmap_width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), + symbol->bitmap_width, data[i].expected_bitmap_width); + assert_equal(symbol->bitmap_height, data[i].expected_bitmap_height, "i:%d (%s) symbol->bitmap_height %d != %d\n", i, testUtilBarcodeName(data[i].symbology), + symbol->bitmap_height, data[i].expected_bitmap_height); if (data[i].expected_set != -1) { + assert_nonzero(data[i].expected_set_row < data[i].expected_bitmap_height, "i:%d (%s) expected_set_row %d >= expected_bitmap_height %d\n", + i, testUtilBarcodeName(data[i].symbology), data[i].expected_set_row, data[i].expected_bitmap_height); ret = is_row_column_black(symbol, data[i].expected_set_row, data[i].expected_set_col); if (data[i].expected_set) { - assert_nonzero(ret, "i:%d (%d) is_row_column_black(%d, %d) zero\n", i, data[i].symbology, data[i].expected_set_row, data[i].expected_set_col); + assert_nonzero(ret, "i:%d (%s) is_row_column_black(%d, %d) zero\n", i, testUtilBarcodeName(data[i].symbology), data[i].expected_set_row, data[i].expected_set_col); } else { - assert_zero(ret, "i:%d (%d) is_row_column_black(%d, %d) non-zero\n", i, data[i].symbology, data[i].expected_set_row, data[i].expected_set_col); + assert_zero(ret, "i:%d (%s) is_row_column_black(%d, %d) non-zero\n", i, testUtilBarcodeName(data[i].symbology), data[i].expected_set_row, data[i].expected_set_col); } } } @@ -764,13 +783,13 @@ static void test_draw_string_wrap(int index, int debug) { int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, -1 /*option_1*/, -1, -1, data[i].output_options, data[i].data, -1, debug); ret = ZBarcode_Encode(symbol, data[i].data, length); - assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt); + assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 (%s)\n", i, data[i].symbology, ret, symbol->errtxt); // Cheat by overwriting text strcpy(symbol->text, data[i].text); ret = ZBarcode_Buffer(symbol, 0); - assert_zero(ret, "i:%d ZBarcode_Buffer(%d) ret %d != 0\n", i, data[i].symbology, ret); + assert_zero(ret, "i:%d ZBarcode_Buffer(%d) ret %d != 0 (%s)\n", i, data[i].symbology, ret, symbol->errtxt); assert_nonnull(symbol->bitmap, "i:%d (%d) symbol->bitmap NULL\n", i, data[i].symbology); assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %d != %d\n", i, data[i].symbology, symbol->height, data[i].expected_height); @@ -877,6 +896,7 @@ static void test_scale(int index, int debug) { int output_options; float scale; unsigned char *data; + char *composite; int expected_height; int expected_rows; @@ -890,31 +910,35 @@ static void test_scale(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_PDF417, -1, -1, -1, 0, "1", 18, 6, 103, 206, 36, 0, 36, 170, 14 }, // With no scaling - /* 1*/ { BARCODE_PDF417, -1, -1, -1, 0.6, "1", 18, 6, 103, 206 * 0.6, 36 * 0.6, 0, 36 * 0.6, 170 * 0.6 + 1, 14 * 0.6 }, // +1 set_col due to some scaling inversion difference - /* 2*/ { BARCODE_PDF417, -1, -1, -1, 1.2, "1", 18, 6, 103, 206 * 1.2, 36 * 1.2, 0, 36 * 1.2, 170 * 1.2 + 1, 14 * 1.2 }, // +1 set_col due to some scaling inversion difference - /* 3*/ { BARCODE_PDF417, -1, -1, -1, 0.5, "1", 18, 6, 103, 206 * 0.5, 36 * 0.5, 0, 36 * 0.5, 170 * 0.5, 14 * 0.5 }, - /* 4*/ { BARCODE_PDF417, -1, -1, -1, 1.0, "1", 18, 6, 103, 206 * 1.0, 36 * 1.0, 0, 36 * 1.0, 170 * 1.0, 14 * 1.0 }, - /* 5*/ { BARCODE_PDF417, -1, -1, -1, 1.5, "1", 18, 6, 103, 206 * 1.5, 36 * 1.5, 0, 36 * 1.5, 170 * 1.5, 14 * 1.5 }, - /* 6*/ { BARCODE_PDF417, -1, -1, -1, 2.0, "1", 18, 6, 103, 206 * 2.0, 36 * 2.0, 0, 36 * 2.0, 170 * 2.0, 14 * 2.0 }, - /* 7*/ { BARCODE_PDF417, -1, -1, -1, 2.5, "1", 18, 6, 103, 206 * 2.5, 36 * 2.5, 0, 36 * 2.5, 170 * 2.5, 14 * 2.5 }, - /* 8*/ { BARCODE_PDF417, -1, -1, -1, 3.0, "1", 18, 6, 103, 206 * 3.0, 36 * 3.0, 0, 36 * 3.0, 170 * 3.0, 14 * 3.0 }, - /* 9*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0, "1", 18, 6, 103, 218, 48, 0, 48, 176, 14 }, // With no scaling - /* 10*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0.6, "1", 18, 6, 103, 218 * 0.6, 48 * 0.6, 0, 48 * 0.6, 176 * 0.6 + 1, 14 * 0.6 }, // +1 set_col due to some scaling inversion difference - /* 11*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 1.6, "1", 18, 6, 103, 218 * 1.6, 48 * 1.6, 0, 48 * 1.6, 176 * 1.6 + 1, 14 * 1.6 }, // +1 set_col due to some scaling inversion difference - /* 12*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 1.5, "1", 18, 6, 103, 218 * 1.5, 48 * 1.5, 0, 48 * 1.5, 176 * 1.5, 14 * 1.5 }, - /* 13*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 2.5, "1", 18, 6, 103, 218 * 2.5, 48 * 2.5, 0, 48 * 2.5, 176 * 2.5, 14 * 2.5 }, - /* 14*/ { BARCODE_PDF417, -1, 3, OUT_BUFFER_INTERMEDIATE, 1.3, "1", 18, 6, 103, 206 * 1.3, 36 * 1.3, 0, 36 * 1.3, 170 * 1.3 + 1, 14 * 1.3 }, // +1 set_col due to some scaling inversion difference - /* 15*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 0, "123456789012", 50, 1, 79, 158, 116, 104, 114, 20, 2 }, // With no scaling - /* 16*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 1.5, "123456789012", 50, 1, 79, 158 * 1.5, 116 * 1.5, 104 * 1.5, 114 * 1.5, 20 * 1.5, 1 * 1.5 }, - /* 17*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 2.0, "123456789012", 50, 1, 79, 158 * 2.0, 116 * 2.0, 104 * 2.0, 114 * 2.0, 20 * 2.0, 1 * 2.0 }, - /* 18*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 3.5, "123456789012", 50, 1, 79, 158 * 3.5, 116 * 3.5, 104 * 3.5, 114 * 3.5, 20 * 3.5, 1 * 3.5 }, - /* 19*/ { BARCODE_UPCA, -1, -1, -1, 0, "12345678904", 50, 1, 95, 226, 116, 104, 114, 5, 2 }, // With no scaling - /* 20*/ { BARCODE_UPCA, -1, -1, -1, 2.5, "12345678904", 50, 1, 95, 226 * 2.5, 116 * 2.5, 104 * 2.5, 114 * 2.5, 5 * 2.5, 2 * 2.5 }, - /* 21*/ { BARCODE_UPCA, -1, -1, -1, 4.5, "12345678904", 50, 1, 95, 226 * 4.5, 116 * 4.5, 104 * 4.5, 114 * 4.5, 5 * 4.5, 2 * 4.5 }, + /* 0*/ { BARCODE_PDF417, -1, -1, -1, 0, "1", "", 18, 6, 103, 206, 36, 0, 36, 170, 14 }, // With no scaling + /* 1*/ { BARCODE_PDF417, -1, -1, -1, 0.6, "1", "", 18, 6, 103, 206 * 0.6, 36 * 0.6, 0 /*set_row*/, 36 * 0.6, 170 * 0.6 + 1, 14 * 0.6 }, // +1 set_col due to some scaling inversion difference + /* 2*/ { BARCODE_PDF417, -1, -1, -1, 1.2, "1", "", 18, 6, 103, 206 * 1.2, 36 * 1.2, 0 /*set_row*/, 36 * 1.2, 170 * 1.2 + 1, 14 * 1.2 }, // +1 set_col due to some scaling inversion difference + /* 3*/ { BARCODE_PDF417, -1, -1, -1, 0.5, "1", "", 18, 6, 103, 206 * 0.5, 36 * 0.5, 0 /*set_row*/, 36 * 0.5, 170 * 0.5, 14 * 0.5 }, + /* 4*/ { BARCODE_PDF417, -1, -1, -1, 1.0, "1", "", 18, 6, 103, 206 * 1.0, 36 * 1.0, 0 /*set_row*/, 36 * 1.0, 170 * 1.0, 14 * 1.0 }, + /* 5*/ { BARCODE_PDF417, -1, -1, -1, 1.5, "1", "", 18, 6, 103, 206 * 1.5, 36 * 1.5, 0 /*set_row*/, 36 * 1.5, 170 * 1.5, 14 * 1.5 }, + /* 6*/ { BARCODE_PDF417, -1, -1, -1, 2.0, "1", "", 18, 6, 103, 206 * 2.0, 36 * 2.0, 0 /*set_row*/, 36 * 2.0, 170 * 2.0, 14 * 2.0 }, + /* 7*/ { BARCODE_PDF417, -1, -1, -1, 2.5, "1", "", 18, 6, 103, 206 * 2.5, 36 * 2.5, 0 /*set_row*/, 36 * 2.5, 170 * 2.5, 14 * 2.5 }, + /* 8*/ { BARCODE_PDF417, -1, -1, -1, 3.0, "1", "", 18, 6, 103, 206 * 3.0, 36 * 3.0, 0 /*set_row*/, 36 * 3.0, 170 * 3.0, 14 * 3.0 }, + /* 9*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0, "1", "", 18, 6, 103, 218, 48, 0 /*set_row*/, 48, 176, 14 }, // With no scaling + /* 10*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 0.6, "1", "", 18, 6, 103, 218 * 0.6, 48 * 0.6, 0 /*set_row*/, 48 * 0.6, 176 * 0.6 + 1, 14 * 0.6 }, // +1 set_col due to some scaling inversion difference + /* 11*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 1.6, "1", "", 18, 6, 103, 218 * 1.6, 48 * 1.6, 0 /*set_row*/, 48 * 1.6, 176 * 1.6 + 1, 14 * 1.6 }, // +1 set_col due to some scaling inversion difference + /* 12*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 1.5, "1", "", 18, 6, 103, 218 * 1.5, 48 * 1.5, 0 /*set_row*/, 48 * 1.5, 176 * 1.5, 14 * 1.5 }, + /* 13*/ { BARCODE_PDF417, -1, 3, BARCODE_BOX, 2.5, "1", "", 18, 6, 103, 218 * 2.5, 48 * 2.5, 0 /*set_row*/, 48 * 2.5, 176 * 2.5, 14 * 2.5 }, + /* 14*/ { BARCODE_PDF417, -1, 3, OUT_BUFFER_INTERMEDIATE, 1.3, "1", "", 18, 6, 103, 206 * 1.3, 36 * 1.3, 0 /*set_row*/, 36 * 1.3, 170 * 1.3 + 1, 14 * 1.3 }, // +1 set_col due to some scaling inversion difference + /* 15*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 0, "123456789012", "", 50, 1, 79, 158, 116, 104 /*set_row*/, 114, 20, 2 }, // With no scaling + /* 16*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 1.5, "123456789012", "", 50, 1, 79, 158 * 1.5, 116 * 1.5, 104 * 1.5 /*set_row*/, 114 * 1.5, 20 * 1.5, 1 * 1.5 }, + /* 17*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 2.0, "123456789012", "", 50, 1, 79, 158 * 2.0, 116 * 2.0, 104 * 2.0 /*set_row*/, 114 * 2.0, 20 * 2.0, 1 * 2.0 }, + /* 18*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, 3.5, "123456789012", "", 50, 1, 79, 158 * 3.5, 116 * 3.5, 104 * 3.5 /*set_row*/, 114 * 3.5, 20 * 3.5, 1 * 3.5 }, + /* 19*/ { BARCODE_UPCA, -1, -1, -1, 0, "12345678904", "", 50, 1, 95, 226, 116, 104 /*set_row*/, 114, 5, 2 }, // With no scaling + /* 20*/ { BARCODE_UPCA, -1, -1, -1, 2.5, "12345678904", "", 50, 1, 95, 226 * 2.5, 116 * 2.5, 104 * 2.5 /*set_row*/, 114 * 2.5, 5 * 2.5, 2 * 2.5 }, + /* 21*/ { BARCODE_UPCA, -1, -1, -1, 4.5, "12345678904", "", 50, 1, 95, 226 * 4.5, 116 * 4.5, 104 * 4.5 /*set_row*/, 114 * 4.5, 5 * 4.5, 2 * 4.5 }, + /* 22*/ { BARCODE_UPCE_CC, -1, -1, -1, 0, "1234567", "[17]010615[10]A123456\"", 50, 10, 55, 142, 116, 104 /*set_row*/, 115, 11, 2 }, // With no scaling + /* 23*/ { BARCODE_UPCE_CC, -1, -1, -1, 2.0, "1234567", "[17]010615[10]A123456\"", 50, 10, 55, 142 * 2, 116 * 2, 104 * 2 + 1 /*set_row*/, 115 * 2, 11 * 2, 2 * 2 }, // +1 set_row }; int data_size = ARRAY_SIZE(data); + char *text; + for (int i = 0; i < data_size; i++) { if (index != -1 && i != index) continue; @@ -922,15 +946,22 @@ static void test_scale(int index, int debug) { struct zint_symbol *symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); - int length = testUtilSetSymbol(symbol, data[i].symbology, UNICODE_MODE, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, data[i].output_options, data[i].data, -1, debug); + testUtilSetSymbol(symbol, data[i].symbology, UNICODE_MODE, -1 /*eci*/, -1 /*option_1*/, data[i].option_2, -1, data[i].output_options, data[i].data, -1, debug); if (data[i].border_width != -1) { symbol->border_width = data[i].border_width; } if (data[i].scale) { symbol->scale = data[i].scale; } + if (strlen(data[i].composite)) { + text = data[i].composite; + strcpy(symbol->primary, data[i].data); + } else { + text = data[i].data; + } + int length = strlen(text); - ret = ZBarcode_Encode(symbol, data[i].data, length); + ret = ZBarcode_Encode(symbol, text, length); assert_zero(ret, "i:%d ZBarcode_Encode(%d) ret %d != 0 %s\n", i, data[i].symbology, ret, symbol->errtxt); ret = ZBarcode_Buffer(symbol, 0); @@ -948,7 +979,9 @@ static void test_scale(int index, int debug) { ret = ZBarcode_Print(symbol, 0); assert_zero(ret, "i:%d ZBarcode_Print(%d) ret %d != 0\n", i, data[i].symbology, ret); - assert_nonzero(data[i].expected_set_rows > data[i].expected_set_row, "i:%d (%d) expected_set_rows %d < expected_set_rows %d\n", + assert_nonzero(symbol->bitmap_height >= data[i].expected_set_rows, "i:%d (%d) symbol->bitmap_height %d < expected_set_rows %d\n", + i, data[i].symbology, symbol->bitmap_height, data[i].expected_set_rows); + assert_nonzero(data[i].expected_set_rows > data[i].expected_set_row, "i:%d (%d) expected_set_rows %d < expected_set_row %d\n", i, data[i].symbology, data[i].expected_set_rows, data[i].expected_set_row); for (int row = data[i].expected_set_row; row < data[i].expected_set_rows; row++) { int bits_set = 0; diff --git a/backend/tests/test_rss.c b/backend/tests/test_rss.c index 1ef07a75..899bb1d4 100644 --- a/backend/tests/test_rss.c +++ b/backend/tests/test_rss.c @@ -165,12 +165,12 @@ static void test_binary_div_modulo_divisor(int index, int generate, int debug) { assert_zero(ret, "i:%d ZBarcode_Buffer_Vector ret %d != 0\n", i, ret); if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, -1, -1, debug)) { - ret = testUtilBwipp(symbol, -1, -1, -1, text, length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + ret = testUtilBwipp(i, symbol, -1, -1, -1, text, length, symbol->primary, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilBwippCmpRow(symbol, symbol->rows - 1, bwipp_msg, bwipp_buf, data[i].expected); assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } @@ -640,7 +640,7 @@ static void test_examples(int index, int generate, int debug) { for (int i = 0; i < data_size; i++) { if (index != -1 && i != index) continue; - if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d\n", i); + if ((debug & ZINT_DEBUG_TEST_PRINT) && !(debug & ZINT_DEBUG_TEST_LESS_NOISY)) printf("i:%d\n", i); struct zint_symbol *symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); @@ -664,12 +664,12 @@ static void test_examples(int index, int generate, int debug) { assert_zero(ret, "i:%d %s testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, testUtilBarcodeName(data[i].symbology), ret, width, row, data[i].data); if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, data[i].option_2, -1, debug)) { - ret = testUtilBwipp(symbol, -1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + ret = testUtilBwipp(i, symbol, -1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } diff --git a/backend/tests/test_svg.c b/backend/tests/test_svg.c index 049ac3da..78eb54fe 100644 --- a/backend/tests/test_svg.c +++ b/backend/tests/test_svg.c @@ -41,24 +41,48 @@ static void test_print(int index, int generate, int debug) { int ret; struct item { int symbology; + int input_mode; + int output_options; + int show_hrt; int option_1; int option_2; unsigned char *data; + char *composite; char *expected_file; }; struct item data[] = { - /* 0*/ { BARCODE_CODE128, -1, -1, "<>\"&'", "../data/svg/code128_amperands.svg" }, - /* 1*/ { BARCODE_CODABLOCKF, 3, -1, "AAAAAAAAA", "../data/svg/codablockf_3rows.svg"}, - /* 2*/ { BARCODE_EANX, -1, -1, "9771384524017+12", "../data/svg/ean13_2addon_ggs_5.2.2.5.1-2.svg" }, - /* 3*/ { BARCODE_EANX, -1, -1, "9780877799306+54321", "../data/svg/ean13_5addon_ggs_5.2.2.5.2-2.svg" }, - /* 4*/ { BARCODE_UPCA, -1, -1, "012345678905+24", "../data/svg/upca_2addon_ggs_5.2.6.6-5.svg" }, - /* 5*/ { BARCODE_UPCA, -1, -1, "614141234417+12345", "../data/svg/upca_5addon.svg" }, - /* 6*/ { BARCODE_UPCE, -1, -1, "1234567+12", "../data/svg/upce_2addon.svg" }, - /* 7*/ { BARCODE_UPCE, -1, -1, "1234567+12345", "../data/svg/upce_5addon.svg" }, - /* 8*/ { BARCODE_EANX, -1, -1, "1234567+12", "../data/svg/ean8_2addon.svg" }, - /* 9*/ { BARCODE_EANX, -1, -1, "1234567+12345", "../data/svg/ean8_5addon.svg" }, - /* 10*/ { BARCODE_EANX, -1, -1, "12345", "../data/svg/ean5.svg" }, - /* 11*/ { BARCODE_EANX, -1, -1, "12", "../data/svg/ean2.svg" }, + /* 0*/ { BARCODE_CODE128, -1, -1, -1, -1, -1, "<>\"&'", "", "../data/svg/code128_amperands.svg" }, + /* 1*/ { BARCODE_CODE128, UNICODE_MODE, BOLD_TEXT, -1, -1, -1, "Égjpqy", "", "../data/svg/code128_egrave_bold.svg" }, + /* 2*/ { BARCODE_CODE128, UNICODE_MODE, BOLD_TEXT | BARCODE_BOX, -1, -1, -1, "Égjpqy", "", "../data/svg/code128_egrave_bold_box3.svg" }, + /* 3*/ { BARCODE_GS1_128_CC, -1, -1, -1, 3, -1, "[00]030123456789012340", "[02]13012345678909[37]24[10]1234567ABCDEFG", "../data/svg/gs1_128_cc_fig12.svg" }, + /* 4*/ { BARCODE_CODABLOCKF, -1, -1, -1, 3, -1, "AAAAAAAAA", "", "../data/svg/codablockf_3rows.svg" }, + /* 5*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "9771384524017+12", "", "../data/svg/ean13_2addon_ggs_5.2.2.5.1-2.svg" }, + /* 6*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "9780877799306+54321", "", "../data/svg/ean13_5addon_ggs_5.2.2.5.2-2.svg" }, + /* 7*/ { BARCODE_EANX_CC, -1, -1, -1, 1, -1, "123456789012+12", "[91]123456789012345678901", "../data/svg/ean13_cc_2addon_cca_4x4.svg" }, + /* 8*/ { BARCODE_EANX_CC, -1, -1, -1, 2, -1, "123456789012+54321", "[91]1234567890", "../data/svg/ean13_cc_5addon_ccb_3x4.svg" }, + /* 9*/ { BARCODE_EANX_CC, -1, -1, 0, 2, -1, "123456789012+54321", "[91]1234567890", "../data/svg/ean13_cc_5addon_ccb_3x4_notext.svg" }, + /* 10*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, "012345678905+24", "", "../data/svg/upca_2addon_ggs_5.2.6.6-5.svg" }, + /* 11*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, "614141234417+12345", "", "../data/svg/upca_5addon.svg" }, + /* 12*/ { BARCODE_UPCA, -1, BARCODE_BIND, -1, -1, -1, "614141234417+12345", "", "../data/svg/upca_5addon_bind3.svg" }, + /* 13*/ { BARCODE_UPCA, -1, SMALL_TEXT | BOLD_TEXT, -1, -1, -1, "614141234417+12345", "", "../data/svg/upca_5addon_small_bold.svg" }, + /* 14*/ { BARCODE_UPCA_CC, -1, -1, -1, 1, -1, "12345678901+12", "[91]123456789", "../data/svg/upca_cc_2addon_cca_3x4.svg" }, + /* 15*/ { BARCODE_UPCA_CC, -1, -1, -1, 2, -1, "12345678901+12121", "[91]1234567890123", "../data/svg/upca_cc_5addon_ccb_4x4.svg" }, + /* 16*/ { BARCODE_UPCA_CC, -1, -1, 0, 2, -1, "12345678901+12121", "[91]1234567890123", "../data/svg/upca_cc_5addon_ccb_4x4_notext.svg" }, + /* 17*/ { BARCODE_UPCA_CC, -1, BARCODE_BIND, -1, 2, -1, "12345678901+12121", "[91]1234567890123", "../data/svg/upca_cc_5addon_ccb_4x4_bind3.svg" }, + /* 18*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, "1234567+12", "", "../data/svg/upce_2addon.svg" }, + /* 19*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, "1234567+12345", "", "../data/svg/upce_5addon.svg" }, + /* 20*/ { BARCODE_UPCE, -1, -1, 0, -1, -1, "1234567+12345", "", "../data/svg/upce_5addon_notext.svg" }, + /* 21*/ { BARCODE_UPCE_CC, -1, -1, -1, 1, -1, "0654321+89", "[91]1", "../data/svg/upce_cc_2addon_cca_5x2.svg" }, + /* 22*/ { BARCODE_UPCE_CC, -1, -1, -1, 2, -1, "1876543+56789", "[91]12345", "../data/svg/upce_cc_5addon_ccb_8x2.svg" }, + /* 23*/ { BARCODE_UPCE_CC, -1, -1, 0, 2, -1, "1876543+56789", "[91]12345", "../data/svg/upce_cc_5addon_ccb_8x2_notext.svg" }, + /* 24*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "1234567+12", "", "../data/svg/ean8_2addon.svg" }, + /* 25*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "1234567+12345", "", "../data/svg/ean8_5addon.svg" }, + /* 26*/ { BARCODE_EANX_CC, -1, -1, -1, 1, -1, "9876543+65", "[91]1234567", "../data/svg/ean8_cc_2addon_cca_4x3.svg" }, + /* 27*/ { BARCODE_EANX_CC, -1, -1, -1, 2, -1, "9876543+74083", "[91]123456789012345678", "../data/svg/ean8_cc_5addon_ccb_8x3.svg" }, + /* 28*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "12345", "", "../data/svg/ean5.svg" }, + /* 29*/ { BARCODE_EANX, -1, -1, -1, -1, -1, "12", "", "../data/svg/ean2.svg" }, + /* 30*/ { BARCODE_CODE39, -1, SMALL_TEXT, -1, -1, -1, "123", "", "../data/svg/code39_small.svg" }, + /* 31*/ { BARCODE_POSTNET, -1, -1, -1, -1, -1, "12345", "", "../data/svg/postnet_zip.svg" }, }; int data_size = ARRAY_SIZE(data); @@ -66,6 +90,7 @@ static void test_print(int index, int generate, int debug) { char *svg = "out.svg"; char escaped[1024]; int escaped_size = 1024; + char *text; if (generate) { if (!testUtilExists(data_dir)) { @@ -81,9 +106,22 @@ static void test_print(int index, int generate, int debug) { struct zint_symbol *symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); - int length = testUtilSetSymbol(symbol, data[i].symbology, -1 /*input_mode*/, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, -1 /*output_options*/, data[i].data, -1, debug); + int length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, data[i].option_1, data[i].option_2, -1, data[i].output_options, data[i].data, -1, debug); + if (data[i].show_hrt != -1) { + symbol->show_hrt = data[i].show_hrt; + } + if (data[i].output_options & (BARCODE_BOX | BARCODE_BIND)) { + symbol->border_width = 3; + } + if (strlen(data[i].composite)) { + text = data[i].composite; + strcpy(symbol->primary, data[i].data); + } else { + text = data[i].data; + } + int text_length = strlen(text); - ret = ZBarcode_Encode(symbol, data[i].data, length); + ret = ZBarcode_Encode(symbol, text, text_length); assert_zero(ret, "i:%d %s ZBarcode_Encode ret %d != 0 %s\n", i, testUtilBarcodeName(data[i].symbology), ret, symbol->errtxt); strcpy(symbol->outfile, svg); @@ -91,9 +129,9 @@ static void test_print(int index, int generate, int debug) { assert_zero(ret, "i:%d %s ZBarcode_Print %s ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, ret); if (generate) { - printf(" /*%3d*/ { %s, %d, %d, \"%s\", \"%s\"},\n", - i, testUtilBarcodeName(data[i].symbology), data[i].option_1, data[i].option_2, - testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].expected_file); + printf(" /*%3d*/ { %s, %s, %s, %d, %d, %d, \"%s\", \"%s\", \"%s\" },\n", + i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), testUtilOutputOptionsName(data[i].output_options), + data[i].show_hrt, data[i].option_1, data[i].option_2, testUtilEscape(data[i].data, length, escaped, escaped_size), data[i].composite, data[i].expected_file); ret = rename(symbol->outfile, data[i].expected_file); assert_zero(ret, "i:%d rename(%s, %s) ret %d != 0\n", i, symbol->outfile, data[i].expected_file, ret); if (have_inkscape) { diff --git a/backend/tests/test_telepen.c b/backend/tests/test_telepen.c index 0ba3332a..6c83d87c 100644 --- a/backend/tests/test_telepen.c +++ b/backend/tests/test_telepen.c @@ -205,25 +205,25 @@ static void test_encode(int index, int generate, int debug) { /* 1*/ { BARCODE_TELEPEN, "ABC", -1, 0, 1, 96, "Telepen E2326U Example, same", "101010101011100010111011101110001110001110111000101011101110101011101000101000101110001010101010" }, - /* 2*/ { BARCODE_TELEPEN, "RST", -1, 0, 1, 96, "Verified manually against bwipp and tec-it", + /* 2*/ { BARCODE_TELEPEN, "RST", -1, 0, 1, 96, "Verified manually against tec-it", "101010101011100011100011100010101010111010111000111010111000101010111000111011101110001010101010" }, - /* 3*/ { BARCODE_TELEPEN, "?@", -1, 0, 1, 80, "ASCII count 127, check 0; verified manually against bwipp and tec-it", + /* 3*/ { BARCODE_TELEPEN, "?@", -1, 0, 1, 80, "ASCII count 127, check 0; verified manually against tec-it", "10101010101110001010101010101110111011101110101011101110111011101110001010101010" }, - /* 4*/ { BARCODE_TELEPEN, "\000", 1, 0, 1, 64, "Verified manually against bwipp and tec-it", + /* 4*/ { BARCODE_TELEPEN, "\000", 1, 0, 1, 64, "Verified manually against tec-it", "1010101010111000111011101110111011101110111011101110001010101010" }, - /* 5*/ { BARCODE_TELEPEN_NUM, "1234567890", -1, 0, 1, 128, "Verified manually against bwipp and tec-it", + /* 5*/ { BARCODE_TELEPEN_NUM, "1234567890", -1, 0, 1, 128, "Verified manually against tec-it", "10101010101110001010101110101110101000101010001010101110101110001011101010001000101110001010101010101011101010101110001010101010" }, - /* 6*/ { BARCODE_TELEPEN_NUM, "123456789", -1, 0, 1, 128, "Verified manually against bwipp (012345679) and tec-it (012345679)", + /* 6*/ { BARCODE_TELEPEN_NUM, "123456789", -1, 0, 1, 128, "Verified manually against tec-it (012345679)", "10101010101110001110101010111010111000100010001011101110001110001000101010001010111010100010100010111000101110101110001010101010" }, - /* 7*/ { BARCODE_TELEPEN_NUM, "123X", -1, 0, 1, 80, "Verified manually against bwipp and tec-it", + /* 7*/ { BARCODE_TELEPEN_NUM, "123X", -1, 0, 1, 80, "Verified manually against tec-it", "10101010101110001010101110101110111010111000111011101011101110001110001010101010" }, - /* 8*/ { BARCODE_TELEPEN_NUM, "1X3X", -1, 0, 1, 80, "Verified manually against bwipp and tec-it", + /* 8*/ { BARCODE_TELEPEN_NUM, "1X3X", -1, 0, 1, 80, "Verified manually against tec-it", "10101010101110001110001110001110111010111000111010111010101110001110001010101010" }, }; @@ -256,19 +256,17 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); - } + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, -1, -1, debug)) { - ret = testUtilBwipp(symbol, -1, -1, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + ret = testUtilBwipp(i, symbol, -1, -1, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_upcean.c b/backend/tests/test_upcean.c index 73bde64d..4e974c05 100644 --- a/backend/tests/test_upcean.c +++ b/backend/tests/test_upcean.c @@ -428,19 +428,17 @@ static void test_encode(int index, int generate, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - if (ret == 0) { - int width, row; - ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); - assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); - } + int width, row; + ret = testUtilModulesCmp(symbol, data[i].expected, &width, &row); + assert_zero(ret, "i:%d testUtilModulesCmp ret %d != 0 width %d row %d (%s)\n", i, ret, width, row, data[i].data); if (do_bwipp && testUtilCanBwipp(symbol->symbology, -1, data[i].option_2, -1, debug)) { - ret = testUtilBwipp(symbol, -1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); - assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(data[i].symbology), ret); + ret = testUtilBwipp(i, symbol, -1, data[i].option_2, -1, data[i].data, length, NULL, bwipp_buf, sizeof(bwipp_buf)); + assert_zero(ret, "i:%d %s testUtilBwipp ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret); ret = testUtilBwippCmp(symbol, bwipp_msg, bwipp_buf, data[i].expected); assert_zero(ret, "i:%d %s testUtilBwippCmp %d != 0 %s\n actual: %s\nexpected: %s\n", - i, testUtilBarcodeName(data[i].symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); + i, testUtilBarcodeName(symbol->symbology), ret, bwipp_msg, bwipp_buf, data[i].expected); } } } diff --git a/backend/tests/test_vector.c b/backend/tests/test_vector.c index 7d832c8b..0e0097a4 100644 --- a/backend/tests/test_vector.c +++ b/backend/tests/test_vector.c @@ -79,7 +79,7 @@ static void test_options(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_CODE128, "123456", "7890ab", 0, "A", 0, 1, 46, 92, 118 }, + /* 0*/ { BARCODE_CODE128, "123456", "7890ab", 0, "A", 0, 1, 46, 92, 118.9 }, /* 1*/ { BARCODE_CODE128, "12345", NULL, 0, "A", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1 }, /* 2*/ { BARCODE_CODE128, NULL, "1234567", 0, "A", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1 }, /* 3*/ { BARCODE_CODE128, "12345 ", NULL, 0, "A", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1 }, @@ -109,9 +109,9 @@ static void test_options(int index, int debug) { if (ret < 5) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %f != %f\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); - assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %f != %f\n", + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); } @@ -138,131 +138,133 @@ static void test_buffer_vector(int index, int generate, int debug) { float expected_vector_height; }; struct item data[] = { - /* 0*/ { BARCODE_CODE11, "0000000000", "", 50, 1, 99, 198, 118 }, - /* 1*/ { BARCODE_C25STANDARD, "0000000000", "", 50, 1, 117, 234, 118 }, - /* 2*/ { BARCODE_C25INTER, "0000000000", "", 50, 1, 99, 198, 118 }, - /* 3*/ { BARCODE_C25IATA, "0000000000", "", 50, 1, 149, 298, 118 }, - /* 4*/ { BARCODE_C25LOGIC, "0000000000", "", 50, 1, 109, 218, 118 }, - /* 5*/ { BARCODE_C25IND, "0000000000", "", 50, 1, 159, 318, 118 }, - /* 6*/ { BARCODE_CODE39, "0000000000", "", 50, 1, 155, 310, 118 }, - /* 7*/ { BARCODE_EXCODE39, "0000000000", "", 50, 1, 155, 310, 118 }, - /* 8*/ { BARCODE_EANX, "123456789012", "", 50, 1, 95, 226, 118 }, - /* 9*/ { BARCODE_EANX_CHK, "1234567890128", "", 50, 1, 95, 226, 118 }, - /* 10*/ { BARCODE_EANX, "123456789012+12", "", 50, 1, 122, 276, 118 }, - /* 11*/ { BARCODE_EANX_CHK, "1234567890128+12", "", 50, 1, 122, 276, 118 }, - /* 12*/ { BARCODE_EANX, "123456789012+12345", "", 50, 1, 149, 330, 118 }, - /* 13*/ { BARCODE_EANX_CHK, "1234567890128+12345", "", 50, 1, 149, 330, 118 }, - /* 14*/ { BARCODE_EANX, "1234567", "", 50, 1, 67, 162, 118 }, - /* 15*/ { BARCODE_EANX_CHK, "12345670", "", 50, 1, 67, 162, 118 }, - /* 16*/ { BARCODE_EANX, "1234567+12", "", 50, 1, 94, 216, 118 }, - /* 17*/ { BARCODE_EANX_CHK, "12345670+12", "", 50, 1, 94, 216, 118 }, - /* 18*/ { BARCODE_EANX, "1234567+12345", "", 50, 1, 121, 270, 118 }, - /* 19*/ { BARCODE_EANX_CHK, "12345670+12345", "", 50, 1, 121, 270, 118 }, - /* 20*/ { BARCODE_EANX, "1234", "", 50, 1, 47, 118, 118 }, - /* 21*/ { BARCODE_EANX_CHK, "1234", "", 50, 1, 47, 118, 118 }, - /* 22*/ { BARCODE_EANX, "12", "", 50, 1, 20, 64, 118 }, - /* 23*/ { BARCODE_EANX_CHK, "12", "", 50, 1, 20, 64, 118 }, - /* 24*/ { BARCODE_GS1_128, "[01]12345678901234", "", 50, 1, 134, 268, 118 }, - /* 25*/ { BARCODE_CODABAR, "A00000000B", "", 50, 1, 102, 204, 118 }, - /* 26*/ { BARCODE_CODE128, "0000000000", "", 50, 1, 90, 180, 118 }, - /* 27*/ { BARCODE_DPLEIT, "1234567890123", "", 50, 1, 135, 270, 118 }, - /* 28*/ { BARCODE_DPIDENT, "12345678901", "", 50, 1, 117, 234, 118 }, - /* 29*/ { BARCODE_CODE16K, "0000000000", "", 20, 2, 70, 162, 44 }, - /* 30*/ { BARCODE_CODE49, "0000000000", "", 20, 2, 70, 162, 44 }, - /* 31*/ { BARCODE_CODE93, "0000000000", "", 50, 1, 127, 254, 118 }, + /* 0*/ { BARCODE_CODE11, "1234567890", "", 50, 1, 108, 216, 118.9 }, + /* 1*/ { BARCODE_C25STANDARD, "1234567890", "", 50, 1, 117, 234, 118.9 }, + /* 2*/ { BARCODE_C25INTER, "1234567890", "", 50, 1, 99, 198, 118.9 }, + /* 3*/ { BARCODE_C25IATA, "1234567890", "", 50, 1, 149, 298, 118.9 }, + /* 4*/ { BARCODE_C25LOGIC, "1234567890", "", 50, 1, 109, 218, 118.9 }, + /* 5*/ { BARCODE_C25IND, "1234567890", "", 50, 1, 159, 318, 118.9 }, + /* 6*/ { BARCODE_CODE39, "1234567890", "", 50, 1, 155, 310, 118.9 }, + /* 7*/ { BARCODE_EXCODE39, "1234567890", "", 50, 1, 155, 310, 118.9 }, + /* 8*/ { BARCODE_EANX, "123456789012", "", 50, 1, 95, 226, 116.4 }, + /* 9*/ { BARCODE_EANX_CHK, "1234567890128", "", 50, 1, 95, 226, 116.4 }, + /* 10*/ { BARCODE_EANX, "123456789012+12", "", 50, 1, 122, 276, 116.4 }, + /* 11*/ { BARCODE_EANX_CHK, "1234567890128+12", "", 50, 1, 122, 276, 116.4 }, + /* 12*/ { BARCODE_EANX, "123456789012+12345", "", 50, 1, 149, 330, 116.4 }, + /* 13*/ { BARCODE_EANX_CHK, "1234567890128+12345", "", 50, 1, 149, 330, 116.4 }, + /* 14*/ { BARCODE_EANX, "1234567", "", 50, 1, 67, 162, 116.4 }, + /* 15*/ { BARCODE_EANX_CHK, "12345670", "", 50, 1, 67, 162, 116.4 }, + /* 16*/ { BARCODE_EANX, "1234567+12", "", 50, 1, 94, 216, 116.4 }, + /* 17*/ { BARCODE_EANX_CHK, "12345670+12", "", 50, 1, 94, 216, 116.4 }, + /* 18*/ { BARCODE_EANX, "1234567+12345", "", 50, 1, 121, 270, 116.4 }, + /* 19*/ { BARCODE_EANX_CHK, "12345670+12345", "", 50, 1, 121, 270, 116.4 }, + /* 20*/ { BARCODE_EANX, "1234", "", 50, 1, 47, 118, 116.4 }, + /* 21*/ { BARCODE_EANX_CHK, "1234", "", 50, 1, 47, 118, 116.4 }, + /* 22*/ { BARCODE_EANX, "12", "", 50, 1, 20, 64, 116.4 }, + /* 23*/ { BARCODE_EANX_CHK, "12", "", 50, 1, 20, 64, 116.4 }, + /* 24*/ { BARCODE_GS1_128, "[01]12345678901234", "", 50, 1, 134, 268, 118.9 }, + /* 25*/ { BARCODE_CODABAR, "A00000000B", "", 50, 1, 102, 204, 118.9 }, + /* 26*/ { BARCODE_CODE128, "1234567890", "", 50, 1, 90, 180, 118.9 }, + /* 27*/ { BARCODE_DPLEIT, "1234567890123", "", 50, 1, 135, 270, 118.9 }, + /* 28*/ { BARCODE_DPIDENT, "12345678901", "", 50, 1, 117, 234, 118.9 }, + /* 29*/ { BARCODE_CODE16K, "1234567890", "", 20, 2, 70, 162, 44 }, + /* 30*/ { BARCODE_CODE49, "1234567890", "", 20, 2, 70, 162, 44 }, + /* 31*/ { BARCODE_CODE93, "1234567890", "", 50, 1, 127, 254, 118.9 }, /* 32*/ { BARCODE_FLAT, "1234567890", "", 50, 1, 90, 180, 100 }, - /* 33*/ { BARCODE_DBAR_OMN, "1234567890123", "", 50, 1, 96, 192, 118 }, - /* 34*/ { BARCODE_DBAR_LTD, "1234567890123", "", 50, 1, 79, 158.0, 118.0 }, - /* 35*/ { BARCODE_DBAR_EXP, "[01]12345678901234", "", 34, 1, 134, 268, 86 }, - /* 36*/ { BARCODE_TELEPEN, "0000000000", "", 50, 1, 208, 416, 118 }, - /* 37*/ { BARCODE_UPCA, "12345678904", "", 50, 1, 95, 226, 118 }, - /* 38*/ { BARCODE_UPCA_CHK, "123456789043", "", 50, 1, 95, 226, 118 }, - /* 39*/ { BARCODE_UPCA, "12345678904+12", "", 50, 1, 124, 276, 118 }, - /* 40*/ { BARCODE_UPCA_CHK, "123456789043+12", "", 50, 1, 124, 276, 118 }, - /* 41*/ { BARCODE_UPCA, "12345678904+12345", "", 50, 1, 151, 330, 118 }, - /* 42*/ { BARCODE_UPCA_CHK, "123456789043+12345", "", 50, 1, 151, 330, 118 }, - /* 43*/ { BARCODE_UPCE, "1234567", "", 50, 1, 51, 134, 118 }, - /* 44*/ { BARCODE_UPCE_CHK, "12345670", "", 50, 1, 51, 134, 118 }, - /* 45*/ { BARCODE_UPCE, "1234567+12", "", 50, 1, 78, 184, 118 }, - /* 46*/ { BARCODE_UPCE_CHK, "12345670+12", "", 50, 1, 78, 184, 118 }, - /* 47*/ { BARCODE_UPCE, "1234567+12345", "", 50, 1, 105, 238, 118 }, - /* 48*/ { BARCODE_UPCE_CHK, "12345670+12345", "", 50, 1, 105, 238, 118 }, - /* 49*/ { BARCODE_POSTNET, "00000000000", "", 12, 2, 185, 370, 24 }, - /* 50*/ { BARCODE_MSI_PLESSEY, "0000000000", "", 50, 1, 127, 254, 118 }, + /* 33*/ { BARCODE_DBAR_OMN, "1234567890123", "", 50, 1, 96, 192, 118.9 }, + /* 34*/ { BARCODE_DBAR_LTD, "1234567890123", "", 50, 1, 79, 158, 118.9 }, + /* 35*/ { BARCODE_DBAR_EXP, "[01]12345678901234", "", 34, 1, 134, 268, 86.900002 }, + /* 36*/ { BARCODE_TELEPEN, "1234567890", "", 50, 1, 208, 416, 118.9 }, + /* 37*/ { BARCODE_UPCA, "12345678901", "", 50, 1, 95, 226, 116.4 }, + /* 38*/ { BARCODE_UPCA_CHK, "123456789012", "", 50, 1, 95, 226, 116.4 }, + /* 39*/ { BARCODE_UPCA, "12345678901+12", "", 50, 1, 124, 276, 116.4 }, + /* 40*/ { BARCODE_UPCA_CHK, "123456789012+12", "", 50, 1, 124, 276, 116.4 }, + /* 41*/ { BARCODE_UPCA, "12345678901+12345", "", 50, 1, 151, 330, 116.4 }, + /* 42*/ { BARCODE_UPCA_CHK, "123456789012+12345", "", 50, 1, 151, 330, 116.4 }, + /* 43*/ { BARCODE_UPCE, "1234567", "", 50, 1, 51, 134, 116.4 }, + /* 44*/ { BARCODE_UPCE_CHK, "12345670", "", 50, 1, 51, 134, 116.4 }, + /* 45*/ { BARCODE_UPCE, "1234567+12", "", 50, 1, 78, 184, 116.4 }, + /* 46*/ { BARCODE_UPCE_CHK, "12345670+12", "", 50, 1, 78, 184, 116.4 }, + /* 47*/ { BARCODE_UPCE, "1234567+12345", "", 50, 1, 105, 238, 116.4 }, + /* 48*/ { BARCODE_UPCE_CHK, "12345670+12345", "", 50, 1, 105, 238, 116.4 }, + /* 49*/ { BARCODE_POSTNET, "12345678901", "", 12, 2, 123, 246, 24 }, + /* 50*/ { BARCODE_MSI_PLESSEY, "1234567890", "", 50, 1, 127, 254, 118.9 }, /* 51*/ { BARCODE_FIM, "A", "", 50, 1, 17, 34, 100 }, - /* 52*/ { BARCODE_LOGMARS, "0000000000", "", 50, 1, 191, 382, 118 }, + /* 52*/ { BARCODE_LOGMARS, "1234567890", "", 50, 1, 191, 382, 118.9 }, /* 53*/ { BARCODE_PHARMA, "123456", "", 50, 1, 58, 116, 100 }, - /* 54*/ { BARCODE_PZN, "123456", "", 50, 1, 142, 284, 118 }, + /* 54*/ { BARCODE_PZN, "123456", "", 50, 1, 142, 284, 118.9 }, /* 55*/ { BARCODE_PHARMA_TWO, "12345678", "", 10, 2, 29, 58, 20 }, - /* 56*/ { BARCODE_PDF417, "0000000000", "", 21, 7, 103, 206, 42 }, - /* 57*/ { BARCODE_PDF417COMP, "0000000000", "", 21, 7, 69, 138, 42 }, - /* 58*/ { BARCODE_MAXICODE, "0000000000", "", 165, 33, 30, 74, 72 }, // Differs from raster + /* 56*/ { BARCODE_PDF417, "1234567890", "", 21, 7, 103, 206, 42 }, + /* 57*/ { BARCODE_PDF417COMP, "1234567890", "", 21, 7, 69, 138, 42 }, + /* 58*/ { BARCODE_MAXICODE, "1234567890", "", 165, 33, 30, 74, 72 }, /* 59*/ { BARCODE_QRCODE, "1234567890AB", "", 21, 21, 21, 42, 42 }, - /* 60*/ { BARCODE_CODE128B, "0000000000", "", 50, 1, 145, 290, 118 }, + /* 60*/ { BARCODE_CODE128B, "1234567890", "", 50, 1, 145, 290, 118.9 }, /* 61*/ { BARCODE_AUSPOST, "12345678901234567890123", "", 8, 3, 133, 266, 16 }, /* 62*/ { BARCODE_AUSREPLY, "12345678", "", 8, 3, 73, 146, 16 }, /* 63*/ { BARCODE_AUSROUTE, "12345678", "", 8, 3, 73, 146, 16 }, /* 64*/ { BARCODE_AUSREDIRECT, "12345678", "", 8, 3, 73, 146, 16 }, - /* 65*/ { BARCODE_ISBNX, "123456789", "", 50, 1, 95, 226, 118 }, - /* 66*/ { BARCODE_ISBNX, "123456789+12", "", 50, 1, 122, 276, 118 }, - /* 67*/ { BARCODE_ISBNX, "123456789+12345", "", 50, 1, 149, 330, 118 }, - /* 68*/ { BARCODE_RM4SCC, "0000000000", "", 8, 3, 91, 182, 16 }, + /* 65*/ { BARCODE_ISBNX, "123456789", "", 50, 1, 95, 226, 116.4 }, + /* 66*/ { BARCODE_ISBNX, "123456789+12", "", 50, 1, 122, 276, 116.4 }, + /* 67*/ { BARCODE_ISBNX, "123456789+12345", "", 50, 1, 149, 330, 116.4 }, + /* 68*/ { BARCODE_RM4SCC, "1234567890", "", 8, 3, 91, 182, 16 }, /* 69*/ { BARCODE_DATAMATRIX, "ABC", "", 10, 10, 10, 20, 20 }, - /* 70*/ { BARCODE_EAN14, "1234567890123", "", 50, 1, 134, 268, 118 }, - /* 71*/ { BARCODE_VIN, "00000000000000000", "", 50, 1, 246, 492, 118 }, - /* 72*/ { BARCODE_CODABLOCKF, "0000000000", "", 20, 2, 101, 242, 44 }, - /* 73*/ { BARCODE_NVE18, "12345678901234567", "", 50, 1, 156, 312, 118 }, - /* 74*/ { BARCODE_JAPANPOST, "0000000000", "", 8, 3, 133, 266, 16 }, - /* 75*/ { BARCODE_KOREAPOST, "123456", "", 50, 1, 167, 334, 118 }, - /* 76*/ { BARCODE_DBAR_STK, "0000000000000", "", 13, 3, 50, 100, 26 }, - /* 77*/ { BARCODE_DBAR_OMNSTK, "0000000000000", "", 69, 5, 50, 100, 138 }, + /* 70*/ { BARCODE_EAN14, "1234567890123", "", 50, 1, 134, 268, 118.9 }, + /* 71*/ { BARCODE_VIN, "12345678701234567", "", 50, 1, 246, 492, 118.9 }, + /* 72*/ { BARCODE_CODABLOCKF, "1234567890", "", 20, 2, 101, 242, 44 }, + /* 73*/ { BARCODE_NVE18, "12345678901234567", "", 50, 1, 156, 312, 118.9 }, + /* 74*/ { BARCODE_JAPANPOST, "1234567890", "", 8, 3, 133, 266, 16 }, + /* 75*/ { BARCODE_KOREAPOST, "123456", "", 50, 1, 167, 334, 118.9 }, + /* 76*/ { BARCODE_DBAR_STK, "1234567890123", "", 13, 3, 50, 100, 26 }, + /* 77*/ { BARCODE_DBAR_OMNSTK, "1234567890123", "", 69, 5, 50, 100, 138 }, /* 78*/ { BARCODE_DBAR_EXPSTK, "[01]12345678901234", "", 71, 5, 102, 204, 142 }, - /* 79*/ { BARCODE_PLANET, "00000000000", "", 12, 2, 185, 370, 24 }, - /* 80*/ { BARCODE_MICROPDF417, "0000000000", "", 12, 6, 82, 164, 24 }, + /* 79*/ { BARCODE_PLANET, "12345678901", "", 12, 2, 123, 246, 24 }, + /* 80*/ { BARCODE_MICROPDF417, "1234567890", "", 12, 6, 82, 164, 24 }, /* 81*/ { BARCODE_USPS_IMAIL, "12345678901234567890", "", 8, 3, 129, 258, 16 }, - /* 82*/ { BARCODE_PLESSEY, "0000000000", "", 50, 1, 227, 454, 118 }, - /* 83*/ { BARCODE_TELEPEN_NUM, "0000000000", "", 50, 1, 128, 256, 118 }, - /* 84*/ { BARCODE_ITF14, "0000000000", "", 50, 1, 135, 330, 138 }, + /* 82*/ { BARCODE_PLESSEY, "1234567890", "", 50, 1, 227, 454, 118.9 }, + /* 83*/ { BARCODE_TELEPEN_NUM, "1234567890", "", 50, 1, 128, 256, 118.9 }, + /* 84*/ { BARCODE_ITF14, "1234567890", "", 50, 1, 135, 330, 138.89999 }, /* 85*/ { BARCODE_KIX, "123456ABCDE", "", 8, 3, 87, 174, 16 }, /* 86*/ { BARCODE_AZTEC, "1234567890AB", "", 15, 15, 15, 30, 30 }, - /* 87*/ { BARCODE_DAFT, "DAFTDAFTDAFTDAFT", "", 8, 3, 31, 62, 16 }, - /* 88*/ { BARCODE_DPD, "0123456789012345678901234567", "", 50, 1, 189, 378, 118 }, - /* 89*/ { BARCODE_MICROQR, "12345", "", 11, 11, 11, 22, 22 }, - /* 90*/ { BARCODE_HIBC_128, "0000000000", "", 50, 1, 134, 268, 118 }, - /* 91*/ { BARCODE_HIBC_39, "0000000000", "", 50, 1, 223, 446, 118 }, - /* 92*/ { BARCODE_HIBC_DM, "ABC", "", 12, 12, 12, 24, 24 }, - /* 93*/ { BARCODE_HIBC_QR, "1234567890AB", "", 21, 21, 21, 42, 42 }, - /* 94*/ { BARCODE_HIBC_PDF, "0000000000", "", 27, 9, 103, 206, 54 }, - /* 95*/ { BARCODE_HIBC_MICPDF, "0000000000", "", 34, 17, 38, 76, 68 }, - /* 96*/ { BARCODE_HIBC_BLOCKF, "0000000000", "", 30, 3, 101, 242, 64 }, - /* 97*/ { BARCODE_HIBC_AZTEC, "1234567890AB", "", 19, 19, 19, 38, 38 }, - /* 98*/ { BARCODE_DOTCODE, "ABC", "", 11, 11, 16, 32, 22 }, // Differs from raster - /* 99*/ { BARCODE_HANXIN, "1234567890AB", "", 23, 23, 23, 46, 46 }, - /*100*/ { BARCODE_MAILMARK, "01000000000000000AA00AA0A", "", 10, 3, 155, 310, 20 }, - /*101*/ { BARCODE_AZRUNE, "255", "", 11, 11, 11, 22, 22 }, - /*102*/ { BARCODE_CODE32, "12345678", "", 50, 1, 103, 206, 118 }, - /*103*/ { BARCODE_EANX_CC, "123456789012", "[20]01", 50, 7, 99, 234, 118 }, - /*104*/ { BARCODE_EANX_CC, "123456789012+12", "[20]01", 50, 7, 126, 284, 118 }, - /*105*/ { BARCODE_EANX_CC, "123456789012+12345", "[20]01", 50, 7, 153, 338, 118 }, - /*106*/ { BARCODE_GS1_128_CC, "[01]12345678901234", "[20]01", 50, 5, 145, 290, 118 }, - /*107*/ { BARCODE_DBAR_OMN_CC, "1234567890123", "[20]01", 21, 5, 100, 200, 60 }, - /*108*/ { BARCODE_DBAR_LTD_CC, "1234567890123", "[20]01", 19, 6, 79, 158.0, 56.0 }, - /*109*/ { BARCODE_DBAR_EXP_CC, "[01]12345678901234", "[20]01", 41, 5, 134, 268, 100 }, - /*110*/ { BARCODE_UPCA_CC, "12345678901", "[20]01", 50, 7, 99, 234, 118 }, - /*111*/ { BARCODE_UPCA_CC, "12345678901+12", "[20]01", 50, 7, 128, 284, 118 }, - /*112*/ { BARCODE_UPCA_CC, "12345678901+12345", "[20]01", 50, 7, 155, 338, 118 }, - /*113*/ { BARCODE_UPCE_CC, "1234567", "[20]01", 50, 9, 55, 142, 118 }, - /*114*/ { BARCODE_UPCE_CC, "1234567+12", "[20]01", 50, 9, 82, 192, 118 }, - /*115*/ { BARCODE_UPCE_CC, "1234567+12345", "[20]01", 50, 9, 109, 246, 118 }, - /*116*/ { BARCODE_DBAR_STK_CC, "0000000000000", "[20]01", 24, 9, 56, 112, 48 }, - /*117*/ { BARCODE_DBAR_OMNSTK_CC, "0000000000000", "[20]01", 80, 11, 56, 112, 160 }, - /*118*/ { BARCODE_DBAR_EXPSTK_CC, "[01]12345678901234", "[20]01", 78, 9, 102, 204, 156 }, - /*119*/ { BARCODE_CHANNEL, "00", "", 50, 1, 19, 38, 118 }, - /*120*/ { BARCODE_CODEONE, "12345678901234567890", "", 22, 22, 22, 44, 44 }, - /*121*/ { BARCODE_GRIDMATRIX, "ABC", "", 18, 18, 18, 36, 36 }, - /*122*/ { BARCODE_UPNQR, "1234567890AB", "", 77, 77, 77, 154, 154 }, - /*123*/ { BARCODE_ULTRA, "0000000000", "", 13, 13, 18, 36, 26 }, - /*124*/ { BARCODE_RMQR, "12345", "", 11, 11, 27, 54, 22 }, + /* 87*/ { BARCODE_DPD, "0123456789012345678901234567", "", 50, 1, 189, 378, 118.9 }, + /* 88*/ { BARCODE_MICROQR, "12345", "", 11, 11, 11, 22, 22 }, + /* 89*/ { BARCODE_HIBC_128, "1234567890", "", 50, 1, 123, 246, 118.9 }, + /* 90*/ { BARCODE_HIBC_39, "1234567890", "", 50, 1, 223, 446, 118.9 }, + /* 91*/ { BARCODE_HIBC_DM, "ABC", "", 12, 12, 12, 24, 24 }, + /* 92*/ { BARCODE_HIBC_QR, "1234567890AB", "", 21, 21, 21, 42, 42 }, + /* 93*/ { BARCODE_HIBC_PDF, "1234567890", "", 24, 8, 103, 206, 48 }, + /* 94*/ { BARCODE_HIBC_MICPDF, "1234567890", "", 28, 14, 38, 76, 56 }, + /* 95*/ { BARCODE_HIBC_BLOCKF, "1234567890", "", 30, 3, 101, 242, 64 }, + /* 96*/ { BARCODE_HIBC_AZTEC, "1234567890AB", "", 19, 19, 19, 38, 38 }, + /* 97*/ { BARCODE_DOTCODE, "ABC", "", 11, 11, 16, 32, 22 }, + /* 98*/ { BARCODE_HANXIN, "1234567890AB", "", 23, 23, 23, 46, 46 }, + /* 99*/ { BARCODE_MAILMARK, "01000000000000000AA00AA0A", "", 10, 3, 155, 310, 20 }, + /*100*/ { BARCODE_AZRUNE, "255", "", 11, 11, 11, 22, 22 }, + /*101*/ { BARCODE_CODE32, "12345678", "", 50, 1, 103, 206, 118.9 }, + /*102*/ { BARCODE_EANX_CC, "123456789012", "[20]01", 50, 7, 99, 234, 116.4 }, + /*103*/ { BARCODE_EANX_CC, "123456789012+12", "[20]01", 50, 7, 126, 284, 116.4 }, + /*104*/ { BARCODE_EANX_CC, "123456789012+12345", "[20]01", 50, 7, 153, 338, 116.4 }, + /*105*/ { BARCODE_EANX_CC, "1234567", "[20]01", 50, 8, 72, 172, 116.4 }, + /*106*/ { BARCODE_EANX_CC, "1234567+12", "[20]01", 50, 8, 99, 226, 116.4 }, + /*107*/ { BARCODE_EANX_CC, "1234567+12345", "[20]01", 50, 8, 126, 280, 116.4 }, + /*108*/ { BARCODE_GS1_128_CC, "[01]12345678901234", "[20]01", 50, 5, 145, 290, 118.9 }, + /*109*/ { BARCODE_DBAR_OMN_CC, "1234567890123", "[20]01", 21, 5, 100, 200, 60.900002 }, + /*110*/ { BARCODE_DBAR_LTD_CC, "1234567890123", "[20]01", 19, 6, 79, 158, 56.900002 }, + /*111*/ { BARCODE_DBAR_EXP_CC, "[01]12345678901234", "[20]01", 41, 5, 134, 268, 100.9 }, + /*112*/ { BARCODE_UPCA_CC, "12345678901", "[20]01", 50, 7, 99, 234, 116.4 }, + /*113*/ { BARCODE_UPCA_CC, "12345678901+12", "[20]01", 50, 7, 128, 284, 116.4 }, + /*114*/ { BARCODE_UPCA_CC, "12345678901+12345", "[20]01", 50, 7, 155, 338, 116.4 }, + /*115*/ { BARCODE_UPCE_CC, "1234567", "[20]01", 50, 9, 55, 142, 116.4 }, + /*116*/ { BARCODE_UPCE_CC, "1234567+12", "[20]01", 50, 9, 82, 192, 116.4 }, + /*117*/ { BARCODE_UPCE_CC, "1234567+12345", "[20]01", 50, 9, 109, 246, 116.4 }, + /*118*/ { BARCODE_DBAR_STK_CC, "1234567890123", "[20]01", 24, 9, 56, 112, 48 }, + /*119*/ { BARCODE_DBAR_OMNSTK_CC, "1234567890123", "[20]01", 80, 11, 56, 112, 160 }, + /*120*/ { BARCODE_DBAR_EXPSTK_CC, "[01]12345678901234", "[20]01", 78, 9, 102, 204, 156 }, + /*121*/ { BARCODE_CHANNEL, "01", "", 50, 1, 19, 38, 118.9 }, + /*122*/ { BARCODE_CODEONE, "12345678901234567890", "", 22, 22, 22, 44, 44 }, + /*123*/ { BARCODE_GRIDMATRIX, "ABC", "", 18, 18, 18, 36, 36 }, + /*124*/ { BARCODE_UPNQR, "1234567890AB", "", 77, 77, 77, 154, 154 }, + /*125*/ { BARCODE_ULTRA, "1234567890", "", 13, 13, 18, 36, 26 }, + /*126*/ { BARCODE_RMQR, "12345", "", 11, 11, 27, 54, 22 }, }; int data_size = sizeof(data) / sizeof(struct item); @@ -295,16 +297,16 @@ static void test_buffer_vector(int index, int generate, int debug) { assert_nonnull(symbol->vector, "i:%d ZBarcode_Buffer_Vector(%d) vector NULL\n", i, data[i].symbology); if (generate) { - printf(" /*%3d*/ { %s, \"%s\", \"%s\", %d, %d, %d, %.1f, %.1f },\n", + printf(" /*%3d*/ { %s, \"%s\", \"%s\", %d, %d, %d, %.8g, %.8g },\n", i, testUtilBarcodeName(data[i].symbology), data[i].data, data[i].composite, symbol->height, symbol->rows, symbol->width, symbol->vector->width, symbol->vector->height); } else { assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%s) symbol->rows %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%s) symbol->width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %f != %f\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); - assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %f != %f\n", + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); } @@ -335,46 +337,46 @@ static void test_upcean_hrt(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_EANX, -1, "123456789012", 0, 50, 1, 95, 230.0, 118.0, 8, -1 }, // EAN-13 - /* 1*/ { BARCODE_EANX, 0, "123456789012", 0, 50, 1, 95, 230.0, 118.0, -1, -1 }, // EAN-13 - /* 2*/ { BARCODE_EANX_CHK, -1, "1234567890128", 0, 50, 1, 95, 230.0, 118.0, 8, -1 }, // EAN-13 - /* 3*/ { BARCODE_EANX_CHK, 0, "1234567890128", 0, 50, 1, 95, 230.0, 118.0, -1, -1 }, // EAN-13 - /* 4*/ { BARCODE_ISBNX, -1, "9784567890120", 0, 50, 1, 95, 230.0, 118.0, 8, -1 }, - /* 5*/ { BARCODE_ISBNX, 0, "9784567890120", 0, 50, 1, 95, 230.0, 118.0, -1, -1 }, - /* 6*/ { BARCODE_EANX, -1, "1234567", 0, 50, 1, 67, 134.0, 118.0, 48, -1 }, // EAN-8 - /* 7*/ { BARCODE_EANX, 0, "1234567", 0, 50, 1, 67, 134.0, 118.0, -1, -1 }, // EAN-8 - /* 8*/ { BARCODE_EANX, -1, "1234", 0, 50, 1, 47, 94.0, 118.0, 61, -1 }, // EAN-5 - /* 9*/ { BARCODE_EANX, 0, "1234", 0, 50, 1, 47, 94.0, 118.0, -1, -1 }, // EAN-5 - /* 10*/ { BARCODE_EANX, -1, "12", 0, 50, 1, 20, 40.0, 118.0, 34, -1 }, // EAN-2 - /* 11*/ { BARCODE_EANX, 0, "12", 0, 50, 1, 20, 40.0, 118.0, -1, -1 }, // EAN-2 - /* 12*/ { BARCODE_UPCA, -1, "12345678901", 0, 50, 1, 95, 230.0, 118.0, 8, -1 }, - /* 13*/ { BARCODE_UPCA, 0, "12345678901", 0, 50, 1, 95, 230.0, 118.0, -1, -1 }, - /* 14*/ { BARCODE_UPCA_CHK, -1, "123456789012", 0, 50, 1, 95, 230.0, 118.0, 8, -1 }, - /* 15*/ { BARCODE_UPCA_CHK, 0, "123456789012", 0, 50, 1, 95, 230.0, 118.0, -1, -1 }, - /* 16*/ { BARCODE_UPCE, -1, "1234567", 0, 50, 1, 51, 142.0, 118.0, 8, -1 }, - /* 17*/ { BARCODE_UPCE, 0, "1234567", 0, 50, 1, 51, 142.0, 118.0, -1, -1 }, - /* 18*/ { BARCODE_UPCE_CHK, -1, "12345670", 0, 50, 1, 51, 142.0, 118.0, 8, -1 }, - /* 19*/ { BARCODE_UPCE_CHK, 0, "12345670", 0, 50, 1, 51, 142.0, 118.0, -1, -1 }, - /* 20*/ { BARCODE_EANX, -1, "123456789012+12", 0, 50, 1, 122, 276.0, 118.0, 8, 70 }, // EAN-13 + EAN-2 - /* 21*/ { BARCODE_EANX, 0, "123456789012+12", 0, 50, 1, 122, 276.0, 118.0, -1, -1 }, // EAN-13 + EAN-2 - /* 22*/ { BARCODE_ISBNX, -1, "9784567890120+12", 0, 50, 1, 122, 276.0, 118.0, 8, 70 }, // ISBN + EAN-2 - /* 23*/ { BARCODE_ISBNX, 0, "9784567890120+12", 0, 50, 1, 122, 276.0, 118.0, -1, -1 }, // ISBN + EAN-2 - /* 24*/ { BARCODE_EANX, -1, "123456789012+12345", 0, 50, 1, 149, 330.0, 118.0, 8, 70 }, // EAN-13 + EAN-5 - /* 25*/ { BARCODE_EANX, 0, "123456789012+12345", 0, 50, 1, 149, 330.0, 118.0, -1, -1 }, // EAN-13 + EAN-5 - /* 26*/ { BARCODE_ISBNX, -1, "9784567890120+12345", 0, 50, 1, 149, 330.0, 118.0, 8, 70 }, // ISBN + EAN-5 - /* 27*/ { BARCODE_ISBNX, 0, "9784567890120+12345", 0, 50, 1, 149, 330.0, 118.0, -1, -1 }, // ISBN + EAN-5 - /* 28*/ { BARCODE_EANX, -1, "1234567+12", 0, 50, 1, 94, 216.0, 118.0, 48, 114 }, // EAN-8 + EAN-2 - /* 29*/ { BARCODE_EANX, 0, "1234567+12", 0, 50, 1, 94, 216.0, 118.0, -1, -1 }, // EAN-8 + EAN-2 - /* 30*/ { BARCODE_EANX, -1, "1234567+12345", 0, 50, 1, 121, 270.0, 118.0, 48, 114 }, // EAN-8 + EAN-5 - /* 31*/ { BARCODE_EANX, 0, "1234567+12345", 0, 50, 1, 121, 270.0, 118.0, -1, -1 }, // EAN-8 + EAN-5 - /* 32*/ { BARCODE_UPCA, -1, "12345678901+12", 0, 50, 1, 124, 288.0, 118.0, 8, 72 }, - /* 33*/ { BARCODE_UPCA, 0, "12345678901+12", 0, 50, 1, 124, 288.0, 118.0, -1, -1 }, - /* 34*/ { BARCODE_UPCA, -1, "12345678901+12345", 0, 50, 1, 151, 342.0, 118.0, 8, 72 }, - /* 35*/ { BARCODE_UPCA, 0, "12345678901+12345", 0, 50, 1, 151, 342.0, 118.0, -1, -1 }, - /* 36*/ { BARCODE_UPCE, -1, "1234567+12", 0, 50, 1, 78, 184.0, 118.0, 8, 66 }, - /* 37*/ { BARCODE_UPCE, 0, "1234567+12", 0, 50, 1, 78, 184.0, 118.0, -1, -1 }, - /* 38*/ { BARCODE_UPCE, -1, "1234567+12345", 0, 50, 1, 105, 238.0, 118.0, 8, 66 }, - /* 39*/ { BARCODE_UPCE, 0, "1234567+12345", 0, 50, 1, 105, 238.0, 118.0, -1, -1 }, + /* 0*/ { BARCODE_EANX, -1, "123456789012", 0, 50, 1, 95, 226, 116.4, 12, -1 }, // EAN-13 + /* 1*/ { BARCODE_EANX, 0, "123456789012", 0, 50, 1, 95, 226, 110, -1, -1 }, // EAN-13 + /* 2*/ { BARCODE_EANX_CHK, -1, "1234567890128", 0, 50, 1, 95, 226, 116.4, 12, -1 }, // EAN-13 + /* 3*/ { BARCODE_EANX_CHK, 0, "1234567890128", 0, 50, 1, 95, 226, 110, -1, -1 }, // EAN-13 + /* 4*/ { BARCODE_ISBNX, -1, "9784567890120", 0, 50, 1, 95, 226, 116.4, 12, -1 }, + /* 5*/ { BARCODE_ISBNX, 0, "9784567890120", 0, 50, 1, 95, 226, 110, -1, -1 }, + /* 6*/ { BARCODE_EANX, -1, "1234567", 0, 50, 1, 67, 162, 116.4, 48, -1 }, // EAN-8 + /* 7*/ { BARCODE_EANX, 0, "1234567", 0, 50, 1, 67, 162, 110, -1, -1 }, // EAN-8 + /* 8*/ { BARCODE_EANX, -1, "1234", 0, 50, 1, 47, 118, 116.4, 61, -1 }, // EAN-5 + /* 9*/ { BARCODE_EANX, 0, "1234", 0, 50, 1, 47, 118, 100, -1, -1 }, // EAN-5 + /* 10*/ { BARCODE_EANX, -1, "12", 0, 50, 1, 20, 64, 116.4, 34, -1 }, // EAN-2 + /* 11*/ { BARCODE_EANX, 0, "12", 0, 50, 1, 20, 64, 100, -1, -1 }, // EAN-2 + /* 12*/ { BARCODE_UPCA, -1, "12345678901", 0, 50, 1, 95, 226, 116.4, 8, -1 }, + /* 13*/ { BARCODE_UPCA, 0, "12345678901", 0, 50, 1, 95, 226, 110, -1, -1 }, + /* 14*/ { BARCODE_UPCA_CHK, -1, "123456789012", 0, 50, 1, 95, 226, 116.4, 8, -1 }, + /* 15*/ { BARCODE_UPCA_CHK, 0, "123456789012", 0, 50, 1, 95, 226, 110, -1, -1 }, + /* 16*/ { BARCODE_UPCE, -1, "1234567", 0, 50, 1, 51, 134, 116.4, 8, -1 }, + /* 17*/ { BARCODE_UPCE, 0, "1234567", 0, 50, 1, 51, 134, 110, -1, -1 }, + /* 18*/ { BARCODE_UPCE_CHK, -1, "12345670", 0, 50, 1, 51, 134, 116.4, 8, -1 }, + /* 19*/ { BARCODE_UPCE_CHK, 0, "12345670", 0, 50, 1, 51, 134, 110, -1, -1 }, + /* 20*/ { BARCODE_EANX, -1, "123456789012+12", 0, 50, 1, 122, 276.0, 116.4, 12, 70 }, // EAN-13 + EAN-2 + /* 21*/ { BARCODE_EANX, 0, "123456789012+12", 0, 50, 1, 122, 276.0, 110, -1, -1 }, // EAN-13 + EAN-2 + /* 22*/ { BARCODE_ISBNX, -1, "9784567890120+12", 0, 50, 1, 122, 276.0, 116.4, 12, 70 }, // ISBN + EAN-2 + /* 23*/ { BARCODE_ISBNX, 0, "9784567890120+12", 0, 50, 1, 122, 276.0, 110, -1, -1 }, // ISBN + EAN-2 + /* 24*/ { BARCODE_EANX, -1, "123456789012+12345", 0, 50, 1, 149, 330.0, 116.4, 12, 70 }, // EAN-13 + EAN-5 + /* 25*/ { BARCODE_EANX, 0, "123456789012+12345", 0, 50, 1, 149, 330.0, 110, -1, -1 }, // EAN-13 + EAN-5 + /* 26*/ { BARCODE_ISBNX, -1, "9784567890120+12345", 0, 50, 1, 149, 330.0, 116.4, 12, 70 }, // ISBN + EAN-5 + /* 27*/ { BARCODE_ISBNX, 0, "9784567890120+12345", 0, 50, 1, 149, 330.0, 110, -1, -1 }, // ISBN + EAN-5 + /* 28*/ { BARCODE_EANX, -1, "1234567+12", 0, 50, 1, 94, 216.0, 116.4, 48, 114 }, // EAN-8 + EAN-2 + /* 29*/ { BARCODE_EANX, 0, "1234567+12", 0, 50, 1, 94, 216.0, 110, -1, -1 }, // EAN-8 + EAN-2 + /* 30*/ { BARCODE_EANX, -1, "1234567+12345", 0, 50, 1, 121, 270.0, 116.4, 48, 114 }, // EAN-8 + EAN-5 + /* 31*/ { BARCODE_EANX, 0, "1234567+12345", 0, 50, 1, 121, 270.0, 110, -1, -1 }, // EAN-8 + EAN-5 + /* 32*/ { BARCODE_UPCA, -1, "12345678901+12", 0, 50, 1, 124, 276, 116.4, 8, 72 }, + /* 33*/ { BARCODE_UPCA, 0, "12345678901+12", 0, 50, 1, 124, 276, 110, -1, -1 }, + /* 34*/ { BARCODE_UPCA, -1, "12345678901+12345", 0, 50, 1, 151, 330, 116.4, 8, 72 }, + /* 35*/ { BARCODE_UPCA, 0, "12345678901+12345", 0, 50, 1, 151, 330, 110, -1, -1 }, + /* 36*/ { BARCODE_UPCE, -1, "1234567+12", 0, 50, 1, 78, 184.0, 116.4, 8, 66 }, + /* 37*/ { BARCODE_UPCE, 0, "1234567+12", 0, 50, 1, 78, 184.0, 110, -1, -1 }, + /* 38*/ { BARCODE_UPCE, -1, "1234567+12345", 0, 50, 1, 105, 238.0, 116.4, 8, 66 }, + /* 39*/ { BARCODE_UPCE, 0, "1234567+12345", 0, 50, 1, 105, 238.0, 110, -1, -1 }, }; int data_size = sizeof(data) / sizeof(struct item); @@ -400,16 +402,29 @@ static void test_upcean_hrt(int index, int debug) { assert_zero(ret, "i:%d ZBarcode_Buffer_Vector(%d) ret %d != 0\n", i, data[i].symbology, ret); assert_nonnull(symbol->vector, "i:%d ZBarcode_Buffer_Vector(%d) vector NULL\n", i, data[i].symbology); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->height, data[i].expected_height); + assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%s) symbol->rows %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%s) symbol->width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width); + + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", + i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", + i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); + + if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) { + sprintf(symbol->outfile, "test_upcean_hrt%d.svg", i); + ZBarcode_Print(symbol, 0); + } + if (data[i].show_hrt) { assert_nonnull(symbol->vector->strings, "i:%d ZBarcode_Buffer_Vector(%d) vector->strings NULL\n", i, data[i].symbology); assert_equal(symbol->vector->strings->x, data[i].expected_string_x, - "i:%d (%s) symbol->vector->strings->x %f != %f\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->strings->x, data[i].expected_string_x); + "i:%d (%s) symbol->vector->strings->x %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->strings->x, data[i].expected_string_x); if (data[i].expected_addon_string_x != -1) { assert_nonnull(symbol->vector->strings->next, "i:%d ZBarcode_Buffer_Vector(%d) vector->strings->next NULL\n", i, data[i].symbology); assert_equal(symbol->vector->strings->next->x, data[i].expected_addon_string_x, - "i:%d (%s) symbol->vector->strings->next->x %f != %f\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->strings->next->x, data[i].expected_addon_string_x); + "i:%d (%s) symbol->vector->strings->next->x %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->strings->next->x, data[i].expected_addon_string_x); } } else { assert_null(symbol->vector->strings, "i:%d ZBarcode_Buffer_Vector(%d) vector->strings NULL\n", i, data[i].symbology); @@ -513,9 +528,9 @@ static void test_stacking(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_CODE128, -1, -1, -1, "A", "B", 50, 2, 46, 92, 118, -1, -1, -1 }, - /* 1*/ { BARCODE_CODE128, BARCODE_BIND, -1, -1, "A", "B", 50, 2, 46, 92, 118, 49, 0, 2 }, - /* 2*/ { BARCODE_CODE128, BARCODE_BIND, -1, 2, "A", "B", 50, 2, 46, 92, 118, 48, 0, 4 }, + /* 0*/ { BARCODE_CODE128, -1, -1, -1, "A", "B", 50, 2, 46, 92, 116.1, -1, -1, -1 }, + /* 1*/ { BARCODE_CODE128, BARCODE_BIND, -1, -1, "A", "B", 50, 2, 46, 92, 116.1, 49, 0, 2 }, + /* 2*/ { BARCODE_CODE128, BARCODE_BIND, -1, 2, "A", "B", 50, 2, 46, 92, 116.1, 48, 0, 4 }, }; int data_size = ARRAY_SIZE(data); @@ -545,7 +560,7 @@ static void test_stacking(int index, int debug) { assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); if (data[i].expected_separator_row != -1) { - if (index != -1) { + if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) { sprintf(symbol->outfile, "test_stacking_%d.svg", i); ZBarcode_Print(symbol, 0); } @@ -592,17 +607,17 @@ static void test_output_options(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_CODE128, -1, -1, -1, "A123", 0, 50, 1, 79, 158, 118, 0, 0, 4 }, - /* 1*/ { BARCODE_CODE128, -1, 2, -1, "A123", 0, 50, 1, 79, 158, 118, 0, 0, 4 }, - /* 2*/ { BARCODE_CODE128, -1, 2, BARCODE_BIND, "A123", 0, 50, 1, 79, 158, 126, 1, 0, 4 }, - /* 3*/ { BARCODE_CODE128, -1, 2, BARCODE_BIND, "A123", 0, 50, 1, 79, 158, 126, 0, 4, 4 }, - /* 4*/ { BARCODE_CODE128, -1, 2, BARCODE_BOX, "A123", 0, 50, 1, 79, 166, 126, 1, 4, 4 }, - /* 5*/ { BARCODE_CODE128, -1, 0, BARCODE_BIND, "A123", 0, 50, 1, 79, 158, 118, 0, 0, 4 }, - /* 6*/ { BARCODE_CODE128, -1, 0, BARCODE_BOX, "A123", 0, 50, 1, 79, 158, 118, 0, 4, 4 }, - /* 7*/ { BARCODE_CODE128, -1, -1, -1, "A123", 0, 50, 1, 79, 158, 118, 0, 6, 8 }, - /* 8*/ { BARCODE_CODE128, 3, 4, BARCODE_BIND, "A123", 0, 50, 1, 79, 170, 134, 1, 6, 8 }, - /* 9*/ { BARCODE_CODE128, 3, 4, BARCODE_BIND, "A123", 0, 50, 1, 79, 170, 134, 0, 14, 8 }, - /* 10*/ { BARCODE_CODE128, 3, 4, BARCODE_BOX, "A123", 0, 50, 1, 79, 186, 134, 1, 14, 8 }, + /* 0*/ { BARCODE_CODE128, -1, -1, -1, "A123", 0, 50, 1, 79, 158, 118.9, 0, 0, 4 }, + /* 1*/ { BARCODE_CODE128, -1, 2, -1, "A123", 0, 50, 1, 79, 158, 118.9, 0, 0, 4 }, + /* 2*/ { BARCODE_CODE128, -1, 2, BARCODE_BIND, "A123", 0, 50, 1, 79, 158, 126.9, 1, 0, 4 }, + /* 3*/ { BARCODE_CODE128, -1, 2, BARCODE_BIND, "A123", 0, 50, 1, 79, 158, 126.9, 0, 4, 4 }, + /* 4*/ { BARCODE_CODE128, -1, 2, BARCODE_BOX, "A123", 0, 50, 1, 79, 166, 126.9, 1, 4, 4 }, + /* 5*/ { BARCODE_CODE128, -1, 0, BARCODE_BIND, "A123", 0, 50, 1, 79, 158, 118.9, 0, 0, 4 }, + /* 6*/ { BARCODE_CODE128, -1, 0, BARCODE_BOX, "A123", 0, 50, 1, 79, 158, 118.9, 0, 4, 4 }, + /* 7*/ { BARCODE_CODE128, -1, -1, -1, "A123", 0, 50, 1, 79, 158, 118.9, 0, 6, 8 }, + /* 8*/ { BARCODE_CODE128, 3, 4, BARCODE_BIND, "A123", 0, 50, 1, 79, 170, 134.89999, 1, 6, 8 }, + /* 9*/ { BARCODE_CODE128, 3, 4, BARCODE_BIND, "A123", 0, 50, 1, 79, 170, 134.89999, 0, 14, 8 }, + /* 10*/ { BARCODE_CODE128, 3, 4, BARCODE_BOX, "A123", 0, 50, 1, 79, 186, 134.89999, 1, 14, 8 }, /* 11*/ { BARCODE_CODE128, -1, -1, BARCODE_DOTTY_MODE, "A123", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1, -1, -1, -1, -1 }, /* 12*/ { BARCODE_QRCODE, -1, -1, -1, "A123", 0, 21, 21, 21, 42, 42, 0, 0, 6 }, /* 13*/ { BARCODE_QRCODE, -1, 3, -1, "A123", 0, 21, 21, 21, 42, 42, 0, 0, 6 }, @@ -628,9 +643,9 @@ static void test_output_options(int index, int debug) { /* 33*/ { BARCODE_MAXICODE, 6, 5, BARCODE_BIND, "A123", 0, 165, 33, 30, 98, 92, 0, 108, 0 }, /* 34*/ { BARCODE_MAXICODE, 6, 5, BARCODE_BOX, "A123", 0, 165, 33, 30, 118, 92, 1, 108, 0 }, /* 35*/ { BARCODE_MAXICODE, -1, -1, BARCODE_DOTTY_MODE, "A123", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1, -1, -1, -1, -1 }, - /* 36*/ { BARCODE_ITF14, -1, -1, -1, "123", 0, 50, 1, 135, 330, 138, 1, 320, 0 }, - /* 37*/ { BARCODE_ITF14, -1, 0, -1, "123", 0, 50, 1, 135, 330, 138, 1, 320, 0 }, - /* 38*/ { BARCODE_ITF14, -1, 0, BARCODE_BOX, "123", 0, 50, 1, 135, 310, 118, 0, 300, 0 }, // No zero-width/height rectangles + /* 36*/ { BARCODE_ITF14, -1, -1, -1, "123", 0, 50, 1, 135, 330, 138.89999, 1, 320, 0 }, + /* 37*/ { BARCODE_ITF14, -1, 0, -1, "123", 0, 50, 1, 135, 330, 138.89999, 1, 320, 0 }, + /* 38*/ { BARCODE_ITF14, -1, 0, BARCODE_BOX, "123", 0, 50, 1, 135, 310, 118.9, 0, 300, 0 }, // No zero-width/height rectangles }; int data_size = ARRAY_SIZE(data); @@ -660,7 +675,7 @@ static void test_output_options(int index, int debug) { if (ret < 5) { assert_nonnull(symbol->vector, "i:%d ZBarcode_Buffer_Vector(%d) vector NULL\n", i, data[i].symbology); - if (index != -1) { + if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) { sprintf(symbol->outfile, "test_output_options_%d.svg", i); ZBarcode_Print(symbol, 0); } @@ -669,9 +684,9 @@ static void test_output_options(int index, int debug) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %f != %f\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); - assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %f != %f\n", + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); if (data[i].expected_set != -1) { @@ -734,7 +749,7 @@ static void test_noncomposite_string_x(int index, int debug) { assert_equal(symbol->width, data[i].expected_width, "i:%d (%s) symbol->width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width); assert_nonnull(symbol->vector->strings, "i:%d ZBarcode_Buffer_Vector(%d) vector->strings NULL\n", i, data[i].symbology); assert_equal(symbol->vector->strings->x, data[i].expected_string_x, - "i:%d (%s) symbol->vector->strings->x %f != %f\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->strings->x, data[i].expected_string_x); + "i:%d (%s) symbol->vector->strings->x %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->strings->x, data[i].expected_string_x); ZBarcode_Delete(symbol); } @@ -760,10 +775,10 @@ static void test_upcean_whitespace_width(int index, int debug) { }; // s/\/\*[ 0-9]*\*\//\=printf("\/*%2d*\/", line(".") - line("'<")) struct item data[] = { - /* 0*/ { BARCODE_UPCA, "12345678904+12345", 0, 151, 330.0, 5, 16.0 }, - /* 1*/ { BARCODE_UPCA, "12345678904+12345", 11, 151, 330.0 + 4 * 11, 5, 16.0 }, - /* 2*/ { BARCODE_UPCE, "1234567+12", 0, 78, 184.0, 4, 16.0 }, - /* 3*/ { BARCODE_UPCE, "1234567+12", 8, 78, 184.0 + 4 * 8, 4, 16.0 }, // Note: change from previous behaviour where if whitespace < 10 then set to 10 + /* 0*/ { BARCODE_UPCA, "12345678904+12345", 0, 151, 330.0, 5, 15.0 }, + /* 1*/ { BARCODE_UPCA, "12345678904+12345", 11, 151, 330.0 + 4 * 11, 5, 15.0 }, + /* 2*/ { BARCODE_UPCE, "1234567+12", 0, 78, 184.0, 4, 15.0 }, + /* 3*/ { BARCODE_UPCE, "1234567+12", 8, 78, 184.0 + 4 * 8, 4, 15.0 }, // Note: change from previous behaviour where if whitespace < 10 then set to 10 }; int data_size = sizeof(data) / sizeof(struct item); @@ -791,8 +806,13 @@ static void test_upcean_whitespace_width(int index, int debug) { assert_zero(ret, "i:%d ZBarcode_Buffer_Vector(%d) ret %d != 0\n", i, data[i].symbology, ret); assert_nonnull(symbol->vector, "i:%d ZBarcode_Buffer_Vector(%d) vector NULL\n", i, data[i].symbology); + if (index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) { + sprintf(symbol->outfile, "test_upcean_whitespace_width_%d.svg", i); + ZBarcode_Print(symbol, 0); + } + assert_equal(symbol->width, data[i].expected_width, "i:%d (%s) symbol->width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %f != %f\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); assert_nonnull(symbol->vector->strings, "i:%d ZBarcode_Buffer_Vector(%d) vector->strings NULL\n", i, data[i].symbology); @@ -801,7 +821,7 @@ static void test_upcean_whitespace_width(int index, int debug) { string = string->next; } assert_equal(string_cnt, data[i].expected_string_cnt, "i:%d (%s) string_cnt %d != %d\n", i, testUtilBarcodeName(data[i].symbology), string_cnt, data[i].expected_string_cnt); - assert_equal(string->y, data[i].expected_string_y, "i:%d (%s) string->y %f != %f\n", i, testUtilBarcodeName(data[i].symbology), string->y, data[i].expected_string_y); + assert_equal(string->y, data[i].expected_string_y, "i:%d (%s) string->y %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), string->y, data[i].expected_string_y); ZBarcode_Delete(symbol); } diff --git a/backend/tests/testcommon.c b/backend/tests/testcommon.c index 002c00a6..208edf35 100644 --- a/backend/tests/testcommon.c +++ b/backend/tests/testcommon.c @@ -219,17 +219,17 @@ void testRun(int argc, char *argv[], testFunction funcs[], int funcs_size) { } if (func && !ran) { - fprintf(stderr, "testRun: unknown -f func arg\n"); + fprintf(stderr, "testRun: unknown -f func arg '%s'\n", func); } } -char *testUtilBarcodeName(int symbology) { +const char *testUtilBarcodeName(int symbology) { struct item { - char *name; + const char *name; int define; int val; }; - struct item data[] = { + static const struct item data[] = { { "", -1, 0 }, { "BARCODE_CODE11", BARCODE_CODE11, 1 }, { "BARCODE_C25STANDARD", BARCODE_C25STANDARD, 2 }, @@ -377,7 +377,7 @@ char *testUtilBarcodeName(int symbology) { { "BARCODE_ULTRA", BARCODE_ULTRA, 144 }, { "BARCODE_RMQR", BARCODE_RMQR, 145 }, }; - int data_size = sizeof(data) / sizeof(struct item); + static const int data_size = sizeof(data) / sizeof(struct item); if (symbology < 0 || symbology >= data_size) { return ""; @@ -417,18 +417,18 @@ int testUtilSetSymbol(struct zint_symbol *symbol, int symbology, int input_mode, return length; } -char *testUtilErrorName(int error_number) { +const char *testUtilErrorName(int error_number) { struct item { - char *name; + const char *name; int define; int val; }; - struct item data[] = { + static const struct item data[] = { { "0", 0, 0 }, { "", -1, 1 }, { "ZINT_WARN_INVALID_OPTION", ZINT_WARN_INVALID_OPTION, 2 }, { "ZINT_WARN_USES_ECI", ZINT_WARN_USES_ECI, 3 }, - { "", -1, 4 }, + { "ZINT_WARN_NONCOMPLIANT", ZINT_WARN_NONCOMPLIANT, 4 }, { "ZINT_ERROR_TOO_LONG", ZINT_ERROR_TOO_LONG, 5 }, { "ZINT_ERROR_INVALID_DATA", ZINT_ERROR_INVALID_DATA, 6 }, { "ZINT_ERROR_INVALID_CHECK", ZINT_ERROR_INVALID_CHECK, 7 }, @@ -437,7 +437,7 @@ char *testUtilErrorName(int error_number) { { "ZINT_ERROR_FILE_ACCESS", ZINT_ERROR_FILE_ACCESS, 10 }, { "ZINT_ERROR_MEMORY", ZINT_ERROR_MEMORY, 11 }, }; - int data_size = sizeof(data) / sizeof(struct item); + static const int data_size = sizeof(data) / sizeof(struct item); if (error_number < 0 || error_number >= data_size) { return ""; @@ -449,13 +449,13 @@ char *testUtilErrorName(int error_number) { return data[error_number].name; } -char *testUtilInputModeName(int input_mode) { +const char *testUtilInputModeName(int input_mode) { struct item { - char *name; + const char *name; int define; int val; }; - struct item data[] = { + static const struct item data[] = { { "DATA_MODE", DATA_MODE, 0 }, { "UNICODE_MODE", UNICODE_MODE, 1 }, { "GS1_MODE", GS1_MODE, 2 }, @@ -468,7 +468,7 @@ char *testUtilInputModeName(int input_mode) { { "UNICODE_MODE | ESCAPE_MODE", UNICODE_MODE | ESCAPE_MODE, 9 }, { "GS1_MODE | ESCAPE_MODE", GS1_MODE | ESCAPE_MODE, 10 }, }; - int data_size = sizeof(data) / sizeof(struct item); + static const int data_size = sizeof(data) / sizeof(struct item); if (input_mode < 0 || input_mode >= data_size) { return input_mode == -1 ? "-1" : ""; @@ -480,7 +480,7 @@ char *testUtilInputModeName(int input_mode) { return data[input_mode].name; } -char *testUtilOption3Name(int option_3) { +const char *testUtilOption3Name(int option_3) { switch (option_3) { case DM_SQUARE: return "DM_SQUARE"; case DM_DMRE: return "DM_DMRE"; @@ -494,15 +494,15 @@ char *testUtilOption3Name(int option_3) { return option_3 ? "-1" : "0"; } -char *testUtilOutputOptionsName(int output_options) { +const char *testUtilOutputOptionsName(int output_options) { static char buf[512]; struct item { - char *name; + const char *name; int define; int val; }; - struct item data[] = { + static const struct item data[] = { { "BARCODE_NO_ASCII", BARCODE_NO_ASCII, 1 }, { "BARCODE_BIND", BARCODE_BIND, 2 }, { "BARCODE_BOX", BARCODE_BOX, 4 }, @@ -515,7 +515,7 @@ char *testUtilOutputOptionsName(int output_options) { { "GS1_GS_SEPARATOR", GS1_GS_SEPARATOR, 512 }, { "OUT_BUFFER_INTERMEDIATE", OUT_BUFFER_INTERMEDIATE, 1024 }, }; - int data_size = ARRAY_SIZE(data); + static int const data_size = ARRAY_SIZE(data); int set = 0; int i; @@ -1460,9 +1460,9 @@ int testUtilVerifyGhostscript(char *filename, int debug) { return system(buf); } -static char *testUtilBwippName(int symbology, int option_1, int option_2, int option_3, int *linear_row_height, int *gs1_cvt) { +static const char *testUtilBwippName(int symbology, int option_1, int option_2, int option_3, int *linear_row_height, int *gs1_cvt) { struct item { - char *name; + const char *name; int define; int val; int can_option_1; @@ -1471,7 +1471,7 @@ static char *testUtilBwippName(int symbology, int option_1, int option_2, int op int linear_row_height; int gs1_cvt; }; - struct item data[] = { + static const struct item data[] = { { "", -1, 0, 0, 0, 0, 0, 0, }, { "code11", BARCODE_CODE11, 1, 0, 1, 0, 0, 0, }, { "matrix2of5", BARCODE_C25STANDARD, 2, 0, 0, 0, 0, 0, }, @@ -1490,13 +1490,13 @@ static char *testUtilBwippName(int symbology, int option_1, int option_2, int op { "", -1, 15, 0, 0, 0, 0, 0, }, { "gs1-128", BARCODE_GS1_128, 16, 0, 0, 0, 0, 1 /*gs1_cvt*/, }, { "", -1, 17, 0, 0, 0, 0, 0, }, - { "rationalizedCodabar", BARCODE_CODABAR, 18, 0, 0, 0, 0, 0, }, + { "rationalizedCodabar", BARCODE_CODABAR, 18, 0, 1, 0, 0, 0, }, { "", -1, 19, 0, 0, 0, 0, 0, }, { "code128", BARCODE_CODE128, 20, 0, 0, 0, 0, 0, }, { "leitcode", BARCODE_DPLEIT, 21, 0, 0, 0, 0, 0, }, { "identcode", BARCODE_DPIDENT, 22, 0, 0, 0, 0, 0, }, - { "code16k", BARCODE_CODE16K, 23, 0, 0, 0, 0, 0, }, - { "code49", BARCODE_CODE49, 24, 0, 0, 0, 0, 0, }, + { "code16k", BARCODE_CODE16K, 23, 0, 0, 0, 8 /*linear_row_height*/, 0, }, + { "code49", BARCODE_CODE49, 24, 0, 0, 0, 8 /*linear_row_height*/, 0, }, { "code93", BARCODE_CODE93, 25, 0, 0, 0, 0, 0, }, { "", -1, 26, 0, 0, 0, 0, 0, }, { "", -1, 27, 0, 0, 0, 0, 0, }, @@ -1523,7 +1523,7 @@ static char *testUtilBwippName(int symbology, int option_1, int option_2, int op { "", -1, 48, 0, 0, 0, 0, 0, }, { "symbol", BARCODE_FIM, 49, 0, 0, 0, 0, 0, }, { "code39", BARCODE_LOGMARS, 50, 0, 1, 0, 0, 0, }, - { "pharmacode", BARCODE_PHARMA, 51, 0, 0, 0, 0, 0, }, + { "pharmacode", BARCODE_PHARMA, 51, 0, 0, 0, 1 /*linear_row_height*/, 0, }, { "pzn", BARCODE_PZN, 52, 0, 0, 0, 0, 0, }, { "pharmacode2", BARCODE_PHARMA_TWO, 53, 0, 0, 0, 0, 0, }, { "", -1, 54, 0, 0, 0, 0, 0, }, @@ -1546,14 +1546,14 @@ static char *testUtilBwippName(int symbology, int option_1, int option_2, int op { "datamatrix", BARCODE_DATAMATRIX, 71, 0, 0, 0, 0, 0, }, { "ean14", BARCODE_EAN14, 72, 0, 0, 0, 0, 1 /*gs1_cvt*/, }, { "code39", BARCODE_VIN, 73, 0, 0, 0, 0, 0, }, - { "codablockf", BARCODE_CODABLOCKF, 74, 1, 1, 0, 0, 0, }, + { "codablockf", BARCODE_CODABLOCKF, 74, 1, 1, 0, 10 /*linear_row_height*/, 0, }, { "sscc18", BARCODE_NVE18, 75, 0, 0, 0, 0, 1 /*gs1_cvt*/, }, { "japanpost", BARCODE_JAPANPOST, 76, 0, 0, 0, 0, 0, }, { "", BARCODE_KOREAPOST, 77, 0, 0, 0, 0, 0, }, { "", -1, 78, 0, 0, 0, 0, 0, }, { "databarstacked", BARCODE_DBAR_STK, 79, 0, 0, 0, 0, 1 /*gs1_cvt*/, }, - { "databarstackedomni", BARCODE_DBAR_OMNSTK, 80, 0, 0, 0, 0, 1, }, - { "databarexpandedstacked", BARCODE_DBAR_EXPSTK, 81, 0, 1, 0, 0, 1, }, + { "databarstackedomni", BARCODE_DBAR_OMNSTK, 80, 0, 0, 0, 33 /*linear_row_height*/, 1, }, + { "databarexpandedstacked", BARCODE_DBAR_EXPSTK, 81, 0, 1, 0, 34 /*linear_row_height*/, 1, }, { "planet", BARCODE_PLANET, 82, 0, 0, 0, 0, 0, }, { "", -1, 83, 0, 0, 0, 0, 0, }, { "micropdf417", BARCODE_MICROPDF417, 84, 0, 1, 0, 0, 0, }, @@ -1582,7 +1582,7 @@ static char *testUtilBwippName(int symbology, int option_1, int option_2, int op { "", -1, 107, 0, 0, 0, 0, 0, }, { "hibcmicropdf417", BARCODE_HIBC_MICPDF, 108, 0, 1, 0, 0, 0, }, { "", -1, 109, 0, 0, 0, 0, 0, }, - { "hibccodablockf", BARCODE_HIBC_BLOCKF, 110, 1, 1, 0, 0, 0, }, + { "hibccodablockf", BARCODE_HIBC_BLOCKF, 110, 1, 1, 0, 10 /*linear_row_height*/, 0, }, { "", -1, 111, 0, 0, 0, 0, 0, }, { "hibcazteccode", BARCODE_HIBC_AZTEC, 112, 0, 0, 0, 0, 0, }, { "", -1, 113, 0, 0, 0, 0, 0, }, @@ -1593,7 +1593,7 @@ static char *testUtilBwippName(int symbology, int option_1, int option_2, int op { "", -1, 118, 0, 0, 0, 0, 0, }, { "", -1, 119, 0, 0, 0, 0, 0, }, { "", -1, 120, 0, 0, 0, 0, 0, }, - { "mailmark", BARCODE_MAILMARK, 121, 0, 0, 0, 0, 0, }, + { "", BARCODE_MAILMARK, 121, 0, 0, 0, 0, 0, }, /* Note BWIPP mailmark is Data Matrix variant */ { "", -1, 122, 0, 0, 0, 0, 0, }, { "", -1, 123, 0, 0, 0, 0, 0, }, { "", -1, 124, 0, 0, 0, 0, 0, }, @@ -1605,13 +1605,13 @@ static char *testUtilBwippName(int symbology, int option_1, int option_2, int op { "ean13composite", BARCODE_EANX_CC, 130, 1, 1, 0, 72 /*linear_row_height*/, 1 /*gs1_cvt*/, }, { "gs1-128composite", BARCODE_GS1_128_CC, 131, 1, 0, 0, 36, 1, }, { "databaromnicomposite", BARCODE_DBAR_OMN_CC, 132, 1, 0, 0, 33, 1, }, - { "databarlimitedcomposite", BARCODE_DBAR_LTD_CC, 133, 1, 0, 0, 0, 1, }, - { "databarexpandedcomposite", BARCODE_DBAR_EXP_CC, 134, 1, 1, 0, 0, 1, }, + { "databarlimitedcomposite", BARCODE_DBAR_LTD_CC, 133, 1, 0, 0, 10 /*linear_row_height*/, 1, }, + { "databarexpandedcomposite", BARCODE_DBAR_EXP_CC, 134, 1, 1, 0, 34 /*linear_row_height*/, 1, }, { "upcacomposite", BARCODE_UPCA_CC, 135, 1, 1, 0, 72, 1, }, { "upcecomposite", BARCODE_UPCE_CC, 136, 1, 1, 0, 72, 1, }, { "databarstackedcomposite", BARCODE_DBAR_STK_CC, 137, 1, 0, 0, 0, 1, }, - { "databarstackedomnicomposite", BARCODE_DBAR_OMNSTK_CC, 138, 1, 0, 0, 0, 1, }, - { "databarexpandedstackedcomposite", BARCODE_DBAR_EXPSTK_CC, 139, 1, 1, 0, 0, 1, }, + { "databarstackedomnicomposite", BARCODE_DBAR_OMNSTK_CC, 138, 1, 0, 0, 33 /*linear_row_height*/, 1, }, + { "databarexpandedstackedcomposite", BARCODE_DBAR_EXPSTK_CC, 139, 1, 1, 0, 34 /*linear_row_height*/, 1, }, { "channelcode", BARCODE_CHANNEL, 140, 0, 0, 0, 0, 0, }, { "codeone", BARCODE_CODEONE, 141, 0, 0, 0, 0, 0, }, { "", BARCODE_GRIDMATRIX, 142, 0, 0, 0, 0, 0, }, @@ -1619,7 +1619,7 @@ static char *testUtilBwippName(int symbology, int option_1, int option_2, int op { "ultracode", BARCODE_ULTRA, 144, 0, 0, 0, 0, 0, }, { "rectangularmicroqrcode", BARCODE_RMQR, 145, 0, 0, 0, 0, 0, }, }; - int data_size = ARRAY_SIZE(data); + static const int data_size = ARRAY_SIZE(data); if (symbology < 0 || symbology >= data_size) { return NULL; @@ -1736,7 +1736,7 @@ static void testUtilISBNHyphenate(char *bwipp_data, int addon_posn) { #define GS_INITIAL_LEN 35 /* Length of cmd up to -q */ -int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, int option_3, const char *data, int length, const char *primary, char *buffer, int buffer_size) { +int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int option_2, int option_3, const char *data, int length, const char *primary, char *buffer, int buffer_size) { const char *cmd_fmt = "gs -dNOPAUSE -dBATCH -dNODISPLAY -q -sb=%s -sd='%s' ../tools/bwipp_dump.ps"; const char *cmd_opts_fmt = "gs -dNOPAUSE -dBATCH -dNODISPLAY -q -sb=%s -sd='%s' -so='%s' ../tools/bwipp_dump.ps"; const char *cmd_fmt2 = "gs -dNOPAUSE -dBATCH -dNODISPLAY -q -sb=%s -sd='%.2043s' -sd2='%s' ../tools/bwipp_dump.ps"; // If data > 2K @@ -1748,7 +1748,7 @@ int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, int max_data_len = 4 + primary_len + 1 + 1 + data_len * 4 + 32; /* 4 AI prefix + primary + '|' + leading zero + escaped data + fudge */ char cmd[max_data_len + 1024]; - char *bwipp_barcode = NULL; + const char *bwipp_barcode = NULL; char *bwipp_opts = NULL; char bwipp_data[max_data_len + 1]; char bwipp_opts_buf[512]; @@ -1764,6 +1764,7 @@ int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, int r, h; int parse; + int composite = is_composite(symbology); int upcean = is_extendable(symbology); int upca = symbology == BARCODE_UPCA || symbology == BARCODE_UPCA_CHK || symbology == BARCODE_UPCA_CC; int addon_posn; @@ -1772,20 +1773,25 @@ int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, bwipp_barcode = testUtilBwippName(symbology, option_1, option_2, option_3, &linear_row_height, &gs1_cvt); if (!bwipp_barcode) { - fprintf(stderr, "testUtilBwipp: no mapping for %s, option_1 %d, option_2 %d, option_3 %d\n", testUtilBarcodeName(symbology), option_1, option_2, option_3); + fprintf(stderr, "i:%d testUtilBwipp: no mapping for %s, option_1 %d, option_2 %d, option_3 %d\n", index, testUtilBarcodeName(symbology), option_1, option_2, option_3); return -1; } for (r = 0; r < symbol->rows; r++) { - bwipp_row_height[r] = symbol->row_height[r]; + bwipp_row_height[r] = symbol->row_height[r] ? symbol->row_height[r] : linear_row_height; + //fprintf(stderr, "bwipp_row_height[%d] %d, symbol->row_height[%d] %d\n", r, bwipp_row_height[r], r, symbol->row_height[r]); } - if (linear_row_height) { - bwipp_row_height[symbol->rows - 1] = linear_row_height; + if (symbology == BARCODE_DBAR_EXP) { + bwipp_row_height[symbol->rows - 1] = 1; + } else if (symbology == BARCODE_DBAR_OMN_CC) { + bwipp_row_height[symbol->rows - 1] = 33; + } else if (symbology == BARCODE_GS1_128_CC) { + bwipp_row_height[symbol->rows - 1] = 36; } if (is_composite(symbology)) { if (!primary) { - fprintf(stderr, "testUtilBwipp: no primary data given %s\n", testUtilBarcodeName(symbology)); + fprintf(stderr, "i:%d testUtilBwipp: no primary data given %s\n", index, testUtilBarcodeName(symbology)); return -1; } if (*primary != '[' && !upcean) { @@ -1804,6 +1810,7 @@ int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%saddongap=%d", strlen(bwipp_opts_buf) ? " " : "", option_2 > 0 ? option_2 : upca ? 9 : 7); bwipp_opts = bwipp_opts_buf; } + bwipp_row_height[symbol->rows - 1] = 72; } if (option_1 > 0) { @@ -1873,7 +1880,7 @@ int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%scolumns=%d", strlen(bwipp_opts_buf) ? " " : "", (symbol->width - 57) / 11); } bwipp_opts = bwipp_opts_buf; - } else if (symbology == BARCODE_CODE11 || symbology == BARCODE_CODE39 || symbology == BARCODE_EXCODE39 || symbology == BARCODE_LOGMARS) { + } else if (symbology == BARCODE_CODE11 || symbology == BARCODE_CODE39 || symbology == BARCODE_EXCODE39 || symbology == BARCODE_LOGMARS || symbology == BARCODE_CODABAR) { if (option_2 > 0) { if (option_2 == 1) { sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%sincludecheck", strlen(bwipp_opts_buf) ? " " : ""); @@ -1891,12 +1898,49 @@ int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%scolumns=%d", strlen(bwipp_opts_buf) ? " " : "", option_2); bwipp_opts = bwipp_opts_buf; } + } else if (symbology == BARCODE_POSTNET || symbology == BARCODE_PLANET || symbology == BARCODE_RM4SCC || symbology == BARCODE_JAPANPOST || symbology == BARCODE_KIX + || symbology == BARCODE_DAFT || symbology == BARCODE_USPS_IMAIL || symbology == BARCODE_AUSPOST || symbology == BARCODE_PHARMA_TWO) { + for (r = 0; r < symbol->rows; r++) bwipp_row_height[r] = 1; /* Zap */ + if (symbology == BARCODE_KIX) { + to_upper(bwipp_data); + } else if (symbology == BARCODE_USPS_IMAIL) { + char *dash = strchr(bwipp_data, '-'); + if (dash) { + memmove(dash, dash + 1, strlen(dash)); + } + } else if (symbology == BARCODE_AUSPOST) { + const char *prefix; + if (data_len == 8) { + prefix = "11"; + } else if (data_len == 13 || data_len == 16) { + prefix = "59"; + if (data_len == 16) { + sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%scustinfoenc=numeric", strlen(bwipp_opts_buf) ? " " : ""); + bwipp_opts = bwipp_opts_buf; + } + } else { + prefix = "62"; + if (data_len == 23) { + sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%scustinfoenc=numeric", strlen(bwipp_opts_buf) ? " " : ""); + bwipp_opts = bwipp_opts_buf; + } + } + memmove(bwipp_data + 2, bwipp_data, data_len + 1); + memmove(bwipp_data, prefix, 2); + } + } else if (symbology == BARCODE_FIM) { + strcpy(bwipp_data, "fima"); + bwipp_data[3] = data[0] - 'A' + 'a'; + } else if (symbology == BARCODE_CODE16K || symbology == BARCODE_CODE49) { + for (r = 0; r < symbol->rows; r++) bwipp_row_height[r] = 8; /* Change from 10 */ + sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%ssepheight=0", strlen(bwipp_opts_buf) ? " " : ""); + bwipp_opts = bwipp_opts_buf; } } } if ((option_1 != -1 || option_2 != -1 || option_3 != -1) && !bwipp_opts) { - fprintf(stderr, "testUtilBwipp: no mapping option_1 %d, option_2 %d, option_3 %d for symbology %s\n", option_1, option_2, option_3, testUtilBarcodeName(symbology)); + fprintf(stderr, "i:%d testUtilBwipp: no mapping option_1 %d, option_2 %d, option_3 %d for symbology %s\n", index, option_1, option_2, option_3, testUtilBarcodeName(symbology)); return -1; } @@ -1921,7 +1965,8 @@ int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, memmove(cmd + GS_INITIAL_LEN + sizeof(adj), cmd + GS_INITIAL_LEN, strlen(cmd) + 1 - GS_INITIAL_LEN); memcpy(cmd + GS_INITIAL_LEN, adj, sizeof(adj)); } - if (symbology == BARCODE_CODE11 || symbology == BARCODE_CODE39 || symbology == BARCODE_EXCODE39 || symbology == BARCODE_PZN || symbology == BARCODE_VIN) { + if (symbology == BARCODE_CODE11 || symbology == BARCODE_CODE39 || symbology == BARCODE_EXCODE39 || symbology == BARCODE_CODABAR + || symbology == BARCODE_PHARMA || symbology == BARCODE_PZN || symbology == BARCODE_CODE32 || symbology == BARCODE_VIN) { /* Ratio 3 width bar/space -> 2 width */ char adj[8] = " -sr=0.6"; memmove(cmd + GS_INITIAL_LEN + sizeof(adj), cmd + GS_INITIAL_LEN, strlen(cmd) + 1 - GS_INITIAL_LEN); @@ -1933,9 +1978,16 @@ int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, memmove(cmd + GS_INITIAL_LEN + sizeof(adj), cmd + GS_INITIAL_LEN, strlen(cmd) + 1 - GS_INITIAL_LEN); memcpy(cmd + GS_INITIAL_LEN, adj, sizeof(adj)); } + if (symbology == BARCODE_FIM) { + /* Ratio 2 width bar/space -> 1 width */ + char adj[8] = " -sr=0.5"; + memmove(cmd + GS_INITIAL_LEN + sizeof(adj), cmd + GS_INITIAL_LEN, strlen(cmd) + 1 - GS_INITIAL_LEN); + memcpy(cmd + GS_INITIAL_LEN, adj, sizeof(adj)); + } if (symbology == BARCODE_CODE11 || symbology == BARCODE_CODE39 || symbology == BARCODE_EXCODE39 || symbology == BARCODE_HIBC_39 - || symbology == BARCODE_LOGMARS || symbology == BARCODE_PZN || symbology == BARCODE_VIN - || symbology == BARCODE_C25INTER || symbology == BARCODE_DPLEIT || symbology == BARCODE_DPIDENT || symbology == BARCODE_ITF14) { + || symbology == BARCODE_LOGMARS || symbology == BARCODE_PHARMA || symbology == BARCODE_PZN || symbology == BARCODE_CODE32 || symbology == BARCODE_VIN + || symbology == BARCODE_C25INTER || symbology == BARCODE_DPLEIT || symbology == BARCODE_DPIDENT || symbology == BARCODE_ITF14 + || symbology == BARCODE_PHARMA_TWO) { /* End sbs loop on bar */ char adj[6] = " -selb"; memmove(cmd + GS_INITIAL_LEN + sizeof(adj), cmd + GS_INITIAL_LEN, strlen(cmd) + 1 - GS_INITIAL_LEN); @@ -1947,26 +1999,38 @@ int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, memmove(cmd + GS_INITIAL_LEN + sizeof(adj), cmd + GS_INITIAL_LEN, strlen(cmd) + 1 - GS_INITIAL_LEN); memcpy(cmd + GS_INITIAL_LEN, adj, sizeof(adj)); } + if (symbology == BARCODE_POSTNET || symbology == BARCODE_PLANET || symbology == BARCODE_RM4SCC || symbology == BARCODE_JAPANPOST || symbology == BARCODE_KIX + || symbology == BARCODE_DAFT || symbology == BARCODE_USPS_IMAIL || symbology == BARCODE_AUSPOST || symbology == BARCODE_PHARMA_TWO) { + /* Emulate rows with BWIPP heights. */ + char adj[5] = " -shs"; + memmove(cmd + GS_INITIAL_LEN + sizeof(adj), cmd + GS_INITIAL_LEN, strlen(cmd) + 1 - GS_INITIAL_LEN); + memcpy(cmd + GS_INITIAL_LEN, adj, sizeof(adj)); + } + if (symbology == BARCODE_CODE16K || symbology == BARCODE_CODE49) { + char adj[15] = " -sxs=10 -sxe=1"; /* Strip first 10 and last zero */ + memmove(cmd + GS_INITIAL_LEN + sizeof(adj), cmd + GS_INITIAL_LEN, strlen(cmd) + 1 - GS_INITIAL_LEN); + memcpy(cmd + GS_INITIAL_LEN, adj, sizeof(adj)); + } if (symbol->debug & ZINT_DEBUG_TEST_PRINT) { - printf("testUtilBwipp: cmd %s\n", cmd); + printf("i:%d testUtilBwipp: cmd %s\n", index, cmd); } fp = popen(cmd, "r"); if (!fp) { - fprintf(stderr, "testUtilBwipp: failed to run '%s'\n", cmd); + fprintf(stderr, "i:%d testUtilBwipp: failed to run '%s'\n", index, cmd); return -1; } for (r = 0; r < symbol->rows; r++) { if (b + symbol->width > be) { - fprintf(stderr, "testUtilBwipp: row %d, width %d, row width iteration overrun (%s)\n", r, symbol->width, cmd); + fprintf(stderr, "i:%d testUtilBwipp: row %d, width %d, row width iteration overrun (%s)\n", index, r, symbol->width, cmd); pclose(fp); return -1; } cnt = fread(b, 1, symbol->width, fp); if (cnt != symbol->width) { - fprintf(stderr, "testUtilBwipp: failed to read symbol->width %d bytes, cnt %d (%s)\n", symbol->width, cnt, cmd); + fprintf(stderr, "i:%d testUtilBwipp: failed to read symbol->width %d bytes, cnt %d (%s)\n", index, symbol->width, cnt, cmd); pclose(fp); return -1; } @@ -1974,7 +2038,8 @@ int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, for (h = bwipp_row_height[r]; h > 1; h--) { /* Ignore row copies if any */ cnt = fread(b, 1, symbol->width, fp); if (cnt != symbol->width) { - fprintf(stderr, "testUtilBwipp: failed to read/ignore symbol->width %d bytes, cnt %d (%s)\n", symbol->width, cnt, cmd); + fprintf(stderr, "i:%d testUtilBwipp: failed to read/ignore symbol->width %d bytes, cnt %d, h %d, bwipp_row_height[%d] %d, symbol->row_height[%d] %d (%s)\n", + index, symbol->width, cnt, h, r, bwipp_row_height[r], r, symbol->row_height[r], cmd); pclose(fp); return -1; } @@ -1983,7 +2048,7 @@ int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, *b = '\0'; if (fgetc(fp) != EOF) { - fprintf(stderr, "testUtilBwipp: failed to read full stream (%s)\n", cmd); + fprintf(stderr, "i:%d testUtilBwipp: failed to read full stream (%s)\n", index, cmd); pclose(fp); return -1; } diff --git a/backend/tests/testcommon.h b/backend/tests/testcommon.h index 75678f5b..505680c1 100644 --- a/backend/tests/testcommon.h +++ b/backend/tests/testcommon.h @@ -77,11 +77,11 @@ void testRun(int argc, char *argv[], testFunction funcs[], int funcs_size); extern void vector_free(struct zint_symbol *symbol); /* Free vector structures */ int testUtilSetSymbol(struct zint_symbol *symbol, int symbology, int input_mode, int eci, int option_1, int option_2, int option_3, int output_options, char *data, int length, int debug); -char *testUtilBarcodeName(int symbology); -char *testUtilErrorName(int error_number); -char *testUtilInputModeName(int input_mode); -char *testUtilOption3Name(int option_3); -char *testUtilOutputOptionsName(int output_options); +const char *testUtilBarcodeName(int symbology); +const char *testUtilErrorName(int error_number); +const char *testUtilInputModeName(int input_mode); +const char *testUtilOption3Name(int option_3); +const char *testUtilOutputOptionsName(int output_options); int testUtilDAFTConvert(const struct zint_symbol *symbol, char *buffer, int buffer_size); int testUtilIsValidUTF8(const unsigned char str[], const size_t length); char *testUtilEscape(char *buffer, int length, char *escaped, int escaped_size); @@ -111,7 +111,7 @@ int testUtilVerifyInkscape(char *filename, int debug); int testUtilHaveGhostscript(); int testUtilVerifyGhostscript(char *filename, int debug); int testUtilCanBwipp(int symbology, int option_1, int option_2, int option_3, int debug); -int testUtilBwipp(const struct zint_symbol *symbol, int option_1, int option_2, int option_3, const char *data, int length, const char *primary, char *buffer, int buffer_size); +int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int option_2, int option_3, const char *data, int length, const char *primary, char *buffer, int buffer_size); int testUtilBwippCmp(const struct zint_symbol *symbol, char *msg, const char *bwipp_buf, const char *expected); int testUtilBwippCmpRow(const struct zint_symbol *symbol, int row, char *msg, const char *bwipp_buf, const char *expected); diff --git a/backend/tests/tools/bwipp_dump-barcode.ps.diff b/backend/tests/tools/bwipp_dump-barcode.ps.diff index 982b46d6..fe2a392c 100644 --- a/backend/tests/tools/bwipp_dump-barcode.ps.diff +++ b/backend/tests/tools/bwipp_dump-barcode.ps.diff @@ -1,5 +1,5 @@ ---- ../../../../postscriptbarcode/build/monolithic/barcode.ps 2020-09-11 07:39:13.775630088 +0100 -+++ ../tools/bwipp_dump.ps 2020-09-11 07:57:38.915196229 +0100 +--- ../../../../postscriptbarcode/build/monolithic/barcode.ps 2020-09-18 02:41:06.166708679 +0100 ++++ ../tools/bwipp_dump.ps 2020-09-18 03:56:06.144846176 +0100 @@ -29,6 +29,8 @@ % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. @@ -9,7 +9,7 @@ % --BEGIN TEMPLATE-- % --BEGIN RESOURCE preamble-- -@@ -25344,34 +25346,80 @@ +@@ -25403,34 +25405,80 @@ pop } ifelse @@ -109,7 +109,7 @@ end -@@ -25430,7 +25478,7 @@ +@@ -25489,7 +25537,7 @@ pop } ifelse @@ -118,7 +118,7 @@ % Get the result of encoding with ean8 and gs1-cc options (lintype) (ean8) put -@@ -25438,29 +25486,75 @@ +@@ -25497,29 +25545,75 @@ options (dontdraw) true put % Plot the linear part @@ -214,7 +214,7 @@ end -@@ -25519,34 +25613,80 @@ +@@ -25578,34 +25672,80 @@ pop } ifelse @@ -314,7 +314,7 @@ end -@@ -25620,34 +25760,80 @@ +@@ -25679,34 +25819,80 @@ /opt options >> def @@ -414,7 +414,7 @@ end -@@ -25706,7 +25892,7 @@ +@@ -25765,7 +25951,7 @@ pop } ifelse @@ -423,7 +423,7 @@ options (lintype) (databaromni) put options (linkage) true put -@@ -25717,7 +25903,7 @@ +@@ -25776,7 +25962,7 @@ linear options //databaromni exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -432,7 +432,7 @@ % Plot the separator /sepfinder { -@@ -25748,20 +25934,66 @@ +@@ -25807,20 +25993,66 @@ sep 0 [0 0 0] putinterval sep sep length 4 sub [0 0 0 0] putinterval 18 sepfinder 64 sepfinder @@ -511,7 +511,7 @@ end -@@ -25819,7 +26051,7 @@ +@@ -25878,7 +26110,7 @@ pop } ifelse @@ -520,7 +520,7 @@ options (lintype) (databarstacked) put options (linkage) true put -@@ -25830,7 +26062,7 @@ +@@ -25889,7 +26121,7 @@ linear options //databarstacked exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def @@ -529,7 +529,7 @@ % Plot the separator /sepfinder { -@@ -25858,20 +26090,52 @@ +@@ -25917,20 +26149,52 @@ sep 0 [ 0 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval 18 sepfinder @@ -594,7 +594,7 @@ end -@@ -25929,7 +26193,7 @@ +@@ -25988,7 +26252,7 @@ pop } ifelse @@ -603,7 +603,7 @@ options (lintype) (databarstackedomni) put options (linkage) true put -@@ -25940,7 +26204,7 @@ +@@ -25999,7 +26263,7 @@ linear options //databarstackedomni exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def @@ -612,7 +612,7 @@ % Plot the separator /sepfinder { -@@ -25968,20 +26232,52 @@ +@@ -26027,20 +26291,52 @@ sep 0 [ 0 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval 18 sepfinder @@ -677,7 +677,7 @@ end -@@ -26154,7 +26450,7 @@ +@@ -26213,7 +26509,7 @@ pop } ifelse @@ -686,7 +686,7 @@ options (lintype) (databarlimited) put options (linkage) true put -@@ -26165,7 +26461,7 @@ +@@ -26224,7 +26520,7 @@ linear options //databarlimited exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -695,7 +695,7 @@ % Plot the separator mark -@@ -26173,22 +26469,68 @@ +@@ -26232,22 +26528,68 @@ counttomark 1 sub array astore /sep exch def pop pop sep 0 [0 0 0] putinterval sep sep length 9 sub [0 0 0 0 0 0 0 0 0] putinterval % 4 + 5 right guard spaces @@ -778,7 +778,7 @@ end -@@ -26247,7 +26589,7 @@ +@@ -26306,7 +26648,7 @@ pop } ifelse @@ -787,7 +787,7 @@ options (lintype) (databarexpanded) put options (linkage) true put -@@ -26258,7 +26600,7 @@ +@@ -26317,7 +26659,7 @@ linear options //databarexpanded exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -796,7 +796,7 @@ % Plot the separator /sepfinder { -@@ -26287,20 +26629,60 @@ +@@ -26346,20 +26688,60 @@ 18 98 bot length 13 sub {} for 69 98 bot length 13 sub {} for ] {sepfinder} forall @@ -869,7 +869,7 @@ end -@@ -26358,7 +26740,7 @@ +@@ -26417,7 +26799,7 @@ pop } ifelse @@ -878,7 +878,7 @@ options (lintype) (databarexpandedstacked) put options (linkage) true put -@@ -26369,7 +26751,7 @@ +@@ -26428,7 +26810,7 @@ linear options //databarexpandedstacked exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def @@ -887,7 +887,7 @@ % Plot the separator /sepfinder { -@@ -26389,27 +26771,55 @@ +@@ -26448,27 +26830,55 @@ } for } bind def /sep [ bot {1 exch sub} forall ] def @@ -957,7 +957,7 @@ end -@@ -26468,7 +26878,7 @@ +@@ -26527,7 +26937,7 @@ pop } ifelse @@ -966,7 +966,7 @@ options (inkspread) (0) put options (dontdraw) true put -@@ -26495,35 +26905,87 @@ +@@ -26554,35 +26964,87 @@ linear << options {} forall >> //gs1-128 exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -1068,7 +1068,7 @@ end -@@ -27821,3 +28283,124 @@ +@@ -27880,3 +28342,176 @@ % --END ENCODER hibcazteccode-- % --END TEMPLATE-- @@ -1131,13 +1131,16 @@ +ret /pixs known { + /pixs ret /pixs get def + -+ n ret /pixx known and { % If newlines requested and have row width ++ /xs systemdict /xs known { systemdict /xs get cvi } { 0 } ifelse def ++ /xe systemdict /xe known { systemdict /xe get cvi } { 0 } ifelse def ++ ++ n xs 0 ne or xe 0 ne or ret /pixx known and { % If newlines or start/end indexes requested and have row width + /pixx ret /pixx get def -+ 0 pixx pixs length 1 sub { % For i = 0; i < pixs length; i += pixx -+ pixs exch pixx getinterval { % For j = i; j < i + pixx; j++ ++ xs pixx pixs length 1 sub xe sub { % For i = xs; i < pixs length - xe; i += pixx ++ pixs exch pixx xs sub xe sub getinterval { % For j = i; j < i + pixx - xs -xe; j++ + 1 string cvs print + } forall -+ (\n) print ++ n { (\n) print } if + } for + } { % Else dump the whole thing, no newlines + pixs { 1 string cvs print } forall @@ -1172,17 +1175,66 @@ + sbs length 1 sub + } ifelse def + -+ 0 1 limit { -+ /i exch def -+ p not { % If not preprocessed ++ % If should use bhs/bbs to emulate rows (DAFT/pharmacode2) (hacky) ++ /nosbs false def ++ /minh 999999 def ++ /midh 0 def ++ /maxh 0 def ++ /maxb 0 def ++ systemdict /hs known ret /bhs known and ret /bbs known and { ++ /bhs ret /bhs get def ++ /bbs ret /bbs get def ++ 0 1 bhs length 1 sub { ++ /i exch def ++ /h bhs i get def ++ /b bbs i get def ++ h minh lt { /minh h def } if ++ h maxh gt { /maxh h def } if ++ h minh ne h maxh ne and { /midh h def } if ++ b maxb gt { /maxb b def } if ++ } for ++ 0 1 limit { ++ /i exch def + i 2 mod 0 eq { % i is even -+ sbs i get f cvi { (1) print } repeat ++ /h bhs i 2 idiv get def ++ /b bbs i 2 idiv get def ++ h maxh eq h midh eq b maxb eq and or maxb 0 ne b maxb eq and midh 0 eq and h minh eq and or { (1) } { (0) } ifelse print % Yeah, me too + } { -+ sbs i get f cvi { (0) print } repeat ++ (0) print + } ifelse -+ } if -+ } for -+ n { (\n) print } if ++ } for ++ n { (\n) print } if ++ maxb 0 ne midh 0 eq and maxb 0 eq minh maxh eq and or { /nosbs true def } if % No tracker (pharmacode2) ++ } if ++ ++ % Process sbs ++ nosbs not { ++ 0 1 limit { ++ /i exch def ++ p not { % If not preprocessed ++ i 2 mod 0 eq { % i is even ++ sbs i get f cvi { (1) print } repeat ++ } { ++ sbs i get f cvi { (0) print } repeat ++ } ifelse ++ } if ++ } for ++ n { (\n) print } if ++ } if ++ ++ % Third row if DAFT, second row if no tracker (pharmacode2) ++ maxb 0 ne midh 0 ne or minh maxh eq or { ++ 0 1 limit { ++ /i exch def ++ i 2 mod 0 eq { % i is even ++ /b bbs i 2 idiv get def ++ b 0 eq { (1) } { (0) } ifelse print ++ } { ++ (0) print ++ } ifelse ++ } for ++ n { (\n) print } if ++ } if + } if +} ifelse + diff --git a/backend/tests/tools/bwipp_dump.ps.tar.xz b/backend/tests/tools/bwipp_dump.ps.tar.xz index 0bc4a583..e6df65e2 100644 Binary files a/backend/tests/tools/bwipp_dump.ps.tar.xz and b/backend/tests/tools/bwipp_dump.ps.tar.xz differ diff --git a/backend/tests/tools/run_bwipp_tests.sh b/backend/tests/tools/run_bwipp_tests.sh index 79f1be28..fd24c224 100755 --- a/backend/tests/tools/run_bwipp_tests.sh +++ b/backend/tests/tools/run_bwipp_tests.sh @@ -1,12 +1,33 @@ #!/bin/bash -./test_2of5 -f encode -d $(expr 128 + 16) -./test_channel -f encode -d $(expr 128 + 16) -./test_codablock -f encode -d $(expr 128 + 16) -./test_code -f encode -d $(expr 128 + 16) -./test_code128 -f encode -d $(expr 128 + 16) -./test_composite -d $(expr 128 + 16) -./test_gs1 -f gs1_reduce -d $(expr 128 + 16) -./test_pdf417 -f encode -d $(expr 128 + 16) -./test_rss -d $(expr 128 + 16) -./test_telepen -f encode -d $(expr 128 + 16) -./test_upcean -f encode -d $(expr 128 + 16) +# Copyright (C) 2020 Robin Stuart +# vim: set ts=4 sw=4 et : +set -e + +function run_bwipp_test() { + if [ -z "$2" ]; then + echo -e "\n$1" + ./$1 -d $(expr 128 + 16 + 32) || exit 1 + else + echo -e "\n$1 -f $2" + ./$1 -f "$2" -d $(expr 128 + 16 + 32) || exit 1 + fi +} + +run_bwipp_test "test_2of5" "encode" +run_bwipp_test "test_auspost" "encode" +run_bwipp_test "test_channel" "encode" +run_bwipp_test "test_codablock" "encode" +run_bwipp_test "test_code" "encode" +run_bwipp_test "test_code1" "encode" +run_bwipp_test "test_code128" "encode" +run_bwipp_test "test_code16k" "encode" +run_bwipp_test "test_code49" "encode" +run_bwipp_test "test_composite" +run_bwipp_test "test_gs1" "gs1_reduce" +run_bwipp_test "test_imail" "encode" +run_bwipp_test "test_medical" "encode" +run_bwipp_test "test_pdf417" "encode" +run_bwipp_test "test_postal" "encode" +run_bwipp_test "test_rss" +run_bwipp_test "test_telepen" "encode" +run_bwipp_test "test_upcean" "encode" diff --git a/backend/upcean.c b/backend/upcean.c index b8b5c29f..1aa27a56 100644 --- a/backend/upcean.c +++ b/backend/upcean.c @@ -126,6 +126,7 @@ static void upca_draw(char source[], char dest[]) { static int upca(struct zint_symbol *symbol, unsigned char source[], char dest[]) { int length; char gtin[15]; + int error_number = 0; strcpy(gtin, (char*) source); length = strlen(gtin); @@ -136,6 +137,9 @@ static int upca(struct zint_symbol *symbol, unsigned char source[], char dest[]) } else { gtin[length - 1] = '\0'; if (source[length - 1] != upc_check(gtin)) { + if (symbol->debug & ZINT_DEBUG_PRINT) { + printf("UPC-A: %s, Check digit: %c\n", gtin, upc_check(gtin)); + } strcpy(symbol->errtxt, "270: Invalid check digit"); return ZINT_ERROR_INVALID_CHECK; } @@ -143,7 +147,8 @@ static int upca(struct zint_symbol *symbol, unsigned char source[], char dest[]) } upca_draw(gtin, dest); ustrcpy(symbol->text, (unsigned char*) gtin); - return 0; + + return error_number; } /* UPC E is a zero-compressed version of UPC A */ @@ -151,6 +156,7 @@ static int upce(struct zint_symbol *symbol, unsigned char source[], char dest[]) unsigned int i, num_system; char emode, equivalent[12], check_digit, parity[8], temp[9]; char hrt[9]; + int error_number = 0; /* Two number systems can be used - system 0 and system 1 */ if (symbol->symbology != BARCODE_UPCE_CHK) { @@ -301,7 +307,8 @@ static int upce(struct zint_symbol *symbol, unsigned char source[], char dest[]) } } ustrcpy(symbol->text, (unsigned char*) hrt); - return 0; + + return error_number; } /* EAN-2 and EAN-5 add-on codes */ @@ -392,6 +399,7 @@ static int ean13(struct zint_symbol *symbol, unsigned char source[], char dest[] unsigned int length, i, half_way; char parity[6]; char gtin[15]; + int error_number = 0; strcpy(parity, ""); strcpy(gtin, (char*) source); @@ -436,9 +444,9 @@ static int ean13(struct zint_symbol *symbol, unsigned char source[], char dest[] /* stop character */ strcat(dest, "111"); - ustrcpy(symbol->text, (unsigned char*) gtin); - return 0; + + return error_number; } /* Make an EAN-8 barcode when we haven't been given the check digit */ @@ -446,6 +454,7 @@ static int ean8(struct zint_symbol *symbol, unsigned char source[], char dest[]) /* EAN-8 is basically the same as UPC-A but with fewer digits */ int length; char gtin[10]; + int error_number = 0; strcpy(gtin, (char*) source); length = strlen(gtin); @@ -464,7 +473,7 @@ static int ean8(struct zint_symbol *symbol, unsigned char source[], char dest[]) upca_draw(gtin, dest); ustrcpy(symbol->text, (unsigned char*) gtin); - return 0; + return error_number; } /* For ISBN(13) only */ @@ -837,12 +846,12 @@ INTERNAL int eanx(struct zint_symbol *symbol, unsigned char source[], int src_le if ((ustrlen(first_part) == 11) || (ustrlen(first_part) == 12)) { error_number = upca(symbol, first_part, (char*) dest); } else { - strcpy(symbol->errtxt, "288: Input wrong length (C6I)"); + strcpy(symbol->errtxt, "288: Input wrong length"); return ZINT_ERROR_TOO_LONG; } break; case BARCODE_UPCA_CC: - if (ustrlen(first_part) == 11) { + if (ustrlen(first_part) == 11 || ustrlen(first_part) == 12) { set_module(symbol, symbol->rows, 1); set_module(symbol, symbol->rows, 95); set_module(symbol, symbol->rows + 1, 0); @@ -891,7 +900,7 @@ INTERNAL int eanx(struct zint_symbol *symbol, unsigned char source[], int src_le break; } - if (error_number > 4) { + if (error_number >= ZINT_ERROR) { return error_number; } @@ -931,5 +940,5 @@ INTERNAL int eanx(struct zint_symbol *symbol, unsigned char source[], int src_le break; } - return 0; + return error_number; } diff --git a/backend/vector.c b/backend/vector.c index 7cea0c6a..a027e045 100644 --- a/backend/vector.c +++ b/backend/vector.c @@ -42,7 +42,7 @@ INTERNAL int ps_plot(struct zint_symbol *symbol); INTERNAL int svg_plot(struct zint_symbol *symbol); -INTERNAL int emf_plot(struct zint_symbol *symbol); +INTERNAL int emf_plot(struct zint_symbol *symbol, int rotate_angle); static struct zint_vector_rect *vector_plot_create_rect(float x, float y, float width, float height) { struct zint_vector_rect *rect; @@ -122,7 +122,7 @@ static int vector_plot_add_circle(struct zint_symbol *symbol, struct zint_vector } static int vector_plot_add_string(struct zint_symbol *symbol, - unsigned char *text, float x, float y, float fsize, float width, + unsigned char *text, float x, float y, float fsize, float width, int halign, struct zint_vector_string **last_string) { struct zint_vector_string *string; @@ -134,6 +134,7 @@ static int vector_plot_add_string(struct zint_symbol *symbol, string->fsize = fsize; string->length = ustrlen(text); string->rotation = 0; + string->halign = halign; string->text = (unsigned char*) malloc(sizeof (unsigned char) * (ustrlen(text) + 1)); ustrcpy(string->text, text); @@ -381,23 +382,31 @@ static void vector_reduce_rectangles(struct zint_symbol *symbol) { INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_type) { int error_number; - float large_bar_height; - int textdone; - int main_width, comp_offset, addon_gap; + int large_bar_height; + int textdone = 0; + int main_width; + int comp_offset = 0; unsigned char addon[6]; + int addon_gap; + float addon_text_posn = 0.0f; + float addon_bar_height; int xoffset, yoffset, roffset, boffset; - float addon_text_posn; - int textoffset; - int default_text_posn; + float textoffset; + float default_text_posn; float row_height, row_posn; int upceanflag = 0; int addon_latch = 0; unsigned char textpart1[5], textpart2[7], textpart3[7], textpart4[2]; - int textpos; - int hide_text = 0; + float textpos; + int hide_text; int i, r; + int text_height; /* Font pixel size (so whole integers) */ + int upcae_outside_text_height; /* UPC-A/E outside digits font size */ + float digit_ascent_factor = 0.25f; /* Assuming digit ascent roughly 25% less than font size */ + float text_gap; /* Gap between barcode and text */ + float dot_overspill = 0.0f; + float dotoffset = 0.0f; - float text_height; int rect_count, last_row_start; int this_row; @@ -425,10 +434,8 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ vector->strings = NULL; large_bar_height = output_large_bar_height(symbol); - textdone = 0; main_width = symbol->width; - comp_offset = 0; if (is_extendable(symbol->symbology)) { upceanflag = output_process_upcean(symbol, &main_width, &comp_offset, addon, &addon_gap); @@ -436,51 +443,57 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ output_set_whitespace_offsets(symbol, &xoffset, &yoffset, &roffset, &boffset); - addon_text_posn = 0.0f; hide_text = ((!symbol->show_hrt) || (ustrlen(symbol->text) == 0)); - if (hide_text) { - text_height = 0.0f; - textoffset = upceanflag ? 9.0f : 0.0f; + /* Note font sizes scaled by 2 so really twice these values */ + if (upceanflag) { + /* Note BOLD_TEXT ignored for UPCEAN by svg/emf/ps/qzint */ + text_height = symbol->output_options & SMALL_TEXT ? 7 : 10; + upcae_outside_text_height = symbol->output_options & SMALL_TEXT ? 6 : 7; + text_gap = -text_height * digit_ascent_factor + 0.5f; /* Negative to move close to barcode (less digit ascent, then add 0.5X) */ } else { - text_height = upceanflag ? 11.0f : 9.0f; - textoffset = 9.0f; + text_height = symbol->output_options & SMALL_TEXT ? 6 : 7; + text_gap = text_height * 0.1f; } - if (symbol->output_options & SMALL_TEXT) - text_height *= 0.8f; - vector->width = ceil(symbol->width + (xoffset + roffset)); - vector->height = ceil(symbol->height + textoffset + (yoffset + boffset)); + if (hide_text) { + textoffset = upceanflag && upceanflag != 2 && upceanflag != 5 ? 5.0f : 0.0f; /* Allow for guard bars */ + } else { + if (upceanflag) { + textoffset = text_height + 0.2f + text_gap; /* Add fudge for anti-aliasing of digits */ + } else { + textoffset = text_height * 1.25f + text_gap; /* Allow +25% for characters descending below baseline */ + } + } + + if ((symbol->symbology != BARCODE_MAXICODE) && (symbol->output_options & BARCODE_DOTTY_MODE)) { + dot_overspill = symbol->dot_size - 1.0f; /* Allow for exceeding 1X */ + if (dot_overspill < 0.0f) { + dot_overspill = 0.0f; + } else { + dotoffset = 0.1f; /* Fudge for anti-aliasing */ + } + } + + vector->width = symbol->width + dotoffset * 2.0f + dot_overspill + (xoffset + roffset); + vector->height = symbol->height + textoffset + dotoffset * 2.0f + dot_overspill + (yoffset + boffset); if (symbol->border_width > 0 && ((symbol->output_options & BARCODE_BOX) || (symbol->output_options & BARCODE_BIND))) { - default_text_posn = symbol->height + textoffset + symbol->border_width + symbol->border_width; + default_text_posn = symbol->height + text_height + text_gap + symbol->border_width + symbol->border_width; } else { - default_text_posn = symbol->height + textoffset; + default_text_posn = symbol->height + text_height + text_gap; } - row_height = 0.0f; rect_count = 0; last_row_start = 0; // Plot rectangles - most symbols created here if ((symbol->symbology != BARCODE_MAXICODE) && ((symbol->output_options & BARCODE_DOTTY_MODE) == 0)) { + row_posn = yoffset; for (r = 0; r < symbol->rows; r++) { this_row = r; last_row_start = rect_count; - if (symbol->row_height[this_row] == 0) { - row_height = large_bar_height; - } else { - row_height = symbol->row_height[this_row]; - } - row_posn = 0.0f; - for (i = 0; i < r; i++) { - if (symbol->row_height[i] == 0) { - row_posn += large_bar_height; - } else { - row_posn += symbol->row_height[i]; - } - } - row_posn += yoffset; + row_height = symbol->row_height[this_row] ? symbol->row_height[this_row] : large_bar_height; i = 0; @@ -490,7 +503,17 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ block_width++; } while (i + block_width < symbol->width && module_is_set(symbol, this_row, i + block_width) == module_is_set(symbol, this_row, i)); if ((addon_latch == 0) && (r == (symbol->rows - 1)) && (i > main_width)) { - addon_text_posn = row_posn + 8.0f; + addon_text_posn = row_posn + text_height - text_height * digit_ascent_factor; + if (addon_text_posn < 0.0f) { + addon_text_posn = 0.0f; + } + addon_bar_height = row_height - (addon_text_posn - row_posn) + text_gap; + if (upceanflag != 12 && upceanflag != 6) { /* UPC-A/E don't descend */ + addon_bar_height += 5.0f; + } + if (addon_bar_height < 0.5f) { + addon_bar_height = 0.5f; + } addon_latch = 1; } if (module_is_set(symbol, this_row, i)) { @@ -501,11 +524,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ rectangle->colour = module_is_set(symbol, this_row, i); } } else { - if (upceanflag == 12 || upceanflag == 6) { /* UPC-A/E don't descend */ - rectangle = vector_plot_create_rect(i + xoffset, row_posn + 10.0f, block_width, row_height > 10.0f ? row_height - 10.0f : 1.0f); - } else { - rectangle = vector_plot_create_rect(i + xoffset, row_posn + 10.0f, block_width, row_height > 5.0f ? row_height - 5.0f : 1.0f); - } + rectangle = vector_plot_create_rect(i + xoffset, addon_text_posn - text_gap, block_width, addon_bar_height); } vector_plot_add_rect(symbol, rectangle, &last_rectangle); rect_count++; @@ -513,6 +532,8 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ i += block_width; } while (i < symbol->width); + + row_posn += row_height; } } @@ -551,10 +572,11 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ // Dotty mode if ((symbol->symbology != BARCODE_MAXICODE) && (symbol->output_options & BARCODE_DOTTY_MODE)) { + float dotradius = symbol->dot_size / 2.0f; for (r = 0; r < symbol->rows; r++) { for (i = 0; i < symbol->width; i++) { if (module_is_set(symbol, r, i)) { - struct zint_vector_circle *circle = vector_plot_create_circle(i + 0.5f + xoffset, r + 0.5f + yoffset, 1.0f, 0); + struct zint_vector_circle *circle = vector_plot_create_circle(i + dotradius + dotoffset + xoffset, r + dotradius + dotoffset + yoffset, symbol->dot_size, 0); vector_plot_add_circle(symbol, circle, &last_circle); } } @@ -637,98 +659,99 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ if (upceanflag) { float textwidth; + output_upcean_split_text(upceanflag, symbol->text, textpart1, textpart2, textpart3, textpart4); if (upceanflag == 6) { /* UPC-E */ - textpos = -5 + xoffset; + textpos = -5.0f + xoffset; textwidth = 6.2f; - vector_plot_add_string(symbol, textpart1, textpos, default_text_posn - 2.0f, text_height * (8.0f / 11.0f), textwidth, &last_string); - textpos = 24 + xoffset; + vector_plot_add_string(symbol, textpart1, textpos, default_text_posn, upcae_outside_text_height, textwidth, 2 /*right align*/, &last_string); + textpos = 24.0f + xoffset; textwidth = 6.0f * 8.5f; - vector_plot_add_string(symbol, textpart2, textpos, default_text_posn, text_height, textwidth, &last_string); - textpos = 55 + xoffset; + vector_plot_add_string(symbol, textpart2, textpos, default_text_posn, text_height, textwidth, 0, &last_string); + textpos = 51.0f + 3.0f + xoffset; textwidth = 6.2f; - vector_plot_add_string(symbol, textpart3, textpos, default_text_posn - 2.0f, text_height * (8.0f / 11.0f), textwidth, &last_string); + vector_plot_add_string(symbol, textpart3, textpos, default_text_posn, upcae_outside_text_height, textwidth, 1 /*left align*/, &last_string); textdone = 1; switch (ustrlen(addon)) { case 2: - textpos = 61 + xoffset + addon_gap; + textpos = 61.0f + xoffset + addon_gap; textwidth = 2.0f * 8.5f; - vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, &last_string); + vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, &last_string); break; case 5: - textpos = 75 + xoffset + addon_gap; + textpos = 75.0f + xoffset + addon_gap; textwidth = 5.0f * 8.5f; - vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, &last_string); + vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, &last_string); break; } } else if (upceanflag == 8) { /* EAN-8 */ - textpos = 17 + xoffset; + textpos = 17.0f + xoffset; textwidth = 4.0f * 8.5f; - vector_plot_add_string(symbol, textpart1, textpos, default_text_posn, text_height, textwidth, &last_string); - textpos = 50 + xoffset; - vector_plot_add_string(symbol, textpart2, textpos, default_text_posn, text_height, textwidth, &last_string); + vector_plot_add_string(symbol, textpart1, textpos, default_text_posn, text_height, textwidth, 0, &last_string); + textpos = 50.0f + xoffset; + vector_plot_add_string(symbol, textpart2, textpos, default_text_posn, text_height, textwidth, 0, &last_string); textdone = 1; switch (ustrlen(addon)) { case 2: - textpos = 77 + xoffset + addon_gap; + textpos = 77.0f + xoffset + addon_gap; textwidth = 2.0f * 8.5f; - vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, &last_string); + vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, &last_string); break; case 5: - textpos = 91 + xoffset + addon_gap; + textpos = 91.0f + xoffset + addon_gap; textwidth = 5.0f * 8.5f; - vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, &last_string); + vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, &last_string); break; } } else if (upceanflag == 12) { /* UPC-A */ - textpos = -5 + xoffset; + textpos = -5.0f + xoffset; textwidth = 6.2f; - vector_plot_add_string(symbol, textpart1, textpos, default_text_posn - 2.0f, text_height * (8.0f / 11.0f), textwidth, &last_string); - textpos = 27 + xoffset; + vector_plot_add_string(symbol, textpart1, textpos, default_text_posn, upcae_outside_text_height, textwidth, 2 /*right align*/, &last_string); + textpos = 27.0f + xoffset; textwidth = 5.0f * 8.5f; - vector_plot_add_string(symbol, textpart2, textpos, default_text_posn, text_height, textwidth, &last_string); - textpos = 68 + xoffset; - vector_plot_add_string(symbol, textpart3, textpos, default_text_posn, text_height, textwidth, &last_string); - textpos = 100 + xoffset; + vector_plot_add_string(symbol, textpart2, textpos, default_text_posn, text_height, textwidth, 0, &last_string); + textpos = 67.0f + xoffset; + vector_plot_add_string(symbol, textpart3, textpos, default_text_posn, text_height, textwidth, 0, &last_string); + textpos = 95.0f + 5.0f + xoffset; textwidth = 6.2f; - vector_plot_add_string(symbol, textpart4, textpos, default_text_posn - 2.0f, text_height * (8.0f / 11.0f), textwidth, &last_string); + vector_plot_add_string(symbol, textpart4, textpos, default_text_posn, upcae_outside_text_height, textwidth, 1 /*left align*/, &last_string); textdone = 1; switch (ustrlen(addon)) { case 2: - textpos = 107 + xoffset + addon_gap; + textpos = 105.0f + xoffset + addon_gap; textwidth = 2.0f * 8.5f; - vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, &last_string); + vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, &last_string); break; case 5: - textpos = 121 + xoffset + addon_gap; + textpos = 119.0f + xoffset + addon_gap; textwidth = 5.0f * 8.5f; - vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, &last_string); + vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, &last_string); break; } } else if (upceanflag == 13) { /* EAN-13 */ - textpos = -7 + xoffset; + textpos = -5.0f + xoffset; textwidth = 8.5f; - vector_plot_add_string(symbol, textpart1, textpos, default_text_posn, text_height, textwidth, &last_string); - textpos = 24 + xoffset; + vector_plot_add_string(symbol, textpart1, textpos, default_text_posn, text_height, textwidth, 2 /*right align*/, &last_string); + textpos = 24.0f + xoffset; textwidth = 6.0f * 8.5f; - vector_plot_add_string(symbol, textpart2, textpos, default_text_posn, text_height, textwidth, &last_string); - textpos = 71 + xoffset; - vector_plot_add_string(symbol, textpart3, textpos, default_text_posn, text_height, textwidth, &last_string); + vector_plot_add_string(symbol, textpart2, textpos, default_text_posn, text_height, textwidth, 0, &last_string); + textpos = 71.0f + xoffset; + vector_plot_add_string(symbol, textpart3, textpos, default_text_posn, text_height, textwidth, 0, &last_string); textdone = 1; switch (ustrlen(addon)) { case 2: - textpos = 105 + xoffset + addon_gap; + textpos = 105.0f + xoffset + addon_gap; textwidth = 2.0f * 8.5f; - vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, &last_string); + vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, &last_string); break; case 5: - textpos = 119 + xoffset + addon_gap; + textpos = 119.0f + xoffset + addon_gap; textwidth = 5.0f * 8.5f; - vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, &last_string); + vector_plot_add_string(symbol, addon, textpos, addon_text_posn, text_height, textwidth, 0, &last_string); break; } } @@ -737,7 +760,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ if (!textdone) { /* Put normal human readable text at the bottom (and centered) */ // calculate start xoffset to center text - vector_plot_add_string(symbol, symbol->text, main_width / 2.0f + xoffset, default_text_posn, text_height, symbol->width, &last_string); + vector_plot_add_string(symbol, symbol->text, main_width / 2.0f + xoffset, default_text_posn, text_height, symbol->width, 0, &last_string); } xoffset -= comp_offset; // Restore xoffset @@ -753,12 +776,14 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ /* row binding */ if (symbol->symbology != BARCODE_CODABLOCKF && symbol->symbology != BARCODE_HIBC_BLOCKF) { for (r = 1; r < symbol->rows; r++) { + row_height = symbol->row_height[r - 1] ? symbol->row_height[r - 1] : large_bar_height; rectangle = vector_plot_create_rect(xoffset, (r * row_height) + yoffset - sep_height / 2, symbol->width, sep_height); vector_plot_add_rect(symbol, rectangle, &last_rectangle); } } else { for (r = 1; r < symbol->rows; r++) { /* Avoid 11-module start and 13-module stop chars */ + row_height = symbol->row_height[r - 1] ? symbol->row_height[r - 1] : large_bar_height; rectangle = vector_plot_create_rect(xoffset + 11, (r * row_height) + yoffset - sep_height / 2, symbol->width - 24, sep_height); vector_plot_add_rect(symbol, rectangle, &last_rectangle); } @@ -797,7 +822,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ vector_scale(symbol, file_type); if (file_type != OUT_EMF_FILE) { - /* Should be possible for EMF but not sure how to rotate text */ + /* EMF does its own rotation (with mixed results in various apps) */ vector_rotate(symbol, rotate_angle); } @@ -809,7 +834,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ error_number = svg_plot(symbol); break; case OUT_EMF_FILE: - error_number = emf_plot(symbol); + error_number = emf_plot(symbol, rotate_angle); break; /* case OUT_BUFFER: No more work needed */ } diff --git a/backend/zint.h b/backend/zint.h index 1bf62844..99a27952 100644 --- a/backend/zint.h +++ b/backend/zint.h @@ -48,6 +48,7 @@ extern "C" { float width; /* Suggested string width, may be 0 if none recommended */ int length; int rotation; + int halign; /* Horizontal alignment: 0 for centre (middle, 1 for left (start), 2 for right (end) */ unsigned char *text; struct zint_vector_string *next; /* Pointer to next character */ }; @@ -271,6 +272,7 @@ extern "C" { #define ZINT_WARN_INVALID_OPTION 2 #define ZINT_WARN_USES_ECI 3 #define ZINT_WARN_NONCOMPLIANT 4 +#define ZINT_ERROR 5 /* Warn/error marker, not returned */ #define ZINT_ERROR_TOO_LONG 5 #define ZINT_ERROR_INVALID_DATA 6 #define ZINT_ERROR_INVALID_CHECK 7 @@ -291,15 +293,27 @@ extern "C" { #define OUT_JPG_FILE 180 #define OUT_TIF_FILE 200 -// Debug flags -#define ZINT_DEBUG_PRINT 1 -#define ZINT_DEBUG_TEST 2 - // Warning warn #define WARN_DEFAULT 0 #define WARN_ZPL_COMPAT 1 #define WARN_FAIL_ALL 2 +// Capability flags +#define ZINT_CAP_HRT 0x0001 +#define ZINT_CAP_STACKABLE 0x0002 +#define ZINT_CAP_EXTENDABLE 0x0004 +#define ZINT_CAP_COMPOSITE 0x0008 +#define ZINT_CAP_ECI 0x0010 +#define ZINT_CAP_GS1 0x0020 +#define ZINT_CAP_DOTTY 0x0040 +#define ZINT_CAP_FIXED_RATIO 0x0100 /* Aspect ratio */ +#define ZINT_CAP_READER_INIT 0x0200 +#define ZINT_CAP_FULL_MULTIBYTE 0x0400 + +// Debug flags +#define ZINT_DEBUG_PRINT 1 +#define ZINT_DEBUG_TEST 2 + #if defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(_MSC_VER) #if defined (DLL_EXPORT) || defined(PIC) || defined(_USRDLL) #define ZINT_EXTERN __declspec(dllexport) @@ -330,6 +344,7 @@ extern "C" { ZINT_EXTERN int ZBarcode_Encode_File_and_Buffer_Vector(struct zint_symbol *symbol, char *filename, int rotate_angle); ZINT_EXTERN int ZBarcode_ValidID(int symbol_id); + ZINT_EXTERN unsigned int ZBarcode_Cap(int symbol_id, unsigned int cap_flag); ZINT_EXTERN int ZBarcode_Version(); #ifdef __cplusplus diff --git a/backend_qt/CMakeLists.txt b/backend_qt/CMakeLists.txt index 9a34e3b2..8be5bc0e 100644 --- a/backend_qt/CMakeLists.txt +++ b/backend_qt/CMakeLists.txt @@ -5,6 +5,7 @@ project(QZint) include_directories(BEFORE "${CMAKE_SOURCE_DIR}/backend" ) set(QZint_SRCS qzint.cpp) +QT5_WRAP_CPP(QZint_SRCS qzint.h) add_library(QZint SHARED ${QZint_SRCS}) diff --git a/backend_qt/qzint.cpp b/backend_qt/qzint.cpp index d81b89b9..8dbf8ffc 100644 --- a/backend_qt/qzint.cpp +++ b/backend_qt/qzint.cpp @@ -16,6 +16,7 @@ ***************************************************************************/ /* vim: set ts=4 sw=4 et : */ +//#include #include "qzint.h" #include #include @@ -25,30 +26,36 @@ #include namespace Zint { - static const char* fontstyle = "Arial"; - static const int fontPixelSizeSmall = 8; - static const int fontPixelSizeLarge = 12; + static const char *fontStyle = "Helvetica"; + static const char *fontStyleError = "Helvetica"; + static const int fontSizeError = 14; /* Point size */ QZint::QZint() { m_symbol = BARCODE_CODE128; m_height = 0; - m_border = NO_BORDER; + m_borderType = 0; m_borderWidth = 0; + m_fontSetting = 0; m_securityLevel = -1; m_fgColor = Qt::black; m_bgColor = Qt::white; + m_cmyk = false; m_zintSymbol = NULL; m_error = 0; m_input_mode = UNICODE_MODE; - m_scale = 1.0; + m_scale = 1.0f; m_option_3 = 0; - m_hidetext = 0; - m_dot_size = 4.0 / 5.0; + m_show_hrt = 1; + m_eci = 0; + m_dotty = false; + m_dot_size = 4.0f / 5.0f; target_size_horiz = 0; target_size_vert = 0; m_option_2 = 0; m_whitespace = 0; m_gssep = false; + m_reader_init = false; + m_rotate_angle = 0; m_debug = false; } @@ -63,7 +70,7 @@ namespace Zint { m_lastError.clear(); m_zintSymbol = ZBarcode_Create(); - m_zintSymbol->output_options |= m_border; + m_zintSymbol->output_options |= m_borderType | m_fontSetting; m_zintSymbol->symbology = m_symbol; m_zintSymbol->height = m_height; m_zintSymbol->whitespace_width = m_whitespace; @@ -71,17 +78,20 @@ namespace Zint { m_zintSymbol->option_1 = m_securityLevel; m_zintSymbol->input_mode = m_input_mode; m_zintSymbol->option_2 = m_option_2; - m_zintSymbol->dot_size = m_dot_size; - if (m_hidetext) { - m_zintSymbol->show_hrt = 0; - } else { - m_zintSymbol->show_hrt = 1; + if (m_dotty) { + m_zintSymbol->output_options |= BARCODE_DOTTY_MODE; } + m_zintSymbol->dot_size = m_dot_size; + m_zintSymbol->show_hrt = m_show_hrt ? 1 : 0; + m_zintSymbol->eci = m_eci; m_zintSymbol->option_3 = m_option_3; m_zintSymbol->scale = m_scale; if (m_gssep) { m_zintSymbol->output_options |= GS1_GS_SEPARATOR; } + if (m_reader_init) { + m_zintSymbol->output_options |= READER_INIT; + } if (m_debug) { m_zintSymbol->debug |= ZINT_DEBUG_PRINT; } @@ -94,25 +104,25 @@ namespace Zint { if (m_bgColor.alpha() != 0xff) { strcat(m_zintSymbol->bgcolour, m_bgColor.name(QColor::HexArgb).toLatin1().mid(1,2)); } + if (m_cmyk) { + m_zintSymbol->output_options |= CMYK_COLOUR; + } strcpy(m_zintSymbol->primary, m_primaryMessage.toLatin1().left(127)); } void QZint::encode() { resetSymbol(); QByteArray bstr = m_text.toUtf8(); - m_error = ZBarcode_Encode_and_Buffer_Vector(m_zintSymbol, (unsigned char*) bstr.data(), bstr.length(), 0); + m_error = ZBarcode_Encode_and_Buffer_Vector(m_zintSymbol, (unsigned char *) bstr.data(), bstr.length(), 0); /* Note do our own rotation */ m_lastError = m_zintSymbol->errtxt; - switch (m_zintSymbol->output_options & (BARCODE_BIND | BARCODE_BOX)) { - case 0: m_border = NO_BORDER; - break; - case 2: m_border = BIND; - break; - case 4: m_border = BOX; - break; + if (m_error < ZINT_ERROR) { + m_borderType = m_zintSymbol->output_options & (BARCODE_BIND | BARCODE_BOX); + m_height = m_zintSymbol->height; + m_borderWidth = m_zintSymbol->border_width; + m_whitespace = m_zintSymbol->whitespace_width; + emit encoded(); } - m_borderWidth = m_zintSymbol->border_width; - m_whitespace = m_zintSymbol->whitespace_width; } int QZint::symbol() const { @@ -175,6 +185,14 @@ namespace Zint { m_scale = scale; } + bool QZint::dotty() const { + return m_dotty; + } + + void QZint::setDotty(bool dotty) { + m_dotty = dotty; + } + void QZint::setDotSize(float dot_size) { m_dot_size = dot_size; } @@ -195,12 +213,22 @@ namespace Zint { m_bgColor = bgColor; } - QZint::BorderType QZint::borderType() const { - return m_border; + void QZint::setCMYK(bool cmyk) { + m_cmyk = cmyk; } - void QZint::setBorderType(BorderType border) { - m_border = border; + int QZint::borderType() const { + return m_borderType; + } + + void QZint::setBorderType(int borderTypeIndex) { + if (borderTypeIndex == 1) { + m_borderType = BARCODE_BIND; + } else if (borderTypeIndex == 2) { + m_borderType = BARCODE_BOX; + } else { + m_borderType = 0; + } } int QZint::borderWidth() const { @@ -233,8 +261,20 @@ namespace Zint { m_securityLevel = securityLevel; } - void QZint::setHideText(bool hide) { - m_hidetext = hide; + void QZint::setFontSetting(int fontSettingIndex) { + if (fontSettingIndex == 1) { + m_fontSetting = BOLD_TEXT; + } else if (fontSettingIndex == 2) { + m_fontSetting = SMALL_TEXT; + } else if (fontSettingIndex == 3) { + m_fontSetting = SMALL_TEXT | BOLD_TEXT; + } else { + m_fontSetting = 0; + } + } + + void QZint::setShowText(bool show) { + m_show_hrt = show; } void QZint::setTargetSize(int width, int height) { @@ -246,10 +286,68 @@ namespace Zint { m_gssep = gssep; } + int QZint::rotateAngle() const { + return m_rotate_angle; + } + + void QZint::setRotateAngle(int rotateIndex) { + if (rotateIndex == 1) { + m_rotate_angle = 90; + } else if (rotateIndex == 2) { + m_rotate_angle = 180; + } else if (rotateIndex == 3) { + m_rotate_angle = 270; + } else { + m_rotate_angle = 0; + } + } + + void QZint::setECI(int ECIIndex) { + if (ECIIndex >= 1 && ECIIndex <= 11) { + m_eci = ECIIndex + 2; + } else if (ECIIndex >= 12 && ECIIndex <= 15) { + m_eci = ECIIndex + 3; + } else if (ECIIndex >= 16 && ECIIndex <= 26) { + m_eci = ECIIndex + 4; + } else if (ECIIndex == 27) { + m_eci = 899; /* 8-bit binary data TODO: support */ + } else { + m_eci = 0; + } + } + + void QZint::setReaderInit(bool reader_init) { + m_reader_init = reader_init; + } + void QZint::setDebug(bool debug) { m_debug = debug; } + bool QZint::hasHRT(int symbology) const { + return ZBarcode_Cap(symbology ? symbology : m_symbol, ZINT_CAP_HRT); + } + + bool QZint::isExtendable(int symbology) const { + return ZBarcode_Cap(symbology ? symbology : m_symbol, ZINT_CAP_EXTENDABLE); + } + + bool QZint::supportsECI(int symbology) const { + return ZBarcode_Cap(symbology ? symbology : m_symbol, ZINT_CAP_ECI); + } + + bool QZint::isFixedRatio(int symbology) const { + return ZBarcode_Cap(symbology ? symbology : m_symbol, ZINT_CAP_FIXED_RATIO); + } + + bool QZint::isDotty(int symbology) const { + return ZBarcode_Cap(symbology ? symbology : m_symbol, ZINT_CAP_DOTTY); + } + + bool QZint::supportsReaderInit(int symbology) const { + return ZBarcode_Cap(symbology ? symbology : m_symbol, ZINT_CAP_READER_INIT); + } + int QZint::getError() const { return m_error; } @@ -270,8 +368,8 @@ namespace Zint { resetSymbol(); strcpy(m_zintSymbol->outfile, filename.toLatin1().left(255)); QByteArray bstr = m_text.toUtf8(); - m_error = ZBarcode_Encode_and_Print(m_zintSymbol, (unsigned char*) bstr.data(), bstr.length(), 0); - if (m_error >= 5) { + m_error = ZBarcode_Encode_and_Print(m_zintSymbol, (unsigned char *) bstr.data(), bstr.length(), m_rotate_angle); + if (m_error >= ZINT_ERROR) { m_lastError = m_zintSymbol->errtxt; return false; } else { @@ -279,6 +377,35 @@ namespace Zint { } } + Qt::GlobalColor QZint::colourToQtColor(int colour) { + switch (colour) { + case 1: // Cyan + return Qt::cyan; + break; + case 2: // Blue + return Qt::blue; + break; + case 3: // Magenta + return Qt::magenta; + break; + case 4: // Red + return Qt::red; + break; + case 5: // Yellow + return Qt::yellow; + break; + case 6: // Green + return Qt::green; + break; + case 8: // White + return Qt::white; + break; + default: + return Qt::black; + break; + } + } + void QZint::render(QPainter & painter, const QRectF & paintRect, AspectRatioMode mode) { struct zint_vector_rect *rect; struct zint_vector_hexagon *hex; @@ -290,140 +417,143 @@ namespace Zint { encode(); - QFont fontSmall(fontstyle); - fontSmall.setPixelSize(fontPixelSizeSmall); - QFont fontLarge(fontstyle); - fontLarge.setPixelSize(fontPixelSizeLarge); + painter.save(); - if (m_error >= 5) { - // Display error message instead of barcode - fontLarge.setPointSize(14); - painter.setFont(fontLarge); - painter.drawText(paintRect, Qt::AlignCenter, m_lastError); + if (m_error >= ZINT_ERROR) { + painter.setRenderHint(QPainter::Antialiasing); + QFont font(fontStyleError, fontSizeError); + painter.setFont(font); + painter.drawText(paintRect, Qt::AlignCenter | Qt::TextWordWrap, m_lastError); + painter.restore(); return; } - painter.save(); painter.setClipRect(paintRect, Qt::IntersectClip); qreal xtr = paintRect.x(); qreal ytr = paintRect.y(); qreal scale; - + qreal gwidth = m_zintSymbol->vector->width; qreal gheight = m_zintSymbol->vector->height; - if (paintRect.width() / gwidth < paintRect.height() / gheight) { - scale = paintRect.width() / gwidth; + if (m_rotate_angle == 90 || m_rotate_angle == 270) { + if (paintRect.width() / gheight < paintRect.height() / gwidth) { + scale = paintRect.width() / gheight; + } else { + scale = paintRect.height() / gwidth; + } } else { - scale = paintRect.height() / gheight; + if (paintRect.width() / gwidth < paintRect.height() / gheight) { + scale = paintRect.width() / gwidth; + } else { + scale = paintRect.height() / gheight; + } } - + xtr += (qreal) (paintRect.width() - gwidth * scale) / 2.0; ytr += (qreal) (paintRect.height() - gheight * scale) / 2.0; painter.setBackground(QBrush(m_bgColor)); painter.fillRect(paintRect, QBrush(m_bgColor)); - + + if (m_rotate_angle) { + painter.translate(paintRect.width() / 2.0, paintRect.height() / 2.0); // Need to rotate around centre + painter.rotate(m_rotate_angle); + painter.translate(-paintRect.width() / 2.0, -paintRect.height() / 2.0); // Undo + } + painter.translate(xtr, ytr); painter.scale(scale, scale); - + //Red square for diagnostics //painter.fillRect(QRect(0, 0, m_zintSymbol->vector->width, m_zintSymbol->vector->height), QBrush(QColor(255,0,0,255))); - QPen p; - - p.setWidth(1); - p.setColor(m_fgColor); - painter.setPen(p); - painter.setRenderHint(QPainter::Antialiasing); - // Plot rectangles rect = m_zintSymbol->vector->rectangles; - while (rect) { - if (rect->colour == -1) { - painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(m_fgColor)); - } else { - switch(rect->colour) { - case 1: // Cyan - painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::cyan)); - break; - case 2: // Blue - painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::blue)); - break; - case 3: // Magenta - painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::magenta)); - break; - case 4: // Red - painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::red)); - break; - case 5: // Yellow - painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::yellow)); - break; - case 6: // Green - painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::green)); - break; - case 8: // White - painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::white)); - break; - default: - painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::black)); - break; + if (rect) { + QBrush brush(Qt::SolidPattern); + while (rect) { + if (rect->colour == -1) { + brush.setColor(m_fgColor); + } else { + brush.setColor(colourToQtColor(rect->colour)); } + painter.fillRect(QRectF(rect->x, rect->y, rect->width, rect->height), brush); + rect = rect->next; } - rect = rect->next; } - + // Plot hexagons hex = m_zintSymbol->vector->hexagons; - while (hex) { - radius = hex->diameter / 2.0; - - QPainterPath pt; - pt.moveTo(hex->x, hex->y + (1.0 * radius)); - pt.lineTo(hex->x + (0.86 * radius), hex->y + (0.5 * radius)); - pt.lineTo(hex->x + (0.86 * radius), hex->y - (0.5 * radius)); - pt.lineTo(hex->x, hex->y - (1.0 * radius)); - pt.lineTo(hex->x - (0.86 * radius), hex->y - (0.5 * radius)); - pt.lineTo(hex->x - (0.86 * radius), hex->y + (0.5 * radius)); - pt.lineTo(hex->x, hex->y + (1.0 * radius)); - painter.fillPath(pt, QBrush(m_fgColor)); - - hex = hex->next; + if (hex) { + painter.setRenderHint(QPainter::Antialiasing); + QBrush brush(m_fgColor); + while (hex) { + radius = hex->diameter / 2.0; + + QPainterPath pt; + pt.moveTo(hex->x, hex->y + (1.0 * radius)); + pt.lineTo(hex->x + (0.86 * radius), hex->y + (0.5 * radius)); + pt.lineTo(hex->x + (0.86 * radius), hex->y - (0.5 * radius)); + pt.lineTo(hex->x, hex->y - (1.0 * radius)); + pt.lineTo(hex->x - (0.86 * radius), hex->y - (0.5 * radius)); + pt.lineTo(hex->x - (0.86 * radius), hex->y + (0.5 * radius)); + pt.lineTo(hex->x, hex->y + (1.0 * radius)); + painter.fillPath(pt, brush); + + hex = hex->next; + } } - + // Plot dots (circles) circle = m_zintSymbol->vector->circles; - while (circle) { - if (circle->colour) { - p.setColor(m_bgColor); - p.setWidth(0); - painter.setPen(p); - painter.setBrush(QBrush(m_bgColor)); - } else { - p.setColor(m_fgColor); - p.setWidth(0); - painter.setPen(p); - painter.setBrush(QBrush(m_fgColor)); + if (circle) { + painter.setRenderHint(QPainter::Antialiasing); + QPen p; + while (circle) { + if (circle->colour) { // Set means use background colour + p.setColor(m_bgColor); + p.setWidth(0); + painter.setPen(p); + painter.setBrush(QBrush(m_bgColor)); + } else { + p.setColor(m_fgColor); + p.setWidth(0); + painter.setPen(p); + painter.setBrush(QBrush(m_fgColor)); + } + painter.drawEllipse(QPointF(circle->x, circle->y), (double) circle->diameter / 2.0, (double) circle->diameter / 2.0); + circle = circle->next; } - painter.drawEllipse(QPointF(circle->x, circle->y), (double) circle->diameter / 2.0, (double) circle->diameter / 2.0); - circle = circle->next; } - + // Plot text string = m_zintSymbol->vector->strings; if (string) { - painter.setFont(fontLarge); + painter.setRenderHint(QPainter::Antialiasing); + bool bold = (m_zintSymbol->output_options & BOLD_TEXT) && (!isExtendable() || (m_zintSymbol->output_options & SMALL_TEXT)); + QFont font(fontStyle, -1 /*pointSize*/, bold ? QFont::Bold : -1); + while (string) { + font.setPixelSize(string->fsize); + painter.setFont(font); + QString content = QString::fromUtf8((const char *) string->text); + /* string->y is baseline of font */ + if (string->halign == 1) { /* Left align */ + painter.drawText(QPointF(string->x, string->y), content); + } else { + QFontMetrics fm(painter.fontMetrics()); + int width = fm.boundingRect(content).width(); + if (string->halign == 2) { /* Right align */ + painter.drawText(QPointF(string->x - width, string->y), content); + } else { /* Centre align */ + painter.drawText(QPointF(string->x - (width / 2.0), string->y), content); + } + } + string = string->next; + } } - QFontMetrics fm(fontLarge); - while (string) { - QString content = QString::fromUtf8((const char *) string->text, -1); - int width = fm.width(content, -1); - int height = fm.height(); - painter.drawText(string->x - (width / 2.0), string->y - height, width, height, Qt::AlignHCenter | Qt::AlignBottom, content); - string = string->next; - } - + painter.restore(); } } diff --git a/backend_qt/qzint.h b/backend_qt/qzint.h index f159ae9a..b6f0d9be 100644 --- a/backend_qt/qzint.h +++ b/backend_qt/qzint.h @@ -19,18 +19,16 @@ #define BARCODERENDER_H #include #include - #include "zint.h" namespace Zint { -class QZint +class QZint : public QObject { -private: + Q_OBJECT public: - enum BorderType{NO_BORDER=0, BIND=2, BOX=4}; enum AspectRatioMode{IgnoreAspectRatio=0, KeepAspectRatio=1, CenterBarCode=2}; public: @@ -60,6 +58,9 @@ public: float scale() const; void setScale(float scale); + bool dotty() const; + void setDotty(bool botty); + void setDotSize(float dot_size); QColor fgColor() const; @@ -68,8 +69,10 @@ public: QColor bgColor() const; void setBgColor(const QColor & bgColor); - BorderType borderType() const; - void setBorderType(BorderType border); + void setCMYK(bool cmyk); + + int borderType() const; + void setBorderType(int borderTypeIndex); int borderWidth() const; void setBorderWidth(int boderWidth); @@ -82,14 +85,30 @@ public: void setWhitespace(int whitespace); - void setHideText(bool hide); + void setFontSetting(int fontSettingIndex); + + void setShowText(bool show); void setTargetSize(int width, int height); void setGSSep(bool gssep); + int rotateAngle() const; + void setRotateAngle(int rotateIndex); + + void setECI(int ECIIndex); + + void setReaderInit(bool reader_init); + void setDebug(bool debug); + bool hasHRT(int symbology = 0) const; + bool isExtendable(int symbology = 0) const; + bool supportsECI(int symbology = 0) const; + bool isFixedRatio(int symbology = 0) const; + bool isDotty(int symbology = 0) const; + bool supportsReaderInit(int symbology = 0) const; + int getError() const; QString error_message() const; @@ -101,33 +120,43 @@ public: void render(QPainter & painter, const QRectF & paintRect, AspectRatioMode mode=IgnoreAspectRatio); +signals: + void encoded(); + private: void resetSymbol(); void encode(); + static Qt::GlobalColor colourToQtColor(int colour); private: int m_symbol; QString m_text; QString m_primaryMessage; int m_height; - BorderType m_border; + int m_borderType; int m_borderWidth; + int m_fontSetting; int m_option_2; int m_securityLevel; int m_input_mode; QColor m_fgColor; QColor m_bgColor; + bool m_cmyk; QString m_lastError; int m_error; int m_whitespace; zint_symbol * m_zintSymbol; float m_scale; int m_option_3; - bool m_hidetext; + bool m_show_hrt; + int m_eci; + int m_rotate_angle; + bool m_dotty; float m_dot_size; int target_size_horiz; int target_size_vert; bool m_gssep; + bool m_reader_init; bool m_debug; }; } diff --git a/backend_tcl/Makefile.in b/backend_tcl/Makefile.in index 47e2bcc8..88e1660c 100644 --- a/backend_tcl/Makefile.in +++ b/backend_tcl/Makefile.in @@ -65,6 +65,7 @@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ +datarootdir = @datarootdir@ datadir = @datadir@ mandir = @mandir@ includedir = @includedir@ @@ -176,7 +177,7 @@ libraries: doc: -install: all install-binaries install-libraries install-doc +install: all install-binaries install-libraries install-binaries: binaries install-lib-binaries install-bin-binaries @mkdir -p $(DESTDIR)$(pkglibdir) diff --git a/backend_tcl/configure b/backend_tcl/configure old mode 100644 new mode 100755 index af12300f..d353b403 --- a/backend_tcl/configure +++ b/backend_tcl/configure @@ -1,18 +1,20 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for zint 2.5.2. +# Generated by GNU Autoconf 2.69 for zint 2.9.1.9. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -20,23 +22,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -44,7 +38,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -55,7 +55,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -78,13 +78,6 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -94,15 +87,16 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +as_myself= +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -114,12 +108,16 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -131,7 +129,293 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# Required to use basename. +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -145,8 +429,12 @@ else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -166,295 +454,19 @@ $as_echo X/"$0" | } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= @@ -471,9 +483,12 @@ test \$exitcode = 0") || { s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -482,29 +497,18 @@ test \$exitcode = 0") || { exit } - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -519,49 +523,29 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -570,11 +554,11 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -exec 7<&0 &1 +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -589,14 +573,14 @@ cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='zint' PACKAGE_TARNAME='zint' -PACKAGE_VERSION='2.5.2' -PACKAGE_STRING='zint 2.5.2' +PACKAGE_VERSION='2.9.1.9' +PACKAGE_STRING='zint 2.9.1.9' PACKAGE_BUGREPORT='' +PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ @@ -739,6 +723,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -750,6 +735,7 @@ bindir program_transform_name prefix exec_prefix +PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION @@ -820,6 +806,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -844,8 +831,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -890,8 +878,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -917,8 +904,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1073,6 +1059,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1122,8 +1117,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1139,8 +1133,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1170,17 +1163,17 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1189,7 +1182,7 @@ Try \`$0 --help' for more information." >&2 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1197,15 +1190,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1214,7 +1205,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1228,8 +1219,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1243,8 +1233,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1259,11 +1247,9 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1302,13 +1288,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1334,7 +1318,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures zint 2.5.2 to adapt to many kinds of systems. +\`configure' configures zint 2.9.1.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1348,7 +1332,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1374,6 +1358,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1395,7 +1380,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of zint 2.5.2:";; + short | recursive ) echo "Configuration of zint 2.9.1.9:";; esac cat <<\_ACEOF @@ -1427,13 +1412,14 @@ Some influential environment variables: LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. +Report bugs to the package provider. _ACEOF ac_status=$? fi @@ -1496,22 +1482,373 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -zint configure 2.5.2 -generated by GNU Autoconf 2.63 +zint configure 2.9.1.9 +generated by GNU Autoconf 2.69 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by zint $as_me 2.5.2, which was -generated by GNU Autoconf 2.63. Invocation command line was +It was created by zint $as_me 2.9.1.9, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -1547,8 +1884,8 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" -done + $as_echo "PATH: $as_dir" + done IFS=$as_save_IFS } >&5 @@ -1585,9 +1922,9 @@ do ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" + as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -1603,13 +1940,13 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args '$ac_arg'" + as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1621,11 +1958,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -1634,13 +1969,13 @@ _ASBOX case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -1659,11 +1994,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -1676,11 +2009,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -1694,11 +2025,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -1712,46 +2041,53 @@ _ASBOX exit $exit_status ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h +$as_echo "/* confdefs.h */" > confdefs.h + # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -1762,19 +2098,23 @@ fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; @@ -1782,7 +2122,7 @@ $as_echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1797,11 +2137,11 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; @@ -1811,17 +2151,17 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac @@ -1833,43 +2173,20 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi - - - - - - - - - - - - - - - - - - - - - - - - +## -------------------- ## +## Main body of script. ## +## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -1890,26 +2207,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # are compatible with. TEA_VERSION="3.9" - { $as_echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct TEA configuration" >&5 $as_echo_n "checking for correct TEA configuration... " >&6; } if test x"${PACKAGE_NAME}" = x ; then - { { $as_echo "$as_me:$LINENO: error: -The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 -$as_echo "$as_me: error: -The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? " +The PACKAGE_NAME variable must be defined by your TEA configure.in" "$LINENO" 5 fi if test x"3.9" = x ; then - { { $as_echo "$as_me:$LINENO: error: -TEA version not specified." >&5 -$as_echo "$as_me: error: -TEA version not specified." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? " +TEA version not specified." "$LINENO" 5 elif test "3.9" != "${TEA_VERSION}" ; then - { $as_echo "$as_me:$LINENO: result: warning: requested TEA version \"3.9\", have \"${TEA_VERSION}\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: requested TEA version \"3.9\", have \"${TEA_VERSION}\"" >&5 $as_echo "warning: requested TEA version \"3.9\", have \"${TEA_VERSION}\"" >&6; } else - { $as_echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (TEA ${TEA_VERSION})" >&5 $as_echo "ok (TEA ${TEA_VERSION})" >&6; } fi @@ -1923,9 +2234,9 @@ $as_echo "ok (TEA ${TEA_VERSION})" >&6; } *win32*|*WIN32*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CYGPATH+set}" = set; then +if ${ac_cv_prog_CYGPATH+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CYGPATH"; then @@ -1936,14 +2247,14 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -w" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" @@ -1951,10 +2262,10 @@ fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then - { $as_echo "$as_me:$LINENO: result: $CYGPATH" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 $as_echo "$CYGPATH" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -1992,7 +2303,7 @@ fi exec_prefix=$prefix fi - { $as_echo "$as_me:$LINENO: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&5 $as_echo "$as_me: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&6;} @@ -2031,9 +2342,7 @@ for ac_dir in tclconfig "$srcdir"/tclconfig; do fi done if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in tclconfig \"$srcdir\"/tclconfig" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in tclconfig \"$srcdir\"/tclconfig" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "cannot find install-sh, install.sh, or shtool in tclconfig \"$srcdir\"/tclconfig" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2063,13 +2372,13 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. no_tcl=true # Check whether --with-tcl was given. -if test "${with_tcl+set}" = set; then +if test "${with_tcl+set}" = set; then : withval=$with_tcl; with_tclconfig="${withval}" fi - { $as_echo "$as_me:$LINENO: checking for Tcl configuration" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5 $as_echo_n "checking for Tcl configuration... " >&6; } - if test "${ac_cv_c_tclconfig+set}" = set; then + if ${ac_cv_c_tclconfig+:} false; then : $as_echo_n "(cached) " >&6 else @@ -2079,7 +2388,7 @@ else case "${with_tclconfig}" in */tclConfig.sh ) if test -f "${with_tclconfig}"; then - { $as_echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 $as_echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`" fi ;; @@ -2087,9 +2396,7 @@ $as_echo "$as_me: WARNING: --with-tcl argument should refer to directory contain if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`" else - { { $as_echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 -$as_echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5 fi fi @@ -2190,13 +2497,11 @@ fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" - { { $as_echo "$as_me:$LINENO: error: Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" >&5 -$as_echo "$as_me: error: Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" "$LINENO" 5 else no_tcl= TCL_BIN_DIR="${ac_cv_c_tclconfig}" - { $as_echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 $as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; } fi fi @@ -2209,9 +2514,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2222,24 +2527,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2249,9 +2554,9 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2262,24 +2567,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2288,7 +2593,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -2302,9 +2607,9 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2315,24 +2620,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2342,9 +2647,9 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2356,18 +2661,18 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then @@ -2386,10 +2691,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2401,9 +2706,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2414,24 +2719,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2445,9 +2750,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2458,24 +2763,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2488,7 +2793,7 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -2499,57 +2804,37 @@ fi fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2565,8 +2850,8 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: @@ -2582,17 +2867,17 @@ do done rm -f $ac_rmfiles -if { (ac_try="$ac_link_default" +if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -2609,7 +2894,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -2628,84 +2913,41 @@ test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi - -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - fi - fi -fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } -if { (ac_try="$ac_link" +if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -2720,32 +2962,83 @@ for ac_file in conftest.exe conftest conftest.*; do esac done else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi - -rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2757,17 +3050,17 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" +if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -2780,31 +3073,23 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2818,37 +3103,16 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no + ac_compiler_gnu=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes @@ -2857,20 +3121,16 @@ else fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2881,35 +3141,11 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2920,36 +3156,12 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_compile "$LINENO"; then : - ac_c_werror_flag=$ac_save_c_werror_flag +else + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2960,42 +3172,17 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -3012,23 +3199,18 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3080,32 +3262,9 @@ for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -3116,17 +3275,19 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3136,15 +3297,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - { $as_echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 $as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; } if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - { $as_echo "$as_me:$LINENO: result: loading" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 $as_echo "loading" >&6; } . "${TCL_BIN_DIR}/tclConfig.sh" else - { $as_echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 $as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } fi @@ -3204,14 +3365,10 @@ $as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } - { $as_echo "$as_me:$LINENO: checking platform" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking platform" >&5 $as_echo_n "checking platform... " >&6; } hold_cc=$CC; CC="$TCL_CC" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3226,36 +3383,15 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : TEA_PLATFORM="unix" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - TEA_PLATFORM="windows" + TEA_PLATFORM="windows" fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CC=$hold_cc - { $as_echo "$as_me:$LINENO: result: $TEA_PLATFORM" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEA_PLATFORM" >&5 $as_echo "$TEA_PLATFORM" >&6; } # The BUILD_$pkg is to define the correct extern storage class @@ -3296,13 +3432,13 @@ _ACEOF no_tk=true # Check whether --with-tk was given. -if test "${with_tk+set}" = set; then +if test "${with_tk+set}" = set; then : withval=$with_tk; with_tkconfig="${withval}" fi - { $as_echo "$as_me:$LINENO: checking for Tk configuration" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk configuration" >&5 $as_echo_n "checking for Tk configuration... " >&6; } - if test "${ac_cv_c_tkconfig+set}" = set; then + if ${ac_cv_c_tkconfig+:} false; then : $as_echo_n "(cached) " >&6 else @@ -3312,7 +3448,7 @@ else case "${with_tkconfig}" in */tkConfig.sh ) if test -f "${with_tkconfig}"; then - { $as_echo "$as_me:$LINENO: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5 $as_echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;} with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`" fi ;; @@ -3322,9 +3458,7 @@ $as_echo "$as_me: WARNING: --with-tk argument should refer to directory containi elif test -f "${with_tkconfig}/sdl2tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`" else - { { $as_echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5 -$as_echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "${with_tkconfig} directory doesn't contain tkConfig.sh" "$LINENO" 5 fi fi @@ -3431,31 +3565,29 @@ fi if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" - { { $as_echo "$as_me:$LINENO: error: Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh" >&5 -$as_echo "$as_me: error: Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh" "$LINENO" 5 else no_tk= TK_BIN_DIR="${ac_cv_c_tkconfig}" - { $as_echo "$as_me:$LINENO: result: found ${TK_BIN_DIR}/tkConfig.sh" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TK_BIN_DIR}/tkConfig.sh" >&5 $as_echo "found ${TK_BIN_DIR}/tkConfig.sh" >&6; } fi fi - { $as_echo "$as_me:$LINENO: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5 $as_echo_n "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... " >&6; } if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then - { $as_echo "$as_me:$LINENO: result: loading" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 $as_echo "loading" >&6; } . "${TK_BIN_DIR}/tkConfig.sh" elif test -f "${TK_BIN_DIR}/sdl2tkConfig.sh" ; then - { $as_echo "$as_me:$LINENO: result: loading" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 $as_echo "loading" >&6; } . "${TK_BIN_DIR}/sdl2tkConfig.sh" else - { $as_echo "$as_me:$LINENO: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5 $as_echo "could not find ${TK_BIN_DIR}/tkConfig.sh" >&6; } fi @@ -3515,9 +3647,7 @@ $as_echo "could not find ${TK_BIN_DIR}/tkConfig.sh" >&6; } case ${TK_DEFS} in *MAC_OSX_TK*) -cat >>confdefs.h <<\_ACEOF -#define MAC_OSX_TK 1 -_ACEOF +$as_echo "#define MAC_OSX_TK 1" >>confdefs.h TEA_WINDOWINGSYSTEM="aqua" ;; @@ -3555,11 +3685,11 @@ _ACEOF if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then - { $as_echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 $as_echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} prefix=${TCL_PREFIX} else - { $as_echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: --prefix defaulting to /usr/local" >&5 $as_echo "$as_me: --prefix defaulting to /usr/local" >&6;} prefix=/usr/local fi @@ -3567,11 +3697,11 @@ $as_echo "$as_me: --prefix defaulting to /usr/local" >&6;} if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then if test x"${TCL_EXEC_PREFIX}" != x; then - { $as_echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 $as_echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} exec_prefix=${TCL_EXEC_PREFIX} else - { $as_echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to ${prefix}" >&5 $as_echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} exec_prefix=$prefix fi @@ -3597,9 +3727,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3610,24 +3740,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3637,9 +3767,9 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3650,24 +3780,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3676,7 +3806,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -3690,9 +3820,9 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3703,24 +3833,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3730,9 +3860,9 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3744,18 +3874,18 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then @@ -3774,10 +3904,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3789,9 +3919,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3802,24 +3932,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3833,9 +3963,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3846,24 +3976,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3876,7 +4006,7 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -3887,62 +4017,42 @@ fi fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3956,37 +4066,16 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no + ac_compiler_gnu=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes @@ -3995,20 +4084,16 @@ else fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4019,35 +4104,11 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4058,36 +4119,12 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_compile "$LINENO"; then : - ac_c_werror_flag=$ac_save_c_werror_flag +else + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4098,42 +4135,17 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -4150,23 +4162,18 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -4218,32 +4225,9 @@ for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -4254,17 +4238,19 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -4277,14 +4263,14 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -4299,11 +4285,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -4312,78 +4294,34 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : break fi @@ -4395,7 +4333,7 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -4406,11 +4344,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -4419,87 +4353,40 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -4522,11 +4409,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- - { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -4534,7 +4421,7 @@ SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; @@ -4544,11 +4431,11 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -4561,9 +4448,9 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -4574,24 +4461,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -4601,9 +4488,9 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -4614,24 +4501,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -4640,7 +4527,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -4659,9 +4546,9 @@ fi -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -4672,10 +4559,10 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4692,7 +4579,7 @@ case `"$ac_path_GREP" --version 2>&1` in $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` + as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" @@ -4707,26 +4594,24 @@ esac $ac_path_GREP_found && break 3 done done -done + done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -4740,10 +4625,10 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -4760,7 +4645,7 @@ case `"$ac_path_EGREP" --version 2>&1` in $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` + as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" @@ -4775,12 +4660,10 @@ esac $ac_path_EGREP_found && break 3 done done -done + done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -4788,21 +4671,17 @@ fi fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -4817,48 +4696,23 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no + ac_cv_header_stdc=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : + $EGREP "memchr" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -4868,18 +4722,14 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : + $EGREP "free" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -4889,14 +4739,10 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -4923,118 +4769,33 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : +if ac_fn_c_try_run "$LINENO"; then : + else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -5054,18 +4815,14 @@ done #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then - { $as_echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5 $as_echo_n "checking if the compiler understands -pipe... " >&6; } -if test "${tcl_cv_cc_pipe+set}" = set; then +if ${tcl_cv_cc_pipe+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5076,36 +4833,15 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cc_pipe=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_cc_pipe=no + tcl_cv_cc_pipe=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5 $as_echo "$tcl_cv_cc_pipe" >&6; } if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" @@ -5116,19 +4852,14 @@ $as_echo "$tcl_cv_cc_pipe" >&6; } # Common compiler flag setup #-------------------------------------------------------------------- - - { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then +if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler @@ -5136,46 +4867,34 @@ cat >>conftest.$ac_ext <<_ACEOF typedef int dummy; _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless - # there are some -arch flags. Note that *ppc* also matches - # ppc64. This check is also rather less than ideal. - case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( - *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; - esac -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -5193,30 +4912,9 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -5232,49 +4930,18 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no + ac_cv_c_bigendian=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -5289,30 +4956,9 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -5327,51 +4973,20 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no + ac_cv_c_bigendian=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; @@ -5397,24 +5012,7 @@ return use_ascii (foo) == use_ebcdic (foo); return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi @@ -5426,20 +5024,10 @@ $as_echo "$ac_try_echo") >&5 ac_cv_c_bigendian=unknown fi fi -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -5459,67 +5047,33 @@ main () return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes + ac_cv_c_bigendian=yes fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) - cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) -cat >>confdefs.h <<\_ACEOF -#define AC_APPLE_UNIVERSAL_BUILD 1 -_ACEOF +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) - { { $as_echo "$as_me:$LINENO: error: unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -$as_echo "$as_me: error: unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac if test "${TEA_PLATFORM}" = "unix" ; then @@ -5531,109 +5085,21 @@ $as_echo "$as_me: error: unknown endianness # right (and it must appear before "-lm"). #-------------------------------------------------------------------- - { $as_echo "$as_me:$LINENO: checking for sin" >&5 -$as_echo_n "checking for sin... " >&6; } -if test "${ac_cv_func_sin+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define sin to an innocuous variant, in case declares sin. - For example, HP-UX 11i declares gettimeofday. */ -#define sin innocuous_sin - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char sin (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef sin - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char sin (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_sin || defined __stub___sin -choke me -#endif - -int -main () -{ -return sin (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_sin=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_sin=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 -$as_echo "$ac_cv_func_sin" >&6; } -if test "x$ac_cv_func_sin" = x""yes; then + ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin" +if test "x$ac_cv_func_sin" = xyes; then : MATH_LIBS="" else MATH_LIBS="-lm" fi - { $as_echo "$as_me:$LINENO: checking for main in -lieee" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lieee" >&5 $as_echo_n "checking for main in -lieee... " >&6; } -if test "${ac_cv_lib_ieee_main+set}" = set; then +if ${ac_cv_lib_ieee_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5645,43 +5111,18 @@ return main (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ieee_main=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_ieee_main=no + ac_cv_lib_ieee_main=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ieee_main" >&5 $as_echo "$ac_cv_lib_ieee_main" >&6; } -if test "x$ac_cv_lib_ieee_main" = x""yes; then +if test "x$ac_cv_lib_ieee_main" = xyes; then : MATH_LIBS="-lieee $MATH_LIBS" fi @@ -5691,18 +5132,14 @@ fi # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- - { $as_echo "$as_me:$LINENO: checking for main in -linet" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -linet" >&5 $as_echo_n "checking for main in -linet... " >&6; } -if test "${ac_cv_lib_inet_main+set}" = set; then +if ${ac_cv_lib_inet_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5714,179 +5151,26 @@ return main (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_inet_main=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_inet_main=no + ac_cv_lib_inet_main=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_main" >&5 $as_echo "$ac_cv_lib_inet_main" >&6; } -if test "x$ac_cv_lib_inet_main" = x""yes; then +if test "x$ac_cv_lib_inet_main" = xyes; then : LIBS="$LIBS -linet" fi - if test "${ac_cv_header_net_errno_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for net/errno.h" >&5 -$as_echo_n "checking for net/errno.h... " >&6; } -if test "${ac_cv_header_net_errno_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 -$as_echo "$ac_cv_header_net_errno_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking net/errno.h usability" >&5 -$as_echo_n "checking net/errno.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking net/errno.h presence" >&5 -$as_echo_n "checking net/errno.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for net/errno.h" >&5 -$as_echo_n "checking for net/errno.h... " >&6; } -if test "${ac_cv_header_net_errno_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_net_errno_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 -$as_echo "$ac_cv_header_net_errno_h" >&6; } - -fi -if test "x$ac_cv_header_net_errno_h" = x""yes; then + ac_fn_c_check_header_mongrel "$LINENO" "net/errno.h" "ac_cv_header_net_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_net_errno_h" = xyes; then : -cat >>confdefs.h <<\_ACEOF -#define HAVE_NET_ERRNO_H 1 -_ACEOF +$as_echo "#define HAVE_NET_ERRNO_H 1" >>confdefs.h fi @@ -5911,198 +5195,26 @@ fi #-------------------------------------------------------------------- tcl_checkBoth=0 - { $as_echo "$as_me:$LINENO: checking for connect" >&5 -$as_echo_n "checking for connect... " >&6; } -if test "${ac_cv_func_connect+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define connect to an innocuous variant, in case declares connect. - For example, HP-UX 11i declares gettimeofday. */ -#define connect innocuous_connect - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef connect - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char connect (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_connect || defined __stub___connect -choke me -#endif - -int -main () -{ -return connect (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_connect=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_connect=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 -$as_echo "$ac_cv_func_connect" >&6; } -if test "x$ac_cv_func_connect" = x""yes; then + ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" +if test "x$ac_cv_func_connect" = xyes; then : tcl_checkSocket=0 else tcl_checkSocket=1 fi if test "$tcl_checkSocket" = 1; then - { $as_echo "$as_me:$LINENO: checking for setsockopt" >&5 -$as_echo_n "checking for setsockopt... " >&6; } -if test "${ac_cv_func_setsockopt+set}" = set; then - $as_echo_n "(cached) " >&6 + ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt" +if test "x$ac_cv_func_setsockopt" = xyes; then : + else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define setsockopt to an innocuous variant, in case declares setsockopt. - For example, HP-UX 11i declares gettimeofday. */ -#define setsockopt innocuous_setsockopt - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char setsockopt (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef setsockopt - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char setsockopt (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_setsockopt || defined __stub___setsockopt -choke me -#endif - -int -main () -{ -return setsockopt (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_setsockopt=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_setsockopt=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 -$as_echo "$ac_cv_func_setsockopt" >&6; } -if test "x$ac_cv_func_setsockopt" = x""yes; then - : -else - { $as_echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5 $as_echo_n "checking for setsockopt in -lsocket... " >&6; } -if test "${ac_cv_lib_socket_setsockopt+set}" = set; then +if ${ac_cv_lib_socket_setsockopt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -6120,43 +5232,18 @@ return setsockopt (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_setsockopt=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_socket_setsockopt=no + ac_cv_lib_socket_setsockopt=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5 $as_echo "$ac_cv_lib_socket_setsockopt" >&6; } -if test "x$ac_cv_lib_socket_setsockopt" = x""yes; then +if test "x$ac_cv_lib_socket_setsockopt" = xyes; then : LIBS="$LIBS -lsocket" else tcl_checkBoth=1 @@ -6168,198 +5255,26 @@ fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" - { $as_echo "$as_me:$LINENO: checking for accept" >&5 -$as_echo_n "checking for accept... " >&6; } -if test "${ac_cv_func_accept+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define accept to an innocuous variant, in case declares accept. - For example, HP-UX 11i declares gettimeofday. */ -#define accept innocuous_accept - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char accept (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef accept - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char accept (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_accept || defined __stub___accept -choke me -#endif - -int -main () -{ -return accept (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_accept=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_accept=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 -$as_echo "$ac_cv_func_accept" >&6; } -if test "x$ac_cv_func_accept" = x""yes; then + ac_fn_c_check_func "$LINENO" "accept" "ac_cv_func_accept" +if test "x$ac_cv_func_accept" = xyes; then : tcl_checkNsl=0 else LIBS=$tk_oldLibs fi fi - { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5 -$as_echo_n "checking for gethostbyname... " >&6; } -if test "${ac_cv_func_gethostbyname+set}" = set; then - $as_echo_n "(cached) " >&6 + ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = xyes; then : + else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. - For example, HP-UX 11i declares gettimeofday. */ -#define gethostbyname innocuous_gethostbyname - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef gethostbyname - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_gethostbyname || defined __stub___gethostbyname -choke me -#endif - -int -main () -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_gethostbyname=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_gethostbyname=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 -$as_echo "$ac_cv_func_gethostbyname" >&6; } -if test "x$ac_cv_func_gethostbyname" = x""yes; then - : -else - { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } -if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -6377,43 +5292,18 @@ return gethostbyname (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_nsl_gethostbyname=no + ac_cv_lib_nsl_gethostbyname=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : LIBS="$LIBS -lnsl" fi @@ -6428,17 +5318,13 @@ fi - { $as_echo "$as_me:$LINENO: checking dirent.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dirent.h" >&5 $as_echo_n "checking dirent.h... " >&6; } -if test "${tcl_cv_dirent_h+set}" = set; then +if ${tcl_cv_dirent_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -6468,787 +5354,108 @@ closedir(d); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_dirent_h=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_dirent_h=no + tcl_cv_dirent_h=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_dirent_h" >&5 $as_echo "$tcl_cv_dirent_h" >&6; } if test $tcl_cv_dirent_h = no; then -cat >>confdefs.h <<\_ACEOF -#define NO_DIRENT_H 1 -_ACEOF +$as_echo "#define NO_DIRENT_H 1" >>confdefs.h fi # TEA specific: - if test "${ac_cv_header_errno_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for errno.h" >&5 -$as_echo_n "checking for errno.h... " >&6; } -if test "${ac_cv_header_errno_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 -$as_echo "$ac_cv_header_errno_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking errno.h usability" >&5 -$as_echo_n "checking errno.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking errno.h presence" >&5 -$as_echo_n "checking errno.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for errno.h" >&5 -$as_echo_n "checking for errno.h... " >&6; } -if test "${ac_cv_header_errno_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_errno_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 -$as_echo "$ac_cv_header_errno_h" >&6; } - -fi -if test "x$ac_cv_header_errno_h" = x""yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_ERRNO_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_float_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for float.h" >&5 -$as_echo_n "checking for float.h... " >&6; } -if test "${ac_cv_header_float_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 -$as_echo "$ac_cv_header_float_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking float.h usability" >&5 -$as_echo_n "checking float.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking float.h presence" >&5 -$as_echo_n "checking float.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for float.h" >&5 -$as_echo_n "checking for float.h... " >&6; } -if test "${ac_cv_header_float_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_float_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 -$as_echo "$ac_cv_header_float_h" >&6; } - -fi -if test "x$ac_cv_header_float_h" = x""yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_FLOAT_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_values_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for values.h" >&5 -$as_echo_n "checking for values.h... " >&6; } -if test "${ac_cv_header_values_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 -$as_echo "$ac_cv_header_values_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking values.h usability" >&5 -$as_echo_n "checking values.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking values.h presence" >&5 -$as_echo_n "checking values.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for values.h" >&5 -$as_echo_n "checking for values.h... " >&6; } -if test "${ac_cv_header_values_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_values_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 -$as_echo "$ac_cv_header_values_h" >&6; } - -fi -if test "x$ac_cv_header_values_h" = x""yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_VALUES_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_limits_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for limits.h" >&5 -$as_echo_n "checking for limits.h... " >&6; } -if test "${ac_cv_header_limits_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 -$as_echo "$ac_cv_header_limits_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking limits.h usability" >&5 -$as_echo_n "checking limits.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking limits.h presence" >&5 -$as_echo_n "checking limits.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for limits.h" >&5 -$as_echo_n "checking for limits.h... " >&6; } -if test "${ac_cv_header_limits_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_limits_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 -$as_echo "$ac_cv_header_limits_h" >&6; } - -fi -if test "x$ac_cv_header_limits_h" = x""yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIMITS_H 1 -_ACEOF + ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes; then : else -cat >>confdefs.h <<\_ACEOF -#define NO_LIMITS_H 1 -_ACEOF +$as_echo "#define NO_ERRNO_H 1" >>confdefs.h fi - if test "${ac_cv_header_stdlib_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for stdlib.h" >&5 -$as_echo_n "checking for stdlib.h... " >&6; } -if test "${ac_cv_header_stdlib_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 -$as_echo "$ac_cv_header_stdlib_h" >&6; } + ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" +if test "x$ac_cv_header_float_h" = xyes; then : + else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking stdlib.h usability" >&5 -$as_echo_n "checking stdlib.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + +$as_echo "#define NO_FLOAT_H 1" >>confdefs.h + +fi + + + ac_fn_c_check_header_mongrel "$LINENO" "values.h" "ac_cv_header_values_h" "$ac_includes_default" +if test "x$ac_cv_header_values_h" = xyes; then : + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +$as_echo "#define NO_VALUES_H 1" >>confdefs.h + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking stdlib.h presence" >&5 -$as_echo_n "checking stdlib.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes + ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" +if test "x$ac_cv_header_limits_h" = xyes; then : + +$as_echo "#define HAVE_LIMITS_H 1" >>confdefs.h + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for stdlib.h" >&5 -$as_echo_n "checking for stdlib.h... " >&6; } -if test "${ac_cv_header_stdlib_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_stdlib_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 -$as_echo "$ac_cv_header_stdlib_h" >&6; } +$as_echo "#define NO_LIMITS_H 1" >>confdefs.h fi -if test "x$ac_cv_header_stdlib_h" = x""yes; then + + + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : tcl_ok=1 else tcl_ok=0 fi - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtol" >/dev/null 2>&1; then - : + $EGREP "strtol" >/dev/null 2>&1; then : + else tcl_ok=0 fi rm -f conftest* - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtoul" >/dev/null 2>&1; then - : + $EGREP "strtoul" >/dev/null 2>&1; then : + else tcl_ok=0 fi rm -f conftest* - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtod" >/dev/null 2>&1; then - : + $EGREP "strtod" >/dev/null 2>&1; then : + else tcl_ok=0 fi @@ -7256,174 +5463,38 @@ rm -f conftest* if test $tcl_ok = 0; then -cat >>confdefs.h <<\_ACEOF -#define NO_STDLIB_H 1 -_ACEOF +$as_echo "#define NO_STDLIB_H 1" >>confdefs.h fi - if test "${ac_cv_header_string_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for string.h" >&5 -$as_echo_n "checking for string.h... " >&6; } -if test "${ac_cv_header_string_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 -$as_echo "$ac_cv_header_string_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking string.h usability" >&5 -$as_echo_n "checking string.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking string.h presence" >&5 -$as_echo_n "checking string.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for string.h" >&5 -$as_echo_n "checking for string.h... " >&6; } -if test "${ac_cv_header_string_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_string_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 -$as_echo "$ac_cv_header_string_h" >&6; } - -fi -if test "x$ac_cv_header_string_h" = x""yes; then + ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = xyes; then : tcl_ok=1 else tcl_ok=0 fi - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strstr" >/dev/null 2>&1; then - : + $EGREP "strstr" >/dev/null 2>&1; then : + else tcl_ok=0 fi rm -f conftest* - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strerror" >/dev/null 2>&1; then - : + $EGREP "strerror" >/dev/null 2>&1; then : + else tcl_ok=0 fi @@ -7435,430 +5506,38 @@ rm -f conftest* if test $tcl_ok = 0; then -cat >>confdefs.h <<\_ACEOF -#define NO_STRING_H 1 -_ACEOF +$as_echo "#define NO_STRING_H 1" >>confdefs.h fi - if test "${ac_cv_header_sys_wait_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for sys/wait.h" >&5 -$as_echo_n "checking for sys/wait.h... " >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -$as_echo "$ac_cv_header_sys_wait_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 -$as_echo_n "checking sys/wait.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_wait_h" = xyes; then : - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 -$as_echo_n "checking sys/wait.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for sys/wait.h" >&5 -$as_echo_n "checking for sys/wait.h... " >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_sys_wait_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -$as_echo "$ac_cv_header_sys_wait_h" >&6; } - -fi -if test "x$ac_cv_header_sys_wait_h" = x""yes; then - : else -cat >>confdefs.h <<\_ACEOF -#define NO_SYS_WAIT_H 1 -_ACEOF +$as_echo "#define NO_SYS_WAIT_H 1" >>confdefs.h fi - if test "${ac_cv_header_dlfcn_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for dlfcn.h" >&5 -$as_echo_n "checking for dlfcn.h... " >&6; } -if test "${ac_cv_header_dlfcn_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 -$as_echo "$ac_cv_header_dlfcn_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 -$as_echo_n "checking dlfcn.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 -$as_echo_n "checking dlfcn.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for dlfcn.h" >&5 -$as_echo_n "checking for dlfcn.h... " >&6; } -if test "${ac_cv_header_dlfcn_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_dlfcn_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 -$as_echo "$ac_cv_header_dlfcn_h" >&6; } - -fi -if test "x$ac_cv_header_dlfcn_h" = x""yes; then - : else -cat >>confdefs.h <<\_ACEOF -#define NO_DLFCN_H 1 -_ACEOF +$as_echo "#define NO_DLFCN_H 1" >>confdefs.h fi # OS/390 lacks sys/param.h (and doesn't need it, by chance). - -for ac_header in sys/param.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then + for ac_header in sys/param.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_SYS_PARAM_H 1 _ACEOF fi @@ -7888,6 +5567,8 @@ done ../backend/2of5.c ../backend/auspost.c ../backend/aztec.c + ../backend/bmp.c + ../backend/codablock.c ../backend/code128.c ../backend/code16k.c ../backend/code1.c @@ -7897,25 +5578,40 @@ done ../backend/composite.c ../backend/dllversion.c ../backend/dmatrix.c + ../backend/dotcode.c + ../backend/eci.c + ../backend/emf.c + ../backend/gb18030.c + ../backend/gb2312.c + ../backend/general_field.c + ../backend/gif.c ../backend/gridmtx.c ../backend/gs1.c + ../backend/hanxin.c ../backend/imail.c ../backend/large.c ../backend/library.c + ../backend/mailmark.c ../backend/maxicode.c ../backend/medical.c + ../backend/output.c + ../backend/pcx.c ../backend/pdf417.c ../backend/plessey.c ../backend/png.c ../backend/postal.c ../backend/ps.c ../backend/qr.c + ../backend/raster.c ../backend/reedsol.c - ../backend/render.c ../backend/rss.c + ../backend/sjis.c ../backend/svg.c ../backend/telepen.c + ../backend/tif.c + ../backend/ultra.c ../backend/upcean.c + ../backend/vector.c zint.c " for i in $vars; do @@ -7933,9 +5629,7 @@ done -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ -a ! -f "${srcdir}/macosx/$i" -a ! -f "${srcdir}/sdl/$i" \ ; then - { { $as_echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 -$as_echo "$as_me: error: could not find source file '$i'" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not find source file '$i'" "$LINENO" 5 fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir @@ -7965,9 +5659,7 @@ $as_echo "$as_me: error: could not find source file '$i'" >&2;} -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ -a ! -f "${srcdir}/macosx/$i" -a ! -f "${srcdir}/sdl/$i" \ ; then - { { $as_echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 -$as_echo "$as_me: error: could not find stub source file '$i'" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not find stub source file '$i'" "$LINENO" 5 fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir @@ -7988,9 +5680,7 @@ $as_echo "$as_me: error: could not find stub source file '$i'" >&2;} for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then - { { $as_echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 -$as_echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not find tcl source file '${srcdir}/$i'" "$LINENO" 5 fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done @@ -8007,17 +5697,17 @@ $as_echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} #-------------------------------------------------------------------- - { $as_echo "$as_me:$LINENO: checking for Tcl public headers" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl public headers" >&5 $as_echo_n "checking for Tcl public headers... " >&6; } # Check whether --with-tclinclude was given. -if test "${with_tclinclude+set}" = set; then +if test "${with_tclinclude+set}" = set; then : withval=$with_tclinclude; with_tclinclude=${withval} fi - if test "${ac_cv_c_tclh+set}" = set; then + if ${ac_cv_c_tclh+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8027,9 +5717,7 @@ else if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else - { { $as_echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 -$as_echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "${with_tclinclude} directory does not contain tcl.h" "$LINENO" 5 fi else list="" @@ -8078,11 +5766,9 @@ fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then - { { $as_echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 -$as_echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "tcl.h not found. Please specify its location with --with-tclinclude" "$LINENO" 5 else - { $as_echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tclh}" >&5 $as_echo "${ac_cv_c_tclh}" >&6; } fi @@ -8095,17 +5781,17 @@ $as_echo "${ac_cv_c_tclh}" >&6; } - { $as_echo "$as_me:$LINENO: checking for Tk public headers" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk public headers" >&5 $as_echo_n "checking for Tk public headers... " >&6; } # Check whether --with-tkinclude was given. -if test "${with_tkinclude+set}" = set; then +if test "${with_tkinclude+set}" = set; then : withval=$with_tkinclude; with_tkinclude=${withval} fi - if test "${ac_cv_c_tkh+set}" = set; then + if ${ac_cv_c_tkh+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8115,9 +5801,7 @@ else if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else - { { $as_echo "$as_me:$LINENO: error: ${with_tkinclude} directory does not contain tk.h" >&5 -$as_echo "$as_me: error: ${with_tkinclude} directory does not contain tk.h" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "${with_tkinclude} directory does not contain tk.h" "$LINENO" 5 fi else list="" @@ -8169,11 +5853,9 @@ fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then - { { $as_echo "$as_me:$LINENO: error: tk.h not found. Please specify its location with --with-tkinclude" >&5 -$as_echo "$as_me: error: tk.h not found. Please specify its location with --with-tkinclude" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "tk.h not found. Please specify its location with --with-tkinclude" "$LINENO" 5 else - { $as_echo "$as_me:$LINENO: result: ${ac_cv_c_tkh}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tkh}" >&5 $as_echo "${ac_cv_c_tkh}" >&6; } fi @@ -8187,14 +5869,14 @@ $as_echo "${ac_cv_c_tkh}" >&6; } if test "${TEA_WINDOWINGSYSTEM}" != "x11" -o "${TEA_USE_SDL}" = "yes" ; then # On Windows and Aqua, we need the X compat headers - { $as_echo "$as_me:$LINENO: checking for X11 header files" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 header files" >&5 $as_echo_n "checking for X11 header files... " >&6; } if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" fi - { $as_echo "$as_me:$LINENO: result: ${INCLUDE_DIR_NATIVE}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${INCLUDE_DIR_NATIVE}" >&5 $as_echo "${INCLUDE_DIR_NATIVE}" >&6; } fi @@ -8232,7 +5914,7 @@ $as_echo "${INCLUDE_DIR_NATIVE}" >&6; } # Check whether --enable-threads was given. -if test "${enable_threads+set}" = set; then +if test "${enable_threads+set}" = set; then : enableval=$enable_threads; tcl_ok=$enableval else tcl_ok=yes @@ -8255,39 +5937,27 @@ fi # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention -cat >>confdefs.h <<\_ACEOF -#define USE_THREAD_ALLOC 1 -_ACEOF +$as_echo "#define USE_THREAD_ALLOC 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF +$as_echo "#define _REENTRANT 1" >>confdefs.h if test "`uname -s`" = "SunOS" ; then -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF +$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h fi -cat >>confdefs.h <<\_ACEOF -#define _THREAD_SAFE 1 -_ACEOF +$as_echo "#define _THREAD_SAFE 1" >>confdefs.h - { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 $as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then +if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -8305,43 +5975,18 @@ return pthread_mutex_init (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_mutex_init=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_pthread_pthread_mutex_init=no + ac_cv_lib_pthread_pthread_mutex_init=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthread_pthread_mutex_init" = x""yes; then +if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no @@ -8353,18 +5998,14 @@ fi # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] - { $as_echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5 $as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then +if ${ac_cv_lib_pthread___pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -8382,43 +6023,18 @@ return __pthread_mutex_init (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread___pthread_mutex_init=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_pthread___pthread_mutex_init=no + ac_cv_lib_pthread___pthread_mutex_init=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthread___pthread_mutex_init" = x""yes; then +if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no @@ -8430,18 +6046,14 @@ fi # The space is needed THREADS_LIBS=" -lpthread" else - { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5 $as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; } -if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then +if ${ac_cv_lib_pthreads_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -8459,43 +6071,18 @@ return pthread_mutex_init (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthreads_pthread_mutex_init=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_pthreads_pthread_mutex_init=no + ac_cv_lib_pthreads_pthread_mutex_init=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = x""yes; then +if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no @@ -8505,18 +6092,14 @@ fi # The space is needed THREADS_LIBS=" -lpthreads" else - { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5 $as_echo_n "checking for pthread_mutex_init in -lc... " >&6; } -if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then +if ${ac_cv_lib_c_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -8534,61 +6117,32 @@ return pthread_mutex_init (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_pthread_mutex_init=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_c_pthread_mutex_init=no + ac_cv_lib_c_pthread_mutex_init=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_c_pthread_mutex_init" = x""yes; then +if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then - { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5 $as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; } -if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then +if ${ac_cv_lib_c_r_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -8606,43 +6160,18 @@ return pthread_mutex_init (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_r_pthread_mutex_init=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_c_r_pthread_mutex_init=no + ac_cv_lib_c_r_pthread_mutex_init=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_c_r_pthread_mutex_init" = x""yes; then +if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no @@ -8653,7 +6182,7 @@ fi THREADS_LIBS=" -pthread" else TCL_THREADS=0 - { $as_echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 $as_echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} fi fi @@ -8664,18 +6193,16 @@ $as_echo "$as_me: WARNING: Do not know how to find pthread lib on your system - TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output - { $as_echo "$as_me:$LINENO: checking for building with threads" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for building with threads" >&5 $as_echo_n "checking for building with threads... " >&6; } if test "${TCL_THREADS}" = 1; then -cat >>confdefs.h <<\_ACEOF -#define TCL_THREADS 1 -_ACEOF +$as_echo "#define TCL_THREADS 1" >>confdefs.h - { $as_echo "$as_me:$LINENO: result: yes (default)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # TCL_THREADS sanity checking. See if our request for building with @@ -8683,7 +6210,7 @@ $as_echo "no" >&6; } case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then - { $as_echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&5 $as_echo "$as_me: WARNING: @@ -8693,7 +6220,7 @@ $as_echo "$as_me: WARNING: ;; *) if test "${TCL_THREADS}" = "1"; then - { $as_echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&5 @@ -8713,10 +6240,10 @@ $as_echo "$as_me: WARNING: #-------------------------------------------------------------------- - { $as_echo "$as_me:$LINENO: checking how to build libraries" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 $as_echo_n "checking how to build libraries... " >&6; } # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then +if test "${enable_shared+set}" = set; then : enableval=$enable_shared; tcl_ok=$enableval else tcl_ok=yes @@ -8731,17 +6258,15 @@ fi fi if test "$tcl_ok" = "yes" ; then - { $as_echo "$as_me:$LINENO: result: shared" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5 $as_echo "shared" >&6; } SHARED_BUILD=1 else - { $as_echo "$as_me:$LINENO: result: static" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 $as_echo "static" >&6; } SHARED_BUILD=0 -cat >>confdefs.h <<\_ACEOF -#define STATIC_BUILD 1 -_ACEOF +$as_echo "#define STATIC_BUILD 1" >>confdefs.h fi @@ -8756,9 +6281,9 @@ _ACEOF if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -8769,24 +6294,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -8796,9 +6321,9 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -8809,24 +6334,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -8835,7 +6360,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -8850,52 +6375,47 @@ fi # Step 0.a: Enable 64 bit support? - { $as_echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 $as_echo_n "checking if 64bit support is requested... " >&6; } # Check whether --enable-64bit was given. -if test "${enable_64bit+set}" = set; then +if test "${enable_64bit+set}" = set; then : enableval=$enable_64bit; do64bit=$enableval else do64bit=no fi - { $as_echo "$as_me:$LINENO: result: $do64bit" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 $as_echo "$do64bit" >&6; } # Step 0.b: Enable Solaris 64 bit VIS support? - { $as_echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5 $as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; } # Check whether --enable-64bit-vis was given. -if test "${enable_64bit_vis+set}" = set; then +if test "${enable_64bit_vis+set}" = set; then : enableval=$enable_64bit_vis; do64bitVIS=$enableval else do64bitVIS=no fi - { $as_echo "$as_me:$LINENO: result: $do64bitVIS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5 $as_echo "$do64bitVIS" >&6; } # Force 64bit on with VIS - if test "$do64bitVIS" = "yes"; then + if test "$do64bitVIS" = "yes"; then : do64bit=yes fi - # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. - { $as_echo "$as_me:$LINENO: checking if compiler supports visibility \"hidden\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5 $as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; } -if test "${tcl_cv_cc_visibility_hidden+set}" = set; then +if ${tcl_cv_cc_visibility_hidden+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern __attribute__((__visibility__("hidden"))) void f(void); @@ -8908,98 +6428,67 @@ f(); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_visibility_hidden=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_cc_visibility_hidden=no + tcl_cv_cc_visibility_hidden=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5 $as_echo "$tcl_cv_cc_visibility_hidden" >&6; } - if test $tcl_cv_cc_visibility_hidden = yes; then + if test $tcl_cv_cc_visibility_hidden = yes; then : -cat >>confdefs.h <<\_ACEOF -#define MODULE_SCOPE extern __attribute__((__visibility__("hidden"))) -_ACEOF +$as_echo "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define HAVE_HIDDEN 1 -_ACEOF +$as_echo "#define HAVE_HIDDEN 1" >>confdefs.h fi - # Step 0.d: Disable -rpath support? - { $as_echo "$as_me:$LINENO: checking if rpath support is requested" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5 $as_echo_n "checking if rpath support is requested... " >&6; } # Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then +if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; doRpath=$enableval else doRpath=yes fi - { $as_echo "$as_me:$LINENO: result: $doRpath" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5 $as_echo "$doRpath" >&6; } # TEA specific: Cross-compiling options for Windows/CE builds? - if test "${TEA_PLATFORM}" = windows; then + if test "${TEA_PLATFORM}" = windows; then : - { $as_echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Windows/CE build is requested" >&5 $as_echo_n "checking if Windows/CE build is requested... " >&6; } # Check whether --enable-wince was given. -if test "${enable_wince+set}" = set; then +if test "${enable_wince+set}" = set; then : enableval=$enable_wince; doWince=$enableval else doWince=no fi - { $as_echo "$as_me:$LINENO: result: $doWince" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doWince" >&5 $as_echo "$doWince" >&6; } fi - # Set the variable "system" to hold the name and version number # for the system. - { $as_echo "$as_me:$LINENO: checking system version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5 $as_echo_n "checking system version... " >&6; } -if test "${tcl_cv_sys_version+set}" = set; then +if ${tcl_cv_sys_version+:} false; then : $as_echo_n "(cached) " >&6 else @@ -9009,7 +6498,7 @@ else else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then - { $as_echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 $as_echo "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else @@ -9020,7 +6509,7 @@ $as_echo "$as_me: WARNING: can't find uname command" >&2;} fi fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 $as_echo "$tcl_cv_sys_version" >&6; } system=$tcl_cv_sys_version @@ -9046,7 +6535,7 @@ $as_echo "$tcl_cv_sys_version" >&6; } ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g - if test "$GCC" = yes; then + if test "$GCC" = yes; then : CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall" @@ -9057,14 +6546,13 @@ else CFLAGS_WARNING="" fi - CC_OBJNAME="-o \$@" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -9075,24 +6563,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:$LINENO: result: $AR" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -9102,9 +6590,9 @@ if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then @@ -9115,24 +6603,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -9141,7 +6629,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -9153,10 +6641,9 @@ fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" - if test "x$SHLIB_VERSION" = x; then + if test "x$SHLIB_VERSION" = x; then : SHLIB_VERSION="1.0" fi - case $system in # TEA specific: windows) @@ -9183,13 +6670,13 @@ fi ;; esac if test "$GCC" != "yes" -a ! -d "${PATH64}" ; then - { $as_echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 $as_echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ensure latest Platform SDK is installed" >&5 $as_echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} do64bit="no" else - { $as_echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 $as_echo " Using 64-bit $MACHINE mode" >&6; } do64bit_ok="yes" fi @@ -9197,14 +6684,10 @@ $as_echo " Using 64-bit $MACHINE mode" >&6; } if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then - { { $as_echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 -$as_echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "Windows/CE and 64-bit builds incompatible" "$LINENO" 5 fi if test "$GCC" = "yes" ; then - { { $as_echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 -$as_echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "Windows/CE and GCC builds incompatible" "$LINENO" 5 fi # First, look for one uninstalled. @@ -9215,13 +6698,13 @@ $as_echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} no_celib=true # Check whether --with-celib was given. -if test "${with_celib+set}" = set; then +if test "${with_celib+set}" = set; then : withval=$with_celib; with_celibconfig=${withval} fi - { $as_echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Windows/CE celib directory" >&5 $as_echo_n "checking for Windows/CE celib directory... " >&6; } - if test "${ac_cv_c_celibconfig+set}" = set; then + if ${ac_cv_c_celibconfig+:} false; then : $as_echo_n "(cached) " >&6 else @@ -9230,9 +6713,7 @@ else if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else - { { $as_echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 -$as_echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "${with_celibconfig} directory doesn't contain inc directory" "$LINENO" 5 fi fi @@ -9258,14 +6739,12 @@ $as_echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc direc fi if test x"${ac_cv_c_celibconfig}" = x ; then - { { $as_echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 -$as_echo "$as_me: error: Cannot find celib support library directory" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "Cannot find celib support library directory" "$LINENO" 5 else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` - { $as_echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $CELIB_DIR" >&5 $as_echo "found $CELIB_DIR" >&6; } fi fi @@ -9308,9 +6787,7 @@ $as_echo "found $CELIB_DIR" >&6; } SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then - { { $as_echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 -$as_echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" "$LINENO" 5 doWince="no" else # We could PATH_NOSPACE these, but that's not important, @@ -9404,9 +6881,9 @@ _ACEOF if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RC+set}" = set; then +if ${ac_cv_prog_RC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RC"; then @@ -9417,24 +6894,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RC="${ac_tool_prefix}windres" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi RC=$ac_cv_prog_RC if test -n "$RC"; then - { $as_echo "$as_me:$LINENO: result: $RC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RC" >&5 $as_echo "$RC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -9444,9 +6921,9 @@ if test -z "$ac_cv_prog_RC"; then ac_ct_RC=$RC # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RC+set}" = set; then +if ${ac_cv_prog_ac_ct_RC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RC"; then @@ -9457,24 +6934,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RC="windres" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_RC=$ac_cv_prog_ac_ct_RC if test -n "$ac_ct_RC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5 $as_echo "$ac_ct_RC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -9483,7 +6960,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -9500,16 +6977,12 @@ fi LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" - { $as_echo "$as_me:$LINENO: checking for cross-compile version of gcc" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cross-compile version of gcc" >&5 $as_echo_n "checking for cross-compile version of gcc... " >&6; } -if test "${ac_cv_cross+set}" = set; then +if ${ac_cv_cross+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _WIN32 @@ -9524,36 +6997,15 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_cross=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_cross=no + ac_cv_cross=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cross" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cross" >&5 $as_echo "$ac_cv_cross" >&6; } if test "$ac_cv_cross" = "yes"; then case "$do64bit" in @@ -9605,7 +7057,7 @@ $as_echo "$ac_cv_cross" >&6; } TCL_LIB_VERSIONS_OK=nodots ;; AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then : # AIX requires the _r compiler when gcc isn't being used case "${CC}" in @@ -9617,11 +7069,10 @@ $as_echo "$ac_cv_cross" >&6; } CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'` ;; esac - { $as_echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5 $as_echo "Using $CC for compiling with threads" >&6; } fi - LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" @@ -9629,11 +7080,11 @@ fi LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes; then + if test "$do64bit" = yes; then : - if test "$GCC" = yes; then + if test "$GCC" = yes; then : - { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else @@ -9647,15 +7098,13 @@ else fi - fi - - if test "`uname -m`" = ia64; then + if test "`uname -m`" = ia64; then : # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" - if test "$GCC" = yes; then + if test "$GCC" = yes; then : CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' @@ -9664,12 +7113,11 @@ else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else - if test "$GCC" = yes; then + if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared -Wl,-bexpall' @@ -9679,13 +7127,11 @@ else LDFLAGS="$LDFLAGS -brtl" fi - SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi - ;; BeOS*) SHLIB_CFLAGS="-fPIC" @@ -9697,18 +7143,14 @@ fi # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- - { $as_echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5 $as_echo_n "checking for inet_ntoa in -lbind... " >&6; } -if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then +if ${ac_cv_lib_bind_inet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -9726,43 +7168,18 @@ return inet_ntoa (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bind_inet_ntoa=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_bind_inet_ntoa=no + ac_cv_lib_bind_inet_ntoa=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5 $as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; } -if test "x$ac_cv_lib_bind_inet_ntoa" = x""yes; then +if test "x$ac_cv_lib_bind_inet_ntoa" = xyes; then : LIBS="$LIBS -lbind -lsocket" fi @@ -9789,18 +7206,14 @@ fi SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}' - { $as_echo "$as_me:$LINENO: checking for inet_ntoa in -lnetwork" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5 $as_echo_n "checking for inet_ntoa in -lnetwork... " >&6; } -if test "${ac_cv_lib_network_inet_ntoa+set}" = set; then +if ${ac_cv_lib_network_inet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -9818,43 +7231,18 @@ return inet_ntoa (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_network_inet_ntoa=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_network_inet_ntoa=no + ac_cv_lib_network_inet_ntoa=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_network_inet_ntoa" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5 $as_echo "$ac_cv_lib_network_inet_ntoa" >&6; } -if test "x$ac_cv_lib_network_inet_ntoa" = x""yes; then +if test "x$ac_cv_lib_network_inet_ntoa" = xyes; then : LIBS="$LIBS -lnetwork" fi @@ -9862,15 +7250,13 @@ fi HP-UX-*.11.*) # Use updated header definitions where possible -cat >>confdefs.h <<\_ACEOF -#define _XOPEN_SOURCE_EXTENDED 1 -_ACEOF +$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h # TEA specific: Needed by Tcl, but not most extensions #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) #LIBS="$LIBS -lxnet" # Use the XOPEN network library - if test "`uname -m`" = ia64; then + if test "`uname -m`" = ia64; then : SHLIB_SUFFIX=".so" # Use newer C++ library for C++ extensions @@ -9883,19 +7269,14 @@ else SHLIB_SUFFIX=".sl" fi - - { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then +if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -9913,49 +7294,24 @@ return shl_load (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dld_shl_load=no + ac_cv_lib_dld_shl_load=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : tcl_ok=yes else tcl_ok=no fi - if test "$tcl_ok" = yes; then + if test "$tcl_ok" = yes; then : LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' @@ -9963,8 +7319,7 @@ fi LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi - - if test "$GCC" = yes; then + if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} @@ -9979,26 +7334,24 @@ else fi - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes"; then + if test "$do64bit" = "yes"; then : - if test "$GCC" = yes; then + if test "$GCC" = yes; then : case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) - { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} ;; esac @@ -10011,20 +7364,17 @@ else fi - -fi - ;; +fi ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - - if test "$GCC" = yes; then + if test "$GCC" = yes; then : CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" @@ -10043,26 +7393,24 @@ else LDFLAGS="$LDFLAGS -n32" fi - ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes; then + if test "$do64bit" = yes; then : - if test "$GCC" = yes; then + if test "$GCC" = yes; then : - { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else @@ -10074,9 +7422,7 @@ else fi - fi - ;; Linux*|GNU*|NetBSD-Debian) SHLIB_CFLAGS="-fPIC" @@ -10099,31 +7445,25 @@ fi else LDFLAGS="$LDFLAGS -Wl,--export-dynamic" fi - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha"; then + if test "`uname -m`" = "alpha"; then : CFLAGS="$CFLAGS -mieee" fi + if test $do64bit = yes; then : - if test $do64bit = yes; then - - { $as_echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5 $as_echo_n "checking if compiler accepts -m64 flag... " >&6; } -if test "${tcl_cv_cc_m64+set}" = set; then +if ${tcl_cv_cc_m64+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10134,63 +7474,35 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_m64=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_cc_m64=no + tcl_cv_cc_m64=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5 $as_echo "$tcl_cv_cc_m64" >&6; } - if test $tcl_cv_cc_m64 = yes; then + if test $tcl_cv_cc_m64 = yes; then : CFLAGS="$CFLAGS -m64" do64bit_ok=yes fi - fi - # The combo of gcc + glibc has a bug related to inlining of # functions like strtod(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x; then + if test x"${USE_COMPAT}" != x; then : CFLAGS="$CFLAGS -fno-inline" fi - ;; Lynx*) SHLIB_CFLAGS="-fPIC" @@ -10198,12 +7510,11 @@ fi CFLAGS_OPTIMIZE=-02 SHLIB_LD='${CC} -shared' LD_FLAGS="-Wl,--export-dynamic" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - ;; OpenBSD-*) arch=`arch -s` @@ -10217,11 +7528,10 @@ fi SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_SUFFIX=".so" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' LDFLAGS="-Wl,-export-dynamic" @@ -10235,7 +7545,7 @@ fi CFLAGS_OPTIMIZE="-O2" ;; esac - if test "${TCL_THREADS}" = "1"; then + if test "${TCL_THREADS}" = "1"; then : # On OpenBSD: Compile with -pthread # Don't link with -lpthread @@ -10243,7 +7553,6 @@ fi CFLAGS="$CFLAGS -pthread" fi - # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots @@ -10254,13 +7563,12 @@ fi SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_SUFFIX=".so" LDFLAGS="$LDFLAGS -export-dynamic" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "${TCL_THREADS}" = "1"; then + if test "${TCL_THREADS}" = "1"; then : # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` @@ -10268,7 +7576,6 @@ fi LDFLAGS="$LDFLAGS -pthread" fi - ;; FreeBSD-*) # This configuration from FreeBSD Ports. @@ -10278,20 +7585,18 @@ fi TK_SHLIB_LD_EXTRAS="-Wl,-soname,\$@" SHLIB_SUFFIX=".so" LDFLAGS="" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - - if test "${TCL_THREADS}" = "1"; then + if test "${TCL_THREADS}" = "1"; then : # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS" fi - case $system in FreeBSD-3.*) # Version numbers are dot-stripped by system policy. @@ -10314,23 +7619,19 @@ fi CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" - if test $do64bit = yes; then + if test $do64bit = yes; then : case `arch` in ppc) - { $as_echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5 $as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; } -if test "${tcl_cv_cc_arch_ppc64+set}" = set; then +if ${tcl_cv_cc_arch_ppc64+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10341,63 +7642,33 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_ppc64=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_cc_arch_ppc64=no + tcl_cv_cc_arch_ppc64=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5 $as_echo "$tcl_cv_cc_arch_ppc64" >&6; } - if test $tcl_cv_cc_arch_ppc64 = yes; then + if test $tcl_cv_cc_arch_ppc64 = yes; then : CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes -fi -;; +fi;; i386) - { $as_echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5 $as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; } -if test "${tcl_cv_cc_arch_x86_64+set}" = set; then +if ${tcl_cv_cc_arch_x86_64+:} false; then : $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10408,51 +7679,25 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_x86_64=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_cc_arch_x86_64=no + tcl_cv_cc_arch_x86_64=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5 $as_echo "$tcl_cv_cc_arch_x86_64" >&6; } - if test $tcl_cv_cc_arch_x86_64 = yes; then + if test $tcl_cv_cc_arch_x86_64 = yes; then : CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes -fi -;; +fi;; *) - { $as_echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 $as_echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; esac @@ -10460,29 +7705,23 @@ else # Check for combined 32-bit and 64-bit fat build if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ - && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then + && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then : fat_32_64=yes fi - fi - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' - { $as_echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5 $as_echo_n "checking if ld accepts -single_module flag... " >&6; } -if test "${tcl_cv_ld_single_module+set}" = set; then +if ${tcl_cv_ld_single_module+:} false; then : $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10493,73 +7732,42 @@ int i; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_single_module=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_ld_single_module=no + tcl_cv_ld_single_module=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5 $as_echo "$tcl_cv_ld_single_module" >&6; } - if test $tcl_cv_ld_single_module = yes; then + if test $tcl_cv_ld_single_module = yes; then : SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi - # TEA specific: link shlib with current and compatibility version flags vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([0-9]\{1,5\}\)\(\(\.[0-9]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d` SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}" SHLIB_SUFFIX=".dylib" # Don't use -prebind when building for Mac OS X 10.4 or later only: if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ - "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then : LDFLAGS="$LDFLAGS -prebind" fi - LDFLAGS="$LDFLAGS -headerpad_max_install_names" - { $as_echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5 $as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; } -if test "${tcl_cv_ld_search_paths_first+set}" = set; then +if ${tcl_cv_ld_search_paths_first+:} false; then : $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10570,71 +7778,42 @@ int i; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_search_paths_first=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_ld_search_paths_first=no + tcl_cv_ld_search_paths_first=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5 $as_echo "$tcl_cv_ld_search_paths_first" >&6; } - if test $tcl_cv_ld_search_paths_first = yes; then + if test $tcl_cv_ld_search_paths_first = yes; then : LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi - - if test "$tcl_cv_cc_visibility_hidden" != yes; then + if test "$tcl_cv_cc_visibility_hidden" != yes; then : -cat >>confdefs.h <<\_ACEOF -#define MODULE_SCOPE __private_extern__ -_ACEOF +$as_echo "#define MODULE_SCOPE __private_extern__" >>confdefs.h tcl_cv_cc_visibility_hidden=yes fi - CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" # TEA specific: for combined 32 & 64 bit fat builds of Tk # extensions, verify that 64-bit build is possible. - if test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"; then + if test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"; then : - if test "${TEA_WINDOWINGSYSTEM}" = x11; then + if test "${TEA_WINDOWINGSYSTEM}" = x11; then : - { $as_echo "$as_me:$LINENO: checking for 64-bit X11" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit X11" >&5 $as_echo_n "checking for 64-bit X11... " >&6; } -if test "${tcl_cv_lib_x11_64+set}" = set; then +if ${tcl_cv_lib_x11_64+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10643,11 +7822,7 @@ else done CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -10658,52 +7833,26 @@ XrmInitialize(); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_x11_64=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_lib_x11_64=no + tcl_cv_lib_x11_64=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_lib_x11_64" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_x11_64" >&5 $as_echo "$tcl_cv_lib_x11_64" >&6; } fi + if test "${TEA_WINDOWINGSYSTEM}" = aqua; then : - if test "${TEA_WINDOWINGSYSTEM}" = aqua; then - - { $as_echo "$as_me:$LINENO: checking for 64-bit Tk" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit Tk" >&5 $as_echo_n "checking for 64-bit Tk... " >&6; } -if test "${tcl_cv_lib_tk_64+set}" = set; then +if ${tcl_cv_lib_tk_64+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10712,11 +7861,7 @@ else done CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}" LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -10727,74 +7872,44 @@ Tk_InitStubs(NULL, "", 0); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_tk_64=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_lib_tk_64=no + tcl_cv_lib_tk_64=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_lib_tk_64" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_tk_64" >&5 $as_echo "$tcl_cv_lib_tk_64" >&6; } fi - # remove 64-bit arch flags from CFLAGS et al. if configuration # does not support 64-bit. - if test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no; then + if test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no; then : - { $as_echo "$as_me:$LINENO: Removing 64-bit architectures from compiler & linker flags" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Removing 64-bit architectures from compiler & linker flags" >&5 $as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done fi - fi - ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy -cat >>confdefs.h <<\_ACEOF -#define _OE_SOCKETS 1 -_ACEOF +$as_echo "#define _OE_SOCKETS 1" >>confdefs.h ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = 1; then + if test "$SHARED_BUILD" = 1; then : SHLIB_LD='ld -shared -expect_unresolved "*"' @@ -10803,28 +7918,25 @@ else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi - SHLIB_SUFFIX=".so" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - - if test "$GCC" = yes; then + if test "$GCC" = yes; then : CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi - # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = 1; then + if test "${TCL_THREADS}" = 1; then : CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = yes; then + if test "$GCC" = yes; then : LIBS="$LIBS -lpthread -lmach -lexc" @@ -10835,9 +7947,7 @@ else fi - fi - ;; QNX-6*) # QNX RTP @@ -10850,7 +7960,7 @@ fi LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) - if test "$GCC" = yes; then + if test "$GCC" = yes; then : SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" @@ -10861,7 +7971,6 @@ else LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi - SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" @@ -10875,19 +7984,15 @@ fi # won't define thread-safe library routines. -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF +$as_echo "#define _REENTRANT 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF +$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" SHLIB_SUFFIX=".so" - if test "$GCC" = yes; then + if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' @@ -10900,36 +8005,31 @@ else LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi - ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF +$as_echo "#define _REENTRANT 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF +$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes; then + if test "$do64bit" = yes; then : arch=`isainfo` - if test "$arch" = "sparcv9 sparc"; then + if test "$arch" = "sparcv9 sparc"; then : - if test "$GCC" = yes; then + if test "$GCC" = yes; then : - if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then + if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then : - { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else @@ -10941,11 +8041,10 @@ else fi - else do64bit_ok=yes - if test "$do64bitVIS" = yes; then + if test "$do64bitVIS" = yes; then : CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" @@ -10956,17 +8055,15 @@ else LDFLAGS_ARCH="-xarch=v9" fi - # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi - else - if test "$arch" = "amd64 i386"; then + if test "$arch" = "amd64 i386"; then : - if test "$GCC" = yes; then + if test "$GCC" = yes; then : case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) @@ -10974,7 +8071,7 @@ else CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) - { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; esac @@ -10992,27 +8089,23 @@ else fi - else - { $as_echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5 $as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi - fi - fi - SHLIB_SUFFIX=".so" - if test "$GCC" = yes; then + if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = yes; then + if test "$do64bit_ok" = yes; then : - if test "$arch" = "sparcv9 sparc"; then + if test "$arch" = "sparcv9 sparc"; then : # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. @@ -11025,20 +8118,17 @@ fi #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" else - if test "$arch" = "amd64 i386"; then + if test "$arch" = "amd64 i386"; then : # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" fi - fi - fi - else case $system in @@ -11052,7 +8142,6 @@ else LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi - ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" @@ -11061,19 +8150,15 @@ fi SHLIB_SUFFIX=".so" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. - { $as_echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5 $as_echo_n "checking for ld accepts -Bexport flag... " >&6; } -if test "${tcl_cv_ld_Bexport+set}" = set; then +if ${tcl_cv_ld_Bexport+:} false; then : $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -11084,63 +8169,36 @@ int i; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_Bexport=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_ld_Bexport=no + tcl_cv_ld_Bexport=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5 $as_echo "$tcl_cv_ld_Bexport" >&6; } - if test $tcl_cv_ld_Bexport = yes; then + if test $tcl_cv_ld_Bexport = yes; then : LDFLAGS="$LDFLAGS -Wl,-Bexport" fi - CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac - if test "$do64bit" = yes -a "$do64bit_ok" = no; then + if test "$do64bit" = yes -a "$do64bit_ok" = no; then : - { $as_echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 $as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi - # Add in the arch flags late to ensure it wasn't removed. # Not necessary in TEA, but this is aligned with core LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" @@ -11149,7 +8207,7 @@ fi # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. - if test "$GCC" = yes; then + if test "$GCC" = yes; then : case $system in AIX-*) ;; @@ -11164,45 +8222,35 @@ fi esac fi - - if test "$tcl_cv_cc_visibility_hidden" != yes; then + if test "$tcl_cv_cc_visibility_hidden" != yes; then : -cat >>confdefs.h <<\_ACEOF -#define MODULE_SCOPE extern -_ACEOF +$as_echo "#define MODULE_SCOPE extern" >>confdefs.h fi - - if test "$SHARED_LIB_SUFFIX" = ""; then + if test "$SHARED_LIB_SUFFIX" = ""; then : # TEA specific: use PACKAGE_VERSION instead of VERSION SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi - - if test "$UNSHARED_LIB_SUFFIX" = ""; then + if test "$UNSHARED_LIB_SUFFIX" = ""; then : # TEA specific: use PACKAGE_VERSION instead of VERSION UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi - if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then - { $as_echo "$as_me:$LINENO: checking for SEH support in compiler" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SEH support in compiler" >&5 $as_echo_n "checking for SEH support in compiler... " >&6; } -if test "${tcl_cv_seh+set}" = set; then +if ${tcl_cv_seh+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : tcl_cv_seh=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define WIN32_LEAN_AND_MEAN @@ -11221,51 +8269,22 @@ cat >>conftest.$ac_ext <<_ACEOF } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : tcl_cv_seh=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -tcl_cv_seh=no + tcl_cv_seh=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_seh" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_seh" >&5 $as_echo "$tcl_cv_seh" >&6; } if test "$tcl_cv_seh" = "no" ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_NO_SEH 1 -_ACEOF +$as_echo "#define HAVE_NO_SEH 1" >>confdefs.h fi @@ -11275,16 +8294,12 @@ _ACEOF # with Cygwin's version as of 2002-04-10, define it to be int, # sufficient for getting the current code to work. # - { $as_echo "$as_me:$LINENO: checking for EXCEPTION_DISPOSITION support in include files" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXCEPTION_DISPOSITION support in include files" >&5 $as_echo_n "checking for EXCEPTION_DISPOSITION support in include files... " >&6; } -if test "${tcl_cv_eh_disposition+set}" = set; then +if ${tcl_cv_eh_disposition+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define WIN32_LEAN_AND_MEAN @@ -11301,42 +8316,19 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_eh_disposition=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_eh_disposition=no + tcl_cv_eh_disposition=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_eh_disposition" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_eh_disposition" >&5 $as_echo "$tcl_cv_eh_disposition" >&6; } if test "$tcl_cv_eh_disposition" = "no" ; then -cat >>confdefs.h <<\_ACEOF -#define EXCEPTION_DISPOSITION int -_ACEOF +$as_echo "#define EXCEPTION_DISPOSITION int" >>confdefs.h fi @@ -11344,16 +8336,12 @@ _ACEOF # even if VOID has already been #defined. The win32api # used by mingw and cygwin is known to do this. - { $as_echo "$as_me:$LINENO: checking for winnt.h that ignores VOID define" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winnt.h that ignores VOID define" >&5 $as_echo_n "checking for winnt.h that ignores VOID define... " >&6; } -if test "${tcl_cv_winnt_ignore_void+set}" = set; then +if ${tcl_cv_winnt_ignore_void+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define VOID void @@ -11373,42 +8361,19 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_winnt_ignore_void=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_winnt_ignore_void=no + tcl_cv_winnt_ignore_void=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_winnt_ignore_void" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_winnt_ignore_void" >&5 $as_echo "$tcl_cv_winnt_ignore_void" >&6; } if test "$tcl_cv_winnt_ignore_void" = "yes" ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_WINNT_IGNORE_VOID 1 -_ACEOF +$as_echo "#define HAVE_WINNT_IGNORE_VOID 1" >>confdefs.h fi fi @@ -11417,16 +8382,12 @@ _ACEOF # This is used to stop gcc from printing a compiler # warning when initializing a union member. - { $as_echo "$as_me:$LINENO: checking for cast to union support" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 $as_echo_n "checking for cast to union support... " >&6; } -if test "${tcl_cv_cast_to_union+set}" = set; then +if ${tcl_cv_cast_to_union+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -11440,42 +8401,19 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cast_to_union=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_cast_to_union=no + tcl_cv_cast_to_union=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_cast_to_union" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 $as_echo "$tcl_cv_cast_to_union" >&6; } if test "$tcl_cv_cast_to_union" = "yes"; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_CAST_TO_UNION 1 -_ACEOF +$as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi @@ -11495,18 +8433,14 @@ _ACEOF # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary - { $as_echo "$as_me:$LINENO: checking for required early compiler flags" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5 $as_echo_n "checking for required early compiler flags... " >&6; } tcl_flags="" - if test "${tcl_cv_flag__isoc99_source+set}" = set; then + if ${tcl_cv_flag__isoc99_source+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -11517,34 +8451,10 @@ char *p = (char *)strtoll; char *q = (char *)strtoull; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__isoc99_source=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include @@ -11556,56 +8466,28 @@ char *p = (char *)strtoll; char *q = (char *)strtoull; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__isoc99_source=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_flag__isoc99_source=no + tcl_cv_flag__isoc99_source=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then -cat >>confdefs.h <<\_ACEOF -#define _ISOC99_SOURCE 1 -_ACEOF +$as_echo "#define _ISOC99_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _ISOC99_SOURCE" fi - if test "${tcl_cv_flag__largefile64_source+set}" = set; then + if ${tcl_cv_flag__largefile64_source+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -11616,34 +8498,10 @@ struct stat64 buf; int i = stat64("/", &buf); return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile64_source=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include @@ -11655,56 +8513,28 @@ struct stat64 buf; int i = stat64("/", &buf); return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile64_source=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_flag__largefile64_source=no + tcl_cv_flag__largefile64_source=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then -cat >>confdefs.h <<\_ACEOF -#define _LARGEFILE64_SOURCE 1 -_ACEOF +$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi - if test "${tcl_cv_flag__largefile_source64+set}" = set; then + if ${tcl_cv_flag__largefile_source64+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -11715,34 +8545,10 @@ char *p = (char *)open64; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile_source64=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE64 1 #include @@ -11754,69 +8560,41 @@ char *p = (char *)open64; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile_source64=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_flag__largefile_source64=no + tcl_cv_flag__largefile_source64=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then -cat >>confdefs.h <<\_ACEOF -#define _LARGEFILE_SOURCE64 1 -_ACEOF +$as_echo "#define _LARGEFILE_SOURCE64 1" >>confdefs.h tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" fi if test "x${tcl_flags}" = "x" ; then - { $as_echo "$as_me:$LINENO: result: none" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } else - { $as_echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5 $as_echo "${tcl_flags}" >&6; } fi - { $as_echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit integer type" >&5 $as_echo_n "checking for 64-bit integer type... " >&6; } - if test "${tcl_cv_type_64bit+set}" = set; then + if ${tcl_cv_type_64bit+:} false; then : $as_echo_n "(cached) " >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -11827,41 +8605,16 @@ __int64 value = (__int64) 0; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_type_64bit=__int64 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_type_64bit="long long" + tcl_type_64bit="long long" fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -11874,48 +8627,23 @@ switch (0) { return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_64bit=${tcl_type_64bit} -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then -cat >>confdefs.h <<\_ACEOF -#define TCL_WIDE_INT_IS_LONG 1 -_ACEOF +$as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h - { $as_echo "$as_me:$LINENO: result: using long" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: using long" >&5 $as_echo "using long" >&6; } elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # TEA specific: We actually want to use the default tcl.h checks in # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* - { $as_echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Tcl header defaults" >&5 $as_echo "using Tcl header defaults" >&6; } else @@ -11923,21 +8651,17 @@ cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF - { $as_echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_cv_type_64bit}" >&5 $as_echo "${tcl_cv_type_64bit}" >&6; } # Now check for auxiliary declarations - { $as_echo "$as_me:$LINENO: checking for struct dirent64" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 $as_echo_n "checking for struct dirent64... " >&6; } -if test "${tcl_cv_struct_dirent64+set}" = set; then +if ${tcl_cv_struct_dirent64+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -11949,55 +8673,28 @@ struct dirent64 p; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_struct_dirent64=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_struct_dirent64=no + tcl_cv_struct_dirent64=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5 $as_echo "$tcl_cv_struct_dirent64" >&6; } if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_DIRENT64 1 -_ACEOF +$as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h fi - { $as_echo "$as_me:$LINENO: checking for struct stat64" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5 $as_echo_n "checking for struct stat64... " >&6; } -if test "${tcl_cv_struct_stat64+set}" = set; then +if ${tcl_cv_struct_stat64+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -12009,139 +8706,26 @@ struct stat64 p; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_struct_stat64=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_struct_stat64=no + tcl_cv_struct_stat64=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5 $as_echo "$tcl_cv_struct_stat64" >&6; } if test "x${tcl_cv_struct_stat64}" = "xyes" ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_STAT64 1 -_ACEOF +$as_echo "#define HAVE_STRUCT_STAT64 1" >>confdefs.h fi - - -for ac_func in open64 lseek64 -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then + for ac_func in open64 lseek64 +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -12149,17 +8733,13 @@ _ACEOF fi done - { $as_echo "$as_me:$LINENO: checking for off64_t" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5 $as_echo_n "checking for off64_t... " >&6; } - if test "${tcl_cv_type_off64_t+set}" = set; then + if ${tcl_cv_type_off64_t+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -12171,32 +8751,11 @@ off64_t offset; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_off64_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - tcl_cv_type_off64_t=no + tcl_cv_type_off64_t=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi @@ -12204,14 +8763,12 @@ fi test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_TYPE_OFF64_T 1 -_ACEOF +$as_echo "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi @@ -12225,10 +8782,10 @@ $as_echo "no" >&6; } - { $as_echo "$as_me:$LINENO: checking for build with symbols" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5 $as_echo_n "checking for build with symbols... " >&6; } # Check whether --enable-symbols was given. -if test "${enable_symbols+set}" = set; then +if test "${enable_symbols+set}" = set; then : enableval=$enable_symbols; tcl_ok=$enableval else tcl_ok=no @@ -12238,13 +8795,13 @@ fi if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then - { $as_echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5 $as_echo "yes (standard debugging)" >&6; } fi fi @@ -12258,18 +8815,16 @@ $as_echo "yes (standard debugging)" >&6; } if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then -cat >>confdefs.h <<\_ACEOF -#define TCL_MEM_DEBUG 1 -_ACEOF +$as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then - { $as_echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem debugging" >&5 $as_echo "enabled symbols mem debugging" >&6; } else - { $as_echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5 $as_echo "enabled $tcl_ok debugging" >&6; } fi fi @@ -12282,13 +8837,9 @@ $as_echo "enabled $tcl_ok debugging" >&6; } # link against the non-stubbed Tcl library. #-------------------------------------------------------------------- -cat >>confdefs.h <<\_ACEOF -#define USE_TCL_STUBS 1 -_ACEOF +$as_echo "#define USE_TCL_STUBS 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define USE_TK_STUBS 1 -_ACEOF +$as_echo "#define USE_TK_STUBS 1" >>confdefs.h #-------------------------------------------------------------------- @@ -12301,11 +8852,7 @@ _ACEOF if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined(_MSC_VER) && _MSC_VER >= 1400 @@ -12314,7 +8861,7 @@ print("manifest needed") _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "manifest needed" >/dev/null 2>&1; then + $EGREP "manifest needed" >/dev/null 2>&1; then : # Could do a CHECK_PROG for mt, but should always be with MSVC8+ VC_MANIFEST_EMBED_DLL="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;2 ; fi" @@ -12418,7 +8965,7 @@ rm -f conftest* #-------------------------------------------------------------------- - { $as_echo "$as_me:$LINENO: checking for tclsh" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 $as_echo_n "checking for tclsh... " >&6; } if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory @@ -12445,12 +8992,12 @@ $as_echo_n "checking for tclsh... " >&6; } done TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" fi - { $as_echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${TCLSH_PROG}" >&5 $as_echo "${TCLSH_PROG}" >&6; } - { $as_echo "$as_me:$LINENO: checking for wish" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wish" >&5 $as_echo_n "checking for wish... " >&6; } if test -f "${TK_BIN_DIR}/Makefile" ; then # tkConfig.sh is in Tk build directory @@ -12477,7 +9024,7 @@ $as_echo_n "checking for wish... " >&6; } done WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" fi - { $as_echo "$as_me:$LINENO: result: ${WISH_PROG}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WISH_PROG}" >&5 $as_echo "${WISH_PROG}" >&6; } @@ -12531,13 +9078,13 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -12545,8 +9092,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" @@ -12568,12 +9115,23 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi @@ -12623,14 +9181,15 @@ DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -12640,13 +9199,14 @@ LTLIBOBJS=$ac_ltlibobjs CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -12656,17 +9216,18 @@ cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -12674,23 +9235,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -12698,7 +9251,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -12709,7 +9268,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -12732,13 +9291,6 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -12748,15 +9300,16 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +as_myself= +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -12768,12 +9321,16 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -12785,7 +9342,89 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# Required to use basename. +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -12799,8 +9438,12 @@ else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -12820,76 +9463,25 @@ $as_echo X/"$0" | } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -12904,518 +9496,31 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by zint $as_me 2.5.2, which was -generated by GNU Autoconf 2.63. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTION]... [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_version="\\ -zint config.status 2.5.2 -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2008 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" - ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () { - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=' ' -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\).*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\).*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } -_ACEOF - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - - -eval set X " :F $CONFIG_FILES " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( @@ -13449,9 +9554,504 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by zint $as_me 2.9.1.9, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +zint config.status 2.9.1.9 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in @@ -13499,7 +10099,6 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= - ac_sed_dataroot=' /datarootdir/ { p @@ -13509,12 +10108,11 @@ ac_sed_dataroot=' /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/p -' +/@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -13524,7 +10122,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF @@ -13550,27 +10148,24 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -13580,15 +10175,12 @@ $as_echo "$as_me: error: could not create $ac_file" >&2;} done # for ac_tag -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -13609,10 +10201,10 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi diff --git a/backend_tcl/configure.in b/backend_tcl/configure.in index 38ef16c9..c78a1bc0 100644 --- a/backend_tcl/configure.in +++ b/backend_tcl/configure.in @@ -14,7 +14,7 @@ # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- -AC_INIT([zint], [2.9.0]) +AC_INIT([zint], [2.9.1.9]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. @@ -71,7 +71,6 @@ TEA_ADD_SOURCES([ ../backend/auspost.c ../backend/aztec.c ../backend/bmp.c - ../backend/emf.c ../backend/codablock.c ../backend/code128.c ../backend/code16k.c @@ -84,9 +83,10 @@ TEA_ADD_SOURCES([ ../backend/dmatrix.c ../backend/dotcode.c ../backend/eci.c - ../backend/gb18030.c - ../backend/gb2312.c - ../backend/general_field.c + ../backend/emf.c + ../backend/gb18030.c + ../backend/gb2312.c + ../backend/general_field.c ../backend/gif.c ../backend/gridmtx.c ../backend/gs1.c @@ -94,10 +94,10 @@ TEA_ADD_SOURCES([ ../backend/imail.c ../backend/large.c ../backend/library.c - ../backend/mailmark.c + ../backend/mailmark.c ../backend/maxicode.c ../backend/medical.c - ../backend/output.c + ../backend/output.c ../backend/pcx.c ../backend/pdf417.c ../backend/plessey.c @@ -108,11 +108,13 @@ TEA_ADD_SOURCES([ ../backend/raster.c ../backend/reedsol.c ../backend/rss.c - ../backend/sjis.c + ../backend/sjis.c ../backend/svg.c ../backend/telepen.c ../backend/tif.c + ../backend/ultra.c ../backend/upcean.c + ../backend/vector.c zint.c ]) TEA_ADD_CFLAGS([-I../backend -DNO_PNG=1 -DZINT_VERSION=PACKAGE_VERSION]) diff --git a/backend_tcl/zint.c b/backend_tcl/zint.c index 4a45dec2..e04eef44 100644 --- a/backend_tcl/zint.c +++ b/backend_tcl/zint.c @@ -156,9 +156,6 @@ static int Zint(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); static int Encode(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); -static int is_fullmultibyte(struct zint_symbol* symbol); -static int is_stackable(const int symbology); -static int is_extendable(const int symbology); /*----------------------------------------------------------------------------*/ /* >>>> File Global Variables */ @@ -1004,15 +1001,15 @@ static int Encode(Tcl_Interp *interp, int objc, /*------------------------------------------------------------------------*/ /* >>> option_3 is set by two values depending on the symbology */ /* On wrong symbology, the option is ignored(as does the zint program)*/ - if (fFullMultiByte && is_fullmultibyte(hSymbol)) { + if (fFullMultiByte && ZBarcode_Cap(hSymbol->symbology, ZINT_CAP_FULL_MULTIBYTE)) { hSymbol->option_3 = ZINT_FULL_MULTIBYTE; - } else if (Separator && is_stackable(hSymbol->symbology)) { + } else if (Separator && ZBarcode_Cap(hSymbol->symbology, ZINT_CAP_STACKABLE)) { hSymbol->option_3 = Separator; } /*------------------------------------------------------------------------*/ /* >>> option_2 is set by two values depending on the symbology */ /* On wrong symbology, the option is ignored(as does the zint program)*/ - if (addon_gap && is_extendable(hSymbol->symbology)) { + if (addon_gap && ZBarcode_Cap(hSymbol->symbology, ZINT_CAP_EXTENDABLE)) { hSymbol->option_2 = addon_gap; } /*------------------------------------------------------------------------*/ @@ -1061,7 +1058,7 @@ static int Encode(Tcl_Interp *interp, int objc, { Tcl_SetObjResult(interp, Tcl_NewStringObj(hSymbol->errtxt, -1)); } - if( 5 <= ErrorNumber ) + if( ZINT_ERROR <= ErrorNumber ) { /* >> Encode error */ fError = 1; @@ -1131,64 +1128,3 @@ static int Encode(Tcl_Interp *interp, int objc, } return TCL_OK; } - -static int is_fullmultibyte(struct zint_symbol* symbol) { - switch (symbol->symbology) { - case BARCODE_QRCODE: - case BARCODE_MICROQR: - //case BARCODE_HIBC_QR: Note character set restricted to ASCII subset - //case BARCODE_UPNQR: Note does not use Kanji mode - case BARCODE_RMQR: - case BARCODE_HANXIN: - case BARCODE_GRIDMATRIX: - return 1; - } - return 0; -} - -/* Indicates which symbologies can have row binding - * Note: if change this must also change version in backend/common.c */ -static int is_stackable(const int symbology) { - if (symbology < BARCODE_PDF417) { - return 1; - } - - switch (symbology) { - case BARCODE_CODE128B: - case BARCODE_ISBNX: - case BARCODE_EAN14: - case BARCODE_NVE18: - case BARCODE_KOREAPOST: - case BARCODE_PLESSEY: - case BARCODE_TELEPEN_NUM: - case BARCODE_ITF14: - case BARCODE_CODE32: - case BARCODE_CODABLOCKF: - case BARCODE_HIBC_BLOCKF: - return 1; - } - - return 0; -} - -/* Indicates which symbols can have addon (EAN-2 and EAN-5) - * Note: if change this must also change version in backend/common.c */ -static int is_extendable(const int symbology) { - - switch (symbology) { - case BARCODE_EANX: - case BARCODE_EANX_CHK: - case BARCODE_UPCA: - case BARCODE_UPCA_CHK: - case BARCODE_UPCE: - case BARCODE_UPCE_CHK: - case BARCODE_ISBNX: - case BARCODE_EANX_CC: - case BARCODE_UPCA_CC: - case BARCODE_UPCE_CC: - return 1; - } - - return 0; -} - diff --git a/docs/manual.txt b/docs/manual.txt index 079d5b74..f0817730 100644 --- a/docs/manual.txt +++ b/docs/manual.txt @@ -50,7 +50,7 @@ matrix: A matrix symbol is one based on a (usually square) grid of elements. Examples include Data Matrix, but Maxicode and DotCode are also considered matrix symbologies. -X-dimension: The X-dimension of a symbol is size (usually the width) of the +X-dimension: The X-dimension of a symbol is the size (usually the width) of the smallest element. For a linear symbology this is the width of the smallest bar. The default size of the X-dimension in a raster image is 2 pixels. Many symbologies have a fixed width-to-height ratio where @@ -79,6 +79,7 @@ ECI: The ECI mechanism allows for multi-language data to be encoded in be useful, for example, if you need to encode Cyrillic characters, but should be used with caution as not all scanners support this method. + 2. Installing Zint ================== @@ -100,10 +101,9 @@ make install The command line program can be accessed by typing -zint {options} -d {data} +zint {options} -Notice that the data needs to be entered after all other options. Any options -given after the data will be ignored. The GUI can be accessed by typing +The GUI can be accessed by typing zint-qt @@ -140,13 +140,14 @@ line into the MacOS terminal Once homebrew is installed use the following command to install Zint. -brew install zint +brew install zint 2.4 zint tcl backend -------------------- -The tcl backend may be build using the provided TEA build on Linux, Windows, +The tcl backend may be built using the provided TEA build on Linux, Windows, Mac-OS and Android. For Windows, a MS-VC6 makefile is also available. + 3. Using Zint Barcode Studio ============================ Zint Barcode Studio is the graphical user interface for Zint. If you are @@ -169,10 +170,17 @@ removed from this text-only version) This section describes how to encode data using the command line front end program. The examples given are for the Linux platform, but the same options are available for Windows - just remember to include the executable file -extension. i.e.: +extension if ".EXE" is not in your PATHEXT environment variable, i.e.: zint.exe -d "This Text" +For compatibility with Windows the examples use double quotes to delimit data, +though on Linux single quotes are generally preferable as they stop the shell +from processing any characters such as backslash or dollar. A single quote +itself is dealt with by terminating the single-quoted text, backslashing the +single quote, and then continuing: + +zint -d 'Text containing a single quote '\'' in the middle' 4.1 Inputting data ------------------ @@ -349,8 +357,8 @@ Numeric Value | Barcode Name 4.4 Adjusting height -------------------- -The height of a linear symbol can be adjusted using the --height switch. For -example: +The height of a symbol (except those with a fixed width-to-height ratio) can be +adjusted using the --height switch. For example: zint --height=100 -d "This Text" @@ -452,8 +460,8 @@ using the default character encoding then it will take advantage of the ECI not all barcode readers support ECI mode, so this can sometimes lead to unreadable barcodes. If you are using characters beyond those supported by Latin-1 then you should check that the resulting barcode can be understood by -your target barcode reader. Zint will generate a warning message when ECI codes -have been inserted into a symbol. +your target barcode reader. Zint will generate a warning message when an ECI +code that has not been explicitly requested has been inserted into a symbol. GS1 data can be encoded in a number of symbologies. Application identifiers should be enclosed in [square brackets] followed by the data to be encoded (see @@ -469,18 +477,18 @@ Identification Code (HIBC LIC). For HIBC Provider Applications Standard (HIBC PAS), preface the data with a slash "/". The --binary option encodes the input data as given. Automatic code page -translations to ECI pages is disabled. This may be used for raw binary -or binary encrypted data. -This switch plays together with the build-in ECI logic and examples may +translations to ECI pages is disabled. This may be used for raw binary or binary +encrypted data. +This switch plays together with the built-in ECI logic and examples may be found in that section. The --fullmultibyte option uses the multibyte modes of QR Code, Micro QR Code, Rectangular Micro QR Code, Han Xin Code and Grid Matrix for binary and Latin data, maximizing density. This is achieved by using compression designed for -Kanji characters, however some decoders take blocks which are encoded this -way and interpret them as Kanji characters, typically by applying a -transformation to UTF-8 and thus causing data corruption. Symbols encoded -with this option should be checked against decoders before they are used. +Kanji/Hanzi characters, however some decoders take blocks which are encoded this +way and interpret them as Kanji/Hanzi characters, typically by applying a +transformation to UTF-8 and thus causing data corruption. Symbols encoded with +this option should be checked against decoders before they are used. The popular open-source ZXing decoder is known to exhibit this behaviour. If your data contains non ISO-Latin-1 characters, you may encode it using an @@ -538,14 +546,14 @@ ECI Code | Character Encoding Scheme 25 * | UCS-2 Unicode (High order byte first) 26 | Unicode (UTF-8) 27 | ISO-646:1991 7-bit character set -28 * | Big-5 (Taiwan) Chinese Character Set +28 * | Big5 (Taiwan) Chinese Character Set 29 *** | GB (PRC) Chinese Character Set 30 * | Korean Character Set (KSX1001:1998) -------------------------------------------------------- Three examples: Ex1: The Euro sign can be encoded in ISO-8859-15. -The Euro-Sign has the ISO-8859-15 codepoint hex A4. +The Euro sign has the ISO-8859-15 codepoint hex A4. It is encoded in UTF-8 as the hex sequence: e2 82 ac Those 3 bytes are contained in the file "utf8euro.txt" This command will generate the corresponding code: @@ -688,6 +696,7 @@ Additional options are available which are specific to certain symbologies. These may, for example, control the amount of error correction data or the size of the symbol. These options are discussed in section 6 of this guide. + 5. Using the API ================ Zint has been written using the C language and currently only has an API for @@ -733,7 +742,6 @@ code takes a string from the command line and outputs a Code 128 symbol in a PNG file named out.png (or a GIF file called out.gif if libpng is not present) in the current working directory: -#include #include int main(int argc, char **argv) { @@ -748,7 +756,6 @@ int main(int argc, char **argv) This can also be done in one stage using the ZBarcode_Encode_and_Print() function as shown in the next example: -#include #include int main(int argc, char **argv) { @@ -765,8 +772,8 @@ Input data should be Unicode (UTF-8) formatted. -------------------------------------------- The functions for encoding and printing barcodes are defined as: -int ZBarcode_Encode(struct zint_symbol *symbol, unsigned char *input, int -length); +int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, + int in_length); int ZBarcode_Encode_File(struct zint_symbol *symbol, char *filename); @@ -798,7 +805,7 @@ allow you to do this: int ZBarcode_Buffer(struct zint_symbol *symbol, int rotate_angle); -int ZBarcide_Encode_and_Buffer(struct zint_symbol *symbol, unsigned char *input, +int ZBarcode_Encode_and_Buffer(struct zint_symbol *symbol, unsigned char *input, int length, int rotate_angle); int ZBarcode_Encode_File_and_Buffer(struct zint_symbol *symbol, char *filename, @@ -934,12 +941,12 @@ To alter these values use the syntax shown in the example below. This code has the same result as the previous example except the output is now taller and plotted in green. -#include #include #include int main(int argc, char **argv) { - struct zint_symbol *my_symbol;my_symbol = ZBarcode_Create(); + struct zint_symbol *my_symbol; + my_symbol = ZBarcode_Create(); strcpy(my_symbol->fgcolour, "00ff00"); my_symbol->height = 400; ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0); @@ -960,9 +967,9 @@ application. In addition the errtxt value is used to give a message detailing the nature of the error. The errors generated by Zint are given in the table below: -------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Return Value | Meaning -------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- ZINT_WARN_INVALID_OPTION | One of the values in zint_struct was set | incorrectly but Zint has made a guess at | what it should have been and generated a @@ -970,6 +977,12 @@ ZINT_WARN_INVALID_OPTION | One of the values in zint_struct was set ZINT_WARN_USES_ECI | Zint has automatically inserted an ECI | character. The symbol may not be readable | with some readers. +ZINT_WARN_NONCOMPLIANT | The symbol was created but is not compliant with + | certain standards set in its specification + | (e.g. height, GS1 AI data lengths). +ZINT_ERROR | Marks the divide between warnings and errors. + | For return values greater than or equal to + | this no symbol is generated. ZINT_ERROR_TOO_LONG | The input data is too long or too short for the | selected symbology. No symbol has been | generated. @@ -992,7 +1005,7 @@ ZINT_ERROR_FILE_ACCESS | Zint was unable to open the requested output | problem. ZINT_ERROR_MEMORY | Zint ran out of memory. This should only be a | problem with legacy systems. -------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- To catch errors use an integer variable as shown in the code below: @@ -1011,7 +1024,7 @@ int main(int argc, char **argv) /* some warning or error occurred */ printf("%s\n", my_symbol->errtxt); } - if (error >= ZINT_ERROR_TOO_LONG) + if (error >= ZINT_ERROR) { /* stop now */ ZBarcode_Delete(my_symbol); @@ -1024,14 +1037,14 @@ int main(int argc, char **argv) This code will exit with the appropriate message: -error: malformed foreground colour target +Error 653: Malformed foreground colour target 5.7 Specifying a Symbology -------------------------- Symbologies can be specified by number or by name as shown in the following table. For example -symbol->symbology= BARCODE_LOGMARS; +symbol->symbology = BARCODE_LOGMARS; means the same as @@ -1173,7 +1186,7 @@ BOLD_TEXT | Embolden the human readable text. CMYK_COLOUR | Select the CMYK colour space option for encapsulated | PostScript files. BARCODE_DOTTY_MODE | Plot a matrix symbol using dots rather than squares. -GS1_GS_SEPARATOR | Use GS instead FNC1 as GS1 separator (Data Matrix). +GS1_GS_SEPARATOR | Use GS instead of FNC1 as GS1 separator (Data Matrix) OUT_BUFFER_INTERMEDIATE | Return the bitmap buffer as ASCII values instead of | separate colour channels (OUT_BUFFER only). -------------------------------------------------------------------------------- @@ -1203,7 +1216,6 @@ my_symbol->input_mode = DATA_MODE | GS1_MODE; is not valid. Permissible escape sequences are listed in section 4.1. - 5.10 Verifying Symbology Availability ------------------------------------- An additional function available in the API is defined as: @@ -1215,11 +1227,63 @@ non-zero return value indicates that the given symbology is available. For example: if (ZBarcode_ValidID(BARCODE_PDF417) != 0) { - printf("PDF417 available"); + printf("PDF417 available\n"); } else { - printf("PDF417 not available"); + printf("PDF417 not available\n"); } +5.11 Checking Symbology Capabilities +------------------------------------ +It can be useful for frontend programs to know the capabilities of a symbology. +This can be determined using another additional function: + +unsigned int ZBarcode_Cap(int symbol_id, unsigned int cap_flag); + +by oring the flags below in the "cap_flag" argument and checking the return to +see which are set. + +------------------------------------------------------------------------------- +Value | Meaning +------------------------------------------------------------------------------- +ZINT_CAP_HRT | Can the symbology print Human Readable Text? +ZINT_CAP_STACKABLE | Is the symbology stackable? +ZINT_CAP_EXTENDABLE | Is the symbology extendable with add-on data? + | (i.e. is it UPC/EAN?) +ZINT_CAP_COMPOSITE | Does the symbology support composite data? + | (see 6.3 below) +ZINT_CAP_ECI | Does the symbology support Extended Channel + | Interpretations? +ZINT_CAP_GS1 | Does the symbology support GS1 data? +ZINT_CAP_DOTTY | Can the symbology be outputted as dots? +ZINT_CAP_FIXED_RATIO | Does the symbology have a fixed width-to-height + | (aspect) ratio? +ZINT_CAP_READER_INIT | Does the symbology support Reader Initialisation? +ZINT_CAP_FULL_MULTIBYTE | Is the ZINT_FULL_MULTIBYTE option applicable? +------------------------------------------------------------------------------- + +For example: + +unsigned int cap = ZBarcode_Cap(BARCODE_PDF417, ZINT_CAP_HRT | ZINT_CAP_ECI); +if (cap & ZINT_CAP_HRT) { + printf("PDF417 supports HRT\n"); +} else { + printf("PDF417 does not support HRT\n"); +} +if (cap & ZINT_CAP_ECI) { + printf("PDF417 supports ECI\n"); +} else { + printf("PDF417 does not support ECI\n"); +} + +5.11 Zint Version +----------------- +Lastly, the version of the Zint library linked to is returned by: + +int ZBarcode_Version(); + +The version parts are separated by hundreds. For instance, version "2.9.1" is +returned as "20901". + [1] This value is ignored for Australia Post 4-State Barcodes, PostNet, PLANET, USPS Intelligent Mail, RM4SCC, PDF417, Data Matrix, Maxicode, QR Code, GS1 DataBar Stacked, PDF417 and MicroPDF417 - all of which have a fixed height. @@ -1227,6 +1291,7 @@ DataBar Stacked, PDF417 and MicroPDF417 - all of which have a fixed height. [2] This value is ignored for Code 16k and Codablock-F. Special considerations apply to ITF-14 - see the specific section for that symbology. + 6. Types of Symbology ===================== 6.1 One-Dimensional Symbols @@ -1251,7 +1316,7 @@ before using these standards. 6.1.2.1 Standard Code 2 of 5 ---------------------------- -Also known as Code 2 of 5 Matrix is a self-checking code used in industrial +Also known as Code 2 of 5 Matrix this is a self-checking code used in industrial applications and photo development. Standard Code 2 of 5 will encode any length numeric input (digits 0-9). @@ -1318,7 +1383,7 @@ or encode a data string with the + character included: my_symbol->symbology = BARCODE_UPCA; -error = ZBarcode_Encode_and_Print(my_symbol, "72527270270+12345"); +error = ZBarcode_Encode_and_Print(my_symbol, "72527270270+12345", 0, 0); If your input data already includes the check digit symbology BARCODE_UPCA_CHK (35) can be used which takes a 12 digit input and validates the check digit @@ -1343,7 +1408,7 @@ or my_symbol->symbology = BARCODE_UPCE; -error = ZBarcode_Encode_and_Print(my_symbol, "1123456"); +error = ZBarcode_Encode_and_Print(my_symbol, "1123456", 0, 0); If your input data already includes the check digit symbology BARCODE_UPCE_CHK (38) can be used which takes a 7 or 8 digit input and validates the check digit @@ -1374,9 +1439,9 @@ be achieved using the API: my_symbol->symbology = BARCODE_EANX; -error = ZBarcode_Encode_and_Print(my_symbol, "54321"); +error = ZBarcode_Encode_and_Print(my_symbol, "54321", 0, 0); -error = ZBarcode_Encode_and_Print(my_symbol, "7432365+54321"); +error = ZBarcode_Encode_and_Print(my_symbol, "7432365+54321", 0, 0); All of the EAN symbols include check digits which are added by Zint. @@ -1638,7 +1703,7 @@ the vehicle industry, is to simply stack one-dimensional codes on top of each other. This can be achieved at the command prompt by giving more than one set of input data. For example -zint -d 'This' -d 'That' +zint -d "This" -d "That" will draw two Code 128 symbols, one on top of the other. The same result can be achieved using the API by executing the ZBarcode_Encode() function more than @@ -1646,9 +1711,9 @@ once on a symbol. For example: my_symbol->symbology = BARCODE_CODE128; -error = ZBarcode_Encode(my_symbol, "This"); +error = ZBarcode_Encode(my_symbol, "This", 0); -error = ZBarcode_Encode(my_symbol, "That"); +error = ZBarcode_Encode(my_symbol, "That", 0); error = ZBarcode_Print(my_symbol); @@ -1657,7 +1722,7 @@ The stacked barcode rows can be separated by row separator bars by specifying multiples of the X-dimension (minimum and default 1, maximum 4) can be set by --separator= (option_3): -zind --bind --separator=2 -d 'This' -d 'That' +zind --bind --separator=2 -d "This" -d "That" A more sophisticated method is to use some type of line indexing which indicates to the barcode reader which order the symbols should be read. This is @@ -1790,13 +1855,13 @@ This creates an EAN-13 linear component with the data "331234567890" and a 2D CC-A (see below) component with the data "(99)1234-abcd". The same results can be achieved using the API as shown below: -my_symbol->symbology = 130; +my_symbol->symbology = BARCODE_EANX_CC; my_symbol->option_1 = 1; strcpy(my_symbol->primary, "331234567890"); -ZBarcode_Encode_and_Print(my_symbol, "[99]1234-abcd"); +ZBarcode_Encode_and_Print(my_symbol, "[99]1234-abcd", 0, 0); EAN-2 and EAN-5 add-on data can be used with EAN and UPC symbols using the + symbol as described in section 6.1.3 and 5.1.4. @@ -2617,6 +2682,7 @@ and 'T' where these refer to descender, ascender, full (ascender and descender) and tracker (neither ascender nor descender) respectively. All other characters are ignored. + 7. Legal and Version Information ================================ 7.1 License @@ -2936,7 +3002,7 @@ international standards: > Uniform Symbology Specification Code One (AIM Inc., 1994) > ANSI/AIM BC12-1998 - Uniform Symbology Specification Channel Code > ANSI/AIM BC6-2000 - Uniform Symbology Specification Code 49 -> ANSI/HIBC 2.3-2009 - The Health Industry Bar Code (HIBC) Supplier Labeling +> ANSI/HIBC 2.6-2016 - The Health Industry Bar Code (HIBC) Supplier Labeling Standard > AIM ISS-X-24 - Uniform Symbology Specification Codablock F > AIMD013 (v 1.34a) – Information technology – Automaic identification and data @@ -2954,6 +3020,7 @@ international standards: > AIM ITS/04-023 International Technical Standard – Extended Channel Interpretations Part 3: Register (Released 15th July 2004) + A. Character Encoding ===================== This section is intended as a quick reference to the character sets used by diff --git a/frontend/main.c b/frontend/main.c index 0989676e..ff5c0d44 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -159,7 +159,7 @@ static void show_eci(void) { "25: ** UCS-2 Unicode (High order byte first)\n" "26: Unicode (UTF-8)\n" "27: ISO-646:1991 7-bit character set\n" - "28: ** Big-5 (Taiwan) Chinese Character Set\n" + "28: ** Big5 (Taiwan) Chinese Character Set\n" "29: ** GB (PRC) Chinese Character Set\n" "30: ** Korean Character Set (KSX1001:1998)\n" "** See note in section 4.10 of the manual\n" @@ -460,66 +460,6 @@ static int batch_process(struct zint_symbol *symbol, char *filename, int mirror_ return error_number; } -static int is_fullmultibyte(struct zint_symbol* symbol) { - switch (symbol->symbology) { - case BARCODE_QRCODE: - case BARCODE_MICROQR: - //case BARCODE_HIBC_QR: Note character set restricted to ASCII subset - //case BARCODE_UPNQR: Note does not use Kanji mode - case BARCODE_RMQR: - case BARCODE_HANXIN: - case BARCODE_GRIDMATRIX: - return 1; - } - return 0; -} - -/* Indicates which symbologies can have row binding - * Note: if change this must also change version in backend/common.c */ -static int is_stackable(const int symbology) { - if (symbology < BARCODE_PDF417) { - return 1; - } - - switch (symbology) { - case BARCODE_CODE128B: - case BARCODE_ISBNX: - case BARCODE_EAN14: - case BARCODE_NVE18: - case BARCODE_KOREAPOST: - case BARCODE_PLESSEY: - case BARCODE_TELEPEN_NUM: - case BARCODE_ITF14: - case BARCODE_CODE32: - case BARCODE_CODABLOCKF: - case BARCODE_HIBC_BLOCKF: - return 1; - } - - return 0; -} - -/* Indicates which symbols can have addon (EAN-2 and EAN-5) - * Note: if change this must also change version in backend/common.c */ -static int is_extendable(const int symbology) { - - switch (symbology) { - case BARCODE_EANX: - case BARCODE_EANX_CHK: - case BARCODE_UPCA: - case BARCODE_UPCA_CHK: - case BARCODE_UPCE: - case BARCODE_UPCE_CHK: - case BARCODE_ISBNX: - case BARCODE_EANX_CC: - case BARCODE_UPCA_CC: - case BARCODE_UPCE_CC: - return 1; - } - - return 0; -} - typedef struct { char *arg; int opt; } arg_opt; int main(int argc, char **argv) { @@ -670,11 +610,11 @@ int main(int argc, char **argv) { } if (!strcmp(long_options[option_index].name, "scale")) { my_symbol->scale = (float) (atof(optarg)); - if (my_symbol->scale < 0.01) { + if (my_symbol->scale < 0.01f) { /* Zero and negative values are not permitted */ fprintf(stderr, "Warning 105: Invalid scale value\n"); fflush(stderr); - my_symbol->scale = 1.0; + my_symbol->scale = 1.0f; } } if (!strcmp(long_options[option_index].name, "separator")) { @@ -706,11 +646,11 @@ int main(int argc, char **argv) { } if (!strcmp(long_options[option_index].name, "dotsize")) { my_symbol->dot_size = (float) (atof(optarg)); - if (my_symbol->dot_size < 0.01) { + if (my_symbol->dot_size < 0.01f) { /* Zero and negative values are not permitted */ fprintf(stderr, "Warning 106: Invalid dot radius value\n"); fflush(stderr); - my_symbol->dot_size = 4.0F / 5.0F; + my_symbol->dot_size = 4.0f / 5.0f; } } if (!strcmp(long_options[option_index].name, "border")) { @@ -989,12 +929,13 @@ int main(int argc, char **argv) { } if (data_arg_num) { - if (fullmultibyte && is_fullmultibyte(my_symbol)) { + unsigned int cap = ZBarcode_Cap(my_symbol->symbology, ZINT_CAP_FULL_MULTIBYTE | ZINT_CAP_STACKABLE | ZINT_CAP_EXTENDABLE); + if (fullmultibyte && (cap & ZINT_CAP_FULL_MULTIBYTE)) { my_symbol->option_3 = ZINT_FULL_MULTIBYTE; - } else if (separator && is_stackable(my_symbol->symbology)) { + } else if (separator && (cap & ZINT_CAP_STACKABLE)) { my_symbol->option_3 = separator; } - if (addon_gap && is_extendable(my_symbol->symbology)) { + if (addon_gap && (cap & ZINT_CAP_EXTENDABLE)) { my_symbol->option_2 = addon_gap; } @@ -1035,12 +976,12 @@ int main(int argc, char **argv) { if (ret != 0) { fprintf(stderr, "%s\n", my_symbol->errtxt); fflush(stderr); - if (error_number < 5) { + if (error_number < ZINT_ERROR) { error_number = ret; } } } - if (error_number < 5) { + if (error_number < ZINT_ERROR) { error_number = ZBarcode_Print(my_symbol, rotate_angle); if (error_number != 0) { diff --git a/frontend/tests/cmake/Modules/FindLibZint.cmake b/frontend/tests/cmake/Modules/FindLibZint.cmake new file mode 100644 index 00000000..7ef0ff36 --- /dev/null +++ b/frontend/tests/cmake/Modules/FindLibZint.cmake @@ -0,0 +1,53 @@ +# - Try to find the Zint barcode library +# Once done this will define +# +# LIBZINT_FOUND - System has Zint barcode +# LIBZINT_INCLUDE_DIRS - The Zint barcode include directory +# LIBZINT_LIBRARIES - The libraries needed to use Zint barcode +# LIBZINT_DEFINITIONS - Definitions needed to use Zint barcode +# LIBZINT_VERSION_STRING - the version of Zint barcode found + +set (LIBZINT_DEFINITIONS "") + +find_path (LIBZINT_INCLUDE_DIR NAMES zint.h) + +find_library (LIBZINT_LIBRARY NAMES zint ) + +if (LIBZINT_LIBRARY AND LIBZINT_INCLUDE_DIR) + + set (LIBZINT_INCLUDE_DIRS ${LIBZINT_INCLUDE_DIR}) + set (LIBZINT_LIBRARIES ${LIBZINT_LIBRARY}) + set (LIBZINT_DEFINITIONS "") + + if (NOT TARGET ZINT::ZINT) + + add_library (ZINT::ZINT UNKNOWN IMPORTED) + set_target_properties (ZINT::ZINT PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "${LIBZINT_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${LIBZINT_INCLUDE_DIRS}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${LIBZINT_LIBRARY}" + ) + + endif () + +endif () + +if (LIBZINT_INCLUDE_DIR AND EXISTS "${LIBZINT_INCLUDE_DIR}/zint.h") + file (STRINGS "${LIBZINT_INCLUDE_DIR}/zint.h" ZINT_MAJOR_H REGEX "^#define ZINT_VERSION_MAJOR *[0-9]*") + file (STRINGS "${LIBZINT_INCLUDE_DIR}/zint.h" ZINT_MINOR_H REGEX "^#define ZINT_VERSION_MINOR *[0-9]*") + file (STRINGS "${LIBZINT_INCLUDE_DIR}/zint.h" ZINT_MICRO_H REGEX "^#define ZINT_VERSION_RELEASE *[0-9]*") + string (REGEX REPLACE "^.*VERSION_MAJOR *([0-9]*)" "\\1" ZINT_MAJOR ${ZINT_MAJOR_H}) + string (REGEX REPLACE "^.*VERSION_MINOR *([0-9]*)" "\\1" ZINT_MINOR ${ZINT_MINOR_H}) + string (REGEX REPLACE "^.*VERSION_RELEASE *([0-9]*)" "\\1" ZINT_MICRO ${ZINT_MICRO_H}) + set (LIBZINT_VERSION_STRING ${ZINT_MAJOR}.${ZINT_MINOR}.${ZINT_MICRO}) +endif() + +# handle the QUIETLY and REQUIRED arguments and set LIBZINT_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibZint + REQUIRED_VARS LIBZINT_LIBRARY LIBZINT_INCLUDE_DIR + VERSION_VAR LIBZINT_VERSION_STRING) + +mark_as_advanced(LIBZINT_INCLUDE_DIR LIBZINT_LIBRARY) diff --git a/frontend_qt/grpDotCode.ui b/frontend_qt/grpDotCode.ui index e9a0fc6d..e9b9dc59 100644 --- a/frontend_qt/grpDotCode.ui +++ b/frontend_qt/grpDotCode.ui @@ -22,6 +22,19 @@ + + + + &Number of Data Columns: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + cmbDotCols + + + @@ -284,42 +297,6 @@ - - - - true - - - Dot Size: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - &Number of Data Columns: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - cmbDotCols - - - - - - - true - - - 0.8 - - - diff --git a/frontend_qt/grpGrid.ui b/frontend_qt/grpGrid.ui index 2e17b3f6..8ffb14c6 100644 --- a/frontend_qt/grpGrid.ui +++ b/frontend_qt/grpGrid.ui @@ -179,6 +179,19 @@ + + + + Full Multibyte + + + false + + + Use Hanzi multibyte encoding for binary and Latin data + + + diff --git a/frontend_qt/grpHX.ui b/frontend_qt/grpHX.ui index 39d09db9..05279122 100644 --- a/frontend_qt/grpHX.ui +++ b/frontend_qt/grpHX.ui @@ -505,6 +505,19 @@ + + + + Full Multibyte + + + false + + + Use Hanzi multibyte encoding for binary and Latin data + + + diff --git a/frontend_qt/grpMQR.ui b/frontend_qt/grpMQR.ui index 0fec8c01..15304601 100644 --- a/frontend_qt/grpMQR.ui +++ b/frontend_qt/grpMQR.ui @@ -96,6 +96,19 @@ + + + + Full Multibyte + + + false + + + Use Kanji multibyte encoding for binary and Latin data + + + diff --git a/frontend_qt/grpMaxicode.ui b/frontend_qt/grpMaxicode.ui index 1249114e..ed31b0fb 100644 --- a/frontend_qt/grpMaxicode.ui +++ b/frontend_qt/grpMaxicode.ui @@ -41,7 +41,7 @@ false - &Primary Data: + &Primary Message: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -96,7 +96,7 @@ - Primary Data Here! + Primary Message Here! diff --git a/frontend_qt/grpQR.ui b/frontend_qt/grpQR.ui index c40301e8..d7e6fa3a 100644 --- a/frontend_qt/grpQR.ui +++ b/frontend_qt/grpQR.ui @@ -321,6 +321,19 @@ + + + + Full Multibyte + + + false + + + Use Kanji multibyte encoding for binary and Latin data + + + diff --git a/frontend_qt/grpRMQR.ui b/frontend_qt/grpRMQR.ui index 64423b7d..081553bd 100644 --- a/frontend_qt/grpRMQR.ui +++ b/frontend_qt/grpRMQR.ui @@ -294,6 +294,19 @@ + + + + Full Multibyte + + + false + + + Use Kanji multibyte encoding for binary and Latin data + + + diff --git a/frontend_qt/mainWindow.ui b/frontend_qt/mainWindow.ui index ad535cc8..4147696f 100644 --- a/frontend_qt/mainWindow.ui +++ b/frontend_qt/mainWindow.ui @@ -65,6 +65,9 @@ bstyle + + Type of barcode + @@ -78,6 +81,19 @@ Type of barcode + + QComboBox::AdjustToContents + + + + + + + Filter symbologies + + + + @@ -90,10 +106,16 @@ 0 + + + 0 + 300 + + 16777215 - 350 + 300 @@ -103,7 +125,7 @@ - 1 + 0 @@ -161,7 +183,7 @@ or import from file Encode a sequence - 123.. + &123.. @@ -231,6 +253,9 @@ or import from file cmbCompType + + Type of 2D component + @@ -276,11 +301,15 @@ or import from file false - 2D &Component Data: + &2D Component Data: txtComposite + + Data to be encoded in 2D component +Remember to place [square brackets] around AI identifiers + @@ -302,7 +331,7 @@ or import from file Data to be encoded in 2D component -Remember to place [square brackets] around AI data +Remember to place [square brackets] around AI identifiers <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> @@ -322,11 +351,214 @@ p, li { white-space: pre-wrap; } - + + + + + + 40 + 16777215 + + + + EC&I: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + cmbECI + + + Set the ECI (Extended Channel Interpretation) code +(ignored if disabled) + + + + + + + + 80 + 16777215 + + + + Set the ECI (Extended Channel Interpretation) code +(ignored if disabled) + + + + None + + + + + 3: ISO-8859-1 Latin-1 + + + + + 4: ISO-8859-2 Latin-2 + + + + + 5: ISO-8859-3 Latin-3 + + + + + 6: ISO-8859-4 Latin-4 + + + + + 7: ISO-8859-5 Cyrillic + + + + + 8: ISO-8859-6 Arabic + + + + + 9: ISO-8859-7 Greek + + + + + 10: ISO-8859-8 Hebrew + + + + + 11: ISO-8859-9 Turkish + + + + + 12: ISO-8859-10 Nordic + + + + + 13: ISO-8859-11 Thai + + + + + 15: ISO-8859-13 Baltic + + + + + 16: ISO-8859-14 Celtic + + + + + 17: ISO-8859-15 Latin-9 + + + + + 18: ISO-8859-16 Latin-10 + + + + + 20: Shift-JIS + + + + + 21: Windows 1250 Latin-2 + + + + + 22: Windows 1251 Cyrillic + + + + + 23: Windows 1252 Latin-1 + + + + + 24: Windows 1256 Arabic + + + + + 25: UCS-2 (BE) + + + + + 26: UTF-8 + + + + + 27: ISO-646 ASCII + + + + + 28: Big5 (Taiwan) + + + + + 29: GB (PRC) + + + + + 30: Korean + + + + + + + + Qt::Horizontal + + + + 10 + 20 + + + + + + Process escape sequences in input data +\0 - NUL character (0x00) +\E - End of Transmission (0x04) +\a - Bell (0x07) +\b - Backspace (0x08) +\t - Horizontal Tab (0x09) +\n - Line Feed (0x0A) +\v - Vertical Tab (0x0B) +\f - Form Feed (0x0C) +\r - Carriage Return (0x0D) +\e - Escape (0x1B) +\G - Group Selector (0x1D) +\R - Record Selector (0x1E) +\\ - Backslash (0x5C) +\xNN - 8-bit character (N hex) +\uNNNN - 16-bit Unicode (N hex) + - Parse Escape Sequences + &Parse Escapes false @@ -335,8 +567,26 @@ p, li { white-space: pre-wrap; } + + Treat input as raw binary data +(ignored if disabled) + - Data (binary) &Mode + Binary &Mode + + + false + + + + + + + Create reader initialisation/programming symbol +(ignored if disabled) + + + &Reader Init false @@ -360,7 +610,21 @@ p, li { white-space: pre-wrap; } - + + + + Use default height +(ignored if disabled) + + + Auto&matic Height + + + true + + + + false @@ -374,9 +638,12 @@ p, li { white-space: pre-wrap; } heightb + + Overall symbol height + - + false @@ -390,6 +657,9 @@ p, li { white-space: pre-wrap; } + + 1 + 300 @@ -398,10 +668,10 @@ p, li { white-space: pre-wrap; } - + - B&order Width: + Border &Width: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -409,9 +679,12 @@ p, li { white-space: pre-wrap; } bwidth + + Width of boundary bars or border + - + Width of boundary bars or border @@ -430,7 +703,7 @@ p, li { white-space: pre-wrap; } - + Border &Type: @@ -441,9 +714,12 @@ p, li { white-space: pre-wrap; } btype + + Add border or box + - + Add border or box @@ -468,10 +744,10 @@ p, li { white-space: pre-wrap; } - + - Horizontal &Whitespace: + Hori&zontal Whitespace: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -479,19 +755,22 @@ p, li { white-space: pre-wrap; } spnWhitespace + + Width of whitespace on either side of barcode + - + - Width of whitespace + Width of whitespace on either side of barcode X - + &Printing Scale: @@ -502,9 +781,12 @@ p, li { white-space: pre-wrap; } spnScale + + Image scale when output to file + - + Image scale when output to file @@ -529,13 +811,79 @@ p, li { white-space: pre-wrap; } - - - - false + + + + Fo&nt Setting: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + cmbFontSetting + + + Set font characteristics + + + + + + + Set font characteristics + + + + Normal + + + + + Bold + + + + + Small + + + + + Small Bold (vector only) + + + + + + + + Show text in image +(ignored if disabled) - + Show H&uman Readable Text + + + true + + + + + + + true + + + Colour: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + fgcolor + + + Change colour of ink or paper @@ -545,17 +893,17 @@ p, li { white-space: pre-wrap; } Change ink colour - &Foreground Colour + &Foreground - + false - + @@ -565,17 +913,7 @@ p, li { white-space: pre-wrap; } Change paper colour - &Backgound Colour - - - - - - - false - - - + Ba&ckground @@ -585,54 +923,129 @@ p, li { white-space: pre-wrap; } Reset to black on white - &Reset Colours + &Reset + + + + + + + Use CMYK colour space in EPS output + + + CMY&K (EPS) + + + false + + + + + + + R&otate: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + cmbRotate + + + Rotate symbol by degrees + + + + + + + Rotate symbol by degrees + + + + 0° + + + + + 90° + + + + + 180° + + + + + 270° + + + + + + + + Use dots instead of squares for matrix symbols +(ignored if disabled) + + + &Dotty + + + false + + + + + + + false + + + &Dot Size: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + spnDotSize + + + Size of dots + + + + + + + Size of dots + + + false + + + + + + 2 + + + 0.010000000000000 + + + 20.000000000000000 + + + 0.100000000000000 + + + 0.800000000000000 - - - - true - - - Automatic Height - - - true - - - - - - - Show text in image - - - Show H&uman Readable Text - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 40 - - - - @@ -643,14 +1056,8 @@ p, li { white-space: pre-wrap; } - + - - - 100 - 0 - - About Zint @@ -659,36 +1066,7 @@ p, li { white-space: pre-wrap; } - - - - - 100 - 0 - - - - Save image to file - - - &Save - - - - - - - - 100 - 0 - - - - E&xit - - - - + Qt::Horizontal @@ -701,32 +1079,43 @@ p, li { white-space: pre-wrap; } - - - - - 100 - 0 - - + + - Copy to clipboard + Copy to clipboard as BMP + + + Copy &BMP + + + + + + + Copy to clipboard as SVG Copy S&VG - - - - - 100 - 0 - + + + + Output image to file (BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF) - &Copy BMP + &Save As… + + + + + + + Quit Zint Barcode Studio + + + E&xit diff --git a/frontend_qt/mainwindow.cpp b/frontend_qt/mainwindow.cpp index d6ba187d..1897aba9 100644 --- a/frontend_qt/mainwindow.cpp +++ b/frontend_qt/mainwindow.cpp @@ -15,7 +15,7 @@ ***************************************************************************/ /* vim: set ts=4 sw=4 et : */ -#include +//#include #include #include #include @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include "mainwindow.h" #include "datawindow.h" @@ -35,7 +37,7 @@ #include MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl) - : QWidget(parent, fl), m_optionWidget(0) + : QWidget(parent, fl), m_optionWidget(NULL), m_symbology(0) { m_bc.bc.setDebug(QCoreApplication::arguments().contains("--verbose")); // Undocumented command line debug flag @@ -62,7 +64,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl) "Code 2 of 5 IATA", "Code 2 of 5 Industrial", "Code 2 of 5 Interleaved", - "Code 2 of 5 Matrix", + "Code 2 of 5 Standard", "Code 32 (Italian Pharmacode)", "Code 39 (ISO 16388)", "Code 39 Extended", @@ -124,47 +126,75 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl) setupUi(this); view->setScene(scene); - m_fgcolor=qRgba(settings.value("studio/ink/red", 0).toInt(), + restoreGeometry(settings.value("studio/window_geometry").toByteArray()); + + m_fgcolor.setRgb(settings.value("studio/ink/red", 0).toInt(), settings.value("studio/ink/green", 0).toInt(), settings.value("studio/ink/blue", 0).toInt(), settings.value("studio/ink/alpha", 0xff).toInt()); - m_bgcolor=qRgba(settings.value("studio/paper/red", 0xff).toInt(), + m_bgcolor.setRgb(settings.value("studio/paper/red", 0xff).toInt(), settings.value("studio/paper/green", 0xff).toInt(), settings.value("studio/paper/blue", 0xff).toInt(), settings.value("studio/paper/alpha", 0xff).toInt()); - for (int i = 0; i < metaObject()->enumerator(0).keyCount(); i++) { + int cnt = metaObject()->enumerator(0).keyCount(); + for (int i = 0; i < cnt; i++) { bstyle->addItem(metaObject()->enumerator(0).key(i)); bstyle->setItemText(i, bstyle_text[i]); } +#ifdef _WIN32 + bstyle->setMaxVisibleItems(cnt); /* Apart from increasing combo size, seems to be needed for filter to work */ +#endif +#if QT_VERSION < 0x50A00 + /* Prior to Qt 5.10 comboboxes have display issues when filtered (scrollers not accounted for), so disable */ + filter_bstyle->hide(); +#endif bstyle->setCurrentIndex(settings.value("studio/symbology", 10).toInt()); txtData->setText(settings.value("studio/data", "Your Data Here!").toString()); txtComposite->setText(settings.value("studio/composite_text", "Your Data Here!").toString()); + chkComposite->setChecked(settings.value("studio/chk_composite").toInt() ? true : false); + cmbCompType->setCurrentIndex(settings.value("studio/comp_type", 0).toInt()); + cmbECI->setCurrentIndex(settings.value("studio/appearance/eci", 0).toInt()); + chkEscape->setChecked(settings.value("studio/chk_escape").toInt() ? true : false); + chkData->setChecked(settings.value("studio/chk_data").toInt() ? true : false); + chkRInit->setChecked(settings.value("studio/chk_rinit").toInt() ? true : false); + chkAutoHeight->setChecked(settings.value("studio/appearance/autoheight", 1).toInt() ? true : false); heightb->setValue(settings.value("studio/appearance/height", 50).toInt()); - bwidth->setValue(settings.value("studio/appearance/border", 50).toInt()); + bwidth->setValue(settings.value("studio/appearance/border", 0).toInt()); spnWhitespace->setValue(settings.value("studio/appearance/whitespace", 0).toInt()); spnScale->setValue(settings.value("studio/appearance/scale", 1.0).toFloat()); btype->setCurrentIndex(settings.value("studio/appearance/border_type", 0).toInt()); + cmbFontSetting->setCurrentIndex(settings.value("studio/appearance/font_setting", 0).toInt()); + chkHRTShow->setChecked(settings.value("studio/appearance/chk_hrt_show", 1).toInt() ? true : false); + chkCMYK->setChecked(settings.value("studio/appearance/cmyk", 0).toInt() ? true : false); + cmbRotate->setCurrentIndex(settings.value("studio/appearance/rotate", 0).toInt()); + chkDotty->setChecked(settings.value("studio/appearance/dotty", 0).toInt() ? true : false); + spnDotSize->setValue(settings.value("studio/appearance/dot_size", 4.0 / 5.0).toFloat()); change_options(); + scene->addItem(&m_bc); update_preview(); connect(bstyle, SIGNAL(currentIndexChanged( int )), SLOT(change_options())); connect(bstyle, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(filter_bstyle, SIGNAL(textChanged( const QString& )), SLOT(filter_symbologies())); connect(heightb, SIGNAL(valueChanged( int )), SLOT(update_preview())); connect(bwidth, SIGNAL(valueChanged( int )), SLOT(update_preview())); connect(btype, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(cmbFontSetting, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(txtData, SIGNAL(textChanged( const QString& )), SLOT(update_preview())); connect(txtComposite, SIGNAL(textChanged()), SLOT(update_preview())); - connect(chkComposite, SIGNAL(stateChanged( int )), SLOT(composite_enable())); + connect(chkComposite, SIGNAL(stateChanged( int )), SLOT(composite_ui_set())); connect(chkComposite, SIGNAL(stateChanged( int )), SLOT(update_preview())); connect(cmbCompType, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(cmbECI, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(chkEscape, SIGNAL(stateChanged( int )), SLOT(update_preview())); connect(chkData, SIGNAL(stateChanged( int )), SLOT(update_preview())); + connect(chkRInit, SIGNAL(stateChanged( int )), SLOT(update_preview())); connect(spnWhitespace, SIGNAL(valueChanged( int )), SLOT(update_preview())); connect(btnAbout, SIGNAL(clicked( bool )), SLOT(about())); connect(btnSave, SIGNAL(clicked( bool )), SLOT(save())); @@ -173,16 +203,30 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl) connect(btnReset, SIGNAL(clicked( bool )), SLOT(reset_view())); connect(btnMoreData, SIGNAL(clicked( bool )), SLOT(open_data_dialog())); connect(btnSequence, SIGNAL(clicked( bool )), SLOT(open_sequence_dialog())); - connect(chkHRTHide, SIGNAL(stateChanged( int )), SLOT(update_preview())); - connect(chkAutoHeight, SIGNAL(stateChanged( int )), SLOT(autoheight_clicked())); + connect(chkAutoHeight, SIGNAL(stateChanged( int )), SLOT(autoheight_ui_set())); + connect(chkAutoHeight, SIGNAL(stateChanged( int )), SLOT(update_preview())); + connect(chkHRTShow, SIGNAL(stateChanged( int )), SLOT(HRTShow_ui_set())); + connect(chkHRTShow, SIGNAL(stateChanged( int )), SLOT(update_preview())); + connect(chkCMYK, SIGNAL(stateChanged( int )), SLOT(change_cmyk())); + connect(cmbRotate, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(chkDotty, SIGNAL(stateChanged( int )), SLOT(dotty_ui_set())); + connect(chkDotty, SIGNAL(stateChanged( int )), SLOT(update_preview())); + connect(spnDotSize, SIGNAL(valueChanged( double )), SLOT(update_preview())); connect(btnCopySVG, SIGNAL(clicked( bool )), SLOT(copy_to_clipboard_svg())); connect(btnCopyBMP, SIGNAL(clicked( bool )), SLOT(copy_to_clipboard_bmp())); + + connect(&m_bc.bc, SIGNAL(encoded()), SLOT(on_encoded())); + + QShortcut *ctrl_q = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this); + connect(ctrl_q, SIGNAL(activated()), SLOT(quit_now())); } MainWindow::~MainWindow() { QSettings settings; + settings.setValue("studio/window_geometry", saveGeometry()); + settings.setValue("studio/tab_index", tabMain->currentIndex()); settings.setValue("studio/symbology", bstyle->currentIndex()); settings.setValue("studio/ink/red", m_fgcolor.red()); settings.setValue("studio/ink/green", m_fgcolor.green()); @@ -194,11 +238,26 @@ MainWindow::~MainWindow() settings.setValue("studio/paper/alpha", m_bgcolor.alpha()); settings.setValue("studio/data", txtData->text()); settings.setValue("studio/composite_text", txtComposite->toPlainText()); + settings.setValue("studio/chk_composite", chkComposite->isChecked() ? 1 : 0); + settings.setValue("studio/comp_type", cmbCompType->currentIndex()); + settings.setValue("studio/eci", cmbECI->currentIndex()); + settings.setValue("studio/chk_escape", chkEscape->isChecked() ? 1 : 0); + settings.setValue("studio/chk_data", chkData->isChecked() ? 1 : 0); + settings.setValue("studio/chk_rinit", chkRInit->isChecked() ? 1 : 0); + settings.setValue("studio/appearance/autoheight", chkAutoHeight->isChecked() ? 1 : 0); settings.setValue("studio/appearance/height", heightb->value()); settings.setValue("studio/appearance/border", bwidth->value()); settings.setValue("studio/appearance/whitespace", spnWhitespace->value()); settings.setValue("studio/appearance/scale", spnScale->value()); settings.setValue("studio/appearance/border_type", btype->currentIndex()); + settings.setValue("studio/appearance/font_setting", cmbFontSetting->currentIndex()); + settings.setValue("studio/appearance/chk_hrt_show", chkHRTShow->isChecked() ? 1 : 0); + settings.setValue("studio/appearance/chk_cmyk", chkCMYK->isChecked() ? 1 : 0); + settings.setValue("studio/appearance/rotate", cmbRotate->currentIndex()); + settings.setValue("studio/appearance/chk_dotty", chkDotty->isChecked() ? 1 : 0); + settings.setValue("studio/appearance/dot_size", spnDotSize->value()); + + save_sub_settings(settings, m_bc.bc.symbol()); } void MainWindow::resizeEvent(QResizeEvent* event) @@ -209,8 +268,8 @@ void MainWindow::resizeEvent(QResizeEvent* event) void MainWindow::reset_view() { - m_fgcolor=qRgba(0,0,0,0xff); - m_bgcolor=qRgba(0xff,0xff,0xff,0xff); + m_fgcolor.setRgb(0, 0, 0, 0xff); + m_bgcolor.setRgb(0xff, 0xff, 0xff, 0xff); update_preview(); } @@ -227,16 +286,16 @@ bool MainWindow::save() #ifdef NO_PNG suffix = settings.value("studio/default_suffix", "gif").toString(); - save_dialog.setNameFilter(tr("Encapsulated Post Script (*.eps);;Graphics Interchange Format (*.gif);;Scalable Vector Graphic (*.svg);;Windows Bitmap (*.bmp);;ZSoft PC Painter Image (*.pcx);;Extended Metafile (*.emf);;Tagged Image File Format (*.tif)")); + save_dialog.setNameFilter(tr("Encapsulated PostScript (*.eps);;Graphics Interchange Format (*.gif);;Scalable Vector Graphic (*.svg);;Windows Bitmap (*.bmp);;ZSoft PC Painter Image (*.pcx);;Extended Metafile (*.emf);;Tagged Image File Format (*.tif)")); #else suffix = settings.value("studio/default_suffix", "png").toString(); - save_dialog.setNameFilter(tr("Portable Network Graphic (*.png);;Encapsulated Post Script (*.eps);;Graphics Interchange Format (*.gif);;Scalable Vector Graphic (*.svg);;Windows Bitmap (*.bmp);;ZSoft PC Painter Image (*.pcx);;Extended Metafile (*.emf);;Tagged Image File Format (*.tif)")); + save_dialog.setNameFilter(tr("Portable Network Graphic (*.png);;Encapsulated PostScript (*.eps);;Graphics Interchange Format (*.gif);;Scalable Vector Graphic (*.svg);;Windows Bitmap (*.bmp);;ZSoft PC Painter Image (*.pcx);;Extended Metafile (*.emf);;Tagged Image File Format (*.tif)")); #endif if (QString::compare(suffix, "png", Qt::CaseInsensitive) == 0) save_dialog.selectNameFilter("Portable Network Graphic (*.png)"); if (QString::compare(suffix, "eps", Qt::CaseInsensitive) == 0) - save_dialog.selectNameFilter("Encapsulated Post Script (*.eps)"); + save_dialog.selectNameFilter("Encapsulated PostScript (*.eps)"); if (QString::compare(suffix, "gif", Qt::CaseInsensitive) == 0) save_dialog.selectNameFilter("Graphics Interchange Format (*.gif)"); if (QString::compare(suffix, "svg", Qt::CaseInsensitive) == 0) @@ -265,7 +324,7 @@ bool MainWindow::save() } if(m_bc.bc.save_to_file(filename) == false) { - if (m_bc.bc.getError() > 4) { + if (m_bc.bc.getError() >= ZINT_ERROR) { QMessageBox::critical(this, tr("Save Error"), m_bc.bc.error_message()); return false; } else { @@ -304,11 +363,11 @@ void MainWindow::about() "\"QR Code\" is a Registered Trademark of Denso Corp.
" "\"Telepen\" is a Registered Trademark of SB Electronics." "

Currently supported standards include:
" - "EN 797:1996, EN 798:1996, EN 12323:2005, ISO/IEC 15417:2007,
" + "BS 797:1996, BS 798:1996, ISO/IEC 12323:2005, ISO/IEC 15417:2007,
" "ISO/IEC 15438:2015, ISO/IEC 16022:2006, ISO/IEC 16023:2000,
" "ISO/IEC 16388:2007, ISO/IEC 18004:2015, ISO/IEC 24723:2010,
" "ISO/IEC 24724:2011, ISO/IEC 24728:2006, ISO/IEC 24778:2008,
" - "ISO/IEC 21471:2019, ANSI-HIBC 2.3-2009, ANSI/AIM BC6-2000,
" + "ISO/IEC 21471:2019, ANSI-HIBC 2.6-2016, ANSI/AIM BC6-2000,
" "ANSI/AIM BC12-1998, AIMD014 (v 1.63), USPS-B-3200" "
").arg(zint_version).arg(QT_VERSION_STR)); } @@ -352,16 +411,103 @@ void MainWindow::on_bgcolor_clicked() } } -void MainWindow::autoheight_clicked() +void MainWindow::autoheight_ui_set() { - if (chkAutoHeight->isChecked()) { + if (!chkAutoHeight->isEnabled() || chkAutoHeight->isChecked()) { lblHeight->setEnabled(false); heightb->setEnabled(false); } else { lblHeight->setEnabled(true); heightb->setEnabled(true); } - update_preview(); +} + +void MainWindow::HRTShow_ui_set() +{ + if (chkHRTShow->isEnabled() && chkHRTShow->isChecked()) { + lblFontSetting->setEnabled(true); + cmbFontSetting->setEnabled(true); + } else { + lblFontSetting->setEnabled(false); + cmbFontSetting->setEnabled(false); + } +} + +void MainWindow::dotty_ui_set() +{ + int symbology = metaObject()->enumerator(0).value(bstyle->currentIndex()); + + if (symbology == BARCODE_DOTCODE) { + chkDotty->setEnabled(false); + lblDotSize->setEnabled(true); + spnDotSize->setEnabled(true); + } else { + if (chkDotty->isEnabled() && chkDotty->isChecked()) { + lblDotSize->setEnabled(true); + spnDotSize->setEnabled(true); + } else { + lblDotSize->setEnabled(false); + spnDotSize->setEnabled(false); + } + } +} + +void MainWindow::on_encoded() +{ + if (!chkAutoHeight->isEnabled() || chkAutoHeight->isChecked()) { + heightb->setValue(m_bc.bc.height()); + } +} + +void MainWindow::filter_symbologies() +{ + QString filter = filter_bstyle->text().simplified(); /* `simplified()` trims and reduces inner whitespace to a single space - nice! */ + QListView *view = qobject_cast(bstyle->view()); + QStandardItemModel *model = qobject_cast(bstyle->model()); + QStandardItem *item; + + if (!view || !model) { + return; + } + + /* QString::split() only introduced Qt 5.14, so too new for us to use */ + QStringList filter_list; + if (!filter.isEmpty()) { + int i, j; + for (i = 0; (j = filter.indexOf(" ", i)) != -1; i = j + 1) { + filter_list << filter.mid(i, j - i); + } + filter_list << filter.mid(i); + } + int filter_cnt = filter_list.size(); + int cnt = metaObject()->enumerator(0).keyCount(); + + if (filter_cnt) { + for (int i = 0; i < cnt; i++) { + bool hidden = view->isRowHidden(i); + bool hide = true; + for (int j = 0; j < filter_cnt; j++) { + if (bstyle->itemText(i).contains(filter_list[j], Qt::CaseInsensitive)) { + hide = false; + break; + } + } + if ((hide && !hidden) || (!hide && hidden)) { + // https://stackoverflow.com/questions/25172220/how-to-hide-qcombobox-items-instead-of-clearing-them-out + item = model->item(i); + item->setFlags(hide ? item->flags() & ~Qt::ItemIsEnabled : item->flags() | Qt::ItemIsEnabled); + view->setRowHidden(i, hide); + } + } + } else { + for (int i = 0; i < cnt; i++) { + if (view->isRowHidden(i)) { + item = model->item(i); + item->setFlags(item->flags() | Qt::ItemIsEnabled); + view->setRowHidden(i, false); + } + } + } } void MainWindow::change_print_scale() @@ -370,6 +516,12 @@ void MainWindow::change_print_scale() m_bc.bc.setScale((float)spnScale->value()); } +void MainWindow::change_cmyk() +{ + /* This value is only used when printing (saving) to file */ + m_bc.bc.setCMYK(chkCMYK->isChecked()); +} + void MainWindow::quit_now() { close(); @@ -378,16 +530,17 @@ void MainWindow::quit_now() void MainWindow::copy_to_clipboard_svg() { QClipboard *clipboard = QGuiApplication::clipboard(); - QMimeData *data = new QMimeData; QString filename = ".zint.svg"; double scale = spnScale->value(); spnScale->setValue(5); if (!m_bc.bc.save_to_file(filename)) { + spnScale->setValue(scale); return; } + QMimeData *data = new QMimeData; data->setImageData(QImage(filename)); clipboard->setMimeData(data, QClipboard::Clipboard); @@ -399,13 +552,13 @@ void MainWindow::copy_to_clipboard_svg() void MainWindow::copy_to_clipboard_bmp() { QClipboard *clipboard = QGuiApplication::clipboard(); - QMimeData *data = new QMimeData; QString filename = ".zint.bmp"; if (!m_bc.bc.save_to_file(filename)) { return; } + QMimeData *data = new QMimeData; data->setImageData(QImage(filename)); clipboard->setMimeData(data, QClipboard::Clipboard); @@ -415,13 +568,24 @@ void MainWindow::copy_to_clipboard_bmp() void MainWindow::change_options() { QUiLoader uiload; + QSettings settings; + + bool initial_load = m_symbology == 0; + int original_tab_count = tabMain->count(); + int original_tab_index = tabMain->currentIndex(); int symbology = metaObject()->enumerator(0).value(bstyle->currentIndex()); + if (m_symbology) { + save_sub_settings(settings, m_symbology); + } + if (tabMain->count()==3) tabMain->removeTab(1); chkComposite->setText(tr("Add 2D Component")); btype->setItemText(0, tr("No border")); + combobox_item_enabled(cmbFontSetting, 1, true); + cmbFontSetting->setItemText(2, tr("Small")); if (symbology == BARCODE_CODE128) { @@ -478,7 +642,6 @@ void MainWindow::change_options() connect(m_optionWidget->findChild("cmbDotCols"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild("radDotStand"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild("radDotGS1"), SIGNAL(clicked( bool )), SLOT(update_preview())); - connect(m_optionWidget->findChild("txtDotSize"), SIGNAL(textChanged( QString )), SLOT(update_preview())); } if (symbology == BARCODE_AZTEC) @@ -530,12 +693,12 @@ void MainWindow::change_options() return; m_optionWidget=uiload.load(&file); file.close(); - tabMain->insertTab(1,m_optionWidget,tr("Code 39")); connect(m_optionWidget->findChild("radC39Stand"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild("radC39Check"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild("radC39HIBC"), SIGNAL(clicked( bool )), SLOT(update_preview())); if (symbology == BARCODE_EXCODE39) { + tabMain->insertTab(1,m_optionWidget,tr("Code 39 Extended")); if(m_optionWidget->findChild("radC39HIBC")->isChecked() == true) { m_optionWidget->findChild("radC39HIBC")->setChecked(false); @@ -543,8 +706,10 @@ void MainWindow::change_options() } m_optionWidget->findChild("radC39HIBC")->setEnabled(false); } - else + else { + tabMain->insertTab(1,m_optionWidget,tr("Code 39")); m_optionWidget->findChild("radC39HIBC")->setEnabled(true); + } } if (symbology == BARCODE_LOGMARS) @@ -634,6 +799,7 @@ void MainWindow::change_options() connect(m_optionWidget->findChild("radQRStand"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild("radQRGS1"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild("radQRHIBC"), SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(m_optionWidget->findChild("chkQRFullMultibyte"), SIGNAL(stateChanged( int )), SLOT(update_preview())); } if (symbology == BARCODE_RMQR) @@ -648,6 +814,7 @@ void MainWindow::change_options() connect(m_optionWidget->findChild("cmbRMQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild("radRMQRStand"), SIGNAL(clicked( bool )), SLOT(update_preview())); connect(m_optionWidget->findChild("radRMQRGS1"), SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(m_optionWidget->findChild("chkRMQRFullMultibyte"), SIGNAL(stateChanged( int )), SLOT(update_preview())); } if (symbology == BARCODE_HANXIN) @@ -660,6 +827,7 @@ void MainWindow::change_options() tabMain->insertTab(1,m_optionWidget,tr("Han Xin Code")); connect(m_optionWidget->findChild("cmbHXSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild("cmbHXECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(m_optionWidget->findChild("chkHXFullMultibyte"), SIGNAL(stateChanged( int )), SLOT(update_preview())); } if (symbology == BARCODE_MICROQR) @@ -672,6 +840,7 @@ void MainWindow::change_options() tabMain->insertTab(1,m_optionWidget,tr("Micro QR Code")); connect(m_optionWidget->findChild("cmbMQRSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild("cmbMQRECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(m_optionWidget->findChild("chkMQRFullMultibyte"), SIGNAL(stateChanged( int )), SLOT(update_preview())); } if (symbology == BARCODE_GRIDMATRIX) @@ -684,6 +853,7 @@ void MainWindow::change_options() tabMain->insertTab(1,m_optionWidget,tr("Grid Matrix")); connect(m_optionWidget->findChild("cmbGridSize"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(m_optionWidget->findChild("cmbGridECC"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(m_optionWidget->findChild("chkGridFullMultibyte"), SIGNAL(stateChanged( int )), SLOT(update_preview())); } if (symbology == BARCODE_MAXICODE) @@ -768,6 +938,11 @@ void MainWindow::change_options() m_optionWidget=uiload.load(&file); file.close(); tabMain->insertTab(1, m_optionWidget, tr("UPC-A")); + combobox_item_enabled(cmbFontSetting, 1, false); + if (cmbFontSetting->currentIndex() == 1) { + cmbFontSetting->setCurrentIndex(0); + } + cmbFontSetting->setItemText(2, tr("Small (vector only)")); connect(m_optionWidget->findChild("cmbUPCAAddonGap"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); } @@ -787,6 +962,11 @@ void MainWindow::change_options() } else { tabMain->insertTab(1, m_optionWidget, tr("EAN")); } + combobox_item_enabled(cmbFontSetting, 1, false); + if (cmbFontSetting->currentIndex() == 1) { + cmbFontSetting->setCurrentIndex(0); + } + cmbFontSetting->setItemText(2, tr("Small (vector only)")); connect(m_optionWidget->findChild("cmbUPCEANAddonGap"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); } @@ -816,23 +996,47 @@ void MainWindow::change_options() grpComposite->show(); break; default: - chkComposite->setChecked(false); grpComposite->hide(); break; } - tabMain->setCurrentIndex(0); + cmbECI->setEnabled(m_bc.bc.supportsECI(symbology)); /* Will need checking again in update_preview() as encoding mode dependent (HIBC) */ + chkRInit->setEnabled(m_bc.bc.supportsReaderInit(symbology)); /* Ditto (HIBC and GS1) */ + chkAutoHeight->setEnabled(!m_bc.bc.isFixedRatio(symbology)); + chkHRTShow->setEnabled(m_bc.bc.hasHRT(symbology)); + chkDotty->setEnabled(m_bc.bc.isDotty(symbology)); + + load_sub_settings(settings, symbology); + + composite_ui_set(); + autoheight_ui_set(); + HRTShow_ui_set(); + dotty_ui_set(); + + if (initial_load) { + tabMain->setCurrentIndex(settings.value("studio/tab_index", 0).toInt()); + } else if (original_tab_count == tabMain->count()) { + tabMain->setCurrentIndex(original_tab_index); + } else if (original_tab_count > tabMain->count()) { + tabMain->setCurrentIndex(original_tab_index == 2 ? 1 : 0); + } else { + tabMain->setCurrentIndex(original_tab_index == 1 ? 2 : 0); + } } -void MainWindow::composite_enable() +void MainWindow::composite_ui_set() { - if(chkComposite->isChecked() == true) + if (!grpComposite->isHidden() && chkComposite->isChecked()) { lblCompType->setEnabled(true); cmbCompType->setEnabled(true); lblComposite->setEnabled(true); txtComposite->setEnabled(true); - if (metaObject()->enumerator(0).value(bstyle->currentIndex())==BARCODE_CODE128) - m_optionWidget->findChild("radC128EAN")->setChecked(true); + if (metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CODE128) { + QRadioButton *radioButton = m_optionWidget->findChild("radC128EAN"); + if (radioButton) { + radioButton->setChecked(true); + } + } } else { @@ -847,7 +1051,8 @@ void MainWindow::composite_ean_check() { if (metaObject()->enumerator(0).value(bstyle->currentIndex())!=BARCODE_CODE128) return; - if(!m_optionWidget->findChild("radC128EAN")->isChecked()) + QRadioButton *radioButton = m_optionWidget->findChild("radC128EAN"); + if (radioButton && !radioButton->isChecked()) chkComposite->setChecked(false); } @@ -864,7 +1069,19 @@ void MainWindow::maxi_primary() } } -void MainWindow::upcean_addon_gap(QComboBox *comboBox, QLabel* label, int base) +// Taken from https://stackoverflow.com/questions/38915001/disable-specific-items-in-qcombobox +void MainWindow::combobox_item_enabled(QComboBox *comboBox, int index, bool enabled) +{ + QStandardItemModel *model = qobject_cast(comboBox->model()); + if (model) { + QStandardItem *item = model->item(index); + if (item) { + item->setEnabled(enabled); + } + } +} + +void MainWindow::upcean_addon_gap(QComboBox *comboBox, QLabel *label, int base) { const QRegularExpression addonRE("^[0-9X]+[+][0-9]+$"); int item_val; @@ -901,7 +1118,7 @@ void MainWindow::update_preview() QCheckBox *checkBox; //m_bc.ar=(Zint::QZint::AspectRatioMode)1; - if(chkComposite->isChecked() == true) { + if (!grpComposite->isHidden() && chkComposite->isChecked()) { m_bc.bc.setPrimaryMessage(txtData->text()); m_bc.bc.setText(txtComposite->toPlainText()); } else { @@ -919,11 +1136,8 @@ void MainWindow::update_preview() if (chkEscape->isChecked()) { m_bc.bc.setInputMode(m_bc.bc.inputMode() | ESCAPE_MODE); } - m_bc.bc.setHideText(0); - if(chkHRTHide->isChecked() == false) { - m_bc.bc.setHideText(1); - } m_bc.bc.setGSSep(false); + m_bc.bc.setDotSize(0.4f / 0.5f); switch (symbology) { @@ -1046,7 +1260,6 @@ void MainWindow::update_preview() m_bc.bc.setSymbol(BARCODE_DOTCODE); m_bc.bc.setOption2(m_optionWidget->findChild("cmbDotCols")->currentIndex()); set_gs1_mode(m_optionWidget->findChild("radDotGS1")->isChecked()); - m_bc.bc.setDotSize(m_optionWidget->findChild("txtDotSize")->text().toFloat()); break; case BARCODE_AZTEC: @@ -1196,6 +1409,9 @@ void MainWindow::update_preview() if (item_val) { m_bc.bc.setSecurityLevel(item_val); } + if (m_optionWidget->findChild("chkQRFullMultibyte")->isChecked()) { + m_bc.bc.setOption3(ZINT_FULL_MULTIBYTE); + } break; case BARCODE_MICROQR: @@ -1208,6 +1424,9 @@ void MainWindow::update_preview() if (item_val) { m_bc.bc.setSecurityLevel(item_val); } + if (m_optionWidget->findChild("chkMQRFullMultibyte")->isChecked()) { + m_bc.bc.setOption3(ZINT_FULL_MULTIBYTE); + } break; case BARCODE_RMQR: @@ -1223,6 +1442,9 @@ void MainWindow::update_preview() if (item_val) { m_bc.bc.setSecurityLevel(item_val * 2); // Levels 2 (M) and 4 (H) only } + if (m_optionWidget->findChild("chkRMQRFullMultibyte")->isChecked()) { + m_bc.bc.setOption3(ZINT_FULL_MULTIBYTE); + } break; case BARCODE_GRIDMATRIX: @@ -1235,6 +1457,9 @@ void MainWindow::update_preview() if (item_val) { m_bc.bc.setSecurityLevel(item_val); } + if (m_optionWidget->findChild("chkGridFullMultibyte")->isChecked()) { + m_bc.bc.setOption3(ZINT_FULL_MULTIBYTE); + } break; case BARCODE_MAXICODE: @@ -1282,6 +1507,9 @@ void MainWindow::update_preview() if (item_val) { m_bc.bc.setSecurityLevel(item_val); } + if (m_optionWidget->findChild("chkHXFullMultibyte")->isChecked()) { + m_bc.bc.setOption3(ZINT_FULL_MULTIBYTE); + } break; case BARCODE_ULTRA: @@ -1302,22 +1530,713 @@ void MainWindow::update_preview() m_bc.bc.setSymbol(symbology); break; } + m_symbology = m_bc.bc.symbol(); - if(chkComposite->isChecked()) + /* Recheck ECI and Reader Init */ + cmbECI->setEnabled(m_bc.bc.supportsECI()); + lblECI->setEnabled(cmbECI->isEnabled()); + chkRInit->setEnabled(m_bc.bc.supportsReaderInit() && (m_bc.bc.inputMode() & 0x07) != GS1_MODE); + + if (!grpComposite->isHidden() && chkComposite->isChecked()) m_bc.bc.setSecurityLevel(cmbCompType->currentIndex()); - m_bc.bc.setBorderType((Zint::QZint::BorderType)(btype->currentIndex()*2)); - m_bc.bc.setBorderWidth(bwidth->value()); - if(chkAutoHeight->isChecked()) { + if (!chkAutoHeight->isEnabled() || chkAutoHeight->isChecked()) { m_bc.bc.setHeight(0); } else { m_bc.bc.setHeight(heightb->value()); } + m_bc.bc.setECI(cmbECI->isEnabled() ? cmbECI->currentIndex() : 0); + m_bc.bc.setReaderInit(chkRInit->isEnabled() && chkRInit->isChecked()); + m_bc.bc.setShowText(chkHRTShow->isEnabled() && chkHRTShow->isChecked()); + m_bc.bc.setBorderType(btype->currentIndex()); + m_bc.bc.setBorderWidth(bwidth->value()); m_bc.bc.setWhitespace(spnWhitespace->value()); + m_bc.bc.setFontSetting(cmbFontSetting->currentIndex()); + m_bc.bc.setRotateAngle(cmbRotate->currentIndex()); + m_bc.bc.setDotty(chkDotty->isEnabled() && chkDotty->isChecked()); + if (m_symbology == BARCODE_DOTCODE || (chkDotty->isEnabled() && chkDotty->isChecked())) { + m_bc.bc.setDotSize(spnDotSize->value()); + } m_bc.bc.setFgColor(m_fgcolor); m_bc.bc.setBgColor(m_bgcolor); + change_print_scale(); + change_cmyk(); m_bc.setSize(width - 10, height - 10); m_bc.update(); - scene->setSceneRect(0, 0, width - 10, height - 10); + scene->setSceneRect(m_bc.boundingRect()); scene->update(); } + +/* Return settings subsection name for a symbol */ +const char *MainWindow::get_setting_name(int symbology) { + struct item { + const char *name; + int define; + int val; + }; + static const struct item data[] = { + { "", -1, 0 }, + { "code11", BARCODE_CODE11, 1 }, + { "c25standard", BARCODE_C25STANDARD, 2 }, + { "c25inter", BARCODE_C25INTER, 3 }, + { "c25iata", BARCODE_C25IATA, 4 }, + { "", -1, 5 }, + { "c25logic", BARCODE_C25LOGIC, 6 }, + { "c25ind", BARCODE_C25IND, 7 }, + { "code39", BARCODE_CODE39, 8 }, + { "excode39", BARCODE_EXCODE39, 9 }, + { "", -1, 10 }, + { "", -1, 11 }, + { "", -1, 12 }, + { "eanx", BARCODE_EANX, 13 }, + { "eanx", BARCODE_EANX_CHK, 14 }, + { "", -1, 15 }, + { "code128", BARCODE_GS1_128, 16 }, + { "", -1, 17 }, + { "codabar", BARCODE_CODABAR, 18 }, + { "", -1, 19 }, + { "code128", BARCODE_CODE128, 20 }, + { "dpleit", BARCODE_DPLEIT, 21 }, + { "dpident", BARCODE_DPIDENT, 22 }, + { "code16k", BARCODE_CODE16K, 23 }, + { "code49", BARCODE_CODE49, 24 }, + { "code93", BARCODE_CODE93, 25 }, + { "", -1, 26 }, + { "", -1, 27 }, + { "flat", BARCODE_FLAT, 28 }, + { "dbar_omn", BARCODE_DBAR_OMN, 29 }, + { "dbar_ltd", BARCODE_DBAR_LTD, 30 }, + { "dbar_exp", BARCODE_DBAR_EXP, 31 }, + { "telepen", BARCODE_TELEPEN, 32 }, + { "", -1, 33 }, + { "upca", BARCODE_UPCA, 34 }, + { "upca", BARCODE_UPCA_CHK, 35 }, + { "", -1, 36 }, + { "upce", BARCODE_UPCE, 37 }, + { "upce", BARCODE_UPCE_CHK, 38 }, + { "", -1, 39 }, + { "postnet", BARCODE_POSTNET, 40 }, + { "", -1, 41 }, + { "", -1, 42 }, + { "", -1, 43 }, + { "", -1, 44 }, + { "", -1, 45 }, + { "", -1, 46 }, + { "msi_plessey", BARCODE_MSI_PLESSEY, 47 }, + { "", -1, 48 }, + { "fim", BARCODE_FIM, 49 }, + { "logmars", BARCODE_LOGMARS, 50 }, + { "pharma", BARCODE_PHARMA, 51 }, + { "pzn", BARCODE_PZN, 52 }, + { "pharma_two", BARCODE_PHARMA_TWO, 53 }, + { "", -1, 54 }, + { "pdf417", BARCODE_PDF417, 55 }, + { "pdf417", BARCODE_PDF417COMP, 56 }, + { "maxicode", BARCODE_MAXICODE, 57 }, + { "qrcode", BARCODE_QRCODE, 58 }, + { "", -1, 59 }, + { "code128", BARCODE_CODE128B, 60 }, + { "", -1, 61 }, + { "", -1, 62 }, + { "auspost", BARCODE_AUSPOST, 63 }, + { "", -1, 64 }, + { "", -1, 65 }, + { "ausreply", BARCODE_AUSREPLY, 66 }, + { "ausroute", BARCODE_AUSROUTE, 67 }, + { "ausredirect", BARCODE_AUSREDIRECT, 68 }, + { "isbnx", BARCODE_ISBNX, 69 }, + { "rm4scc", BARCODE_RM4SCC, 70 }, + { "datamatrix", BARCODE_DATAMATRIX, 71 }, + { "ean14", BARCODE_EAN14, 72 }, + { "vin", BARCODE_VIN, 73 }, + { "codablockf", BARCODE_CODABLOCKF, 74 }, + { "nve18", BARCODE_NVE18, 75 }, + { "japanpost", BARCODE_JAPANPOST, 76 }, + { "koreapost", BARCODE_KOREAPOST, 77 }, + { "", -1, 78 }, + { "dbar_stk", BARCODE_DBAR_STK, 79 }, + { "dbar_omnstk", BARCODE_DBAR_OMNSTK, 80 }, + { "dbar_expstk", BARCODE_DBAR_EXPSTK, 81 }, + { "planet", BARCODE_PLANET, 82 }, + { "", -1, 83 }, + { "micropdf417", BARCODE_MICROPDF417, 84 }, + { "usps_imail", BARCODE_USPS_IMAIL, 85 }, + { "plessey", BARCODE_PLESSEY, 86 }, + { "telepen_num", BARCODE_TELEPEN_NUM, 87 }, + { "", -1, 88 }, + { "itf14", BARCODE_ITF14, 89 }, + { "kix", BARCODE_KIX, 90 }, + { "", -1, 91 }, + { "aztec", BARCODE_AZTEC, 92 }, + { "daft", BARCODE_DAFT, 93 }, + { "", -1, 94 }, + { "", -1, 95 }, + { "dpd", BARCODE_DPD, 96 }, + { "microqr", BARCODE_MICROQR, 97 }, + { "code128", BARCODE_HIBC_128, 98 }, + { "code39", BARCODE_HIBC_39, 99 }, + { "", -1, 100 }, + { "", -1, 101 }, + { "datamatrix", BARCODE_HIBC_DM, 102 }, + { "", -1, 103 }, + { "qrcode", BARCODE_HIBC_QR, 104 }, + { "", -1, 105 }, + { "pdf417", BARCODE_HIBC_PDF, 106 }, + { "", -1, 107 }, + { "micropdf417", BARCODE_HIBC_MICPDF, 108 }, + { "", -1, 109 }, + { "codablockf", BARCODE_HIBC_BLOCKF, 110 }, + { "", -1, 111 }, + { "aztec", BARCODE_HIBC_AZTEC, 112 }, + { "", -1, 113 }, + { "", -1, 114 }, + { "dotcode", BARCODE_DOTCODE, 115 }, + { "hanxin", BARCODE_HANXIN, 116 }, + { "", -1, 117 }, + { "", -1, 118 }, + { "", -1, 119 }, + { "", -1, 120 }, + { "mailmark", BARCODE_MAILMARK, 121 }, + { "", -1, 122 }, + { "", -1, 123 }, + { "", -1, 124 }, + { "", -1, 125 }, + { "", -1, 126 }, + { "", -1, 127 }, + { "azrune", BARCODE_AZRUNE, 128 }, + { "code32", BARCODE_CODE32, 129 }, + { "eanx", BARCODE_EANX_CC, 130 }, + { "code128", BARCODE_GS1_128_CC, 131 }, + { "dbar_omn", BARCODE_DBAR_OMN_CC, 132 }, + { "dbar_ltd", BARCODE_DBAR_LTD_CC, 133 }, + { "dbar_exp", BARCODE_DBAR_EXP_CC, 134 }, + { "upca", BARCODE_UPCA_CC, 135 }, + { "upce", BARCODE_UPCE_CC, 136 }, + { "dbar_stk", BARCODE_DBAR_STK_CC, 137 }, + { "dbar_omnstk", BARCODE_DBAR_OMNSTK_CC, 138 }, + { "dbar_expstk", BARCODE_DBAR_EXPSTK_CC, 139 }, + { "channel", BARCODE_CHANNEL, 140 }, + { "codeone", BARCODE_CODEONE, 141 }, + { "gridmatrix", BARCODE_GRIDMATRIX, 142 }, + { "upnqr", BARCODE_UPNQR, 143 }, + { "ultra", BARCODE_ULTRA, 144 }, + { "rmqr", BARCODE_RMQR, 145 }, + }; + static const int data_size = sizeof(data) / sizeof(struct item); + + if (symbology < 0 || symbology >= data_size) { + return ""; + } + if (data[symbology].val != symbology || (data[symbology].define != -1 && data[symbology].define != symbology)) { // Self-check + fprintf(stderr, "MainWindow::get_setting_name: data table out of sync (%d)\n", symbology); + return ""; + } + return data[symbology].name; +} + +/* Helper to return index of selected radio button in group, checking for NULL */ +int MainWindow::get_button_group_index(const QStringList &children) { + QRadioButton *radioButton; + for (int index = 0; index < children.size(); index++) { + radioButton = m_optionWidget->findChild(children[index]); + if (radioButton && radioButton->isChecked()) { + return index; + } + } + return 0; +} + +/* Helper to set radio button in group from index in settings, checking for NULL */ +void MainWindow::set_radiobutton_from_setting(QSettings &settings, const QString &setting, const QStringList &children, int default_val) { + int index = settings.value(setting, default_val).toInt(); + QRadioButton *radioButton; + if (index >= 0 && index < children.size()) { + radioButton = m_optionWidget->findChild(children[index]); + } else { + radioButton = m_optionWidget->findChild(children[0]); + } + if (radioButton) { + radioButton->setChecked(true); + } +} + +/* Helper to return index of selected item in combobox, checking for NULL */ +int MainWindow::get_combobox_index(const QString &child) { + QComboBox *comboBox = m_optionWidget->findChild(child); + return comboBox ? comboBox->currentIndex() : 0; +} + +/* Helper to set item in combobox from index in settings, checking for NULL */ +void MainWindow::set_combobox_from_setting(QSettings &settings, const QString &setting, const QString &child, int default_val) { + QComboBox *comboBox = m_optionWidget->findChild(child); + if (comboBox) { + comboBox->setCurrentIndex(settings.value(setting, default_val).toInt()); + } +} + +/* Helper to return if checkbox checked, checking for NULL */ +int MainWindow::get_checkbox_val(const QString &child) { + QCheckBox *checkBox = m_optionWidget->findChild(child); + return checkBox && checkBox->isChecked() ? 1 : 0; +} + +/* Helper to set checkbox from settings, checking for NULL */ +void MainWindow::set_checkbox_from_setting(QSettings &settings, const QString &setting, const QString &child, int default_val) { + QCheckBox *checkBox = m_optionWidget->findChild(child); + if (checkBox) { + checkBox->setChecked(settings.value(setting, default_val).toInt() ? true : false); + } +} + +/* Helper to return text of line edit, checking for NULL */ +QString MainWindow::get_lineedit_val(const QString &child) { + QLineEdit *lineEdit = m_optionWidget->findChild(child); + return lineEdit ? lineEdit->text() : ""; +} + +/* Helper to set line edit from settings, checking for NULL */ +void MainWindow::set_lineedit_from_setting(QSettings &settings, const QString &setting, const QString &child, const char *default_val) { + QLineEdit *lineEdit = m_optionWidget->findChild(child); + if (lineEdit) { + lineEdit->setText(settings.value(setting, default_val).toString()); + } +} + +/* Save settings for an individual symbol */ +void MainWindow::save_sub_settings(QSettings &settings, int symbology) { + + const char *name = get_setting_name(symbology); + if (*name) { + settings.setValue(QString("studio/bc/%1/data").arg(name), txtData->text()); + if (!grpComposite->isHidden()) { + settings.setValue(QString("studio/bc/%1/composite_text").arg(name), txtComposite->toPlainText()); + settings.setValue(QString("studio/bc/%1/chk_composite").arg(name), chkComposite->isChecked() ? 1 : 0); + settings.setValue(QString("studio/bc/%1/comp_type").arg(name), cmbCompType->currentIndex()); + } + if (cmbECI->isEnabled()) { + settings.setValue(QString("studio/bc/%1/eci").arg(name), cmbECI->currentIndex()); + } + settings.setValue(QString("studio/bc/%1/chk_escape").arg(name), chkEscape->isChecked() ? 1 : 0); + settings.setValue(QString("studio/bc/%1/chk_data").arg(name), chkData->isChecked() ? 1 : 0); + if (chkRInit->isEnabled()) { + settings.setValue(QString("studio/bc/%1/chk_rinit").arg(name), chkRInit->isChecked() ? 1 : 0); + } + if (chkAutoHeight->isEnabled()) { + settings.setValue(QString("studio/bc/%1/appearance/autoheight").arg(name), chkAutoHeight->isChecked() ? 1 : 0); + settings.setValue(QString("studio/bc/%1/appearance/height").arg(name), heightb->value()); + } + settings.setValue(QString("studio/bc/%1/appearance/border").arg(name), bwidth->value()); + settings.setValue(QString("studio/bc/%1/appearance/whitespace").arg(name), spnWhitespace->value()); + settings.setValue(QString("studio/bc/%1/appearance/scale").arg(name), spnScale->value()); + settings.setValue(QString("studio/bc/%1/appearance/border_type").arg(name), btype->currentIndex()); + if (chkHRTShow->isEnabled()) { + settings.setValue(QString("studio/bc/%1/appearance/font_setting").arg(name), cmbFontSetting->currentIndex()); + settings.setValue(QString("studio/bc/%1/appearance/chk_hrt_show").arg(name), chkHRTShow->isChecked() ? 1 : 0); + } + settings.setValue(QString("studio/bc/%1/appearance/cmyk").arg(name), chkCMYK->isChecked() ? 1 : 0); + settings.setValue(QString("studio/bc/%1/appearance/rotate").arg(name), cmbRotate->currentIndex()); + if (symbology == BARCODE_DOTCODE || chkDotty->isEnabled()) { + settings.setValue(QString("studio/bc/%1/appearance/chk_dotty").arg(name), chkDotty->isChecked() ? 1 : 0); + settings.setValue(QString("studio/bc/%1/appearance/dot_size").arg(name), spnDotSize->value()); + } + settings.setValue(QString("studio/bc/%1/ink/red").arg(name), m_fgcolor.red()); + settings.setValue(QString("studio/bc/%1/ink/green").arg(name), m_fgcolor.green()); + settings.setValue(QString("studio/bc/%1/ink/blue").arg(name), m_fgcolor.blue()); + settings.setValue(QString("studio/bc/%1/ink/alpha").arg(name), m_fgcolor.alpha()); + settings.setValue(QString("studio/bc/%1/paper/red").arg(name), m_bgcolor.red()); + settings.setValue(QString("studio/bc/%1/paper/green").arg(name), m_bgcolor.green()); + settings.setValue(QString("studio/bc/%1/paper/blue").arg(name), m_bgcolor.blue()); + settings.setValue(QString("studio/bc/%1/paper/alpha").arg(name), m_bgcolor.alpha()); + } + + switch (symbology) { + case BARCODE_CODE128: + case BARCODE_CODE128B: + case BARCODE_GS1_128: + case BARCODE_GS1_128_CC: + case BARCODE_HIBC_128: + settings.setValue("studio/bc/code128/encoding_mode", get_button_group_index(QStringList() << "radC128Stand" << "radC128EAN" << "radC128CSup" << "radC128HIBC")); + break; + + case BARCODE_PDF417: + case BARCODE_PDF417COMP: + case BARCODE_HIBC_PDF: + settings.setValue("studio/bc/pdf417/cols", get_combobox_index("cmbPDFCols")); + settings.setValue("studio/bc/pdf417/ecc", get_combobox_index("cmbPDFECC")); + settings.setValue("studio/bc/pdf417/encoding_mode", get_button_group_index(QStringList() << "radPDFStand" << "radPDFTruncated" << "radPDFHIBC")); + break; + + case BARCODE_MICROPDF417: + case BARCODE_HIBC_MICPDF: + settings.setValue("studio/bc/micropdf417/cols", get_combobox_index("cmbMPDFCols")); + settings.setValue("studio/bc/micropdf417/encoding_mode", get_button_group_index(QStringList() << "radMPDFStand" << "radMPDFHIBC")); + break; + + case BARCODE_DOTCODE: + settings.setValue("studio/bc/dotcode/cols", get_combobox_index("cmbDotCols")); + settings.setValue("studio/bc/dotcode/encoding_mode", get_button_group_index(QStringList() << "radDotStand" << "radDotGS1")); + break; + + case BARCODE_AZTEC: + case BARCODE_HIBC_AZTEC: + settings.setValue("studio/bc/aztec/autoresizing", get_button_group_index(QStringList() << "radAztecAuto" << "radAztecSize" << "radAztecECC")); + settings.setValue("studio/bc/aztec/size", get_combobox_index("cmbAztecSize")); + settings.setValue("studio/bc/aztec/ecc", get_combobox_index("cmbAztecECC")); + settings.setValue("studio/bc/aztec/encoding_mode", get_button_group_index(QStringList() << "radAztecStand" << "radAztecGS1" << "radAztecHIBC")); + break; + + case BARCODE_MSI_PLESSEY: + settings.setValue("studio/bc/msi_plessey/check_digit", get_combobox_index("cmbMSICheck")); + break; + + case BARCODE_CODE11: + settings.setValue("studio/bc/code11/check_digit", get_button_group_index(QStringList() << "radC11TwoCheckDigits" << "radC11OneCheckDigit" << "radC11NoCheckDigits")); + break; + + case BARCODE_CODE39: + case BARCODE_HIBC_39: + settings.setValue("studio/bc/code39/check_digit", get_button_group_index(QStringList() << "radC39Stand" << "radC39Check" << "radC39HIBC")); + break; + + case BARCODE_EXCODE39: + settings.setValue("studio/bc/excode39/check_digit", get_button_group_index(QStringList() << "radC39Stand" << "radC39Check")); + break; + + case BARCODE_LOGMARS: + settings.setValue("studio/bc/logmars/check_digit", get_button_group_index(QStringList() << "radLOGMARSStand" << "radLOGMARSCheck")); + break; + + case BARCODE_CODE16K: + settings.setValue("studio/bc/code16k/row_sep_height", get_combobox_index("cmbC16kRowSepHeight")); + settings.setValue("studio/bc/code16k/encoding_mode", get_button_group_index(QStringList() << "radC16kStand" << "radC16kGS1")); + break; + + case BARCODE_CODABAR: + settings.setValue("studio/bc/codabar/chk_check_char", get_checkbox_val("chkCodabarCheck")); + break; + + case BARCODE_CODABLOCKF: + case BARCODE_HIBC_BLOCKF: + settings.setValue("studio/bc/codablockf/width", get_combobox_index("cmbCbfWidth")); + settings.setValue("studio/bc/codablockf/height", get_combobox_index("cmbCbfHeight")); + settings.setValue("studio/bc/codablockf/row_sep_height", get_combobox_index("cmbCbfRowSepHeight")); + settings.setValue("studio/bc/codablockf/encoding_mode", get_button_group_index(QStringList() << "radCbfStand" << "radCbfHIBC")); + break; + + case BARCODE_DATAMATRIX: + case BARCODE_HIBC_DM: + settings.setValue("studio/bc/datamatrix/size", get_combobox_index("cmbDM200Size")); + settings.setValue("studio/bc/datamatrix/encoding_mode", get_button_group_index(QStringList() << "radDM200Stand" << "radDM200GS1" << "radDM200HIBC")); + settings.setValue("studio/bc/datamatrix/chk_suppress_rect", get_checkbox_val("chkDMRectangle")); + settings.setValue("studio/bc/datamatrix/chk_allow_dmre", get_checkbox_val("chkDMRE")); + settings.setValue("studio/bc/datamatrix/chk_gs_sep", get_checkbox_val("chkDMGSSep")); + break; + + case BARCODE_QRCODE: + case BARCODE_HIBC_QR: + settings.setValue("studio/bc/qrcode/size", get_combobox_index("cmbQRSize")); + settings.setValue("studio/bc/qrcode/ecc", get_combobox_index("cmbQRECC")); + settings.setValue("studio/bc/qrcode/encoding_mode", get_button_group_index(QStringList() << "radDM200Stand" << "radQRGS1" << "radQRHIBC")); + settings.setValue("studio/bc/qrcode/chk_full_multibyte", get_checkbox_val("chkQRFullMultibyte")); + break; + + case BARCODE_RMQR: + settings.setValue("studio/bc/rmqr/size", get_combobox_index("cmbRMQRSize")); + settings.setValue("studio/bc/rmqr/ecc", get_combobox_index("cmbRMQRECC")); + settings.setValue("studio/bc/rmqr/encoding_mode", get_button_group_index(QStringList() << "radQRStand" << "radRMQRGS1")); + settings.setValue("studio/bc/rmqr/chk_full_multibyte", get_checkbox_val("chkRMQRFullMultibyte")); + break; + + case BARCODE_HANXIN: + settings.setValue("studio/bc/hanxin/size", get_combobox_index("cmbHXSize")); + settings.setValue("studio/bc/hanxin/ecc", get_combobox_index("cmbHXECC")); + settings.setValue("studio/bc/hanxin/chk_full_multibyte", get_checkbox_val("chkHXFullMultibyte")); + break; + + case BARCODE_MICROQR: + settings.setValue("studio/bc/microqr/size", get_combobox_index("cmbMQRSize")); + settings.setValue("studio/bc/microqr/ecc", get_combobox_index("cmbMQRECC")); + settings.setValue("studio/bc/microqr/chk_full_multibyte", get_checkbox_val("chkMQRFullMultibyte")); + break; + + case BARCODE_GRIDMATRIX: + settings.setValue("studio/bc/gridmatrix/size", get_combobox_index("cmbGridSize")); + settings.setValue("studio/bc/gridmatrix/ecc", get_combobox_index("cmbGridECC")); + settings.setValue("studio/bc/gridmatrix/chk_full_multibyte", get_checkbox_val("chkGridFullMultibyte")); + break; + + case BARCODE_MAXICODE: + settings.setValue("studio/bc/maxicode/mode", get_combobox_index("cmbMaxiMode")); + settings.setValue("studio/bc/maxicode/primary_message", get_lineedit_val("txtMaxiPrimary")); + break; + + case BARCODE_CODEONE: + settings.setValue("studio/bc/codeone/size", get_combobox_index("cmbC1Size")); + settings.setValue("studio/bc/codeone/encoding_mode", get_button_group_index(QStringList() << "radC1Stand" << "radC1GS1")); + break; + + case BARCODE_CODE49: + settings.setValue("studio/bc/code49/row_sep_height", get_combobox_index("cmbC49RowSepHeight")); + settings.setValue("studio/bc/code49/encoding_mode", get_button_group_index(QStringList() << "radC49Stand" << "radC49GS1")); + break; + + case BARCODE_DBAR_EXPSTK: + case BARCODE_DBAR_EXPSTK_CC: + settings.setValue("studio/bc/dbar_expstk/cols", get_combobox_index("cmbCols")); + break; + + case BARCODE_ULTRA: + settings.setValue("studio/bc/ultra/autoresizing", get_button_group_index(QStringList() << "radUltraAuto" << "radUltraEcc")); + settings.setValue("studio/bc/ultra/ecc", get_combobox_index("cmbUltraEcc")); + settings.setValue("studio/bc/ultra/encoding_mode", get_button_group_index(QStringList() << "radUltraStand" << "radUltraGS1")); + break; + + case BARCODE_UPCA: + case BARCODE_UPCA_CHK: + case BARCODE_UPCA_CC: + settings.setValue("studio/bc/upca/addongap", get_combobox_index("cmbUPCAAddonGap")); + break; + + case BARCODE_EANX: + case BARCODE_EANX_CHK: + case BARCODE_EANX_CC: + settings.setValue("studio/bc/eanx/addongap", get_combobox_index("cmbUPCEANAddonGap")); + break; + + case BARCODE_UPCE: + case BARCODE_UPCE_CHK: + case BARCODE_UPCE_CC: + settings.setValue("studio/bc/upce/addongap", get_combobox_index("cmbUPCEANAddonGap")); + break; + + case BARCODE_ISBNX: + settings.setValue("studio/bc/isnbx/addongap", get_combobox_index("cmbUPCEANAddonGap")); + break; + + case BARCODE_VIN: + settings.setValue("studio/bc/vin/chk_import_char_prefix", get_checkbox_val("chkVINImportChar")); + break; + } +} + +/* Load settings for an individual symbol */ +void MainWindow::load_sub_settings(QSettings &settings, int symbology) { + + const char *name = get_setting_name(symbology); + if (*name) { + const QString &data = settings.value(QString("studio/bc/%1/data").arg(name), "").toString(); + if (!data.isEmpty()) { + txtData->setText(data); + } + if (!grpComposite->isHidden()) { + const QString &composite_text = settings.value(QString("studio/bc/%1/composite_text").arg(name), "").toString(); + if (!composite_text.isEmpty()) { + txtComposite->setText(composite_text); + } + chkComposite->setChecked(settings.value(QString("studio/bc/%1/chk_composite").arg(name), 0).toInt() ? true : false); + cmbCompType->setCurrentIndex(settings.value(QString("studio/bc/%1/comp_type").arg(name), 0).toInt()); + } + if (cmbECI->isEnabled()) { + cmbECI->setCurrentIndex(settings.value(QString("studio/bc/%1/eci").arg(name), 0).toInt()); + } + chkEscape->setChecked(settings.value(QString("studio/bc/%1/chk_escape").arg(name)).toInt() ? true : false); + chkData->setChecked(settings.value(QString("studio/bc/%1/chk_data").arg(name)).toInt() ? true : false); + if (chkRInit->isEnabled()) { + chkRInit->setChecked(settings.value(QString("studio/bc/%1/chk_rinit").arg(name)).toInt() ? true : false); + } + if (chkAutoHeight->isEnabled()) { + chkAutoHeight->setChecked(settings.value(QString("studio/bc/%1/appearance/autoheight").arg(name), 1).toInt() ? true : false); + heightb->setValue(settings.value(QString("studio/bc/%1/appearance/height").arg(name), 50).toInt()); + } + bwidth->setValue(settings.value(QString("studio/bc/%1/appearance/border").arg(name), 0).toInt()); + spnWhitespace->setValue(settings.value(QString("studio/bc/%1/appearance/whitespace").arg(name), 0).toInt()); + spnScale->setValue(settings.value(QString("studio/bc/%1/appearance/scale").arg(name), 1.0).toFloat()); + btype->setCurrentIndex(settings.value(QString("studio/bc/%1/appearance/border_type").arg(name), 0).toInt()); + if (chkHRTShow->isEnabled()) { + cmbFontSetting->setCurrentIndex(settings.value(QString("studio/bc/%1/appearance/font_setting").arg(name), 0).toInt()); + chkHRTShow->setChecked(settings.value(QString("studio/bc/%1/appearance/chk_hrt_show").arg(name), 1).toInt() ? true : false); + } + chkCMYK->setChecked(settings.value(QString("studio/bc/%1/appearance/cmyk").arg(name), 0).toInt() ? true : false); + cmbRotate->setCurrentIndex(settings.value(QString("studio/bc/%1/appearance/rotate").arg(name), 0).toInt()); + if (symbology == BARCODE_DOTCODE || chkDotty->isEnabled()) { + chkDotty->setChecked(settings.value(QString("studio/bc/%1/appearance/chk_dotty").arg(name), 0).toInt() ? true : false); + spnDotSize->setValue(settings.value(QString("studio/bc/%1/appearance/dot_size").arg(name), 0.4f / 0.5f).toFloat()); + } + m_fgcolor.setRgb(settings.value(QString("studio/bc/%1/ink/red").arg(name), 0).toInt(), + settings.value(QString("studio/bc/%1/ink/green").arg(name), 0).toInt(), + settings.value(QString("studio/bc/%1/ink/blue").arg(name), 0).toInt(), + settings.value(QString("studio/bc/%1/ink/alpha").arg(name), 0xff).toInt()); + m_bgcolor.setRgb(settings.value(QString("studio/bc/%1/paper/red").arg(name), 0xff).toInt(), + settings.value(QString("studio/bc/%1/paper/green").arg(name), 0xff).toInt(), + settings.value(QString("studio/bc/%1/paper/blue").arg(name), 0xff).toInt(), + settings.value(QString("studio/bc/%1/paper/alpha").arg(name), 0xff).toInt()); + } + + switch (symbology) { + case BARCODE_CODE128: + case BARCODE_CODE128B: + case BARCODE_GS1_128: + case BARCODE_GS1_128_CC: + case BARCODE_HIBC_128: + set_radiobutton_from_setting(settings, "studio/bc/code128/encoding_mode", QStringList() << "radC128Stand" << "radC128EAN" << "radC128CSup" << "radC128HIBC"); + break; + + case BARCODE_PDF417: + case BARCODE_PDF417COMP: + case BARCODE_HIBC_PDF: + set_combobox_from_setting(settings, "studio/bc/pdf417/cols", "cmbPDFCols"); + set_combobox_from_setting(settings, "studio/bc/pdf417/ecc", "cmbPDFECC"); + set_radiobutton_from_setting(settings, "studio/bc/pdf417/encoding_mode", QStringList() << "radPDFStand" << "radPDFTruncated" << "radPDFHIBC"); + break; + + case BARCODE_MICROPDF417: + case BARCODE_HIBC_MICPDF: + set_combobox_from_setting(settings, "studio/bc/micropdf417/cols", "cmbMPDFCols"); + set_radiobutton_from_setting(settings, "studio/bc/micropdf417/encoding_mode", QStringList() << "radMPDFStand" << "radMPDFHIBC"); + break; + + case BARCODE_DOTCODE: + set_combobox_from_setting(settings, "studio/bc/dotcode/cols", "cmbDotCols"); + set_radiobutton_from_setting(settings, "studio/bc/dotcode/encoding_mode", QStringList() << "radDotStand" << "radDotGS1"); + break; + + case BARCODE_AZTEC: + case BARCODE_HIBC_AZTEC: + set_radiobutton_from_setting(settings, "studio/bc/aztec/autoresizing", QStringList() << "radAztecAuto" << "radAztecSize" << "radAztecECC"); + set_combobox_from_setting(settings, "studio/bc/aztec/size", "cmbAztecSize"); + set_combobox_from_setting(settings, "studio/bc/aztec/ecc", "cmbAztecECC"); + set_radiobutton_from_setting(settings, "studio/bc/aztec/encoding_mode", QStringList() << "radAztecStand" << "radAztecGS1" << "radAztecHIBC"); + break; + + case BARCODE_MSI_PLESSEY: + set_combobox_from_setting(settings, "studio/bc/msi_plessey/check_digit", "cmbMSICheck"); + break; + + case BARCODE_CODE11: + set_radiobutton_from_setting(settings, "studio/bc/code11/check_digit", QStringList() << "radC11TwoCheckDigits" << "radC11OneCheckDigit" << "radC11NoCheckDigits"); + break; + + case BARCODE_CODE39: + case BARCODE_HIBC_39: + set_radiobutton_from_setting(settings, "studio/bc/code39/check_digit", QStringList() << "radC39Stand" << "radC39Check" << "radC39HIBC"); + break; + + case BARCODE_EXCODE39: + set_radiobutton_from_setting(settings, "studio/bc/excode39/check_digit", QStringList() << "radC39Stand" << "radC39Check"); + break; + + case BARCODE_LOGMARS: + set_radiobutton_from_setting(settings, "studio/bc/logmars/check_digit", QStringList() << "radLOGMARSStand" << "radLOGMARSCheck"); + break; + + case BARCODE_CODE16K: + set_combobox_from_setting(settings, "studio/bc/code16k/row_sep_height", "cmbC16kRowSepHeight"); + set_radiobutton_from_setting(settings, "studio/bc/code16k/encoding_mode", QStringList() << "radC16kStand" << "radC16kGS1"); + break; + + case BARCODE_CODABAR: + set_checkbox_from_setting(settings, "studio/bc/codabar/chk_check_char", "chkCodabarCheck"); + break; + + case BARCODE_CODABLOCKF: + case BARCODE_HIBC_BLOCKF: + set_combobox_from_setting(settings, "studio/bc/codablockf/width", "cmbCbfWidth"); + set_combobox_from_setting(settings, "studio/bc/codablockf/height", "cmbCbfHeight"); + set_combobox_from_setting(settings, "studio/bc/codablockf/row_sep_height", "cmbCbfRowSepHeight"); + set_radiobutton_from_setting(settings, "studio/bc/codablockf/encoding_mode", QStringList() << "radCbfStand" << "radCbfHIBC"); + break; + + case BARCODE_DATAMATRIX: + case BARCODE_HIBC_DM: + set_combobox_from_setting(settings, "studio/bc/datamatrix/size", "cmbDM200Size"); + set_radiobutton_from_setting(settings, "studio/bc/datamatrix/encoding_mode", QStringList() << "radDM200Stand" << "radDM200GS1" << "radDM200HIBC"); + set_checkbox_from_setting(settings, "studio/bc/datamatrix/chk_suppress_rect", "chkDMRectangle"); + set_checkbox_from_setting(settings, "studio/bc/datamatrix/chk_allow_dmre", "chkDMRE"); + set_checkbox_from_setting(settings, "studio/bc/datamatrix/chk_gs_sep", "chkDMGSSep"); + break; + + case BARCODE_QRCODE: + case BARCODE_HIBC_QR: + set_combobox_from_setting(settings, "studio/bc/qrcode/size", "cmbQRSize"); + set_combobox_from_setting(settings, "studio/bc/qrcode/ecc", "cmbQRECC"); + set_radiobutton_from_setting(settings, "studio/bc/qrcode/encoding_mode", QStringList() << "radDM200Stand" << "radQRGS1" << "radQRHIBC"); + set_checkbox_from_setting(settings, "studio/bc/qrcode/chk_full_multibyte", "chkQRFullMultibyte"); + break; + + case BARCODE_RMQR: + set_combobox_from_setting(settings, "studio/bc/rmqr/size", "cmbRMQRSize"); + set_combobox_from_setting(settings, "studio/bc/rmqr/ecc", "cmbRMQRECC"); + set_radiobutton_from_setting(settings, "studio/bc/rmqr/encoding_mode", QStringList() << "radQRStand" << "radRMQRGS1"); + set_checkbox_from_setting(settings, "studio/bc/rmqr/chk_full_multibyte", "chkRMQRFullMultibyte"); + break; + + case BARCODE_HANXIN: + set_combobox_from_setting(settings, "studio/bc/hanxin/size", "cmbHXSize"); + set_combobox_from_setting(settings, "studio/bc/hanxin/ecc", "cmbHXECC"); + set_checkbox_from_setting(settings, "studio/bc/hanxin/chk_full_multibyte", "chkHXFullMultibyte"); + break; + + case BARCODE_MICROQR: + set_combobox_from_setting(settings, "studio/bc/microqr/size", "cmbMQRSize"); + set_combobox_from_setting(settings, "studio/bc/microqr/ecc", "cmbMQRECC"); + set_checkbox_from_setting(settings, "studio/bc/microqr/chk_full_multibyte", "chkMQRFullMultibyte"); + break; + + case BARCODE_GRIDMATRIX: + set_combobox_from_setting(settings, "studio/bc/gridmatrix/size", "cmbGridSize"); + set_combobox_from_setting(settings, "studio/bc/gridmatrix/ecc", "cmbGridECC"); + set_checkbox_from_setting(settings, "studio/bc/gridmatrix/chk_full_multibyte", "chkGridFullMultibyte"); + break; + + case BARCODE_MAXICODE: + set_combobox_from_setting(settings, "studio/bc/maxicode/mode", "cmbMaxiMode", 1); + set_lineedit_from_setting(settings, "studio/bc/maxicode/primary_message", "txtMaxiPrimary", "Primary Message Here!"); + break; + + case BARCODE_CODEONE: + set_combobox_from_setting(settings, "studio/bc/codeone/size", "cmbC1Size"); + set_radiobutton_from_setting(settings, "studio/bc/codeone/encoding_mode", QStringList() << "radC1Stand" << "radC1GS1"); + break; + + case BARCODE_CODE49: + set_combobox_from_setting(settings, "studio/bc/code49/row_sep_height", "cmbC49RowSepHeight"); + set_radiobutton_from_setting(settings, "studio/bc/code49/encoding_mode", QStringList() << "radC49Stand" << "radC49GS1"); + break; + + case BARCODE_DBAR_EXPSTK: + set_combobox_from_setting(settings, "studio/bc/dbar_expstk/cols", "cmbCols"); + break; + + case BARCODE_ULTRA: + set_radiobutton_from_setting(settings, "studio/bc/ultra/autoresizing", QStringList() << "radUltraAuto" << "radUltraEcc"); + set_combobox_from_setting(settings, "studio/bc/ultra/ecc", "cmbUltraEcc"); + set_radiobutton_from_setting(settings, "studio/bc/ultra/encoding_mode", QStringList() << "radUltraStand" << "radUltraGS1"); + break; + + case BARCODE_UPCA: + case BARCODE_UPCA_CHK: + case BARCODE_UPCA_CC: + set_combobox_from_setting(settings, "studio/bc/upca/addongap", "cmbUPCAAddonGap"); + break; + + case BARCODE_EANX: + case BARCODE_EANX_CHK: + case BARCODE_EANX_CC: + set_combobox_from_setting(settings, "studio/bc/eanx/addongap", "cmbUPCEANAddonGap"); + break; + + case BARCODE_UPCE: + case BARCODE_UPCE_CHK: + case BARCODE_UPCE_CC: + set_combobox_from_setting(settings, "studio/bc/upce/addongap", "cmbUPCEANAddonGap"); + break; + + case BARCODE_ISBNX: + set_combobox_from_setting(settings, "studio/bc/isbnx/addongap", "cmbUPCEANAddonGap"); + break; + + case BARCODE_VIN: + set_checkbox_from_setting(settings, "studio/bc/vin/chk_import_char_prefix", "chkVINImportChar"); + break; + } +} diff --git a/frontend_qt/mainwindow.h b/frontend_qt/mainwindow.h index 18d4bd05..e17759a4 100644 --- a/frontend_qt/mainwindow.h +++ b/frontend_qt/mainwindow.h @@ -113,7 +113,7 @@ public: }; public: - MainWindow(QWidget* parent = 0, Qt::WindowFlags fl = 0); + MainWindow(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); ~MainWindow(); @@ -122,16 +122,37 @@ public slots: void change_options(); void on_fgcolor_clicked(); void on_bgcolor_clicked(); - void composite_enable(); + void composite_ui_set(); void composite_ean_check(); void maxi_primary(); void change_print_scale(); - void autoheight_clicked(); + void change_cmyk(); + void autoheight_ui_set(); + void HRTShow_ui_set(); + void dotty_ui_set(); + void on_encoded(); + void filter_symbologies(); protected: void resizeEvent(QResizeEvent *event); - void upcean_addon_gap(QComboBox *comboBox, QLabel* label, int base); + void combobox_item_enabled(QComboBox *comboBox, int index, bool enabled); + void upcean_addon_gap(QComboBox *comboBox, QLabel *label, int base); void set_gs1_mode(bool gs1_mode); + bool fixed_height(); + bool no_hrt(); + const char *get_setting_name(int symbology); + int get_button_group_index(const QStringList &children); + void set_radiobutton_from_setting(QSettings &settings, const QString &setting, const QStringList &children, int default_val = 0); + int get_combobox_index(const QString &child); + void set_combobox_from_setting(QSettings &settings, const QString &setting, const QString &child, int default_val = 0); + int get_checkbox_val(const QString &child); + void set_checkbox_from_setting(QSettings &settings, const QString &setting, const QString &child, int default_val = 0); + float get_doublespinbox_val(const QString &child); + void set_doublespinbox_from_setting(QSettings &settings, const QString &setting, const QString &child, float default_val = 0); + QString get_lineedit_val(const QString &child); + void set_lineedit_from_setting(QSettings &settings, const QString &setting, const QString &child, const char *default_val = ""); + void save_sub_settings(QSettings &settings, int symbology); + void load_sub_settings(QSettings &settings, int symbology); private slots: bool save(); @@ -148,6 +169,7 @@ private: BarcodeItem m_bc; QWidget *m_optionWidget; QGraphicsScene *scene; + int m_symbology; }; #endif diff --git a/tools/update_version.php b/tools/update_version.php index d49a8340..d6f57136 100644 --- a/tools/update_version.php +++ b/tools/update_version.php @@ -213,6 +213,10 @@ version_replace(1, $data_dirname . 'backend_qt/backend_qt.pro', '/^VERSION[ \t]* version_replace(1, $data_dirname . 'backend_tcl/zint.c', '/#define[ \t]+VERSION[ \t]+"/', '/[0-9.]+/', $v_str); +// backend_tcl/configure.in + +version_replace(1, $data_dirname . 'backend_tcl/configure.in', '/^AC_INIT\(\[zint\],[ \t]*\[/', '/[0-9.]+/', $v_str); + // frontend/zint.rc rc_replace($data_dirname . 'frontend/zint.rc', $rc_str); @@ -257,7 +261,15 @@ version_replace(6, $data_dirname . 'win32/vs2015/zint.vcxproj', '/ZINT_VERSION=" version_replace(1, $data_dirname . 'win32/vs2015/vsx/libzintMD.vcxproj', '/ZINT_VERSION="/', '/ZINT_VERSION="[0-9.]+"/', 'ZINT_VERSION="' . $v_str . '"'); +// win32/vs2019/libzint.vcxproj + +version_replace(2, $data_dirname . 'win32/vs2019/libzint.vcxproj', '/ZINT_VERSION="/', '/ZINT_VERSION="[0-9.]+"/', 'ZINT_VERSION="' . $v_str . '"'); + +// win32/vs2019/zint.vcxproj + +version_replace(2, $data_dirname . 'win32/vs2019/zint.vcxproj', '/ZINT_VERSION="/', '/ZINT_VERSION="[0-9.]+"/', 'ZINT_VERSION="' . $v_str . '"'); + // Leaving auto-generated files: -// backend_tcl/configure (PACKAGE_VERSION and PACKAGE_STRING) +// backend_tcl/configure (PACKAGE_VERSION and PACKAGE_STRING) - generated by autoconf from configure.in // frontend_qt/Inno_Setup_qtzint.iss (MyAppVersion) // win32/zint_cmdline_vc6/zint_cmdline_vc6.dsp (2 ZINT_VERSION's) diff --git a/win32/vs2015/libzint.vcxproj b/win32/vs2015/libzint.vcxproj index 2c9d85fd..c1fe63d9 100644 --- a/win32/vs2015/libzint.vcxproj +++ b/win32/vs2015/libzint.vcxproj @@ -114,7 +114,7 @@ Disabled - ..\extern\libpng\include;..\extern\zlib\include;%(AdditionalIncludeDirectories) + ..\..\..\zlib\;..\..\..\lpng\;..\..\..\lpng\build;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";NO_PNG;BUILD_ZINT_DLL;ZLIB_DLL;PNG_DLL;DEBUG;%(PreprocessorDefinitions) true @@ -137,7 +137,7 @@ %(AdditionalDependencies) $(OutDir)zintd.dll - ..\extern\libpng\lib\x86;..\extern\zlib\lib\x86;%(AdditionalLibraryDirectories) + ..\..\lpng\build\Release;..\..\..\zlib;%(AdditionalLibraryDirectories) libcmtd.lib;%(IgnoreSpecificDefaultLibraries) true Windows @@ -147,7 +147,7 @@ Disabled - ..\extern\libpng\include;..\extern\zlib\include;%(AdditionalIncludeDirectories) + ..\..\..\zlib\;..\..\..\lpng\;..\..\..\lpng\build;%(AdditionalIncludeDirectories) NO_PNG;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";BUILD_ZINT_DLL;ZLIB_DLL;PNG_DLL;DEBUG;%(PreprocessorDefinitions) @@ -171,7 +171,7 @@ zlibd.lib;%(AdditionalDependencies) $(OutDir)zintd.dll - ..\extern\libpng\lib\x64;..\extern\zlib\lib\x64;%(AdditionalLibraryDirectories) + ..\..\lpng\build\Release;..\..\..\zlib;%(AdditionalLibraryDirectories) libcmtd.lib;%(IgnoreSpecificDefaultLibraries) true Windows @@ -181,7 +181,7 @@ MaxSpeed false - ..\extern\libpng\include;..\extern\zlib\include;%(AdditionalIncludeDirectories) + ..\..\..\zlib\;..\..\..\lpng\;..\..\..\lpng\build;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";BUILD_ZINT_DLL;ZLIB_DLL;PNG_DLL;NO_PNG;%(PreprocessorDefinitions) true @@ -201,9 +201,9 @@ false - libpng16.lib;zlib.lib;%(AdditionalDependencies) + libpng16_static.lib;zlib.lib;%(AdditionalDependencies) $(OutDir)zint.dll - ..\extern\libpng\lib\x86;..\extern\zlib\lib\x86;%(AdditionalLibraryDirectories) + ..\..\..\lpng\build\Release;..\..\..\zlib;%(AdditionalLibraryDirectories) false Windows true @@ -215,7 +215,7 @@ MaxSpeed false - ..\extern\libpng\include;..\extern\zlib\include;%(AdditionalIncludeDirectories) + ..\..\..\zlib\;..\..\..\lpng\;..\..\..\lpng\build;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";BUILD_ZINT_DLL;NO_PNG;ZLIB_DLL;PNG_DLL;%(PreprocessorDefinitions) true @@ -238,9 +238,9 @@ false - libpng16.lib;zlib.lib;%(AdditionalDependencies) + libpng16_static.lib;zlib.lib;%(AdditionalDependencies) $(OutDir)zint.dll - ..\extern\libpng\lib\x64;..\extern\zlib\lib\x64;%(AdditionalLibraryDirectories) + ..\..\..\lpng\build\Release;..\..\..\zlib;%(AdditionalLibraryDirectories) false Windows true @@ -251,7 +251,7 @@ MaxSpeed false - d:\opt\include;%(AdditionalIncludeDirectories) + ..\..\..\zlib\;..\..\..\lpng\;..\..\..\lpng\build;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";%(PreprocessorDefinitions) true @@ -275,7 +275,7 @@ MaxSpeed false - ..\extern\libpng\include;..\extern\zlib\include;%(AdditionalIncludeDirectories) + ..\..\..\zlib\;..\..\..\lpng\;..\..\..\lpng\build;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";%(PreprocessorDefinitions) true @@ -299,93 +299,93 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + true true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + true true diff --git a/win32/vs2015/zint.vcxproj b/win32/vs2015/zint.vcxproj index be2e2c8f..21614006 100644 --- a/win32/vs2015/zint.vcxproj +++ b/win32/vs2015/zint.vcxproj @@ -107,7 +107,7 @@ Disabled - ..\backend;%(AdditionalIncludeDirectories) + ..\..\backend;%(AdditionalIncludeDirectories) WIN32;_WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";ZINT_DLL;%(PreprocessorDefinitions) true @@ -126,7 +126,7 @@ Disabled - ..\backend;%(AdditionalIncludeDirectories) + ..\..\backend;%(AdditionalIncludeDirectories) WIN32;_WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";ZINT_DLL;%(PreprocessorDefinitions) @@ -146,7 +146,7 @@ MaxSpeed - ..\backend;%(AdditionalIncludeDirectories) + ..\..\backend;%(AdditionalIncludeDirectories) WIN32;_WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";ZINT_DLL;%(PreprocessorDefinitions) true @@ -164,7 +164,7 @@ MaxSpeed - ..\backend;%(AdditionalIncludeDirectories) + ..\..\backend;%(AdditionalIncludeDirectories) WIN32;_WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";ZINT_DLL;%(PreprocessorDefinitions) true @@ -185,7 +185,7 @@ MaxSpeed - ..\backend;%(AdditionalIncludeDirectories) + ..\..\backend;%(AdditionalIncludeDirectories) WIN32;_WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";%(PreprocessorDefinitions) true @@ -204,7 +204,7 @@ MaxSpeed - ..\backend;%(AdditionalIncludeDirectories) + ..\..\backend;%(AdditionalIncludeDirectories) WIN32;_WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";%(PreprocessorDefinitions) true @@ -224,16 +224,16 @@ - - - + + + - - + + - + diff --git a/win32/vs2019/libzint.vcxproj b/win32/vs2019/libzint.vcxproj new file mode 100644 index 00000000..fb18185e --- /dev/null +++ b/win32/vs2019/libzint.vcxproj @@ -0,0 +1,214 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {5C08DC40-8F7D-475E-AA3C-814DED735A4B} + libzint_png_qr + Win32Proj + 10.0 + + + + DynamicLibrary + v142 + MultiByte + false + + + DynamicLibrary + MultiByte + v142 + + + + + + + + + + + + + <_ProjectFileVersion>12.0.30501.0 + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + zint + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + zint + + + + Disabled + ..\..\..\zlib\;..\..\..\lpng\;..\..\..\lpng\build;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";BUILD_ZINT_DLL;DEBUG;%(PreprocessorDefinitions) + true + + EnableFastChecks + true + MultiThreadedDebugDLL + false + + Level3 + ProgramDatabase + CompileAsCpp + 4018;4244;4305;%(DisableSpecificWarnings) + + + _DEBUG;%(PreprocessorDefinitions) + + + false + + + libpng16_static.lib;zlib.lib;%(AdditionalDependencies) + $(OutDir)zint.dll + ..\..\..\lpng\build\Release;..\..\..\zlib;%(AdditionalLibraryDirectories) + libcmtd.lib;msvcrt.lib;%(IgnoreSpecificDefaultLibraries) + true + Windows + MachineX86 + false + + + + + MaxSpeed + false + ..\..\..\zlib\;..\..\..\lpng\;..\..\..\lpng\build;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";BUILD_ZINT_DLL;%(PreprocessorDefinitions) + true + + MultiThreadedDLL + false + false + + Level3 + + CompileAsCpp + 4018;4244;4305;%(DisableSpecificWarnings) + + + NDEBUG;%(PreprocessorDefinitions) + + + false + + + libpng16_static.lib;zlib.lib;%(AdditionalDependencies) + $(OutDir)zint.dll + ..\..\..\lpng\build\Release;..\..\..\zlib;%(AdditionalLibraryDirectories) + false + Windows + true + true + MachineX86 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/win32/vs2019/zint.sln b/win32/vs2019/zint.sln new file mode 100644 index 00000000..47fd5a9b --- /dev/null +++ b/win32/vs2019/zint.sln @@ -0,0 +1,36 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2036 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zint", "zint.vcxproj", "{3169C7FA-E52C-4BFC-B7BB-E55EBA133770}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzint", "libzint.vcxproj", "{5C08DC40-8F7D-475E-AA3C-814DED735A4B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C246B2E9-C3A0-4505-BECA-1FDFC59C7BE5}" + ProjectSection(SolutionItems) = preProject + ..\.editorconfig = ..\.editorconfig + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Debug|Win32.ActiveCfg = Debug|Win32 + {3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Debug|Win32.Build.0 = Debug|Win32 + {3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Release|Win32.ActiveCfg = Release|Win32 + {3169C7FA-E52C-4BFC-B7BB-E55EBA133770}.Release|Win32.Build.0 = Release|Win32 + {5C08DC40-8F7D-475E-AA3C-814DED735A4B}.Debug|Win32.ActiveCfg = Debug|Win32 + {5C08DC40-8F7D-475E-AA3C-814DED735A4B}.Debug|Win32.Build.0 = Debug|Win32 + {5C08DC40-8F7D-475E-AA3C-814DED735A4B}.Release|Win32.ActiveCfg = Release|Win32 + {5C08DC40-8F7D-475E-AA3C-814DED735A4B}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5F58D857-0A43-4DC0-AA25-1AD65E537C6A} + EndGlobalSection +EndGlobal diff --git a/win32/vs2019/zint.vcxproj b/win32/vs2019/zint.vcxproj new file mode 100644 index 00000000..c4c5448f --- /dev/null +++ b/win32/vs2019/zint.vcxproj @@ -0,0 +1,107 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {3169C7FA-E52C-4BFC-B7BB-E55EBA133770} + zint + Win32Proj + 10.0 + + + + Application + v142 + MultiByte + false + + + Application + v142 + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>12.0.30501.0 + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + + Disabled + ..\..\backend;%(AdditionalIncludeDirectories) + WIN32;_WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";ZINT_DLL;%(PreprocessorDefinitions) + true + + EnableFastChecks + true + MultiThreadedDebugDLL + true + + Level3 + EditAndContinue + + + true + + + + + MaxSpeed + ..\..\backend;%(AdditionalIncludeDirectories) + WIN32;_WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;ZINT_VERSION="2.9.1.9";ZINT_DLL;%(PreprocessorDefinitions) + true + + MultiThreaded + false + false + + Level3 + + + + + + + + + + + + + + + + + + {5c08dc40-8f7d-475e-aa3c-814ded735a4b} + false + + + + + + \ No newline at end of file