Skip btr suffix from {pre,post}_select_btr().
authorAndre Noll <maan@systemlinux.org>
Wed, 13 Jan 2010 22:39:32 +0000 (23:39 +0100)
committerAndre Noll <maan@systemlinux.org>
Wed, 13 Jan 2010 22:39:32 +0000 (23:39 +0100)
Everything uses btr now, so there's no need for a suffix any more.
Update the documentation a bit.

alsa_write.c
file_write.c
oss_write.c
write.h
write_common.c

index 7362c42..8bc12a9 100644 (file)
@@ -136,7 +136,7 @@ static int alsa_open(struct writer_node *wn)
        return 1;
 }
 
        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;
 {
        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);
 }
 
        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);
                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;
        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;
        w->parse_config = alsa_parse_config;
        w->shutdown = NULL; /* nothing to do */
        w->free_config = alsa_free_config;
index 2a53499..b12d07d 100644 (file)
@@ -71,7 +71,7 @@ static int file_write_open(struct writer_node *wn)
        return -E_FW_OPEN;
 }
 
        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;
 {
        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);
 }
 
        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);
                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;
 
        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;
        w->parse_config = file_write_parse_config;
        w->free_config = file_write_free_config;
        w->close = file_write_close;
index b002113..8426753 100644 (file)
@@ -36,7 +36,7 @@ struct private_oss_write_data {
        int bytes_per_frame;
 };
 
        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;
 {
        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;
 }
 
        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);
                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;
        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;
        w->parse_config = oss_parse_config;
        w->free_config = oss_free_config;
        w->shutdown = NULL;
diff --git a/write.h b/write.h
index 4a17270..936d99c 100644 (file)
--- a/write.h
+++ b/write.h
@@ -54,24 +54,16 @@ struct writer {
        /**
         * Prepare the fd sets for select.
         *
        /**
         * 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.
         *
        /**
         * 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.
         *
        /**
         * Close one instance of the writer.
         *
index b05a9e9..66f097a 100644 (file)
@@ -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);
        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);
 }
 
        register_task(&wn->task);
 }