From 70ee2199d293268fac6453a8ec6b3b39d2553f7b Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 13 Jan 2010 23:39:32 +0100 Subject: [PATCH] Skip btr suffix from {pre,post}_select_btr(). Everything uses btr now, so there's no need for a suffix any more. Update the documentation a bit. --- alsa_write.c | 8 ++++---- file_write.c | 8 ++++---- oss_write.c | 8 ++++---- write.h | 18 +++++------------- write_common.c | 4 ++-- 5 files changed, 19 insertions(+), 27 deletions(-) diff --git a/alsa_write.c b/alsa_write.c index 7362c42b..8bc12a90 100644 --- a/alsa_write.c +++ b/alsa_write.c @@ -136,7 +136,7 @@ static int alsa_open(struct writer_node *wn) return 1; } -static void alsa_write_pre_select_btr(struct sched *s, struct task *t) +static void alsa_write_pre_select(struct sched *s, struct task *t) { struct writer_node *wn = container_of(t, struct writer_node, task); struct private_alsa_write_data *pad = wn->private_data; @@ -209,7 +209,7 @@ static void alsa_close(struct writer_node *wn) free(pad); } -static void alsa_write_post_select_btr(__a_unused struct sched *s, +static void alsa_write_post_select(__a_unused struct sched *s, struct task *t) { struct writer_node *wn = container_of(t, struct writer_node, task); @@ -319,8 +319,8 @@ void alsa_write_init(struct writer *w) alsa_cmdline_parser_init(&dummy); w->open = alsa_open; w->close = alsa_close; - w->pre_select_btr = alsa_write_pre_select_btr; - w->post_select_btr = alsa_write_post_select_btr; + w->pre_select = alsa_write_pre_select; + w->post_select = alsa_write_post_select; w->parse_config = alsa_parse_config; w->shutdown = NULL; /* nothing to do */ w->free_config = alsa_free_config; diff --git a/file_write.c b/file_write.c index 2a53499a..b12d07d5 100644 --- a/file_write.c +++ b/file_write.c @@ -71,7 +71,7 @@ static int file_write_open(struct writer_node *wn) return -E_FW_OPEN; } -static void file_write_pre_select_btr(struct sched *s, struct task *t) +static void file_write_pre_select(struct sched *s, struct task *t) { struct writer_node *wn = container_of(t, struct writer_node, task); struct private_file_write_data *pfwd = wn->private_data; @@ -93,7 +93,7 @@ static void file_write_close(struct writer_node *wn) free(pfwd); } -static void file_write_post_select_btr(__a_unused struct sched *s, +static void file_write_post_select(__a_unused struct sched *s, struct task *t) { struct writer_node *wn = container_of(t, struct writer_node, task); @@ -147,8 +147,8 @@ void file_write_init(struct writer *w) file_cmdline_parser_init(&dummy); w->open = file_write_open; - w->pre_select_btr = file_write_pre_select_btr; - w->post_select_btr = file_write_post_select_btr; + w->pre_select = file_write_pre_select; + w->post_select = file_write_post_select; w->parse_config = file_write_parse_config; w->free_config = file_write_free_config; w->close = file_write_close; diff --git a/oss_write.c b/oss_write.c index b002113c..8426753e 100644 --- a/oss_write.c +++ b/oss_write.c @@ -36,7 +36,7 @@ struct private_oss_write_data { int bytes_per_frame; }; -static void oss_pre_select_btr(struct sched *s, struct task *t) +static void oss_pre_select(struct sched *s, struct task *t) { struct writer_node *wn = container_of(t, struct writer_node, task); struct private_oss_write_data *powd = wn->private_data; @@ -141,7 +141,7 @@ err: return ret; } -static void oss_post_select_btr(__a_unused struct sched *s, +static void oss_post_select(__a_unused struct sched *s, struct task *t) { struct writer_node *wn = container_of(t, struct writer_node, task); @@ -236,8 +236,8 @@ void oss_write_init(struct writer *w) oss_cmdline_parser_init(&dummy); w->open = oss_open; w->close = oss_close; - w->pre_select_btr = oss_pre_select_btr; - w->post_select_btr = oss_post_select_btr; + w->pre_select = oss_pre_select; + w->post_select = oss_post_select; w->parse_config = oss_parse_config; w->free_config = oss_free_config; w->shutdown = NULL; diff --git a/write.h b/write.h index 4a172709..936d99c0 100644 --- a/write.h +++ b/write.h @@ -54,24 +54,16 @@ struct writer { /** * Prepare the fd sets for select. * - * This is called from the writer node group task's pre_select(). It - * may use the sched pointer to add any file descriptors or to decrease - * the select timeout. It must return positive on success and negative - * on errors. + * This is called from scheduler. It may use the sched pointer to add + * any file descriptors or to decrease the select timeout. */ - int (*pre_select)(struct sched *s, struct writer_node *wn); - void (*pre_select_btr)(struct sched *s, struct task *t); + void (*pre_select)(struct sched *s, struct task *t); /** * Write audio data. * - * Called from the post_select function of the wng task. It must keep - * track of the number of bytes consumed from the wng's buffer via - * the \p wn->written variable (which may be modified by the wng handling - * functions). This function must return positive on success and - * negative on errors. + * Called from the post_select function of the writer node's task. */ - int (*post_select)(struct sched *s, struct writer_node *wn); - void (*post_select_btr)(struct sched *s, struct task *t); + void (*post_select)(struct sched *s, struct task *t); /** * Close one instance of the writer. * diff --git a/write_common.c b/write_common.c index b05a9e98..66f097af 100644 --- a/write_common.c +++ b/write_common.c @@ -85,8 +85,8 @@ void register_writer_node(struct writer_node *wn, struct btr_node *parent) strcpy(wn->task.status, name); free(name); ret = w->open(wn); - wn->task.post_select = w->post_select_btr; - wn->task.pre_select = w->pre_select_btr; + wn->task.post_select = w->post_select; + wn->task.pre_select = w->pre_select; register_task(&wn->task); } -- 2.39.5