Don't use ENAVAIL.
authorAndre Noll <maan@systemlinux.org>
Mon, 18 Jan 2010 09:52:32 +0000 (10:52 +0100)
committerAndre Noll <maan@systemlinux.org>
Mon, 18 Jan 2010 09:52:32 +0000 (10:52 +0100)
NetBSD doesn't know it, and the error text does not fit well. So replace
it by a paraslash error message.

aacdec_filter.c
error.h
mp3dec_filter.c
oggdec_filter.c
wmadec_filter.c
write.c

index 9809552..d48b18e 100644 (file)
@@ -62,13 +62,13 @@ static int aacdec_execute(struct btr_node *btrn, const char *cmd, char **result)
 
        if (!strcmp(cmd, "samplerate")) {
                if (padd->samplerate == 0)
-                       return -ERRNO_TO_PARA_ERROR(ENAVAIL);
+                       return -E_BTR_NAVAIL;
                *result = make_message("%u", padd->samplerate);
                return 1;
        }
        if (!strcmp(cmd, "channels")) {
                if (padd->channels == 0)
-                       return -ERRNO_TO_PARA_ERROR(ENAVAIL);
+                       return -E_BTR_NAVAIL;
                *result = make_message("%u", padd->channels);
                return 1;
        }
diff --git a/error.h b/error.h
index 5a5d015..ecea044 100644 (file)
--- a/error.h
+++ b/error.h
@@ -40,6 +40,7 @@ extern const char **para_errlist[];
 #define BUFFER_TREE_ERRORS \
        PARA_ERROR(BTR_EOF, "buffer tree: end of file"), \
        PARA_ERROR(BTR_NO_CHILD, "btr node has no children"), \
+       PARA_ERROR(BTR_NAVAIL, "btr node: value currently unavailable"), \
 
 #define STDOUT_ERRORS \
        PARA_ERROR(STDOUT_EOF, "stdout: end of file"), \
index 696367d..a025eed 100644 (file)
@@ -232,13 +232,13 @@ static int mp3dec_execute(struct btr_node *btrn, const char *cmd, char **result)
 
        if (!strcmp(cmd, "samplerate")) {
                if (pmd->samplerate == 0)
-                       return -ERRNO_TO_PARA_ERROR(ENAVAIL);
+                       return -E_BTR_NAVAIL;
                *result = make_message("%u", pmd->samplerate);
                return 1;
        }
        if (!strcmp(cmd, "channels")) {
                if (pmd->channels == 0)
-                       return -ERRNO_TO_PARA_ERROR(ENAVAIL);
+                       return -E_BTR_NAVAIL;
                *result = make_message("%u", pmd->channels);
                return 1;
        }
index bac28cf..f14d97c 100644 (file)
@@ -125,13 +125,13 @@ static int oggdec_execute(struct btr_node *btrn, const char *cmd, char **result)
 
        if (!strcmp(cmd, "samplerate")) {
                if (pod->samplerate == 0)
-                       return -ERRNO_TO_PARA_ERROR(ENAVAIL);
+                       return -E_BTR_NAVAIL;
                *result = make_message("%u", pod->samplerate);
                return 1;
        }
        if (!strcmp(cmd, "channels")) {
                if (pod->channels == 0)
-                       return -ERRNO_TO_PARA_ERROR(ENAVAIL);
+                       return -E_BTR_NAVAIL;
                *result = make_message("%u", pod->channels);
                return 1;
        }
index 1233996..d78c72b 100644 (file)
@@ -1210,13 +1210,13 @@ static int wmadec_execute(struct btr_node *btrn, const char *cmd, char **result)
 
        if (!strcmp(cmd, "samplerate")) {
                if (pwd->ahi.sample_rate == 0)
-                       return -ERRNO_TO_PARA_ERROR(ENAVAIL);
+                       return -E_BTR_NAVAIL;
                *result = make_message("%u", pwd->ahi.sample_rate);
                return 1;
        }
        if (!strcmp(cmd, "channels")) {
                if (pwd->ahi.channels == 0)
-                       return -ERRNO_TO_PARA_ERROR(ENAVAIL);
+                       return -E_BTR_NAVAIL;
                *result = make_message("%u", pwd->ahi.channels);
                return 1;
        }
diff --git a/write.c b/write.c
index d886335..bf178c4 100644 (file)
--- a/write.c
+++ b/write.c
@@ -74,13 +74,13 @@ static int check_wav_exec(struct btr_node *btrn, const char *cmd, char **result)
 
        if (!strcmp(cmd, "samplerate")) {
                if (cwt->state != CWS_HAVE_HEADER)
-                       return -ERRNO_TO_PARA_ERROR(ENAVAIL);
+                       return -E_BTR_NAVAIL;
                *result = make_message("%d", cwt->samplerate);
                return 1;
        }
        if (!strcmp(cmd, "channels")) {
                if (cwt->state != CWS_HAVE_HEADER)
-                       return -ERRNO_TO_PARA_ERROR(ENAVAIL);
+                       return -E_BTR_NAVAIL;
                *result = make_message("%d", cwt->channels);
                return 1;
        }