From 48a58073dd9bf781a8e2a127e832941332fc8a41 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Tue, 18 May 2004 02:46:13 +0000 Subject: 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 --- src/inputStream.h | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'src/inputStream.h') 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 #include -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); -- cgit v1.2.3