Files | |
file | decode-39.c |
Code 39 Decode. | |
Enumerations | |
enum | { STANDARD, SPECIAL } |
Functions | |
unsigned short | Decode39 (struct BC_STRUCT *p) |
Code 39 decode routine. |
anonymous enum |
unsigned short Decode39 | ( | struct BC_STRUCT * | p | ) |
Code 39 decode routine.
p | points to channel context |
Definition at line 107 of file decode-39.c.
References BC_STRUCT::decode_count, BC_STRUCT::sample_buffer, BC_STRUCT::sample_ctr, BC_STRUCT::sample_ptr, SPECIAL, and STANDARD.
00108 { 00109 // Minimum sample count 00110 if(p->sample_ctr < 27){ 00111 return 0; 00112 } 00113 00114 // Standard reference 00115 p->sample_ptr = &p->sample_buffer[0]; 00116 if(FindStart(p, STANDARD) != NO_CODE){ 00117 if(Decode(p, STANDARD) != NO_DECODE){ 00118 return p->decode_count; 00119 } 00120 } 00121 00122 // Special reference 00123 p->sample_ptr = &p->sample_buffer[0]; 00124 if(FindStart(p, SPECIAL) != NO_CODE){ 00125 if(Decode(p, SPECIAL) != NO_DECODE){ 00126 return p->decode_count; 00127 } 00128 } 00129 00130 // Unable to decode 00131 return 0; 00132 }