X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-sys%2Fevtloop.h;h=08650393d5727564210fc81aacd5f1c559556cb5;hb=5a4ed6a80a95c870a3603350d2a1e99b99d99b5b;hp=2be73669503a19428e3baec410d72f1b5143eea8;hpb=0b38190e1f839237d104c1094cd34fb2388c81df;p=apps%2Fmadmutt.git diff --git a/lib-sys/evtloop.h b/lib-sys/evtloop.h index 2be7366..0865039 100644 --- a/lib-sys/evtloop.h +++ b/lib-sys/evtloop.h @@ -23,6 +23,7 @@ #include #include +#include typedef enum el_state { EL_LLP_INIT, @@ -55,6 +56,7 @@ typedef enum el_event { typedef struct job_t { int fd; + int ssf; gnutls_session_t session; gnutls_certificate_credentials_t xcred; @@ -63,6 +65,7 @@ typedef struct job_t { el_mode mode : 3; el_mode emode : 3; + struct timeval mru; int (*llp)(struct job_t *); const struct machine_t *m; void *ptr; @@ -83,18 +86,20 @@ typedef struct machine_t { do { if ((expr) < 0) return -1; } while (0) __must_check__ int el_job_setmode(job_t *w, el_mode); +__must_check__ job_t *el_job_start(const machine_t *m, void *cfg); __must_check__ int el_job_release(job_t *j, el_status); + __must_check__ int el_job_connect(job_t *w, struct sockaddr *, socklen_t len, int type, int proto, int ssl); +__must_check__ int el_job_starttls(job_t *w); __must_check__ ssize_t el_job_read(job_t *w, buffer_t *buf); __must_check__ ssize_t el_job_write(job_t *w, buffer_t *buf); -static inline job_t *el_job_start(const machine_t *m, void *cfg) { - job_t *w = job_new(); - w->m = m; - return m->setup(w, cfg) < 0 ? NULL : w; -} int el_dispatch(int timeout); +void *el_loop(void *); + +void el_initialize(void); +void el_shutdown(void); #endif