qrencode - QR Code encoder Copyright (C) 2006, 2007, 2008 Kentaro Fukuchi <fukuchi@megaui.net>
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Libqrencode is a library for encoding data in a QR Code symbol, a kind of 2D symbology.
If the input data contains Kanji (Shift-JIS) characters and you want to encode them as Kanji in QR Code, you should give QR_MODE_KANJI as a hint. Otherwise, all of non-alphanumeric characters are encoded as 8 bit data. If you want to encode a whole string in 8 bit mode, use QRcode_encodeString8bit() instead.
Please note that a C string can not contain NUL character. If your data contains NUL, you should chose the second way.
Please note that the version of the result may be larger than specified. In such cases, the input data would be too large to be encoded in the symbol of the specified version.
QRcode_List *qrcodes; QRcode_List *entry; QRcode *qrcode; qrcodes = QRcode_encodeStringStructured(...); entry = qrcodes; while(entry != NULL) { qrcode = entry->code; // do something entry = entry->next; } QRcode_List_free(entry);
Instead of using auto-parsing functions, you can construct your own structured input. At first, instantiate an object of QRinput_Struct by calling QRinput_Struct_new(). This object can hold multiple QRinput, and one QR code is generated for a QRinput. QRinput_Struct_appendInput() appends a QRinput to a QRinput_Struct object. In order to generate structured-appended symbols, it is required to embed headers to each symbol. You can use QRinput_Struct_insertStructuredAppendHeaders() to insert appropriate headers to each symbol. You should call this function just once before encoding symbols.
1.5.5