user_list.c: Minor documentation impreovements.
[paraslash.git] / write.c
diff --git a/write.c b/write.c
index 3b87335f9adff268aee8f91c23cf565f1210b09e..672f3e249769be23a681a6b3b8c2eb9c4ed4e331 100644 (file)
--- a/write.c
+++ b/write.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005-2007 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2008 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -28,11 +28,11 @@ struct check_wav_task {
        char *buf;
        /** Number of bytes loaded in \a buf. */
        size_t *loaded;
-       /** Non-zero if end of file was reached. */
-       int *eof;
+       /** Non-zero if an error occurred or end of file was reached. */
+       int *error;
        /** Number of channels specified in wav header given by \a buf. */
        unsigned channels;
-       /** Samplerate specified in wav header given by \a buf. */
+       /** Sample rate specified in wav header given by \a buf. */
        unsigned samplerate;
        /** The task structure for this task. */
        struct task task;
@@ -67,7 +67,7 @@ static void check_wav_pre_select(__a_unused struct sched *s, struct task *t)
        unsigned char *a;
 
        if (*wt->loaded < WAV_HEADER_LEN) {
-               t->ret = *wt->eof? -E_PREMATURE_END : 1;
+               t->ret = *wt->error? -E_PREMATURE_END : 1;
                return;
        }
        wt->channels = 2;
@@ -156,7 +156,7 @@ static void wng_event_handler(struct task *t)
 {
        struct writer_node_group *g = t->private_data;
 
-       PARA_INFO_LOG("%s\n", PARA_STRERROR(-t->ret));
+       PARA_INFO_LOG("%s\n", para_strerror(-t->ret));
        unregister_task(t);
        wng_close(g);
 }
@@ -166,17 +166,17 @@ static void idt_event_handler(struct task *t)
 {
        int ret;
 
-       PARA_INFO_LOG("%s\n", PARA_STRERROR(-t->ret));
+       PARA_INFO_LOG("%s\n", para_strerror(-t->ret));
        unregister_task(t);
        wng->buf = sit.buf;
        wng->loaded = &sit.loaded;
-       wng->input_eof = &sit.eof;
+       wng->input_error = &sit.error;
        wng->task.event_handler = wng_event_handler;
        wng->channels = &cwt.channels;
        wng->samplerate = &cwt.samplerate;
        ret = wng_open(wng);
        if (ret < 0) {
-               PARA_ERROR_LOG("%s\n", PARA_STRERROR(-ret));
+               PARA_ERROR_LOG("%s\n", para_strerror(-ret));
                exit(EXIT_FAILURE);
        }
 }
@@ -184,10 +184,10 @@ static void idt_event_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));
+               PARA_ERROR_LOG("%s\n", para_strerror(-t->ret));
                exit(EXIT_FAILURE);
        }
-       PARA_INFO_LOG("%s\n", PARA_STRERROR(-t->ret));
+       PARA_INFO_LOG("%s\n", para_strerror(-t->ret));
        unregister_task(t);
 //     if (t->ret == -E_WAV_HEADER_SUCCESS) {
 //             conf.channels_arg = cwt.channels;
@@ -234,7 +234,7 @@ int main(int argc, char *argv[])
        cwt.task.event_handler = cwt_event_handler;
        cwt.buf = sit.buf;
        cwt.loaded = &sit.loaded;
-       cwt.eof = &sit.eof;
+       cwt.error = &sit.error;
        sprintf(cwt.task.status, "check wav");
        register_task(&cwt.task);
 
@@ -244,7 +244,7 @@ int main(int argc, char *argv[])
 
 out:
        if (ret < 0) {
-               PARA_ERROR_LOG("%s\n", PARA_STRERROR(-ret));
+               PARA_ERROR_LOG("%s\n", para_strerror(-ret));
                ret = EXIT_FAILURE;
        } else
                ret = EXIT_SUCCESS;