[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright gshterm/Makefile gshterm/gshterm.c gt...
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright gshterm/Makefile gshterm/gshterm.c gt... |
Date: |
Fri, 09 Feb 2007 16:10:42 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 07/02/09 16:10:42
Modified files:
gshterm : Makefile gshterm.c
gtkshell : updated_label.c
Added files:
gshterm : exit.c exit.h
Log message:
Split out functions performed at exit in gshterm.
Split out result verification in updated_label updater function.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/gshterm/Makefile?cvsroot=antiright&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/antiright/gshterm/gshterm.c?cvsroot=antiright&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/antiright/gshterm/exit.c?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gshterm/exit.h?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated_label.c?cvsroot=antiright&r1=1.2&r2=1.3
Patches:
Index: gshterm/Makefile
===================================================================
RCS file: /sources/antiright/antiright/gshterm/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- gshterm/Makefile 9 Feb 2007 16:02:03 -0000 1.3
+++ gshterm/Makefile 9 Feb 2007 16:10:42 -0000 1.4
@@ -7,7 +7,7 @@
LDFLAGS+=`pkg-config --libs gtk+-2.0` -lgtkshell -lantiright
LDFLAGS+=`pkg-config --libs vte`
-objects=main.o gshterm.o command_line.o script.o
+objects=main.o gshterm.o command_line.o script.o exit.o
all: $(objects)
cc -o gshterm $(objects) $(LDFLAGS)
Index: gshterm/gshterm.c
===================================================================
RCS file: /sources/antiright/antiright/gshterm/gshterm.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- gshterm/gshterm.c 9 Feb 2007 16:02:03 -0000 1.3
+++ gshterm/gshterm.c 9 Feb 2007 16:10:42 -0000 1.4
@@ -22,27 +22,6 @@
#include "gshterm.h"
-extern char* gsh_geometry;
-
-void
-gshterm_delete_tmp(gpointer data)
-{
- char *sys_command;
-
- asprintf(&sys_command, "rm -f %s", (char*)data);
- system(sys_command);
- free(sys_command);
-}
-
-void
-gshterm_exit_cb(GtkWidget *widget, gpointer data)
-{
- UNUSED(widget);
-
- gshterm_delete_tmp(data);
- exit(0);
-}
-
void
gshterm_set_terminal_options(GtkWidget *terminal)
{
Index: gtkshell/updated_label.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/updated_label.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gtkshell/updated_label.c 7 Feb 2007 16:05:58 -0000 1.2
+++ gtkshell/updated_label.c 9 Feb 2007 16:10:42 -0000 1.3
@@ -23,6 +23,18 @@
#include "gtkshell.h"
void
+gsh_check_results(char **results)
+{
+ /* This ensures that the result string is not empty, avoiding certain
formatting problems. */
+ /* Otherwise, a GTK warning is produced. */
+ if(!strncmp(*results, "", 1))
+ {
+ free(*results);
+ asprintf(results, " ");
+ }
+}
+
+void
gsh_update_label(char *command, void *widget)
{
char *results;
@@ -33,13 +45,7 @@
results=antiright_pipe_read(command);
- /* This ensures that the result string is not empty, avoiding certain
formatting problems. */
- /* Otherwise, a GTK warning is produced. */
- if(!strncmp(results, "", 1))
- {
- free(results);
- asprintf(&results, " ");
- }
+ gsh_check_results(&results);
gsh_set_label((GtkWidget*)widget, results);
free(results);
Index: gshterm/exit.c
===================================================================
RCS file: gshterm/exit.c
diff -N gshterm/exit.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gshterm/exit.c 9 Feb 2007 16:10:42 -0000 1.1
@@ -0,0 +1,44 @@
+/*
+ AntiRight
+ (c) 2007 Jeffrey Bedard
+ address@hidden
+
+ This file is part of AntiRight.
+
+ AntiRight is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ AntiRight is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with AntiRight; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+*/
+
+#include "gshterm.h"
+
+void
+gshterm_delete_tmp(gpointer data)
+{
+ char *sys_command;
+
+ asprintf(&sys_command, "rm -f %s", (char*)data);
+ system(sys_command);
+ free(sys_command);
+}
+
+void
+gshterm_exit_cb(GtkWidget *widget, gpointer data)
+{
+ UNUSED(widget);
+
+ gshterm_delete_tmp(data);
+ exit(0);
+}
+
+
Index: gshterm/exit.h
===================================================================
RCS file: gshterm/exit.h
diff -N gshterm/exit.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gshterm/exit.h 9 Feb 2007 16:10:42 -0000 1.1
@@ -0,0 +1,30 @@
+/*
+ AntiRight
+ (c) 2007 Jeffrey Bedard
+ address@hidden
+
+ This file is part of AntiRight.
+
+ AntiRight is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ AntiRight is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with AntiRight; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+*/
+
+#ifndef GHSTERM_EXIT_H
+#define GSHTERM_EXIT_H
+
+void
+gshterm_exit_cb(GtkWidget *widget, gpointer data);
+
+#endif /* GSHTERM_EXIT_H */
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Antiright-devel] antiright gshterm/Makefile gshterm/gshterm.c gt...,
Jeffrey Bedard <=