TTKMusicPlayer
4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
|
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "qrencode.h"
#include "qrspec.h"
#include "mqrspec.h"
#include "bitstream.h"
#include "qrinput.h"
Go to the source code of this file.
Functions | |
int | QRinput_isSplittableMode (QRencodeMode mode) |
static QRinput_List * | QRinput_List_newEntry (QRencodeMode mode, int size, const unsigned char *data) |
static void | QRinput_List_freeEntry (QRinput_List *entry) |
static QRinput_List * | QRinput_List_dup (QRinput_List *entry) |
QRinput * | QRinput_new (void) |
Instantiate an input data object. More... | |
QRinput * | QRinput_new2 (int version, QRecLevel level) |
Instantiate an input data object. More... | |
QRinput * | QRinput_newMQR (int version, QRecLevel level) |
Instantiate an input data object. More... | |
int | QRinput_getVersion (QRinput *input) |
Get current version. More... | |
int | QRinput_setVersion (QRinput *input, int version) |
Set version of the QR code that is to be encoded. More... | |
QRecLevel | QRinput_getErrorCorrectionLevel (QRinput *input) |
Get current error correction level. More... | |
int | QRinput_setErrorCorrectionLevel (QRinput *input, QRecLevel level) |
Set error correction level of the QR code that is to be encoded. More... | |
int | QRinput_setVersionAndErrorCorrectionLevel (QRinput *input, int version, QRecLevel level) |
Set version and error correction level of the QR code at once. More... | |
static void | QRinput_appendEntry (QRinput *input, QRinput_List *entry) |
int | QRinput_append (QRinput *input, QRencodeMode mode, int size, const unsigned char *data) |
Append data to an input object. More... | |
STATIC_IN_RELEASE int | QRinput_insertStructuredAppendHeader (QRinput *input, int size, int number, unsigned char parity) |
Insert a structured-append header to the head of the input data. More... | |
int | QRinput_appendECIheader (QRinput *input, unsigned int ecinum) |
Append ECI header. More... | |
void | QRinput_free (QRinput *input) |
Free the input object. More... | |
static unsigned char | QRinput_calcParity (QRinput *input) |
QRinput * | QRinput_dup (QRinput *input) |
static int | QRinput_checkModeNum (int size, const char *data) |
Check the input data. More... | |
int | QRinput_estimateBitsModeNum (int size) |
Estimate the length of the encoded bit stream of numeric data. More... | |
static int | QRinput_encodeModeNum (QRinput_List *entry, BitStream *bstream, int version, int mqr) |
Convert the number data and append to a bit stream. More... | |
static int | QRinput_checkModeAn (int size, const char *data) |
Check the input data. More... | |
int | QRinput_estimateBitsModeAn (int size) |
Estimate the length of the encoded bit stream of alphabet-numeric data. More... | |
static int | QRinput_encodeModeAn (QRinput_List *entry, BitStream *bstream, int version, int mqr) |
Convert the alphabet-numeric data and append to a bit stream. More... | |
int | QRinput_estimateBitsMode8 (int size) |
Estimate the length of the encoded bit stream of 8 bit data. More... | |
static int | QRinput_encodeMode8 (QRinput_List *entry, BitStream *bstream, int version, int mqr) |
Convert the 8bits data and append to a bit stream. More... | |
int | QRinput_estimateBitsModeKanji (int size) |
Estimate the length of the encoded bit stream of kanji data. More... | |
static int | QRinput_checkModeKanji (int size, const unsigned char *data) |
Check the input data. More... | |
static int | QRinput_encodeModeKanji (QRinput_List *entry, BitStream *bstream, int version, int mqr) |
Convert the kanji data and append to a bit stream. More... | |
static int | QRinput_encodeModeStructure (QRinput_List *entry, BitStream *bstream, int mqr) |
Convert a structure symbol code and append to a bit stream. More... | |
static int | QRinput_checkModeFNC1Second (int size) |
static int | QRinput_encodeModeFNC1Second (QRinput_List *entry, BitStream *bstream) |
static unsigned int | QRinput_decodeECIfromByteArray (unsigned char *data) |
static int | QRinput_estimateBitsModeECI (unsigned char *data) |
static int | QRinput_encodeModeECI (QRinput_List *entry, BitStream *bstream) |
int | QRinput_check (QRencodeMode mode, int size, const unsigned char *data) |
Validate the input data. More... | |
static int | QRinput_estimateBitStreamSizeOfEntry (QRinput_List *entry, int version, int mqr) |
Estimate the length of the encoded bit stream on the current version. More... | |
STATIC_IN_RELEASE int | QRinput_estimateBitStreamSize (QRinput *input, int version) |
Estimate the length of the encoded bit stream of the data. More... | |
STATIC_IN_RELEASE int | QRinput_estimateVersion (QRinput *input) |
Estimate the required version number of the symbol. More... | |
STATIC_IN_RELEASE int | QRinput_lengthOfCode (QRencodeMode mode, int version, int bits) |
Return required length in bytes for specified mode, version and bits. More... | |
static int | QRinput_encodeBitStream (QRinput_List *entry, BitStream *bstream, int version, int mqr) |
Convert the input data in the data chunk and append to a bit stream. More... | |
static int | QRinput_createBitStream (QRinput *input, BitStream *bstream) |
Convert the input data to a bit stream. More... | |
static int | QRinput_convertData (QRinput *input, BitStream *bstream) |
Convert the input data to a bit stream. More... | |
static int | QRinput_appendPaddingBit (BitStream *bstream, QRinput *input) |
Append padding bits for the input data. More... | |
static int | QRinput_appendPaddingBitMQR (BitStream *bstream, QRinput *input) |
Append padding bits for the input data - Micro QR Code version. More... | |
static int | QRinput_insertFNC1Header (QRinput *input) |
STATIC_IN_RELEASE int | QRinput_mergeBitStream (QRinput *input, BitStream *bstream) |
Merge all bit streams in the input data. More... | |
STATIC_IN_RELEASE int | QRinput_getBitStream (QRinput *input, BitStream *bstream) |
Merge all bit streams in the input data and append padding bits. More... | |
unsigned char * | QRinput_getByteStream (QRinput *input) |
Pack all bit streams padding bits into a byte array. More... | |
static QRinput_InputList * | QRinput_InputList_newEntry (QRinput *input) |
static void | QRinput_InputList_freeEntry (QRinput_InputList *entry) |
QRinput_Struct * | QRinput_Struct_new (void) |
Instantiate a set of input data object. More... | |
void | QRinput_Struct_setParity (QRinput_Struct *s, unsigned char parity) |
Set parity of structured symbols. More... | |
int | QRinput_Struct_appendInput (QRinput_Struct *s, QRinput *input) |
Append a QRinput object to the set. More... | |
void | QRinput_Struct_free (QRinput_Struct *s) |
Free all of QRinput in the set. More... | |
static unsigned char | QRinput_Struct_calcParity (QRinput_Struct *s) |
static int | QRinput_List_shrinkEntry (QRinput_List *entry, int bytes) |
STATIC_IN_RELEASE int | QRinput_splitEntry (QRinput_List *entry, int bytes) |
QRinput_Struct * | QRinput_splitQRinputToStruct (QRinput *input) |
Split a QRinput to QRinput_Struct. More... | |
int | QRinput_Struct_insertStructuredAppendHeaders (QRinput_Struct *s) |
Insert structured-append headers to the input structure. More... | |
int | QRinput_setFNC1First (QRinput *input) |
Set FNC1-1st position flag. More... | |
int | QRinput_setFNC1Second (QRinput *input, unsigned char appid) |
Set FNC1-2nd position flag and application identifier. More... | |
Variables | |
const signed char | QRinput_anTable [128] |
int QRinput_append | ( | QRinput * | input, |
QRencodeMode | mode, | ||
int | size, | ||
const unsigned char * | data | ||
) |
Append data to an input object.
The data is copied and appended to the input object.
input | input object. |
mode | encoding mode. |
size | size of data (byte). |
data | a pointer to the memory area of the input data. |
0 | success. |
-1 | an error occurred and errno is set to indeicate the error. See Execptions for the details. |
ENOMEM | unable to allocate memory. |
EINVAL | input data is invalid. |
Definition at line 221 of file qrinput.c.
References QRinput_appendEntry(), and QRinput_List_newEntry().
Referenced by QRcode_encodeDataReal(), QRcode_encodeDataStructuredReal(), QRinput_appendECIheader(), Split_eat8(), Split_eatAn(), Split_eatKanji(), and Split_eatNum().
Append ECI header.
input | input object. |
ecinum | ECI indicator number (0 - 999999) |
0 | success. |
-1 | an error occurred and errno is set to indeicate the error. See Execptions for the details. |
ENOMEM | unable to allocate memory. |
EINVAL | input data is invalid. |
Definition at line 274 of file qrinput.c.
References QR_MODE_ECI, and QRinput_append().
|
static |
Definition at line 209 of file qrinput.c.
References _QRinput::head, _QRinput_List::next, and _QRinput::tail.
Referenced by QRinput_append(), and QRinput_dup().
Append padding bits for the input data.
bstream | Bitstream to be appended. |
input | input data. |
0 | success |
-1 | an error occurred and errno is set to indeicate the error. See Execptions for the details. |
ERANGE | input data is too large. |
ENOMEM | unable to allocate memory. |
Definition at line 1145 of file qrinput.c.
References BitStream_appendNum(), BitStream_size, int(), _QRinput::level, QRspec_getDataLength(), and _QRinput::version.
Referenced by QRinput_getBitStream().
Append padding bits for the input data - Micro QR Code version.
bstream | Bitstream to be appended. |
input | input data. |
0 | success |
-1 | an error occurred and errno is set to indeicate the error. See Execptions for the details. |
ERANGE | input data is too large. |
ENOMEM | unable to allocate memory. |
Definition at line 1194 of file qrinput.c.
References BitStream_appendNum(), BitStream_size, int(), _QRinput::level, MQRspec_getDataLengthBit(), and _QRinput::version.
Referenced by QRinput_getBitStream().
|
static |
Definition at line 307 of file qrinput.c.
References _QRinput_List::data, _QRinput::head, _QRinput_List::mode, _QRinput_List::next, QR_MODE_STRUCTURE, and _QRinput_List::size.
Referenced by QRinput_splitQRinputToStruct(), and QRinput_Struct_calcParity().
int QRinput_check | ( | QRencodeMode | mode, |
int | size, | ||
const unsigned char * | data | ||
) |
Validate the input data.
mode | encoding mode. |
size | size of data (byte). |
data | a pointer to the memory area of the input data. |
0 | success. |
-1 | invalid arguments. |
Definition at line 817 of file qrinput.c.
References QR_MODE_8, QR_MODE_AN, QR_MODE_ECI, QR_MODE_FNC1FIRST, QR_MODE_FNC1SECOND, QR_MODE_KANJI, QR_MODE_NUL, QR_MODE_NUM, QR_MODE_STRUCTURE, QRinput_checkModeAn(), QRinput_checkModeFNC1Second(), QRinput_checkModeKanji(), and QRinput_checkModeNum().
Referenced by QRinput_List_newEntry().
Check the input data.
size | |
data |
Definition at line 474 of file qrinput.c.
References QRinput_lookAnTable.
Referenced by QRinput_check().
Definition at line 730 of file qrinput.c.
Referenced by QRinput_check().
Check the input data.
size | |
data |
Definition at line 625 of file qrinput.c.
References int().
Referenced by QRinput_check().
Check the input data.
size | |
data |
Definition at line 362 of file qrinput.c.
Referenced by QRinput_check().
Convert the input data to a bit stream.
When the version number is given and that is not sufficient, it is increased automatically.
input | input data. |
bstream | where the converted data is stored. |
0 | success |
-1 | an error occurred and errno is set to indeicate the error. See Execptions for the details. |
ENOMEM | unable to allocate memory. |
ERANGE | input data is too large. |
Definition at line 1110 of file qrinput.c.
References BitStream_reset, _QRinput::level, QRinput_createBitStream(), QRinput_estimateVersion(), QRinput_getVersion(), QRinput_setVersion(), and QRspec_getMinimumVersion().
Referenced by QRinput_mergeBitStream().
Convert the input data to a bit stream.
input | input data. |
0 | success |
-1 | an error occurred and errno is set to indeicate the error. See Execptions for the details. |
ENOMEM | unable to allocate memory. |
Definition at line 1082 of file qrinput.c.
References _QRinput::head, _QRinput::mqr, _QRinput_List::next, QRinput_encodeBitStream(), and _QRinput::version.
Referenced by QRinput_convertData(), and QRinput_mergeBitStream().
|
static |
Definition at line 755 of file qrinput.c.
Referenced by QRinput_encodeModeECI(), and QRinput_estimateBitsModeECI().
Definition at line 326 of file qrinput.c.
References _QRinput::head, _QRinput::level, _QRinput::mqr, _QRinput_List::next, QRinput_appendEntry(), QRinput_free(), QRinput_List_dup(), QRinput_new2(), QRinput_newMQR(), and _QRinput::version.
Referenced by QRinput_splitQRinputToStruct().
|
static |
Convert the input data in the data chunk and append to a bit stream.
entry | |
bstream |
Definition at line 1011 of file qrinput.c.
References BitStream_size, _QRinput_List::data, int(), _QRinput_List::mode, MQRspec_maximumWords(), QR_MODE_8, QR_MODE_AN, QR_MODE_ECI, QR_MODE_FNC1SECOND, QR_MODE_KANJI, QR_MODE_NUM, QR_MODE_STRUCTURE, QRinput_encodeMode8(), QRinput_encodeModeAn(), QRinput_encodeModeECI(), QRinput_encodeModeFNC1Second(), QRinput_encodeModeKanji(), QRinput_encodeModeNum(), QRinput_encodeModeStructure(), QRinput_List_freeEntry(), QRinput_List_newEntry(), QRspec_maximumWords(), and _QRinput_List::size.
Referenced by QRinput_createBitStream(), and QRinput_splitQRinputToStruct().
|
static |
Convert the 8bits data and append to a bit stream.
entry | |
mqr |
0 | success |
-1 | an error occurred and errno is set to indeicate the error. See Execptions for the details. |
ENOMEM | unable to allocate memory. |
Definition at line 578 of file qrinput.c.
References BitStream_appendBytes(), BitStream_appendNum(), _QRinput_List::data, MQRspec_lengthIndicator(), MQRSPEC_MODEID_8, QR_MODE_8, QRspec_lengthIndicator(), QRSPEC_MODEID_8, and _QRinput_List::size.
Referenced by QRinput_encodeBitStream().
|
static |
Convert the alphabet-numeric data and append to a bit stream.
entry | |
mqr |
0 | success |
-1 | an error occurred and errno is set to indeicate the error. See Execptions for the details. |
ENOMEM | unable to allocate memory. |
EINVAL | invalid version. |
Definition at line 515 of file qrinput.c.
References BitStream_appendNum(), _QRinput_List::data, int(), MQRspec_lengthIndicator(), MQRSPEC_MODEID_AN, QR_MODE_AN, QRinput_lookAnTable, QRspec_lengthIndicator(), QRSPEC_MODEID_AN, and _QRinput_List::size.
Referenced by QRinput_encodeBitStream().
|
static |
Definition at line 785 of file qrinput.c.
References BitStream_appendNum(), _QRinput_List::data, QRinput_decodeECIfromByteArray(), and QRSPEC_MODEID_ECI.
Referenced by QRinput_encodeBitStream().
|
static |
Definition at line 739 of file qrinput.c.
References BitStream_appendBytes(), BitStream_appendNum(), _QRinput_List::data, and QRSPEC_MODEID_FNC1SECOND.
Referenced by QRinput_encodeBitStream().
|
static |
Convert the kanji data and append to a bit stream.
entry | |
mqr |
0 | success |
-1 | an error occurred and errno is set to indeicate the error. See Execptions for the details. |
ENOMEM | unable to allocate memory. |
EINVAL | invalid version. |
Definition at line 653 of file qrinput.c.
References BitStream_appendNum(), _QRinput_List::data, int(), MQRspec_lengthIndicator(), MQRSPEC_MODEID_KANJI, QR_MODE_KANJI, QRspec_lengthIndicator(), QRSPEC_MODEID_KANJI, and _QRinput_List::size.
Referenced by QRinput_encodeBitStream().
|
static |
Convert the number data and append to a bit stream.
entry | |
mqr |
0 | success |
-1 | an error occurred and errno is set to indeicate the error. See Execptions for the details. |
ENOMEM | unable to allocate memory. |
Definition at line 409 of file qrinput.c.
References BitStream_appendNum(), _QRinput_List::data, int(), MQRspec_lengthIndicator(), MQRSPEC_MODEID_NUM, QR_MODE_NUM, QRspec_lengthIndicator(), QRSPEC_MODEID_NUM, and _QRinput_List::size.
Referenced by QRinput_encodeBitStream().
|
static |
Convert a structure symbol code and append to a bit stream.
entry | |
mqr |
0 | success |
-1 | an error occurred and errno is set to indeicate the error. See Execptions for the details. |
ENOMEM | unable to allocate memory. |
EINVAL | invalid entry. |
Definition at line 705 of file qrinput.c.
References BitStream_appendNum(), _QRinput_List::data, and QRSPEC_MODEID_STRUCTURE.
Referenced by QRinput_encodeBitStream().
Estimate the length of the encoded bit stream of 8 bit data.
size |
Definition at line 564 of file qrinput.c.
Referenced by QRinput_estimateBitStreamSizeOfEntry(), Split_eat8(), Split_eatAn(), and Split_eatNum().
Estimate the length of the encoded bit stream of alphabet-numeric data.
size |
Definition at line 491 of file qrinput.c.
Referenced by QRinput_estimateBitStreamSizeOfEntry(), Split_eat8(), Split_eatAn(), and Split_eatNum().
|
static |
Definition at line 769 of file qrinput.c.
References MODE_INDICATOR_SIZE, and QRinput_decodeECIfromByteArray().
Referenced by QRinput_estimateBitStreamSizeOfEntry().
Estimate the length of the encoded bit stream of kanji data.
size |
Definition at line 614 of file qrinput.c.
Referenced by QRinput_estimateBitStreamSizeOfEntry().
Estimate the length of the encoded bit stream of numeric data.
size |
Definition at line 379 of file qrinput.c.
Referenced by QRinput_estimateBitStreamSizeOfEntry(), Split_eat8(), Split_eatAn(), and Split_eatNum().
STATIC_IN_RELEASE int QRinput_estimateBitStreamSize | ( | QRinput * | input, |
int | version | ||
) |
Estimate the length of the encoded bit stream of the data.
input | input data |
version | version of the symbol |
Definition at line 915 of file qrinput.c.
References _QRinput::head, _QRinput::mqr, _QRinput_List::next, and QRinput_estimateBitStreamSizeOfEntry().
Referenced by QRinput_estimateVersion().
|
static |
Estimate the length of the encoded bit stream on the current version.
entry | |
version | version of the symbol |
mqr |
Definition at line 856 of file qrinput.c.
References _QRinput_List::data, _QRinput_List::mode, MODE_INDICATOR_SIZE, MQRspec_lengthIndicator(), QR_MODE_8, QR_MODE_AN, QR_MODE_ECI, QR_MODE_FNC1FIRST, QR_MODE_FNC1SECOND, QR_MODE_KANJI, QR_MODE_NUM, QR_MODE_STRUCTURE, QRinput_estimateBitsMode8(), QRinput_estimateBitsModeAn(), QRinput_estimateBitsModeECI(), QRinput_estimateBitsModeKanji(), QRinput_estimateBitsModeNum(), QRspec_lengthIndicator(), _QRinput_List::size, and STRUCTURE_HEADER_SIZE.
Referenced by QRinput_estimateBitStreamSize(), and QRinput_splitQRinputToStruct().
STATIC_IN_RELEASE int QRinput_estimateVersion | ( | QRinput * | input | ) |
Estimate the required version number of the symbol.
input | input data |
Definition at line 934 of file qrinput.c.
References _QRinput::level, QRinput_estimateBitStreamSize(), and QRspec_getMinimumVersion().
Referenced by QRinput_convertData().
void QRinput_free | ( | QRinput * | input | ) |
Free the input object.
All of data chunks in the input object are freed too.
input | input object. |
Definition at line 292 of file qrinput.c.
References free(), _QRinput::head, _QRinput_List::next, and QRinput_List_freeEntry().
Referenced by QRcode_encodeDataReal(), QRcode_encodeDataStructuredReal(), QRcode_encodeStringReal(), QRinput_dup(), QRinput_InputList_freeEntry(), and QRinput_splitQRinputToStruct().
STATIC_IN_RELEASE int QRinput_getBitStream | ( | QRinput * | input, |
BitStream * | bstream | ||
) |
Merge all bit streams in the input data and append padding bits.
input | input data. |
Definition at line 1301 of file qrinput.c.
References _QRinput::mqr, QRinput_appendPaddingBit(), QRinput_appendPaddingBitMQR(), and QRinput_mergeBitStream().
Referenced by QRinput_getByteStream().
unsigned char* QRinput_getByteStream | ( | QRinput * | input | ) |
Pack all bit streams padding bits into a byte array.
input | input data. |
Definition at line 1324 of file qrinput.c.
References BitStream_free(), BitStream_new(), BitStream_toByte(), and QRinput_getBitStream().
Referenced by MQRraw_new(), and QRraw_new().
Get current error correction level.
input | input object. |
Definition at line 172 of file qrinput.c.
References _QRinput::level.
Get current version.
input | input object. |
Definition at line 155 of file qrinput.c.
References _QRinput::version.
Referenced by QRinput_convertData().
|
static |
Definition at line 1363 of file qrinput.c.
References free(), _QRinput_InputList::input, and QRinput_free().
Referenced by QRinput_Struct_free().
|
static |
Definition at line 1350 of file qrinput.c.
References _QRinput_InputList::input, malloc(), and _QRinput_InputList::next.
Referenced by QRinput_Struct_appendInput().
Definition at line 1245 of file qrinput.c.
References _QRinput::appid, _QRinput::fnc1, _QRinput::head, _QRinput_List::mode, _QRinput_List::next, QR_MODE_ECI, QR_MODE_FNC1FIRST, QR_MODE_FNC1SECOND, QR_MODE_STRUCTURE, and QRinput_List_newEntry().
Referenced by QRinput_mergeBitStream().
STATIC_IN_RELEASE int QRinput_insertStructuredAppendHeader | ( | QRinput * | input, |
int | size, | ||
int | number, | ||
unsigned char | parity | ||
) |
Insert a structured-append header to the head of the input data.
input | input data. |
size | number of structured symbols. |
number | index number of the symbol. (1 <= number <= size) |
parity | parity among input data. (NOTE: each symbol of a set of structured symbols has the same parity data) |
0 | success. |
-1 | error occurred and errno is set to indeicate the error. See Execptions for the details. |
EINVAL | invalid parameter. |
ENOMEM | unable to allocate memory. |
Definition at line 246 of file qrinput.c.
References _QRinput::head, MAX_STRUCTURED_SYMBOLS, _QRinput_List::next, QR_MODE_STRUCTURE, and QRinput_List_newEntry().
Referenced by QRinput_Struct_insertStructuredAppendHeaders().
int QRinput_isSplittableMode | ( | QRencodeMode | mode | ) |
Definition at line 37 of file qrinput.c.
References QR_MODE_KANJI, and QR_MODE_NUM.
Referenced by QRspec_lengthIndicator(), and QRspec_maximumWords().
STATIC_IN_RELEASE int QRinput_lengthOfCode | ( | QRencodeMode | mode, |
int | version, | ||
int | bits | ||
) |
Return required length in bytes for specified mode, version and bits.
mode | |
version | |
bits |
Definition at line 959 of file qrinput.c.
References QR_MODE_8, QR_MODE_AN, QR_MODE_KANJI, QR_MODE_NUM, QR_MODE_STRUCTURE, QRspec_lengthIndicator(), and QRspec_maximumWords().
Referenced by QRinput_splitQRinputToStruct().
|
static |
Definition at line 84 of file qrinput.c.
References _QRinput_List::bstream, _QRinput_List::data, free(), malloc(), _QRinput_List::mode, _QRinput_List::next, and _QRinput_List::size.
Referenced by QRinput_dup().
|
static |
Definition at line 75 of file qrinput.c.
References BitStream_free(), _QRinput_List::bstream, _QRinput_List::data, and free().
Referenced by QRinput_encodeBitStream(), QRinput_free(), and QRinput_splitEntry().
|
static |
Definition at line 46 of file qrinput.c.
References _QRinput_List::bstream, _QRinput_List::data, free(), malloc(), _QRinput_List::mode, _QRinput_List::next, QRinput_check(), and _QRinput_List::size.
Referenced by QRinput_append(), QRinput_encodeBitStream(), QRinput_insertFNC1Header(), QRinput_insertStructuredAppendHeader(), and QRinput_splitEntry().
|
static |
Definition at line 1446 of file qrinput.c.
References _QRinput_List::data, free(), malloc(), and _QRinput_List::size.
Referenced by QRinput_splitEntry().
STATIC_IN_RELEASE int QRinput_mergeBitStream | ( | QRinput * | input, |
BitStream * | bstream | ||
) |
Merge all bit streams in the input data.
input | input data. |
Definition at line 1275 of file qrinput.c.
References _QRinput::fnc1, _QRinput::mqr, QRinput_convertData(), QRinput_createBitStream(), and QRinput_insertFNC1Header().
Referenced by QRinput_getBitStream().
QRinput* QRinput_new | ( | void | ) |
Instantiate an input data object.
The version is set to 0 (auto-select) and the error correction level is set to QR_ECLEVEL_L.
ENOMEM | unable to allocate memory. |
Definition at line 109 of file qrinput.c.
References QR_ECLEVEL_L, and QRinput_new2().
Instantiate an input data object.
version | version number. |
level | Error correction level. |
ENOMEM | unable to allocate memory for input objects. |
EINVAL | invalid arguments. |
Definition at line 114 of file qrinput.c.
References _QRinput::fnc1, _QRinput::head, _QRinput::level, malloc(), _QRinput::mqr, QR_ECLEVEL_H, QRSPEC_VERSION_MAX, _QRinput::tail, and _QRinput::version.
Referenced by QRcode_encodeDataReal(), QRcode_encodeDataStructuredReal(), QRcode_encodeStringReal(), QRinput_dup(), QRinput_new(), QRinput_newMQR(), and QRinput_splitQRinputToStruct().
Instantiate an input data object.
Object's Micro QR Code flag is set. Unlike with full-sized QR Code, version number must be specified (>0).
version | version number (1–4). |
level | Error correction level. |
ENOMEM | unable to allocate memory for input objects. |
EINVAL | invalid arguments. |
Definition at line 136 of file qrinput.c.
References _QRinput::mqr, MQRspec_getECCLength(), MQRSPEC_VERSION_MAX, and QRinput_new2().
Referenced by QRcode_encodeDataReal(), QRcode_encodeStringReal(), and QRinput_dup().
Set error correction level of the QR code that is to be encoded.
This function cannot be applied to Micro QR Code.
input | input object. |
level | Error correction level. |
0 | success. |
-1 | invalid argument. |
Definition at line 177 of file qrinput.c.
References _QRinput::level, _QRinput::mqr, and QR_ECLEVEL_H.
Set FNC1-1st position flag.
Definition at line 1616 of file qrinput.c.
References _QRinput::fnc1, and _QRinput::mqr.
Set FNC1-2nd position flag and application identifier.
Definition at line 1627 of file qrinput.c.
References _QRinput::appid, _QRinput::fnc1, and _QRinput::mqr.
Set version of the QR code that is to be encoded.
This function cannot be applied to Micro QR Code.
input | input object. |
version | version number (0 = auto) |
0 | success. |
-1 | invalid argument. |
Definition at line 160 of file qrinput.c.
References _QRinput::mqr, QRSPEC_VERSION_MAX, and _QRinput::version.
Referenced by QRinput_convertData().
Set version and error correction level of the QR code at once.
This function is recommened for Micro QR Code.
input | input object. |
version | version number (0 = auto) |
level | Error correction level. |
0 | success. |
-1 | invalid argument. |
Definition at line 189 of file qrinput.c.
References _QRinput::level, _QRinput::mqr, MQRspec_getECCLength(), MQRSPEC_VERSION_MAX, QR_ECLEVEL_H, QRSPEC_VERSION_MAX, and _QRinput::version.
STATIC_IN_RELEASE int QRinput_splitEntry | ( | QRinput_List * | entry, |
int | bytes | ||
) |
Definition at line 1461 of file qrinput.c.
References _QRinput_List::data, _QRinput_List::mode, _QRinput_List::next, QRinput_List_freeEntry(), QRinput_List_newEntry(), QRinput_List_shrinkEntry(), and _QRinput_List::size.
Referenced by QRinput_splitQRinputToStruct().
QRinput_Struct* QRinput_splitQRinputToStruct | ( | QRinput * | input | ) |
Split a QRinput to QRinput_Struct.
It calculates a parity, set it, then insert structured-append headers. QRinput created by QRinput_newMQR() will be rejected.
input | input object. Version number and error correction level must be set. |
ERANGE | input data is too large. |
EINVAL | invalid input data. |
ENOMEM | unable to allocate memory. |
Definition at line 1483 of file qrinput.c.
References BitStream_free(), BitStream_new(), BitStream_reset, _QRinput::head, _QRinput::level, MAX_STRUCTURED_SYMBOLS, _QRinput_List::mode, _QRinput::mqr, _QRinput_List::next, QRinput_calcParity(), QRinput_dup(), QRinput_encodeBitStream(), QRinput_estimateBitStreamSizeOfEntry(), QRinput_free(), QRinput_lengthOfCode(), QRinput_new2(), QRinput_splitEntry(), QRinput_Struct_appendInput(), QRinput_Struct_free(), QRinput_Struct_insertStructuredAppendHeaders(), QRinput_Struct_new(), QRinput_Struct_setParity(), QRspec_getDataLength(), _QRinput_Struct::size, STRUCTURE_HEADER_SIZE, _QRinput::tail, and _QRinput::version.
Referenced by QRcode_encodeInputToStructured().
int QRinput_Struct_appendInput | ( | QRinput_Struct * | s, |
QRinput * | input | ||
) |
Append a QRinput object to the set.
QRinput created by QRinput_newMQR() will be rejected.
s | structured input object. |
input | an input object. |
>0 | number of input objects in the structure. |
-1 | an error occurred. See Exceptions for the details. |
ENOMEM | unable to allocate memory. |
EINVAL | invalid arguments. |
Definition at line 1391 of file qrinput.c.
References _QRinput_Struct::head, _QRinput::mqr, _QRinput_InputList::next, QRinput_InputList_newEntry(), _QRinput_Struct::size, and _QRinput_Struct::tail.
Referenced by QRinput_splitQRinputToStruct().
|
static |
Definition at line 1430 of file qrinput.c.
References _QRinput_Struct::head, _QRinput_InputList::input, _QRinput_InputList::next, QRinput_calcParity(), and QRinput_Struct_setParity().
Referenced by QRinput_Struct_insertStructuredAppendHeaders().
void QRinput_Struct_free | ( | QRinput_Struct * | s | ) |
Free all of QRinput in the set.
s | a structured input object. |
Definition at line 1415 of file qrinput.c.
References free(), _QRinput_Struct::head, _QRinput_InputList::next, and QRinput_InputList_freeEntry().
Referenced by QRcode_encodeInputToStructured(), and QRinput_splitQRinputToStruct().
int QRinput_Struct_insertStructuredAppendHeaders | ( | QRinput_Struct * | s | ) |
Insert structured-append headers to the input structure.
It calculates a parity and set it if the parity is not set yet.
s | input structure |
0 | success. |
-1 | an error occurred and errno is set to indeicate the error. See Execptions for the details. |
EINVAL | invalid input object. |
ENOMEM | unable to allocate memory. |
Definition at line 1588 of file qrinput.c.
References _QRinput_Struct::head, _QRinput_InputList::input, _QRinput_InputList::next, _QRinput_Struct::parity, QRinput_insertStructuredAppendHeader(), QRinput_Struct_calcParity(), and _QRinput_Struct::size.
Referenced by QRinput_splitQRinputToStruct().
QRinput_Struct* QRinput_Struct_new | ( | void | ) |
Instantiate a set of input data object.
ENOMEM | unable to allocate memory. |
Definition at line 1371 of file qrinput.c.
References _QRinput_Struct::head, malloc(), _QRinput_Struct::parity, _QRinput_Struct::size, and _QRinput_Struct::tail.
Referenced by QRinput_splitQRinputToStruct().
void QRinput_Struct_setParity | ( | QRinput_Struct * | s, |
unsigned char | parity | ||
) |
Set parity of structured symbols.
s | structured input object. |
parity | parity of s. |
Definition at line 1386 of file qrinput.c.
References int(), and _QRinput_Struct::parity.
Referenced by QRinput_splitQRinputToStruct(), and QRinput_Struct_calcParity().
const signed char QRinput_anTable[128] |