summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/base_cpudep.c2
-rw-r--r--base/base_error.c2
-rw-r--r--base/base_hash.c2
-rw-r--r--base/base_matrix.c2
-rw-r--r--base/base_memory.c2
-rw-r--r--base/base_rect.c2
-rw-r--r--include/fitz-base.h12
-rw-r--r--include/fitz-draw.h20
-rw-r--r--include/fitz-stream.h19
-rw-r--r--include/fitz-world.h24
-rw-r--r--include/fitz.h45
-rw-r--r--include/fitz/runtime.h (renamed from include/fitz/base.h)0
-rw-r--r--include/mupdf.h12
-rw-r--r--include/samus.h12
-rw-r--r--raster/archppc.c4
-rw-r--r--raster/archsparc.c4
-rw-r--r--raster/archx86.c4
-rw-r--r--raster/glyphcache.c4
-rw-r--r--raster/imagedraw.c4
-rw-r--r--raster/imagescale.c4
-rw-r--r--raster/imageunpack.c4
-rw-r--r--raster/meshdraw.c4
-rw-r--r--raster/pathfill.c4
-rw-r--r--raster/pathscan.c4
-rw-r--r--raster/pathstroke.c4
-rw-r--r--raster/pixmap.c4
-rw-r--r--raster/porterduff.c4
-rw-r--r--raster/render.c4
-rw-r--r--stream/crypt_arc4.c3
-rw-r--r--stream/crypt_md5.c3
-rw-r--r--stream/filt_a85d.c3
-rw-r--r--stream/filt_a85e.c3
-rw-r--r--stream/filt_ahxd.c3
-rw-r--r--stream/filt_ahxe.c3
-rw-r--r--stream/filt_arc4.c3
-rw-r--r--stream/filt_dctd.c3
-rw-r--r--stream/filt_dcte.c3
-rw-r--r--stream/filt_faxd.c3
-rw-r--r--stream/filt_faxe.c3
-rw-r--r--stream/filt_flate.c3
-rw-r--r--stream/filt_jbig2d.c3
-rw-r--r--stream/filt_jpxd.c3
-rw-r--r--stream/filt_lzwd.c3
-rw-r--r--stream/filt_lzwe.c3
-rw-r--r--stream/filt_null.c3
-rw-r--r--stream/filt_pipeline.c3
-rw-r--r--stream/filt_predict.c3
-rw-r--r--stream/filt_rld.c3
-rw-r--r--stream/filt_rle.c3
-rw-r--r--stream/obj_array.c3
-rw-r--r--stream/obj_dict.c3
-rw-r--r--stream/obj_parse.c3
-rw-r--r--stream/obj_print.c3
-rw-r--r--stream/obj_simple.c3
-rw-r--r--stream/stm_buffer.c3
-rw-r--r--stream/stm_filter.c3
-rw-r--r--stream/stm_misc.c3
-rw-r--r--stream/stm_open.c3
-rw-r--r--stream/stm_read.c3
-rw-r--r--stream/stm_write.c3
-rw-r--r--world/node_misc1.c3
-rw-r--r--world/node_misc2.c11
-rw-r--r--world/node_optimize.c3
-rw-r--r--world/node_path.c3
-rw-r--r--world/node_text.c3
-rw-r--r--world/node_tolisp.c3
-rw-r--r--world/node_toxml.c12
-rw-r--r--world/node_tree.c3
-rw-r--r--world/res_cmap.c3
-rw-r--r--world/res_colorspace.c3
-rw-r--r--world/res_font.c3
-rw-r--r--world/res_image.c3
-rw-r--r--world/res_shade.c3
73 files changed, 242 insertions, 122 deletions
diff --git a/base/base_cpudep.c b/base/base_cpudep.c
index 0db2e331..d51d011c 100644
--- a/base/base_cpudep.c
+++ b/base/base_cpudep.c
@@ -5,7 +5,7 @@ mm, alphabet soup...
Glenn Kennard <d98gk@efd.lth.se>
*/
-#include <fitz.h>
+#include "fitz-base.h"
/* global run-time constant */
unsigned fz_cpuflags = 0;
diff --git a/base/base_error.c b/base/base_error.c
index 926c48dc..e9823f14 100644
--- a/base/base_error.c
+++ b/base/base_error.c
@@ -1,4 +1,4 @@
-#include <fitz.h>
+#include "fitz-base.h"
void
fz_warn(char *fmt, ...)
diff --git a/base/base_hash.c b/base/base_hash.c
index 65bc7130..37351b48 100644
--- a/base/base_hash.c
+++ b/base/base_hash.c
@@ -9,7 +9,7 @@
* and removed frequently.
*/
-#include <fitz.h>
+#include "fitz-base.h"
enum { MAXKEYLEN = 16 };
diff --git a/base/base_matrix.c b/base/base_matrix.c
index e24196f9..054bb283 100644
--- a/base/base_matrix.c
+++ b/base/base_matrix.c
@@ -1,4 +1,4 @@
-#include <fitz.h>
+#include "fitz-base.h"
void fz_invert3x3(float *dst, float *m)
{
diff --git a/base/base_memory.c b/base/base_memory.c
index 48988dbc..64d5e383 100644
--- a/base/base_memory.c
+++ b/base/base_memory.c
@@ -1,4 +1,4 @@
-#include <fitz.h>
+#include "fitz-base.h"
/* Make this thread local storage if you wish. */
diff --git a/base/base_rect.c b/base/base_rect.c
index 18acb952..3c00cb94 100644
--- a/base/base_rect.c
+++ b/base/base_rect.c
@@ -1,4 +1,4 @@
-#include <fitz.h>
+#include "fitz-base.h"
fz_rect fz_infiniterect = { 1, 1, -1, -1 };
fz_rect fz_emptyrect = { 0, 0, 0, 0 };
diff --git a/include/fitz-base.h b/include/fitz-base.h
new file mode 100644
index 00000000..0f6e8ba6
--- /dev/null
+++ b/include/fitz-base.h
@@ -0,0 +1,12 @@
+#ifdef _FITZ_BASE_H_
+#error "fitz-base.h must only be included once"
+#endif
+#define _FITZ_BASE_H_
+
+#include "fitz/sysdep.h"
+#include "fitz/cpudep.h"
+#include "fitz/runtime.h"
+#include "fitz/math.h"
+#include "fitz/geometry.h"
+#include "fitz/hash.h"
+
diff --git a/include/fitz-draw.h b/include/fitz-draw.h
new file mode 100644
index 00000000..9f25fe44
--- /dev/null
+++ b/include/fitz-draw.h
@@ -0,0 +1,20 @@
+/*
+ * Rasterizer
+ */
+
+#ifdef _FITZ_DRAW_H_
+#error "fitz-draw.h must only be included once"
+#endif
+#define _FITZ_DRAW_H_
+
+#ifndef _FITZ_BASE_H_
+#error "fitz-base.h must be included before fitz-draw.h"
+#endif
+
+#ifndef _FITZ_WORLD_H_
+#error "fitz-world.h must be included before fitz-draw.h"
+#endif
+
+#include "fitz/pathscan.h"
+#include "fitz/render.h"
+
diff --git a/include/fitz-stream.h b/include/fitz-stream.h
new file mode 100644
index 00000000..47454ce5
--- /dev/null
+++ b/include/fitz-stream.h
@@ -0,0 +1,19 @@
+/*
+ * Streams and dynamic objects
+ */
+
+#ifdef _FITZ_STREAM_H_
+#error "fitz-stream.h must only be included once"
+#endif
+#define _FITZ_STREAM_H_
+
+#ifndef _FITZ_BASE_H_
+#error "fitz-base.h must be included before fitz-stream.h"
+#endif
+
+#include "fitz/crypt.h"
+#include "fitz/object.h"
+#include "fitz/buffer.h"
+#include "fitz/filter.h"
+#include "fitz/stream.h"
+
diff --git a/include/fitz-world.h b/include/fitz-world.h
new file mode 100644
index 00000000..86c9e5f1
--- /dev/null
+++ b/include/fitz-world.h
@@ -0,0 +1,24 @@
+/*
+ * The World -- fitz resources and trees
+ */
+
+#ifdef _FITZ_WORLD_H_
+#error "fitz-world.h must only be included once"
+#endif
+#define _FITZ_WORLD_H_
+
+#ifndef _FITZ_BASE_H_
+#error "fitz-base.h must be included before fitz-world.h"
+#endif
+
+#include "fitz/cmap.h"
+#include "fitz/font.h"
+#include "fitz/pixmap.h"
+#include "fitz/colorspace.h"
+#include "fitz/image.h"
+#include "fitz/shade.h"
+
+#include "fitz/tree.h"
+#include "fitz/path.h"
+#include "fitz/text.h"
+
diff --git a/include/fitz.h b/include/fitz.h
index 942219bb..47e7eeb8 100644
--- a/include/fitz.h
+++ b/include/fitz.h
@@ -3,45 +3,8 @@
#endif
#define _FITZ_H_
-/*
- * Base library
- */
-#include "fitz/sysdep.h"
-#include "fitz/cpudep.h"
-#include "fitz/base.h"
-#include "fitz/math.h"
-#include "fitz/geometry.h"
-#include "fitz/hash.h"
-
-/*
- * Streams and dynamic objects
- */
-#include "fitz/crypt.h"
-#include "fitz/object.h"
-#include "fitz/buffer.h"
-#include "fitz/filter.h"
-#include "fitz/stream.h"
-
-/*
- * Resources
- */
-#include "fitz/cmap.h"
-#include "fitz/font.h"
-#include "fitz/pixmap.h"
-#include "fitz/colorspace.h"
-#include "fitz/image.h"
-#include "fitz/shade.h"
-
-/*
- * Display tree
- */
-#include "fitz/tree.h"
-#include "fitz/path.h"
-#include "fitz/text.h"
-
-/*
- * Renderer
- */
-#include "fitz/pathscan.h"
-#include "fitz/render.h"
+#include "fitz-base.h"
+#include "fitz-stream.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
diff --git a/include/fitz/base.h b/include/fitz/runtime.h
index e52e3c1d..e52e3c1d 100644
--- a/include/fitz/base.h
+++ b/include/fitz/runtime.h
diff --git a/include/mupdf.h b/include/mupdf.h
index 94d47812..86b9a6c9 100644
--- a/include/mupdf.h
+++ b/include/mupdf.h
@@ -3,8 +3,16 @@
#endif
#define _MUPDF_H_
-#ifndef _FITZ_H_
-#error "fitz.h must be included before mupdf.h"
+#ifndef _FITZ_BASE_H_
+#error "fitz-base.h must be included before mupdf.h"
+#endif
+
+#ifndef _FITZ_STREAM_H_
+#error "fitz-stream.h must be included before mupdf.h"
+#endif
+
+#ifndef _FITZ_WORLD_H_
+#error "fitz-world.h must be included before mupdf.h"
#endif
void pdf_logxref(char *fmt, ...);
diff --git a/include/samus.h b/include/samus.h
index 8837267b..e9c841f7 100644
--- a/include/samus.h
+++ b/include/samus.h
@@ -3,8 +3,16 @@
#endif
#define _SAMUS_H_
-#ifndef _FITZ_H_
-#error "fitz.h must be included before samus.h"
+#ifndef _FITZ_BASE_H_
+#error "fitz-base.h must be included before mupdf.h"
+#endif
+
+#ifndef _FITZ_STREAM_H_
+#error "fitz-stream.h must be included before mupdf.h"
+#endif
+
+#ifndef _FITZ_WORLD_H_
+#error "fitz-world.h must be included before mupdf.h"
#endif
#include "samus/misc.h"
diff --git a/raster/archppc.c b/raster/archppc.c
index 2d0fee1d..30dbd780 100644
--- a/raster/archppc.c
+++ b/raster/archppc.c
@@ -2,7 +2,9 @@
* PowerPC specific render optims live here
*/
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
typedef unsigned char byte;
diff --git a/raster/archsparc.c b/raster/archsparc.c
index 32e142c3..b78e5a4d 100644
--- a/raster/archsparc.c
+++ b/raster/archsparc.c
@@ -1,7 +1,9 @@
/*
SPARC specific render optims live here
*/
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
#ifdef HAVE_VIS
diff --git a/raster/archx86.c b/raster/archx86.c
index a4161a1f..089edf02 100644
--- a/raster/archx86.c
+++ b/raster/archx86.c
@@ -2,7 +2,9 @@
* x86 specific render optims live here
*/
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
typedef unsigned char byte;
diff --git a/raster/glyphcache.c b/raster/glyphcache.c
index 6fc8bd52..b10b47bb 100644
--- a/raster/glyphcache.c
+++ b/raster/glyphcache.c
@@ -1,4 +1,6 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
typedef struct fz_hash_s fz_hash;
typedef struct fz_key_s fz_key;
diff --git a/raster/imagedraw.c b/raster/imagedraw.c
index 0654b006..0f51c01b 100644
--- a/raster/imagedraw.c
+++ b/raster/imagedraw.c
@@ -1,4 +1,6 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
typedef unsigned char byte;
diff --git a/raster/imagescale.c b/raster/imagescale.c
index ede19f1c..6d12086d 100644
--- a/raster/imagescale.c
+++ b/raster/imagescale.c
@@ -1,4 +1,6 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
typedef unsigned char byte;
diff --git a/raster/imageunpack.c b/raster/imageunpack.c
index 0885c293..b650b0f2 100644
--- a/raster/imageunpack.c
+++ b/raster/imageunpack.c
@@ -1,4 +1,6 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
typedef unsigned char byte;
diff --git a/raster/meshdraw.c b/raster/meshdraw.c
index f5b1a3fb..c0d798e6 100644
--- a/raster/meshdraw.c
+++ b/raster/meshdraw.c
@@ -1,4 +1,6 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
/*
* polygon clipping
diff --git a/raster/pathfill.c b/raster/pathfill.c
index d25f78b1..e361b9a5 100644
--- a/raster/pathfill.c
+++ b/raster/pathfill.c
@@ -1,4 +1,6 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
static fz_error *
line(fz_gel *gel, fz_matrix *ctm, float x0, float y0, float x1, float y1)
diff --git a/raster/pathscan.c b/raster/pathscan.c
index cea3a849..455b04f1 100644
--- a/raster/pathscan.c
+++ b/raster/pathscan.c
@@ -1,4 +1,6 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
/*
* Global Edge List -- list of straight path segments for scan conversion
diff --git a/raster/pathstroke.c b/raster/pathstroke.c
index 2527e6ad..b7b76f9f 100644
--- a/raster/pathstroke.c
+++ b/raster/pathstroke.c
@@ -1,4 +1,6 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
enum { BUTT = 0, ROUND = 1, SQUARE = 2, MITER = 0, BEVEL = 2 };
diff --git a/raster/pixmap.c b/raster/pixmap.c
index 8f34ebcd..74e2f59a 100644
--- a/raster/pixmap.c
+++ b/raster/pixmap.c
@@ -1,4 +1,6 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
fz_error *
fz_newpixmap(fz_pixmap **pixp, int x, int y, int w, int h, int n)
diff --git a/raster/porterduff.c b/raster/porterduff.c
index 9cd99dbb..ab974151 100644
--- a/raster/porterduff.c
+++ b/raster/porterduff.c
@@ -1,4 +1,6 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
typedef unsigned char byte;
diff --git a/raster/render.c b/raster/render.c
index cf69e942..36a9ed97 100644
--- a/raster/render.c
+++ b/raster/render.c
@@ -1,4 +1,6 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
+#include "fitz-draw.h"
#define noDEBUG(args...) printf(args)
#ifndef DEBUG
diff --git a/stream/crypt_arc4.c b/stream/crypt_arc4.c
index 86c9afd8..0a5c942f 100644
--- a/stream/crypt_arc4.c
+++ b/stream/crypt_arc4.c
@@ -21,7 +21,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
void
fz_arc4init(fz_arc4 *arc4, unsigned char *key, unsigned keylen)
diff --git a/stream/crypt_md5.c b/stream/crypt_md5.c
index 03601e5b..cf20024b 100644
--- a/stream/crypt_md5.c
+++ b/stream/crypt_md5.c
@@ -23,7 +23,8 @@ These notices must be retained in any copies of any part of this
documentation and/or software.
*/
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
/* Constants for MD5Transform routine */
enum
diff --git a/stream/filt_a85d.c b/stream/filt_a85d.c
index 5b2e105e..3db4951a 100644
--- a/stream/filt_a85d.c
+++ b/stream/filt_a85d.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
typedef struct fz_a85d_s fz_a85d;
diff --git a/stream/filt_a85e.c b/stream/filt_a85e.c
index d9cd22c6..357bd4de 100644
--- a/stream/filt_a85e.c
+++ b/stream/filt_a85e.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
typedef struct fz_a85e_s fz_a85e;
diff --git a/stream/filt_ahxd.c b/stream/filt_ahxd.c
index d0e6d7f5..f54670b2 100644
--- a/stream/filt_ahxd.c
+++ b/stream/filt_ahxd.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
typedef struct fz_ahxd_s fz_ahxd;
diff --git a/stream/filt_ahxe.c b/stream/filt_ahxe.c
index c2b882a6..12c8aad0 100644
--- a/stream/filt_ahxe.c
+++ b/stream/filt_ahxe.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
typedef struct fz_ahxe_s fz_ahxe;
diff --git a/stream/filt_arc4.c b/stream/filt_arc4.c
index b025368c..3b3c5957 100644
--- a/stream/filt_arc4.c
+++ b/stream/filt_arc4.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
typedef struct fz_arc4c_s fz_arc4c;
diff --git a/stream/filt_dctd.c b/stream/filt_dctd.c
index ebdf2f65..38ab3fbf 100644
--- a/stream/filt_dctd.c
+++ b/stream/filt_dctd.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
#include "filt_dctc.h"
diff --git a/stream/filt_dcte.c b/stream/filt_dcte.c
index 74f6bbd3..06f3fcbe 100644
--- a/stream/filt_dcte.c
+++ b/stream/filt_dcte.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
#include "filt_dctc.h"
diff --git a/stream/filt_faxd.c b/stream/filt_faxd.c
index 19db9cb1..45f9d556 100644
--- a/stream/filt_faxd.c
+++ b/stream/filt_faxd.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
#include "filt_faxd.h"
#include "filt_faxc.h"
diff --git a/stream/filt_faxe.c b/stream/filt_faxe.c
index c9155e01..97c16c0d 100644
--- a/stream/filt_faxe.c
+++ b/stream/filt_faxe.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
#include "filt_faxe.h"
#include "filt_faxc.h"
diff --git a/stream/filt_flate.c b/stream/filt_flate.c
index 777d6d56..00310172 100644
--- a/stream/filt_flate.c
+++ b/stream/filt_flate.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
#include <zlib.h>
diff --git a/stream/filt_jbig2d.c b/stream/filt_jbig2d.c
index ed54eed3..ce73ee53 100644
--- a/stream/filt_jbig2d.c
+++ b/stream/filt_jbig2d.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
/* TODO: complete rewrite with error checking and use fitz memctx */
diff --git a/stream/filt_jpxd.c b/stream/filt_jpxd.c
index 2aa93448..1b93f477 100644
--- a/stream/filt_jpxd.c
+++ b/stream/filt_jpxd.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
/* TODO: bpc */
diff --git a/stream/filt_lzwd.c b/stream/filt_lzwd.c
index 95fc462a..bbdb4984 100644
--- a/stream/filt_lzwd.c
+++ b/stream/filt_lzwd.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
/* TODO: error checking */
diff --git a/stream/filt_lzwe.c b/stream/filt_lzwe.c
index f2c3c7a4..a24d8fe5 100644
--- a/stream/filt_lzwe.c
+++ b/stream/filt_lzwe.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
#define noDEBUG 1
diff --git a/stream/filt_null.c b/stream/filt_null.c
index e83b6d5a..d2c068e9 100644
--- a/stream/filt_null.c
+++ b/stream/filt_null.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
typedef struct fz_nullfilter_s fz_nullfilter;
diff --git a/stream/filt_pipeline.c b/stream/filt_pipeline.c
index 7b7f4252..65e1c38d 100644
--- a/stream/filt_pipeline.c
+++ b/stream/filt_pipeline.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
#define noDEBUG 1
diff --git a/stream/filt_predict.c b/stream/filt_predict.c
index f3c50f6e..bf4680e7 100644
--- a/stream/filt_predict.c
+++ b/stream/filt_predict.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
/* TODO: check if this works with 16bpp images */
diff --git a/stream/filt_rld.c b/stream/filt_rld.c
index c36913d6..dc720fbd 100644
--- a/stream/filt_rld.c
+++ b/stream/filt_rld.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
fz_error *
fz_newrld(fz_filter **fp, fz_obj *params)
diff --git a/stream/filt_rle.c b/stream/filt_rle.c
index 921e470a..598733e1 100644
--- a/stream/filt_rle.c
+++ b/stream/filt_rle.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
/* TODO: rewrite!
* make it non-optimal or something,
diff --git a/stream/obj_array.c b/stream/obj_array.c
index c493bdaa..666e113a 100644
--- a/stream/obj_array.c
+++ b/stream/obj_array.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
void fz_droparray(fz_obj *obj);
diff --git a/stream/obj_dict.c b/stream/obj_dict.c
index a0fb6d25..2eef56b5 100644
--- a/stream/obj_dict.c
+++ b/stream/obj_dict.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
/* keep either names or strings in the dict. don't mix & match. */
diff --git a/stream/obj_parse.c b/stream/obj_parse.c
index c3f3d3dc..bd8133a2 100644
--- a/stream/obj_parse.c
+++ b/stream/obj_parse.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
struct vap { va_list ap; };
diff --git a/stream/obj_print.c b/stream/obj_print.c
index 7ada9845..e58462b3 100644
--- a/stream/obj_print.c
+++ b/stream/obj_print.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
struct fmt
{
diff --git a/stream/obj_simple.c b/stream/obj_simple.c
index 131e11b4..c674f056 100644
--- a/stream/obj_simple.c
+++ b/stream/obj_simple.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
extern void fz_droparray(fz_obj *array);
extern void fz_dropdict(fz_obj *dict);
diff --git a/stream/stm_buffer.c b/stream/stm_buffer.c
index 7d58e192..4fc5636c 100644
--- a/stream/stm_buffer.c
+++ b/stream/stm_buffer.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
fz_error *
fz_newbuffer(fz_buffer **bp, int size)
diff --git a/stream/stm_filter.c b/stream/stm_filter.c
index afe4feed..c8091136 100644
--- a/stream/stm_filter.c
+++ b/stream/stm_filter.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-stream.h"
fz_error fz_kioneedin = { -1, "<ioneedin>", "<process>", "filter.c", 0 };
fz_error fz_kioneedout = { -1, "<ioneedout>", "<process>", "filter.c", 0 };
diff --git a/stream/stm_misc.c b/stream/stm_misc.c
index 010676fd..bc739055 100644
--- a/stream/stm_misc.c
+++ b/stream/stm_misc.c
@@ -2,7 +2,8 @@
* Miscellaneous I/O functions
*/
-#include "fitz.h"
+#include "fitz-base.h"
+#include "fitz-stream.h"
int fz_tell(fz_stream *stm)
{
diff --git a/stream/stm_open.c b/stream/stm_open.c
index d72d9837..baec93fa 100644
--- a/stream/stm_open.c
+++ b/stream/stm_open.c
@@ -2,7 +2,8 @@
* Creation and destruction.
*/
-#include "fitz.h"
+#include "fitz-base.h"
+#include "fitz-stream.h"
static fz_stream *
newstm(int kind, int mode)
diff --git a/stream/stm_read.c b/stream/stm_read.c
index cb7c5c02..484414c5 100644
--- a/stream/stm_read.c
+++ b/stream/stm_read.c
@@ -2,7 +2,8 @@
* Input streams.
*/
-#include "fitz.h"
+#include "fitz-base.h"
+#include "fitz-stream.h"
int
fz_makedata(fz_stream *stm)
diff --git a/stream/stm_write.c b/stream/stm_write.c
index 3b4a8baf..e0dad571 100644
--- a/stream/stm_write.c
+++ b/stream/stm_write.c
@@ -2,7 +2,8 @@
* Output streams.
*/
-#include "fitz.h"
+#include "fitz-base.h"
+#include "fitz-stream.h"
int fz_wtell(fz_stream *stm)
{
diff --git a/world/node_misc1.c b/world/node_misc1.c
index c2d6e876..7ddd9167 100644
--- a/world/node_misc1.c
+++ b/world/node_misc1.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
void fz_dropmetanode(fz_metanode* node);
void fz_droplinknode(fz_linknode* node);
diff --git a/world/node_misc2.c b/world/node_misc2.c
index 5382273e..8abcd4a5 100644
--- a/world/node_misc2.c
+++ b/world/node_misc2.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
/*
* Over
@@ -175,9 +176,9 @@ fz_newmetanode(fz_node **nodep, void *name, void *dict)
node->dict = nil;
if (name)
- node->name = fz_keepobj(name);
+ node->name = name;
if (dict)
- node->dict = fz_keepobj(dict);
+ node->dict = dict;
return nil;
}
@@ -186,9 +187,9 @@ void
fz_dropmetanode(fz_metanode *node)
{
if (node->name)
- fz_dropobj(node->name);
+ fz_warn("leaking meta node name");
if (node->dict)
- fz_dropobj(node->dict);
+ fz_warn("leaking meta node dict");
}
fz_rect
diff --git a/world/node_optimize.c b/world/node_optimize.c
index 80a43293..49893aeb 100644
--- a/world/node_optimize.c
+++ b/world/node_optimize.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
/*
* Remove (mask ... white) until we get something not white
diff --git a/world/node_path.c b/world/node_path.c
index 5f4b4425..b64d0742 100644
--- a/world/node_path.c
+++ b/world/node_path.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
fz_error *
fz_newpathnode(fz_pathnode **pathp)
diff --git a/world/node_text.c b/world/node_text.c
index 49cdb576..c6f19e29 100644
--- a/world/node_text.c
+++ b/world/node_text.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
fz_error *
fz_newtextnode(fz_textnode **textp, fz_font *font)
diff --git a/world/node_tolisp.c b/world/node_tolisp.c
index b03d4e28..a02c0261 100644
--- a/world/node_tolisp.c
+++ b/world/node_tolisp.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
static void indent(int level)
{
diff --git a/world/node_toxml.c b/world/node_toxml.c
index 04a00423..2099c6a8 100644
--- a/world/node_toxml.c
+++ b/world/node_toxml.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
static void indent(int level)
{
@@ -13,14 +14,7 @@ static void xmlmeta(fz_metanode *node, int level)
fz_node *child;
indent(level);
- printf("<meta");
- if (node->name)
- {
- printf(" name=\"");
- fz_debugobj(node->name);
- printf("\" ");
- }
- printf(">\n");
+ printf("<meta>\n");
for (child = node->super.first; child; child = child->next)
xmlnode(child, level + 1);
diff --git a/world/node_tree.c b/world/node_tree.c
index f6874711..32d3a635 100644
--- a/world/node_tree.c
+++ b/world/node_tree.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
fz_error *
fz_newtree(fz_tree **treep)
diff --git a/world/res_cmap.c b/world/res_cmap.c
index 577ba7c0..bc2b4249 100644
--- a/world/res_cmap.c
+++ b/world/res_cmap.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
typedef struct fz_range_s fz_range;
diff --git a/world/res_colorspace.c b/world/res_colorspace.c
index 65909bfe..adbab733 100644
--- a/world/res_colorspace.c
+++ b/world/res_colorspace.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
void
fz_convertpixmap(fz_colorspace *srcs, fz_pixmap *src, fz_colorspace *dsts, fz_pixmap *dst)
diff --git a/world/res_font.c b/world/res_font.c
index 3875a0c7..d27d5bb4 100644
--- a/world/res_font.c
+++ b/world/res_font.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
void
fz_initfont(fz_font *font, char *name)
diff --git a/world/res_image.c b/world/res_image.c
index dbeb1fd8..2d172669 100644
--- a/world/res_image.c
+++ b/world/res_image.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
fz_image *
fz_keepimage(fz_image *image)
diff --git a/world/res_shade.c b/world/res_shade.c
index 67a64e4e..4bfc5831 100644
--- a/world/res_shade.c
+++ b/world/res_shade.c
@@ -1,4 +1,5 @@
-#include <fitz.h>
+#include "fitz-base.h"
+#include "fitz-world.h"
fz_shade *
fz_keepshade(fz_shade *shade)