A bit of adapting.
[Rockbox.git] / apps / buffering.h
blob639ff176dfc2776a08e61354a0c815afc57e22b7
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 int bufopen(char *file, size_t offset, enum data_type type);
39 int bufalloc(void *src, size_t size, enum data_type type);
40 int bufclose(int handle_id);
41 int bufseek(int handle_id, size_t newpos);
42 int bufadvance(int handle_id, off_t offset);
43 ssize_t bufread(int handle_id, size_t size, char *dest);
44 ssize_t bufgetdata(int handle_id, size_t size, unsigned char **data);
46 #endif