summaryrefslogtreecommitdiff
path: root/apps/buffering.h
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2007-11-28 04:58:16 +0000
committerBrandon Low <lostlogic@rockbox.org>2007-11-28 04:58:16 +0000
commit3386dd7be90f4f4a23d36359f2052fa834fb20e7 (patch)
tree4765c534909e8d55455872bf7b0b2b1e464ff2c5 /apps/buffering.h
parent05784b52abb3d21dfe0e7b1e014e601ce1d10803 (diff)
downloadrockbox-3386dd7be90f4f4a23d36359f2052fa834fb20e7.tar.gz
rockbox-3386dd7be90f4f4a23d36359f2052fa834fb20e7.zip
Fix FS8069, because Nico_P made it easy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15840 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/buffering.h')
-rw-r--r--apps/buffering.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/buffering.h b/apps/buffering.h
index f6a9f7883b..bc61ec5e6d 100644
--- a/apps/buffering.h
+++ b/apps/buffering.h
@@ -41,6 +41,7 @@ enum callback_event {
41 EVENT_HANDLE_REBUFFER, 41 EVENT_HANDLE_REBUFFER,
42 EVENT_HANDLE_CLOSED, 42 EVENT_HANDLE_CLOSED,
43 EVENT_HANDLE_MOVED, 43 EVENT_HANDLE_MOVED,
44 EVENT_HANDLE_FINISHED,
44}; 45};
45 46
46/* Error return values */ 47/* Error return values */
@@ -48,6 +49,7 @@ enum callback_event {
48#define ERR_BUFFER_FULL -2 49#define ERR_BUFFER_FULL -2
49#define ERR_INVALID_VALUE -3 50#define ERR_INVALID_VALUE -3
50#define ERR_FILE_ERROR -4 51#define ERR_FILE_ERROR -4
52#define ERR_HANDLE_NOT_DONE -5
51 53
52 54
53/* Initialise the buffering subsystem */ 55/* Initialise the buffering subsystem */
@@ -68,9 +70,12 @@ bool buffering_reset(char *buf, size_t buflen);
68 * bufadvance: Move handle reading index, relatively to current position 70 * bufadvance: Move handle reading index, relatively to current position
69 * bufread : Copy data from a handle to a buffer 71 * bufread : Copy data from a handle to a buffer
70 * bufgetdata: Obtain a pointer for linear access to a "size" amount of data 72 * bufgetdata: Obtain a pointer for linear access to a "size" amount of data
73 * bufgettail: Out-of-band get the last size bytes of a handle.
74 * bufcuttail: Out-of-band remove the trailing 'size' bytes of a handle.
71 * 75 *
72 * NOTE: bufread and bufgetdata will block the caller until the requested 76 * NOTE: bufread and bufgetdata will block the caller until the requested
73 * amount of data is ready (unless EOF is reached). 77 * amount of data is ready (unless EOF is reached).
78 * NOTE: Tail operations are only legal when the end of the file is buffered.
74 ****************************************************************************/ 79 ****************************************************************************/
75 80
76#define BUF_MAX_HANDLES 256 81#define BUF_MAX_HANDLES 256
@@ -82,6 +87,8 @@ int bufseek(int handle_id, size_t newpos);
82int bufadvance(int handle_id, off_t offset); 87int bufadvance(int handle_id, off_t offset);
83ssize_t bufread(int handle_id, size_t size, void *dest); 88ssize_t bufread(int handle_id, size_t size, void *dest);
84ssize_t bufgetdata(int handle_id, size_t size, void **data); 89ssize_t bufgetdata(int handle_id, size_t size, void **data);
90ssize_t bufgettail(int handle_id, size_t size, void **data);
91ssize_t bufcuttail(int handle_id, size_t size);
85 92
86 93
87/*************************************************************************** 94/***************************************************************************