#include "mem.h"
-enum job_state {
+enum job_mode {
JOB_IDLE = 0x00,
JOB_READ = 0x01,
JOB_WRITE = 0x02,
- JOB_RDWR = 0x03,
+ JOB_RDWR = JOB_READ | JOB_WRITE,
JOB_LISTEN = 0x04,
JOB_CONN = 0x08,
};
typedef struct jpriv_t jpriv_t;
typedef struct job_t {
- unsigned state : 6;
- unsigned done : 1;
- unsigned error : 1;
+ unsigned mode : 6; /* 4 are enough, 2 used as padding */
+ unsigned done : 1;
+ unsigned error : 1;
+ unsigned state : 24;
int fd;
}
void job_delete(job_t **job);
-void job_update_state(job_t *job, int state);
-job_t *job_accept(job_t *listener, int state);
+void job_update_mode(job_t *job, int mode);
+job_t *job_accept(job_t *listener, int mode);
void job_initialize(void);
void job_loop(void);