stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src clone/ccl.c include/ccl.h


From: Jimmy Salmon
Subject: [Stratagus-CVS] stratagus/src clone/ccl.c include/ccl.h
Date: Thu, 20 Nov 2003 12:21:35 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Jimmy Salmon <address@hidden>   03/11/20 12:21:34

Modified files:
        src/clone      : ccl.c 
        src/include    : ccl.h 

Log message:
        Added LuaTo* functions

Patches:
Index: stratagus/src/clone/ccl.c
diff -u stratagus/src/clone/ccl.c:1.137 stratagus/src/clone/ccl.c:1.138
--- stratagus/src/clone/ccl.c:1.137     Thu Nov 20 11:18:34 2003
+++ stratagus/src/clone/ccl.c   Thu Nov 20 12:21:32 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl.c,v 1.137 2003/11/20 16:18:34 pludov Exp $
+//     $Id: ccl.c,v 1.138 2003/11/20 17:21:32 jsalmon3 Exp $
 
 //@{
 
@@ -205,6 +205,24 @@
     LuaLoadFile(buf);
     return 0;
 }
+
+global const char* LuaToString(lua_State* l, int narg)
+{
+    luaL_checktype(l, narg, LUA_TSTRING);
+    return lua_tostring(l, narg);
+}
+
+global lua_Number LuaToNumber(lua_State* l, int narg)
+{
+    luaL_checktype(l, narg, LUA_TNUMBER);
+    return lua_tonumber(l, narg);
+}
+
+global int LuaToBoolean(lua_State* l, int narg)
+{
+    luaL_checktype(l, narg, LUA_TBOOLEAN);
+    return lua_toboolean(l, narg);
+}
 #endif
 
 /** 
@@ -2037,7 +2055,7 @@
     }
 
     fprintf(fd, ";;; -----------------------------------------\n");
-    fprintf(fd, ";;; $Id: ccl.c,v 1.137 2003/11/20 16:18:34 pludov Exp $\n");
+    fprintf(fd, ";;; $Id: ccl.c,v 1.138 2003/11/20 17:21:32 jsalmon3 Exp $\n");
 
     fprintf(fd, "(set-video-resolution! %d %d)\n", VideoWidth, VideoHeight);
     fprintf(fd, "(set-group-keys \"");
@@ -2068,7 +2086,7 @@
     }
 
     fprintf(fd, "--[[\n");
-    fprintf(fd, "      $Id: ccl.c,v 1.137 2003/11/20 16:18:34 pludov Exp $\n");
+    fprintf(fd, "      $Id: ccl.c,v 1.138 2003/11/20 17:21:32 jsalmon3 Exp 
$\n");
     fprintf(fd, "]]\n");
 
     fprintf(fd, "SetVideoResolution(%d, %d)\n", VideoWidth, VideoHeight);
@@ -2095,7 +2113,7 @@
     }
 
     fprintf(fd, ";;; -----------------------------------------\n");
-    fprintf(fd, ";;; $Id: ccl.c,v 1.137 2003/11/20 16:18:34 pludov Exp $\n");
+    fprintf(fd, ";;; $Id: ccl.c,v 1.138 2003/11/20 17:21:32 jsalmon3 Exp $\n");
 
     // Global options
     if (OriginalFogOfWar) {
@@ -2176,7 +2194,7 @@
     }
 
     fprintf(fd, "--[[\n");
-    fprintf(fd, "      $Id: ccl.c,v 1.137 2003/11/20 16:18:34 pludov Exp $\n");
+    fprintf(fd, "      $Id: ccl.c,v 1.138 2003/11/20 17:21:32 jsalmon3 Exp 
$\n");
     fprintf(fd, "]]\n");
 
     fprintf(fd, "SetVideoFullscreen(%s)\n", VideoFullScreen ? "true" : 
"false");
@@ -2236,7 +2254,7 @@
     extern SCM oblistvar;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: CCL $Id: ccl.c,v 1.137 2003/11/20 16:18:34 
pludov Exp $\n\n");
+    CLprintf(file, ";;; MODULE: CCL $Id: ccl.c,v 1.138 2003/11/20 17:21:32 
jsalmon3 Exp $\n\n");
 
     for (list = oblistvar; gh_list_p(list); list = gh_cdr(list)) {
        SCM sym;
Index: stratagus/src/include/ccl.h
diff -u stratagus/src/include/ccl.h:1.43 stratagus/src/include/ccl.h:1.44
--- stratagus/src/include/ccl.h:1.43    Fri Nov 14 11:47:41 2003
+++ stratagus/src/include/ccl.h Thu Nov 20 12:21:34 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl.h,v 1.43 2003/11/14 16:47:41 pludov Exp $
+//     $Id: ccl.h,v 1.44 2003/11/20 17:21:34 jsalmon3 Exp $
 
 #ifndef __CCL_H__
 #define __CCL_H__
@@ -197,6 +197,9 @@
 extern void CclGcUnprotect(SCM* obj);  /// Unprotect scm var for GC
 extern void CclGcProtectedAssign(SCM* obj, SCM value); /// Alter garbage 
protected scm var.
 #elif defined(USE_LUA)
+extern const char* LuaToString(lua_State* l, int narg);
+extern lua_Number LuaToNumber(lua_State* l, int narg);
+extern int LuaToBoolean(lua_State* l, int narg);
 #endif
 extern void CclGarbageCollect(int fast);/// Perform garbage collection
 extern void CclFlushOutput();          /// Flush ccl output




reply via email to

[Prev in Thread] Current Thread [Next in Thread]