ref: ec7a4d2acda4ed328d4205ec060b74c3b38a62a7
parent: 6fec84b78e354c10ba5aab8da6e0c260d28d9857
author: Sebastian Rasmussen <sebras@gmail.com>
date: Thu May 24 19:54:54 EDT 2018
jbig2dec: Add include guards to all headers.
--- a/jbig2_arith.h
+++ b/jbig2_arith.h
@@ -17,6 +17,9 @@
jbig2dec
*/
+#ifndef _JBIG2_ARITH_H
+#define _JBIG2_ARITH_H
+
typedef struct _Jbig2ArithState Jbig2ArithState;
/* An arithmetic coding context is stored as a single byte, with the
@@ -32,3 +35,5 @@
/* returns true if the end of the data stream has been reached (for sanity checks) */
bool jbig2_arith_has_reached_marker(Jbig2ArithState *as);
+
+#endif /* _JBIG2_ARITH_H */
--- a/jbig2_arith_iaid.h
+++ b/jbig2_arith_iaid.h
@@ -17,6 +17,9 @@
jbig2dec
*/
+#ifndef _JBIG2_ARITH_IAID_H
+#define _JBIG2_ARITH_IAID_H
+
typedef struct _Jbig2ArithIaidCtx Jbig2ArithIaidCtx;
Jbig2ArithIaidCtx *jbig2_arith_iaid_ctx_new(Jbig2Ctx *ctx, int SBSYMCODELEN);
@@ -24,3 +27,5 @@
int jbig2_arith_iaid_decode(Jbig2Ctx *ctx, Jbig2ArithIaidCtx *actx, Jbig2ArithState *as, int32_t *p_result);
void jbig2_arith_iaid_ctx_free(Jbig2Ctx *ctx, Jbig2ArithIaidCtx *iax);
+
+#endif /* _JBIG2_ARITH_IAID_H */
--- a/jbig2_arith_int.h
+++ b/jbig2_arith_int.h
@@ -17,6 +17,9 @@
jbig2dec
*/
+#ifndef _JBIG2_ARITH_INT_H
+#define _JBIG2_ARITH_INT_H
+
typedef struct _Jbig2ArithIntCtx Jbig2ArithIntCtx;
Jbig2ArithIntCtx *jbig2_arith_int_ctx_new(Jbig2Ctx *ctx);
@@ -24,3 +27,5 @@
int jbig2_arith_int_decode(Jbig2Ctx *ctx, Jbig2ArithIntCtx *actx, Jbig2ArithState *as, int32_t *p_result);
void jbig2_arith_int_ctx_free(Jbig2Ctx *ctx, Jbig2ArithIntCtx *iax);
+
+#endif /* _JBIG2_ARITH_INT_H */
--- a/jbig2_generic.h
+++ b/jbig2_generic.h
@@ -17,6 +17,9 @@
jbig2dec
*/
+#ifndef _JBIG2_GENERIC_H
+#define _JBIG2_GENERIC_H
+
/**
* Headers for Generic and Generic Refinement region handling
**/
@@ -55,3 +58,5 @@
jbig2_decode_refinement_region(Jbig2Ctx *ctx,
Jbig2Segment *segment,
const Jbig2RefinementRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats);
+
+#endif /* _JBIG2_GENERIC_H */
--- a/jbig2_huffman.h
+++ b/jbig2_huffman.h
@@ -17,8 +17,8 @@
jbig2dec
*/
-#ifndef JBIG2_HUFFMAN_H
-#define JBIG2_HUFFMAN_H
+#ifndef _JBIG2_HUFFMAN_H
+#define _JBIG2_HUFFMAN_H
/* Huffman coder interface */
@@ -107,4 +107,4 @@
/* find a user supplied table used by 'segment' and by 'index' */
const Jbig2HuffmanParams *jbig2_find_table(Jbig2Ctx *ctx, Jbig2Segment *segment, int index);
-#endif /* JBIG2_HUFFMAN_H */
+#endif /* _JBIG2_HUFFMAN_H */
--- a/jbig2_hufftab.h
+++ b/jbig2_hufftab.h
@@ -20,8 +20,8 @@
/* predefined Huffman table definitions
-- See Annex B of the JBIG2 specification */
-#ifndef JBIG2_HUFFTAB_H
-#define JBIG2_HUFFTAB_H
+#ifndef _JBIG2_HUFFTAB_H
+#define _JBIG2_HUFFTAB_H
/* types are in jbig2_huffman.h, you must include that first */
@@ -312,4 +312,4 @@
#undef JBIG2_COUNTOF
-#endif /* JBIG2_HUFFTAB_H */
+#endif /* _JBIG2_HUFFTAB_H */
--- a/jbig2_mmr.h
+++ b/jbig2_mmr.h
@@ -17,8 +17,13 @@
jbig2dec
*/
+#ifndef _JBIG2_MMR_H
+#define _JBIG2_MMR_H
+
int
jbig2_decode_generic_mmr(Jbig2Ctx *ctx, Jbig2Segment *segment, const Jbig2GenericRegionParams *params, const byte *data, size_t size, Jbig2Image *image);
int
jbig2_decode_halftone_mmr(Jbig2Ctx *ctx, const Jbig2GenericRegionParams *params, const byte *data, size_t size, Jbig2Image *image, size_t *consumed_bytes);
+
+#endif /* _JBIG2_MMR_H */
--- a/jbig2_priv.h
+++ b/jbig2_priv.h
@@ -17,6 +17,9 @@
jbig2dec
*/
+#ifndef _JBIG2_PRIV_H
+#define _JBIG2_PRIV_H
+
/* To enable Memento, either uncomment the following, or arrange to
* predefine MEMENTO whilst building. */
/* #define MEMENTO */
@@ -188,3 +191,5 @@
Jbig2WordStream *jbig2_word_stream_buf_new(Jbig2Ctx *ctx, const byte *data, size_t size);
void jbig2_word_stream_buf_free(Jbig2Ctx *ctx, Jbig2WordStream *ws);
+
+#endif /* _JBIG2_PRIV_H */
--- a/jbig2_symbol_dict.h
+++ b/jbig2_symbol_dict.h
@@ -17,6 +17,9 @@
jbig2dec
*/
+#ifndef _JBIG2_SYMBOL_DICT_H
+#define _JBIG2_SYMBOL_DICT_H
+
/* symbol dictionary header */
/* the results of decoding a symbol dictionary */
@@ -48,3 +51,5 @@
/* return an array of pointers to symbol dictionaries referred
to by a segment */
Jbig2SymbolDict **jbig2_sd_list_referred(Jbig2Ctx *ctx, Jbig2Segment *segment);
+
+#endif /* _JBIG2_SYMBOL_DICT_H */
--- a/jbig2_text.h
+++ b/jbig2_text.h
@@ -17,6 +17,9 @@
jbig2dec
*/
+#ifndef _JBIG2_TEXT_H
+#define _JBIG2_TEXT_H
+
/**
* Headers for Text region handling
**/
@@ -72,3 +75,5 @@
const Jbig2TextRegionParams *params,
const Jbig2SymbolDict *const *dicts, const uint32_t n_dicts,
Jbig2Image *image, const byte *data, const size_t size, Jbig2ArithCx *GR_stats, Jbig2ArithState *as, Jbig2WordStream *ws);
+
+#endif /* _JBIG2_TEXT_H */