From: Pierre Habouzit Date: Fri, 11 Jan 2008 21:08:05 +0000 (+0100) Subject: start a job X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=38f368de05a21ba6cbef6d48f4f89225d0d71c6e;p=apps%2Fmadmutt.git start a job Signed-off-by: Pierre Habouzit --- diff --git a/lib-sys/evtloop.h b/lib-sys/evtloop.h index 6c5e0d8..7c46bf6 100644 --- a/lib-sys/evtloop.h +++ b/lib-sys/evtloop.h @@ -60,7 +60,7 @@ typedef struct job_t { el_mode emode : 3; int (*llp)(struct job_t *); - struct machine_t *m; + const struct machine_t *m; void *ptr; } job_t; DO_INIT(job_t, job); @@ -80,6 +80,12 @@ __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); +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); #endif