Update versions, add AVV description
authorMyhailo Danylenko <isbear@ukrpost.net>
Tue, 03 May 2011 18:51:48 +0300
changeset 17 f17c162d0c52
parent 16 d4571e41b19c
child 18 f419047da139
Update versions, add AVV description
CMakeLists.txt
config.h.in
yaubil.avv.in
yaubil.c
--- a/CMakeLists.txt	Tue May 03 02:30:10 2011 +0300
+++ b/CMakeLists.txt	Tue May 03 18:51:48 2011 +0300
@@ -60,9 +60,12 @@
 set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so")
 include(CPack)
 
+configure_file(yaubil.avv.in yaubil.avv)
+
 ## Installation
 install(TARGETS yaubil DESTINATION lib/mcabber) 
 install(FILES COPYING yaubil.rc README TODO DESTINATION share/doc/${CPACK_PACKAGE_NAME})
 install(DIRECTORY help DESTINATION share/mcabber)
+install(FILES ${PROJECT_BINARY_DIR}/yaubil.avv DESTINATION share/mcabber/avv/modules RENAME yaubil)
 
 ## 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:51:48 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/yaubil.avv.in	Tue May 03 18:51:48 2011 +0300
@@ -0,0 +1,9 @@
+
+Name:        ${PROJECT_NAME}
+Method:      glib
+Version:     ${PROJECT_VERSION}
+Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}
+Requires:    commands:4 + compl:3 + settings:1
+Init:        yaubil_init
+Uninit:      yaubil_uninit
+
--- a/yaubil.c	Tue May 03 02:30:10 2011 +0300
+++ b/yaubil.c	Tue May 03 18:51:48 2011 +0300
@@ -28,17 +28,18 @@
 #include <mcabber/logprint.h>
 #include <mcabber/settings.h>
 #include <mcabber/modules.h>
+#include <mcabber/api.h>
 
 #include "config.h"
 
-static void yaubil_init   (void);
-static void yaubil_uninit (void);
+void yaubil_init   (void);
+void yaubil_uninit (void);
 
 #define DESCRIPTION ( "Yet Another Useless Built-In Language\nProvides commands /multi, /if, /then, /else, /eval, /let" )
 
-static module_info_t info_yaubil_experimental = {
-	.branch      = "experimental",
-	.api         = 28,
+static module_info_t info_yaubil_dev = {
+	.branch      = "dev",
+	.api         = 20,
 	.version     = PROJECT_VERSION,
 	.description = DESCRIPTION,
 	.requires    = NULL,
@@ -47,19 +48,8 @@
 	.next        = NULL,
 };
 
-static module_info_t info_yaubil_dev = {
-	.branch      = "dev",
-	.api         = 13,
-	.version     = PROJECT_VERSION,
-	.description = DESCRIPTION,
-	.requires    = NULL,
-	.init        = yaubil_init,
-	.uninit      = yaubil_uninit,
-	.next        = &info_yaubil_experimental,
-};
-
 module_info_t info_yaubil = {
-	.branch      = "0.10.0",
+	.branch      = "0.10.1",
 	.api         = 1,
 	.version     = PROJECT_VERSION,
 	.description = DESCRIPTION,
@@ -69,14 +59,13 @@
 	.next        = &info_yaubil_dev,
 };
 
-#ifdef HAVE_CMD_ID
+#ifdef MCABBER_API_HAVE_CMD_ID
 static gpointer yaubil_multi_cmid = NULL;
 static gpointer yaubil_if_cmid    = NULL;
 static gpointer yaubil_then_cmid  = NULL;
 static gpointer yaubil_else_cmid  = NULL;
 static gpointer yaubil_eval_cmid  = NULL;
 static gpointer yaubil_let_cmid   = NULL;
-#ifdef HAVE_CMD_SAFE
 static gboolean yaubil_multi_set_safe = FALSE;
 static gboolean yaubil_if_set_safe    = FALSE;
 static gboolean yaubil_then_set_safe  = FALSE;
@@ -84,7 +73,6 @@
 static gboolean yaubil_eval_set_safe  = FALSE;
 static gboolean yaubil_let_set_safe   = FALSE;
 #endif
-#endif
 
 static gboolean ifresult = TRUE;
 
@@ -947,9 +935,9 @@
 		process_command (start, TRUE);
 }
 
-static void yaubil_init (void)
+void yaubil_init (void)
 {
-#ifndef HAVE_CMD_ID
+#ifndef MCABBER_API_HAVE_CMD_ID
 	cmd_add ("multi", "", COMPL_CMD, COMPL_CMD, do_multi, NULL);
 	cmd_add ("if", "", 0, 0, do_if, NULL);
 	cmd_add ("then", "", COMPL_CMD, COMPL_CMD, do_then, NULL);
@@ -963,7 +951,6 @@
 	yaubil_else_cmid  = cmd_add ("else", "", COMPL_CMD, COMPL_CMD, do_else, NULL);
 	yaubil_eval_cmid  = cmd_add ("eval", "", 0, 0, do_eval, NULL);
 	yaubil_let_cmid   = cmd_add ("let", "", 0, 0, do_let, NULL);
-#ifdef HAVE_CMD_SAFE
 	yaubil_multi_set_safe = cmd_set_safe ("multi", TRUE);
 	yaubil_if_set_safe    = cmd_set_safe ("if", TRUE);
 	yaubil_then_set_safe  = cmd_set_safe ("then", TRUE);
@@ -971,12 +958,11 @@
 	yaubil_eval_set_safe  = cmd_set_safe ("eval", TRUE);
 	yaubil_let_set_safe   = cmd_set_safe ("let", TRUE);
 #endif
-#endif
 }
 
-static void yaubil_uninit (void)
+void yaubil_uninit (void)
 {
-#ifndef HAVE_CMD_ID
+#ifndef MCABBER_API_HAVE_CMD_ID
 	cmd_del ("multi");
 	cmd_del ("if");
 	cmd_del ("then");
@@ -996,7 +982,6 @@
 		cmd_del (yaubil_eval_cmid);
 	if (yaubil_let_cmid)
 		cmd_del (yaubil_let_cmid);
-#ifdef HAVE_CMD_SAFE
 	if (yaubil_multi_set_safe)
 		cmd_set_safe ("multi", FALSE);
 	if (yaubil_if_set_safe)
@@ -1010,7 +995,6 @@
 	if (yaubil_let_set_safe)
 		cmd_set_safe ("let", FALSE);
 #endif
-#endif
 }
 
 /* The End */