1 // Copyright (c) 2013-15, LKC Technologies, Inc. 2 // All rights reserved. 3 // 4 // Redistribution and use in source and binary forms, with or without 5 // modification, are permitted provided that the following conditions are met: 6 // 7 // Redistributions of source code must retain the above copyright notice, this 8 // list of conditions and the following disclaimer. Redistributions in binary 9 // form must reproduce the above copyright notice, this list of conditions and 10 // the following disclaimer in the documentation and/or other materials 11 // provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 12 // HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 13 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 14 // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 15 // COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 16 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 17 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 18 // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 19 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 20 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 21 // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 23 #ifndef CODE128_H 24 #define CODE128_H 25 26 #include <stddef.h> 27 28 #ifdef __cplusplus 29 extern "C" { 30 #endif 31 32 // Since the FNCn characters are not ASCII, define versions here to 33 // simplify encoding strings that include them. 34 #define CODE128_FNC1 '\xf1' 35 #define CODE128_FNC2 '\xf2' 36 #define CODE128_FNC3 '\xf3' 37 #define CODE128_FNC4 '\xf4' 38 39 size_t code128_estimate_len(const char * s); 40 size_t code128_encode_gs1(const char * s, char * out, size_t maxlength); 41 size_t code128_encode_raw(const char * s, char * out, size_t maxlength); 42 43 #ifdef __cplusplus 44 } 45 #endif 46 47 #endif // CODE128_H 48