--- ./Imakefile.org 2006-04-06 21:54:14.000000000 +0900 +++ ./Imakefile 2006-04-07 03:29:57.000000000 +0900 @@ -27,6 +27,7 @@ /* Normal development flags for warnings and debug info CFLAGS = -Wall -g */ +CPPFLAGS = -DI18N SRCS = xclib.c xcprint.c xclip.c OBJS = xclib.o xcprint.o xclip.o --- ./xclib.c.org 2006-04-06 21:54:14.000000000 +0900 +++ ./xclib.c 2006-04-07 01:04:12.000000000 +0900 @@ -23,6 +23,10 @@ #include #include #include +#ifndef I18N +#else +#include +#endif #include "xcdef.h" #include "xcprint.h" #include "xclib.h" @@ -128,7 +132,11 @@ XConvertSelection( dpy, sel, +#ifndef I18N XA_STRING, +#else + XA_TEXT(dpy), +#endif pty, win, CurrentTime @@ -377,7 +385,13 @@ /* put the data into an property */ if (evt.xselectionrequest.target == targets) { - Atom types[2] = { targets, XA_STRING }; + Atom types[2] = { targets, +#ifndef I18N + XA_STRING +#else + XA_TEXT(dpy) +#endif + }; /* send data all at once (not using INCR) */ XChangeProperty( @@ -425,7 +439,11 @@ dpy, *win, *pty, +#ifndef I18N XA_STRING, +#else + XA_TEXT(dpy), +#endif 8, PropModeReplace, (unsigned char*) txt, @@ -506,7 +524,11 @@ dpy, *win, *pty, +#ifndef I18N XA_STRING, +#else + XA_TEXT(dpy), +#endif 8, PropModeReplace, &txt[*pos], @@ -521,7 +543,11 @@ dpy, *win, *pty, +#ifndef I18N XA_STRING, +#else + XA_TEXT(dpy), +#endif 8, PropModeReplace, 0, --- ./xclip.c.org 2006-04-06 21:54:14.000000000 +0900 +++ ./xclip.c 2006-04-07 00:21:01.000000000 +0900 @@ -25,6 +25,11 @@ #include #include #include +#ifndef I18N +#else +#include +#include +#endif #include "xcdef.h" #include "xcprint.h" #include "xclib.h" @@ -491,6 +496,16 @@ /* Declare variables */ Window win; /* Window */ +#ifndef I18N +#else + if (!setlocale(LC_ALL, "")) + fprintf(stderr, "cannot setlocal(LC_ALL,\"\")\n"); + else if (!XSupportsLocale()) + fprintf(stderr, "does not support locale by XSupportsLocale()\n"); + else if (!XSetLocaleModifiers("")) + fprintf(stderr, "cannot XSetLocaleModifiers(\"\")\n"); +#endif + /* set up option table. I can't figure out a better way than this to * do it while sticking to pure ANSI C. The option and specifier * members have a type of volatile char *, so they need to be allocated --- ./xctest.org 2006-04-06 21:54:14.000000000 +0900 +++ ./xctest 2006-04-07 03:33:53.000000000 +0900 @@ -41,7 +41,9 @@ do # temp file names (in and out) tempi=`tempfile` + [ "$tempi" = "" ] && tempi=${TMP:-/tmp}/xctest$$i tempo=`tempfile` + [ "$tempo" = "" ] && tempo=${TMP:-/tmp}/xctest$$o linec=0 # current line of file in while loop