First commit of buffering.[ch], based on testplugin.c
[Rockbox-MoB.git] / buffering.h
bloba08c4e11155d508b8d83769ed6a20b564d254299
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>
25 #define MAX_PATH 256
27 enum data_type {
28 TYPE_CODEC,
29 TYPE_AUDIO,
30 TYPE_STREAM,
31 TYPE_ID3,
32 TYPE_CUESHEET,
33 TYPE_IMAGE,
34 TYPE_BUFFER,
35 TYPE_UNKNOWN,
38 void buffer_init(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