summaryrefslogtreecommitdiff
path: root/app/luit
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-10-04 16:14:00 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-10-04 16:14:00 +0000
commitabe18d8a3de86ed358f65ceff89bedc1f519e630 (patch)
tree128fb3a8b702b1fc5fba2e92d1865cbcea83fd02 /app/luit
parent1435578951365337358d89623b531b2c68a1b07d (diff)
update to luit version 1.0.4.
Diffstat (limited to 'app/luit')
-rw-r--r--app/luit/ChangeLog51
-rw-r--r--app/luit/Makefile.am7
-rw-r--r--app/luit/README28
-rw-r--r--app/luit/charset.c16
-rw-r--r--app/luit/configure.ac14
-rw-r--r--app/luit/iso2022.c4
-rw-r--r--app/luit/luit.c18
-rw-r--r--app/luit/sys.c40
8 files changed, 131 insertions, 47 deletions
diff --git a/app/luit/ChangeLog b/app/luit/ChangeLog
index 1daa2aebd..fc5088306 100644
--- a/app/luit/ChangeLog
+++ b/app/luit/ChangeLog
@@ -1,3 +1,54 @@
+commit f5e4bc812cec6503722ee289a0cc1099ce6fb3f5
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Thu Oct 1 18:14:18 2009 -0700
+
+ luit 1.0.4
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 61bb775852796628207a5062d8fdd8bcd6ec77bd
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Thu Oct 1 18:01:27 2009 -0700
+
+ Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 8f9d685e4bb91640fb01392c6d73e7d9e365b41b
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Thu Oct 1 14:54:17 2009 -0700
+
+ Add README with pointers to mailing lists, bugzilla, & git
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 4823838f77ab03cccd07860fdf8002bc577e0f04
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Thu Apr 9 14:55:03 2009 -0700
+
+ luit: Convert platform #ifdefs to configure tests for functions & headers
+
+ Also check for __SVR4 in remaining SVR4 check to match Solaris compiler
+ default definition.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 638f4ac8e233973dc3c89d87cd9f6ac05489fef4
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date: Fri Jan 16 20:01:11 2009 -0200
+
+ Ansification and compile warning fixes.
+
+ This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
+ make distcheck and most gcc 4.3 and sparse warnings.
+
+commit 51eae7b3a07faab716ea7ef3186cee658f393d04
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date: Fri Apr 11 10:32:59 2008 -0700
+
+ Apple: Use secure tty
+ Thanks to Martin Otte for the patch
+
commit 2547b637ab615884ea51458dfb793f1a70bc5201
Author: Julien Cristau <jcristau@debian.org>
Date: Fri Feb 1 00:08:27 2008 +0100
diff --git a/app/luit/Makefile.am b/app/luit/Makefile.am
index 6299f1678..6dc2a07ab 100644
--- a/app/luit/Makefile.am
+++ b/app/luit/Makefile.am
@@ -23,7 +23,8 @@ bin_PROGRAMS = luit
LOCALEALIASFILE = @LOCALEALIASFILE@
-AM_CFLAGS = $(LUIT_CFLAGS) -DLOCALE_ALIAS_FILE=\"$(LOCALEALIASFILE)\"
+AM_CFLAGS = $(CWARNFLAGS) $(LUIT_CFLAGS) \
+ -DLOCALE_ALIAS_FILE=\"$(LOCALEALIASFILE)\"
luit_LDADD = $(LUIT_LIBS)
luit_SOURCES = \
@@ -59,7 +60,7 @@ MAINTAINERCLEANFILES = ChangeLog
.PHONY: ChangeLog
ChangeLog:
- (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+ $(CHANGELOG_CMD)
dist-hook: ChangeLog
@@ -84,4 +85,4 @@ MAN_SUBSTS = \
SUFFIXES = .$(APP_MAN_SUFFIX) .man
.man.$(APP_MAN_SUFFIX):
- sed $(MAN_SUBSTS) < $< > $@
+ $(AM_V_GEN)sed $(MAN_SUBSTS) < $< > $@
diff --git a/app/luit/README b/app/luit/README
index e69de29bb..825d09ee1 100644
--- a/app/luit/README
+++ b/app/luit/README
@@ -0,0 +1,28 @@
+Luit is a filter that can be run between an arbitrary application and
+a UTF-8 terminal emulator such as xterm. It will convert application
+output from the locale's encoding into UTF-8, and convert terminal
+input from UTF-8 into the locale's encoding.
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+ http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+ https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+ git://anongit.freedesktop.org/git/xorg/app/luit
+
+ http://cgit.freedesktop.org/xorg/app/luit
+
+For patch submission instructions, see:
+
+ http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+ http://wiki.x.org/wiki/GitPage
+
diff --git a/app/luit/charset.c b/app/luit/charset.c
index c6bb45701..7424ac392 100644
--- a/app/luit/charset.c
+++ b/app/luit/charset.c
@@ -75,13 +75,13 @@ NullReverse(unsigned int n, CharsetPtr self)
return -1;
}
-CharsetRec Unknown94Charset =
+static CharsetRec Unknown94Charset =
{ "Unknown (94)", T_94, 0, IdentityRecode, NullReverse, NULL, NULL};
-CharsetRec Unknown96Charset =
+static CharsetRec Unknown96Charset =
{ "Unknown (96)", T_96, 0, IdentityRecode, NullReverse, NULL, NULL};
-CharsetRec Unknown9494Charset =
+static CharsetRec Unknown9494Charset =
{ "Unknown (94x94)", T_9494, 0, IdentityRecode, NullReverse, NULL, NULL};
-CharsetRec Unknown9696Charset =
+static CharsetRec Unknown9696Charset =
{ "Unknown (96x96)", T_9696, 0, IdentityRecode, NullReverse, NULL, NULL};
typedef struct _FontencCharset {
@@ -94,7 +94,7 @@ typedef struct _FontencCharset {
FontMapReversePtr reverse;
} FontencCharsetRec, *FontencCharsetPtr;
-FontencCharsetRec fontencCharsets[] = {
+static FontencCharsetRec fontencCharsets[] = {
{"ISO 646 (1973)", T_94, '@', "iso646.1973-0", 0x00, NULL, NULL},
{"ASCII", T_94, 'B', "iso8859-1", 0x00, NULL, NULL},
{"JIS X 0201:GL", T_94, 'J', "jisx0201.1976-0", 0x00, NULL, NULL},
@@ -154,7 +154,7 @@ typedef struct _OtherCharset {
int (*stack)(unsigned char, OtherStatePtr);
} OtherCharsetRec, *OtherCharsetPtr;
-OtherCharsetRec otherCharsets[] = {
+static OtherCharsetRec otherCharsets[] = {
{"GBK", init_gbk, mapping_gbk, reverse_gbk, stack_gbk},
{"UTF-8", init_utf8, mapping_utf8, reverse_utf8, stack_utf8},
{"SJIS", init_sjis, mapping_sjis, reverse_sjis, stack_sjis},
@@ -393,7 +393,7 @@ getCharsetByName(const char *name)
return getUnknownCharset(T_94);
}
-const LocaleCharsetRec localeCharsets[] = {
+static const LocaleCharsetRec localeCharsets[] = {
{ "C", 0, 2, "ASCII", NULL, "ISO 8859-1", NULL, NULL},
{ "POSIX", 0, 2, "ASCII", NULL, "ISO 8859-1", NULL, NULL},
{ "ISO8859-1", 0, 2, "ASCII", NULL, "ISO 8859-1", NULL, NULL},
@@ -481,7 +481,7 @@ getLocaleState(const char *locale, char *charset,
}
if(p->name == NULL) {
- if (resolved != 0)
+ if (resolved != NULL)
free(resolved);
return -1;
}
diff --git a/app/luit/configure.ac b/app/luit/configure.ac
index 2fb4fddc9..fae0f7bda 100644
--- a/app/luit/configure.ac
+++ b/app/luit/configure.ac
@@ -22,16 +22,25 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ([2.57])
-AC_INIT(luit,[1.0.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],luit)
+AC_INIT(luit,[1.0.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],luit)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_INSTALL
AC_CANONICAL_HOST
+XORG_DEFAULT_OPTIONS
+
+AC_CHECK_HEADERS([poll.h pty.h stropts.h sys/param.h sys/select.h])
+AC_CHECK_FUNCS([poll select grantpt])
+
AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([zlib not found]))
AC_ARG_WITH(localealiasfile,
@@ -57,7 +66,4 @@ LUIT_CFLAGS="$LUIT_CFLAGS $OS_CFLAGS"
AC_SUBST(LUIT_CFLAGS)
AC_SUBST(LUIT_LIBS)
-XORG_MANPAGE_SECTIONS
-XORG_RELEASE_VERSION
-
AC_OUTPUT([Makefile])
diff --git a/app/luit/iso2022.c b/app/luit/iso2022.c
index ce8769533..ac2f5ddb9 100644
--- a/app/luit/iso2022.c
+++ b/app/luit/iso2022.c
@@ -37,8 +37,8 @@ THE SOFTWARE.
#include "iso2022.h"
#define BUFFERED_INPUT_SIZE 4
-unsigned char buffered_input[BUFFERED_INPUT_SIZE];
-int buffered_input_count = 0;
+static unsigned char buffered_input[BUFFERED_INPUT_SIZE];
+static int buffered_input_count = 0;
static void
FatalError(char *f, ...)
diff --git a/app/luit/luit.c b/app/luit/luit.c
index 5c8d606b8..7fa7acf8c 100644
--- a/app/luit/luit.c
+++ b/app/luit/luit.c
@@ -34,8 +34,12 @@ THE SOFTWARE.
#include <sys/ioctl.h>
#include <signal.h>
-#ifdef SVR4
-#include <stropts.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef HAVE_STROPTS_H
+# include <stropts.h>
#endif
#include <X11/fonts/fontenc.h>
@@ -52,11 +56,11 @@ static char *locale_name = NULL;
int ilog = -1;
int olog = -1;
int verbose = 0;
-int converter = 0;
-int exitOnChild = 0;
+static int converter = 0;
+static int exitOnChild = 0;
-volatile int sigwinch_queued = 0;
-volatile int sigchld_queued = 0;
+static volatile int sigwinch_queued = 0;
+static volatile int sigchld_queued = 0;
static int convert(int, int);
static int condom(int, char**);
@@ -452,6 +456,8 @@ condom(int argc, char **argv)
int rc;
int val;
+ path = NULL;
+ child_argv = NULL;
rc = parseArgs(argc, argv, child_argv0,
&path, &child_argv);
if(rc < 0)
diff --git a/app/luit/sys.c b/app/luit/sys.c
index efec546af..ba60fbf04 100644
--- a/app/luit/sys.c
+++ b/app/luit/sys.c
@@ -34,14 +34,8 @@ THE SOFTWARE.
#include <signal.h>
#include <errno.h>
-#ifdef SVR4
-#define HAVE_POLL
-#endif
-
-#ifndef HAVE_POLL
-#ifndef _MINIX
-#define HAVE_SELECT
-#endif
+#ifdef HAVE_CONFIG_H
+# include "config.h"
#endif
#ifdef HAVE_POLL
@@ -49,27 +43,20 @@ THE SOFTWARE.
#undef HAVE_SELECT
#endif
-#ifdef __QNX__
-#include <sys/select.h>
-#endif
-
-
-#if (defined(__GLIBC__) && \
- (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))) || \
- defined(SVR4)
-#define HAVE_GRANTPT
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
#endif
-#ifdef __GLIBC__
-#include <pty.h>
+#ifdef HAVE_PTY_H
+# include <pty.h>
#endif
-#ifdef SVR4
-#include <stropts.h>
+#ifdef HAVE_STROPTS_H
+# include <stropts.h>
#endif
-#if (defined(__unix__) || defined(unix)) && !defined(USG)
-#include <sys/param.h>
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
#endif
#include "sys.h"
@@ -340,7 +327,12 @@ allocatePty(int *pty_return, char **line_return)
char *temp_line;
int rc;
+#ifdef __APPLE__
+ pty = posix_openpt(O_RDWR);
+#else
pty = open("/dev/ptmx", O_RDWR);
+#endif
+
if(pty < 0)
goto bsd;
@@ -428,7 +420,7 @@ openTty(char *line)
}
#endif
-#ifdef SVR4
+#if defined(SVR4) || defined(__SVR4)
rc = ioctl(tty, I_PUSH, "ptem");
if(rc < 0)
goto bail;