aboutsummaryrefslogtreecommitdiffstats
path: root/src/InputStream.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-17 09:43:55 +0200
committerMax Kellermann <max@duempel.org>2013-10-17 10:45:10 +0200
commit05de2e998c7df2757ae63ce6a053e27eca3d13ca (patch)
tree2c85c43cb69dc2dc7086bfddc66090928cd0d93f /src/InputStream.hxx
parent24780d99e61af44141e8f0d0d0776a1c994e6770 (diff)
downloadmpd-05de2e998c7df2757ae63ce6a053e27eca3d13ca.tar.gz
mpd-05de2e998c7df2757ae63ce6a053e27eca3d13ca.tar.xz
mpd-05de2e998c7df2757ae63ce6a053e27eca3d13ca.zip
InputStream: use int64_t instead of goffset
Decouple some more from GLib.
Diffstat (limited to 'src/InputStream.hxx')
-rw-r--r--src/InputStream.hxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/InputStream.hxx b/src/InputStream.hxx
index 51f32deec..2a3d7b2cd 100644
--- a/src/InputStream.hxx
+++ b/src/InputStream.hxx
@@ -26,9 +26,8 @@
#include <string>
-#include <glib.h>
-
#include <assert.h>
+#include <stdint.h>
class Cond;
class Error;
@@ -36,6 +35,8 @@ struct Tag;
struct InputPlugin;
struct input_stream {
+ typedef int64_t offset_type;
+
/**
* the plugin which implements this input stream
*/
@@ -80,12 +81,12 @@ struct input_stream {
/**
* the size of the resource, or -1 if unknown
*/
- goffset size;
+ offset_type size;
/**
* the current offset within the stream
*/
- goffset offset;
+ offset_type offset;
/**
* the MIME content type of the resource, or empty if unknown.
@@ -173,14 +174,14 @@ struct input_stream {
}
gcc_pure
- goffset GetSize() const {
+ offset_type GetSize() const {
assert(ready);
return size;
}
gcc_pure
- goffset GetOffset() const {
+ offset_type GetOffset() const {
assert(ready);
return offset;
@@ -208,13 +209,13 @@ struct input_stream {
* @param offset the relative offset
* @param whence the base of the seek, one of SEEK_SET, SEEK_CUR, SEEK_END
*/
- bool Seek(goffset offset, int whence, Error &error);
+ bool Seek(offset_type offset, int whence, Error &error);
/**
* Wrapper for Seek() which locks and unlocks the mutex; the
* caller must not be holding it already.
*/
- bool LockSeek(goffset offset, int whence, Error &error);
+ bool LockSeek(offset_type offset, int whence, Error &error);
/**
* Returns true if the stream has reached end-of-file.