Add method for dynamically checking version info

Suggestion by aragon@phat.za.net for python-zint
This commit is contained in:
Robin Stuart 2017-07-01 09:06:47 +01:00
parent 6306228fed
commit 0d6716a773
2 changed files with 7 additions and 2 deletions

View File

@ -983,8 +983,8 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source,int
error_number = ZINT_ERROR_INVALID_OPTION;
}
if ((symbol->eci < 3) || (symbol->eci > 26) || (symbol->eci == 14) || (symbol->eci == 19) || (symbol->eci == 25)) {
strcpy(symbol->errtxt, "Invalid or unsupported ECI mode (B18)");
if ((symbol->eci < 3) || (symbol->eci > 999999)) {
strcpy(symbol->errtxt, "Invalid ECI mode (B18)");
error_number = ZINT_ERROR_INVALID_OPTION;
}
@ -1304,3 +1304,7 @@ int ZBarcode_Render(struct zint_symbol *symbol, const float width, const float h
// Send the request to the render_plot method
return render_plot(symbol, width, height);
}
int ZBarcode_Version() {
return (ZINT_VERSION_MAJOR * 10000) + (ZINT_VERSION_MINOR * 100) + ZINT_VERSION_RELEASE;
}

View File

@ -274,6 +274,7 @@ extern "C" {
ZINT_EXTERN int ZBarcode_Encode_File_and_Buffer(struct zint_symbol *symbol, char *filename, int rotate_angle);
ZINT_EXTERN int ZBarcode_ValidID(int symbol_id);
ZINT_EXTERN int ZBarcode_Version();
#ifdef __cplusplus
}