A couple more tweaks
[Rockbox.git] / apps / buffering.h
blob4583d8125b426c1504e91c392045f3ce17c577b2
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 Nicolas Pennequin
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef _BUFFERING_H_
21 #define _BUFFERING_H_
23 #include <sys/types.h>
24 #include <stdbool.h>
26 enum data_type {
27 TYPE_CODEC,
28 TYPE_AUDIO,
29 TYPE_STREAM,
30 TYPE_ID3,
31 TYPE_CUESHEET,
32 TYPE_IMAGE,
33 TYPE_BUFFER,
34 TYPE_UNKNOWN,
37 bool buffering_init(char *filebuf, size_t filebuflen);
38 size_t bufused(void);
39 int bufopen(char *file, size_t offset, enum data_type type);
40 int bufalloc(void *src, size_t size, enum data_type type);
41 int bufclose(int handle_id);
42 int bufseek(int handle_id, size_t newpos);
43 int bufadvance(int handle_id, off_t offset);
44 ssize_t bufread(int handle_id, size_t size, char *dest);
45 ssize_t bufgetdata(int handle_id, size_t size, unsigned char **data);
47 #endif