[asterisk-commits] russell: trunk r97641 - in /trunk: ./ pbx/pbx_gtkconsole.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jan 9 16:27:50 CST 2008
Author: russell
Date: Wed Jan 9 16:27:50 2008
New Revision: 97641
URL: http://svn.digium.com/view/asterisk?view=rev&rev=97641
Log:
Merged revisions 97640 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r97640 | russell | 2008-01-09 16:26:33 -0600 (Wed, 09 Jan 2008) | 3 lines
Make pbx_gtkconsole build ... but doesn't actually load on my system still
(related to issue #11706)
........
Modified:
trunk/ (props changed)
trunk/pbx/pbx_gtkconsole.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/pbx/pbx_gtkconsole.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_gtkconsole.c?view=diff&rev=97641&r1=97640&r2=97641
==============================================================================
--- trunk/pbx/pbx_gtkconsole.c (original)
+++ trunk/pbx/pbx_gtkconsole.c Wed Jan 9 16:27:50 2008
@@ -44,6 +44,7 @@
#include "asterisk/logger.h"
#include "asterisk/cli.h"
#include "asterisk/utils.h"
+#include "asterisk/paths.h"
AST_MUTEX_DEFINE_STATIC(verb_lock);
@@ -52,8 +53,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;
@@ -71,7 +70,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 */
@@ -97,7 +96,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;
@@ -105,8 +104,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();
@@ -127,11 +124,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);
}
@@ -156,7 +153,7 @@
c++;
n = *c;
*c = '\0';
- __verboser(l, 0, 0, 1);
+ __verboser(l);
*(c - 1) = '\0';
*c = n;
l = c;
@@ -173,14 +170,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();
@@ -193,13 +189,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();
@@ -287,7 +284,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));
@@ -413,7 +410,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);
@@ -469,7 +466,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");
@@ -492,14 +489,8 @@
return AST_MODULE_LOAD_SUCCESS;
}
-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