mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Add method for dynamically checking version info
Suggestion by aragon@phat.za.net for python-zint
This commit is contained in:
parent
6306228fed
commit
0d6716a773
@ -983,8 +983,8 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source,int
|
|||||||
error_number = ZINT_ERROR_INVALID_OPTION;
|
error_number = ZINT_ERROR_INVALID_OPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((symbol->eci < 3) || (symbol->eci > 26) || (symbol->eci == 14) || (symbol->eci == 19) || (symbol->eci == 25)) {
|
if ((symbol->eci < 3) || (symbol->eci > 999999)) {
|
||||||
strcpy(symbol->errtxt, "Invalid or unsupported ECI mode (B18)");
|
strcpy(symbol->errtxt, "Invalid ECI mode (B18)");
|
||||||
error_number = ZINT_ERROR_INVALID_OPTION;
|
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
|
// Send the request to the render_plot method
|
||||||
return render_plot(symbol, width, height);
|
return render_plot(symbol, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ZBarcode_Version() {
|
||||||
|
return (ZINT_VERSION_MAJOR * 10000) + (ZINT_VERSION_MINOR * 100) + ZINT_VERSION_RELEASE;
|
||||||
|
}
|
@ -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_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_ValidID(int symbol_id);
|
||||||
|
ZINT_EXTERN int ZBarcode_Version();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user