diff --git a/doc/reference/libvips-docs.sgml.in b/doc/reference/libvips-docs.sgml.in
index 8077d935..74fe29b4 100644
--- a/doc/reference/libvips-docs.sgml.in
+++ b/doc/reference/libvips-docs.sgml.in
@@ -18,6 +18,7 @@
Core VIPS API
+
diff --git a/libvips/include/vips/Makefile.am b/libvips/include/vips/Makefile.am
index 769133a8..84111558 100644
--- a/libvips/include/vips/Makefile.am
+++ b/libvips/include/vips/Makefile.am
@@ -6,6 +6,7 @@ pkginclude_HEADERS = \
debug.h \
dispatch.h \
format.h \
+ header.h \
fmask.h \
mosaic.h \
interpolate.h \
diff --git a/libvips/include/vips/header.h b/libvips/include/vips/header.h
new file mode 100644
index 00000000..9f6bf232
--- /dev/null
+++ b/libvips/include/vips/header.h
@@ -0,0 +1,52 @@
+/* boolean.h
+ *
+ * 20/9/09
+ * - from proto.h
+ */
+
+/*
+
+ This file is part of VIPS.
+
+ VIPS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ */
+
+/*
+
+ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
+
+ */
+
+#ifndef IM_HEADER_H
+#define IM_HEADER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus*/
+
+int im_header_int( IMAGE *im, const char *field, int *out );
+int im_header_double( IMAGE *im, const char *field, double *out );
+int im_header_string( IMAGE *im, const char *field, char **out );
+GType im_header_get_typeof( IMAGE *im, const char *field );
+int im_header_get( IMAGE *im, const char *field, GValue *value_copy );
+typedef void *(*im_header_map_fn)( IMAGE *, const char *, GValue *, void * );
+void *im_header_map( IMAGE *im, im_header_map_fn fn, void *a );
+
+#ifdef __cplusplus
+}
+#endif /*__cplusplus*/
+
+#endif /*IM_HEADER_H*/
diff --git a/libvips/include/vips/proto.h b/libvips/include/vips/proto.h
index 8c38e8bc..1a03fb67 100644
--- a/libvips/include/vips/proto.h
+++ b/libvips/include/vips/proto.h
@@ -76,14 +76,6 @@ void im_progress_set( int progress );
int im_debugim( IMAGE * );
int im_printlines( IMAGE * );
-int im_header_int( IMAGE *im, const char *field, int *out );
-int im_header_double( IMAGE *im, const char *field, double *out );
-int im_header_string( IMAGE *im, const char *field, char **out );
-GType im_header_get_typeof( IMAGE *im, const char *field );
-int im_header_get( IMAGE *im, const char *field, GValue *value_copy );
-typedef void *(*im_header_map_fn)( IMAGE *, const char *, GValue *, void * );
-void *im_header_map( IMAGE *im, im_header_map_fn fn, void *a );
-
const char *im_version_string( void );
int im_version( int flag );
const char *im_guess_prefix( const char *, const char * );
diff --git a/libvips/include/vips/vips.h b/libvips/include/vips/vips.h
index 6942c05c..315e9bfb 100644
--- a/libvips/include/vips/vips.h
+++ b/libvips/include/vips/vips.h
@@ -133,7 +133,9 @@ typedef struct im__DOUBLEMASK {
#include
#include
#include
+
#include
+#include
#include
#include
diff --git a/libvips/iofuncs/Makefile.am b/libvips/iofuncs/Makefile.am
index fb50f151..9c3cbf7e 100644
--- a/libvips/iofuncs/Makefile.am
+++ b/libvips/iofuncs/Makefile.am
@@ -17,7 +17,6 @@ libiofuncs_la_SOURCES = \
im_debugim.c \
im_demand_hint.c \
im_generate.c \
- im_header.c \
im_histlin.c \
im_image.c \
im_init.c \
@@ -47,6 +46,7 @@ libiofuncs_la_SOURCES = \
memory.c \
package.c \
predicate.c \
+ header.c \
region.c \
rect.c \
semaphore.c \
diff --git a/libvips/iofuncs/im_header.c b/libvips/iofuncs/header.c
similarity index 95%
rename from libvips/iofuncs/im_header.c
rename to libvips/iofuncs/header.c
index e6a9ac2f..4f76a303 100644
--- a/libvips/iofuncs/im_header.c
+++ b/libvips/iofuncs/header.c
@@ -15,6 +15,9 @@
* 29/8/09
* - im_header_get_type() renamed as im_header_get_typeof() to prevent
* confusion with GObject-style type definers
+ * 1/10/09
+ * - rename as header.c
+ * - gtkdoc comments
*/
/*
@@ -59,6 +62,17 @@
#include
#endif /*WITH_DMALLOC*/
+/**
+ * SECTION: header
+ * @short_description: get, set and walk image headers
+ * @stability: Stable
+ * @see_also: meta
+ * @include: vips/vips.h
+ *
+ * These functions let you get at image header data (including metadata) in a
+ * uniform way.
+ */
+
/* Name, offset pair.
*/
typedef struct _HeaderField {