[asterisk-commits] russell: branch 1.4 r97640 - /branches/1.4/pbx/pbx_gtkconsole.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jan 9 16:26:33 CST 2008
Author: russell
Date: Wed Jan 9 16:26:33 2008
New Revision: 97640
URL: http://svn.digium.com/view/asterisk?view=rev&rev=97640
Log:
Make pbx_gtkconsole build ... but doesn't actually load on my system still
(related to issue #11706)
Modified:
branches/1.4/pbx/pbx_gtkconsole.c
Modified: branches/1.4/pbx/pbx_gtkconsole.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/pbx_gtkconsole.c?view=diff&rev=97640&r1=97639&r2=97640
==============================================================================
--- branches/1.4/pbx/pbx_gtkconsole.c (original)
+++ branches/1.4/pbx/pbx_gtkconsole.c Wed Jan 9 16:26:33 2008
@@ -51,6 +51,7 @@
#include "asterisk/options.h"
#include "asterisk/cli.h"
#include "asterisk/utils.h"
+#include "asterisk/paths.h"
AST_MUTEX_DEFINE_STATIC(verb_lock);
@@ -59,8 +60,6 @@
static int inuse=0;
static int clipipe[2];
static int cleanupid = -1;
-
-static char *dtext = "Asterisk PBX Console (GTK Version)";
static GtkWidget *window;
static GtkWidget *quit;
@@ -78,7 +77,7 @@
gtk_statusbar_push(GTK_STATUSBAR(statusbar), 1, msg);
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
if (inuse) {
/* Kill off the main thread */
@@ -104,7 +103,7 @@
}
-static void __verboser(const char *stuff, int opos, int replacelast, int complete)
+static void __verboser(const char *stuff)
{
char *s2[2];
struct timeval tv;
@@ -112,8 +111,6 @@
s2[0] = (char *)stuff;
s2[1] = NULL;
gtk_clist_freeze(GTK_CLIST(verb));
- if (replacelast)
- gtk_clist_remove(GTK_CLIST(verb), GTK_CLIST(verb)->rows - 1);
gtk_clist_append(GTK_CLIST(verb), s2);
if (!ast_tvzero(last)) {
gdk_threads_leave();
@@ -134,11 +131,11 @@
}
}
-static void verboser(const char *stuff, int opos, int replacelast, int complete)
+static void verboser(const char *stuff)
{
ast_mutex_lock(&verb_lock);
/* Lock appropriately if we're really being called in verbose mode */
- __verboser(stuff, opos, replacelast, complete);
+ __verboser(stuff);
ast_mutex_unlock(&verb_lock);
}
@@ -163,7 +160,7 @@
c++;
n = *c;
*c = '\0';
- __verboser(l, 0, 0, 1);
+ __verboser(l);
*(c - 1) = '\0';
*c = n;
l = c;
@@ -180,14 +177,13 @@
}
-
static void remove_module(void)
{
int res;
char *module;
char buf[256];
if (GTK_CLIST(modules)->selection) {
- module= (char *)gtk_clist_get_row_data(GTK_CLIST(modules), (int) GTK_CLIST(modules)->selection->data);
+ module = (char *) gtk_clist_get_row_data(GTK_CLIST(modules), (long) GTK_CLIST(modules)->selection->data);
gdk_threads_leave();
res = ast_unload_resource(module, 0);
gdk_threads_enter();
@@ -200,13 +196,14 @@
}
}
}
-static int reload_module(void *mod)
+
+static int reload(void)
{
int res, x;
char *module;
char buf[256];
if (GTK_CLIST(modules)->selection) {
- module= (char *)gtk_clist_get_row_data(GTK_CLIST(modules), (int) GTK_CLIST(modules)->selection->data);
+ module= (char *)gtk_clist_get_row_data(GTK_CLIST(modules), (long) GTK_CLIST(modules)->selection->data);
module = strdup(module);
if (module) {
gdk_threads_leave();
@@ -294,7 +291,7 @@
char *module= NULL;
/* Update the mod stuff */
if (GTK_CLIST(modules)->selection) {
- module= (char *)gtk_clist_get_row_data(GTK_CLIST(modules), (int) GTK_CLIST(modules)->selection->data);
+ module= (char *)gtk_clist_get_row_data(GTK_CLIST(modules), (long) GTK_CLIST(modules)->selection->data);
}
gtk_clist_freeze(GTK_CLIST(modules));
gtk_clist_clear(GTK_CLIST(modules));
@@ -421,7 +418,7 @@
gtk_signal_connect(GTK_OBJECT(add), "clicked",
GTK_SIGNAL_FUNC (add_module), window);
gtk_signal_connect(GTK_OBJECT(reloadw), "clicked",
- GTK_SIGNAL_FUNC (reload_module), window);
+ GTK_SIGNAL_FUNC (reload), window);
bbox = gtk_vbox_new(FALSE, 5);
gtk_widget_show(bbox);
@@ -477,7 +474,7 @@
}
-static int load_module(void *mod)
+static int load_module(void)
{
if (pipe(clipipe)) {
ast_log(LOG_WARNING, "Unable to create CLI pipe\n");
@@ -501,14 +498,8 @@
return 0;
}
-static const char *description(void)
-{
- return dtext;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, reload_module, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "GTK Console",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
More information about the asterisk-commits
mailing list