giftcurs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[giFTcurs-commits] giFTcurs/src Makefile.am main.c parse.c screen....


From: Göran Weinholt
Subject: [giFTcurs-commits] giFTcurs/src Makefile.am main.c parse.c screen....
Date: Tue, 04 Nov 2003 18:40:45 -0500

CVSROOT:        /cvsroot/giftcurs
Module name:    giFTcurs
Branch:         
Changes by:     Göran Weinholt <address@hidden> 03/11/04 18:40:44

Modified files:
        src            : Makefile.am main.c parse.c screen.c screen.h 
                         test_utf8.c ui_console.c 

Log message:
        Use HAS_WIDE_CURSES to conditionally compile wcwidth.c and the utf8 
test suite. Other minor fixes included as a bonus.

Patches:
Index: giFTcurs/src/Makefile.am
diff -u giFTcurs/src/Makefile.am:1.62 giFTcurs/src/Makefile.am:1.63
--- giFTcurs/src/Makefile.am:1.62       Fri Oct 31 19:11:32 2003
+++ giFTcurs/src/Makefile.am    Tue Nov  4 18:40:44 2003
@@ -2,6 +2,13 @@
 
 bin_PROGRAMS = giFTcurs
 
+if HAS_WIDE_CURSES
+WIDE_TARGETS = wcwidth.c wcwidth.h
+WIDE_TESTS = test_utf8
+test_utf8_SOURCES = test_utf8.c parse.c list.c $(WIDE_TARGETS)
+test_utf8_LDADD = @INTLLIBS@ $(GLIB_LIBS)
+endif
+
 giFTcurs_SOURCES = \
        main.c        giftcurs.h \
        ban.c         ban.h \
@@ -25,7 +32,8 @@
        ui_settings.c \
        ui_transfer.c \
        format.c      format.h \
-       xcommon.c     xcommon.h
+       xcommon.c     xcommon.h \
+       $(WIDE_TARGETS)
 
 giFTcurs_LDADD = @INTLLIBS@ $(CURSES_LIBS) $(GLIB_LIBS)
 
@@ -40,16 +48,14 @@
 
 giFTwakeup_LDADD = $(GLIB_LIBS)
 
-TESTS = test_parse test_list test_gift test_utf8
-check_PROGRAMS = test_parse test_list test_gift test_utf8
-test_parse_SOURCES = test_parse.c parse.c list.c
+TESTS = test_parse test_list test_gift $(WIDE_TESTS)
+check_PROGRAMS = test_parse test_list test_gift $(WIDE_TESTS)
+test_parse_SOURCES = test_parse.c parse.c list.c $(WIDE_TARGETS)
 test_parse_LDADD = $(GLIB_LIBS)
 test_list_SOURCES = test_list.c list.c
 test_list_LDADD = $(GLIB_LIBS)
-test_gift_SOURCES = test_gift.c gift.c list.c parse.c protocol.c
+test_gift_SOURCES = test_gift.c gift.c list.c parse.c protocol.c 
$(WIDE_TARGETS)
 test_gift_LDADD = @INTLLIBS@ $(GLIB_LIBS)
-test_utf8_SOURCES = test_utf8.c parse.c list.c
-test_utf8_LDADD = @INTLLIBS@ $(GLIB_LIBS)
 
 localedir = $(datadir)/locale
 INCLUDES = -I../intl $(CURSES_INCLUDEDIR) $(GLIB_CFLAGS) 
-DLOCALEDIR=\"$(localedir)\"
Index: giFTcurs/src/main.c
diff -u giFTcurs/src/main.c:1.138 giFTcurs/src/main.c:1.139
--- giFTcurs/src/main.c:1.138   Tue Oct 14 15:47:59 2003
+++ giFTcurs/src/main.c Tue Nov  4 18:40:44 2003
@@ -18,7 +18,7 @@
  * along with giFTcurs; if not, write to the Free Software Foundation,
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,  USA.
  *
- * $Id: main.c,v 1.138 2003/10/14 19:47:59 weinholt Exp $
+ * $Id: main.c,v 1.139 2003/11/04 23:40:44 weinholt Exp $
  */
 #include "giftcurs.h"
 
@@ -47,7 +47,6 @@
 const char *profile_name = NULL;
 gboolean verbose = FALSE;
 #ifdef WIDE_NCURSES
-gboolean utf8 = FALSE;
 gboolean fancy_utf8 = FALSE;
 #endif
 static gboolean do_remap_linechars = 0;
Index: giFTcurs/src/parse.c
diff -u giFTcurs/src/parse.c:1.153 giFTcurs/src/parse.c:1.154
--- giFTcurs/src/parse.c:1.153  Tue Nov  4 10:55:37 2003
+++ giFTcurs/src/parse.c        Tue Nov  4 18:40:44 2003
@@ -18,7 +18,7 @@
  * along with giFTcurs; if not, write to the Free Software Foundation,
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,  USA.
  *
- * $Id: parse.c,v 1.153 2003/11/04 15:55:37 saturn Exp $
+ * $Id: parse.c,v 1.154 2003/11/04 23:40:44 weinholt Exp $
  */
 #include "giftcurs.h"
 
@@ -35,8 +35,11 @@
 #endif
 
 #include "parse.h"
+#include "wcwidth.h"
 
-gboolean utf8;
+#ifdef WIDE_CURSES
+gboolean utf8 = FALSE;
+#endif
 
 char *trim(char *src)
 {
@@ -346,8 +349,6 @@
 }
 
 #ifdef WIDE_NCURSES
-# include "wcwidth.c"
-
 /* Visual strlen(). */
 glong vstrlen(const char *str)
 {
Index: giFTcurs/src/screen.c
diff -u giFTcurs/src/screen.c:1.113 giFTcurs/src/screen.c:1.114
--- giFTcurs/src/screen.c:1.113 Mon Sep  8 13:52:06 2003
+++ giFTcurs/src/screen.c       Tue Nov  4 18:40:44 2003
@@ -18,7 +18,7 @@
  * along with giFTcurs; if not, write to the Free Software Foundation,
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,  USA.
  *
- * $Id: screen.c,v 1.113 2003/09/08 17:52:06 saturn Exp $
+ * $Id: screen.c,v 1.114 2003/11/04 23:40:44 weinholt Exp $
  */
 #include "giftcurs.h"
 
@@ -388,7 +388,7 @@
                return;
 
        /* Strip eventual trailing newline */
-       data.message = strdup(message);
+       data.message = g_strdup(message);
        g_strchomp(data.message);
 
        data.log_level = log_level;
Index: giFTcurs/src/screen.h
diff -u giFTcurs/src/screen.h:1.80 giFTcurs/src/screen.h:1.81
--- giFTcurs/src/screen.h:1.80  Sat Oct 18 09:20:10 2003
+++ giFTcurs/src/screen.h       Tue Nov  4 18:40:44 2003
@@ -18,7 +18,7 @@
  * along with giFTcurs; if not, write to the Free Software Foundation,
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,  USA.
  *
- * $Id: screen.h,v 1.80 2003/10/18 13:20:10 saturn Exp $
+ * $Id: screen.h,v 1.81 2003/11/04 23:40:44 weinholt Exp $
  */
 #ifndef _SCREEN_H
 #define _SCREEN_H
@@ -70,11 +70,6 @@
 
 /* Used for "exporting" the items[] list. */
 const char *item_name(int);
-
-/* OSF1 curses wants this defined, and ncursesw does too. */
-#if defined(USE_SYSV_CURSES) || defined(WIDE_NCURSES)
-#define _XOPEN_SOURCE_EXTENDED
-#endif
 
 #if defined(USE_NCURSES) && !defined(RENAMED_NCURSES)
 # include <ncurses.h>
Index: giFTcurs/src/test_utf8.c
diff -u giFTcurs/src/test_utf8.c:1.2 giFTcurs/src/test_utf8.c:1.3
--- giFTcurs/src/test_utf8.c:1.2        Tue Nov  4 10:55:37 2003
+++ giFTcurs/src/test_utf8.c    Tue Nov  4 18:40:44 2003
@@ -18,7 +18,7 @@
  * along with giFTcurs; if not, write to the Free Software Foundation,
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,  USA.
  *
- * $Id: test_utf8.c,v 1.2 2003/11/04 15:55:37 saturn Exp $
+ * $Id: test_utf8.c,v 1.3 2003/11/04 23:40:44 weinholt Exp $
  */
 #include "giftcurs.h"
 
@@ -36,8 +36,6 @@
 #define PASS                   0
 #define MAX_TIME               10
 
-#ifdef WIDE_NCURSES
-
 static int test_vstrlen(void);
 static int test_str_occupy(void);
 static int test_addstr(void);
@@ -205,12 +203,3 @@
 
        return ret;
 }
-
-#else
-
-int main(int argc, char *argv[])
-{
-       puts("Not compiled with unicode support - test skipped.");
-       return PASS;
-}
-#endif
Index: giFTcurs/src/ui_console.c
diff -u giFTcurs/src/ui_console.c:1.15 giFTcurs/src/ui_console.c:1.16
--- giFTcurs/src/ui_console.c:1.15      Sat Aug 23 12:51:09 2003
+++ giFTcurs/src/ui_console.c   Tue Nov  4 18:40:44 2003
@@ -18,7 +18,7 @@
  * along with giFTcurs; if not, write to the Free Software Foundation,
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,  USA.
  *
- * $Id: ui_console.c,v 1.15 2003/08/23 16:51:09 weinholt Exp $
+ * $Id: ui_console.c,v 1.16 2003/11/04 23:40:44 weinholt Exp $
  */
 #include "giftcurs.h"
 
@@ -166,7 +166,7 @@
                        list_remove_entry(&messages, 0);
                }
        }
-       dynarray_append(&log_entries, strdup(msg));
+       dynarray_append(&log_entries, g_strdup(msg));
 
        wrap_lines(&messages, msg, build_width);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]