Commit d02b2498 authored by Thomas Roessler's avatar Thomas Roessler

[unstable] Merge changes from stable: rx -> regex, Byrial's timezone

patch, translation updates.
parent 4a3e38f0
......@@ -84,16 +84,17 @@ to ``configure'' to help it out, or change the default behavior:
--disable-nls
This switch disables mutt's native language support.
--with-included-gettext Mutt will be built using the GNU gettext
library included in the intl/ sub-directory. You may need
to use this switch if your machine has something which looks
like gettext to the configure script, but isn't able to cope
with mutt's catalog files.
--with-included-gettext
Mutt will be built using the GNU gettext library included in
the intl/ sub-directory. You may need to use this switch if
your machine has something which looks like gettext to the
configure script, but isn't able to cope with mutt's catalog
files.
--with-rx
use GNU rx instead of local regexp routines. Many systems don't
have the POSIX compliant regcomp/regexec/regfree routines, so this
provides a way to support them.
--with-regex
use GNU regex instead of local regexp routines. Many systems
don't have the POSIX compliant regcomp/regexec/regfree
routines, so this provides a way to support them.
--enable-flock
use flock() to lock files.
......@@ -167,7 +168,7 @@ Solaris 2.4
The system regcomp() and regexec() routines are very badly
broken. This should be automatically detected by the
configure script. If not, use the --with-rx switch when
configure script. If not, use the --with-regex switch when
configuring mutt.
We are also hearing reports that Solaris 2.4's NLS libraries
......@@ -181,9 +182,9 @@ Solaris 2.4
Solaris 2.6
There are reports that mutt behaves strangely when linked
with the system regexp library. Please use the --with-rx
switch when configuring on this platform.
There are reports that mutt behaves strangely when linked with
the system regexp library. Please use the --with-regex switch
when configuring on this platform.
For the real fix, applying Sun patches # 105490-05 (linker
patch) and # 105210-17 (libc and malloc patch) from
......@@ -205,11 +206,7 @@ Sparc Linux
Digital Unix (OSF/1)
Don't try "--with-rx", because you won't be able to match
anything (using system's regex functions seems to work fine
though).
Also, the system curses library is said to be badly broken. Use
GNU ncurses or SLang instead.
The system curses library is said to be badly broken. Use GNU
ncurses or SLang instead.
$Id$
......@@ -35,7 +35,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP TODO configure acconfig.h attach.h \
mailbox.h mapping.h mime.h mutt.h mutt_curses.h mutt_menu.h \
mutt_regex.h mutt_socket.h mx.h pager.h parse.h pgp.h protos.h \
reldate.h rfc1524.h rfc2047.h rfc822.h sha.h sha_locl.h \
sort.h mime.types VERSION prepare
sort.h mime.types VERSION prepare _regex.h
BUILT_SOURCES = mutt_dotlock.c keymap_defs.h
......@@ -52,7 +52,7 @@ ACLOCAL_AMFLAGS = -I m4
LDADD = @[email protected] @[email protected]
SUBDIRS = doc intl m4 po rx contrib
SUBDIRS = doc intl m4 po contrib
OPS=$(srcdir)/OPS $(srcdir)/OPS.PGP
......
This diff is collapsed.
......@@ -23,7 +23,6 @@
/* What is your domain name? */
#undef DOMAIN
@TOP@
/* Mutt version info */
#undef VERSION
......@@ -97,9 +96,6 @@
/* Does your curses library support color? */
#undef HAVE_COLOR
/* Are we using GNU rx? */
#undef USE_GNU_RX
/* Compiling with SLang instead of curses/ncurses? */
#undef USE_SLANG_CURSES
......@@ -137,4 +133,8 @@
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
/* Do we have stpcpy? */
#undef HAVE_STPCPY
/* Use the included regex.c? */
#undef USE_GNU_REGEX
......@@ -223,22 +223,9 @@ AC_CHECK_FUNCS(strftime, break, [AC_CHECK_LIB(intl, strftime)])
dnl AIX may not have fchdir()
AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)], [mutt_cv_fchdir=no])
mutt_cv_regex=yes
AC_ARG_WITH(rx, [ --with-rx[=DIR] Use GNU rx ],
[if test $withval != yes; then
if test -d $withval/lib; then
LIBS="$LIBS -L$withval/lib -lrx"
CPPFLAGS="-I$withval/include $CPPFLAGS"
else
LIBS="$LIBS -L$withval -lrx"
CPPFLAGS="-I$withval $CPPFLAGS"
fi
AC_DEFINE(USE_GNU_RX)
mutt_cv_regex=no
fi],
[AC_CHECK_FUNCS(regcomp, mutt_cv_regex=no)])
RX_TARGET=no
AC_ARG_WITH(regex, [ --with-regex Use the GNU regex library ],
[mutt_cv_regex=yes],
[AC_CHECK_FUNCS(regcomp, mutt_cv_regex=no, mutt_cv_regex=yes)])
if test $mutt_cv_regex = no ; then
AC_MSG_CHECKING(whether your system's regexp library is completely broken)
......@@ -249,24 +236,16 @@ main() { regex_t blah ; return regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec
mutt_cv_regex_broken=no, mutt_cv_regex_broken=yes, mutt_cv_regex_broken=yes)
AC_MSG_RESULT([$mutt_cv_regex_broken])
if test $mutt_cv_regex_broken = yes ; then
echo "Using the included GNU rx instead." >&AC_FD_MSG
echo "Using the included GNU regex instead." >&AC_FD_MSG
mutt_cv_regex=yes
fi
fi
if test $mutt_cv_regex = yes; then
if test -d ../rx-1.5; then
LIBS="$LIBS ../rx-1.5/rx/librx.a"
CPPFLAGS="-I../rx-1.5/rx $CPPFLAGS"
else
MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS rx/librx.a"
CPPFLAGS="-I\$(srcdir)/rx $CPPFLAGS"
RX_TARGET=yes
fi
AC_DEFINE(USE_GNU_RX)
AC_DEFINE(USE_GNU_REGEX)
LIBOBJS="$LIBOBJS regex.c"
fi
AC_SUBST(RX_TARGET)
AC_ARG_WITH(homespool, [ --with-homespool[=FILE] file in user's directory where new mail is spooled], with_homespool=${withval})
if test x$with_homespool != x; then
......@@ -470,4 +449,4 @@ MUTTLOCALEDIR=$mutt_cv_prefix/$DATADIRNAME/locale
AC_SUBST(MUTTLOCALEDIR)
AC_DEFINE_UNQUOTED(MUTTLOCALEDIR, "$MUTTLOCALEDIR")
AC_OUTPUT(Makefile intl/Makefile m4/Makefile po/Makefile.in rx/Makefile Muttrc doc/Makefile doc/manual.sgml doc/dotlock.man doc/mutt.man contrib/Makefile)
AC_OUTPUT(Makefile intl/Makefile m4/Makefile po/Makefile.in Muttrc doc/Makefile doc/manual.sgml doc/dotlock.man doc/mutt.man charsets/Makefile contrib/Makefile)
......@@ -20,50 +20,44 @@ static const char rcsid[]="$Id$";
#include "mutt.h"
#include <string.h>
/* returns the seconds west of UTC given `g' and its corresponding gmtime()
/* returns the seconds east of UTC given `g' and its corresponding gmtime()
representation */
static time_t mutt_compute_tz (time_t g, struct tm *utc)
static time_t compute_tz (time_t g, struct tm *utc)
{
struct tm *lt = localtime (&g);
time_t t;
int yday;
t = (((utc->tm_hour - lt->tm_hour) * 60) + (utc->tm_min - lt->tm_min)) * 60;
switch (utc->tm_yday - lt->tm_yday)
{
case 0:
break;
case 1:
case -364:
case -365:
t += 24 * 60 * 60;
break;
t = (((lt->tm_hour - utc->tm_hour) * 60) + (lt->tm_min - utc->tm_min)) * 60;
case -1:
case 364:
case 365:
if ((yday = (lt->tm_yday - utc->tm_yday)))
{
/* This code is optimized to negative timezones (West of Greenwich) */
if (yday == -1 || /* UTC passed midnight before localtime */
yday > 1) /* UTC passed new year before localtime */
t -= 24 * 60 * 60;
break;
default:
mutt_error _("Please report this program error in the function mutt_mktime.");
else
t += 24 * 60 * 60;
}
return t;
}
time_t mutt_local_tz (void)
/* Returns the local timezone in seconds east of UTC for the time t,
* or for the current time if t is zero.
*/
time_t mutt_local_tz (time_t t)
{
struct tm *ptm;
struct tm utc;
time_t now;
now = time (NULL);
ptm = gmtime (&now);
if (!t)
t = time (NULL);
ptm = gmtime (&t);
/* need to make a copy because gmtime/localtime return a pointer to
static memory (grr!) */
memcpy (&utc, ptm, sizeof (utc));
return (mutt_compute_tz (now, &utc));
return (compute_tz (t, &utc));
}
/* converts struct tm to time_t, but does not take the local timezone into
......@@ -103,7 +97,7 @@ time_t mutt_mktime (struct tm *t, int local)
g += t->tm_sec;
if (local)
g += mutt_compute_tz (g, t);
g -= compute_tz (g, t);
return (g);
}
......
......@@ -184,9 +184,7 @@ time_t is_from (const char *s, char *path, size_t pathlen)
dprint (3,(debugfile, "is_from(): month=%d, day=%d, hr=%d, min=%d, sec=%d, yr=%d.\n",
tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_year));
tm.tm_isdst = 0;
tm.tm_yday = 0;
tm.tm_wday = 0;
tm.tm_isdst = -1;
return (mutt_mktime (&tm, 0));
}
......@@ -208,10 +208,10 @@ static void show_version (void)
"-HAVE_REGCOMP "
#endif
#ifdef USE_GNU_RX
"+USE_GNU_RX "
#ifdef USE_GNU_REGEX
"+USE_GNU_REGEX "
#else
"-USE_GNU_RX "
"-USE_GNU_REGEX "
#endif
#ifdef HAVE_COLOR
......
......@@ -107,7 +107,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx)
/* precompute the local timezone to speed up calculation of the
received time */
tz = mutt_local_tz ();
tz = mutt_local_tz (0);
buf[sizeof (buf) - 1] = 0;
......@@ -145,7 +145,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx)
}
}
else
hdr->received = t + tz;
hdr->received = t - tz;
hdr->env = mutt_read_rfc822_header (ctx->fp, hdr, 0);
......@@ -249,7 +249,7 @@ int mbox_parse_mailbox (CONTEXT *ctx)
/* precompute the local timezone to speed up calculation of the
date received */
tz = mutt_local_tz ();
tz = mutt_local_tz (0);
loc = ftell (ctx->fp);
while (fgets (buf, sizeof (buf), ctx->fp) != NULL)
......@@ -281,7 +281,7 @@ int mbox_parse_mailbox (CONTEXT *ctx)
mx_alloc_memory (ctx);
curhdr = ctx->hdrs[ctx->msgcount] = mutt_new_header ();
curhdr->received = t + tz;
curhdr->received = t - tz;
curhdr->offset = loc;
curhdr->index = ctx->msgcount;
......
......@@ -24,10 +24,10 @@
#ifndef MUTT_REGEX_H
#define MUTT_REGEX_H
#ifdef HAVE_REGCOMP
#include <regex.h>
#ifdef USE_GNU_REGEX
#include "_regex.h"
#else
#include "rxposix.h"
#include <regex.h>
#endif
/* this is a non-standard option supported by Solaris 2.5.x which allows
......
......@@ -891,7 +891,7 @@ ENVELOPE *mutt_read_rfc822_header (FILE *f, HEADER *hdr, short user_hdrs)
{
/* MH somtimes has the From_ line in the middle of the header! */
if (hdr && !hdr->received)
hdr->received = t + mutt_local_tz ();
hdr->received = t - mutt_local_tz (t);
loc = ftell (f);
continue;
}
......
......@@ -7,9 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Mutt 0.94.14i\n"
"POT-Creation-Date: 1999-01-04 13:55+0100\n"
"PO-Revision-Date: 1998-12-11 09:06+0100\n"
"Last-Translator: Marc Baudoin <[email protected]>, Vincent Lefevre "
"<[email protected]>\n"
"PO-Revision-Date: 1999-01-05 20:46+0100\n"
"Last-Translator: Marc Baudoin <[email protected]>, Vincent Lefevre <[email protected]>\n"
"Language-Team: mutt-dev <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
......@@ -1195,13 +1194,13 @@ msgstr "Erreur dans %s, ligne %d : %s"
#: init.c:1102
#, c-format
msgid "source: errors in %s"
msgstr "source : erreurs %s"
msgstr "source : erreurs dans %s"
# , c-format
#: init.c:1112
#, c-format
msgid "source: error at %s"
msgstr "source : erreur %s"
msgstr "source : erreur dans %s"
#: init.c:1117
msgid "source: too many arguments"
......@@ -2117,7 +2116,7 @@ msgstr ""
msgid ""
"\n"
"Compile options:"
msgstr ""
msgstr "\nOptions de compilation :"
#: main.c:306
msgid "Error initializing terminal."
......@@ -2313,7 +2312,7 @@ msgstr "
#: mx.c:704
#, fuzzy, c-format
msgid "Could not synchronize mailbox %s!"
msgstr "La bote aux lettres n'a pas pu tre rouverte !"
msgstr "La bote aux lettres %s n'a pas pu tre rouverte !"
# , c-format
#: mx.c:767
......@@ -2577,9 +2576,7 @@ msgstr "[-- FIN DE BLOC DE CL
msgid ""
"\n"
"[-- END PGP SIGNED MESSAGE --]\n"
msgstr ""
"[-- DBUT DE MESSAGE SIGN PGP --]\n"
"\n"
msgstr "\n[-- FIN DE MESSAGE SIGN PGP --]\n"
#: pgp.c:477
msgid ""
......@@ -3080,7 +3077,7 @@ msgstr "Message non modifi
#. abort
#: send.c:1140
msgid "Mail not sent."
msgstr "Courrier non envoy."
msgstr "Message non envoy."
#: send.c:1153
msgid "Message postponed."
......@@ -3113,11 +3110,11 @@ msgstr "Envoi du message..."
#: send.c:1324
#, fuzzy
msgid "Could not send the message."
msgstr "envoyer le message"
msgstr "Impossible d'envoyer le message."
#: send.c:1330
msgid "Mail sent."
msgstr "Courrier envoy."
msgstr "Message envoy."
#: sendlib.c:475
msgid "No boundary parameter found! [report this error]"
......
......@@ -94,7 +94,7 @@ HEADER *mutt_dup_header (HEADER *);
ATTACHPTR **mutt_gen_attach_list (BODY *, int, ATTACHPTR **, short *, short *, int, int);
time_t mutt_local_tz (void);
time_t mutt_local_tz (time_t);
time_t mutt_mktime (struct tm *, int);
time_t is_from (const char *, char *, size_t);
time_t mutt_parse_date (const char *, HEADER *);
......
This diff is collapsed.
This diff is collapsed.
# $Id$
PACKAGE=@[email protected]
VERSION=@[email protected]
OBJS= hashrexp.o rx.o rxanal.o rxbasic.o rxbitset.o rxcset.o \
rxgnucomp.o rxhash.o rxnfa.o rxnode.o rxposix.o rxsimp.o \
rxspencer.o rxstr.o rxsuper.o rxunfa.o
DISTFILES = COPYING.LIB Makefile.in _rx.h hashrexp.c inst-rxposix.h rx.c\
rx.h rxall.h rxanal.c rxanal.h rxbasic.c rxbasic.h rxbitset.c \
rxbitset.h rxcontext.h rxcset.c rxcset.h rxgnucomp.c rxgnucomp.h \
rxhash.c rxhash.h rxnfa.c rxnfa.h rxnode.c rxnode.h rxposix.c \
rxposix.h rxproto.h rxsimp.c rxsimp.h rxspencer.c rxspencer.h \
rxstr.c rxstr.h rxsuper.c rxsuper.h rxunfa.c rxunfa.h
VPATH=@[email protected]
CC=@[email protected]
@[email protected]
srcdir=@[email protected]
top_srcdir=@[email protected]
top_builddir=..
subdir=rx
all: [email protected][email protected]
all-yes: librx.a
all-no:
install:
librx.a: $(OBJS)
ar rc librx.a $(OBJS)
-ranlib librx.a
clean:
rm -f *.o librx.a *~
maintainer-clean distclean: clean
rm -f Makefile
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
Makefile: ../config.status Makefile.in
cd .. \
&& CONFIG_FILES=$(subdir)/[email protected] CONFIG_HEADERS= $(SHELL) ./config.status
dist distdir: Makefile $(DISTFILES)
for file in $(DISTFILES) ; do \
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
|| cp -p $(srcdir)/$$file $(distdir); \
done
/* $Id$ */
/* classes: h_files */
#ifndef _RXH
#define _RXH
/* Copyright (C) 1995, 1996 Tom Lord
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <sys/types.h>
#include "rxhash.h"
#include "rxcset.h"
struct rx_cache;
struct rx_superset;
struct rx;
struct rx_se_list;
/* Suppose that from some NFA state and next character, more than one
* path through side-effect edges is possible. In what order should
* the paths be tried? A function of type rx_se_list_order answers
* that question. It compares two lists of side effects, and says
* which list comes first.
*/
#ifdef __STDC__
typedef int (*rx_se_list_order) (struct rx *,
struct rx_se_list *,
struct rx_se_list *);
#else
typedef int (*rx_se_list_order) ();
#endif
/* Struct RX holds an NFA and cache state for the corresponding super NFA.
*/
struct rx
{
/* The compiler assigns a unique id to every pattern.
* Like sequence numbers in X, there is a subtle bug here
* if you use Rx in a system that runs for a long time.
* But, because of the way the caches work out, it is almost
* impossible to trigger the Rx version of this bug.
*
* The id is used to validate superstates found in a cache
* of superstates. It isn't sufficient to let a superstate
* point back to the rx for which it was compiled -- the caller
* may be re-using a `struct rx' in which case the superstate
* is not really valid. So instead, superstates are validated
* by checking the sequence number of the pattern for which
* they were built.
*/
int rx_id;
/* This is memory mgt. state for superstates. This may be
* shared by more than one struct rx.
*/
struct rx_cache * cache;
/* Every nfa defines the size of its own character set.
* Each superstate has an array of this size, with each element
* a `struct rx_inx'. So, don't make this number too large.
* In particular, don't make it 2^16.
*/
int local_cset_size;
/* Lists of side effects as stored in the NFA are `hash consed'..meaning
* that lists with the same elements are ==. During compilation,
* this table facilitates hash-consing.
*/
struct rx_hash se_list_memo;
/* Lists of NFA states are also hashed.
*/
struct rx_hash set_list_memo;
/* The compiler and matcher must build a number of instruction frames.
* The format of these frames is fixed (c.f. struct rx_inx). The values
* of the instruction opcodes is not fixed.
*
* An enumerated type (enum rx_opcode) defines the set of instructions
* that the compiler or matcher might generate. When filling an instruction
* frame, the INX field is found by indexing this instruction table
* with an opcode:
*/
void ** instruction_table;
/* The list of all states in an NFA.
* The NEXT field of NFA states links this list.
*/
struct rx_nfa_state *nfa_states;
struct rx_nfa_state *start_nfa_states;
struct rx_superset * start_set;
/* This orders the search through super-nfa paths.
* See the comment near the typedef of rx_se_list_order.
*/
rx_se_list_order se_list_cmp;
int next_nfa_id;
};
/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
* `re_match_2' returns information about at least this many registers
* the first time a `regs' structure is passed.
*
* Also, this is the greatest number of backreferenced subexpressions
* allowed in a pattern being matched without caller-supplied registers.
*/
#ifndef RE_NREGS
#define RE_NREGS 30
#endif
#ifndef emacs
#define CHARBITS 8
#define CHAR_SET_SIZE (1 << CHARBITS)
#define Sword 1
#define SYNTAX(c) re_syntax_table[c]
extern char re_syntax_table[CHAR_SET_SIZE];
#endif
/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
* use `alloca' instead of `malloc' for the backtracking stack.
*
* Emacs will die miserably if we don't do this.
*/
#ifdef REGEX_MALLOC
#define REGEX_ALLOCATE malloc
#else /* not REGEX_MALLOC */
#define REGEX_ALLOCATE alloca
#endif /* not REGEX_MALLOC */
#undef MAX
#undef MIN
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
extern void * rx_id_instruction_table[];
extern struct rx_cache * rx_default_cache;
#ifdef __STDC__
#else /* STDC */
#endif /* STDC */
#endif /* _RXH */
static const char rcsid[]="$Id$";
/* Copyright (C) 1995, 1996 Tom Lord
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "rxall.h"
#include "rxnode.h"
#include "rxhash.h"
#ifdef __STDC__
static int
rexp_node_equal (void * va, void * vb)
#else
static int
rexp_node_equal (va, vb)
void * va;
void * vb;
#endif
{
struct rexp_node * a;
struct rexp_node * b;
a = (struct rexp_node *)va;
b = (struct rexp_node *)vb;
return ( (va == vb)
|| ( (a->type == b->type)
&& (a->params.intval == b->params.intval)
&& (a->params.intval2 == b->params.intval2)
&& rx_bitset_is_equal (a->params.cset_size, a->params.cset, b->params.cset)
&& rexp_node_equal (a->params.pair.left, b->params.pair.left)
&& rexp_node_equal (a->params.pair.right, b->params.pair.right)));
}
/* $Id$ */
/* classes: h_files */
#ifndef INST_RXPOSIXH
#define INST_RXPOSIXH
/* Copyright (C) 1995, 1996 Tom Lord
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
struct rx_posix_regex
{
struct rexp_node * pattern;
struct rexp_node ** subexps;
size_t re_nsub;
unsigned char * translate;