libzint.so: suppress exporting INTERNAL functions to the shared library; ZINT_TEST

This commit is contained in:
gitlost
2019-12-19 00:37:55 +00:00
parent c524d32227
commit bca82ecc0d
58 changed files with 489 additions and 491 deletions

View File

@ -104,7 +104,7 @@ static int clr_row(char *Dots, const int Hgt, const int Wid, const int y) {
}
/* Dot pattern scoring routine from Annex A */
const int score_array(char Dots[], int Hgt, int Wid) {
static const int score_array(char Dots[], int Hgt, int Wid) {
int x, y, worstedge, first, last, sum;
int penalty_local = 0;
int penalty = 0;
@ -268,7 +268,7 @@ const int score_array(char Dots[], int Hgt, int Wid) {
// employing Galois Field GF, where GF is prime, with a prime modulus of PM
//-------------------------------------------------------------------------
void rsencode(int nd, int nc, unsigned char *wd) {
static void rsencode(int nd, int nc, unsigned char *wd) {
int i, j, k, nw, start, step, root[GF], c[GF];
// Start by generating "nc" roots (antilogs):
@ -312,7 +312,7 @@ void rsencode(int nd, int nc, unsigned char *wd) {
}
/* Check if the next character is directly encodable in code set A (Annex F.II.D) */
int datum_a(const unsigned char source[], int position, int length) {
static int datum_a(const unsigned char source[], int position, int length) {
int retval = 0;
if (position < length) {
@ -325,7 +325,7 @@ int datum_a(const unsigned char source[], int position, int length) {
}
/* Check if the next character is directly encodable in code set B (Annex F.II.D) */
int datum_b(const unsigned char source[], int position, int length) {
static int datum_b(const unsigned char source[], int position, int length) {
int retval = 0;
if (position < length) {
@ -352,7 +352,7 @@ int datum_b(const unsigned char source[], int position, int length) {
}
/* Check if the next characters are directly encodable in code set C (Annex F.II.D) */
int datum_c(const unsigned char source[], int position, int length) {
static int datum_c(const unsigned char source[], int position, int length) {
int retval = 0;
if (position <= length - 2) {
@ -365,7 +365,7 @@ int datum_c(const unsigned char source[], int position, int length) {
}
/* Returns how many consecutive digits lie immediately ahead (Annex F.II.A) */
int n_digits(const unsigned char source[], int position, int length) {
static int n_digits(const unsigned char source[], int position, int length) {
int i;
for (i = position; ((source[i] >= '0') && (source[i] <= '9')) && (i < length); i++);
@ -374,7 +374,7 @@ int n_digits(const unsigned char source[], int position, int length) {
}
/* checks ahead for 10 or more digits starting "17xxxxxx10..." (Annex F.II.B) */
int seventeen_ten(const unsigned char source[], int position, int length) {
static int seventeen_ten(const unsigned char source[], int position, int length) {
int found = 0;
if (n_digits(source, position, length) >= 10) {
@ -390,7 +390,7 @@ int seventeen_ten(const unsigned char source[], int position, int length) {
/* checks how many characters ahead can be reached while datum_c is true,
* returning the resulting number of codewords (Annex F.II.E)
*/
int ahead_c(const unsigned char source[], int position, int length) {
static int ahead_c(const unsigned char source[], int position, int length) {
int count = 0;
int i;
@ -402,7 +402,7 @@ int ahead_c(const unsigned char source[], int position, int length) {
}
/* Annex F.II.F */
int try_c(const unsigned char source[], int position, int length) {
static int try_c(const unsigned char source[], int position, int length) {
int retval = 0;
if (n_digits(source, position, length) > 0) {
@ -415,7 +415,7 @@ int try_c(const unsigned char source[], int position, int length) {
}
/* Annex F.II.G */
int ahead_a(const unsigned char source[], int position, int length) {
static int ahead_a(const unsigned char source[], int position, int length) {
int count = 0;
int i;
@ -428,7 +428,7 @@ int ahead_a(const unsigned char source[], int position, int length) {
}
/* Annex F.II.H */
int ahead_b(const unsigned char source[], int position, int length) {
static int ahead_b(const unsigned char source[], int position, int length) {
int count = 0;
int i;
@ -441,7 +441,7 @@ int ahead_b(const unsigned char source[], int position, int length) {
}
/* checks if the next character is in the range 128 to 255 (Annex F.II.I) */
int binary(const unsigned char source[], int position) {
static int binary(const unsigned char source[], int position) {
int retval = 0;
if (source[position] >= 128) {
@ -452,7 +452,7 @@ int binary(const unsigned char source[], int position) {
}
/* Analyse input data stream and encode using algorithm from Annex F */
int dotcode_encode_message(struct zint_symbol *symbol, const unsigned char source[], int length, unsigned char *codeword_array, int *binary_finish) {
static int dotcode_encode_message(struct zint_symbol *symbol, const unsigned char source[], int length, unsigned char *codeword_array, int *binary_finish) {
int input_position, array_length, i;
char encoding_mode;
int inside_macro;
@ -1102,7 +1102,7 @@ static size_t make_dotstream(unsigned char masked_array[], int array_length, cha
/* Determines if a given dot is a reserved corner dot
* to be used by one of the last six bits
*/
int is_corner(int column, int row, int width, int height) {
static int is_corner(int column, int row, int width, int height) {
int corner = 0;
/* Top Left */
@ -1144,7 +1144,7 @@ int is_corner(int column, int row, int width, int height) {
}
/* Place the dots in the symbol*/
void fold_dotstream(char dot_stream[], int width, int height, char dot_array[]) {
static void fold_dotstream(char dot_stream[], int width, int height, char dot_array[]) {
int column, row;
int input_position = 0;
@ -1209,7 +1209,7 @@ void fold_dotstream(char dot_stream[], int width, int height, char dot_array[])
}
}
void apply_mask(int mask, int data_length, unsigned char *masked_codeword_array, unsigned char *codeword_array, int ecc_length, char *dot_stream) {
static void apply_mask(int mask, int data_length, unsigned char *masked_codeword_array, unsigned char *codeword_array, int ecc_length, char *dot_stream) {
int weight = 0;
int j;
@ -1246,7 +1246,7 @@ void apply_mask(int mask, int data_length, unsigned char *masked_codeword_array,
rsencode(data_length + 1, ecc_length, masked_codeword_array);
}
void force_corners(int width, int height, char *dot_array) {
static void force_corners(int width, int height, char *dot_array) {
if (width % 2) {
// "Vertical" symbol
dot_array[0] = '1';
@ -1266,7 +1266,7 @@ void force_corners(int width, int height, char *dot_array) {
}
}
int dotcode(struct zint_symbol *symbol, const unsigned char source[], int length) {
INTERNAL int dotcode(struct zint_symbol *symbol, const unsigned char source[], int length) {
int i, j, k;
size_t jc, n_dots;
int data_length, ecc_length;
@ -1519,4 +1519,3 @@ int dotcode(struct zint_symbol *symbol, const unsigned char source[], int length
return 0;
}