Use new module struct with api version
authorMyhailo Danylenko <isbear@ukrpost.net>
Sun, 14 Mar 2010 22:10:17 +0200
changeset 95 f2f4c7810a72
parent 94 0379139a2003
child 96 270ce1cfc823
Use new module struct with api version
CMakeLists.txt
config.h.in
main.c
--- a/CMakeLists.txt	Thu Mar 11 19:35:18 2010 +0200
+++ b/CMakeLists.txt	Sun Mar 14 22:10:17 2010 +0200
@@ -17,6 +17,7 @@
 
 cmake_minimum_required(VERSION 2.6)
 project(lua C)
+set(PROJECT_VERSION "0.0.1")
 
 ## User options
 option(DEBUG "Enable debugging output" ON)
@@ -61,7 +62,7 @@
 
 ## Packaging information
 set(CPACK_PACKAGE_NAME libmcabber-lua)
-set(CPACK_PACKAGE_VERSION "0.0.1")
+set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
 set(CPACK_PACKAGE_VENDOR "IsBear")
 set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>")
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mcabber lua module")
--- a/config.h.in	Thu Mar 11 19:35:18 2010 +0200
+++ b/config.h.in	Sun Mar 14 22:10:17 2010 +0200
@@ -34,6 +34,8 @@
 // priority of glib event sources for timeout and bgread
 #define MLUA_SOURCE_PRIORITY ( ${ML_SOURCE_PRIORITY} )
 
+#define PROJECT_VERSION ( "${PROJECT_VERSION}" )
+
 #ifdef DEBUG
 #  include <stdio.h>
 
--- a/main.c	Thu Mar 11 19:35:18 2010 +0200
+++ b/main.c	Sun Mar 14 22:10:17 2010 +0200
@@ -46,11 +46,38 @@
 static void mlua_init   (void);
 static void mlua_uninit (void);
 
+#ifdef LLM_LOG_HANDLER
+#define DESCRIPTION ( \
+	"Lua scripting interface\n" \
+	"Recognizes options lua_init_file, lua_hook_function and lua_lm_debug\n" \
+	"Provides command /lua" )
+#else
+#define DESCRIPTION ( \
+	"Lua scripting interface\n" \
+	"Recognizes options lua_init_file and lua_hook_function\n" \
+	"Provides command /lua" )
+#endif
+
+static module_info_t info_lua_experimental = {
+	.branch      = "experimental",
+	.api         = 5,
+	.version     = PROJECT_VERSION,
+	.description = DESCRIPTION,
+	.requires    = NULL,
+	.init        = mlua_init,
+	.uninit      = mlua_uninit,
+	.next        = NULL,
+};
+
 module_info_t info_lua = {
-	.mcabber_version = "0.10.0",
-	.requires        = NULL,
-	.init            = mlua_init,
-	.uninit          = mlua_uninit,
+	.branch      = "dev",
+	.api         = 4,
+	.version     = PROJECT_VERSION,
+	.description = DESCRIPTION,
+	.requires    = NULL,
+	.init        = mlua_init,
+	.uninit      = mlua_uninit,
+	.next        = &info_lua_experimental,
 };
 
 // global lua state object, necessary for uninitialization function