aboutsummaryrefslogtreecommitdiffstats
path: root/src/input_stream.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-28 20:39:09 +0100
committerMax Kellermann <max@duempel.org>2008-10-28 20:39:09 +0100
commit0a61877702965dc375b3ad2b2d1cf0315703c22e (patch)
tree9c4ed9b5ae32a1b00eab1b84b08f0100be4e3aa1 /src/input_stream.h
parent016d996131d560db6d72476ae29c74df84746fff (diff)
downloadmpd-0a61877702965dc375b3ad2b2d1cf0315703c22e.tar.gz
mpd-0a61877702965dc375b3ad2b2d1cf0315703c22e.tar.xz
mpd-0a61877702965dc375b3ad2b2d1cf0315703c22e.zip
input_stream: convert offset and size to the off_t data type
size_t and long aren't 64 bit safe (i.e. files larger than 2 GB on a 32 bit OS). Use off_t instead, which is a 64 bit integer if compiled with large file support.
Diffstat (limited to 'src/input_stream.h')
-rw-r--r--src/input_stream.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/input_stream.h b/src/input_stream.h
index 0f6a1f503..3787d9ce5 100644
--- a/src/input_stream.h
+++ b/src/input_stream.h
@@ -21,6 +21,7 @@
#include <stddef.h>
#include <stdbool.h>
+#include <sys/types.h>
struct input_stream;
@@ -31,7 +32,7 @@ struct input_plugin {
int (*buffer)(struct input_stream *is);
size_t (*read)(struct input_stream *is, void *ptr, size_t size);
bool (*eof)(struct input_stream *is);
- bool (*seek)(struct input_stream *is, long offset, int whence);
+ bool (*seek)(struct input_stream *is, off_t offset, int whence);
};
struct input_stream {
@@ -41,8 +42,7 @@ struct input_stream {
bool ready;
int error;
- long offset;
- size_t size;
+ off_t size, offset;
char *mime;
void *data;
@@ -60,7 +60,7 @@ bool
input_stream_open(struct input_stream *is, char *url);
bool
-input_stream_seek(struct input_stream *is, long offset, int whence);
+input_stream_seek(struct input_stream *is, off_t offset, int whence);
void input_stream_close(struct input_stream *is);
bool input_stream_eof(struct input_stream *is);