Use new module struct with apis
authorMyhailo Danylenko <isbear@ukrpost.net>
Sun, 14 Mar 2010 21:45:48 +0200
changeset 12 14cd74b518ea
parent 11 dc7bcc0fa5e1
child 13 dbb001e9f800
Use new module struct with apis
CMakeLists.txt
config.h.in
env.c
--- a/CMakeLists.txt	Thu Mar 04 19:51:17 2010 +0200
+++ b/CMakeLists.txt	Sun Mar 14 21:45:48 2010 +0200
@@ -16,6 +16,7 @@
 
 cmake_minimum_required(VERSION 2.6) 
 project(env C) 
+set(PROJECT_VERSION "0.0.1")
 
 ## User settable options
  
@@ -30,6 +31,7 @@
 add_library(env MODULE env.c) 
 
 ## Compiler setup
+configure_file(config.h.in config.h)
 include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} 
                     ${MCABBER_INCLUDE_DIRS})
 target_link_libraries(env ${GLIB_LIBRARIES} 
@@ -39,7 +41,7 @@
 
 ## Packaging information
 set(CPACK_PACKAGE_NAME libmcabber-env)
-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 "Debug module to access mcabber environment")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config.h.in	Sun Mar 14 21:45:48 2010 +0200
@@ -0,0 +1,8 @@
+
+#ifndef LOCAL_CONFIG_H
+#define LOCAL_CONFIG_H
+
+#define PROJECT_VERSION ( "${PROJECT_VERSION}" )
+
+#endif
+
--- a/env.c	Thu Mar 04 19:51:17 2010 +0200
+++ b/env.c	Sun Mar 14 21:45:48 2010 +0200
@@ -30,14 +30,33 @@
 #include <mcabber/logprint.h>
 #include <mcabber/modules.h>
 
+#include "config.h"
+
 static void env_load   (void);
 static void env_unload (void);
 
+#define DESCRIPTION ( "Some debugging routines\nProvides commands /env and /cd" )
+
+static module_info_t info_env_experimental = {
+	.branch      = "experimental",
+	.api         = 5,
+	.version     = PROJECT_VERSION,
+	.description = DESCRIPTION,
+	.requires    = NULL,
+	.init        = env_load,
+	.uninit      = env_unload,
+	.next        = &info_env_experimental,
+};
+
 module_info_t info_env = {
-	.mcabber_version = "0.10.0",
-	.requires        = NULL,
-	.init            = env_load,
-	.uninit          = env_unload,
+	.branch      = "dev",
+	.api         = 4,
+	.version     = PROJECT_VERSION,
+	.description = DESCRIPTION,
+	.requires    = NULL,
+	.init        = env_load,
+	.uninit      = env_unload,
+	.next        = &info_env_experimental,
 };
 
 extern char **environ;