Logo Search packages:      
Sourcecode: zebra version File versions  Download package

zebra_decoder_t* zebra_decoder_create (  ) 

constructor.

Definition at line 38 of file decoder.c.

References ZEBRA_CFG_EMIT_CHECK, ZEBRA_CFG_ENABLE, zebra_decoder_create(), and zebra_decoder_reset().

Referenced by zebra::Decoder::Decoder(), zebra_decoder_create(), and zebra_image_scanner_create().

{
    zebra_decoder_t *dcode = malloc(sizeof(zebra_decoder_t));
    dcode->buflen = BUFFER_MIN;
    dcode->buf = malloc(dcode->buflen);
    dcode->handler = dcode->userdata = NULL;

    /* initialize default configs */
#ifdef ENABLE_EAN
    dcode->ean.enable = 1;
    dcode->ean.ean13_config = ((1 << ZEBRA_CFG_ENABLE) |
                                (1 << ZEBRA_CFG_EMIT_CHECK));
    dcode->ean.ean8_config = ((1 << ZEBRA_CFG_ENABLE) |
                               (1 << ZEBRA_CFG_EMIT_CHECK));
    dcode->ean.upca_config = 1 << ZEBRA_CFG_EMIT_CHECK;
    dcode->ean.upce_config = 1 << ZEBRA_CFG_EMIT_CHECK;
    dcode->ean.isbn10_config = 1 << ZEBRA_CFG_EMIT_CHECK;
    dcode->ean.isbn13_config = 1 << ZEBRA_CFG_EMIT_CHECK;
#endif
#ifdef ENABLE_I25
    dcode->i25.config = 1 << ZEBRA_CFG_ENABLE;
#endif
#ifdef ENABLE_CODE39
    dcode->code39.config = 1 << ZEBRA_CFG_ENABLE;
#endif
#ifdef ENABLE_CODE128
    dcode->code128.config = 1 << ZEBRA_CFG_ENABLE;
#endif

    zebra_decoder_reset(dcode);
    return(dcode);
}


Generated by  Doxygen 1.6.0   Back to index