- add_address_addr (address, address_type);
- add_address_addr (address, "email");
+ add_term_address_addr (doc, address, address_type);
+ add_term_address_addr (doc, address, "email");
+ }
+}
+
+/* Generate terms for the body of a message, given the filename of the
+ * message and the offset at which the headers of the message end,
+ * (and hence the body begins). */
+static void
+gen_terms_body (Xapian::TermGenerator term_gen,
+ const char * filename,
+ gint64 body_offset)
+{
+ GIOChannel *channel;
+ GIOStatus gio_status;
+ GError *error = NULL;
+ char *body_str;
+
+ channel = g_io_channel_new_file (filename, "r", &error);
+ if (channel == NULL) {
+ fprintf (stderr, "Error: %s\n", error->message);
+ exit (1);
+ }
+
+ gio_status = g_io_channel_seek_position (channel, body_offset,
+ G_SEEK_SET, &error);
+ if (gio_status != G_IO_STATUS_NORMAL) {
+ fprintf (stderr, "Error: %s\n", error->message);
+ exit (1);