--- a/CMakeLists.txt Tue May 03 02:30:10 2011 +0300
+++ b/CMakeLists.txt Tue May 03 18:36:19 2011 +0300
@@ -60,9 +60,12 @@
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so")
include(CPack)
+configure_file(templatecmd.avv.in templatecmd.avv)
+
## Installation
install(TARGETS templatecmd DESTINATION lib/mcabber)
install(FILES templatecmd.rc TODO README COPYING DESTINATION share/doc/${CPACK_PACKAGE_NAME})
install(DIRECTORY help DESTINATION share/mcabber)
+install(FILES ${PROJECT_BINARY_DIR}/templatecmd.avv DESTINATION share/mcabber/avv/modules RENAME templatecmd)
## The End ## vim: se ts=4: ##
--- a/config.h.in Tue May 03 02:30:10 2011 +0300
+++ b/config.h.in Tue May 03 18:36:19 2011 +0300
@@ -2,15 +2,6 @@
#ifndef LOCAL_CONFIG_H
#define LOCAL_CONFIG_H
-#include <mcabber/config.h>
-
-#if MCABBER_BRANCH_EXPERIMENTAL && MCABBER_API_VERSION >= 27
-# define HAVE_CMD_ID
-# if MCABBER_API_VERSION >= 28
-# define HAVE_CMD_SAFE
-# endif
-#endif
-
#define PROJECT_VERSION ( "${PROJECT_VERSION}" )
#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templatecmd.avv.in Tue May 03 18:36:19 2011 +0300
@@ -0,0 +1,9 @@
+
+Name: ${PROJECT_NAME}
+Method: glib
+Version: ${PROJECT_VERSION}
+Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}
+Requires: commands:4 + compl:3 + utils:2 + logprint:3
+Init: tcmd_init
+Uninit: tcmd_uninit
+
--- a/templatecmd.c Tue May 03 02:30:10 2011 +0300
+++ b/templatecmd.c Tue May 03 18:36:19 2011 +0300
@@ -25,17 +25,18 @@
#include <mcabber/utils.h>
#include <mcabber/logprint.h>
#include <mcabber/modules.h>
+#include <mcabber/api.h>
#include "config.h"
-static void tcmd_init (void);
-static void tcmd_uninit (void);
+void tcmd_init (void);
+void tcmd_uninit (void);
#define DESCRIPTION ( "Templated commands\nProvides command /templatecmd (and any commands, you define with it)" )
-static module_info_t info_templatecmd_experimental = {
- .branch = "experimental",
- .api = 28,
+static module_info_t info_templatecmd_dev = {
+ .branch = "dev",
+ .api = 20,
.version = PROJECT_VERSION,
.description = DESCRIPTION,
.requires = NULL,
@@ -44,19 +45,8 @@
.next = NULL,
};
-static module_info_t info_templatecmd_dev = {
- .branch = "dev",
- .api = 13,
- .version = PROJECT_VERSION,
- .description = DESCRIPTION,
- .requires = NULL,
- .init = tcmd_init,
- .uninit = tcmd_uninit,
- .next = &info_templatecmd_experimental,
-};
-
module_info_t info_templatecmd = {
- .branch = "0.10.0",
+ .branch = "0.10.1",
.api = 1,
.version = PROJECT_VERSION,
.description = DESCRIPTION,
@@ -68,7 +58,7 @@
typedef struct {
gchar *name;
-#ifdef HAVE_CMD_ID
+#ifdef MCABBER_API_HAVE_CMD_ID
gpointer id;
#endif
gchar *template;
@@ -76,12 +66,10 @@
gboolean stararg;
} tcmd_t;
-#ifdef HAVE_CMD_ID
+#ifdef MCABBER_API_HAVE_CMD_ID
static gpointer tcmd_cmid = NULL;
-#ifdef HAVE_CMD_SAFE
static gboolean tcmd_set_safe = FALSE;
#endif
-#endif
static GSList *template_commands = NULL;
@@ -188,7 +176,7 @@
if (!*astart) { // delete tcmd
if (template_command) {
-#ifndef HAVE_CMD_ID
+#ifndef MCABBER_API_HAVE_CMD_ID
cmd_del (template_command -> name);
#else
if (template_command -> id)
@@ -236,7 +224,7 @@
template_commands = g_slist_append (template_commands, template_command);
-#ifndef HAVE_CMD_ID
+#ifndef MCABBER_API_HAVE_CMD_ID
cmd_add (template_command -> name, "", 0, 0, (void (*) (char *arg)) tcmd_callback, template_command);
#else
template_command -> id = cmd_add (template_command -> name, "", 0, 0, (void (*) (char *arg)) tcmd_callback, template_command);
@@ -246,36 +234,32 @@
}
-static void tcmd_init (void)
+void tcmd_init (void)
{
-#ifndef HAVE_CMD_ID
+#ifndef MCABBER_API_HAVE_CMD_ID
cmd_add ("templatecmd", "", COMPL_CMD, COMPL_CMD, do_templatecmd, NULL);
#else
tcmd_cmid = cmd_add ("templatecmd", "", COMPL_CMD, COMPL_CMD, do_templatecmd, NULL);
-#ifdef HAVE_CMD_SAFE
tcmd_set_safe = cmd_set_safe ("templatecmd", TRUE);
#endif
-#endif
}
-static void tcmd_uninit (void)
+void tcmd_uninit (void)
{
GSList *tel;
-#ifndef HAVE_CMD_ID
+#ifndef MCABBER_API_HAVE_CMD_ID
cmd_del ("templatecmd");
#else
if (tcmd_cmid)
cmd_del (tcmd_cmid);
-#ifdef HAVE_CMD_SAFE
if (tcmd_set_safe)
cmd_set_safe ("templatecmd", FALSE);
#endif
-#endif
for (tel = template_commands; tel; tel = tel -> next) {
tcmd_t *template_command = (tcmd_t *) tel -> data;
-#ifndef HAVE_CMD_ID
+#ifndef MCABBER_API_HAVE_CMD_ID
cmd_del (template_command -> name);
#else
if (template_command -> id)