37 #define isdigit(__c__) ((unsigned char)((signed char)(__c__) - '0') < 10)
38 #define isalnum(__c__) (QRinput_lookAnTable(__c__) >= 0)
44 size_t len = strlen(s) + 1;
45 void *newstring =
malloc(len);
46 if(newstring == NULL)
return NULL;
47 return (
char *)memcpy(newstring, s, len);
56 c = (
unsigned char)
string[0];
64 d = (
unsigned char)
string[1];
66 word = ((
unsigned int)c << 8) | d;
67 if((word >= 0x8140 && word <= 0x9ffc) || (word >= 0xe040 && word <= 0xebbf)) {
94 run = (
int)(p -
string);
114 if(ret < 0)
return -1;
150 run = (
int)(p -
string);
162 if(ret < 0)
return -1;
177 run = (
int)(p -
string);
179 if(ret < 0)
return -1;
245 run = (
int)(p -
string);
247 if(ret < 0)
return -1;
258 while(*
string !=
'\0') {
269 if(length == 0)
break;
270 if(length < 0)
return -1;
283 if(newstr == NULL)
return NULL;
291 if (*p >=
'a' && *p <=
'z') {
292 *p = (char)((
int)*p - 32);
307 if(
string == NULL || *
string ==
'\0') {
313 if(newstr == NULL)
return -1;
EXTRAS_EXPORT int QRinput_append(QRinput *input, QRencodeMode mode, int size, const unsigned char *data)
Append data to an input object.
static int Split_eatNum(const char *string, QRinput *input, QRencodeMode hint)
static int Split_eat8(const char *string, QRinput *input, QRencodeMode hint)
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
static int Split_splitString(const char *string, QRinput *input, QRencodeMode hint)
static int Split_eatKanji(const char *string, QRinput *input, QRencodeMode hint)
static char * dupAndToUpper(const char *str, QRencodeMode hint)
QRencodeMode
Encoding mode.
char * strdup(const char *s)
int QRspec_lengthIndicator(QRencodeMode mode, int version)
Return the size of length indicator for the mode and version.
static QRencodeMode Split_identifyMode(const char *string, QRencodeMode hint)
static int Split_eatAn(const char *string, QRinput *input, QRencodeMode hint)
Terminator (NUL character). Internal use only.
int Split_splitStringToQRinput(const char *string, QRinput *input, QRencodeMode hint, int casesensitive)
Split the input string (null terminated) into QRinput.