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.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/apps/plugins/lua/rockconf.h b/apps/plugins/lua/rockconf.h
index eda1e05084..a13146d7e9 100644
--- a/apps/plugins/lua/rockconf.h
+++ b/apps/plugins/lua/rockconf.h
@@ -25,6 +25,10 @@
25#include "plugin.h" 25#include "plugin.h"
26#include <tlsf.h> 26#include <tlsf.h>
27 27
28#undef LUAI_THROW
29#undef LUAI_TRY
30#undef luai_jmpbuf
31
28#undef LUA_PATH_DEFAULT 32#undef LUA_PATH_DEFAULT
29#define LUA_PATH_DEFAULT "$/?.lua;" "$/?/init.lua;" VIEWERS_DIR"/lua/?.lua;" VIEWERS_DIR"/lua/?/init.lua;" 33#define LUA_PATH_DEFAULT "$/?.lua;" "$/?/init.lua;" VIEWERS_DIR"/lua/?.lua;" VIEWERS_DIR"/lua/?/init.lua;"
30 34
@@ -32,11 +36,20 @@
32 36
33#include "lib/pluginlib_exit.h" 37#include "lib/pluginlib_exit.h"
34 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
35extern char curpath[MAX_PATH]; 43extern char curpath[MAX_PATH];
36struct tm *gmtime(const time_t *timep); 44struct tm *gmtime(const time_t *timep);
37long strtol(const char *nptr, char **endptr, int base); 45long strtol(const char *nptr, char **endptr, int base);
38unsigned long strtoul(const char *str, char **endptr, int base); 46unsigned long strtoul(const char *str, char **endptr, int base);
39size_t strftime(char* dst, size_t max, const char* format, const struct tm* tm); 47size_t strftime(char* dst, size_t max, const char* format, const struct tm* tm);
48long lfloor(long x);
49long lpow(long x, long y);
50
51#define floor lfloor
52#define pow lpow
40 53
41/* Simple substitutions */ 54/* Simple substitutions */
42#define malloc tlsf_malloc 55#define malloc tlsf_malloc
@@ -50,17 +63,5 @@ size_t strftime(char* dst, size_t max, const char* format, const struct tm* tm);
50#define strcpy rb->strcpy 63#define strcpy rb->strcpy
51#define strlen rb->strlen 64#define strlen rb->strlen
52 65
53#define getlocaledecpoint() '.'
54#define abort() exit(EXIT_FAILURE)
55#define difftime(t1,t0) ((t1) - (t0))
56#define localtime gmtime
57#if CONFIG_RTC
58#define time(x) mktime(rb->get_time())
59#define mktime rb->mktime
60#else
61#define time(x) (0)
62#define mktime(x) (0)
63#endif
64
65#endif /* _ROCKCONF_H_ */ 66#endif /* _ROCKCONF_H_ */
66 67