X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=main.c;h=74f95beab2abf13132f40c701a87412cc66071d0;hp=72166ea0fd8b1a4fcf306a98072db496319a6746;hb=f8d1899d44b259a0920a52bd7290f15e39fd0d47;hpb=c81a65db2499a363af5af28610db5f7e69e15839;ds=sidebyside diff --git a/main.c b/main.c index 72166ea..74f95be 100644 --- a/main.c +++ b/main.c @@ -18,9 +18,11 @@ #include #include +#include #include #include +#include #include #include #include @@ -46,8 +48,8 @@ extern int optind; #endif #ifdef USE_HCACHE -#if defined(HAVE_QDBM) -#include +#if defined(HAVE_TOKYOCABINET) +#include #elif defined(HAVE_GDBM) #include #endif @@ -56,6 +58,8 @@ extern int optind; #include #include +#include + void mutt_exit(int code) { mutt_endwin(NULL); @@ -64,7 +68,7 @@ void mutt_exit(int code) static void mutt_usage (void) { - puts(mutt_make_version()); + puts(madmutt_version); puts(_("\ usage: madmutt [ -nRyzZ ] [ -e ] [ -F ] [ -f ]\n\ @@ -98,7 +102,7 @@ static void show_version (void) struct utsname uts; uname(&uts); - puts(mutt_make_version()); + puts(madmutt_version); puts(_(" Copyright (C) 1996-2002 Michael R. Elkins and others.")); puts(_(" Copyright (C) 2005 The Mutt-ng Team")); puts(_(" Copyright (C) 2006-2007 Pierre Habouzit")); @@ -118,8 +122,8 @@ static void show_version (void) printf(" libidn %s\n", STRINGPREP_VERSION); #endif #ifdef USE_HCACHE -#if defined(HAVE_QDBM) - printf(" qdbm %s\n", dpversion); +#if defined(HAVE_TOKYOCABINET) + printf(" tokyocabinet %s\n", tcversion); #elif defined(HAVE_GDBM) printf(" gdbm %s\n", gdbm_version); #endif @@ -129,16 +133,6 @@ static void show_version (void) puts (_("Compile Options:")); puts ( -#ifdef USE_FCNTL - " +USE_FCNTL" -#else - " -USE_FCNTL" -#endif -#ifdef USE_FLOCK - " +USE_FLOCK" -#else - " -USE_FLOCK" -#endif #ifdef USE_HCACHE " +USE_HCACHE" #else @@ -182,6 +176,14 @@ static void mutt_nocurses_error (const char *fmt, ...) fputc('\n', stderr); } +static void *evtloop(void *data) +{ + for (;;) { + el_dispatch(100); + pthread_testcancel(); + } +} + int main (int argc, char **argv) { char folder[_POSIX_PATH_MAX] = ""; @@ -196,6 +198,7 @@ int main (int argc, char **argv) int version = 0; int i; int explicit_folder = 0; + pthread_t pt; /* initialize random number for tmp file creation */ srand48((unsigned int) time (NULL)); @@ -311,8 +314,10 @@ int main (int argc, char **argv) } /* set defaults and read init files */ + el_initialize(); mutt_init (flags & M_NOSYSRC, commands); string_list_wipe(&commands); + pthread_create(&pt, NULL, &evtloop, NULL); if (!option(OPTNOCURSES)) { ui_layout_init(); @@ -498,6 +503,7 @@ int main (int argc, char **argv) NULL)) || !explicit_folder) { mutt_index_menu (); + if (option (OPTXTERMSETTITLES)) printf("\033]2;%s\007", NONULL(XtermLeave)); if (Context) @@ -506,7 +512,10 @@ int main (int argc, char **argv) mutt_endwin (Errorbuf); } + pthread_cancel(pt); + pthread_join(pt, NULL); luaM_shutdown(); mutt_sasl_shutdown(); + el_shutdown(); exit (0); }