From 5c19776f2fc1416dab1da2f2baae9a0c764df965 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 26 Oct 2008 20:56:46 +0100 Subject: 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). --- src/input_stream.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/input_stream.h') 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 */ -- cgit v1.2.3