Permalink
Browse files

Adding Lua library and an example app.

  • Loading branch information...
1 parent 8913466 commit 39633d1d29fdcd1bd11a83ed07c8a330764b63b3 Mikael Kindborg committed Aug 31, 2011
Showing with 49,249 additions and 0 deletions.
  1. BIN documentation/screenshot.png
  2. +17 −0 projects/LuaLib/.cproject
  3. +39 −0 projects/LuaLib/.mosyncproject
  4. +19 −0 projects/LuaLib/.project
  5. +134 −0 projects/LuaLib/inc/LuaEngine.h
  6. +41 −0 projects/LuaLib/inc/LuaErrorListener.h
  7. +23 −0 projects/LuaLib/inc/ScaleImage.h
  8. +29 −0 projects/LuaLib/inc/SystemAPI.h
  9. +8 −0 projects/LuaLib/lua/inc/assert.h
  10. +6 −0 projects/LuaLib/lua/inc/ctype.h
  11. +8 −0 projects/LuaLib/lua/inc/errno.h
  12. +4 −0 projects/LuaLib/lua/inc/locale.h
  13. +11 −0 projects/LuaLib/lua/inc/math.h
  14. +7 −0 projects/LuaLib/lua/inc/setjmp.h
  15. +6 −0 projects/LuaLib/lua/inc/stdarg.h
  16. +7 −0 projects/LuaLib/lua/inc/stddef.h
  17. +21 −0 projects/LuaLib/lua/inc/stdio.h
  18. +17 −0 projects/LuaLib/lua/inc/stdlib.h
  19. +11 −0 projects/LuaLib/lua/inc/string.h
  20. +6 −0 projects/LuaLib/lua/inc/time.h
  21. +3 −0 projects/LuaLib/lua/lib/errno.c
  22. +6 −0 projects/LuaLib/lua/lib/stdio.c
  23. +6 −0 projects/LuaLib/lua/lib/stdlib.c
  24. +21 −0 projects/LuaLib/lua/lib/stringlib.c
  25. +1,087 −0 projects/LuaLib/lua/src/lapi.c
  26. +16 −0 projects/LuaLib/lua/src/lapi.h
  27. +669 −0 projects/LuaLib/lua/src/lauxlib.c
  28. +174 −0 projects/LuaLib/lua/src/lauxlib.h
  29. +677 −0 projects/LuaLib/lua/src/lbaselib.c
  30. +846 −0 projects/LuaLib/lua/src/lcode.c
  31. +76 −0 projects/LuaLib/lua/src/lcode.h
  32. +397 −0 projects/LuaLib/lua/src/ldblib.c
  33. +640 −0 projects/LuaLib/lua/src/ldebug.c
  34. +33 −0 projects/LuaLib/lua/src/ldebug.h
  35. +541 −0 projects/LuaLib/lua/src/ldo.c
  36. +57 −0 projects/LuaLib/lua/src/ldo.h
  37. +164 −0 projects/LuaLib/lua/src/ldump.c
  38. +174 −0 projects/LuaLib/lua/src/lfunc.c
  39. +34 −0 projects/LuaLib/lua/src/lfunc.h
  40. +711 −0 projects/LuaLib/lua/src/lgc.c
  41. +110 −0 projects/LuaLib/lua/src/lgc.h
  42. +53 −0 projects/LuaLib/lua/src/linit.c
  43. +624 −0 projects/LuaLib/lua/src/liolib.c
  44. +479 −0 projects/LuaLib/lua/src/llex.c
  45. +81 −0 projects/LuaLib/lua/src/llex.h
  46. +128 −0 projects/LuaLib/lua/src/llimits.h
  47. +306 −0 projects/LuaLib/lua/src/lmathlib.c
  48. +86 −0 projects/LuaLib/lua/src/lmem.c
  49. +49 −0 projects/LuaLib/lua/src/lmem.h
  50. +674 −0 projects/LuaLib/lua/src/loadlib.c
  51. +214 −0 projects/LuaLib/lua/src/lobject.c
  52. +381 −0 projects/LuaLib/lua/src/lobject.h
  53. +102 −0 projects/LuaLib/lua/src/lopcodes.c
  54. +268 −0 projects/LuaLib/lua/src/lopcodes.h
  55. +272 −0 projects/LuaLib/lua/src/loslib.c
  56. +1,367 −0 projects/LuaLib/lua/src/lparser.c
  57. +82 −0 projects/LuaLib/lua/src/lparser.h
  58. +214 −0 projects/LuaLib/lua/src/lstate.c
  59. +169 −0 projects/LuaLib/lua/src/lstate.h
  60. +111 −0 projects/LuaLib/lua/src/lstring.c
  61. +31 −0 projects/LuaLib/lua/src/lstring.h
  62. +869 −0 projects/LuaLib/lua/src/lstrlib.c
  63. +588 −0 projects/LuaLib/lua/src/ltable.c
  64. +40 −0 projects/LuaLib/lua/src/ltable.h
  65. +287 −0 projects/LuaLib/lua/src/ltablib.c
  66. +75 −0 projects/LuaLib/lua/src/ltm.c
  67. +54 −0 projects/LuaLib/lua/src/ltm.h
  68. +392 −0 projects/LuaLib/lua/src/lua.c
  69. +388 −0 projects/LuaLib/lua/src/lua.h
  70. +200 −0 projects/LuaLib/lua/src/luac.c
  71. +784 −0 projects/LuaLib/lua/src/luaconf.h
  72. +53 −0 projects/LuaLib/lua/src/lualib.h
  73. +227 −0 projects/LuaLib/lua/src/lundump.c
  74. +36 −0 projects/LuaLib/lua/src/lundump.h
  75. +763 −0 projects/LuaLib/lua/src/lvm.c
  76. +36 −0 projects/LuaLib/lua/src/lvm.h
  77. +82 −0 projects/LuaLib/lua/src/lzio.c
  78. +67 −0 projects/LuaLib/lua/src/lzio.h
  79. +227 −0 projects/LuaLib/lua/src/print.c
  80. +417 −0 projects/LuaLib/src/LuaEngine.cpp
  81. +377 −0 projects/LuaLib/src/ScaleImage.c
  82. +466 −0 projects/LuaLib/src/SystemAPI.cpp
  83. +29 −0 projects/LuaLib/toluabindings/HowTo.txt
  84. +9,365 −0 projects/LuaLib/toluabindings/lua_maapi.c
  85. +822 −0 projects/LuaLib/toluabindings/lua_maapi.h
  86. +990 −0 projects/LuaLib/toluabindings/lua_maapi.pkg
  87. +10 −0 projects/LuaLib/toluabindings/lua_special_bindings.h
  88. +158 −0 projects/LuaLib/toluabindings/lua_systemapi.h
  89. +37 −0 projects/LuaLib/toluabindings/makebindings.rb
  90. +133 −0 projects/LuaLib/toluabindings/tolua.h
  91. +445 −0 projects/LuaLib/toluabindings/tolua_event.c
  92. +24 −0 projects/LuaLib/toluabindings/tolua_event.h
  93. +567 −0 projects/LuaLib/toluabindings/tolua_is.c
  94. +536 −0 projects/LuaLib/toluabindings/tolua_map.c
  95. +144 −0 projects/LuaLib/toluabindings/tolua_push.c
  96. +125 −0 projects/LuaLib/toluabindings/tolua_to.c
  97. +121 −0 projects/common/LuaLib.lua
  98. +17 −0 projects/examples/LuaSocket/.cproject
  99. +34 −0 projects/examples/LuaSocket/.mosyncproject
  100. +19 −0 projects/examples/LuaSocket/.project
  101. +151 −0 projects/examples/LuaSocket/LuaSocket.lua
  102. +47 −0 projects/examples/LuaSocket/main.cpp
  103. +7 −0 projects/examples/LuaSocket/resource.lst
  104. +31 −0 tolua/INSTALL
  105. +100 −0 tolua/MANIFEST
  106. +17 −0 tolua/Makefile
  107. +28 −0 tolua/README
  108. +32 −0 tolua/README2
  109. BIN tolua/bin/tolua.exe
  110. +36 −0 tolua/config
  111. +130 −0 tolua/include/tolua.h
  112. +35 −0 tolua/src/bin/Makefile
  113. +26 −0 tolua/src/bin/lua/all.lua
  114. +208 −0 tolua/src/bin/lua/array.lua
  115. +210 −0 tolua/src/bin/lua/basic.lua
  116. +120 −0 tolua/src/bin/lua/class.lua
  117. +75 −0 tolua/src/bin/lua/clean.lua
  118. +73 −0 tolua/src/bin/lua/code.lua
  119. +193 −0 tolua/src/bin/lua/compat.lua
  120. +550 −0 tolua/src/bin/lua/container.lua
  121. +475 −0 tolua/src/bin/lua/declaration.lua
  122. +69 −0 tolua/src/bin/lua/define.lua
  123. +63 −0 tolua/src/bin/lua/doit.lua
  124. +83 −0 tolua/src/bin/lua/enumerate.lua
  125. +101 −0 tolua/src/bin/lua/feature.lua
  126. +386 −0 tolua/src/bin/lua/function.lua
  127. +67 −0 tolua/src/bin/lua/module.lua
  128. +52 −0 tolua/src/bin/lua/namespace.lua
  129. +113 −0 tolua/src/bin/lua/operator.lua
  130. +279 −0 tolua/src/bin/lua/package.lua
  131. +68 −0 tolua/src/bin/lua/typedef.lua
  132. +253 −0 tolua/src/bin/lua/variable.lua
  133. +76 −0 tolua/src/bin/lua/verbatim.lua
  134. +127 −0 tolua/src/bin/tolua.c
  135. +28 −0 tolua/src/bin/tolua.pkg
  136. +4,224 −0 tolua/src/bin/toluabind.c
  137. +27 −0 tolua/src/lib/Makefile
  138. +445 −0 tolua/src/lib/tolua_event.c
  139. +24 −0 tolua/src/lib/tolua_event.h
  140. +567 −0 tolua/src/lib/tolua_is.c
  141. +536 −0 tolua/src/lib/tolua_map.c
  142. +144 −0 tolua/src/lib/tolua_push.c
  143. +125 −0 tolua/src/lib/tolua_to.c
  144. +84 −0 tolua/src/tests/Makefile
  145. +6 −0 tolua/src/tests/myassert.lua
  146. +3 −0 tolua/src/tests/t.pkg
  147. +45 −0 tolua/src/tests/tarray.c
  148. +28 −0 tolua/src/tests/tarray.h
  149. +39 −0 tolua/src/tests/tarray.lua
  150. +29 −0 tolua/src/tests/tarray.pkg
  151. +519 −0 tolua/src/tests/tarraybind.c
  152. +35 −0 tolua/src/tests/tclass.cpp
  153. +67 −0 tolua/src/tests/tclass.h
  154. +52 −0 tolua/src/tests/tclass.lua
  155. +50 −0 tolua/src/tests/tclass.pkg
  156. +666 −0 tolua/src/tests/tclassbind.cpp
  157. +22 −0 tolua/src/tests/tconstant.cpp
  158. +32 −0 tolua/src/tests/tconstant.h
  159. +15 −0 tolua/src/tests/tconstant.lua
  160. +37 −0 tolua/src/tests/tconstant.pkg
  161. +59 −0 tolua/src/tests/tconstantbind.cpp
  162. +8 −0 tolua/src/tests/tdirective.lua
  163. +28 −0 tolua/src/tests/tdirective.pkg
  164. +102 −0 tolua/src/tests/tdirectivebind.c
  165. +5 −0 tolua/src/tests/tdirectivelua.lua
  166. +2 −0 tolua/src/tests/tdirectivepkg.pkg
  167. +26 −0 tolua/src/tests/tenum.c
  168. +17 −0 tolua/src/tests/tenum.h
  169. +9 −0 tolua/src/tests/tenum.lua
  170. +13 −0 tolua/src/tests/tenum.pkg
  171. +78 −0 tolua/src/tests/tenumbind.c
  172. +22 −0 tolua/src/tests/tfunction.cpp
  173. +210 −0 tolua/src/tests/tfunction.h
  174. +104 −0 tolua/src/tests/tfunction.lua
  175. +72 −0 tolua/src/tests/tfunction.pkg
  176. +1,556 −0 tolua/src/tests/tfunctionbind.cpp
  177. +21 −0 tolua/src/tests/tinheritance.cpp
  178. +35 −0 tolua/src/tests/tinheritance.h
  179. +16 −0 tolua/src/tests/tinheritance.lua
  180. +35 −0 tolua/src/tests/tinheritance.pkg
  181. +494 −0 tolua/src/tests/tinheritancebind.cpp
  182. +24 −0 tolua/src/tests/tmodule.c
  183. +7 −0 tolua/src/tests/tmodule.h
  184. +19 −0 tolua/src/tests/tmodule.lua
  185. +16 −0 tolua/src/tests/tmodule.pkg
  186. +138 −0 tolua/src/tests/tmodulebind.c
  187. +25 −0 tolua/src/tests/tnamespace.cpp
  188. +11 −0 tolua/src/tests/tnamespace.h
  189. +16 −0 tolua/src/tests/tnamespace.lua
  190. +13 −0 tolua/src/tests/tnamespace.pkg
  191. +115 −0 tolua/src/tests/tnamespacebind.cpp
  192. +42 −0 tolua/src/tests/tvararg.cpp
  193. +37 −0 tolua/src/tests/tvararg.h
  194. +13 −0 tolua/src/tests/tvararg.lua
  195. +17 −0 tolua/src/tests/tvararg.pkg
  196. +308 −0 tolua/src/tests/tvarargbind.cpp
  197. +46 −0 tolua/src/tests/tvariable.c
  198. +44 −0 tolua/src/tests/tvariable.h
  199. +75 −0 tolua/src/tests/tvariable.lua
  200. +45 −0 tolua/src/tests/tvariable.pkg
  201. +645 −0 tolua/src/tests/tvariablebind.c
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+<storageModule moduleId="org.eclipse.cdt.core.settings">
+<cconfiguration id="org.eclipse.cdt.core.default.config.1748089437">
+<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.1748089437" moduleId="org.eclipse.cdt.core.settings" name="Configuration">
+<externalSettings/>
+<extensions/>
+</storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.core.pathentry">
+<pathentry kind="con" path="com.mobilesorcery.mosync.includepaths"/>
+</storageModule>
+</cconfiguration>
+</storageModule>
+</cproject>
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project supports-build-configs="true" version="1.2">
+<build.cfg id="Debug" types="Debug"/>
+<build.cfg id="Release" types="Release"/>
+<properties>
+<property key="build.prefs:additional.include.paths" value="%mosync-home%/include"/>
+<property key="build.prefs:additional.include.paths/Debug" value="./, ./lua/inc/, ./lua/src/"/>
+<property key="build.prefs:additional.include.paths/Release" value="./, ./lua/inc/, ./lua/src/"/>
+<property key="build.prefs:additional.libraries" value="mastd.lib"/>
+<property key="build.prefs:additional.libraries/Debug" value=""/>
+<property key="build.prefs:additional.libraries/Release" value=""/>
+<property key="build.prefs:additional.library.paths" value="%mosync-home%/lib/pipe"/>
+<property key="build.prefs:additional.library.paths/Debug" value=""/>
+<property key="build.prefs:additional.library.paths/Release" value=""/>
+<property key="build.prefs:app.permissions" value="File\ Storage Internet\ Access Vibrate"/>
+<property key="build.prefs:extra.link.sw/Debug" value=""/>
+<property key="build.prefs:extra.link.sw/Release" value=""/>
+<property key="build.prefs:extra.res.sw/Debug" value=""/>
+<property key="build.prefs:extra.res.sw/Release" value=""/>
+<property key="build.prefs:gcc.switches/Debug" value="-O0 -DMOSYNC "/>
+<property key="build.prefs:gcc.switches/Release" value="-O2 -DMOSYNC -DTOLUA_RELEASE"/>
+<property key="build.prefs:gcc.warnings/Debug" value="0"/>
+<property key="build.prefs:gcc.warnings/Release" value="0"/>
+<property key="build.prefs:ignore.default.include.paths" value="true"/>
+<property key="build.prefs:ignore.default.include.paths/Debug" value="false"/>
+<property key="build.prefs:ignore.default.include.paths/Release" value="false"/>
+<property key="build.prefs:ignore.default.libraries" value="true"/>
+<property key="build.prefs:ignore.default.libraries/Debug" value="true"/>
+<property key="build.prefs:ignore.default.libraries/Release" value="true"/>
+<property key="build.prefs:ignore.default.library.paths" value="true"/>
+<property key="build.prefs:ignore.default.library.paths/Debug" value="false"/>
+<property key="build.prefs:ignore.default.library.paths/Release" value="false"/>
+<property key="build.prefs:project.type" value="lib"/>
+<property key="dependency.strategy" value="0"/>
+<property key="excludes/Debug" value=""/>
+<property key="excludes/Release" value=""/>
+<property key="template.id" value="project.empty"/>
+</properties>
+</project>
View
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>LuaLib</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.mobilesorcery.sdk.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.mobilesorcery.sdk.core.nature</nature>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2010 MoSync AB
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef MOBILELUA_LUAENGINE_H
+#define MOBILELUA_LUAENGINE_H
+
+#include <mawstring.h>
+#include <MAUtil/HashMap.h>
+#include <MAUtil/String.h>
+#include <MAUI/Font.h>
+
+#include "LuaErrorListener.h"
+
+namespace MobileLua
+{
+
+/**
+ * Wrapper for the Lua interpreter.
+ */
+class LuaEngine
+{
+public:
+
+ /**
+ * Constructor.
+ */
+ LuaEngine();
+
+ /**
+ * Destructor.
+ */
+ virtual ~LuaEngine();
+
+// /**
+// * High-level entry point for executing a Lua script.
+// * Initializes the Lua interpreter, then evaluates the code
+// * in the script and enters the event loop. Cleans up after
+// * the event loop exits.
+// * @param script String with Lua code.
+// * @return Non-zero if successful, zero on error.
+// */
+// virtual int run(const char* script);
+//
+// /**
+// * High-level entry point for executing a Lua script contained
+// * in a resource handle.
+// * Initializes the Lua interpreter, then evaluates the code
+// * in the script and enters the event loop. Cleans up after
+// * the event loop exits.
+// * @param scriptResourceId Handle to data object with Lua code,
+// * typically a resource id.
+// * @return Non-zero if successful, zero on error.
+// */
+// virtual int run(MAHandle scriptResourceId);
+
+ /**
+ * Initialize the Lua engine.
+ * @return Non-zero if successful, zero on error.
+ */
+ virtual int initialize();
+
+ /**
+ * Shutdown the Lua engine.
+ */
+ virtual void shutdown();
+
+ /**
+ * Evaluate a Lua script.
+ * @param script String with Lua code.
+ * @return Non-zero if successful, zero on error.
+ */
+ virtual int eval(const char* script);
+
+ /**
+ * Helper method that evaluates a Lua script contained in
+ * a resource handle.
+ * @param scriptResourceId Handle to data object with Lua code,
+ * typically a resource id.
+ * @return Non-zero if successful, zero on error.
+ */
+ virtual int eval(MAHandle scriptResourceId);
+
+ /**
+ * Set a listener that will get notified when there is a
+ * Lua error.
+ */
+ virtual void setLuaErrorListener(LuaErrorListener* listener);
+
+ /**
+ * Called to report a Lua error (for private use, really).
+ */
+ virtual void reportLuaError(const char* errorMessage);
+
+public:
+ /**
+ * The Lua execution state (using void* rather than
+ * lua_State* to avoid including lua.h, since this file
+ * is includes in application code).
+ */
+ void* mLuaState;
+
+ /**
+ * Last Lua error message.
+ */
+ MAUtil::String mLastLuaErrorMessage;
+
+ /**
+ * Listener called when a Lua error occurs.
+ */
+ LuaErrorListener* mLuaErrorListener;
+};
+
+}
+
+#endif
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2010 MoSync AB
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef MOBILELUA_LUAERRORLISTENER_H
+#define MOBILELUA_LUAERRORLISTENER_H
+
+namespace MobileLua
+{
+
+/**
+ * Interface used to capture error messages from the Lua interpreter.
+ */
+class LuaErrorListener
+{
+public:
+ virtual void onError(const char* errorMessage) = 0;
+};
+
+} // namespace MobileLua
+
+#endif
+
@@ -0,0 +1,23 @@
+/* Copyright (C) 2011 Mobile Sorcery AB
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License, version 2, as published by
+the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+*/
+
+#ifndef MOBILELUA_SCALEIMAGE_H
+#define MOBILELUA_SCALEIMAGE_H
+
+#include "SystemAPI.h"
+
+#endif
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2011 MoSync AB
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef MOBILELUA_SYSTEMAPI_H
+#define MOBILELUA_SYSTEMAPI_H
+
+#include <ma.h>
+#include "toluabindings/lua_systemapi.h"
+
+#endif
@@ -0,0 +1,8 @@
+#ifndef MOSYNC_ASSERT_H
+#define MOSYNC_ASSERT_H
+
+#include <maassert.h>
+
+#define assert(EXPR) MAASSERT(EXPR)
+
+#endif
@@ -0,0 +1,6 @@
+#ifndef MOSYNC_CTYPE_H
+#define MOSYNC_CTYPE_H
+
+//#include <stdint.h>
+
+#endif
@@ -0,0 +1,8 @@
+#ifndef MOSYNC_ERRNO_H
+#define MOSYNC_ERRNO_H
+
+//#include <stdint.h>
+
+extern int errno;
+
+#endif
@@ -0,0 +1,4 @@
+#ifndef MOSYNC_LOCALE_H
+#define MOSYNC_LOCALE_H
+
+#endif
@@ -0,0 +1,11 @@
+#ifndef MOSYNC_MATH_H
+#define MOSYNC_MATH_H
+
+#include <mastdlib.h>
+#include <maapi.h>
+
+#ifndef HUGE_VAL
+#define HUGE_VAL (1.0e999999999)
+#endif
+
+#endif
@@ -0,0 +1,7 @@
+#ifndef MOSYNC_TIME_H
+#define MOSYNC_TIME_H
+
+// To make code compile, we don't have setjmp/longjmp on MoSync.
+typedef unsigned int jmp_buf;
+
+#endif
@@ -0,0 +1,6 @@
+#ifndef MOSYNC_STDARG_H
+#define MOSYNC_STDARG_H
+
+#include <maarg.h>
+
+#endif
@@ -0,0 +1,7 @@
+#ifndef MOSYNC_STDDEF_H
+#define MOSYNC_STDDEF_H
+
+#include <ma.h>
+#include <stdint.h>
+
+#endif
@@ -0,0 +1,21 @@
+#ifndef MOSYNC_STDIO_H
+#define MOSYNC_STDIO_H
+
+#include <MAFS/File.h>
+
+#define BUFSIZ 1024
+#define L_tmpnam FILENAME_MAX
+
+#define _IOFBF 0 /* setvbuf should set fully buffered */
+#define _IOLBF 1 /* setvbuf should set line buffered */
+#define _IONBF 2 /* setvbuf should set unbuffered */
+
+extern FILE* stdin;
+extern FILE* stdout;
+extern FILE* stderr;
+
+FILE* freopen(const char* path, const char* mode, FILE* fp);
+//int setvbuf(FILE *stream, char *buf, int mode, size_t size);
+FILE* tmpfile(void);
+
+#endif
Oops, something went wrong.

0 comments on commit 39633d1

Please sign in to comment.