Updated our source code header to explicitly mention that we are GPL v2 or
[Rockbox.git] / apps / codecs / lib / codeclib.h
blob1d95486c789be5b4380b2cde7bcb37c1b4ca371f
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2005 Dave Chapman
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include "config.h"
23 #include "codecs.h"
24 #include "system.h"
25 #include <sys/types.h>
27 #define MALLOC_BUFSIZE (512*1024)
29 extern struct codec_api *ci;
30 extern long mem_ptr;
31 extern long bufsize;
32 extern unsigned char* mp3buf; // The actual MP3 buffer from Rockbox
33 extern unsigned char* mallocbuf; // 512K from the start of MP3 buffer
34 extern unsigned char* filebuf; // The rest of the MP3 buffer
36 /* Standard library functions that are used by the codecs follow here */
38 void* codec_malloc(size_t size);
39 void* codec_calloc(size_t nmemb, size_t size);
40 void* codec_realloc(void* ptr, size_t size);
41 void codec_free(void* ptr);
43 void *memcpy(void *dest, const void *src, size_t n);
44 void *memset(void *s, int c, size_t n);
45 int memcmp(const void *s1, const void *s2, size_t n);
46 void *memmove(void *s1, const void *s2, size_t n);
48 size_t strlen(const char *s);
49 char *strcpy(char *dest, const char *src);
50 char *strcat(char *dest, const char *src);
51 int strcmp(const char *, const char *);
53 void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *));
55 #define abs(x) ((x)>0?(x):-(x))
56 #define labs(x) abs(x)
58 /* Various codec helper functions */
60 int codec_init(void);
61 void codec_set_replaygain(struct mp3entry* id3);
63 #ifdef RB_PROFILE
64 void __cyg_profile_func_enter(void *this_fn, void *call_site)
65 NO_PROF_ATTR ICODE_ATTR;
66 void __cyg_profile_func_exit(void *this_fn, void *call_site)
67 NO_PROF_ATTR ICODE_ATTR;
68 #endif