Maurus Cuelenaere | cf87597 | 2009-05-21 19:01:41 +0000 | [diff] [blame] | 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 | |
Maurus Cuelenaere | 3ff84e5 | 2009-06-25 13:26:05 +0000 | [diff] [blame] | 31 | #undef LUA_PATH_DEFAULT |
Maurus Cuelenaere | 80b4e5d | 2009-07-10 11:30:26 +0000 | [diff] [blame] | 32 | #define LUA_PATH_DEFAULT "$/?.lua;" "$/?/init.lua;" VIEWERS_DIR"/lua/?.lua;" VIEWERS_DIR"/lua/?/init.lua;" |
Maurus Cuelenaere | 3ff84e5 | 2009-06-25 13:26:05 +0000 | [diff] [blame] | 33 | |
Maurus Cuelenaere | cf87597 | 2009-05-21 19:01:41 +0000 | [diff] [blame] | 34 | #ifndef SIMULATOR |
| 35 | #include "../../codecs/lib/setjmp.h" |
| 36 | #else |
| 37 | #include <setjmp.h> |
| 38 | #endif |
| 39 | |
| 40 | #include "lib/pluginlib_exit.h" |
| 41 | |
| 42 | #define LUAI_THROW(L,c) longjmp((c)->b, 1) |
| 43 | #define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } |
| 44 | #define luai_jmpbuf jmp_buf |
| 45 | |
| 46 | extern char curpath[MAX_PATH]; |
Maurus Cuelenaere | beb9066 | 2009-07-05 16:41:16 +0000 | [diff] [blame] | 47 | void* dlmalloc(size_t bytes); |
Maurus Cuelenaere | cf87597 | 2009-05-21 19:01:41 +0000 | [diff] [blame] | 48 | void *dlrealloc(void *ptr, size_t size); |
| 49 | void dlfree(void *ptr); |
Maurus Cuelenaere | b2581e1 | 2009-05-27 22:48:50 +0000 | [diff] [blame] | 50 | struct tm *gmtime(const time_t *timep); |
Maurus Cuelenaere | cf87597 | 2009-05-21 19:01:41 +0000 | [diff] [blame] | 51 | long strtol(const char *nptr, char **endptr, int base); |
| 52 | unsigned long strtoul(const char *str, char **endptr, int base); |
Maurus Cuelenaere | b2581e1 | 2009-05-27 22:48:50 +0000 | [diff] [blame] | 53 | size_t strftime(char* dst, size_t max, const char* format, const struct tm* tm); |
Thomas Martitz | 6894747 | 2010-05-14 12:43:45 +0000 | [diff] [blame^] | 54 | long lfloor(long x); |
| 55 | long lpow(long x, long y); |
| 56 | |
| 57 | #define floor lfloor |
| 58 | #define pow lpow |
Maurus Cuelenaere | cf87597 | 2009-05-21 19:01:41 +0000 | [diff] [blame] | 59 | |
| 60 | /* Simple substitutions */ |
| 61 | #define realloc dlrealloc |
| 62 | #define free dlfree |
| 63 | #define memchr rb->memchr |
| 64 | #define snprintf rb->snprintf |
| 65 | #define strcat rb->strcat |
| 66 | #define strchr rb->strchr |
| 67 | #define strcmp rb->strcmp |
| 68 | #define strcpy rb->strcpy |
Maurus Cuelenaere | cf87597 | 2009-05-21 19:01:41 +0000 | [diff] [blame] | 69 | #define strlen rb->strlen |
| 70 | |
| 71 | #endif /* _ROCKCONF_H_ */ |
| 72 | |