39#define isdigit(__c__) ((unsigned char)((signed char)(__c__) - '0') < 10)
40#define isalnum(__c__) (QRinput_lookAnTable(__c__) >= 0)
46 size_t len = strlen(s) + 1;
47 void *newstring = malloc(len);
48 if(newstring == NULL)
return NULL;
49 return (
char *)memcpy(newstring, s, len);
58 c = (
unsigned char)
string[0];
66 d = (
unsigned char)
string[1];
68 word = ((
unsigned int)c << 8) | d;
69 if((word >= 0x8140 && word <= 0x9ffc) || (word >= 0xe040 && word <= 0xebbf)) {
96 run = (int)(p -
string);
116 if(ret < 0)
return -1;
152 run = (int)(p -
string);
164 if(ret < 0)
return -1;
179 run = (int)(p -
string);
181 if(ret < 0)
return -1;
247 run = (int)(p -
string);
249 if(ret < 0)
return -1;
260 while(*
string !=
'\0') {
271 if(length == 0)
break;
272 if(length < 0)
return -1;
285 if(newstr == NULL)
return NULL;
293 if (*p >=
'a' && *p <=
'z') {
294 *p = (char)((
int)*p - 32);
309 if(
string == NULL || *
string ==
'\0') {
315 if(newstr == NULL)
return -1;
int QRinput_append(QRinput *input, QRencodeMode mode, int size, const unsigned char *data)
Append data to an input object.
QRencodeMode
Encoding mode.
@ QR_MODE_KANJI
Kanji (shift-jis) mode.
@ QR_MODE_AN
Alphabet-numeric mode.
@ QR_MODE_8
8-bit data mode
@ QR_MODE_NUL
Terminator (NUL character). Internal use only.
@ QR_MODE_NUM
Numeric mode.
int QRspec_lengthIndicator(QRencodeMode mode, int version)
Length indicator.
static int Split_splitString(const char *string, QRinput *input, QRencodeMode hint)
static int Split_eatKanji(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)
char * strdup(const char *s)
static QRencodeMode Split_identifyMode(const char *string, 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.
static int Split_eatAn(const char *string, QRinput *input, QRencodeMode hint)