[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[giFTcurs-commits] giFTcurs/src Makefile.am parse.c parse.h ui_dra...
From: |
Christian Häggström |
Subject: |
[giFTcurs-commits] giFTcurs/src Makefile.am parse.c parse.h ui_dra... |
Date: |
Fri, 31 Oct 2003 19:11:35 -0500 |
CVSROOT: /cvsroot/giftcurs
Module name: giFTcurs
Branch:
Changes by: Christian Häggström <address@hidden> 03/10/31 19:11:34
Modified files:
src : Makefile.am parse.c parse.h ui_draw.c ui_draw.h
Added files:
src : test_utf8.c
Log message:
test module for utf-8 handling
Patches:
Index: giFTcurs/src/Makefile.am
diff -u giFTcurs/src/Makefile.am:1.61 giFTcurs/src/Makefile.am:1.62
--- giFTcurs/src/Makefile.am:1.61 Tue Aug 19 10:54:17 2003
+++ giFTcurs/src/Makefile.am Fri Oct 31 19:11:32 2003
@@ -40,14 +40,16 @@
giFTwakeup_LDADD = $(GLIB_LIBS)
-TESTS = test_parse test_list test_gift
-check_PROGRAMS = test_parse test_list test_gift
+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
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_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/parse.c
diff -u giFTcurs/src/parse.c:1.149 giFTcurs/src/parse.c:1.150
--- giFTcurs/src/parse.c:1.149 Fri Oct 17 12:39:00 2003
+++ giFTcurs/src/parse.c Fri Oct 31 19:11:33 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.149 2003/10/17 16:39:00 saturn Exp $
+ * $Id: parse.c,v 1.150 2003/11/01 00:11:33 saturn Exp $
*/
#include "giftcurs.h"
@@ -30,11 +30,18 @@
#include <limits.h>
#if ENABLE_NLS
+# define __USE_XOPEN
# include <locale.h>
#endif
+#if 1 //def WIDE_NCURSES
+# include <wchar.h>
+#endif
+
#include "parse.h"
+gboolean utf8;
+
char *trim(char *src)
{
char *dst = src, *last = src + 666666;
@@ -337,4 +344,19 @@
return tmp;
}
return str;
+}
+
+/* Visual strlen(). */
+glong vstrlen(const char *str)
+{
+ if (utf8) {
+ const char *p;
+ int len;
+
+ for (p = str, len = 0; *p; p = g_utf8_next_char(p))
+ len += g_unichar_iswide(g_utf8_get_char(p)) ? 2 : 1;
+ return len;
+ } else {
+ return strlen(str);
+ }
}
Index: giFTcurs/src/parse.h
diff -u giFTcurs/src/parse.h:1.92 giFTcurs/src/parse.h:1.93
--- giFTcurs/src/parse.h:1.92 Fri Oct 17 12:39:00 2003
+++ giFTcurs/src/parse.h Fri Oct 31 19:11:33 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.h,v 1.92 2003/10/17 16:39:00 saturn Exp $
+ * $Id: parse.h,v 1.93 2003/11/01 00:11:33 saturn Exp $
*/
#ifndef _PARSE_H
#define _PARSE_H
@@ -83,5 +83,8 @@
/* Tries to convert from 'from' to 'to', freeing 'str' and returning the
newly allocated string if it worked. */
char *convert_to_locale(char *str);
+
+/* Visual strlen(). Returns how many chars will be viewed on the screen. */
+glong vstrlen(const char *str);
#endif
Index: giFTcurs/src/ui_draw.c
diff -u giFTcurs/src/ui_draw.c:1.112 giFTcurs/src/ui_draw.c:1.113
--- giFTcurs/src/ui_draw.c:1.112 Sat Oct 18 09:20:10 2003
+++ giFTcurs/src/ui_draw.c Fri Oct 31 19:11:33 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_draw.c,v 1.112 2003/10/18 13:20:10 saturn Exp $
+ * $Id: ui_draw.c,v 1.113 2003/11/01 00:11:33 saturn Exp $
*/
#include "giftcurs.h"
@@ -317,19 +317,4 @@
void clrscr(void)
{
erase();
-}
-
-/* Visual strlen(). */
-glong vstrlen(const char *str)
-{
- if (utf8) {
- const char *p;
- int len;
-
- for (p = str, len = 0; *p; p = g_utf8_next_char(p))
- len += g_unichar_iswide(g_utf8_get_char(p)) ? 2 : 1;
- return len;
- } else {
- return strlen(str);
- }
}
Index: giFTcurs/src/ui_draw.h
diff -u giFTcurs/src/ui_draw.h:1.42 giFTcurs/src/ui_draw.h:1.43
--- giFTcurs/src/ui_draw.h:1.42 Mon Sep 15 17:28:19 2003
+++ giFTcurs/src/ui_draw.h Fri Oct 31 19:11:34 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_draw.h,v 1.42 2003/09/15 21:28:19 saturn Exp $
+ * $Id: ui_draw.h,v 1.43 2003/11/01 00:11:34 saturn Exp $
*/
#ifndef _UI_DRAW_H
#define _UI_DRAW_H
@@ -49,8 +49,5 @@
void draw_fmt_str(int x, int y, int w, int selected, const char *str);
void draw_printfmt(int w, const char *fmt, ...);
-
-/* Visual strlen(). Returns how many chars will be viewed on the screen. */
-glong vstrlen(const char *str);
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [giFTcurs-commits] giFTcurs/src Makefile.am parse.c parse.h ui_dra...,
Christian Häggström <=