qrencode  4.1.1
About: libqrencode is a fast and compact library and command-line utility for encoding data in a QR Code symbol.
  Fossies Dox: qrencode-4.1.1.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rsecc.c File Reference
#include <stdlib.h>
#include <string.h>
#include "rsecc.h"
Include dependency graph for rsecc.c:

Go to the source code of this file.

Macros

#define SYMBOL_SIZE   (8)
 
#define symbols   ((1U << SYMBOL_SIZE) - 1)
 
#define min_length   (2)
 
#define max_length   (30)
 
#define max_generatorSize   (max_length)
 

Functions

static void RSECC_initLookupTable (void)
 
static void RSECC_init (void)
 
static void generator_init (size_t length)
 
int RSECC_encode (size_t data_length, size_t ecc_length, const unsigned char *data, unsigned char *ecc)
 

Variables

static int initialized = 0
 
static const unsigned int proot = 0x11d
 
static unsigned char alpha [((1U<<(8)) - 1)+1]
 
static unsigned char aindex [((1U<<(8)) - 1)+1]
 
static unsigned char generator [(30) -(2)+1][((30))+1]
 
static unsigned char generatorInitialized [(30) -(2)+1]
 

Macro Definition Documentation

◆ max_generatorSize

#define max_generatorSize   (max_length)

Definition at line 50 of file rsecc.c.

◆ max_length

#define max_length   (30)

Definition at line 49 of file rsecc.c.

◆ min_length

#define min_length   (2)

Definition at line 48 of file rsecc.c.

◆ SYMBOL_SIZE

#define SYMBOL_SIZE   (8)

Definition at line 43 of file rsecc.c.

◆ symbols

#define symbols   ((1U << SYMBOL_SIZE) - 1)

Definition at line 44 of file rsecc.c.

Function Documentation

◆ generator_init()

static void generator_init ( size_t  length)
static

Definition at line 83 of file rsecc.c.

References aindex, alpha, generator, generatorInitialized, max_generatorSize, min_length, and symbols.

Referenced by RSECC_encode().

◆ RSECC_encode()

int RSECC_encode ( size_t  data_length,
size_t  ecc_length,
const unsigned char *  data,
unsigned char *  ecc 
)

◆ RSECC_init()

static void RSECC_init ( void  )
static

Definition at line 76 of file rsecc.c.

References generatorInitialized, initialized, max_length, min_length, and RSECC_initLookupTable().

Referenced by RSECC_encode().

◆ RSECC_initLookupTable()

static void RSECC_initLookupTable ( void  )
static

Definition at line 57 of file rsecc.c.

References aindex, alpha, proot, and symbols.

Referenced by RSECC_init().

Variable Documentation

◆ aindex

unsigned char aindex[((1U<<(8)) - 1)+1]
static

Definition at line 53 of file rsecc.c.

Referenced by generator_init(), RSECC_encode(), and RSECC_initLookupTable().

◆ alpha

unsigned char alpha[((1U<<(8)) - 1)+1]
static

Definition at line 52 of file rsecc.c.

Referenced by generator_init(), RSECC_encode(), and RSECC_initLookupTable().

◆ generator

unsigned char generator[(30) -(2)+1][((30))+1]
static

Definition at line 54 of file rsecc.c.

Referenced by generator_init(), and RSECC_encode().

◆ generatorInitialized

unsigned char generatorInitialized[(30) -(2)+1]
static

Definition at line 55 of file rsecc.c.

Referenced by generator_init(), RSECC_encode(), and RSECC_init().

◆ initialized

int initialized = 0
static

Definition at line 41 of file rsecc.c.

Referenced by RSECC_encode(), and RSECC_init().

◆ proot

const unsigned int proot = 0x11d
static

Definition at line 45 of file rsecc.c.

Referenced by RSECC_initLookupTable().