aboutsummaryrefslogtreecommitdiffstats
path: root/src/input_stream.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-26 20:56:46 +0100
committerMax Kellermann <max@duempel.org>2008-10-26 20:56:46 +0100
commit5c19776f2fc1416dab1da2f2baae9a0c764df965 (patch)
tree828f8f768be17f053e12fc38f2a7593e0a9b77b5 /src/input_stream.c
parent464b6117721056e72c79824a298caf53eb5cd452 (diff)
downloadmpd-5c19776f2fc1416dab1da2f2baae9a0c764df965.tar.gz
mpd-5c19776f2fc1416dab1da2f2baae9a0c764df965.tar.xz
mpd-5c19776f2fc1416dab1da2f2baae9a0c764df965.zip
input_stream: use "bool" instead of "int"
For boolean values and success flags, use bool instead of integer (1/0 for true/false, 0/-1 for success/failure).
Diffstat (limited to '')
-rw-r--r--src/input_stream.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/input_stream.c b/src/input_stream.c
index 957ca113f..b19cf30a3 100644
--- a/src/input_stream.c
+++ b/src/input_stream.c
@@ -51,14 +51,15 @@ void input_stream_global_finish(void)
#endif
}
-int input_stream_open(struct input_stream *is, char *url)
+bool
+input_stream_open(struct input_stream *is, char *url)
{
- is->ready = 0;
+ is->seekable = false;
+ is->ready = false;
is->offset = 0;
is->size = 0;
is->error = 0;
is->mime = NULL;
- is->seekable = 0;
is->meta_name = NULL;
is->meta_title = NULL;
@@ -67,14 +68,15 @@ int input_stream_open(struct input_stream *is, char *url)
if (plugin->open(is, url)) {
is->plugin = plugin;
- return 0;
+ return true;
}
}
- return -1;
+ return false;
}
-int input_stream_seek(struct input_stream *is, long offset, int whence)
+bool
+input_stream_seek(struct input_stream *is, long offset, int whence)
{
return is->plugin->seek(is, offset, whence);
}
@@ -97,7 +99,7 @@ void input_stream_close(struct input_stream *is)
is->plugin->close(is);
}
-int input_stream_eof(struct input_stream *is)
+bool input_stream_eof(struct input_stream *is)
{
return is->plugin->eof(is);
}