From: Andre Date: Tue, 23 May 2006 21:49:31 +0000 (+0200) Subject: Rename error handler() to event_handler() X-Git-Tag: v0.2.14~101^2~27 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=37db6c718cbd9e350d46703c36dc6860477de476 Rename error handler() to event_handler() --- diff --git a/sched.c b/sched.c index 6233e40b..9db7c092 100644 --- a/sched.c +++ b/sched.c @@ -16,9 +16,9 @@ static void sched_preselect(struct sched *s) again: list_for_each_entry_safe(t, tmp, &pre_select_list, pre_select_node) { t->pre_select(s, t); - if (t->ret > 0 || !t->error_handler) + if (t->ret > 0 || !t->event_handler) continue; - t->error_handler(t); + t->event_handler(t); goto again; } } @@ -29,9 +29,9 @@ static void sched_post_select(struct sched *s) list_for_each_entry_safe(t, tmp, &post_select_list, post_select_node) { t->post_select(s, t); - if (t->ret > 0 || !t->error_handler) + if (t->ret > 0 || !t->event_handler) continue; - t->error_handler(t); + t->event_handler(t); } } diff --git a/sched.h b/sched.h index 8ed4cd12..9855475d 100644 --- a/sched.h +++ b/sched.h @@ -12,7 +12,7 @@ struct task { int ret; void (*pre_select)(struct sched *s, struct task *t); void (*post_select)(struct sched *s, struct task *t); - void (*error_handler)(struct task *t); + void (*event_handler)(struct task *t); struct list_head pre_select_node; struct list_head post_select_node; char status[MAXLINE]; diff --git a/write.c b/write.c index 3e5a97e8..7b8ddd66 100644 --- a/write.c +++ b/write.c @@ -157,7 +157,7 @@ out: return NULL; } -static void idt_error_handler(struct task *t) +static void idt_event_handler(struct task *t) { int ret; @@ -174,7 +174,7 @@ static void idt_error_handler(struct task *t) } } -static void cwt_error_handler(struct task *t) +static void cwt_event_handler(struct task *t) { if (t->ret != -E_NO_WAV_HEADER && t->ret != -E_WAV_HEADER_SUCCESS) { PARA_ERROR_LOG("%s\n", PARA_STRERROR(-t->ret)); @@ -188,12 +188,12 @@ static void cwt_error_handler(struct task *t) } idt.task.pre_select = initial_delay_pre_select; idt.task.private_data = &idt; - idt.task.error_handler = idt_error_handler; + idt.task.event_handler = idt_event_handler; sprintf(idt.task.status, "initial_delay"); register_task(&idt.task); } -static void stdin_error_handler(struct task *t) +static void stdin_event_handler(struct task *t) { unregister_task(t); if (t->ret != -E_STDIN_EOF) @@ -219,14 +219,14 @@ int main(int argc, char *argv[]) sit.loaded = 0, sit.task.pre_select = stdin_pre_select; sit.task.post_select = stdin_post_select; - sit.task.error_handler = stdin_error_handler; + sit.task.event_handler = stdin_event_handler; sit.task.private_data = &sit; sprintf(sit.task.status, "stdin reader"); register_task(&sit.task); cwt.task.pre_select = check_wav_pre_select; cwt.task.private_data = &cwt; - cwt.task.error_handler = cwt_error_handler; + cwt.task.event_handler = cwt_event_handler; cwt.buf = sit.buf; cwt.loaded = &sit.loaded; cwt.eof = &sit.eof; diff --git a/write_common.c b/write_common.c index 7622c020..0b2772ae 100644 --- a/write_common.c +++ b/write_common.c @@ -97,7 +97,7 @@ void wng_close(struct writer_node_group *g) } } -static void wng_error_handler(struct task *t) +static void wng_event_handler(struct task *t) { struct writer_node_group *g = t->private_data; @@ -116,7 +116,7 @@ struct writer_node_group *wng_new(unsigned num_writers) g->written = para_calloc(num_writers * sizeof(size_t)); g->task.private_data = g; g->task.post_select = wng_post_select; - g->task.error_handler = wng_error_handler; + g->task.event_handler = wng_event_handler; g->task.flags = POST_ADD_TAIL; return g; }