FS#12756 by Marek Salaba - update Czech translation
[maemo-rb.git] / apps / plugins / lua / rockconf.h
blobc0a233135ab85d79494f9a36bb5439da0a2cb012
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2008 Dan Everton (safetydan)
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 #ifndef _ROCKCONF_H_
23 #define _ROCKCONF_H_
25 #include "plugin.h"
27 #undef LUAI_THROW
28 #undef LUAI_TRY
29 #undef luai_jmpbuf
31 #undef LUA_PATH_DEFAULT
32 #define LUA_PATH_DEFAULT "$/?.lua;" "$/?/init.lua;" VIEWERS_DIR"/lua/?.lua;" VIEWERS_DIR"/lua/?/init.lua;"
34 #include <setjmp.h>
36 #include "lib/pluginlib_exit.h"
38 #define LUAI_THROW(L,c) longjmp((c)->b, 1)
39 #define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a }
40 #define luai_jmpbuf jmp_buf
42 extern char curpath[MAX_PATH];
43 void* dlmalloc(size_t bytes);
44 void *dlrealloc(void *ptr, size_t size);
45 void dlfree(void *ptr);
46 struct tm *gmtime(const time_t *timep);
47 long strtol(const char *nptr, char **endptr, int base);
48 unsigned long strtoul(const char *str, char **endptr, int base);
49 size_t strftime(char* dst, size_t max, const char* format, const struct tm* tm);
50 long lfloor(long x);
51 long lpow(long x, long y);
53 #define floor lfloor
54 #define pow lpow
56 /* Simple substitutions */
57 #define realloc dlrealloc
58 #define free dlfree
59 #define memchr rb->memchr
60 #define snprintf rb->snprintf
61 #define strcat rb->strcat
62 #define strchr rb->strchr
63 #define strcmp rb->strcmp
64 #define strcpy rb->strcpy
65 #define strlen rb->strlen
67 #endif /* _ROCKCONF_H_ */