TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Macros | Functions
split.c File Reference
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "qrencode.h"
#include "qrinput.h"
#include "qrspec.h"
#include "split.h"

Go to the source code of this file.

Macros

#define isdigit(__c__)   ((unsigned char)((signed char)(__c__) - '0') < 10)
 
#define isalnum(__c__)   (QRinput_lookAnTable(__c__) >= 0)
 

Functions

char * strdup (const char *s)
 
static QRencodeMode Split_identifyMode (const char *string, QRencodeMode hint)
 
static int Split_eatAn (const char *string, QRinput *input, QRencodeMode hint)
 
static int Split_eat8 (const char *string, QRinput *input, QRencodeMode hint)
 
static int Split_eatNum (const char *string, QRinput *input, QRencodeMode hint)
 
static int Split_eatKanji (const char *string, QRinput *input, QRencodeMode hint)
 
static int Split_splitString (const char *string, QRinput *input, QRencodeMode hint)
 
static char * dupAndToUpper (const char *str, QRencodeMode hint)
 
int Split_splitStringToQRinput (const char *string, QRinput *input, QRencodeMode hint, int casesensitive)
 Split the input string (null terminated) into QRinput. More...
 

Macro Definition Documentation

#define isalnum (   __c__)    (QRinput_lookAnTable(__c__) >= 0)
#define isdigit (   __c__)    ((unsigned char)((signed char)(__c__) - '0') < 10)

Definition at line 37 of file split.c.

Referenced by Split_eat8(), Split_eatAn(), Split_eatNum(), and Split_identifyMode().

Function Documentation

static char* dupAndToUpper ( const char *  str,
QRencodeMode  hint 
)
static

Definition at line 277 of file split.c.

References QR_MODE_KANJI, Split_identifyMode(), and strdup().

Referenced by Split_splitStringToQRinput().

static int Split_eat8 ( const char *  string,
QRinput input,
QRencodeMode  hint 
)
static
static int Split_eatAn ( const char *  string,
QRinput input,
QRencodeMode  hint 
)
static
static int Split_eatKanji ( const char *  string,
QRinput input,
QRencodeMode  hint 
)
static

Definition at line 167 of file split.c.

References int(), QR_MODE_KANJI, QRinput_append(), and Split_identifyMode().

Referenced by Split_splitString().

static int Split_eatNum ( const char *  string,
QRinput input,
QRencodeMode  hint 
)
static
static QRencodeMode Split_identifyMode ( const char *  string,
QRencodeMode  hint 
)
static
static int Split_splitString ( const char *  string,
QRinput input,
QRencodeMode  hint 
)
static
int Split_splitStringToQRinput ( const char *  string,
QRinput input,
QRencodeMode  hint,
int  casesensitive 
)

Split the input string (null terminated) into QRinput.

Parameters
stringinput string
hintgive QR_MODE_KANJI if the input string contains Kanji character encoded in Shift-JIS. If not, give QR_MODE_8.
casesensitive0 for case-insensitive encoding (all alphabet characters are replaced to UPPER-CASE CHARACTERS.
Return values
0success.
-1an error occurred. errno is set to indicate the error. See Exceptions for the details.
Exceptions
EINVALinvalid input object.
ENOMEMunable to allocate memory for input objects.

Definition at line 301 of file split.c.

References dupAndToUpper(), free(), and Split_splitString().

Referenced by QRcode_encodeDataStructuredReal(), and QRcode_encodeStringReal().

char* strdup ( const char *  s)

Definition at line 42 of file split.c.

References malloc().

Referenced by dupAndToUpper().