static void smtp_listener_cb(struct evconnlistener *listener, evutil_socket_t fd ,struct sockaddr *sa, int socklen, void *user_data) { struct event_base* base = user_data; struct bufferevent* bev = bufferevent_socket_new(base, fd, BEV_OPT_CLOSE_ON_FREE); if (!bev) { ERROR("Error constructing bufferevent!"); event_base_loopbreak(base); return; } struct email* email = new_email(); email->bev = bev; bufferevent_setcb(bev, smtp_conn_readcb, NULL, smtp_conn_eventcb, email); bufferevent_enable(bev, EV_READ); bufferevent_write(bev, _220_HELLO, strlen(_220_HELLO)); }
static void about_email_hook (GtkAboutDialog *about, const gchar *email, gpointer data) { new_email (GTK_WINDOW(about), email); }