From ef01767c732629b7eff7d1601e76a1bac58f5bfd Mon Sep 17 00:00:00 2001 From: Leo Howell Date: Sat, 5 Sep 2009 09:33:22 +0900 Subject: The story so far --- lpg/libqr/qr/types.h | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lpg/libqr/qr/types.h (limited to 'lpg/libqr/qr/types.h') diff --git a/lpg/libqr/qr/types.h b/lpg/libqr/qr/types.h new file mode 100644 index 0000000..bb44cde --- /dev/null +++ b/lpg/libqr/qr/types.h @@ -0,0 +1,8 @@ +#ifndef QR_TYPES_H +#define QR_TYPES_H + +struct qr_data; +struct qr_code; + +#endif + -- cgit v1.2.3-70-g09d2 From 3af4ffd175dcaf8aaf735f3f9564da54c4f29403 Mon Sep 17 00:00:00 2001 From: Leo Uino Date: Thu, 14 Jul 2011 11:36:58 +0900 Subject: Create common header --- lpg/libqr/code-create.c | 1 + lpg/libqr/code-layout.c | 1 + lpg/libqr/code-parse.c | 2 +- lpg/libqr/constants.h | 2 +- lpg/libqr/qr/code.h | 7 ------- lpg/libqr/qr/common.h | 14 ++++++++++++++ lpg/libqr/qr/data.h | 18 ------------------ lpg/libqr/qr/types.h | 18 ++++++++++++++++++ 8 files changed, 36 insertions(+), 27 deletions(-) create mode 100644 lpg/libqr/qr/common.h (limited to 'lpg/libqr/qr/types.h') diff --git a/lpg/libqr/code-create.c b/lpg/libqr/code-create.c index 155ffa3..1da7845 100644 --- a/lpg/libqr/code-create.c +++ b/lpg/libqr/code-create.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include "constants.h" diff --git a/lpg/libqr/code-layout.c b/lpg/libqr/code-layout.c index 04b6ca6..97cf3af 100644 --- a/lpg/libqr/code-layout.c +++ b/lpg/libqr/code-layout.c @@ -5,6 +5,7 @@ #include #include +#include #include #include "constants.h" diff --git a/lpg/libqr/code-parse.c b/lpg/libqr/code-parse.c index 50d621c..f84dcfe 100644 --- a/lpg/libqr/code-parse.c +++ b/lpg/libqr/code-parse.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include diff --git a/lpg/libqr/constants.h b/lpg/libqr/constants.h index 2c19e97..5ae9256 100644 --- a/lpg/libqr/constants.h +++ b/lpg/libqr/constants.h @@ -1,7 +1,7 @@ #ifndef QR_CONSTANTS_H #define QR_CONSTANTS_H -#include +#include extern const int QR_ALIGNMENT_LOCATION[40][7]; extern const int QR_DATA_WORD_COUNT[40][4]; diff --git a/lpg/libqr/qr/code.h b/lpg/libqr/qr/code.h index 2392467..e6eb47c 100644 --- a/lpg/libqr/qr/code.h +++ b/lpg/libqr/qr/code.h @@ -13,12 +13,5 @@ struct qr_code * qr_code_create(const struct qr_data * data); void qr_code_destroy(struct qr_code *); -int qr_code_width(const struct qr_code *); - -size_t qr_code_total_capacity(int version); - -struct qr_bitmap * qr_mask_apply(const struct qr_bitmap * orig, - unsigned int mask); - #endif diff --git a/lpg/libqr/qr/common.h b/lpg/libqr/qr/common.h new file mode 100644 index 0000000..9caf3e0 --- /dev/null +++ b/lpg/libqr/qr/common.h @@ -0,0 +1,14 @@ +#ifndef QR_COMMON_H +#define QR_COMMON_H + +#include + +struct qr_bitmap * qr_mask_apply(const struct qr_bitmap * orig, + unsigned int mask); + +size_t qr_code_total_capacity(int version); + +int qr_code_width(const struct qr_code *); + +#endif + diff --git a/lpg/libqr/qr/data.h b/lpg/libqr/qr/data.h index a3bb309..3cc665a 100644 --- a/lpg/libqr/qr/data.h +++ b/lpg/libqr/qr/data.h @@ -4,24 +4,6 @@ #include #include "types.h" -enum qr_data_type { - QR_DATA_INVALID = -1, - QR_DATA_ECI = 7, - QR_DATA_NUMERIC = 1, - QR_DATA_ALPHA = 2, - QR_DATA_8BIT = 4, - QR_DATA_KANJI = 8, /* JIS X 0208 */ - QR_DATA_MIXED = 3, - QR_DATA_FNC1 = 9 -}; - -enum qr_ec_level { - QR_EC_LEVEL_L = 0x1, - QR_EC_LEVEL_M = 0x0, - QR_EC_LEVEL_Q = 0x3, - QR_EC_LEVEL_H = 0x2 -}; - struct qr_data { int version; /* 1 ~ 40 */ enum qr_ec_level ec; diff --git a/lpg/libqr/qr/types.h b/lpg/libqr/qr/types.h index bb44cde..3615e3e 100644 --- a/lpg/libqr/qr/types.h +++ b/lpg/libqr/qr/types.h @@ -4,5 +4,23 @@ struct qr_data; struct qr_code; +enum qr_data_type { + QR_DATA_INVALID = -1, + QR_DATA_ECI = 7, + QR_DATA_NUMERIC = 1, + QR_DATA_ALPHA = 2, + QR_DATA_8BIT = 4, + QR_DATA_KANJI = 8, /* JIS X 0208 */ + QR_DATA_MIXED = 3, + QR_DATA_FNC1 = 9 +}; + +enum qr_ec_level { + QR_EC_LEVEL_L = 0x1, + QR_EC_LEVEL_M = 0x0, + QR_EC_LEVEL_Q = 0x3, + QR_EC_LEVEL_H = 0x2 +}; + #endif -- cgit v1.2.3-70-g09d2 From 779e729ad887c1cc967731a9634a11438d56b017 Mon Sep 17 00:00:00 2001 From: Leo Uino Date: Tue, 19 Jul 2011 12:08:33 +0900 Subject: Add C++ header protectors --- lpg/libqr/qr/bitmap.h | 8 ++++++++ lpg/libqr/qr/bitstream.h | 8 ++++++++ lpg/libqr/qr/code.h | 8 ++++++++ lpg/libqr/qr/common.h | 8 ++++++++ lpg/libqr/qr/data.h | 8 ++++++++ lpg/libqr/qr/layout.h | 8 ++++++++ lpg/libqr/qr/parse.h | 8 ++++++++ lpg/libqr/qr/types.h | 8 ++++++++ lpg/libqr/qr/version.h | 8 ++++++++ 9 files changed, 72 insertions(+) (limited to 'lpg/libqr/qr/types.h') diff --git a/lpg/libqr/qr/bitmap.h b/lpg/libqr/qr/bitmap.h index d4af471..72da07f 100644 --- a/lpg/libqr/qr/bitmap.h +++ b/lpg/libqr/qr/bitmap.h @@ -1,6 +1,10 @@ #ifndef QR_BITMAP_H #define QR_BITMAP_H +#ifdef __cplusplus +extern "C" { +#endif + struct qr_bitmap { unsigned char * bits; unsigned char * mask; @@ -25,5 +29,9 @@ void qr_bitmap_render(const struct qr_bitmap * bmp, unsigned long mark, unsigned long space); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lpg/libqr/qr/bitstream.h b/lpg/libqr/qr/bitstream.h index 9bd8261..aa431e8 100644 --- a/lpg/libqr/qr/bitstream.h +++ b/lpg/libqr/qr/bitstream.h @@ -3,6 +3,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * Note: when writing / reading multiple bits, the * _most_ significant bits come first in the stream. @@ -45,5 +49,9 @@ int qr_bitstream_copy(struct qr_bitstream * dest, struct qr_bitstream * src, size_t count); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lpg/libqr/qr/code.h b/lpg/libqr/qr/code.h index e6eb47c..0f5d49c 100644 --- a/lpg/libqr/qr/code.h +++ b/lpg/libqr/qr/code.h @@ -4,6 +4,10 @@ #include #include "types.h" +#ifdef __cplusplus +extern "C" { +#endif + struct qr_code { int version; struct qr_bitmap * modules; @@ -13,5 +17,9 @@ struct qr_code * qr_code_create(const struct qr_data * data); void qr_code_destroy(struct qr_code *); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lpg/libqr/qr/common.h b/lpg/libqr/qr/common.h index 640696a..b7052ad 100644 --- a/lpg/libqr/qr/common.h +++ b/lpg/libqr/qr/common.h @@ -3,6 +3,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + void qr_mask_apply(struct qr_bitmap * bmp, int mask); size_t qr_code_total_capacity(int version); @@ -20,5 +24,9 @@ void qr_get_rs_block_sizes(int version, int data_length[2], int ec_length[2]); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lpg/libqr/qr/data.h b/lpg/libqr/qr/data.h index f2b4b45..06600ab 100644 --- a/lpg/libqr/qr/data.h +++ b/lpg/libqr/qr/data.h @@ -4,6 +4,10 @@ #include #include "types.h" +#ifdef __cplusplus +extern "C" { +#endif + struct qr_data { int version; /* 1 ~ 40 */ enum qr_ec_level ec; @@ -29,5 +33,9 @@ enum qr_data_type qr_parse_data(const struct qr_data * input, char ** output, size_t * length); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lpg/libqr/qr/layout.h b/lpg/libqr/qr/layout.h index 49bebf6..e691bdb 100644 --- a/lpg/libqr/qr/layout.h +++ b/lpg/libqr/qr/layout.h @@ -1,6 +1,10 @@ #ifndef QR_CODE_LAYOUT_H #define QR_CODE_LAYOUT_H +#ifdef __cplusplus +extern "C" { +#endif + struct qr_iterator; void qr_layout_init_mask(struct qr_code *); @@ -10,5 +14,9 @@ unsigned int qr_layout_read(struct qr_iterator *); void qr_layout_write(struct qr_iterator *, unsigned int); void qr_layout_end(struct qr_iterator *); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lpg/libqr/qr/parse.h b/lpg/libqr/qr/parse.h index 07a0424..0e08354 100644 --- a/lpg/libqr/qr/parse.h +++ b/lpg/libqr/qr/parse.h @@ -3,6 +3,10 @@ #include "data.h" +#ifdef __cplusplus +extern "C" { +#endif + int qr_code_parse(const void * buffer, size_t line_bits, size_t line_stride, @@ -12,5 +16,9 @@ int qr_code_parse(const void * buffer, int qr_decode_format(unsigned long bits, enum qr_ec_level * ec, int * mask); int qr_decode_version(unsigned long bits, int * version); +#ifdef __cplusplus +} +#endif + #endif diff --git a/lpg/libqr/qr/types.h b/lpg/libqr/qr/types.h index 3615e3e..ae760ab 100644 --- a/lpg/libqr/qr/types.h +++ b/lpg/libqr/qr/types.h @@ -1,6 +1,10 @@ #ifndef QR_TYPES_H #define QR_TYPES_H +#ifdef __cplusplus +extern "C" { +#endif + struct qr_data; struct qr_code; @@ -22,5 +26,9 @@ enum qr_ec_level { QR_EC_LEVEL_H = 0x2 }; +#ifdef __cplusplus +} +#endif + #endif diff --git a/lpg/libqr/qr/version.h b/lpg/libqr/qr/version.h index cd263c0..ce540f4 100644 --- a/lpg/libqr/qr/version.h +++ b/lpg/libqr/qr/version.h @@ -1,10 +1,18 @@ #ifndef QR_VERSION_H #define QR_VERSION_H +#ifdef __cplusplus +extern "C" { +#endif + #define QR_VERSION_MAJOR 0 #define QR_VERSION_MINOR 3 #define QR_VERSION "0.3" +#ifdef __cplusplus +} +#endif + #endif -- cgit v1.2.3-70-g09d2