From 4f823c30395fb4ee6625c3039bf810bfc89e7f10 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Fri, 8 Sep 2017 03:16:43 +0000 Subject: [PATCH] Added new unused enum and struct to C library code to represent segments. --- c/qrcodegen.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/c/qrcodegen.h b/c/qrcodegen.h index 389c523..cfd06ac 100644 --- a/c/qrcodegen.h +++ b/c/qrcodegen.h @@ -57,6 +57,37 @@ enum qrcodegen_Mask { }; +/* + * The mode field of a segment. + */ +enum qrcodegen_Mode { + qrcodegen_Mode_NUMERIC, + qrcodegen_Mode_ALPHANUMERIC, + qrcodegen_Mode_BYTE, + qrcodegen_Mode_KANJI, + qrcodegen_Mode_ECI, +}; + + +/** + * Represents a character string to be encoded in a QR Code symbol. Each segment has + * a mode, and a sequence of characters that is already encoded as a sequence of bits. + */ +struct qrcodegen_Segment { + // The mode indicator for this segment. + enum qrcodegen_Mode mode; + + // The length of this segment's unencoded data, measured in characters. Always zero or positive. + int numChars; + + // The data bits of this segment, packed in bitwise big endian. Can be null. + uint8_t *data; + + // The number of valid data bits used in the buffer. Requires 0 <= bitLength <= (capacity of data array * 8). + int bitLength; +}; + + /*---- Macro constants and functions ----*/