[Evolution-hackers] Problems with camel



Hi!

I'm having a bit of a problem using camel. I'm trying to simply make a
small app that can open a camel url and read a message from a message
store, but I can't even figure out how to make a connection without it
segfaulting on me..

I've attaced the code and a makefile.

Any help?


-- 
Søren Hansen <sh warma dk>
 #include "camel/camel.h"
 #include <glib.h>
 
 char *get_pass(CamelSession *session, CamelService *service, const char *domain, const char *prompt, const char *item, guint32 flags, CamelException *ex) {
 		return("mypassword");
 }
 
 int main(gint argc, gchar *argv[]) {
 	CamelSession *session;
 	CamelException *ex; 
 	CamelStore *store;
 	CamelFolder *folder;
 
 	g_thread_init(NULL);
 
 	camel_init("/tmp", FALSE);
 	camel_type_init();
 
 	ex = camel_exception_new();
 
 	session = CAMEL_SESSION (camel_object_new (CAMEL_SESSION_TYPE));
 
 	((CamelSessionClass *) session)->get_password = get_pass;
 
 	camel_session_construct (session, "/tmp");
 
 	camel_session_get_store(session, "imap://sh pluto linuxkonsulent dk/", ex);
 
 	if (camel_exception_is_set(ex))
 		printf("%s", camel_exception_get_description(ex));
 
 	folder = camel_store_get_inbox(store, ex);
 
 	if (camel_exception_is_set(ex))
 		printf("%s", camel_exception_get_description(ex));
 }
all: camel-test

camel-test:
	libtool --mode=link gcc -g `pkg-config --cflags --libs glib-2.0 camel-2.0` camel-test.c -o camel-test

Attachment: smime.p7s
Description: S/MIME cryptographic signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]