projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
using stls should not enable new CAPAs
[apps/madmutt.git]
/
lib-sys
/
evtloop.h
diff --git
a/lib-sys/evtloop.h
b/lib-sys/evtloop.h
index
c96f0c2
..
48bc86a
100644
(file)
--- a/
lib-sys/evtloop.h
+++ b/
lib-sys/evtloop.h
@@
-15,7
+15,7
@@
* MA 02110-1301, USA.
*/
/*
* MA 02110-1301, USA.
*/
/*
- * Copyright © 200
6
Pierre Habouzit
+ * Copyright © 200
7
Pierre Habouzit
*/
#ifndef MUTT_LIB_SYS_EVTLOOP_H
*/
#ifndef MUTT_LIB_SYS_EVTLOOP_H
@@
-24,6
+24,7
@@
#include <lib-lib/lib-lib.h>
#include <gnutls/gnutls.h>
#include <sys/socket.h>
#include <lib-lib/lib-lib.h>
#include <gnutls/gnutls.h>
#include <sys/socket.h>
+#include "account.h"
typedef enum el_state {
EL_LLP_INIT,
typedef enum el_state {
EL_LLP_INIT,
@@
-47,10
+48,10
@@
typedef enum el_status {
} el_status;
typedef enum el_event {
} el_status;
typedef enum el_event {
+ EL_EVT_RUNNING = 0,
EL_EVT_IN = EL_READING,
EL_EVT_OUT = EL_WRITING,
EL_EVT_INOUT = EL_RDWR,
EL_EVT_IN = EL_READING,
EL_EVT_OUT = EL_WRITING,
EL_EVT_INOUT = EL_RDWR,
- EL_EVT_RUNNING = 4,
EL_EVT_WAKEUP = 5,
} el_event;
EL_EVT_WAKEUP = 5,
} el_event;
@@
-58,13
+59,15
@@
typedef struct job_t {
int fd;
int ssf;
int fd;
int ssf;
- gnutls_session_t session;
- gnutls_certificate_credentials_t xcred;
-
+ unsigned cond : 1;
el_state state : 2;
el_mode mode : 3;
el_mode emode : 3;
el_state state : 2;
el_mode mode : 3;
el_mode emode : 3;
+ gnutls_session_t session;
+ gnutls_certificate_credentials_t xcred;
+
+ struct timeval mru;
int (*llp)(struct job_t *);
const struct machine_t *m;
void *ptr;
int (*llp)(struct job_t *);
const struct machine_t *m;
void *ptr;
@@
-85,20
+88,22
@@
typedef struct machine_t {
do { if ((expr) < 0) return -1; } while (0)
__must_check__ int el_job_setmode(job_t *w, el_mode);
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_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_connect(job_t *w, struct sockaddr *, socklen_t len,
int type, int proto, int ssl);
+__must_check__ int el_job_connect2(job_t *w, const ACCOUNT *);
__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);
__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;
-}
+void el_lock(void);
+void el_unlock(void);
+void el_wait(volatile job_t *w);
int el_dispatch(int timeout);
int el_dispatch(int timeout);
+
void el_initialize(void);
void el_shutdown(void);
void el_initialize(void);
void el_shutdown(void);