From bceccc6b63b48ddeefb035ef6d910bea60340342 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 23 Aug 2018 15:45:05 +0000 Subject: Move job struct into job.c. --- format.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'format.c') diff --git a/format.c b/format.c index ccf6c1ca..4244ff0c 100644 --- a/format.c +++ b/format.c @@ -191,8 +191,8 @@ static const char *format_lower[] = { static void format_job_update(struct job *job) { - struct format_job *fj = job->data; - struct evbuffer *evb = job->event->input; + struct format_job *fj = job_get_data(job); + struct evbuffer *evb = job_get_event(job)->input; char *line = NULL, *next; time_t t; @@ -221,18 +221,19 @@ format_job_update(struct job *job) static void format_job_complete(struct job *job) { - struct format_job *fj = job->data; + struct format_job *fj = job_get_data(job); + struct evbuffer *evb = job_get_event(job)->input; char *line, *buf; size_t len; fj->job = NULL; buf = NULL; - if ((line = evbuffer_readline(job->event->input)) == NULL) { - len = EVBUFFER_LENGTH(job->event->input); + if ((line = evbuffer_readline(evb)) == NULL) { + len = EVBUFFER_LENGTH(evb); buf = xmalloc(len + 1); if (len != 0) - memcpy(buf, EVBUFFER_DATA(job->event->input), len); + memcpy(buf, EVBUFFER_DATA(evb), len); buf[len] = '\0'; } else buf = line; -- cgit