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).
This commit is contained in:
Max Kellermann
2008-10-26 20:56:46 +01:00
parent 464b611772
commit 5c19776f2f
14 changed files with 55 additions and 49 deletions

View File

@@ -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 */