yaubil.c
changeset 17 f17c162d0c52
parent 14 026c65e3e7d8
child 19 78535784faa7
--- 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 */