return 0;
}
+
+void el_initialize(void)
+{
+ gnutls_global_init();
+ epollfd = epoll_create(1024);
+ if (epollfd < 0) {
+ mutt_error("epoll_create");
+ mutt_exit(EXIT_FAILURE);
+ }
+}
+
+void el_shutdown(void)
+{
+ close(epollfd);
+ gnutls_global_deinit();
+}
#include <lib-lib/lib-lib.h>
#include <gnutls/gnutls.h>
+#include <sys/socket.h>
typedef enum el_state {
EL_LLP_INIT,
}
int el_dispatch(int timeout);
+void el_initialize(void);
+void el_shutdown(void);
#endif
#include <lib-lib/lib-lib.h>
#include <sys/utsname.h>
+#include <pthread.h>
#include <lib-lua/lib-lua.h>
#include <lib-sys/mutt_signal.h>
+#include <lib-sys/evtloop.h>
#include <lib-mime/mime.h>
#include <lib-ui/lib-ui.h>
#include <lib-mx/mx.h>
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] = "";
int version = 0;
int i;
int explicit_folder = 0;
+ pthread_t pt;
/* initialize random number for tmp file creation */
srand48((unsigned int) time (NULL));
}
/* 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();
NULL)) || !explicit_folder)
{
mutt_index_menu ();
+
if (option (OPTXTERMSETTITLES))
printf("\033]2;%s\007", NONULL(XtermLeave));
if (Context)
mutt_endwin (Errorbuf);
}
+ pthread_cancel(pt);
+ pthread_join(pt, NULL);
luaM_shutdown();
mutt_sasl_shutdown();
+ el_shutdown();
exit (0);
}