Free bitmap structure, add clear option, correct KIX Code and fix spelling mistake.

This commit is contained in:
hooper114 2009-12-02 09:09:45 +00:00
parent f200517593
commit b24cf09fe7
5 changed files with 31 additions and 10 deletions

View file

@ -67,11 +67,30 @@ struct zint_symbol *ZBarcode_Create()
return symbol;
}
int ZBarcode_Delete(struct zint_symbol *symbol)
void ZBarcode_Clear(struct zint_symbol *symbol)
{
int i, j;
for(i = 0; i < symbol->rows; i++) {
for(j = 0; j < symbol->width; j++) {
unset_module(symbol, i, j);
}
}
symbol->rows = 0;
symbol->width = 0;
symbol->text[0] = '\0';
symbol->errtxt[0] = '\0';
if (symbol->bitmap != NULL)
free(symbol->bitmap);
symbol->bitmap_width = 0;
symbol->bitmap_height = 0;
}
void ZBarcode_Delete(struct zint_symbol *symbol)
{
if (symbol->bitmap != NULL)
free(symbol->bitmap);
free(symbol);
return 0;
}
extern int eanx(struct zint_symbol *symbol, unsigned char source[], int length); /* EAN system barcodes */