aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test11.c
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-03-28 06:48:24 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-03-28 06:48:24 +0800
commit767c63615d6229c42ea90503f3888aebf38519ae (patch)
treee911f4ecce4fd1b9e96451f6f640d90ea192bea0 /tests/test11.c
parent3ec585e1b510620a718d672ac682f2b467fe43c2 (diff)
downloadgsoc2013-evolution-767c63615d6229c42ea90503f3888aebf38519ae.tar.gz
gsoc2013-evolution-767c63615d6229c42ea90503f3888aebf38519ae.tar.zst
gsoc2013-evolution-767c63615d6229c42ea90503f3888aebf38519ae.zip
This test is basically now invalid.
2000-03-27 NotZed <NotZed@HelixCode.com> * tests/test9.c (main): This test is basically now invalid. * tests/test11.c (main): Fix for async search api. Probably works. Removed camel-mbox-*.h headers, should be private. svn path=/trunk/; revision=2200
Diffstat (limited to 'tests/test11.c')
-rw-r--r--tests/test11.c94
1 files changed, 53 insertions, 41 deletions
diff --git a/tests/test11.c b/tests/test11.c
index 443f49e788..387c9a6904 100644
--- a/tests/test11.c
+++ b/tests/test11.c
@@ -6,10 +6,6 @@
#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-log.h"
#include "camel-exception.h"
#include "camel-folder-summary.h"
@@ -31,6 +27,45 @@ auth_callback(char *prompt, gboolean secret,
return NULL;
}
+struct search_data {
+ CamelFolder *folder;
+ CamelFolder *outbox;
+ CamelException *ex;
+};
+
+static void
+search_cb(CamelFolder *folder, int id, gboolean complete, GList *matches, struct search_data *sd)
+{
+ GList *n;
+ printf("search found matches:\n");
+ n = matches;
+ while (n) {
+ CamelMimeMessage *m;
+
+ printf("uid: %s\n", (char *) n->data);
+ m = camel_folder_get_message_by_uid(sd->folder, n->data, sd->ex);
+
+ if (camel_exception_get_id (sd->ex)) {
+ printf ("Cannot get message\n"
+ "Full description : %s\n", camel_exception_get_description (sd->ex));
+ }
+
+ camel_folder_append_message(sd->outbox, m, sd->ex);
+
+ if (camel_exception_get_id (sd->ex)) {
+ printf ("Cannot save message\n"
+ "Full description : %s\n", camel_exception_get_description (sd->ex));
+ }
+
+ n = g_list_next(n);
+ }
+
+ if (complete) {
+ camel_folder_close (sd->folder, FALSE, sd->ex);
+ gtk_exit(0);
+ }
+}
+
int
main (int argc, char**argv)
{
@@ -43,12 +78,16 @@ main (int argc, char**argv)
GList *uid_list;
int camel_debug_level = 10;
GList *matches;
+ struct search_data *sd;
gtk_init (&argc, &argv);
camel_init ();
ex = camel_exception_new ();
camel_provider_register_as_module ("../camel/providers/mbox/.libs/libcamelmbox.so.0");
-
+
+ sd = g_malloc0(sizeof(*sd));
+ sd->ex = ex;
+
session = camel_session_new (auth_callback);
store = camel_session_get_store (session, store_url, ex);
if (camel_exception_get_id (ex)) {
@@ -83,45 +122,18 @@ main (int argc, char**argv)
camel_folder_open (outbox, FOLDER_OPEN_WRITE, ex);
- printf("Search for messages\n");
-
-#warning "track api change here"
- matches = camel_folder_search_by_expression (folder,
- "(match-all (header-contains \"subject\" \"gnome\"))",
- /* func */ NULL,
- /* data */ NULL,
- ex);
-
- if (matches) {
- GList *n;
- printf("search found matches:\n");
- n = matches;
- while (n) {
- CamelMimeMessage *m;
+ sd->folder = folder;
+ sd->outbox = outbox;
- printf("uid: %s\n", (char *) n->data);
- m = camel_folder_get_message_by_uid(folder, n->data, ex);
-
- if (camel_exception_get_id (ex)) {
- printf ("Cannot get message\n"
- "Full description : %s\n", camel_exception_get_description (ex));
- }
-
- camel_folder_append_message(outbox, m, ex);
-
- if (camel_exception_get_id (ex)) {
- printf ("Cannot save message\n"
- "Full description : %s\n", camel_exception_get_description (ex));
- }
+ printf("Search for messages\n");
- n = g_list_next(n);
- }
-
- } else {
- printf("no matches?\n");
- }
+ camel_folder_search_by_expression (folder,
+ "(match-all (header-contains \"subject\" \"gnome\"))",
+ search_cb,
+ sd,
+ ex);
- camel_folder_close (folder, FALSE, ex);
+ gtk_main();
return 0;
}
='deletions'>-4/+1 * Fix properties on pkg-plistbapt2014-01-221-1/+0 * - Remove manual creation and removal of share/applications, as it's now in th...amdmi32013-10-221-1/+0 * Add NO_STAGE all over the place in preparation for the staging support (cat: ...bapt2013-09-211-0/+1 * Remove support for the non-default KDE3 option.rene2013-07-021-9/+1 * - adoption of USES framwork for gettext and pathfixjgh2013-05-061-2/+2 * Convert USE_FUSE macros into USES feature.bapt2013-03-071-1/+1 * Bump PORTREVISION after DESKTOP_ENTRIES updatemakc2013-01-231-1/+1 * - Update DESKTOP_ENTRIES:makc2013-01-071-7/+2 * - introduce a USE_FUSE macroflo2012-12-141-2/+1 * - update png to 1.5.10dinoex2012-06-011-3/+3 * Fix multiple options testing in one linebapt2012-06-011-1/+1 * Convert to new options frameworkbapt2012-05-312-26/+23 * Remove more tags from pkg-descr files fo the form:dougb2011-10-241-3/+0 * - Add LDFLAGS to CONFIGURE_ENV and MAKE_ENV (as it was done with LDFLAGS)amdmi32011-09-241-1/+1 * - Fix compiz-manager script to work with Nvidia graphics card.stephen2011-07-123-6/+6 * - Reassign to the heaptabthorpe2011-07-051-1/+1 * - Get Rid MD5 supportmiwi2011-03-201-1/+0 * Fix gtk-window-decorator with gtk+ 2.22. GdkDrawable got deprecated in favorkwm2010-12-052-9/+181 * Sync to new bsd.autotools.mkade2010-12-041-1/+1 * Presenting GNOME 2.32.1 for FreeBSD. The offical release notes for thiskwm2010-11-202-3/+53 * Bounce PORTREVISION for gettext-related ports. Have fun, ya'll.ade2010-05-311-1/+1 * Presenting GNOME 2.30.1 for FreeBSD. The offical release notes for thiskwm2010-05-112-1/+12 * - fix build for png-1.4.1dinoex2010-04-041-7/+13 * - add missing delependencydinoex2010-04-031-0/+1 * - fix build for png-1.4.1dinoex2010-04-031-0/+23 * - fix build for png-1.4.1dinoex2010-03-291-1/+1 * - update to 1.4.1dinoex2010-03-281-2/+2 * - update to jpeg-8dinoex2010-02-051-0/+1 * Update to 0.8.4rnoland2009-12-022-5/+5 * Presenting GNOME 2.28.1 for FreeBSD. The official release notes for thismarcus2009-11-291-2/+3 * -Repocopy devel/libtool15 -> libtool22 and libltdl15 -> libltdl22.mezz2009-08-031-1/+1 * - bump all port that indirectly depends on libjpeg and have not yet been bump...dinoex2009-07-311-0/+1 * Update to 0.8.2rnoland2009-04-085-8/+448 * Remove the dynamic test for xcb support, since it is default now.rnoland2009-01-252-48/+1 * Update to 0.7.8rnoland2008-10-014-12/+66 * Update CONFIGURE_ARGS for how we pass CONFIGURE_TARGET to configure script.rafan2008-08-211-1/+0 * Update my email address to my @FreeBSD.org address.rnoland2008-07-311-1/+1 * Bump portrevision due to upgrade of devel/gettext.edwin2008-06-061-0/+1 * - Remove unneeded dependency from gtk12/gtk20 [1]miwi2008-04-201-2/+2 * Pass maintainership back to rnoland - he's back online.wxs2008-03-241-1/+1 * Reset maintainer due to bouncing mails.wxs2008-03-211-1/+1 * Update compiz to 0.6.2.flz2007-10-303-116/+118 * - Fix the run depends syntaxpav2007-10-261-2/+3 * - Fix the plist.mezz2007-10-262-4/+9 * Add textproc/libxslt to the dependencies.stefan2007-09-301-1/+1 * Update x11-wm/compiz to 0.5.2.flz2007-08-223-11/+84