/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* Test vfolder. */ #include #include #include #include #include #include #include #include #include #include #include #include static void dump_message_content(CamelDataWrapper *object) { CamelDataWrapper *containee; CamelStream *stream; int parts, i; int len; int left; char buffer[128]; printf("Dumping message ..."); containee = camel_medium_get_content_object(CAMEL_MEDIUM(object)); if (containee) { char *type = gmime_content_field_get_mime_type(containee->mime_type); printf("type = %s\n", type); if (CAMEL_IS_MULTIPART(containee)) { parts = camel_multipart_get_number (CAMEL_MULTIPART(containee)); printf("multipart message, scanning contents %d parts ...\n", parts); for (i=0;i 0) { fwrite(buffer, len, 1, stdout); } printf("\n"); } else { g_warning("cannot get stream for message?"); } } g_free(type); } else { printf("no containee?\n"); } } static char * auth_callback(char *prompt, gboolean secret, CamelService *service, char *item, CamelException *ex) { printf ("auth_callback called: %s\n", prompt); return NULL; } int main (int argc, char**argv) { CamelSession *session; CamelException *ex; CamelStore *store; gchar *store_url = "vfolder:"; CamelFolder *folder; GList *n, *matches; gtk_init (&argc, &argv); camel_init (); ex = camel_exception_new (); session = camel_session_new (auth_callback); camel_provider_load (session, "../camel/providers/vee/.libs/libcamelvee.so.0", ex); if (camel_exception_get_id (ex)) { printf ("Exceptions suck: %s\n", camel_exception_get_description (ex)); return 1; } store = camel_session_get_store (session, store_url, ex); if (camel_exception_get_id (ex)) { printf ("Exception caught in camel_session_get_store\n" "Full description : %s\n", camel_exception_get_description (ex)); return -1; } printf("get folder\n"); folder = camel_store_get_folder (store, "gnome_email?(match-all (header-contains \"subject\" \"gnome\"))", ex); if (camel_exception_get_id (ex)) { printf ("Exception caught in camel_store_get_folder\n" "Full description : %s\n", camel_exception_get_description (ex)); return -1; } /* setup searched folders */ { CamelFolder *subfolder; CamelStore *substore; substore = camel_session_get_store (session, "mbox:///home/notzed/evolution/local/Inbox", ex); subfolder = camel_store_get_folder(substore, "mbox", ex); camel_folder_open (subfolder, FOLDER_OPEN_READ, ex); camel_vee_folder_add_folder(folder, subfolder); if (camel_exception_get_id (ex)) { printf ("Exception caught in camel_store_get_folder\n" "Full description : %s\n", camel_exception_get_description (ex)); return -1; } substore = camel_session_get_store (session, "mbox:///home/notzed/evolution/local/Outbox", ex); subfolder = camel_store_get_folder(substore, "mbox", ex); camel_folder_open (subfolder, FOLDER_OPEN_READ, ex); camel_vee_folder_add_folder(folder, subfolder); if (camel_exception_get_id (ex)) { printf ("Exception caught in camel_store_get_folder\n" "Full description : %s\n", camel_exception_get_description (ex)); return -1; } } printf("open folder\n"); camel_folder_open (folder, FOLDER_OPEN_READ, ex); if (camel_exception_get_id (ex)) { printf ("Exception caught when trying to open the folder\n" "Full description : %s\n", camel_exception_get_description (ex)); return -1; } printf("vfolder's uid's:\n"); n = camel_folder_get_uid_list(folder, ex); while (n) { CamelMimeMessage *m; printf("uid: %s\n", (char *) n->data); m = camel_folder_get_message_by_uid(folder, n->data, ex); if (m) { dump_message_content(m); gtk_object_unref(m); } n = g_list_next(n); } camel_folder_close (folder, TRUE, ex); gtk_object_unref((GtkObject *)folder); return 0; } ue='gstreamer0.10-removal' selected='selected'>gstreamer0.10-removal FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* Bump portrevision due to upgrade of devel/gettext.edwin2008-06-061-0/+1
* Update to 5.1.7ahze2008-03-201-1/+1
* Remove the option for the gimp print driver, let graphics/gimp handle thatahze2008-03-011-1/+0
* Update to 5.1.6ahze2008-03-011-1/+1
* Update to 5.1.3ahze2007-06-261-8/+1
* - Welcome X.org 7.2 \o/.flz2007-05-201-1/+1
* - Update to 5.1.0ahze2007-04-045-12871/+30
* -Update to final 5.0.0.mezz2006-12-253-76/+48
* - Add gutenprint (successor to gimp-print)ahze2006-06-097-4439/+12863
* Remove USE_REINPLACE from all categories starting with Pedwin2006-05-131-1/+0
* Conversion to a single libtool environment.ade2006-02-232-2/+3
* Replace ugly "@unexec rmdir %D... 2>/dev/null || true" with @dirrmtryedwin2006-01-221-18/+18
* - Add SHA256pav2005-11-261-0/+1
* Mass-conversion to the USE_AUTOTOOLS New World Order. The code presentade2005-11-151-1/+1
* - Finish what adamw started: bump PORTREVISION and update pre-everything::pav2004-12-051-1/+2
* Disable CUPS support by default.adamw2004-12-041-3/+4
* Update to version 4.2.7krion2004-07-187-60/+860
* Apply a big libtool patch to allow porters to use the libtool installed bymarcus2004-07-101-1/+1
* - Correct minor linuxism in cups module: make different language modulespav2004-06-051-0/+11
* SIZEify.trevor2004-03-181-0/+1
* Whoa there, boy, that's a mighty big commit y'all have there...ade2004-03-141-1/+1
* Make sure the libgimpprint.so library is linked against libintl to resolvemarcus2004-02-052-1/+12
* Add USE_GETTEXT and bump PORTREVISION.marcus2004-02-041-2/+2
* Now gettext 0.12.1 is gettext-old.trevor2004-01-241-1/+1
* Prevent /usr/local/lib/gimp from being created. CONFIGURE_ARGS prevents the gimpadamw2004-01-131-0/+23
* - Update to version 4.2.6krion2004-01-123-131/+749
* Bump the PORTREVISION for the ports directly affected by the gettext upgrade.marcus2003-08-271-0/+1
* Chase the libintl.so shared lib version.marcus2003-08-251-1/+1
* Fix include path order so headers from a previously installed versionnaddy2003-02-181-0/+16
* Update to version 1.2.5.naddy2003-02-164-7/+8
* upgrade to 4.2.4ijliao2003-01-03