QRencode

qrencode.h

Go to the documentation of this file.
00001 
00099 #ifndef __QRENCODE_H__
00100 #define __QRENCODE_H__
00101 
00102 #if defined(__cplusplus)
00103 extern "C" {
00104 #endif
00105 
00109 typedef enum {
00110         QR_MODE_NUL = -1,  
00111         QR_MODE_NUM = 0,   
00112         QR_MODE_AN,        
00113         QR_MODE_8,         
00114         QR_MODE_KANJI,     
00115         QR_MODE_STRUCTURE, 
00116 } QRencodeMode;
00117 
00121 typedef enum {
00122         QR_ECLEVEL_L = 0, 
00123         QR_ECLEVEL_M,
00124         QR_ECLEVEL_Q,
00125         QR_ECLEVEL_H      
00126 } QRecLevel;
00127 
00128 /******************************************************************************
00129  * Input data (qrinput.c)
00130  *****************************************************************************/
00131 
00138 typedef struct _QRinput QRinput;
00139 
00147 extern QRinput *QRinput_new(void);
00148 
00158 extern QRinput *QRinput_new2(int version, QRecLevel level);
00159 
00174 extern int QRinput_append(QRinput *input, QRencodeMode mode, int size, const unsigned char *data);
00175 
00181 extern int QRinput_getVersion(QRinput *input);
00182 
00190 extern int QRinput_setVersion(QRinput *input, int version);
00191 
00197 extern QRecLevel QRinput_getErrorCorrectionLevel(QRinput *input);
00198 
00206 extern int QRinput_setErrorCorrectionLevel(QRinput *input, QRecLevel level);
00207 
00213 extern void QRinput_free(QRinput *input);
00214 
00223 extern int QRinput_check(QRencodeMode mode, int size, const unsigned char *data);
00224 
00228 typedef struct _QRinput_Struct QRinput_Struct;
00229 
00236 extern QRinput_Struct *QRinput_Struct_new(void);
00237 
00243 extern void QRinput_Struct_setParity(QRinput_Struct *s, unsigned char parity);
00244 
00254 extern int QRinput_Struct_appendInput(QRinput_Struct *s, QRinput *input);
00255 
00260 extern void QRinput_Struct_free(QRinput_Struct *s);
00261 
00273 extern QRinput_Struct *QRinput_splitQRinputToStruct(QRinput *input);
00274 
00285 extern int QRinput_Struct_insertStructuredAppendHeaders(QRinput_Struct *s);
00286 
00287 /******************************************************************************
00288  * QRcode output (qrencode.c)
00289  *****************************************************************************/
00290 
00310 typedef struct {
00311         int version;         
00312         int width;           
00313         unsigned char *data; 
00314 } QRcode;
00315 
00320 typedef struct _QRcode_List QRcode_List;
00321 
00322 struct _QRcode_List {
00323         QRcode *code;
00324         QRcode_List *next;
00325 };
00326 
00338 extern QRcode *QRcode_encodeInput(QRinput *input);
00339 
00361 extern QRcode *QRcode_encodeString(const char *string, int version, QRecLevel level, QRencodeMode hint, int casesensitive);
00362 
00367 extern QRcode *QRcode_encodeString8bit(const char *string, int version, QRecLevel level);
00368 
00373 extern void QRcode_free(QRcode *qrcode);
00374 
00381 extern QRcode_List *QRcode_encodeInputStructured(QRinput_Struct *s);
00382 
00401 extern QRcode_List *QRcode_encodeStringStructured(const char *string, int version, QRecLevel level, QRencodeMode hint, int casesensitive);
00402 
00407 extern QRcode_List *QRcode_encodeString8bitStructured(const char *string, int version, QRecLevel level);
00408 
00414 extern int QRcode_List_size(QRcode_List *qrlist);
00415 
00420 extern void QRcode_List_free(QRcode_List *qrlist);
00421 
00422 #if defined(__cplusplus)
00423 }
00424 #endif
00425 
00426 #endif /* __QRENCODE_H__ */