diff options
author | Max Kellermann <max@duempel.org> | 2008-10-26 20:56:46 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-26 20:56:46 +0100 |
commit | 5c19776f2fc1416dab1da2f2baae9a0c764df965 (patch) | |
tree | 828f8f768be17f053e12fc38f2a7593e0a9b77b5 /src/input_stream.h | |
parent | 464b6117721056e72c79824a298caf53eb5cd452 (diff) | |
download | mpd-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 'src/input_stream.h')
-rw-r--r-- | src/input_stream.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/input_stream.h b/src/input_stream.h index 3fc6d942f..0f6a1f503 100644 --- a/src/input_stream.h +++ b/src/input_stream.h @@ -30,20 +30,20 @@ struct input_plugin { int (*buffer)(struct input_stream *is); size_t (*read)(struct input_stream *is, void *ptr, size_t size); - int (*eof)(struct input_stream *is); - int (*seek)(struct input_stream *is, long offset, int whence); + bool (*eof)(struct input_stream *is); + bool (*seek)(struct input_stream *is, long offset, int whence); }; struct input_stream { const struct input_plugin *plugin; - int ready; + bool seekable; + bool ready; int error; long offset; size_t size; char *mime; - int seekable; void *data; char *meta_name; @@ -56,10 +56,14 @@ void input_stream_global_finish(void); /* if an error occurs for these 3 functions, then -1 is returned and errno for the input stream is set */ -int input_stream_open(struct input_stream *is, char *url); -int input_stream_seek(struct input_stream *is, long offset, int whence); +bool +input_stream_open(struct input_stream *is, char *url); + +bool +input_stream_seek(struct input_stream *is, long offset, int whence); + void input_stream_close(struct input_stream *is); -int input_stream_eof(struct input_stream *is); +bool input_stream_eof(struct input_stream *is); /* return value: -1 is error, 1 inidicates stuff was buffered, 0 means nothing was buffered */ |