diff options
Diffstat (limited to 'apps/codecs/libspeex/rockbox.h')
-rw-r--r-- | apps/codecs/libspeex/rockbox.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/apps/codecs/libspeex/rockbox.h b/apps/codecs/libspeex/rockbox.h new file mode 100644 index 0000000000..368f1fb2d2 --- /dev/null +++ b/apps/codecs/libspeex/rockbox.h | |||
@@ -0,0 +1,99 @@ | |||
1 | /************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2007 Dan Everton | ||
10 | * | ||
11 | * All files in this archive are subject to the GNU General Public License. | ||
12 | * See the file COPYING in the source tree root for full license agreement. | ||
13 | * | ||
14 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
15 | * KIND, either express or implied. | ||
16 | * | ||
17 | ***************************************************************************/ | ||
18 | |||
19 | #ifndef SPEEX_ROCKBOX_H | ||
20 | #define SPEEX_ROCKBOX_H | ||
21 | |||
22 | #include "../codec.h" | ||
23 | #include "../lib/codeclib.h" | ||
24 | |||
25 | #if defined(DEBUG) || defined(SIMULATOR) | ||
26 | #undef DEBUGF | ||
27 | #define DEBUGF ci->debugf | ||
28 | #else | ||
29 | #define DEBUGF(...) | ||
30 | #endif | ||
31 | |||
32 | #ifdef ROCKBOX_HAS_LOGF | ||
33 | #undef LOGF | ||
34 | #define LOGF ci->logf | ||
35 | #else | ||
36 | #define LOGF(...) | ||
37 | #endif | ||
38 | |||
39 | extern struct codec_api* ci; | ||
40 | |||
41 | static inline void *speex_alloc (int size) | ||
42 | { | ||
43 | return codec_calloc(size, 1); | ||
44 | } | ||
45 | |||
46 | static inline void *speex_alloc_scratch (int size) | ||
47 | { | ||
48 | return codec_calloc(size,1); | ||
49 | } | ||
50 | |||
51 | static inline void *speex_realloc (void *ptr, int size) | ||
52 | { | ||
53 | return codec_realloc(ptr, size); | ||
54 | } | ||
55 | |||
56 | static inline void speex_free (void *ptr) | ||
57 | { | ||
58 | codec_free(ptr); | ||
59 | } | ||
60 | |||
61 | static inline void speex_free_scratch (void *ptr) | ||
62 | { | ||
63 | codec_free(ptr); | ||
64 | } | ||
65 | |||
66 | static inline void *speex_move (void *dest, void *src, int n) | ||
67 | { | ||
68 | return memmove(dest,src,n); | ||
69 | } | ||
70 | |||
71 | static inline void _speex_fatal(const char *str, const char *file, int line) | ||
72 | { | ||
73 | DEBUGF("Fatal error: %s\n", str); | ||
74 | //exit(1); | ||
75 | } | ||
76 | |||
77 | static inline void speex_warning(const char *str) | ||
78 | { | ||
79 | DEBUGF("warning: %s\n", str); | ||
80 | } | ||
81 | |||
82 | static inline void speex_warning_int(const char *str, int val) | ||
83 | { | ||
84 | DEBUGF("warning: %s %d\n", str, val); | ||
85 | } | ||
86 | |||
87 | static inline void speex_notify(const char *str) | ||
88 | { | ||
89 | DEBUGF("notice: %s\n", str); | ||
90 | } | ||
91 | |||
92 | static inline void _speex_putc(int ch, void *file) | ||
93 | { | ||
94 | //FILE *f = (FILE *)file; | ||
95 | //printf("%c", ch); | ||
96 | } | ||
97 | |||
98 | #endif | ||
99 | |||