aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputStream.h
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-05-18 02:46:13 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-05-18 02:46:13 +0000
commit48a58073dd9bf781a8e2a127e832941332fc8a41 (patch)
tree8aeeb19951a63b43c8f054947539ae904b9f4558 /src/inputStream.h
parentee79a3a8fdd119444ff76d993678a56ed635df2b (diff)
downloadmpd-48a58073dd9bf781a8e2a127e832941332fc8a41.tar.gz
mpd-48a58073dd9bf781a8e2a127e832941332fc8a41.tar.xz
mpd-48a58073dd9bf781a8e2a127e832941332fc8a41.zip
add new inputStream stuff, hopefully something major isn't foobar'd
git-svn-id: https://svn.musicpd.org/mpd/trunk@1049 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/inputStream.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/inputStream.h b/src/inputStream.h
index 15eefe994..861232386 100644
--- a/src/inputStream.h
+++ b/src/inputStream.h
@@ -19,19 +19,33 @@
#ifndef INPUT_STREAM_H
#define INPUT_STREAM_H
-#include <stdio.h>
#include <stdlib.h>
-typedef struct _InputStream {
- FILE * fp;
+typedef struct _InputStream InputStream;
+
+typedef int (* InputStreamSeekFunc) (InputStream * inStream, long offset,
+ int whence);
+typedef size_t (* InputStreamReadFunc) (InputStream * inStream, void * ptr, size_t size,
+ size_t nmemb);
+typedef int (* InputStreamCloseFunc) (InputStream * inStream);
+typedef int (* InputStreamAtEOFFunc) (InputStream * inStream);
+
+struct _InputStream {
int error;
long offset;
size_t size;
-} InputStream;
+
+ /* don't touc this stuff */
+ InputStreamSeekFunc seekFunc;
+ InputStreamReadFunc readFunc;
+ InputStreamCloseFunc closeFunc;
+ InputStreamAtEOFFunc atEOFFunc;
+ void * data;
+};
/* if an error occurs for these 3 functions, then -1 is returned and errno
for the input stream is set */
-int openInputStreamFromFile(InputStream * inStream, char * filename);
+int openInputStream(InputStream * inStream, char * url);
int seekInputStream(InputStream * inStream, long offset, int whence);
int closeInputStream(InputStream * inStream);
int inputStreamAtEOF(InputStream * inStream);