/* -*- 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; } eamer-1.16 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* - turn this into a slave portdinoex2004-03-271-896/+5
* - Security update to 0.9.7ddinoex2004-03-171-5/+10
* - Warn about conflict with /lib/libcrypto.sodinoex2004-01-091-0/+10
* - add CONFLICTSdinoex2003-10-121-3/+3
* - Security Fix, Update to 0.9.7cdinoex2003-10-011-5/+2
* - ### HEAD UP ### SHLIBVER has been bumped back.dinoex2003-04-161-14/+7
* - Update to 0.9.7bdinoex2003-04-121-2/+1
* - enable threads on ia64dinoex2003-04-071-6/+6
* - honor CC and use PHREAD_LIBS and PTHREAD_FLAGSdinoex2003-04-041-0/+1
* - Security Fix:dinoex2003-03-231-1/+1
* - switch to USE_PERL5_BUILDdinoex2003-03-191-1/+2
* - add COMMENTdinoex2003-02-211-0/+1
* - merged some patches in distributiondinoex2003-02-201-46/+60
* - sync SHLIBVER for OPENSSL_OVERWRITE_BASE=yes and 5.0-CURRENTdinoex2003-02-151-0/+4
* - Fix spellingdinoex2003-02-091-1/+1
* - Fix CURRENT version bump in openssl, so ports link as expected.dinoex2003-02-011-0/+5
* - make portlint happierdinoex2003-01-231-1/+1
* - merge and sort manpages, reduce number of lines neededdinoex2003-01-161-797/+785
* - use NOPRECIOUSMAKEVARS, to fix bento problemdinoex2003-01-161-2/+1
* add more MLINKSdinoex2003-01-141-0/+36
* - add flag BROKEN_MLINKS for problems with bsd.port.mkdinoex2003-01-121-1/+9
* Update to 0.9.7 releasedinoex2003-01-031-1/+1
* - Update to 0.9.7-beta5dinoex2003-01-021-4/+693
* - add rnd_keys.c for compatibilty with base. (patch by: jtraub@isilon.com)dinoex2002-10-261-1/+2
* remove pkg-plist.noshared and use PLIST_SUBdinoex2002-10-171-1/+2
* Install manpages in standard only if OPENSSL_OVERWRITE_BASE is not set.dinoex2002-10-131-1/+4
* Install openssl's man pages in standard manpathdinoex2002-10-131-1/+3
* use /etc/ssl if OPENSSL_OVERWRITE_BASE is setdinoex2002-10-061-1/+4
* Update to openssl-0.9.7-beta3 after repro-copy, use at own risk.dinoex2002-08-151-2/+9
* Security Update to: 0.9.6gdinoex2002-08-101-2/+1
* Sync Bugfix from CURRENTdinoex2002-08-061-0/+1
* when build with OPENSSL_OVERWRITE_BASEdinoex2002-08-021-0/+1
* Security Update to 0.9.6edinoex2002-07-311-4/+5
* Remove FORBIDDEN, oenssl-0.9.6d doesn't made in into 4.6 RELEASEdinoex2002-06-241-3/+0
* Add an option OPENSSL_OVERWRITE_BASE=yes as we have done in OPENSHHdinoex2002-06-161-0/+5
* Update to: 0.9.6ddinoex2002-05-141-3/+7
* openssl:dinoex2002-05-041-1/+3
* - Update to 0.9.6cdinoex2002-04-211-17/+22