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)  

split.c File Reference
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "qrencode.h"
#include "qrinput.h"
#include "qrspec.h"
#include "split.h"
Include dependency graph for split.c:

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

◆ isalnum

#define isalnum (   __c__)    (QRinput_lookAnTable(__c__) >= 0)

Definition at line 40 of file split.c.

◆ isdigit

#define isdigit (   __c__)    ((unsigned char)((signed char)(__c__) - '0') < 10)

Definition at line 39 of file split.c.

Function Documentation

◆ dupAndToUpper()

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

Definition at line 279 of file split.c.

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

Referenced by Split_splitStringToQRinput().

◆ Split_eat8()

◆ Split_eatAn()

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

◆ Split_eatKanji()

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

Definition at line 169 of file split.c.

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

Referenced by Split_splitString().

◆ Split_eatNum()

◆ Split_identifyMode()

static QRencodeMode Split_identifyMode ( const char *  string,
QRencodeMode  hint 
)
static

◆ Split_splitString()

static int Split_splitString ( const char *  string,
QRinput input,
QRencodeMode  hint 
)
static

◆ Split_splitStringToQRinput()

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 303 of file split.c.

References casesensitive, dupAndToUpper(), hint, and Split_splitString().

Referenced by QRcode_encodeDataStructuredReal(), and QRcode_encodeStringReal().

◆ strdup()

char * strdup ( const char *  s)

Definition at line 44 of file split.c.

Referenced by dupAndToUpper(), and qrencodeStructured().