summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/rockconf.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/rockconf.h')
-rw-r--r--apps/plugins/lua/rockconf.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/apps/plugins/lua/rockconf.h b/apps/plugins/lua/rockconf.h
new file mode 100644
index 0000000000..7ae2245c3a
--- /dev/null
+++ b/apps/plugins/lua/rockconf.h
@@ -0,0 +1,64 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 Dan Everton (safetydan)
11 *
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.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _ROCKCONF_H_
23#define _ROCKCONF_H_
24
25#include "plugin.h"
26
27#undef LUAI_THROW
28#undef LUAI_TRY
29#undef luai_jmpbuf
30
31#ifndef SIMULATOR
32#include "../../codecs/lib/setjmp.h"
33#else
34#include <setjmp.h>
35#endif
36
37#include "lib/pluginlib_exit.h"
38
39#define LUAI_THROW(L,c) longjmp((c)->b, 1)
40#define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a }
41#define luai_jmpbuf jmp_buf
42
43extern char curpath[MAX_PATH];
44void *dlrealloc(void *ptr, size_t size);
45void dlfree(void *ptr);
46long strtol(const char *nptr, char **endptr, int base);
47unsigned long strtoul(const char *str, char **endptr, int base);
48long floor(long x);
49long pow(long x, long y);
50
51/* Simple substitutions */
52#define realloc dlrealloc
53#define free dlfree
54#define memchr rb->memchr
55#define snprintf rb->snprintf
56#define strcat rb->strcat
57#define strchr rb->strchr
58#define strcmp rb->strcmp
59#define strcpy rb->strcpy
60#define strncpy rb->strncpy
61#define strlen rb->strlen
62
63#endif /* _ROCKCONF_H_ */
64