/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

#include "camel.h"
#include "camel-mbox-folder.h"
#include "camel-mbox-parser.h"
#include "camel-mbox-utils.h"
#include "camel-mbox-summary.h"
#include "camel-exception.h"
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <string.h> 
#include <sys/stat.h>
#include <fcntl.h>
#include <glib.h>

int
main (int argc, char**argv)
{
	GArray *message_info_array;
	gint test_file_fd;
	CamelException *ex;
	CamelMboxSummary *sum1, *sum2;
	GArray *mbox_summary_info;
	CamelMboxSummaryInformation *msg_info;
	int i;
	guint32 next_uid;
	guint32 mbox_file_size;

	gtk_init (&argc, &argv);
	camel_init ();	
	
	ex = camel_exception_new ();
	test_file_fd = open (argv[1], O_RDONLY);
	message_info_array = camel_mbox_parse_file (test_file_fd, 
						    "From ", 
						    0,
						    &mbox_file_size,
						    &next_uid,
						    TRUE,
						    NULL,
						    0,
						    ex); 
	
	close (test_file_fd);
#warning This test is no longer valid.
#if 0
	/* needs a folder to work with (indexing) */
	camel_mbox_write_xev (argv[1], message_info_array, &mbox_file_size, 1, ex);
#endif
	if (camel_exception_get_id (ex)) { 
		printf ("Exception caught in camel_mbox_write_xev : %s\n", camel_exception_get_description (ex));
	}
	
	
	mbox_summary_info =
		parsed_information_to_mbox_summary (message_info_array);
	sum1 = CAMEL_MBOX_SUMMARY (gtk_object_new (camel_mbox_summary_get_type (), NULL));

	sum1->nb_message = mbox_summary_info->len;

	sum1->message_info = mbox_summary_info;

	camel_mbox_summary_save (sum1, "ev-summary.mbox", ex);

	sum2 = camel_mbox_summary_load ("ev-summary.mbox", ex);

	for (i=0; i<sum1->nb_message; i++) {
		
		msg_info = (CamelMboxSummaryInformation *)(sum1->message_info->data) + i;
		printf ("Message %d :\n"
			"  From : %s\n", i, msg_info->headers.sender);
	}

	return 1;
	
}



el/electron4/files/ini-1.3.7</option>
<option value='dependabot/npm_and_yarn/devel/electron4/files/lodash-4.17.19'>dependabot/npm_and_yarn/devel/electron4/files/lodash-4.17.19</option>
<option value='dependabot/npm_and_yarn/devel/electron4/files/lodash.merge-4.6.2'>dependabot/npm_and_yarn/devel/electron4/files/lodash.merge-4.6.2</option>
<option value='dependabot/npm_and_yarn/devel/electron4/files/minimist-1.2.2'>dependabot/npm_and_yarn/devel/electron4/files/minimist-1.2.2</option>
<option value='dependabot/npm_and_yarn/devel/electron4/files/minimist-1.2.3'>dependabot/npm_and_yarn/devel/electron4/files/minimist-1.2.3</option>
<option value='dependabot/npm_and_yarn/devel/electron4/files/node-fetch-2.6.1'>dependabot/npm_and_yarn/devel/electron4/files/node-fetch-2.6.1</option>
<option value='dependabot/npm_and_yarn/devel/electron4/files/serve-10.1.2'>dependabot/npm_and_yarn/devel/electron4/files/serve-10.1.2</option>
<option value='dependabot/npm_and_yarn/devel/electron4/files/y18n-3.2.2'>dependabot/npm_and_yarn/devel/electron4/files/y18n-3.2.2</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/elliptic-6.5.3'>dependabot/npm_and_yarn/devel/electron6/files/elliptic-6.5.3</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/elliptic-6.5.4'>dependabot/npm_and_yarn/devel/electron6/files/elliptic-6.5.4</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/ini-1.3.8'>dependabot/npm_and_yarn/devel/electron6/files/ini-1.3.8</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/lodash-4.17.19'>dependabot/npm_and_yarn/devel/electron6/files/lodash-4.17.19</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/lodash.merge-4.6.2'>dependabot/npm_and_yarn/devel/electron6/files/lodash.merge-4.6.2</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/node-fetch-2.6.1'>dependabot/npm_and_yarn/devel/electron6/files/node-fetch-2.6.1</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/serve-10.1.2'>dependabot/npm_and_yarn/devel/electron6/files/serve-10.1.2</option>
<option value='gnome-3.22'>gnome-3.22</option>
<option value='gnome-3.24'>gnome-3.24</option>
<option value='gnome-3.26'>gnome-3.26</option>
<option value='gnome-3.28'>gnome-3.28</option>
<option value='gnome-3.32'>gnome-3.32</option>
<option value='gnome-3.36'>gnome-3.36</option>
<option value='gstreamer'>gstreamer</option>
<option value='gstreamer-1.16'>gstreamer-1.16</option>
<option value='gstreamer0.10-removal'>gstreamer0.10-removal</option>
<option value='main'>main</option>
<option value='master'>master</option>
<option value='mate-1.16' selected='selected'>mate-1.16</option>
<option value='mate-1.18'>mate-1.18</option>
<option value='mate-1.20'>mate-1.20</option>
<option value='mate-1.22'>mate-1.22</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)</td><td class='sub right'></td></tr></table>
<table class='tabs'><tr><td>
<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/about/?h=mate-1.16'>about</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/?h=mate-1.16'>summary</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/refs/?h=mate-1.16'>refs</a><a class='active' href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/x11/ebuttons?h=mate-1.16'>log</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/tree/x11/ebuttons?h=mate-1.16'>tree</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/x11/ebuttons?h=mate-1.16'>commit</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/diff/x11/ebuttons?h=mate-1.16'>diff</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/stats/x11/ebuttons?h=mate-1.16'>stats</a></td><td class='form'><form class='right' method='get' action='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/x11/ebuttons'>
<input type='hidden' name='h' value='mate-1.16'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/?h=mate-1.16'>root</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/x11?h=mate-1.16'>x11</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/x11/ebuttons?h=mate-1.16'>ebuttons</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th></th><th class='left'>Commit message (<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/x11/ebuttons?h=mate-1.16&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Age</th><th class='left'>Files</th><th class='left'>Lines</th></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/x11/ebuttons?h=mate-1.16&amp;id=882cd6e6c77bb5534b985f1a86581c949309abe6'>- Remove three deprecated ports of mine</a></td><td>gahr</td><td><span title='2011-09-05 17:46:11 +0800'>2011-09-05</span>