libdmtx 0.7.8.7
libdmtx is a software library that enables programs to read and write Data Matrix barcodes of the modern ECC200 variety.
Loading...
Searching...
No Matches
dmtxdecodescheme.c File Reference

libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton. More...

#include <assert.h>
#include <limits.h>
#include <math.h>
#include "dmtx.h"
#include "dmtxstatic.h"

Go to the source code of this file.

Functions

DmtxPassFail decodeDataStream (DmtxMessage *msg, int sizeIdx, unsigned char *outputStart)
 Translate encoded data stream into final output.
 
static int getEncodationScheme (unsigned char cw)
 Determine next encodation scheme.
 
static void pushOutputWord (DmtxMessage *msg, int value)
 
static DmtxBoolean validOutputWord (int value)
 
static void pushOutputC40TextWord (DmtxMessage *msg, C40TextState *state, int value)
 
static void pushOutputMacroHeader (DmtxMessage *msg, int macroType)
 
static void pushOutputMacroTrailer (DmtxMessage *msg)
 
static unsigned char * decodeSchemeAscii (DmtxMessage *msg, unsigned char *ptr, unsigned char *dataEnd)
 Decode stream assuming standard ASCII encodation.
 
static unsigned char * decodeSchemeC40Text (DmtxMessage *msg, unsigned char *ptr, unsigned char *dataEnd, DmtxScheme encScheme)
 Decode stream assuming C40 or Text encodation.
 
static unsigned char * decodeSchemeX12 (DmtxMessage *msg, unsigned char *ptr, unsigned char *dataEnd)
 Decode stream assuming X12 encodation.
 
static unsigned char * decodeSchemeEdifact (DmtxMessage *msg, unsigned char *ptr, unsigned char *dataEnd)
 Decode stream assuming EDIFACT encodation.
 
static unsigned char * decodeSchemeBase256 (DmtxMessage *msg, unsigned char *ptr, unsigned char *dataEnd)
 Decode stream assuming Base 256 encodation.
 

Detailed Description

libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton.

All rights reserved. Copyright 2012-2016 Vadim A. Misbakh-Soloviov. All rights reserved. Copyright 2016 Tim Zaman. All rights reserved.

See LICENSE file in the main project directory for full terms of use and distribution.

Contact: Vadim A. Misbakh-Soloviov dmtx@.nosp@m.mva..nosp@m.name Mike Laughton mike@.nosp@m.drag.nosp@m.onfly.nosp@m.logi.nosp@m.c.com

Definition in file dmtxdecodescheme.c.

Function Documentation

◆ decodeDataStream()

DmtxPassFail decodeDataStream ( DmtxMessage * msg,
int sizeIdx,
unsigned char * outputStart )
extern

Translate encoded data stream into final output.

Parameters
msg
sizeIdx
outputStart
Returns
void

Definition at line 30 of file dmtxdecodescheme.c.

◆ decodeSchemeAscii()

static unsigned char * decodeSchemeAscii ( DmtxMessage * msg,
unsigned char * ptr,
unsigned char * dataEnd )
static

Decode stream assuming standard ASCII encodation.

Parameters
msg
ptr
dataEnd
Returns
Pointer to next undecoded codeword NULL if an error was detected in the stream

Definition at line 213 of file dmtxdecodescheme.c.

◆ decodeSchemeBase256()

static unsigned char * decodeSchemeBase256 ( DmtxMessage * msg,
unsigned char * ptr,
unsigned char * dataEnd )
static

Decode stream assuming Base 256 encodation.

Parameters
msg
ptr
dataEnd
Returns
Pointer to next undecoded codeword, NULL if an error was detected in the stream

Definition at line 502 of file dmtxdecodescheme.c.

◆ decodeSchemeC40Text()

static unsigned char * decodeSchemeC40Text ( DmtxMessage * msg,
unsigned char * ptr,
unsigned char * dataEnd,
DmtxScheme encScheme )
static

Decode stream assuming C40 or Text encodation.

Parameters
msg
ptr
dataEnd
encScheme
Returns
Pointer to next undecoded codeword

Definition at line 269 of file dmtxdecodescheme.c.

◆ decodeSchemeEdifact()

static unsigned char * decodeSchemeEdifact ( DmtxMessage * msg,
unsigned char * ptr,
unsigned char * dataEnd )
static

Decode stream assuming EDIFACT encodation.

Parameters
msg
ptr
dataEnd
Returns
Pointer to next undecoded codeword

Definition at line 419 of file dmtxdecodescheme.c.

◆ decodeSchemeX12()

static unsigned char * decodeSchemeX12 ( DmtxMessage * msg,
unsigned char * ptr,
unsigned char * dataEnd )
static

Decode stream assuming X12 encodation.

Parameters
msg
ptr
dataEnd
Returns
Pointer to next undecoded codeword

Definition at line 363 of file dmtxdecodescheme.c.

◆ getEncodationScheme()

static int getEncodationScheme ( unsigned char cw)
static

Determine next encodation scheme.

Parameters
cw
Returns
Pointer to next undecoded codeword

Definition at line 104 of file dmtxdecodescheme.c.

◆ pushOutputC40TextWord()

static void pushOutputC40TextWord ( DmtxMessage * msg,
C40TextState * state,
int value )
static

Definition at line 156 of file dmtxdecodescheme.c.

◆ pushOutputMacroHeader()

static void pushOutputMacroHeader ( DmtxMessage * msg,
int macroType )
static

Definition at line 177 of file dmtxdecodescheme.c.

◆ pushOutputMacroTrailer()

static void pushOutputMacroTrailer ( DmtxMessage * msg)
static

Definition at line 199 of file dmtxdecodescheme.c.

◆ pushOutputWord()

static void pushOutputWord ( DmtxMessage * msg,
int value )
static

Definition at line 136 of file dmtxdecodescheme.c.

◆ validOutputWord()

static DmtxBoolean validOutputWord ( int value)
static

Definition at line 147 of file dmtxdecodescheme.c.