diff --recursive --context --minimal --new-file oleo-1.6/INSTALL oleo-1.6jb2/INSTALL *** oleo-1.6/INSTALL Sat Jun 4 01:16:57 1994 --- oleo-1.6jb2/INSTALL Sun Feb 9 00:13:54 1997 *************** *** 1,88 **** ! This is a generic INSTALL file for utilities distributions. ! If this package does not come with, e.g., installable documentation or ! data files, please ignore the references to them below. ! To compile this package: ! 1. Configure the package for your system. In the directory that this ! file is in, type `./configure'. If you're using `csh' on an old ! version of System V, you might need to type `sh configure' instead to ! prevent `csh' from trying to execute `configure' itself. ! The `configure' shell script attempts to guess correct values for ! various system-dependent variables used during compilation, and ! creates the Makefile(s) (one in each subdirectory of the source ! directory). In some packages it creates a C header file containing ! system-dependent definitions. It also creates a file `config.status' ! that you can run in the future to recreate the current configuration. ! Running `configure' takes a minute or two. ! To compile the package in a different directory from the one ! containing the source code, you must use GNU make. `cd' to the ! directory where you want the object files and executables to go and ! run `configure' with the option `--srcdir=DIR', where DIR is the ! directory that contains the source code. Using this option is ! actually unnecessary if the source code is in the parent directory of ! the one in which you are compiling; `configure' automatically checks ! for the source code in `..' if it does not find it in the current ! directory. ! By default, `make install' will install the package's files in ! /usr/local/bin, /usr/local/lib, /usr/local/man, etc. You can specify ! an installation prefix other than /usr/local by giving `configure' the ! option `--prefix=PATH'. Alternately, you can do so by changing the ! `prefix' variable in the Makefile that `configure' creates (the ! Makefile in the top-level directory, if the package contains ! subdirectories). ! You can specify separate installation prefixes for machine-specific ! files and machine-independent files. If you give `configure' the ! option `--exec_prefix=PATH', the package will use PATH as the prefix ! for installing programs and libraries. Normally, all files are ! installed using the same prefix. ! `configure' ignores any other arguments that you give it. ! If your system requires unusual options for compilation or linking ! that `configure' doesn't know about, you can give `configure' initial ! values for some variables by setting them in the environment. In ! Bourne-compatible shells, you can do that on the command line like this: ! CC='gcc -traditional' DEFS=-D_POSIX_SOURCE ./configure ! The `make' variables that you might want to override with environment ! variables when running `configure' are: ! (For these variables, any value given in the environment overrides the ! value that `configure' would choose:) ! CC C compiler program. ! Default is `cc', or `gcc' if `gcc' is in your PATH. ! INSTALL Program to use to install files. ! Default is `install' if you have it, `cp' otherwise. ! INCLUDEDIR Directory for `configure' to search for include files. ! Default is /usr/include. ! (For these variables, any value given in the environment is added to ! the value that `configure' chooses:) ! DEFS Configuration options, in the form '-Dfoo -Dbar ...' ! LIBS Libraries to link with, in the form '-lfoo -lbar ...' ! If you need to do unusual things to compile the package, we encourage ! you to teach `configure' how to do them and mail the diffs to the ! address given in the README so we can include them in the next ! release. ! 2. Type `make' to compile the package. ! 3. Type `make install' to install programs, data files, and ! documentation. ! 4. You can remove the program binaries and object files from the ! source directory by typing `make clean'. To also remove the ! Makefile(s), the header file containing system-dependent definitions ! (if the package uses one), and `config.status' (all the files that ! `configure' created), type `make distclean'. - The file `configure.in' is used as a template to create `configure' by - a program called `autoconf'. You will only need it if you want to - regenerate `configure' using a newer version of `autoconf'. --- 1,183 ---- ! Basic Installation ! ================== ! These are generic installation instructions. ! The `configure' shell script attempts to guess correct values for ! various system-dependent variables used during compilation. It uses ! those values to create a `Makefile' in each directory of the package. ! It may also create one or more `.h' files containing system-dependent ! definitions. Finally, it creates a shell script `config.status' that ! you can run in the future to recreate the current configuration, a file ! `config.cache' that saves the results of its tests to speed up ! reconfiguring, and a file `config.log' containing compiler output ! (useful mainly for debugging `configure'). ! If you need to do unusual things to compile the package, please try ! to figure out how `configure' could check whether to do them, and mail ! diffs or instructions to the address given in the `README' so they can ! be considered for the next release. If at some point `config.cache' ! contains results you don't want to keep, you may remove or edit it. ! The file `configure.in' is used to create `configure' by a program ! called `autoconf'. You only need `configure.in' if you want to change ! it or regenerate `configure' using a newer version of `autoconf'. ! The simplest way to compile this package is: ! 1. `cd' to the directory containing the package's source code and type ! `./configure' to configure the package for your system. If you're ! using `csh' on an old version of System V, you might need to type ! `sh ./configure' instead to prevent `csh' from trying to execute ! `configure' itself. ! Running `configure' takes awhile. While running, it prints some ! messages telling which features it is checking for. ! 2. Type `make' to compile the package. ! ! 3. Optionally, type `make check' to run any self-tests that come with ! the package. ! ! 4. Type `make install' to install the programs and any data files and ! documentation. ! ! 5. You can remove the program binaries and object files from the ! source code directory by typing `make clean'. To also remove the ! files that `configure' created (so you can compile the package for ! a different kind of computer), type `make distclean'. There is ! also a `make maintainer-clean' target, but that is intended mainly ! for the package's developers. If you use it, you may have to get ! all sorts of other programs in order to regenerate files that came ! with the distribution. ! ! Compilers and Options ! ===================== ! ! Some systems require unusual options for compilation or linking that ! the `configure' script does not know about. You can give `configure' ! initial values for variables by setting them in the environment. Using ! a Bourne-compatible shell, you can do that on the command line like this: ! CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure ! Or on systems that have the `env' program, you can do it like this: ! env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure ! Compiling For Multiple Architectures ! ==================================== ! You can compile the package for more than one kind of computer at the ! same time, by placing the object files for each architecture in their ! own directory. To do this, you must use a version of `make' that ! supports the `VPATH' variable, such as GNU `make'. `cd' to the ! directory where you want the object files and executables to go and run ! the `configure' script. `configure' automatically checks for the ! source code in the directory that `configure' is in and in `..'. ! If you have to use a `make' that does not supports the `VPATH' ! variable, you have to compile the package for one architecture at a time ! in the source code directory. After you have installed the package for ! one architecture, use `make distclean' before reconfiguring for another ! architecture. ! Installation Names ! ================== ! By default, `make install' will install the package's files in ! `/usr/local/bin', `/usr/local/man', etc. You can specify an ! installation prefix other than `/usr/local' by giving `configure' the ! option `--prefix=PATH'. ! You can specify separate installation prefixes for ! architecture-specific files and architecture-independent files. If you ! give `configure' the option `--exec-prefix=PATH', the package will use ! PATH as the prefix for installing programs and libraries. ! Documentation and other data files will still use the regular prefix. ! ! In addition, if you use an unusual directory layout you can give ! options like `--bindir=PATH' to specify different values for particular ! kinds of files. Run `configure --help' for a list of the directories ! you can set and what kinds of files go in them. ! ! If the package supports it, you can cause programs to be installed ! with an extra prefix or suffix on their names by giving `configure' the ! option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. ! ! Optional Features ! ================= ! ! Some packages pay attention to `--enable-FEATURE' options to ! `configure', where FEATURE indicates an optional part of the package. ! They may also pay attention to `--with-PACKAGE' options, where PACKAGE ! is something like `gnu-as' or `x' (for the X Window System). The ! `README' should mention any `--enable-' and `--with-' options that the ! package recognizes. ! ! For packages that use the X Window System, `configure' can usually ! find the X include and library files automatically, but if it doesn't, ! you can use the `configure' options `--x-includes=DIR' and ! `--x-libraries=DIR' to specify their locations. ! ! Specifying the System Type ! ========================== ! ! There may be some features `configure' can not figure out ! automatically, but needs to determine by the type of host the package ! will run on. Usually `configure' can figure that out, but if it prints ! a message saying it can not guess the host type, give it the ! `--host=TYPE' option. TYPE can either be a short name for the system ! type, such as `sun4', or a canonical name with three fields: ! CPU-COMPANY-SYSTEM ! ! See the file `config.sub' for the possible values of each field. If ! `config.sub' isn't included in this package, then this package doesn't ! need to know the host type. ! ! If you are building compiler tools for cross-compiling, you can also ! use the `--target=TYPE' option to select the type of system they will ! produce code for and the `--build=TYPE' option to select the type of ! system on which you are compiling the package. ! ! Sharing Defaults ! ================ ! ! If you want to set default values for `configure' scripts to share, ! you can create a site shell script called `config.site' that gives ! default values for variables like `CC', `cache_file', and `prefix'. ! `configure' looks for `PREFIX/share/config.site' if it exists, then ! `PREFIX/etc/config.site' if it exists. Or, you can set the ! `CONFIG_SITE' environment variable to the location of the site script. ! A warning: not all `configure' scripts look for a site script. ! ! Operation Controls ! ================== ! ! `configure' recognizes the following options to control how it ! operates. ! ! `--cache-file=FILE' ! Use and save the results of the tests in FILE instead of ! `./config.cache'. Set FILE to `/dev/null' to disable caching, for ! debugging `configure'. ! ! `--help' ! Print a summary of the options to `configure', and exit. ! ! `--quiet' ! `--silent' ! `-q' ! Do not print messages saying which checks are being made. To ! suppress all normal output, redirect it to `/dev/null' (any error ! messages will still be shown). ! ! `--srcdir=DIR' ! Look for the package's source code in directory DIR. Usually ! `configure' can determine that directory automatically. ! ! `--version' ! Print the version of Autoconf used to generate the `configure' ! script, and exit. ! ! `configure' also accepts some other, not widely useful, options. diff --recursive --context --minimal --new-file oleo-1.6/Makefile.in oleo-1.6jb2/Makefile.in *** oleo-1.6/Makefile.in Sat Jun 4 13:58:09 1994 --- oleo-1.6jb2/Makefile.in Thu May 1 14:24:06 1997 *************** *** 20,36 **** VPATH = @srcdir@ # Common prefix for machine-independent installed files. ! prefix = /usr/local # Common prefix for machine-dependent installed files. ! exec_prefix = $(prefix) # Name under which to install GNU Oleo. instname = oleo # Directory to install `oleo' in. bindir = $(exec_prefix)/bin ! CFLAGS = -g -D_XOPEN_SOURCE BISONFLAGS = ! optional_libs = @LIBS@ @wlibs@ extra_objs =@LIBOBJS@ @ALLOCA@ xincludedir = @xincludedir@ xlibdir = @xlibdir@ --- 20,36 ---- VPATH = @srcdir@ # Common prefix for machine-independent installed files. ! prefix = @prefix@ # Common prefix for machine-dependent installed files. ! exec_prefix = @exec_prefix@ # Name under which to install GNU Oleo. instname = oleo # Directory to install `oleo' in. bindir = $(exec_prefix)/bin ! CFLAGS = @CFLAGS@ -DEUC_JP #-DDISABLE_CURSOR #-DGHOSTSCRIPT BISONFLAGS = ! optional_libs = @LIBS@ extra_objs =@LIBOBJS@ @ALLOCA@ xincludedir = @xincludedir@ xlibdir = @xlibdir@ *************** *** 42,47 **** --- 42,49 ---- INSTALL_PROGRAM = @INSTALL_PROGRAM@ ETAGS = etags -tw CTAGS = ctags -tw + CPPFLAGS= @CPPFLAGS@ + LDFLAGS= @LDFLAGS@ ALL_CFLAGS = $(CFLAGS) $(xincludedir) $(xlibdir) @DEFS@ ALL_BISONFLAGS = $(BISONFLAGS) *************** *** 57,63 **** hash.o panic.o line.o io-curses.o font.o display.o print.o init.o \ sylk.o oleofile.o sc.o list.o busi.o string.o cells.o ir.o xrdb.o cmd.o \ basic.o key.o format.o funcs.o args.o stub.o input.o info.o help.o \ ! forminfo.o graph.o date.o getdate.o posixtm.o all_objs= $(objs) $(extra_objs) --- 59,66 ---- hash.o panic.o line.o io-curses.o font.o display.o print.o init.o \ sylk.o oleofile.o sc.o list.o busi.o string.o cells.o ir.o xrdb.o cmd.o \ basic.o key.o format.o funcs.o args.o stub.o input.o info.o help.o \ ! forminfo.o graph.o date.o getdate.o posixtm.o \ ! makeattr.o printw.o checkeucJP.o let.o all_objs= $(objs) $(extra_objs) *************** *** 69,75 **** sylk.c oleofile.c sc.c list.c busi.c string.c cells.c \ random.c vfprintf.c vsprintf.c _doprnt.c alloca.c cmd.c basic.c args.c \ stub.c input.c info.c help.c graph.c forminfo.c getdate.y \ ! mktime.c posixtm.y date.c strftime.c xmalloc.c headers = byte-compile.h cell.h cmd.h ir.h display.h errors.h eval.h \ font.h funcdef.h global.h hash.h init.h io-abstract.h io-edit.h \ --- 72,79 ---- sylk.c oleofile.c sc.c list.c busi.c string.c cells.c \ random.c vfprintf.c vsprintf.c _doprnt.c alloca.c cmd.c basic.c args.c \ stub.c input.c info.c help.c graph.c forminfo.c getdate.y \ ! mktime.c posixtm.y date.c strftime.c xmalloc.c makeattr.c let.c printw.c \ ! alecompat.c checkeucJP.c headers = byte-compile.h cell.h cmd.h ir.h display.h errors.h eval.h \ font.h funcdef.h global.h hash.h init.h io-abstract.h io-edit.h \ *************** *** 128,134 **** check: echo check check check oleo: $(all_objs) ! $(CC) $(ALL_CFLAGS) -o oleo $(all_objs) $(libs) parse.tab.c: parse.y $(BISON) $(srcdir)/parse.y --- 132,138 ---- check: echo check check check oleo: $(all_objs) ! $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o oleo $(all_objs) $(libs) parse.tab.c: parse.y $(BISON) $(srcdir)/parse.y *************** *** 270,273 **** --- 274,285 ---- line.h io-generic.h obstack.h io-abstract.h io-utils.h io-term.h cmd.h key.h \ args.h funcs.h info.h lists.h regions.h xmalloc.o : xmalloc.c sysdef.h + + # added by K.Hayashida + makeattr.o : makeattr.c + let.o: let.c + + printw.o : printw.c + alecompat.o : alecompat.c alecompat.h + checkeucJP.o: checkeucJP.c xrdb.o : xrdb.c diff --recursive --context --minimal --new-file oleo-1.6/alecompat.c oleo-1.6jb2/alecompat.c *** oleo-1.6/alecompat.c Thu Jan 1 09:00:00 1970 --- oleo-1.6jb2/alecompat.c Sat Mar 15 18:22:52 1997 *************** *** 0 **** --- 1,88 ---- + #include + #include + #include "sysdef.h" + #include "alecompat.h" + + /* + * SVR4 互換 curses 国際化関数 + * 見ての通り、性能に問題があるので、特定のcursesに対して書き直した方がいいです + * + */ + + enum kflags { + F_Asc, + F_1st, + F_2nd + }; + + #if defined(A_CHARTEXT) + #define INCH_MASK A_CHARTEXT + #else + #define INCH_MASK (0x000000ff) + #endif + + /* + * 2バイト目にカーソルがあった場合、1バイト目に移動します + */ + int + wadjcurspos(WINDOW *win) + { + int x,y; + int i; + enum kflags flag = F_Asc; + int ch; + + getyx(win,y,x); + for(i=0;i<= x;i++) { + ch = mvwinch(win,y,i) & INCH_MASK; + if( ch <= 0xa0 || ch >= 0xff ) { + flag = F_Asc; + } else { + if( flag == F_1st ) { + flag = F_2nd; + } else { + flag = F_1st; + } + } + + } + if(flag == F_2nd) { + wmove(win,y,x-1); + return 0; + } + wmove(win,y,x); + return 0; + } + + /* + * 次の文字に移動します + */ + int + wmovenextch(WINDOW *win) + { + int x,y; + + wadjcurspos(win); + getyx(win,y,x); + if( (winch(win) & 0xff) < 0x80) { + /**/ + wmove(win,y,x+1); + } else { + wmove(win,y,x+2); + } + } + + /* + * 一つ前の文字に移動します + */ + int + wmoveprevch(WINDOW *win) + { + int x,y; + + wadjcurspos(win); + getyx(win,y,x); + if( (mvwinch(win,y,x-1) & 0x00ff) > 0x80) { + wmove(win,y,x-1); + } + } diff --recursive --context --minimal --new-file oleo-1.6/alecompat.h oleo-1.6jb2/alecompat.h *** oleo-1.6/alecompat.h Thu Jan 1 09:00:00 1970 --- oleo-1.6jb2/alecompat.h Mon Feb 3 22:56:32 1997 *************** *** 0 **** --- 1,14 ---- + #if !defined(HAVE_ALE_COMPAT_H) + #define HAVE_ALE_COMPAT_H + + #include + + #define adjcurspos() wadjcurspos(stdscr) + #define movenextch() wmovenextch(stdscr) + #define moveprevch() wmoveprevch(stdscr) + + int wadjcurspos(WINDOW *); + int wmovenextch(WINDOW *); + int wmoveprevch(WINDOW *); + + #endif /* !defined(HAVE_ALE_COMPAT_H) */ diff --recursive --context --minimal --new-file oleo-1.6/checkeucJP.c oleo-1.6jb2/checkeucJP.c *** oleo-1.6/checkeucJP.c Thu Jan 1 09:00:00 1970 --- oleo-1.6jb2/checkeucJP.c Mon Feb 3 21:04:24 1997 *************** *** 0 **** --- 1,62 ---- + /* Copyright (C) 1996, 1997 Hayashida Kuniaki. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + */ + + #include + + enum kflags { + F_Asc, + F_1st, + F_2nd + }; + + /* + * checkeucJP + * + * 文字列 p の idx バイト目が EUC の 1バイト目であることをチェックする + * + * 復帰値 + * 2バイト目ならば 1 + * それ以外ならば 0 + */ + + #if defined(EUC_JP) + int + checkeucJP(unsigned char *p,int idx) { + int i; + enum kflags flag = F_Asc; + int ch; + + for(i=0;i<= idx;i++) { + ch = *(p+i); + if( ch == '\0' ) { + break; + } else if( ch <= 0xa0 || ch >= 0xff ) { + flag = F_Asc; + } else { + if(flag == F_1st) { + flag = F_2nd; + } else { + flag = F_1st; + } + } + } + if(flag == F_1st) { + return 1; + } + if(flag == F_2nd) { + return 2; + } + return 0; + } + #endif diff --recursive --context --minimal --new-file oleo-1.6/cmd.c oleo-1.6jb2/cmd.c *** oleo-1.6/cmd.c Sat Jun 4 13:00:04 1994 --- oleo-1.6jb2/cmd.c Tue Nov 5 23:29:16 1996 *************** *** 555,561 **** --- 555,565 ---- if (i_cnt) { + #if defined(EUC_JP) + ch = (unsigned char)ibuf[i_cnt++]; + #else ch = ibuf[i_cnt++]; + #endif /* EUC_JP */ if (i_cnt == i_in) i_cnt = i_in = 0; goto fini; *************** *** 605,618 **** --- 609,630 ---- ret = io_read_kbd (ibuf, sizeof (ibuf)); if (ret == 1) { + #if defined(EUC_JP) + ch = (unsigned char) ibuf[0]; + #else ch = ibuf[0]; + #endif goto fini; } if (ret > 1) { i_cnt = 1; i_in = ret; + #if defined(EUC_JP) + ch = (unsigned char)ibuf[0]; + #else ch = ibuf[0]; + #endif /* EUC_JP */ goto fini; } if (ret == 0 || errno != EINTR) *************** *** 621,631 **** --- 633,645 ---- fini: + #if !defined(EUC_JP) if (ch & 0x80) { saved_char = 1 + (ch & 0x7f); ch = CTRL ('['); } + #endif /* !EUC_JP */ if (making_macro) { diff --recursive --context --minimal --new-file oleo-1.6/configure oleo-1.6jb2/configure *** oleo-1.6/configure Sat Jun 4 14:26:18 1994 --- oleo-1.6jb2/configure Wed Mar 26 00:37:41 1997 *************** *** 1,964 **** ! #!/bin/sh ! # Guess values for system-dependent variables and create Makefiles. ! # Generated automatically using autoconf. ! # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. ! # This program is free software; you can redistribute it and/or modify ! # it under the terms of the GNU 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 General Public License for more details. ! # You should have received a copy of the GNU General Public License ! # along with this program; if not, write to the Free Software ! # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ! # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] ! # [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]] ! # Ignores all args except --srcdir, --prefix, --exec-prefix, and ! # --with-PACKAGE[=VALUE] unless this script has special code to handle it. ! for arg do - # Handle --exec-prefix with a space before the argument. - if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix= - # Handle --host with a space before the argument. - elif test x$next_host = xyes; then next_host= - # Handle --prefix with a space before the argument. - elif test x$next_prefix = xyes; then prefix=$arg; next_prefix= - # Handle --srcdir with a space before the argument. - elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir= - else - case $arg in - # For backward compatibility, recognize -exec-prefix and --exec_prefix. - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*) - exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;; - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e) - next_exec_prefix=yes ;; ! -gas | --gas | --ga | --g) ;; ! -host=* | --host=* | --hos=* | --ho=* | --h=*) ;; ! -host | --host | --hos | --ho | --h) ! next_host=yes ;; ! -nfp | --nfp | --nf) ;; ! -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ! prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;; ! -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ! next_prefix=yes ;; ! -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*) ! srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;; ! -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s) ! next_srcdir=yes ;; ! -with-* | --with-*) ! package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'` ! # Reject names that aren't valid shell variable names. ! if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then ! echo "configure: $package: invalid package name" >&2; exit 1 ! fi ! package=`echo $package| sed 's/-/_/g'` ! case "$arg" in ! *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;; ! *) val=1 ;; ! esac ! eval "with_$package='$val'" ;; ! -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v) ! verbose=yes ;; ! *) ;; esac ! fi done ! trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15 ! trap 'rm -f confdefs*' 0 # NLS nuisances. ! # These must not be set unconditionally because not all systems understand ! # e.g. LANG=C (notably SCO). ! if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi ! if test "${LANG+set}" = 'set' ; then LANG=C; export LANG; fi ! rm -f conftest* confdefs.h echo > confdefs.h - compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1' # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ! unique_file=io-term.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ! srcdirdefaulted=yes ! # Try the directory containing this script, then `..'. ! prog=$0 ! confdir=`echo $prog|sed 's%/[^/][^/]*$%%'` ! test "X$confdir" = "X$prog" && confdir=. ! srcdir=$confdir ! if test ! -r $srcdir/$unique_file; then srcdir=.. fi fi ! if test ! -r $srcdir/$unique_file; then ! if test x$srcdirdefaulted = xyes; then ! echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2 else ! echo "configure: Can not find sources in \`${srcdir}'." 1>&2 fi - exit 1 fi ! # Preserve a srcdir of `.' to avoid automounter screwups with pwd. ! # But we can't avoid them for `..', to make subdirectories work. ! case $srcdir in ! .|/*|~*) ;; ! *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute. ! esac ! # Save the original args to write them into config.status later. ! configure_args="$*" if test -z "$CC"; then ! # Extract the first word of `gcc', so it can be a program name with args. ! set dummy gcc; word=$2 ! echo checking for $word ! IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:" ! for dir in $PATH; do ! test -z "$dir" && dir=. ! if test -f $dir/$word; then ! CC="gcc" break fi done ! IFS="$saveifs" fi - test -z "$CC" && CC="cc" - test -n "$CC" && test -n "$verbose" && echo " setting CC to $CC" ! # Find out if we are using GNU C, under whatever name. ! cat > conftest.c < conftest.out 2>&1 ! if egrep yes conftest.out >/dev/null 2>&1; then ! GCC=1 # For later tests. fi rm -f conftest* ! echo checking how to run the C preprocessor if test -z "$CPP"; then ! # This must be in double quotes, not single quotes, because CPP may get ! # substituted into the Makefile and ``${CC-cc}'' will simply confuse ! # make. It must be expanded now. CPP="${CC-cc} -E" ! cat > conftest.c < Syntax Error EOF ! err=`eval "($CPP conftest.c >/dev/null) 2>&1"` ! if test -z "$err"; then : else rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi ! test ".${verbose}" != "." && echo " setting CPP to $CPP" ! for p in 'bison -y' byacc do ! if test -z "$YACC"; then ! # Extract the first word of `$p', so it can be a program name with args. ! set dummy $p; word=$2 ! echo checking for $word ! IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:" ! for dir in $PATH; do ! test -z "$dir" && dir=. ! if test -f $dir/$word; then ! YACC="$p" break fi done ! IFS="$saveifs" fi - - test -n "$YACC" && test -n "$verbose" && echo " setting YACC to $YACC" test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" ! # Make sure to not get the incompatible SysV /etc/install and ! # /usr/sbin/install, which might be in PATH before a BSD-like install, ! # or the SunOS /usr/etc/install directory, or the AIX /bin/install, ! # or the AFS install, which mishandles nonexistent args, or ! # /usr/ucb/install on SVR4, which tries to use the nonexistent group ! # `staff'. On most BSDish systems install is in /usr/bin, not /usr/ucb ! # anyway. Sigh. ! if test "z${INSTALL}" = "z" ; then ! echo checking for install ! IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:" ! for dir in $PATH; do ! test -z "$dir" && dir=. ! case $dir in ! /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;; *) ! if test -f $dir/installbsd; then ! INSTALL="$dir/installbsd -c" # OSF1 ! INSTALL_PROGRAM='$(INSTALL)' ! INSTALL_DATA='$(INSTALL) -m 644' ! break ! fi ! if test -f $dir/install; then ! if grep dspmsg $dir/install >/dev/null 2>&1; then ! : # AIX ! else ! INSTALL="$dir/install -c" ! INSTALL_PROGRAM='$(INSTALL)' ! INSTALL_DATA='$(INSTALL) -m 644' ! break fi ! fi ;; esac done ! IFS="$saveifs" fi ! INSTALL=${INSTALL-cp} ! test -n "$verbose" && echo " setting INSTALL to $INSTALL" ! INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'} ! test -n "$verbose" && echo " setting INSTALL_PROGRAM to $INSTALL_PROGRAM" ! INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'} ! test -n "$verbose" && echo " setting INSTALL_DATA to $INSTALL_DATA" ! echo checking for POSIXized ISC if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then ! ISC=1 # If later tests want to check for ISC. ! ! { ! test -n "$verbose" && \ ! echo " defining _POSIX_SOURCE" ! echo "#define" _POSIX_SOURCE 1 >> confdefs.h ! DEFS="$DEFS -D_POSIX_SOURCE=1" ! } ! if test -n "$GCC"; then CC="$CC -posix" else CC="$CC -Xp" fi fi ! echo checking for AIX ! cat > conftest.c < conftest.out 2>&1" ! if egrep "yes" conftest.out >/dev/null 2>&1; then rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining _ALL_SOURCE" ! echo "#define" _ALL_SOURCE 1 >> confdefs.h ! DEFS="$DEFS -D_ALL_SOURCE=1" ! } ! fi rm -f conftest* ! echo checking for ANSI C header files ! cat > conftest.c < #include #include #include EOF ! err=`eval "($CPP conftest.c >/dev/null) 2>&1"` ! if test -z "$err"; then rm -rf conftest* # SunOS 4.x string.h does not declare mem*, contrary to ANSI. ! echo '#include "confdefs.h" ! #include ' > conftest.c ! eval "$CPP conftest.c > conftest.out 2>&1" ! if egrep "memchr" conftest.out >/dev/null 2>&1; then rm -rf conftest* ! # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. ! cat > conftest.c < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) ! #define XOR(e,f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF ! eval $compile ! if test -s conftest && (./conftest; exit) 2>/dev/null; then ! rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining STDC_HEADERS" ! echo "#define" STDC_HEADERS 1 >> confdefs.h ! DEFS="$DEFS -DSTDC_HEADERS=1" ! } ! ! fi ! rm -f conftest* ! fi - rm -f conftest* - fi ! rm -f conftest* ! echo checking for unistd.h ! cat > conftest.c < EOF - err=`eval "($CPP conftest.c >/dev/null) 2>&1"` - if test -z "$err"; then - rm -rf conftest* - - { - test -n "$verbose" && \ - echo " defining HAVE_UNISTD_H" - echo "#define" HAVE_UNISTD_H 1 >> confdefs.h - DEFS="$DEFS -DHAVE_UNISTD_H=1" - } - fi - rm -f conftest* ! echo checking for directory library header ! dirheader= ! if test -z "$dirheader"; then ! echo checking for dirent.h ! cat > conftest.c < ! #include ! int main() { exit(0); } ! int t() { DIR *dirp = 0; } EOF ! if eval $compile; then rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining DIRENT" ! echo "#define" DIRENT 1 >> confdefs.h ! DEFS="$DEFS -DDIRENT=1" ! } ! dirheader=dirent.h ! fi rm -f conftest* fi ! if test -z "$dirheader"; then ! echo checking for sys/ndir.h ! cat > conftest.c < ! #include ! int main() { exit(0); } ! int t() { DIR *dirp = 0; } EOF ! if eval $compile; then ! rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining SYSNDIR" ! echo "#define" SYSNDIR 1 >> confdefs.h ! DEFS="$DEFS -DSYSNDIR=1" ! } ! dirheader=sys/ndir.h ! ! fi ! rm -f conftest* fi ! if test -z "$dirheader"; then ! echo checking for sys/dir.h ! cat > conftest.c < ! #include ! int main() { exit(0); } ! int t() { DIR *dirp = 0; } EOF ! if eval $compile; then rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining SYSDIR" ! echo "#define" SYSDIR 1 >> confdefs.h ! DEFS="$DEFS -DSYSDIR=1" ! } ! dirheader=sys/dir.h ! fi rm -f conftest* fi ! if test -z "$dirheader"; then ! echo checking for ndir.h ! cat > conftest.c < ! #include ! int main() { exit(0); } ! int t() { DIR *dirp = 0; } EOF ! if eval $compile; then rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining NDIR" ! echo "#define" NDIR 1 >> confdefs.h ! DEFS="$DEFS -DNDIR=1" ! } ! dirheader=ndir.h ! fi rm -f conftest* fi ! echo checking for closedir return value ! cat > conftest.c < ! #include <$dirheader> ! int closedir(); main() { exit(closedir(opendir(".")) != 0); } EOF ! eval $compile ! if test -s conftest && (./conftest; exit) 2>/dev/null; then ! : else rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining VOID_CLOSEDIR" ! echo "#define" VOID_CLOSEDIR 1 >> confdefs.h ! DEFS="$DEFS -DVOID_CLOSEDIR=1" ! } ! fi rm -f conftest* ! for hdr in sys/time.h string.h memory.h sys/select.h limits.h ! do ! trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'` ! echo checking for ${hdr} ! cat > conftest.c < ! EOF ! err=`eval "($CPP conftest.c >/dev/null) 2>&1"` ! if test -z "$err"; then ! rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining ${trhdr}" ! echo "#define" ${trhdr} 1 >> confdefs.h ! DEFS="$DEFS -D${trhdr}=1" ! } ! fi - rm -f conftest* - done ! echo checking for X11 headers and libraries ! dir="" ! cat > conftest.c < EOF ! err=`eval "($CPP conftest.c >/dev/null) 2>&1"` ! if test -z "$err"; then rm -rf conftest* ! : ! else rm -rf conftest* ! if test -r /usr/local/include/X11/Intrinsic.h; then ! dir=/usr/local/include ! ! elif test -r /usr/include/X11R4/X11/Intrinsic.h; then ! dir=/usr/include/X11R4 ! elif test -r /usr/include/X11R5/X11/Intrinsic.h; then ! dir=/usr/include/X11R5 ! ! elif test -r /usr/lpp/X11/Xamples/include/X11/Intrinsic.h; then ! dir=/usr/lpp/X11/Xamples/include ! elif test -r /usr/X11/include/X11/Intrinsic.h; then ! dir=/usr/X11/include ! elif test -r /usr/X11R5/include/X11/Intrinsic.h; then ! dir=/usr/X11R5/include ! elif test -r /usr/openwin/include/X11/Intrinsic.h; then ! dir=/usr/openwin/include ! elif test -r /usr/openwin/share/include/X11/Intrinsic.h; then ! dir=/usr/openwin/share/include ! elif test -r /usr/include/X11/Intrinsic.h; then ! dir= # everyone's cc searches /usr/include, right? else ! no_x=t fi fi rm -f conftest* ! if test -n "$dir"; then ! xincludedir=-I$dir ! DEFS="$DEFS -I$dir" ! echo "(using $xincludedir)" ! elif test -n "$no_x"; then ! # Not all programs may use this symbol, but it won't hurt to define it. ! xincludedir=-DX_DISPLAY_MISSING ! fi ! ! # ! # Now check for the libraries. Amazing how every single X vendor puts ! # these in a different place, and all because MIT thought they should go ! # in /usr/lib. ! dir1="" ! if test -r /usr/local/lib/libXt.a; then ! dir1=/usr/local/lib ! elif test -r /usr/lib/X11R4/libXt.sl; then ! dir1=/usr/lib/X11R4 ! elif test -r /usr/lib/X11R4/libXt.a; then ! dir1=/usr/lib/X11R4 ! elif test -r /usr/lib/X11R5/libXt.a; then ! dir1=/usr/lib/X11R5 ! elif test -r /usr/lpp/X11/Xamples/lib/Xt/libXt.a; then ! dir1=/usr/lpp/X11/Xamples/lib/Xt ! elif test -r /usr/X11/lib/libXt.a; then ! dir1=/usr/X11/lib ! elif test -r /usr/X11R5/lib/libXt.a; then ! dir1=/usr/X11R5/lib ! elif test -r /usr/openwin/lib/libXt.a; then ! dir1=/usr/openwin/lib ! elif test -r /usr/openwin/lib/libXt.so; then ! dir1=/usr/openwin/lib fi - dir2="" - if test -r /usr/lpp/X11/Xamples/lib/Xmu/libXmu.a; then - dir2=/usr/lpp/X11/Xamples/lib/Xmu fi - # - # It would be nice to have a more robust check for the -R ld option then - # just checking for Solaris. The parentheses elide `uname: not found'. - # - # It would also be nice to do this for all -L options, not just this one. - if test -n "$dir1"; then - xlibdir=-L$dir1 - DEFS="$DEFS -L$dir1" - if test "`(uname) 2>/dev/null`" = SunOS && uname -r | grep '^5'; then - xlibdir="$xlibdir -R$dir1" fi ! # ! # Don't need all that stuff for dir2, since it only gets used on AIX. ! test -n "$dir2" && xlibdir="$xlibdir -L$dir2" ! fi ! # ! # Check for additional X libraries. ! # ! # Since we already have an explicit check for POSIXified ISC, use it. ! if test -n "$ISC"; then ! wlibs="$wlibs -lnsl_s -linet" ! echo "(adding -lnsl_s -linet to wlibs)" else ! # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X ! # libraries were built with DECnet support. And karl@cs.umb.edu's Alpha ! # needs dnet_stubs. ! LIBS_save="${LIBS}" ! LIBS="${LIBS} -ldnet" ! have_lib="" ! echo checking for -ldnet ! cat > conftest.c < conftest.c < conftest.c < conftest.c < EOF ! err=`eval "($CPP conftest.c >/dev/null) 2>&1"` ! if test -z "$err"; then ! rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining HAVE_X11_X_H" ! echo "#define" HAVE_X11_X_H 1 >> confdefs.h ! DEFS="$DEFS -DHAVE_X11_X_H=1" ! } ! LIBS="$LIBS -lX11" ! fi ! rm -f conftest* ! echo checking for return type of signal handlers ! cat > conftest.c < #include #ifdef signal #undef signal #endif ! extern void (*signal ()) (); ! int main() { exit(0); } ! int t() { int i; } EOF ! if eval $compile; then rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining" RETSIGTYPE to be void ! echo "#define" RETSIGTYPE void >> confdefs.h ! DEFS="$DEFS -DRETSIGTYPE=void" ! } ! ! else rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining" RETSIGTYPE to be int ! echo "#define" RETSIGTYPE int >> confdefs.h ! DEFS="$DEFS -DRETSIGTYPE=int" ! } ! fi rm -f conftest* # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! ! echo checking for working alloca.h ! cat > conftest.c < ! int main() { exit(0); } ! int t() { char *p = alloca(2 * sizeof(int)); } EOF ! if eval $compile; then rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining HAVE_ALLOCA_H" ! echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h ! DEFS="$DEFS -DHAVE_ALLOCA_H=1" ! } fi - rm -f conftest* ! decl="#ifdef __GNUC__ ! #define alloca __builtin_alloca ! #else ! #if HAVE_ALLOCA_H ! #include #else ! #ifdef _AIX #pragma alloca ! #else char *alloca (); #endif ! #endif ! #endif ! " ! echo checking for alloca ! cat > conftest.c < conftest.c < conftest.out 2>&1" ! if egrep "winnitude" conftest.out >/dev/null 2>&1; then ! rm -rf conftest* ! echo checking for _getb67 ! cat > conftest.c < ! int main() { exit(0); } ! int t() { ! /* The GNU C library defines this for functions which it implements ! to always fail with ENOSYS. Some functions are actually named ! something starting with __ and the normal name is an alias. */ ! #if defined (__stub__getb67) || defined (__stub____getb67) ! choke me ! #else ! /* Override any gcc2 internal prototype to avoid an error. */ ! extern char _getb67(); _getb67(); ! #endif ! } EOF - if eval $compile; then - rm -rf conftest* - { - test -n "$verbose" && \ - echo " defining" CRAY_STACKSEG_END to be _getb67 - echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h - DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67" - } else ! rm -rf conftest* ! echo checking for GETB67 ! cat > conftest.c < ! int main() { exit(0); } ! int t() { ! /* The GNU C library defines this for functions which it implements ! to always fail with ENOSYS. Some functions are actually named ! something starting with __ and the normal name is an alias. */ ! #if defined (__stub_GETB67) || defined (__stub___GETB67) ! choke me #else ! /* Override any gcc2 internal prototype to avoid an error. */ ! extern char GETB67(); GETB67(); #endif ! } EOF ! if eval $compile; then rm -rf conftest* ! { ! test -n "$verbose" && \ ! echo " defining" CRAY_STACKSEG_END to be GETB67 ! echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h ! DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67" ! } else ! rm -rf conftest* ! echo checking for getb67 ! cat > conftest.c < ! int main() { exit(0); } ! int t() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ ! #if defined (__stub_getb67) || defined (__stub___getb67) choke me #else ! /* Override any gcc2 internal prototype to avoid an error. */ ! extern char getb67(); getb67(); #endif ! } EOF ! if eval $compile; then rm -rf conftest* ! { ! test -n "$verbose" && \ ! echo " defining" CRAY_STACKSEG_END to be getb67 ! echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h ! DEFS="$DEFS -DCRAY_STACKSEG_END=getb67" ! } ! ! ! fi ! rm -f conftest* ! fi rm -f conftest* - fi - rm -f conftest* fi - rm -f conftest* - fi - rm -f conftest* - - if test -n "$alloca_missing"; then - # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.o - - { - test -n "$verbose" && \ - echo " defining C_ALLOCA" - echo "#define" C_ALLOCA 1 >> confdefs.h - DEFS="$DEFS -DC_ALLOCA=1" - } - ! echo 'checking stack direction for C alloca' ! echo checking whether cross-compiling ! # If we cannot run a trivial program, we must be cross compiling. ! cat > conftest.c </dev/null; then ! : else ! rm -rf conftest* ! cross_compiling=1 ! fi ! rm -f conftest* ! ! if test -n "$cross_compiling" ! then ! ! { ! test -n "$verbose" && \ ! echo " defining" STACK_DIRECTION to be 0 ! echo "#define" STACK_DIRECTION 0 >> confdefs.h ! DEFS="$DEFS -DSTACK_DIRECTION=0" ! } ! else ! cat > conftest.c <&2; exit 1; } ! fi ! ac_feature=`echo $ac_feature| sed 's/-/_/g'` ! eval "enable_${ac_feature}=no" ;; ! ! -enable-* | --enable-*) ! ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` ! # Reject names that are not valid shell variable names. ! if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then ! { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } ! fi ! ac_feature=`echo $ac_feature| sed 's/-/_/g'` ! case "$ac_option" in ! *=*) ;; ! *) ac_optarg=yes ;; esac ! eval "enable_${ac_feature}='$ac_optarg'" ;; ! ! -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ ! | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ ! | --exec | --exe | --ex) ! ac_prev=exec_prefix ;; ! -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ ! | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ ! | --exec=* | --exe=* | --ex=*) ! exec_prefix="$ac_optarg" ;; ! ! -gas | --gas | --ga | --g) ! # Obsolete; use --with-gas. ! with_gas=yes ;; ! ! -help | --help | --hel | --he) ! # Omit some internal or obsolete options to make the list less imposing. ! # This message is too long to be a string in the A/UX 3.1 sh. ! cat << EOF ! Usage: configure [options] [host] ! Options: [defaults in brackets after descriptions] ! Configuration: ! --cache-file=FILE cache test results in FILE ! --help print this message ! --no-create do not create output files ! --quiet, --silent do not print \`checking...' messages ! --version print the version of autoconf that created configure ! Directory and file names: ! --prefix=PREFIX install architecture-independent files in PREFIX ! [$ac_default_prefix] ! --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX ! [same as prefix] ! --bindir=DIR user executables in DIR [EPREFIX/bin] ! --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] ! --libexecdir=DIR program executables in DIR [EPREFIX/libexec] ! --datadir=DIR read-only architecture-independent data in DIR ! [PREFIX/share] ! --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] ! --sharedstatedir=DIR modifiable architecture-independent data in DIR ! [PREFIX/com] ! --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] ! --libdir=DIR object code libraries in DIR [EPREFIX/lib] ! --includedir=DIR C header files in DIR [PREFIX/include] ! --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] ! --infodir=DIR info documentation in DIR [PREFIX/info] ! --mandir=DIR man documentation in DIR [PREFIX/man] ! --srcdir=DIR find the sources in DIR [configure dir or ..] ! --program-prefix=PREFIX prepend PREFIX to installed program names ! --program-suffix=SUFFIX append SUFFIX to installed program names ! --program-transform-name=PROGRAM ! run sed PROGRAM on installed program names ! EOF ! cat << EOF ! Host type: ! --build=BUILD configure for building on BUILD [BUILD=HOST] ! --host=HOST configure for HOST [guessed] ! --target=TARGET configure for TARGET [TARGET=HOST] ! Features and packages: ! --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) ! --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ! --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] ! --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ! --x-includes=DIR X include files are in DIR ! --x-libraries=DIR X library files are in DIR ! EOF ! if test -n "$ac_help"; then ! echo "--enable and --with options recognized:$ac_help" ! fi ! exit 0 ;; ! ! -host | --host | --hos | --ho) ! ac_prev=host ;; ! -host=* | --host=* | --hos=* | --ho=*) ! host="$ac_optarg" ;; ! ! -includedir | --includedir | --includedi | --included | --include \ ! | --includ | --inclu | --incl | --inc) ! ac_prev=includedir ;; ! -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ ! | --includ=* | --inclu=* | --incl=* | --inc=*) ! includedir="$ac_optarg" ;; ! ! -infodir | --infodir | --infodi | --infod | --info | --inf) ! ac_prev=infodir ;; ! -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) ! infodir="$ac_optarg" ;; ! ! -libdir | --libdir | --libdi | --libd) ! ac_prev=libdir ;; ! -libdir=* | --libdir=* | --libdi=* | --libd=*) ! libdir="$ac_optarg" ;; ! ! -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ ! | --libexe | --libex | --libe) ! ac_prev=libexecdir ;; ! -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ ! | --libexe=* | --libex=* | --libe=*) ! libexecdir="$ac_optarg" ;; ! ! -localstatedir | --localstatedir | --localstatedi | --localstated \ ! | --localstate | --localstat | --localsta | --localst \ ! | --locals | --local | --loca | --loc | --lo) ! ac_prev=localstatedir ;; ! -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ ! | --localstate=* | --localstat=* | --localsta=* | --localst=* \ ! | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) ! localstatedir="$ac_optarg" ;; ! ! -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ! ac_prev=mandir ;; ! -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) ! mandir="$ac_optarg" ;; ! ! -nfp | --nfp | --nf) ! # Obsolete; use --without-fp. ! with_fp=no ;; ! ! -no-create | --no-create | --no-creat | --no-crea | --no-cre \ ! | --no-cr | --no-c) ! no_create=yes ;; ! ! -no-recursion | --no-recursion | --no-recursio | --no-recursi \ ! | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ! no_recursion=yes ;; ! ! -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ ! | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ ! | --oldin | --oldi | --old | --ol | --o) ! ac_prev=oldincludedir ;; ! -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ ! | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ ! | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) ! oldincludedir="$ac_optarg" ;; ! ! -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ! ac_prev=prefix ;; ! -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ! prefix="$ac_optarg" ;; ! ! -program-prefix | --program-prefix | --program-prefi | --program-pref \ ! | --program-pre | --program-pr | --program-p) ! ac_prev=program_prefix ;; ! -program-prefix=* | --program-prefix=* | --program-prefi=* \ ! | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) ! program_prefix="$ac_optarg" ;; ! ! -program-suffix | --program-suffix | --program-suffi | --program-suff \ ! | --program-suf | --program-su | --program-s) ! ac_prev=program_suffix ;; ! -program-suffix=* | --program-suffix=* | --program-suffi=* \ ! | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) ! program_suffix="$ac_optarg" ;; ! ! -program-transform-name | --program-transform-name \ ! | --program-transform-nam | --program-transform-na \ ! | --program-transform-n | --program-transform- \ ! | --program-transform | --program-transfor \ ! | --program-transfo | --program-transf \ ! | --program-trans | --program-tran \ ! | --progr-tra | --program-tr | --program-t) ! ac_prev=program_transform_name ;; ! -program-transform-name=* | --program-transform-name=* \ ! | --program-transform-nam=* | --program-transform-na=* \ ! | --program-transform-n=* | --program-transform-=* \ ! | --program-transform=* | --program-transfor=* \ ! | --program-transfo=* | --program-transf=* \ ! | --program-trans=* | --program-tran=* \ ! | --progr-tra=* | --program-tr=* | --program-t=*) ! program_transform_name="$ac_optarg" ;; ! ! -q | -quiet | --quiet | --quie | --qui | --qu | --q \ ! | -silent | --silent | --silen | --sile | --sil) ! silent=yes ;; ! ! -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ! ac_prev=sbindir ;; ! -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ ! | --sbi=* | --sb=*) ! sbindir="$ac_optarg" ;; ! ! -sharedstatedir | --sharedstatedir | --sharedstatedi \ ! | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ ! | --sharedst | --shareds | --shared | --share | --shar \ ! | --sha | --sh) ! ac_prev=sharedstatedir ;; ! -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ ! | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ ! | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ ! | --sha=* | --sh=*) ! sharedstatedir="$ac_optarg" ;; ! ! -site | --site | --sit) ! ac_prev=site ;; ! -site=* | --site=* | --sit=*) ! site="$ac_optarg" ;; ! ! -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ! ac_prev=srcdir ;; ! -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ! srcdir="$ac_optarg" ;; ! ! -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ ! | --syscon | --sysco | --sysc | --sys | --sy) ! ac_prev=sysconfdir ;; ! -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ ! | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) ! sysconfdir="$ac_optarg" ;; ! ! -target | --target | --targe | --targ | --tar | --ta | --t) ! ac_prev=target ;; ! -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) ! target="$ac_optarg" ;; ! ! -v | -verbose | --verbose | --verbos | --verbo | --verb) ! verbose=yes ;; ! ! -version | --version | --versio | --versi | --vers) ! echo "configure generated by autoconf version 2.12" ! exit 0 ;; ! ! -with-* | --with-*) ! ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` ! # Reject names that are not valid shell variable names. ! if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then ! { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } ! fi ! ac_package=`echo $ac_package| sed 's/-/_/g'` ! case "$ac_option" in ! *=*) ;; ! *) ac_optarg=yes ;; ! esac ! eval "with_${ac_package}='$ac_optarg'" ;; ! ! -without-* | --without-*) ! ac_package=`echo $ac_option|sed -e 's/-*without-//'` ! # Reject names that are not valid shell variable names. ! if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then ! { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } ! fi ! ac_package=`echo $ac_package| sed 's/-/_/g'` ! eval "with_${ac_package}=no" ;; ! ! --x) ! # Obsolete; use --with-x. ! with_x=yes ;; ! ! -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ ! | --x-incl | --x-inc | --x-in | --x-i) ! ac_prev=x_includes ;; ! -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ ! | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) ! x_includes="$ac_optarg" ;; ! ! -x-libraries | --x-libraries | --x-librarie | --x-librari \ ! | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ! ac_prev=x_libraries ;; ! -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ ! | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) ! x_libraries="$ac_optarg" ;; ! ! -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ! ;; ! ! *) ! if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then ! echo "configure: warning: $ac_option: invalid host type" 1>&2 ! fi ! if test "x$nonopt" != xNONE; then ! { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ! fi ! nonopt="$ac_option" ! ;; ! ! esac done ! if test -n "$ac_prev"; then ! { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } ! fi ! ! trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 ! ! # File descriptor usage: ! # 0 standard input ! # 1 file creation ! # 2 errors and warnings ! # 3 some systems may open it to /dev/tty ! # 4 used on the Kubota Titan ! # 6 checking for... messages and results ! # 5 compiler messages saved in config.log ! if test "$silent" = yes; then ! exec 6>/dev/null ! else ! exec 6>&1 ! fi ! exec 5>./config.log ! ! echo "\ ! This file contains any messages produced by compilers while ! running configure, to aid debugging if configure makes a mistake. ! " 1>&5 ! ! # Strip out --no-create and --no-recursion so they do not pile up. ! # Also quote any args containing shell metacharacters. ! ac_configure_args= ! for ac_arg ! do ! case "$ac_arg" in ! -no-create | --no-create | --no-creat | --no-crea | --no-cre \ ! | --no-cr | --no-c) ;; ! -no-recursion | --no-recursion | --no-recursio | --no-recursi \ ! | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; ! *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ! ac_configure_args="$ac_configure_args '$ac_arg'" ;; ! *) ac_configure_args="$ac_configure_args $ac_arg" ;; ! esac ! done # NLS nuisances. ! # Only set these to C if already set. These must not be set unconditionally ! # because not all systems understand e.g. LANG=C (notably SCO). ! # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! ! # Non-C LC_CTYPE values break the ctype check. ! if test "${LANG+set}" = set; then LANG=C; export LANG; fi ! if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi ! if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi ! if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi ! # confdefs.h avoids OS command line length limits that DEFS can exceed. ! rm -rf conftest* confdefs.h ! # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ! ac_unique_file=io-term.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ! ac_srcdir_defaulted=yes ! # Try the directory containing this script, then its parent. ! ac_prog=$0 ! ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` ! test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. ! srcdir=$ac_confdir ! if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi + else + ac_srcdir_defaulted=no fi ! if test ! -r $srcdir/$ac_unique_file; then ! if test "$ac_srcdir_defaulted" = yes; then ! { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else ! { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi ! srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` ! ! # Prefer explicitly selected file to automatically selected ones. ! if test -z "$CONFIG_SITE"; then ! if test "x$prefix" != xNONE; then ! CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" ! else ! CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" ! fi ! fi ! for ac_site_file in $CONFIG_SITE; do ! if test -r "$ac_site_file"; then ! echo "loading site script $ac_site_file" ! . "$ac_site_file" ! fi ! done + if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file + else + echo "creating cache $cache_file" + > $cache_file + fi ! ac_ext=c ! # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ! ac_cpp='$CPP $CPPFLAGS' ! ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ! cross_compiling=$ac_cv_prog_cc_cross ! ! if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then ! # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. ! if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ! ac_n= ac_c=' ! ' ac_t=' ' ! else ! ac_n=-n ac_c= ac_t= ! fi ! else ! ac_n= ac_c='\c' ac_t= ! fi ! ! ! # Extract the first word of "gcc", so it can be a program name with args. ! set dummy gcc; ac_word=$2 ! echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:527: checking for $ac_word" >&5 ! if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! if test -n "$CC"; then ! ac_cv_prog_CC="$CC" # Let the user override the test. ! else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ! for ac_dir in $PATH; do ! test -z "$ac_dir" && ac_dir=. ! if test -f $ac_dir/$ac_word; then ! ac_cv_prog_CC="gcc" ! break ! fi ! done ! IFS="$ac_save_ifs" ! fi ! fi ! CC="$ac_cv_prog_CC" ! if test -n "$CC"; then ! echo "$ac_t""$CC" 1>&6 ! else ! echo "$ac_t""no" 1>&6 ! fi if test -z "$CC"; then ! # Extract the first word of "cc", so it can be a program name with args. ! set dummy cc; ac_word=$2 ! echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:556: checking for $ac_word" >&5 ! if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! if test -n "$CC"; then ! ac_cv_prog_CC="$CC" # Let the user override the test. ! else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ! ac_prog_rejected=no ! for ac_dir in $PATH; do ! test -z "$ac_dir" && ac_dir=. ! if test -f $ac_dir/$ac_word; then ! if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ! ac_prog_rejected=yes ! continue ! fi ! ac_cv_prog_CC="cc" break fi done ! IFS="$ac_save_ifs" ! if test $ac_prog_rejected = yes; then ! # We found a bogon in the path, so make sure we never use it. ! set dummy $ac_cv_prog_CC ! shift ! if test $# -gt 0; then ! # We chose a different compiler from the bogus one. ! # However, it has the same basename, so the bogon will be chosen ! # first if we set CC to just the basename; use the full file name. ! shift ! set dummy "$ac_dir/$ac_word" "$@" ! shift ! ac_cv_prog_CC="$@" ! fi ! fi ! fi ! fi ! CC="$ac_cv_prog_CC" ! if test -n "$CC"; then ! echo "$ac_t""$CC" 1>&6 ! else ! echo "$ac_t""no" 1>&6 fi ! test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } ! fi ! ! echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:604: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ! ! ac_ext=c ! # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ! ac_cpp='$CPP $CPPFLAGS' ! ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ! cross_compiling=$ac_cv_prog_cc_cross ! ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ! ac_cv_prog_cc_works=yes ! # If we can't run a trivial program, we are probably using a cross compiler. ! if (./conftest; exit) 2>/dev/null; then ! ac_cv_prog_cc_cross=no ! else ! ac_cv_prog_cc_cross=yes ! fi ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! ac_cv_prog_cc_works=no ! fi ! rm -fr conftest* ! ! echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 ! if test $ac_cv_prog_cc_works = no; then ! { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } ! fi ! echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:638: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 ! echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 ! cross_compiling=$ac_cv_prog_cc_cross ! ! echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:643: checking whether we are using GNU C" >&5 ! if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ! ac_cv_prog_gcc=yes ! else ! ac_cv_prog_gcc=no ! fi ! fi ! ! echo "$ac_t""$ac_cv_prog_gcc" 1>&6 ! ! if test $ac_cv_prog_gcc = yes; then ! GCC=yes ! ac_test_CFLAGS="${CFLAGS+set}" ! ac_save_CFLAGS="$CFLAGS" ! CFLAGS= ! echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:667: checking whether ${CC-cc} accepts -g" >&5 ! if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! echo 'void f(){}' > conftest.c ! if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ! ac_cv_prog_cc_g=yes ! else ! ac_cv_prog_cc_g=no fi rm -f conftest* ! fi ! ! echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 ! if test "$ac_test_CFLAGS" = set; then ! CFLAGS="$ac_save_CFLAGS" ! elif test $ac_cv_prog_cc_g = yes; then ! CFLAGS="-g -O2" ! else ! CFLAGS="-O2" ! fi ! else ! GCC= ! test "${CFLAGS+set}" = set || CFLAGS="-g" ! fi ! ! echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:695: checking how to run the C preprocessor" >&5 ! # On Suns, sometimes $CPP names a directory. ! if test -n "$CPP" && test -d "$CPP"; then ! CPP= ! fi if test -z "$CPP"; then ! if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! # This must be in double quotes, not single quotes, because CPP may get ! # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" ! # On the NeXT, cc -E runs the code through the compiler's parser, ! # not just through cpp. ! cat > conftest.$ac_ext < Syntax Error EOF ! ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` ! if test -z "$ac_err"; then ! : ! else ! echo "$ac_err" >&5 ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! CPP="${CC-cc} -E -traditional-cpp" ! cat > conftest.$ac_ext < ! Syntax Error ! EOF ! ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` ! if test -z "$ac_err"; then : else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi ! rm -f conftest* ! ac_cv_prog_CPP="$CPP" ! fi ! CPP="$ac_cv_prog_CPP" ! else ! ac_cv_prog_CPP="$CPP" ! fi ! echo "$ac_t""$CPP" 1>&6 ! for ac_prog in 'bison -y' byacc do ! # Extract the first word of "$ac_prog", so it can be a program name with args. ! set dummy $ac_prog; ac_word=$2 ! echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:760: checking for $ac_word" >&5 ! if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! if test -n "$YACC"; then ! ac_cv_prog_YACC="$YACC" # Let the user override the test. ! else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ! for ac_dir in $PATH; do ! test -z "$ac_dir" && ac_dir=. ! if test -f $ac_dir/$ac_word; then ! ac_cv_prog_YACC="$ac_prog" break fi done ! IFS="$ac_save_ifs" ! fi ! fi ! YACC="$ac_cv_prog_YACC" ! if test -n "$YACC"; then ! echo "$ac_t""$YACC" 1>&6 ! else ! echo "$ac_t""no" 1>&6 fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" ! ac_aux_dir= ! for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do ! if test -f $ac_dir/install-sh; then ! ac_aux_dir=$ac_dir ! ac_install_sh="$ac_aux_dir/install-sh -c" ! break ! elif test -f $ac_dir/install.sh; then ! ac_aux_dir=$ac_dir ! ac_install_sh="$ac_aux_dir/install.sh -c" ! break ! fi ! done ! if test -z "$ac_aux_dir"; then ! { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } ! fi ! ac_config_guess=$ac_aux_dir/config.guess ! ac_config_sub=$ac_aux_dir/config.sub ! ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. ! ! # Find a good install program. We prefer a C program (faster), ! # so one script is as good as another. But avoid the broken or ! # incompatible versions: ! # SysV /etc/install, /usr/sbin/install ! # SunOS /usr/etc/install ! # IRIX /sbin/install ! # AIX /bin/install ! # AFS /usr/afsws/bin/install, which mishandles nonexistent args ! # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" ! # ./install, which can be erroneously created by make from ./install.sh. ! echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:819: checking for a BSD compatible install" >&5 ! if test -z "$INSTALL"; then ! if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" ! for ac_dir in $PATH; do ! # Account for people who put trailing slashes in PATH elements. ! case "$ac_dir/" in ! /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) ! # OSF1 and SCO ODT 3.0 have their own names for install. ! for ac_prog in ginstall installbsd scoinst install; do ! if test -f $ac_dir/$ac_prog; then ! if test $ac_prog = install && ! grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then ! # AIX install. It has an incompatible calling convention. ! # OSF/1 installbsd also uses dspmsg, but is usable. ! : ! else ! ac_cv_path_install="$ac_dir/$ac_prog -c" ! break 2 ! fi fi ! done ;; esac done ! IFS="$ac_save_IFS" ! fi ! if test "${ac_cv_path_install+set}" = set; then ! INSTALL="$ac_cv_path_install" ! else ! # As a last resort, use the slow shell script. We don't cache a ! # path for INSTALL within a source directory, because that will ! # break other packages using the cache if that directory is ! # removed, or if the path is relative. ! INSTALL="$ac_install_sh" ! fi ! fi ! echo "$ac_t""$INSTALL" 1>&6 + # Use test -z because SunOS4 sh mishandles braces in ${var-val}. + # It thinks the first close brace ends the variable substitution. + test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' ! test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' ! ! ! echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 ! echo "configure:870: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then ! echo "$ac_t""yes" 1>&6 ! ISC=yes # If later tests want to check for ISC. ! cat >> confdefs.h <<\EOF ! #define _POSIX_SOURCE 1 ! EOF ! if test "$GCC" = yes; then CC="$CC -posix" else CC="$CC -Xp" fi + else + echo "$ac_t""no" 1>&6 + ISC= fi ! echo $ac_n "checking for AIX""... $ac_c" 1>&6 ! echo "configure:891: checking for AIX" >&5 ! cat > conftest.$ac_ext <&5 | ! egrep "yes" >/dev/null 2>&1; then rm -rf conftest* ! echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF ! #define _ALL_SOURCE 1 ! EOF + else + rm -rf conftest* + echo "$ac_t""no" 1>&6 fi rm -f conftest* ! echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:916: checking for ANSI C header files" >&5 ! if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < #include #include #include EOF ! ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` ! if test -z "$ac_err"; then ! rm -rf conftest* ! ac_cv_header_stdc=yes ! else ! echo "$ac_err" >&5 ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 rm -rf conftest* + ac_cv_header_stdc=no + fi + rm -f conftest* + + if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. ! cat > conftest.$ac_ext < ! EOF ! if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "memchr" >/dev/null 2>&1; then ! : ! else rm -rf conftest* ! ac_cv_header_stdc=no ! fi ! rm -f conftest* ! ! fi ! ! if test $ac_cv_header_stdc = yes; then ! # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. ! cat > conftest.$ac_ext < ! EOF ! if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "free" >/dev/null 2>&1; then ! : ! else ! rm -rf conftest* ! ac_cv_header_stdc=no ! fi ! rm -f conftest* ! ! fi ! ! if test $ac_cv_header_stdc = yes; then ! # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. ! if test "$cross_compiling" = yes; then ! : ! else ! cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) ! #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF ! if { (eval echo configure:996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null ! then ! : ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -fr conftest* ! ac_cv_header_stdc=no fi ! rm -fr conftest* fi fi ! fi ! echo "$ac_t""$ac_cv_header_stdc" 1>&6 ! if test $ac_cv_header_stdc = yes; then ! cat >> confdefs.h <<\EOF ! #define STDC_HEADERS 1 EOF fi ! for ac_hdr in unistd.h ! do ! ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ! echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1023: checking for $ac_hdr" >&5 ! if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < EOF ! ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` ! if test -z "$ac_err"; then rm -rf conftest* ! eval "ac_cv_header_$ac_safe=yes" ! else ! echo "$ac_err" >&5 ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi ! if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ! cat >> confdefs.h <&6 fi ! done ! ! ac_header_dirent=no ! for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h ! do ! ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ! echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:1064: checking for $ac_hdr that defines DIR" >&5 ! if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < ! #include <$ac_hdr> ! int main() { ! DIR *dirp = 0; ! ; return 0; } EOF ! if { (eval echo configure:1077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ! eval "ac_cv_header_dirent_$ac_safe=yes" ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_header_dirent_$ac_safe=no" fi rm -f conftest* fi ! if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ! cat >> confdefs.h <&6 ! fi ! done ! # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. ! if test $ac_header_dirent = dirent.h; then ! echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:1102: checking for opendir in -ldir" >&5 ! ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` ! if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! ac_save_LIBS="$LIBS" ! LIBS="-ldir $LIBS" ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=yes" ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -ldir" + else + echo "$ac_t""no" 1>&6 fi ! else ! echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:1143: checking for opendir in -lx" >&5 ! ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` ! if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! ac_save_LIBS="$LIBS" ! LIBS="-lx $LIBS" ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ! rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* + LIBS="$ac_save_LIBS" ! fi ! if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! LIBS="$LIBS -lx" ! else ! echo "$ac_t""no" 1>&6 ! fi fi ! for ac_hdr in sys/time.h string.h memory.h sys/select.h limits.h ! do ! ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ! echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1188: checking for $ac_hdr" >&5 ! if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < EOF ! ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` ! if test -z "$ac_err"; then rm -rf conftest* ! eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ! eval "ac_cv_header_$ac_safe=no" ! fi ! rm -f conftest* ! fi ! if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ! cat >> confdefs.h <&6 ! fi ! done ! # If we find X, set shell vars x_includes and x_libraries to the ! # paths, otherwise set no_x=yes. ! # Uses ac_ vars as temps to allow command line to override cache and checks. ! # --without-x overrides everything else, but does not touch the cache. ! echo $ac_n "checking for X""... $ac_c" 1>&6 ! echo "configure:1229: checking for X" >&5 ! # Check whether --with-x or --without-x was given. ! if test "${with_x+set}" = set; then ! withval="$with_x" ! : ! fi ! # $have_x is `yes', `no', `disabled', or empty when we do not yet know. ! if test "x$with_x" = xno; then ! # The user explicitly disabled X. ! have_x=disabled ! else ! if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then ! # Both variables are already set. ! have_x=yes else ! if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! # One or both of the vars are not set, and there is no cached value. ! ac_x_includes=NO ac_x_libraries=NO ! rm -fr conftestdir ! if mkdir conftestdir; then ! cd conftestdir ! # Make sure to not put "make" in the Imakefile rules, since we grep it out. ! cat > Imakefile <<'EOF' ! acfindx: ! @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' ! EOF ! if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then ! # GNU make sometimes prints "make[1]: Entering...", which would confuse us. ! eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` ! # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. ! for ac_extension in a so sl; do ! if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && ! test -f $ac_im_libdir/libX11.$ac_extension; then ! ac_im_usrlibdir=$ac_im_libdir; break ! fi ! done ! # Screen out bogus values from the imake configuration. They are ! # bogus both because they are the default anyway, and because ! # using them would break gcc on systems where it needs fixed includes. ! case "$ac_im_incroot" in ! /usr/include) ;; ! *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; ! esac ! case "$ac_im_usrlibdir" in ! /usr/lib | /lib) ;; ! *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; ! esac fi + cd .. + rm -fr conftestdir + fi + if test "$ac_x_includes" = NO; then + # Guess where to find include files, by looking for this one X11 .h file. + test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h + + # First, try using that file with no special directory specified. + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out` + if test -z "$ac_err"; then + rm -rf conftest* + # We can compile using X headers with no special include directory. + ac_x_includes= + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + # Look for the header file in a standard set of common directories. + # Check X11 before X11Rn because it is often a symlink to the current release. + for ac_dir in \ + /usr/X11/include \ + /usr/X11R6/include \ + /usr/X11R5/include \ + /usr/X11R4/include \ + \ + /usr/include/X11 \ + /usr/include/X11R6 \ + /usr/include/X11R5 \ + /usr/include/X11R4 \ + \ + /usr/local/X11/include \ + /usr/local/X11R6/include \ + /usr/local/X11R5/include \ + /usr/local/X11R4/include \ + \ + /usr/local/include/X11 \ + /usr/local/include/X11R6 \ + /usr/local/include/X11R5 \ + /usr/local/include/X11R4 \ + \ + /usr/X386/include \ + /usr/x386/include \ + /usr/XFree86/include/X11 \ + \ + /usr/include \ + /usr/local/include \ + /usr/unsupported/include \ + /usr/athena/include \ + /usr/local/x11r5/include \ + /usr/lpp/Xamples/include \ + \ + /usr/openwin/include \ + /usr/openwin/share/include \ + ; \ + do + if test -r "$ac_dir/$x_direct_test_include"; then + ac_x_includes=$ac_dir + break + fi + done fi rm -f conftest* ! fi # $ac_x_includes = NO ! if test "$ac_x_libraries" = NO; then ! # Check for the libraries. ! test -z "$x_direct_test_library" && x_direct_test_library=Xt ! test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc ! # See if we find them without any special options. ! # Don't add to $LIBS permanently. ! ac_save_LIBS="$LIBS" ! LIBS="-l$x_direct_test_library $LIBS" ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ! rm -rf conftest* ! LIBS="$ac_save_LIBS" ! # We can link X programs with no special library path. ! ac_x_libraries= ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! LIBS="$ac_save_LIBS" ! # First see if replacing the include by lib works. ! # Check X11 before X11Rn because it is often a symlink to the current release. ! for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ ! /usr/X11/lib \ ! /usr/X11R6/lib \ ! /usr/X11R5/lib \ ! /usr/X11R4/lib \ ! \ ! /usr/lib/X11 \ ! /usr/lib/X11R6 \ ! /usr/lib/X11R5 \ ! /usr/lib/X11R4 \ ! \ ! /usr/local/X11/lib \ ! /usr/local/X11R6/lib \ ! /usr/local/X11R5/lib \ ! /usr/local/X11R4/lib \ ! \ ! /usr/local/lib/X11 \ ! /usr/local/lib/X11R6 \ ! /usr/local/lib/X11R5 \ ! /usr/local/lib/X11R4 \ ! \ ! /usr/X386/lib \ ! /usr/x386/lib \ ! /usr/XFree86/lib/X11 \ ! \ ! /usr/lib \ ! /usr/local/lib \ ! /usr/unsupported/lib \ ! /usr/athena/lib \ ! /usr/local/x11r5/lib \ ! /usr/lpp/Xamples/lib \ ! /lib/usr/lib/X11 \ ! \ ! /usr/openwin/lib \ ! /usr/openwin/share/lib \ ! ; \ ! do ! for ac_extension in a so sl; do ! if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then ! ac_x_libraries=$ac_dir ! break 2 ! fi ! done ! done ! fi ! rm -f conftest* ! fi # $ac_x_libraries = NO + if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" + else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi fi fi ! eval "$ac_cv_have_x" ! fi # $with_x != no ! ! if test "$have_x" != yes; then ! echo "$ac_t""$have_x" 1>&6 ! no_x=yes else ! # If each of the values was on the command line, it overrides each guess. ! test "x$x_includes" = xNONE && x_includes=$ac_x_includes ! test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries ! # Update the cache value to reflect the command line values. ! ac_cv_have_x="have_x=yes \ ! ac_x_includes=$x_includes ac_x_libraries=$x_libraries" ! echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 ! fi ! if test "$have_x" = "yes" ; then ! xincludedir=-I$x_includes ! ! xlibdir=-L$x_libraries ! ! DEFS="$DEFS $xincludedir $xlibdir" ! LIBS="$LIBS $xlibdir -lX11" ! cat >> confdefs.h <<\EOF ! #define HAVE_X11_X_H 1 EOF ! echo $ac_n "checking for _Xsetlocale in -lX11""... $ac_c" 1>&6 ! echo "configure:1470: checking for _Xsetlocale in -lX11" >&5 ! ac_lib_var=`echo X11'_'_Xsetlocale | sed 'y%./+-%__p_%'` ! if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 else ! ac_save_LIBS="$LIBS" ! LIBS="-lX11 $LIBS" ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=yes" ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* ! LIBS="$ac_save_LIBS" ! ! fi ! if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! cat >> confdefs.h <<\EOF ! #define X_LOCALE 1 ! EOF ! else ! echo "$ac_t""no" 1>&6 fi ! for ac_func in XSetWMProtocols ! do ! echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1515: checking for $ac_func" >&5 ! if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char $ac_func(); ! int main() { ! ! /* The GNU C library defines this for functions which it implements ! to always fail with ENOSYS. Some functions are actually named ! something starting with __ and the normal name is an alias. */ ! #if defined (__stub_$ac_func) || defined (__stub___$ac_func) ! choke me ! #else ! $ac_func(); ! #endif ! ! ; return 0; } EOF ! if { (eval echo configure:1543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ! eval "ac_cv_func_$ac_func=yes" else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_func_$ac_func=no" fi ! rm -f conftest* fi ! if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ! cat >> confdefs.h <&6 fi ! done + fi ! echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:1570: checking return type of signal handlers" >&5 ! if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < #include #ifdef signal #undef signal #endif ! #ifdef __cplusplus ! extern "C" void (*signal (int, void (*)(int)))(int); ! #else ! void (*signal ()) (); ! #endif ! ! int main() { ! int i; ! ; return 0; } EOF ! if { (eval echo configure:1592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ! ac_cv_type_signal=void else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ! ac_cv_type_signal=int fi rm -f conftest* + fi + + echo "$ac_t""$ac_cv_type_signal" 1>&6 + cat >> confdefs.h <&6 ! echo "configure:1613: checking for working alloca.h" >&5 ! if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < ! int main() { ! char *p = alloca(2 * sizeof(int)); ! ; return 0; } EOF ! if { (eval echo configure:1625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ! ac_cv_header_alloca_h=yes ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! ac_cv_header_alloca_h=no ! fi ! rm -f conftest* ! fi + echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 + if test $ac_cv_header_alloca_h = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_ALLOCA_H 1 + EOF fi ! echo $ac_n "checking for alloca""... $ac_c" 1>&6 ! echo "configure:1646: checking for alloca" >&5 ! if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < ! # else ! # ifdef _AIX #pragma alloca ! # else ! # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); + # endif + # endif + # endif #endif ! ! int main() { ! char *p = (char *) alloca(1); ! ; return 0; } EOF ! if { (eval echo configure:1674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ! rm -rf conftest* ! ac_cv_func_alloca_works=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ! ac_cv_func_alloca_works=no ! fi ! rm -f conftest* ! fi + echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 + if test $ac_cv_func_alloca_works = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_ALLOCA 1 EOF ! ! fi ! ! if test $ac_cv_func_alloca_works = no; then ! # The SVR3 libPW and SVR4 libucb both contain incompatible functions ! # that cause trouble. Some versions do not even contain alloca or ! # contain a buggy version. If you still want to use their alloca, ! # use ar to extract alloca.o from them instead of compiling alloca.c. ! ALLOCA=alloca.o ! cat >> confdefs.h <<\EOF ! #define C_ALLOCA 1 EOF + echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 + echo "configure:1706: checking whether alloca needs Cray hooks" >&5 + if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else ! cat > conftest.$ac_ext <&5 | ! egrep "webecray" >/dev/null 2>&1; then rm -rf conftest* ! ac_cv_os_cray=yes ! else ! rm -rf conftest* ! ac_cv_os_cray=no ! fi ! rm -f conftest* + fi + echo "$ac_t""$ac_cv_os_cray" 1>&6 + if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 + echo "configure:1736: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else ! cat > conftest.$ac_ext < ! /* Override any gcc2 internal prototype to avoid an error. */ ! /* We use char because int might match the return type of a gcc2 ! builtin and then its argument prototype would still apply. */ ! char $ac_func(); ! ! int main() { ! /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ ! #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else ! $ac_func(); #endif ! ! ; return 0; } EOF ! if { (eval echo configure:1764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ! eval "ac_cv_func_$ac_func=yes" ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <&6 fi + done fi ! echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:1791: checking stack direction for C alloca" >&5 ! if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 else ! if test "$cross_compiling" = yes; then ! ac_cv_c_stack_direction=0 else ! cat > conftest.$ac_ext </dev/null; then ! rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining" STACK_DIRECTION to be 1 ! echo "#define" STACK_DIRECTION 1 >> confdefs.h ! DEFS="$DEFS -DSTACK_DIRECTION=1" ! } ! ! else ! rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining" STACK_DIRECTION to be -1 ! echo "#define" STACK_DIRECTION -1 >> confdefs.h ! DEFS="$DEFS -DSTACK_DIRECTION=-1" ! } ! fi fi ! rm -f conftest* fi ! for func in random strftime mktime xmalloc do ! echo checking for ${func} ! cat > conftest.c < ! int main() { exit(0); } ! int t() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ ! #if defined (__stub_${func}) || defined (__stub___${func}) choke me #else ! /* Override any gcc2 internal prototype to avoid an error. */ ! extern char ${func}(); ${func}(); #endif ! } EOF ! if eval $compile; then ! : else rm -rf conftest* ! LIBOBJS="$LIBOBJS ${func}.o" ! test -n "$verbose" && echo " using ${func}.o instead" fi rm -f conftest* done ! prog='/* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ --- 1814,1917 ---- exit (find_stack_direction() < 0); } EOF ! if { (eval echo configure:1818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null ! then ! ac_cv_c_stack_direction=1 else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -fr conftest* ! ac_cv_c_stack_direction=-1 fi + rm -fr conftest* fi ! fi ! echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 ! cat >> confdefs.h <&6 ! echo "configure:1842: checking for $ac_func" >&5 ! if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < ! /* Override any gcc2 internal prototype to avoid an error. */ ! /* We use char because int might match the return type of a gcc2 ! builtin and then its argument prototype would still apply. */ ! char $ac_func(); ! ! int main() { ! /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ ! #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else ! $ac_func(); #endif ! ! ; return 0; } EOF ! if { (eval echo configure:1870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ! rm -rf conftest* ! eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ! eval "ac_cv_func_$ac_func=no" fi rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 + LIBOBJS="$LIBOBJS ${ac_func}.o" + fi done ! ! echo $ac_n "checking for working const""... $ac_c" 1>&6 ! echo "configure:1898: checking for working const" >&5 ! if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext <j = 5; ! }' ! echo checking for lack of working const ! cat > conftest.c <> confdefs.h ! DEFS="$DEFS -Dconst=" ! } fi rm -f conftest* need_doprnt= ! echo checking for vfprintf ! cat > conftest.c < conftest.c < conftest.c < ! int main() { exit(0); } ! int t() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ ! #if defined (__stub_${func}) || defined (__stub___${func}) choke me #else ! /* Override any gcc2 internal prototype to avoid an error. */ ! extern char ${func}(); ${func}(); #endif ! } EOF ! if eval $compile; then ! : else rm -rf conftest* ! LIBOBJS="$LIBOBJS ${func}.o" ! test -n "$verbose" && echo " using ${func}.o instead" fi rm -f conftest* done fi ! LIBS_save="${LIBS}" ! LIBS="${LIBS} -ltermcap" ! have_lib="" ! echo checking for -ltermcap ! cat > conftest.c < conftest.c < conftest.c < conftest.c < #include ! int main() { exit(0); } ! int t() { struct tm *tp; tp->tm_sec; } EOF ! if eval $compile; then ! : else rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining TM_IN_SYS_TIME" ! echo "#define" TM_IN_SYS_TIME 1 >> confdefs.h ! DEFS="$DEFS -DTM_IN_SYS_TIME=1" ! } ! fi rm -f conftest* ! decl='#include ! ' ! case "$DEFS" in ! *TM_IN_SYS_TIME*) decl="$decl ! #include ! " ;; ! *) decl="$decl ! #include ! " ;; ! esac ! echo checking for tm_zone in struct tm ! cat > conftest.c <> confdefs.h - DEFS="$DEFS -DHAVE_TM_ZONE=1" - } else rm -rf conftest* ! no_tm_zone=1 fi rm -f conftest* ! if test -n "$no_tm_zone"; then ! echo checking for tzname ! cat > conftest.c < #ifndef tzname /* For SGI. */ ! extern char *tzname[]; /* RS6000 and others want it this way. */ #endif ! int main() { exit(0); } ! int t() { atoi(*tzname); } EOF ! if eval $compile; then rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining HAVE_TZNAME" ! echo "#define" HAVE_TZNAME 1 >> confdefs.h ! DEFS="$DEFS -DHAVE_TZNAME=1" ! } ! ! fi rm -f conftest* fi ! for func in rint rename sysinfo \ getcap stricmp strincmp \ ! strdup strstr strftime mktime ftime XSetWMProtocols do ! trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'` ! echo checking for ${func} ! cat > conftest.c < ! int main() { exit(0); } ! int t() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ ! #if defined (__stub_${func}) || defined (__stub___${func}) choke me #else ! /* Override any gcc2 internal prototype to avoid an error. */ ! extern char ${func}(); ${func}(); #endif ! } EOF ! if eval $compile; then rm -rf conftest* ! { ! test -n "$verbose" && \ ! echo " defining ${trfunc}" ! echo "#define" ${trfunc} 1 >> confdefs.h ! DEFS="$DEFS -D${trfunc}=1" ! } ! ! fi rm -f conftest* done ! echo checking for cbreak ! cat > conftest.c < ! int main() { exit(0); } ! int t() { cbreak(); } EOF ! if eval $compile; then rm -rf conftest* ! ! { ! test -n "$verbose" && \ ! echo " defining HAVE_CBREAK" ! echo "#define" HAVE_CBREAK 1 >> confdefs.h ! DEFS="$DEFS -DHAVE_CBREAK=1" ! } fi - rm -f conftest* - LIBS="$LIBS -lm" - echo checking for hypot - cat > conftest.c <> confdefs.h ! DEFS="$DEFS -DHAVE_HYPOT=1" ! } ! fi rm -f conftest* - LIBS="$LIBS_save" ! echo checking for bogus definition of __GNUC__ ! cat > conftest.c <= 2 exit (__extension__ x); #endif ! } EOF ! if eval $compile; then rm -rf conftest* echo looks ok - else rm -rf conftest* DEFS="$DEFS -D__extension__=" fi rm -f conftest* ! # Set default prefixes. ! if test -n "$prefix"; then ! test -z "$exec_prefix" && exec_prefix='${prefix}' ! prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%" fi ! if test -n "$exec_prefix"; then ! prsub="$prsub ! s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%" fi ! # Quote sed substitution magic chars in DEFS. ! cat >conftest.def < config.status </dev/null | sed 1q`: # ! # $0 $configure_args ! for arg do ! case "\$arg" in ! -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ! echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args ! exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;; ! *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;; esac done ! trap 'rm -f Makefile; exit 1' 1 3 15 ! LIBS='$LIBS' ! CC='$CC' ! CPP='$CPP' ! YACC='$YACC' ! INSTALL='$INSTALL' ! INSTALL_PROGRAM='$INSTALL_PROGRAM' ! INSTALL_DATA='$INSTALL_DATA' ! xincludedir='$xincludedir' ! xlibdir='$xlibdir' ! wlibs='$wlibs' ! ALLOCA='$ALLOCA' ! LIBOBJS='$LIBOBJS' ! srcdir='$srcdir' ! DEFS='$DEFS' ! prefix='$prefix' ! exec_prefix='$exec_prefix' ! prsub='$prsub' ! extrasub='$extrasub' ! EOF ! cat >> config.status <<\EOF ! top_srcdir=$srcdir ! CONFIG_FILES=${CONFIG_FILES-"Makefile"} ! for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then ! srcdir=$top_srcdir ! # Remove last slash and all that follows it. Not all systems have dirname. ! dir=`echo $file|sed 's%/[^/][^/]*$%%'` ! if test "$dir" != "$file"; then ! test "$top_srcdir" != . && srcdir=$top_srcdir/$dir ! test ! -d $dir && mkdir $dir ! fi ! echo creating $file ! rm -f $file ! echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file ! sed -e " ! $prsub $extrasub s%@LIBS@%$LIBS%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@YACC@%$YACC%g - s%@INSTALL@%$INSTALL%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@xincludedir@%$xincludedir%g s%@xlibdir@%$xlibdir%g - s%@wlibs@%$wlibs%g s%@ALLOCA@%$ALLOCA%g s%@LIBOBJS@%$LIBOBJS%g s%@srcdir@%$srcdir%g ! s%@DEFS@%$DEFS% ! " $top_srcdir/${file}.in >> $file fi; done exit 0 EOF ! chmod +x config.status ! ${CONFIG_SHELL-/bin/sh} config.status --- 1941,2892 ---- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; ! } ! { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ ! const int foo = 10; ! } ! ! ; return 0; } ! EOF ! if { (eval echo configure:1952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! rm -rf conftest* ! ac_cv_c_const=yes ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! ac_cv_c_const=no ! fi ! rm -f conftest* ! fi ! ! echo "$ac_t""$ac_cv_c_const" 1>&6 ! if test $ac_cv_c_const = no; then ! cat >> confdefs.h <<\EOF ! #define const ! EOF ! ! fi ! ! ! echo $ac_n "checking for vprintf""... $ac_c" 1>&6 ! echo "configure:1974: checking for vprintf" >&5 ! if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char vprintf(); ! int main() { ! ! /* The GNU C library defines this for functions which it implements ! to always fail with ENOSYS. Some functions are actually named ! something starting with __ and the normal name is an alias. */ ! #if defined (__stub_vprintf) || defined (__stub___vprintf) ! choke me ! #else ! vprintf(); ! #endif ! ! ; return 0; } EOF ! if { (eval echo configure:2002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ! rm -rf conftest* ! eval "ac_cv_func_vprintf=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ! eval "ac_cv_func_vprintf=no" ! fi ! rm -f conftest* ! fi ! ! if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! cat >> confdefs.h <<\EOF ! #define HAVE_VPRINTF 1 ! EOF + else + echo "$ac_t""no" 1>&6 + fi + + if test "$ac_cv_func_vprintf" != yes; then + echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 + echo "configure:2026: checking for _doprnt" >&5 + if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char _doprnt(); + + int main() { + + /* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ + #if defined (__stub__doprnt) || defined (__stub____doprnt) + choke me + #else + _doprnt(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:2054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func__doprnt=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func__doprnt=no" fi rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF + #define HAVE_DOPRNT 1 + EOF + + else + echo "$ac_t""no" 1>&6 + fi + fi need_doprnt= ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* LIBOBJS="$LIBOBJS vfprintf.o"; need_doprnt=1 fi rm -f conftest* ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* LIBOBJS="$LIBOBJS vsprintf.o"; need_doprnt=1 fi rm -f conftest* if test $need_doprnt; then ! for ac_func in _doprnt do ! echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2117: checking for $ac_func" >&5 ! if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < ! /* Override any gcc2 internal prototype to avoid an error. */ ! /* We use char because int might match the return type of a gcc2 ! builtin and then its argument prototype would still apply. */ ! char $ac_func(); ! ! int main() { ! /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ ! #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else ! $ac_func(); #endif ! ! ; return 0; } EOF ! if { (eval echo configure:2145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ! rm -rf conftest* ! eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ! eval "ac_cv_func_$ac_func=no" fi rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 + LIBOBJS="$LIBOBJS ${ac_func}.o" + fi done + fi ! echo $ac_n "checking for tgoto in -lcurses""... $ac_c" 1>&6 ! echo "configure:2174: checking for tgoto in -lcurses" >&5 ! ac_lib_var=`echo curses'_'tgoto | sed 'y%./+-%__p_%'` ! if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! ac_save_LIBS="$LIBS" ! LIBS="-lcurses $LIBS" ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=yes" ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=no" ! fi ! rm -f conftest* ! LIBS="$ac_save_LIBS" ! ! fi ! if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! \ ! LIBS="$LIBS -lcurses" ! else ! echo "$ac_t""no" 1>&6 ! \ ! echo $ac_n "checking for main in -ltermcap""... $ac_c" 1>&6 ! echo "configure:2214: checking for main in -ltermcap" >&5 ! ac_lib_var=`echo termcap'_'main | sed 'y%./+-%__p_%'` ! if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! ac_save_LIBS="$LIBS" ! LIBS="-ltermcap $LIBS" ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* ! LIBS="$ac_save_LIBS" ! ! fi ! if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! \ LIBS="$LIBS -lcurses -ltermcap" else ! echo "$ac_t""no" 1>&6 ! \ ! echo $ac_n "checking for main in -ltermlib""... $ac_c" 1>&6 ! echo "configure:2250: checking for main in -ltermlib" >&5 ! ac_lib_var=`echo termlib'_'main | sed 'y%./+-%__p_%'` ! if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! ac_save_LIBS="$LIBS" ! LIBS="-ltermlib $LIBS" ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=yes" ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* ! LIBS="$ac_save_LIBS" ! ! fi ! if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! \ LIBS="$LIBS -lcurses -ltermlib" else ! echo "$ac_t""no" 1>&6 ! \ LIBS="$LIBS -lcurses" fi fi + fi ! ! echo $ac_n "checking for main in -lmisc""... $ac_c" 1>&6 ! echo "configure:2294: checking for main in -lmisc" >&5 ! ac_lib_var=`echo misc'_'main | sed 'y%./+-%__p_%'` ! if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! ac_save_LIBS="$LIBS" ! LIBS="-lmisc $LIBS" ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=yes" ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* ! LIBS="$ac_save_LIBS" ! ! fi ! if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! \ LIBS="$LIBS -lmisc" else ! echo "$ac_t""no" 1>&6 fi LIBS_save="$LIBS" LIBS="$LIBS -lm" compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1' ! echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 ! echo "configure:2334: checking whether struct tm is in sys/time.h or time.h" >&5 ! if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < #include ! int main() { ! struct tm *tp; tp->tm_sec; ! ; return 0; } EOF ! if { (eval echo configure:2347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! rm -rf conftest* ! ac_cv_struct_tm=time.h else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ! ac_cv_struct_tm=sys/time.h fi rm -f conftest* + fi ! echo "$ac_t""$ac_cv_struct_tm" 1>&6 ! if test $ac_cv_struct_tm = sys/time.h; then ! cat >> confdefs.h <<\EOF ! #define TM_IN_SYS_TIME 1 EOF + fi + echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 + echo "configure:2368: checking for tm_zone in struct tm" >&5 + if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else + cat > conftest.$ac_ext < + #include <$ac_cv_struct_tm> + int main() { + struct tm tm; tm.tm_zone; + ; return 0; } + EOF + if { (eval echo configure:2381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ! ac_cv_struct_tm_zone=yes ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! ac_cv_struct_tm_zone=no fi rm -f conftest* + fi ! echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6 ! if test "$ac_cv_struct_tm_zone" = yes; then ! cat >> confdefs.h <<\EOF ! #define HAVE_TM_ZONE 1 ! EOF ! ! else ! echo $ac_n "checking for tzname""... $ac_c" 1>&6 ! echo "configure:2401: checking for tzname" >&5 ! if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ ! extern char *tzname[]; /* RS6000 and others reject char **tzname. */ #endif ! int main() { ! atoi(*tzname); ! ; return 0; } EOF ! if { (eval echo configure:2416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ! ac_cv_var_tzname=yes ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! ac_cv_var_tzname=no fi rm -f conftest* + fi + + echo "$ac_t""$ac_cv_var_tzname" 1>&6 + if test $ac_cv_var_tzname = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_TZNAME 1 + EOF + fi fi ! for ac_func in rint rename sysinfo \ getcap stricmp strincmp \ ! strdup strstr strftime mktime ftime \ ! cbreak beep flash hypot do ! echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2443: checking for $ac_func" >&5 ! if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! cat > conftest.$ac_ext < ! /* Override any gcc2 internal prototype to avoid an error. */ ! /* We use char because int might match the return type of a gcc2 ! builtin and then its argument prototype would still apply. */ ! char $ac_func(); ! ! int main() { ! /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ ! #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else ! $ac_func(); #endif ! ! ; return 0; } EOF ! if { (eval echo configure:2471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ! eval "ac_cv_func_$ac_func=yes" ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_func_$ac_func=no" fi rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 + fi done ! need_alecompat= ! echo $ac_n "checking for wadjcurspos in -lcurses""... $ac_c" 1>&6 ! echo "configure:2497: checking for wadjcurspos in -lcurses" >&5 ! ac_lib_var=`echo curses'_'wadjcurspos | sed 'y%./+-%__p_%'` ! if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! ac_save_LIBS="$LIBS" ! LIBS="-lcurses $LIBS" ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=yes" ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=no" ! fi ! rm -f conftest* ! LIBS="$ac_save_LIBS" + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF + #define HAVE_ALECOMPAT 1 + EOF + else + echo "$ac_t""no" 1>&6 + LIBOBJS="$LIBOBJS alecompat.o" fi ! cat > conftest.$ac_ext < ! int main() { ! extern int printw(const char*,...);printw(""); ! ; return 0; } EOF ! if { (eval echo configure:2549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ! cat >> confdefs.h <<\EOF ! #define PRINTW_CONST 1 ! EOF + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 fi rm -f conftest* LIBS="$LIBS_save" ! cat > conftest.$ac_ext <= 2 exit (__extension__ x); #endif ! ! ; return 0; } EOF ! if { (eval echo configure:2573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo looks ok else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* DEFS="$DEFS -D__extension__=" fi rm -f conftest* + echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6 + echo "configure:2584: checking for setlocale in -lxpg4" >&5 + ac_lib_var=`echo xpg4'_'setlocale | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-lxpg4 $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ! rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=yes" ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! eval "ac_cv_lib_$ac_lib_var=no" fi ! rm -f conftest* ! LIBS="$ac_save_LIBS" ! fi ! if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ! echo "$ac_t""yes" 1>&6 ! ac_tr_lib=HAVE_LIB`echo xpg4 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ ! -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` ! cat >> confdefs.h <&6 ! fi ! ! trap '' 1 2 15 ! cat > confcache <<\EOF ! # This file is a shell script that caches the results of configure ! # tests run on this system so they can be shared between configure ! # scripts and configure runs. It is not useful on other systems. ! # If it contains results you don't want to keep, you may remove or edit it. ! # ! # By default, configure uses ./config.cache as the cache file, ! # creating it if it does not exist already. You can give configure ! # the --cache-file=FILE option to use a different cache file; that is ! # what configure does when it calls configure scripts in ! # subdirectories, so they share the cache. ! # Giving --cache-file=/dev/null disables caching, for debugging configure. ! # config.status only pays attention to the cache file if you give it the ! # --recheck option to rerun configure. ! # ! EOF ! # The following way of writing the cache mishandles newlines in values, ! # but we know of no workaround that is simple, portable, and efficient. ! # So, don't put newlines in cache variables' values. ! # Ultrix sh set writes to stderr and can't be redirected directly, ! # and sets the high bit in the cache file unless we assign to the vars. ! (set) 2>&1 | ! case `(ac_space=' '; set) 2>&1` in ! *ac_space=\ *) ! # `set' does not quote correctly, so add quotes (double-quote substitution ! # turns \\\\ into \\, and sed turns \\ into \). ! sed -n \ ! -e "s/'/'\\\\''/g" \ ! -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ! ;; ! *) ! # `set' quotes correctly as required by POSIX, so do not add quotes. ! sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ! ;; ! esac >> confcache ! if cmp -s $cache_file confcache; then ! : ! else ! if test -w $cache_file; then ! echo "updating cache $cache_file" ! cat confcache > $cache_file ! else ! echo "not updating unwritable cache $cache_file" ! fi ! fi ! rm -f confcache ! ! trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 ! ! test "x$prefix" = xNONE && prefix=$ac_default_prefix ! # Let make expand exec_prefix. ! test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' ! ! # Any assignment to VPATH causes Sun make to only execute ! # the first set of double-colon rules, so remove it if not needed. ! # If there is a colon in the path, we need to keep it. ! if test "x$srcdir" = x.; then ! ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' ! fi ! ! trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 ! ! # Transform confdefs.h into DEFS. ! # Protect against shell expansion while executing Makefile rules. ! # Protect against Makefile macro expansion. ! cat > conftest.defs <<\EOF ! s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g ! s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g ! s%\[%\\&%g ! s%\]%\\&%g ! s%\$%$$%g ! EOF ! DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` ! rm -f conftest.defs ! ! ! # Without the "./", some shells look in PATH for config.status. ! : ${CONFIG_STATUS=./config.status} ! ! echo creating $CONFIG_STATUS ! rm -f $CONFIG_STATUS ! cat > $CONFIG_STATUS </dev/null | sed 1q`: # ! # $0 $ac_configure_args ! # ! # Compiler output produced by configure, useful for debugging ! # configure, is in ./config.log if it exists. ! ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" ! for ac_option do ! case "\$ac_option" in ! -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ! echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" ! exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; ! -version | --version | --versio | --versi | --vers | --ver | --ve | --v) ! echo "$CONFIG_STATUS generated by autoconf version 2.12" ! exit 0 ;; ! -help | --help | --hel | --he | --h) ! echo "\$ac_cs_usage"; exit 0 ;; ! *) echo "\$ac_cs_usage"; exit 1 ;; esac done ! ac_given_srcdir=$srcdir ! ac_given_INSTALL="$INSTALL" ! trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 ! EOF ! cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF ! $ac_vpsub $extrasub + s%@CFLAGS@%$CFLAGS%g + s%@CPPFLAGS@%$CPPFLAGS%g + s%@CXXFLAGS@%$CXXFLAGS%g + s%@DEFS@%$DEFS%g + s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g + s%@exec_prefix@%$exec_prefix%g + s%@prefix@%$prefix%g + s%@program_transform_name@%$program_transform_name%g + s%@bindir@%$bindir%g + s%@sbindir@%$sbindir%g + s%@libexecdir@%$libexecdir%g + s%@datadir@%$datadir%g + s%@sysconfdir@%$sysconfdir%g + s%@sharedstatedir@%$sharedstatedir%g + s%@localstatedir@%$localstatedir%g + s%@libdir@%$libdir%g + s%@includedir@%$includedir%g + s%@oldincludedir@%$oldincludedir%g + s%@infodir@%$infodir%g + s%@mandir@%$mandir%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@YACC@%$YACC%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@xincludedir@%$xincludedir%g s%@xlibdir@%$xlibdir%g s%@ALLOCA@%$ALLOCA%g s%@LIBOBJS@%$LIBOBJS%g + + CEOF + EOF + + cat >> $CONFIG_STATUS <<\EOF + + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. + ac_file=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_cmds # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds="" + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi + EOF + + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ + # $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub + s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g ! s%@top_srcdir@%$top_srcdir%g ! s%@INSTALL@%$INSTALL%g ! " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done + rm -f conftest.s* + EOF + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF ! chmod +x $CONFIG_STATUS ! rm -fr confdefs* $ac_clean_files ! test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 diff --recursive --context --minimal --new-file oleo-1.6/configure.in oleo-1.6jb2/configure.in *** oleo-1.6/configure.in Sat Jun 4 09:03:59 1994 --- oleo-1.6jb2/configure.in Wed Mar 26 00:37:27 1997 *************** *** 5,130 **** dnl Look for the X11 include files in various places, if they're dnl not in the compiler's path. Substitute for `xincludedir' and dnl `xlibdir'. Perhaps we need different checks for Xt and Xaw? - define(AC_X11_LOCATION, - [echo checking for X11 headers and libraries - dir="" - AC_TEST_CPP([#include ], :, - if test -r /usr/local/[[include]]/X11/Intrinsic.h; then - dir=/usr/local/[[include]] - - elif test -r /usr/[[include]]/X11R4/X11/Intrinsic.h; then - dir=/usr/[[include]]/X11R4 - elif test -r /usr/[[include]]/X11R5/X11/Intrinsic.h; then - dir=/usr/[[include]]/X11R5 - - elif test -r /usr/lpp/X11/Xamples/[[include]]/X11/Intrinsic.h; then - dir=/usr/lpp/X11/Xamples/[[include]] - - elif test -r /usr/X11/[[include]]/X11/Intrinsic.h; then - dir=/usr/X11/[[include]] - elif test -r /usr/X11R5/[[include]]/X11/Intrinsic.h; then - dir=/usr/X11R5/[[include]] - - elif test -r /usr/openwin/[[include]]/X11/Intrinsic.h; then - dir=/usr/openwin/[[include]] - elif test -r /usr/openwin/share/[[include]]/X11/Intrinsic.h; then - dir=/usr/openwin/share/[[include]] - - elif test -r /usr/[[include]]/X11/Intrinsic.h; then - dir= # everyone's cc searches /usr/include, right? - else - no_x=t - fi - ) - dnl Can't use AC_SUBST inside AC_TEST_CPP. - if test -n "$dir"; then - xincludedir=-I$dir - DEFS="$DEFS -I$dir" - echo "(using $xincludedir)" - elif test -n "$no_x"; then - # Not all programs may use this symbol, but it won't hurt to define it. - xincludedir=-DX_DISPLAY_MISSING - fi - AC_SUBST(xincludedir) - # - # Now check for the libraries. Amazing how every single X vendor puts - # these in a different place, and all because MIT thought they should go - # in /usr/lib. - dir1="" - if test -r /usr/local/lib/libXt.a; then - dir1=/usr/local/lib - - elif test -r /usr/lib/X11R4/libXt.sl; then - dir1=/usr/lib/X11R4 - elif test -r /usr/lib/X11R4/libXt.a; then - dir1=/usr/lib/X11R4 - elif test -r /usr/lib/X11R5/libXt.a; then - dir1=/usr/lib/X11R5 - - elif test -r /usr/lpp/X11/Xamples/lib/Xt/libXt.a; then - dir1=/usr/lpp/X11/Xamples/lib/Xt - - elif test -r /usr/X11/lib/libXt.a; then - dir1=/usr/X11/lib - elif test -r /usr/X11R5/lib/libXt.a; then - dir1=/usr/X11R5/lib - - elif test -r /usr/openwin/lib/libXt.a; then - dir1=/usr/openwin/lib - elif test -r /usr/openwin/lib/libXt.so; then - dir1=/usr/openwin/lib - - fi - dir2="" - if test -r /usr/lpp/X11/Xamples/lib/Xmu/libXmu.a; then - dir2=/usr/lpp/X11/Xamples/lib/Xmu - fi - # - # It would be nice to have a more robust check for the -R ld option then - # just checking for Solaris. The parentheses elide `uname: not found'. - # - # It would also be nice to do this for all -L options, not just this one. - if test -n "$dir1"; then - xlibdir=-L$dir1 - DEFS="$DEFS -L$dir1" - if test "`(uname) 2>/dev/null`" = SunOS && uname -r | grep '^5'; then - xlibdir="$xlibdir -R$dir1" - fi - # - # Don't need all that stuff for dir2, since it only gets used on AIX. - test -n "$dir2" && xlibdir="$xlibdir -L$dir2" - fi - # - # Check for additional X libraries. - # - # Since we already have an explicit check for POSIXified ISC, use it. - if test -n "$ISC"; then - wlibs="$wlibs -lnsl_s -linet" - echo "(adding -lnsl_s -linet to wlibs)" - else - # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And karl@cs.umb.edu's Alpha - # needs dnet_stubs. - AC_HAVE_LIBRARY(dnet, - [wlibs="$wlibs -ldnet" - have_dnet=t - echo "(adding -ldnet to wlibs)"]) - if test -z "$have_dnet"; then - AC_HAVE_LIBRARY(dnet_stub, - [wlibs="$wlibs -ldnet_stub" - echo "(adding -ldnet_stub to wlibs)"]) - fi - # lieder@skyler.mavd.honeywell.com says without -lsocket, - # socket/setsockopt and other routines are undefined under SCO ODT 2.0. - AC_HAVE_LIBRARY(socket, - [wlibs="$wlibs -lsocket" - echo "(adding -lsocket to wlibs)"]) - fi - test -n "$xlibdir" && echo "(using $xlibdir)" - LIBS="$LIBS $xlibdir $wlibs" - AC_SUBST(xlibdir)dnl - AC_SUBST(wlibs)dnl - ])dnl AC_INIT(io-term.c) AC_SUBST(LIBS)dnl dnl Checks for programs: --- 5,10 ---- *************** *** 139,149 **** dnl Checks for header files: AC_STDC_HEADERS ! AC_UNISTD_H ! AC_DIR_HEADER AC_HAVE_HEADERS(sys/time.h string.h memory.h sys/select.h limits.h) ! AC_X11_LOCATION ! AC_HEADER_CHECK(X11/X.h, AC_DEFINE(HAVE_X11_X_H) LIBS="$LIBS -lX11") dnl checks for functions AC_RETSIGTYPE --- 19,40 ---- dnl Checks for header files: AC_STDC_HEADERS ! AC_CHECK_HEADERS(unistd.h) ! AC_HEADER_DIRENT AC_HAVE_HEADERS(sys/time.h string.h memory.h sys/select.h limits.h) ! AC_PATH_X ! if test "$have_x" = "yes" ; then ! xincludedir=-I$x_includes ! AC_SUBST(xincludedir) ! xlibdir=-L$x_libraries ! AC_SUBST(xlibdir) ! DEFS="$DEFS $xincludedir $xlibdir" ! LIBS="$LIBS $xlibdir -lX11" ! dnl Oleo が X11/X.h の有無で X が使えるか判定しているのでセットする。 ! AC_DEFINE(HAVE_X11_X_H) ! AC_CHECK_LIB(X11,_Xsetlocale, AC_DEFINE(X_LOCALE)) ! AC_HAVE_FUNCS(XSetWMProtocols) ! fi dnl checks for functions AC_RETSIGTYPE *************** *** 154,175 **** dnl Replace vfprintf and vsprintf. dnl If either needs to be replaced, replace _doprnt. need_doprnt= ! AC_COMPILE_CHECK([vfprintf], , [vfprintf();], , ! [LIBOBJS="$LIBOBJS vfprintf.o"; need_doprnt=1]) ! AC_COMPILE_CHECK([vsprintf], , [vsprintf();], , ! [LIBOBJS="$LIBOBJS vsprintf.o"; need_doprnt=1]) if test $need_doprnt; then AC_REPLACE_FUNCS(_doprnt) fi ! AC_HAVE_LIBRARY(termcap, \ LIBS="$LIBS -lcurses -ltermcap", \ ! AC_HAVE_LIBRARY(termlib, \ LIBS="$LIBS -lcurses -ltermlib", \ ! LIBS="$LIBS -lcurses")) ! AC_HAVE_LIBRARY(misc, \ LIBS="$LIBS -lmisc") LIBS_save="$LIBS" LIBS="$LIBS -lm" --- 45,67 ---- dnl Replace vfprintf and vsprintf. dnl If either needs to be replaced, replace _doprnt. + AC_FUNC_VPRINTF need_doprnt= ! AC_TRY_LINK(,[vfprintf();], , [LIBOBJS="$LIBOBJS vfprintf.o"; need_doprnt=1]) ! AC_TRY_LINK(,[vsprintf();], , [LIBOBJS="$LIBOBJS vsprintf.o"; need_doprnt=1]) if test $need_doprnt; then AC_REPLACE_FUNCS(_doprnt) fi ! AC_CHECK_LIB(curses,tgoto,\ ! LIBS="$LIBS -lcurses", \ ! AC_CHECK_LIB(termcap, main, \ LIBS="$LIBS -lcurses -ltermcap", \ ! AC_CHECK_LIB(termlib, main, \ LIBS="$LIBS -lcurses -ltermlib", \ ! LIBS="$LIBS -lcurses"))) ! AC_CHECK_LIB(misc, main, \ LIBS="$LIBS -lmisc") LIBS_save="$LIBS" LIBS="$LIBS -lm" *************** *** 177,194 **** AC_TIMEZONE AC_HAVE_FUNCS(rint rename sysinfo \ getcap stricmp strincmp \ ! strdup strstr strftime mktime ftime XSetWMProtocols) ! AC_COMPILE_CHECK([cbreak], [#include ], [cbreak();], ! AC_DEFINE(HAVE_CBREAK)) ! LIBS="$LIBS -lm" ! AC_COMPILE_CHECK([hypot], [], [hypot();], ! AC_DEFINE(HAVE_HYPOT)) LIBS="$LIBS_save" ! AC_COMPILE_CHECK([bogus definition of __GNUC__], [static int x = 54;], [ #if defined (__GNUC__) && __GNUC__ >= 2 exit (__extension__ x); #endif ], [echo looks ok], [DEFS="$DEFS -D__extension__="]) AC_OUTPUT(Makefile) --- 69,88 ---- AC_TIMEZONE AC_HAVE_FUNCS(rint rename sysinfo \ getcap stricmp strincmp \ ! strdup strstr strftime mktime ftime \ ! cbreak beep flash hypot) ! need_alecompat= ! AC_CHECK_LIB(curses,wadjcurspos, AC_DEFINE(HAVE_ALECOMPAT), ! [LIBOBJS="$LIBOBJS alecompat.o"]) ! ! AC_TRY_COMPILE([#include ],[extern int printw(const char*,...);printw("");],AC_DEFINE(PRINTW_CONST)) LIBS="$LIBS_save" ! AC_TRY_LINK([static int x = 54;], [ #if defined (__GNUC__) && __GNUC__ >= 2 exit (__extension__ x); #endif ], [echo looks ok], [DEFS="$DEFS -D__extension__="]) + AC_CHECK_LIB(xpg4, setlocale) AC_OUTPUT(Makefile) diff --recursive --context --minimal --new-file oleo-1.6/decompile.c oleo-1.6jb2/decompile.c *** oleo-1.6/decompile.c Sat Jun 4 14:09:08 1994 --- oleo-1.6jb2/decompile.c Sun Mar 23 00:29:17 1997 *************** *** 206,214 **** --- 206,221 ---- case C_STR: tmp_str = backslash_a_string ((char *) expr + jumpto, 1); + #if 0 new = n_alloc (strlen (tmp_str) + 1, 1000, tmp_str); + #else + /* 1997.03.24 By K.Hayashida n_alloc use vsprintf and %[sdf].. expanded */ + new = n_alloc (strlen (tmp_str) + 1, + 1000, + "%s",tmp_str); + #endif break; case C_CELL: *************** *** 508,514 **** --- 515,526 ---- case C_ERR: tmp_str = (char *) expr + jumpto; expr++; + #if 0 new = n_alloc (strlen (tmp_str) + 1, 1000, tmp_str); + #else + /* By K.Hayashida 1997-03-24 stop %[fd..] expand */ + new = n_alloc (strlen (tmp_str) + 1, 1000, "%s",tmp_str); + #endif /* bcopy((VOIDSTAR)expr,(VOIDSTAR)&tmp_str,sizeof(char *)); expr+=sizeof(char *); new=n_alloc(strlen(tmp_str)+1,1000,f->fn_str,tmp_str); */ *************** *** 689,696 **** --- 701,713 ---- } for (; *pf; pf++) { + #if defined(EUC_JP) + ch = (unsigned char)*pf; + if (((ch >= ' ' && ch <= '~')||(ch >= 0xa0 && ch <= 0xfe)) && ch != '\\' && (ch != '"' || !add_quote)) + #else ch = *pf; if (ch >= ' ' && ch <= '~' && ch != '\\' && (ch != '"' || !add_quote)) + #endif /* EUC_JP */ { if (pt) *pt++ = ch; diff --recursive --context --minimal --new-file oleo-1.6/defun.h oleo-1.6jb2/defun.h *** oleo-1.6/defun.h Sat Jun 4 14:13:39 1994 --- oleo-1.6jb2/defun.h Tue Nov 5 23:34:30 1996 *************** *** 1116,1121 **** --- 1116,1124 ---- FDset_ps_font_cmd, FAset_ps_font_cmd, set_ps_font_cmd) #ifdef FUNC_ARG_STRINGS "sSet default postscript font? ", + #if defined(EUC_JP) + "sSet default postscript font2? ", + #endif /* EUC_JP */ #endif #ifdef DOC_STRINGS "Make FONT the default postscript font.", *************** *** 1129,1134 **** --- 1132,1140 ---- FDset_default__x_font, FAset_default_x_font, set_x_default_font) #ifdef FUNC_ARG_STRINGS "sSet default X11 font? ", + #if defined(EUC_JP) + "sSet default X11 font2? ", + #endif /* EUC_JP */ #endif #ifdef DOC_STRINGS "Make FONT the default X11 font.", *************** *** 1158,1163 **** --- 1164,1173 ---- "wDefine font name? ", "wX11 name for %0? ", "wPostscript name for %0? ", + #if defined(EUC_JP) + "wX11 name2 for %0? ", + "wPostscript name2 for %0? ", + #endif /* EUC_JP */ #endif #ifdef DOC_STRINGS "Define the font OLEONAME to correspond to X11NAME and POSTSCRIPTNAME.", *************** *** 1186,1191 **** --- 1196,1204 ---- FDset_x_def_font, FAset_x_def_font, set_x_default_font) #ifdef FUNC_ARG_STRINGS "sX11 font specification? ", + #if defined(EUC_JP) + "sX11 font2 specification? ", + #endif /* EUC_JP */ #endif #ifdef DOC_STRINGS "Set the X11 name of the default font.", *************** *** 2278,2282 **** --- 2291,2305 ---- DEFUN_3 ("graph-plot", FDgraph_plot, graph_plot) #ifdef DOC_STRINGS "Execute a graph. The parameter of the graph are set using [graph-setup]", + #endif + + DEFUN ("let", + FDdo_let, FAdo_let, do_let) + #ifdef FUNC_ARG_STRINGS + "rSet cell? ", + "sEnter value for %0? ", + #endif + #ifdef DOC_STRINGS + "Change the definition of all cells in RANGE to FORMULA.", #endif diff --recursive --context --minimal --new-file oleo-1.6/font.c oleo-1.6jb2/font.c *** oleo-1.6/font.c Sat Jun 4 01:18:22 1994 --- oleo-1.6jb2/font.c Thu May 1 14:21:05 1997 *************** *** 30,37 **** --- 30,48 ---- static char * default_oleo_name = "default"; + #if defined(EUC_JP) + static char * default_x_name = "-*-fixed-medium-r-*--*-*-jisx0201.1976-*"; + static char * default_x_name2 = "-*-fixed-medium-r-*--*-*-jisx0208.1983-*"; + static char * default_ps_name = "Courier"; + #if defined(GHOSTSCRIPT) + static char * default_ps_name2 = "Ryumin-Light-H"; + #else + static char * default_ps_name2 = "Ryumin-Light-EUC-H"; + #endif + #else static char * default_x_name = "*times-medium-r-*"; static char * default_ps_name = "Times-Roman"; + #endif static struct font_names * font_names = 0; struct font_memo * font_list = 0; *************** *** 40,52 **** --- 51,75 ---- #ifdef __STDC__ void + #if defined(EUC_JP) + define_font (char * oleo_name, char * x_name, char * ps_name,char * x_name2, char * ps_name2) + #else define_font (char * oleo_name, char * x_name, char * ps_name) + #endif /* EUC_JP */ #else void + #if defined(EUC_JP) + define_font (oleo_name, x_name, ps_name,x_name2, ps_name2) + #else define_font (oleo_name, x_name, ps_name) + #endif /* EUC_JP */ char * oleo_name; char * x_name; char * ps_name; + #if defined(EUC_JP) + char * x_name2; + char * ps_name2; + #endif /* EUC_JP */ #endif { struct font_names * fn; *************** *** 58,63 **** --- 81,92 ---- free (fn->x_name); if (fn->ps_name) free (fn->ps_name); + #if defined(EUC_JP) + if (fn->x_name2) + free (fn->x_name2); + if (fn->ps_name2) + free (fn->ps_name2); + #endif /* EUC_JP */ break; } if (!fn) *************** *** 69,74 **** --- 98,107 ---- } fn->x_name = strdup (x_name); fn->ps_name = strdup (ps_name); + #if defined(EUC_JP) + fn->x_name2 = strdup (x_name2); + fn->ps_name2 = strdup (ps_name2); + #endif /* EUC_JP */ } *************** *** 102,113 **** --- 135,158 ---- #ifdef __STDC__ static struct font_names * + #if defined(EUC_JP) + matching_font_names (char * x_name, char * ps_name,char * x_name2, char * ps_name2) + #else matching_font_names (char * x_name, char * ps_name) + #endif /* EUC_JP */ #else static struct font_names * + #if defined(EUC_JP) + matching_font_names (x_name, x_name2, ps_name, ps_name2) + #else matching_font_names (x_name, ps_name) + #endif /* EUC_JP */ char * x_name; char * ps_name; + #if defined(EUC_JP) + char * x_name2; + char * ps_name2; + #endif /* EUC_JP */ #endif { struct font_names * fn; *************** *** 115,126 **** --- 160,182 ---- { if ( stricmp (fn->oleo_name, "default") && !stricmp (ps_name, fn->ps_name) + #if defined(EUC_JP) + && !stricmp (x_name, fn->x_name) + && !stricmp (ps_name2, fn->ps_name2) + && !stricmp (x_name2, fn->x_name2)) + #else && !stricmp (x_name, fn->x_name)) + #endif /* EUC_JP */ return fn; } { + #if defined(EUC_JP) + char * oleo_name = mk_sprintf ("%s,%s,%s,%s", x_name, ps_name,x_name2,ps_name2); + define_font (oleo_name, x_name, ps_name,x_name2,ps_name2); + #else char * oleo_name = mk_sprintf ("%s,%s", x_name, ps_name); define_font (oleo_name, x_name, ps_name); + #endif /* EUC_JP */ fn = find_font_name (oleo_name); free (oleo_name); return fn; *************** *** 168,183 **** --- 224,255 ---- #ifdef __STDC__ struct font_memo * + #if defined(EUC_JP) + matching_font (char * x_name, char * ps_name, char * x_name2, char * ps_name2, double scale) + #else matching_font (char * x_name, char * ps_name, double scale) + #endif /* EUC_JP */ #else struct font_memo * + #if defined(EUC_JP) + matching_font (x_name, ps_name, x_name2, ps_name2, scale) + #else matching_font (x_name, ps_name, scale) + #endif /* EUC_JP */ char * x_name; char * ps_name; + #if defined(EUC_JP) + char * x_name2; + char * ps_name2; + #endif /* EUC_JP */ double scale; #endif { + #if defined(EUC_JP) + struct font_names * fn = matching_font_names (x_name, ps_name,x_name2,ps_name2); + #else struct font_names * fn = matching_font_names (x_name, ps_name); + #endif /* EUC_JP */ return intern_font (fn->oleo_name, scale); } *************** *** 194,199 **** --- 266,275 ---- { char x_name[1000]; char ps_name[1000]; + #if defined(EUC_JP) + char x_name2[1000]; + char ps_name2[1000]; + #endif /* EUC_JP */ char *p; char *p2; double scale; *************** *** 222,235 **** --- 298,346 ---- if (isdigit (*p)) { errno = 0; + #if defined(EUC_JP) + scale = strtod (p,&p); + #else scale = atof (p); + #endif /* EUC_JP */ if (errno) scale = 1.; } else scale = 1.; + #if defined(EUC_JP) + /* + * 都合のいいことに、scale の後ろは見ていないので + * ここに日本語用フォントを書く + */ + while (*p && isspace (*p)) ++p; + + /* フォントがなければ オリジナルの Oleo のファイル */ + /* 日本語のためにデフォルトフォントを設定する */ + if ( !*p ) { + return matching_font (x_name, ps_name,default_x_name2,default_ps_name2, scale); + } + + if (*p == ',') ++p; + for (p2 = x_name2; *p && (*p != ',') && !isspace (*p); *p2++ = *p++); + *p2 = '\0'; + if (x_name2[0] == '\0' || says_default(x_name)) + strcpy (x_name2, default_x_name2); + while (isspace (*p)) ++p; + if (*p == ',') ++p; + while (isspace (*p)) ++p; + for (p2 = ps_name2; *p && (*p != ',') && !isspace (*p); *p2++ = *p++) ; + *p2 = '\0'; + + if (ps_name2[0] == '\0' || says_default(x_name)) + strcpy (ps_name2, default_ps_name2); + + return matching_font (x_name, ps_name,x_name2,ps_name2, scale); + #else return matching_font (x_name, ps_name, scale); + #endif /* EUC_JP */ + } *************** *** 285,311 **** --- 396,452 ---- #ifdef __STDC__ void + #if defined(EUC_JP) + set_x_default_font (char * str,char *str2) + #else set_x_default_font (char * str) + #endif /* EUC_JP */ #else void + #if defined(EUC_JP) + set_x_default_font (str,str2) + #else set_x_default_font (str) + #endif /* EUC_JP */ char * str; + #if defined(EUC_JP) + char * str2; + #endif /* EUC_JP */ #endif { + #if defined(EUC_JP) + define_font (default_oleo_name, str, the_default_font->names->ps_name,str2,the_default_font->names->ps_name2); + #else define_font (default_oleo_name, str, the_default_font->names->ps_name); + #endif /* EUC_JP */ io_repaint (); } #ifdef __STDC__ void + #if defined(EUC_JP) + set_ps_font_cmd (char * ps_name,char * ps_name2) + #else set_ps_font_cmd (char * ps_name) + #endif /* EUC_JP */ #else void + #if defined(EUC_JP) + set_ps_font_cmd (ps_name,ps_name2) + #else set_ps_font_cmd (ps_name) + #endif /* EUC_JP */ char * ps_name; + #if defined(EUC_JP) + char * ps_name2; + #endif /* EUC_JP */ #endif { + #if defined(EUC_JP) + define_font (default_oleo_name, the_default_font->names->x_name, ps_name,the_default_font->names->x_name2, ps_name2); + #else define_font (default_oleo_name, the_default_font->names->x_name, ps_name); + #endif } #ifdef __STDC__ *************** *** 320,326 **** --- 461,471 ---- { struct font_names * fn = find_font_name (name); if (fn != find_font_name (default_oleo_name)) + #if defined(EUC_JP) + define_font (default_oleo_name, fn->x_name, fn->ps_name,fn->x_name2,fn->ps_name2); + #else define_font (default_oleo_name, fn->x_name, fn->ps_name); + #endif /* EUC_JP */ the_default_font = intern_font (default_oleo_name, scale); #ifdef HAVE_X11_X_H if (using_x) *************** *** 339,346 **** --- 484,497 ---- init_fonts () #endif { + #if defined(EUC_JP) + define_font (default_oleo_name, default_x_name, default_ps_name,default_x_name2,default_ps_name2); + define_font ("times", default_x_name, default_ps_name,default_x_name2,default_ps_name2); + define_font ("f9x15", "9x15", "sdlkfj","9x15", "sdlkfj"); + #else define_font (default_oleo_name, default_x_name, default_ps_name); define_font ("times", default_x_name, default_ps_name); define_font ("f9x15", "9x15", "sdlkfj"); + #endif /* EUC_JP */ the_default_font = intern_font (default_oleo_name, 1.0); } diff --recursive --context --minimal --new-file oleo-1.6/font.h oleo-1.6jb2/font.h *** oleo-1.6/font.h Sat Jun 4 01:18:24 1994 --- oleo-1.6jb2/font.h Tue Nov 5 23:56:43 1996 *************** *** 35,40 **** --- 35,44 ---- * if the point size is wild-carded. */ char * ps_name; /* like `TimesRoman'. */ + #if defined(EUC_JP) + char * x_name2; + char * ps_name2; + #endif /* EUC_JP */ }; /* Oleo's concept of a particular set of glyphs (specified as a family + a *************** *** 52,66 **** --- 56,85 ---- #ifdef __STDC__ + #if defined(EUC_JP) + extern void define_font (char * oleo_name, char * x_name, char * ps_name,char * x_name2, char * ps_name2); + #else extern void define_font (char * oleo_name, char * x_name, char * ps_name); + #endif /* EUC_JP */ extern struct font_memo * intern_font (char * oleo_name, double scale); extern struct font_memo * default_font (void); + #if defined(EUC_JP) + extern struct font_memo * matching_font (char * x_name, char * ps_name, char *x_name2,char *ps_name2, double scale); + #else extern struct font_memo * matching_font (char * x_name, char * ps_name, double scale); + #endif /* EUC_JP */ extern struct font_memo * parsed_matching_font (char * fullname); extern void set_region_font (struct rng *rng, char * oleo_name, double scale); extern void flush_fonts (void); + #if defined(EUC_JP) + extern void set_x_default_font (char * str,char *str2); + extern void set_x_default_font2 (char * str,char *str2); + extern void set_ps_font_cmd (char * ps_name,char * ps_name2); + extern void set_ps_font_cmd2 (char * ps_name,char * ps_name2); + #else extern void set_x_default_font (char * str); extern void set_ps_font_cmd (char * ps_name); + #endif /* EUC_JP */ extern void set_default_font (char * name, double scale); extern void init_fonts (void); diff --recursive --context --minimal --new-file oleo-1.6/funcs.c oleo-1.6jb2/funcs.c *** oleo-1.6/funcs.c Sat Jun 4 01:18:37 1994 --- oleo-1.6jb2/funcs.c Wed Nov 6 00:48:37 1996 *************** *** 37,42 **** --- 37,43 ---- #include "font.h" #include "graph.h" #include "lists.h" + #include "let.h" /* By K.Hayashida 1996 */ /* This include builds the function table, doc strings, and FUNC_ARGS strings. diff --recursive --context --minimal --new-file oleo-1.6/getdate.y oleo-1.6jb2/getdate.y *** oleo-1.6/getdate.y Sat Jun 4 01:18:42 1994 --- oleo-1.6jb2/getdate.y Fri Nov 8 01:39:00 1996 *************** *** 801,808 **** static int yylex() { ! register char c; ! register char *p; char buff[20]; int Count; int sign; --- 801,808 ---- static int yylex() { ! register unsigned char c; ! register unsigned char *p; char buff[20]; int Count; int sign; diff --recursive --context --minimal --new-file oleo-1.6/init.c oleo-1.6jb2/init.c *** oleo-1.6/init.c Sat Jun 4 14:00:41 1994 --- oleo-1.6jb2/init.c Sat Feb 1 13:54:19 1997 *************** *** 300,305 **** --- 300,309 ---- "", "bind-key read-string meta-read-string ^[", "bind-set read-string self-insert-command \\ -~", + #if defined(EUC_JP) + /* By K.Hayashida 1996 */ + "bind-set read-string self-insert-command \\240-\\376", + #endif /* EUC_JP */ "bind-key read-string exit-minibuffer ^m", "bind-key read-string beginning-of-line ^a", "bind-key read-string end-of-line ^e", diff --recursive --context --minimal --new-file oleo-1.6/input.c oleo-1.6jb2/input.c *** oleo-1.6/input.c Sat Jun 4 01:19:15 1994 --- oleo-1.6jb2/input.c Sat Feb 8 11:52:40 1997 *************** *** 81,93 **** find_vis_begin (int * wid_used, int wid, char * str, int pos, text_measure metric) #else ! static int find_vis_begin (wid_used, wid, str, pos, metric) ! int * wid_used; ! int wid; ! char * str; ! int pos; ! text_measure metric; #endif { int used; /* How many cols allocated? */ --- 81,93 ---- find_vis_begin (int * wid_used, int wid, char * str, int pos, text_measure metric) #else ! static int /* 返り値は表示開始位置 */ find_vis_begin (wid_used, wid, str, pos, metric) ! int * wid_used; /* 表示に使用した幅(返り) */ ! int wid; /* 表示に使用できる幅 */ ! char * str;a /* 表示する文字列 */ ! int pos; /* カーソル位置 */ ! text_measure metric;/* 文字の幅 */ #endif { int used; /* How many cols allocated? */ *************** *** 102,115 **** while (pos && (used < wid)) { int next; ! next = metric (&str[pos - 1], 1); if (used + next > wid) break; else { ! --pos; used += next; } } if (wid_used) *wid_used = used; --- 102,134 ---- while (pos && (used < wid)) { int next; ! #if defined(EUC_JP) ! int chsize; ! ! if( ((unsigned char)str[pos-1]) > 0xa0 ) { ! next = metric (&str[pos - 2], 2); ! chsize = 2; ! } else { ! next = metric (&str[pos - 1], 1); ! chsize = 1; ! } if (used + next > wid) break; else { ! pos -= chsize; used += next; } + #else + next = metric (&str[pos - 1], 1); + if (used + next > wid) + break; + else + { + --pos; + used += next; + } + #endif } if (wid_used) *wid_used = used; *************** *** 141,146 **** --- 160,183 ---- while ((pos < max) && (used < wid)) { int next; + #if defined(EUC_JP) + int chsize; + + if( ((unsigned char)str[pos + 1 ]) > 0xa0 ) { + next = metric (&str[pos + 1], 2); + chsize = 2; + } else { + next = metric (&str[pos + 1], 1); + chsize = 1; + } + if (used + next > wid) + break; + else + { + pos += chsize; + used += next; + } + #else next = metric (&str[pos + 1], 1); if (used + next > wid) break; *************** *** 149,154 **** --- 186,192 ---- ++pos; used += next; } + #endif } if (wid_used) *wid_used = used; diff --recursive --context --minimal --new-file oleo-1.6/install-sh oleo-1.6jb2/install-sh *** oleo-1.6/install-sh Thu Jan 1 09:00:00 1970 --- oleo-1.6jb2/install-sh Sat Feb 1 02:17:45 1997 *************** *** 0 **** --- 1,250 ---- + #! /bin/sh + # + # install - install a program, script, or datafile + # This comes from X11R5 (mit/util/scripts/install.sh). + # + # Copyright 1991 by the Massachusetts Institute of Technology + # + # Permission to use, copy, modify, distribute, and sell this software and its + # documentation for any purpose is hereby granted without fee, provided that + # the above copyright notice appear in all copies and that both that + # copyright notice and this permission notice appear in supporting + # documentation, and that the name of M.I.T. not be used in advertising or + # publicity pertaining to distribution of the software without specific, + # written prior permission. M.I.T. makes no representations about the + # suitability of this software for any purpose. It is provided "as is" + # without express or implied warranty. + # + # Calling this script install-sh is preferred over install.sh, to prevent + # `make' implicit rules from creating a file called install from it + # when there is no Makefile. + # + # This script is compatible with the BSD install script, but was written + # from scratch. It can only install one file at a time, a restriction + # shared with many OS's install programs. + + + # set DOITPROG to echo to test this script + + # Don't use :- since 4.3BSD and earlier shells don't like it. + doit="${DOITPROG-}" + + + # put in absolute paths if you don't have them in your path; or use env. vars. + + mvprog="${MVPROG-mv}" + cpprog="${CPPROG-cp}" + chmodprog="${CHMODPROG-chmod}" + chownprog="${CHOWNPROG-chown}" + chgrpprog="${CHGRPPROG-chgrp}" + stripprog="${STRIPPROG-strip}" + rmprog="${RMPROG-rm}" + mkdirprog="${MKDIRPROG-mkdir}" + + transformbasename="" + transform_arg="" + instcmd="$mvprog" + chmodcmd="$chmodprog 0755" + chowncmd="" + chgrpcmd="" + stripcmd="" + rmcmd="$rmprog -f" + mvcmd="$mvprog" + src="" + dst="" + dir_arg="" + + while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac + done + + if [ x"$src" = x ] + then + echo "install: no input file specified" + exit 1 + else + true + fi + + if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi + else + + # Waiting for this to be detected by the "$instcmd $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + + # If destination is a directory, append the input filename; if your system + # does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi + fi + + ## this sed command emulates the dirname command + dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + # this part is taken from Noah Friedman's mkinstalldirs script + + # Skip lots of stat calls in the usual case. + if [ ! -d "$dstdir" ]; then + defaultIFS=' + ' + IFS="${IFS-${defaultIFS}}" + + oIFS="${IFS}" + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` + IFS="${oIFS}" + + pathcomp='' + + while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" + done + fi + + if [ x"$dir_arg" != x ] + then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi + else + + # If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + + # don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + + # Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + + # Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + + # and set any options; do chmod last to preserve setuid bits + + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + + # Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + + fi && + + + exit 0 diff --recursive --context --minimal --new-file oleo-1.6/io-curses.c oleo-1.6jb2/io-curses.c *** oleo-1.6/io-curses.c Sat Jun 4 01:19:22 1994 --- oleo-1.6jb2/io-curses.c Tue Feb 4 00:04:59 1997 *************** *** 40,45 **** --- 40,48 ---- #include "key.h" #include "input.h" #include "info.h" + #if !defined(HAVE_ALECOMPAT) + #include "alecompat.h" + #endif #define MIN_WIN_HEIGHT (cwin->flags&WIN_EDGES ? 2 : 1) #define MIN_WIN_WIDTH (cwin->flags&WIN_EDGES ? 6 : 1) *************** *** 120,126 **** --- 123,133 ---- { int x; for (x = pos; x <= input_view.visibility_end; ++x) + #if defined(EUC_JP) + addch ((unsigned char)input_view.input_area->buf[x]); + #else addch (input_view.input_area->buf[x]); + #endif } clrtoeol (); input_view.redraw_needed = NO_REDRAW; *************** *** 233,238 **** --- 240,252 ---- int cwid; int n; int x, y; + #if defined(EUC_JP) + int ch; + int flag; /* ascii -> 0 , 1st byte -> 1, 2nd byte then 2 */ + #if EUC_JP_DEBUG + FILE *fp; + #endif + #endif /* EUC_JP */ if (input_view.current_info) return; *************** *** 254,265 **** if (cwid > cwin->numc) cwid = cwin->numc; move (cell_cursor_row, cell_cursor_col); standout (); ! for (n = cwid; n; n--) #ifdef A_STANDOUT ! addch (inch () | A_STANDOUT); #else ! addch (inch ()); #endif standend (); move (y, x); --- 268,332 ---- if (cwid > cwin->numc) cwid = cwin->numc; move (cell_cursor_row, cell_cursor_col); + #if defined(EUC_JP) + { + int x,y; + + adjcurspos(); + getyx (stdscr, y, x); + if(x != cell_cursor_col) { + movenextch(); + cwid--; + } + } + #endif /* EUC_JP */ standout (); ! #if defined(EUC_JP) ! flag = 0; ! #if EUC_JP_DEBUG ! fp = fopen("a.txt","a"); ! #endif ! #endif /* EUC_JP */ ! for (n = cwid; n; n--) { ! ch = inch(); ! #if defined(EUC_JP) ! #ifdef A_CHARTEXT ! ch &= A_CHARTEXT; ! #endif ! #if EUC_JP_DEBUG ! /*fputc(ch,fp);*/ ! fprintf(fp,"%x ",ch); ! #endif ! if( ch > 0xff ) { ! if(flag != 1) ch &= 0xff; ! else ch = (ch >> 8) & 0xff|0x80; ! } ! if(ch & 0x80) { ! if(flag == 1) { ! flag = 2; ! } else { ! flag = 1; ! } ! } else { ! if(flag == 1) { ! /* error */ ! flag = 0; ! } ! flag = 0; ! } ! if( n == 1 && flag == 1 ) { ! break; ! } ! #endif /* EUC_JP */ #ifdef A_STANDOUT ! addch (ch | A_STANDOUT); #else ! addch (ch); ! #endif ! } ! #if EUC_JP_DEBUG ! fputc('\n',fp); ! fclose(fp); #endif standend (); move (y, x); *************** *** 280,285 **** --- 347,356 ---- int cwid; int n; int x, y; + #if defined(EUC_JP) + int chattr,ch; + int flag; + #endif /* EUC_JP */ if (input_view.current_info) return; *************** *** 299,310 **** if (cwid > cwin->numc) cwid = cwin->numc; move (cell_cursor_row, cell_cursor_col); ! for (n = cwid; n; n--) #ifdef A_STANDOUT ! addch (inch () & ~A_STANDOUT); #else ! addch (inch ()); #endif move (y, x); } --- 370,419 ---- if (cwid > cwin->numc) cwid = cwin->numc; move (cell_cursor_row, cell_cursor_col); ! #if defined(EUC_JP) ! { ! int x,y; ! ! adjcurspos(); ! getyx (stdscr, y, x); ! if(x != cell_cursor_col) { ! movenextch(); ! cwid--; ! } ! } ! #endif /* EUC_JP */ ! #if defined(EUC_JP) ! flag = 0; ! #endif /* EUC_JP */ ! for (n = cwid; n; n--) { ! ch = inch(); ! #if defined(EUC_JP) ! #ifdef A_CHARTEXT ! ch &= A_CHARTEXT; ! #endif ! if( ch > 0xff ) { ! if(flag != 1) ch &= 0xff; ! else ch = (ch >> 8) & 0xff|0x80; ! } ! if(ch & 0x80) { ! if(flag == 1) flag = 2; ! else flag = 1; ! } else { ! if(flag == 1) { ! /* error */ ! } ! flag = 0; ! } ! if( n == 1 && flag == 1 ) { ! break; ! } ! #endif /* EUC_JP */ #ifdef A_STANDOUT ! addch ( ch & ~A_STANDOUT); #else ! addch ( ch ); #endif + } move (y, x); } *************** *** 843,849 **** char *s; #endif { ! (void) tputs (s, 1, (int (*)()) local_putchar); } #ifdef __STDC__ --- 952,958 ---- char *s; #endif { ! (void) tputs (s, 1, (void (*)(int)) local_putchar); } #ifdef __STDC__ *************** *** 854,860 **** _io_bell () #endif { ! #ifndef HAVE_GETCAP putchar ('\007'); #else static char *vb; --- 963,974 ---- _io_bell () #endif { ! #if HAVE_FLASH ! flash(); ! #elif HAVE_BEEP ! beep(); ! #else ! #if HAVE_GETCAP putchar ('\007'); #else static char *vb; *************** *** 874,879 **** --- 988,994 ---- local_putchar ('\007'); } #endif + #endif } *************** *** 1161,1166 **** --- 1276,1286 ---- } else if (glowing) { + #if defined(EUC_JP) + if( checkeucJP(ptr,wid-1) == 1 ) { + wid -= 1; + } + #endif printw ("%.*s", wid, ptr); standend (); printw ("%-*.*s ", wwid - wid - 1, wwid - wid - 1, ptr + wid); *************** *** 1170,1182 **** --- 1290,1319 ---- CELLREF ctmp; int w_left; int w_here; + #if defined(EUC_JP) + int adjoffset; + #endif w_left = wid; for (ctmp = c + 1; ctmp < cucol; ctmp++) w_left += get_width (ctmp); + #if defined(EUC_JP) + if( checkeucJP(ptr,w_left-1) == 1) { + w_left += 1; + adjoffset = 1; + } else { + adjoffset = 0; + } + #endif printw ("%.*s", w_left, ptr); standout (); w_here = get_width (cucol); + #if defined(EUC_JP) + w_here -= adjoffset; + if( checkeucJP(ptr,w_left + w_here -1) == 1 ) { + w_here -= 1; + } + #endif if (wwid > w_left + w_here) { printw ("%-*.*s", w_here, w_here, ptr + w_left); diff --recursive --context --minimal --new-file oleo-1.6/io-edit.c oleo-1.6jb2/io-edit.c *** oleo-1.6/io-edit.c Sat Jun 4 14:59:46 1994 --- oleo-1.6jb2/io-edit.c Sun Mar 16 02:52:48 1997 *************** *** 168,173 **** --- 168,184 ---- else { char * error = 0; + #if defined(EUC_JP) + while(n--) { + if( the_cursor <= 0 ) { + the_cursor = 0; + error = "Beginning of buffer."; + break; + } + the_cursor -- ; + if(the_text.attr[the_cursor] & _ATR2ND) the_cursor--; + } + #else if (the_cursor < n) { error = "Beginning of buffer."; *************** *** 175,192 **** --- 186,235 ---- } else the_cursor -= n; + #endif /* EUC_JP */ io_move_cursor (); if (error) io_error_msg (error); /* Doesn't return. */ } } + #if defined(EUC_JP) + #ifdef __STDC__ + void + backward_word (int n) + #else + void + backward_word (n) + int n; + #endif + { + if (check_editting_mode ()) + return; + if (n < 0) + forward_word (-n); + else + { + while(n) { + if( the_cursor ) { + --the_cursor; + while (the_cursor + && (the_text.attr[the_cursor] & _ATRWORD ) == 0 ) + --the_cursor; + } + --n; + } + io_move_cursor (); + } + } + + #else /* defined(EUC_JP) */ #ifdef __STDC__ void backward_word (int n) #else void backward_word (n) + int n; #endif { if (check_editting_mode ()) *************** *** 210,215 **** --- 253,259 ---- io_move_cursor (); } } + #endif /* defined(EUC_JP) */ #ifdef __STDC__ *************** *** 229,234 **** --- 273,289 ---- { char * error = 0; int len = strlen(the_text.buf); + #if defined(EUC_JP) + while( n-- ) { + the_cursor ++ ; + if(the_text.attr[the_cursor] & _ATR2ND) the_cursor++; + if ( the_cursor > len) + { + error = "End of buffer."; + the_cursor = len; + } + } + #else if ((the_cursor + n) > len) { error = "End of buffer."; *************** *** 236,241 **** --- 291,297 ---- } else the_cursor += n; + #endif /* EUC_JP */ io_move_cursor (); if (error) io_error_msg (error); /* Doesn't return. */ *************** *** 259,267 **** --- 315,358 ---- if (n > len) n = len; the_cursor = n; + #if defined(EUC_JP) + if(the_text.attr[the_cursor] & _ATR2ND) the_cursor--; + #endif /* EUC_JP */ io_move_cursor (); } + #if defined(EUC_JP) + #ifdef __STDC__ + void + forward_word (int n) + #else + void + forward_word (n) + int n; + #endif + { + if (check_editting_mode ()) + return; + if (n < 0) + backward_word (-n); + else + { + int len = strlen (the_text.buf); + while (n) + { + if( the_cursor < len ) { + ++the_cursor; + while ((the_cursor < len) + && (the_text.attr[the_cursor] & _ATRWORD) == 0) { + ++the_cursor; + } + } + --n; + } + io_move_cursor (); + } + } + #else /* defined(EUC_JP) */ #ifdef __STDC__ void forward_word (int n) *************** *** 291,296 **** --- 382,388 ---- io_move_cursor (); } } + #endif /* defined(EUC_JP) */ #ifdef __STDC__ *************** *** 302,314 **** --- 394,434 ---- int len; #endif { + #if defined(EUC_JP) + char *p; + unsigned char *atr; + int byte; + #endif /* EUC_JP */ + if (check_editting_mode ()) return; else { + #if defined(EUC_JP) + if(len == 0) { + return; + } + p = &the_text.buf[the_cursor]; + atr = &the_text.attr[the_cursor]; + while(*p && len--) { + if(*atr & _ATR1ST) { + atr+=2; + p+=2; + } else { + atr++; + p++; + } + } + byte = p - &the_text.buf[the_cursor]; + strcpy (&the_text.buf[the_cursor], + &the_text.buf[the_cursor + byte]); + makeattr(&the_text); + io_erase (byte); + #else strcpy (&the_text.buf[the_cursor], &the_text.buf[the_cursor + len]); io_erase (len); + #endif /* EUC_JP */ } } *************** *** 321,326 **** --- 441,449 ---- backward_delete_char (n) #endif { + #if defined(EUC_JP) + int i; + #endif /* EUC_JP */ if (check_editting_mode ()) return; if (n < 0) *************** *** 328,339 **** --- 451,475 ---- else { char * error = 0; + #if defined(EUC_JP) + i = n; + while(i > 0) { + if(the_cursor == 0 ) { + break; + } + the_cursor--; + if(the_text.attr[the_cursor] & _ATR2ND) the_cursor--; + i--; + } + n -= i ; /* カーソルを戻したバイト数を計算する。通常は i=0 */ + #else if (the_cursor < n) { error = "Beginning of buffer."; n = the_cursor; } the_cursor -= n; + #endif /* EUC_JP */ erase (n); if (error) io_error_msg (error); /* Doesn't return. */ diff --recursive --context --minimal --new-file oleo-1.6/io-term.c oleo-1.6jb2/io-term.c *** oleo-1.6/io-term.c Sat Jun 4 15:09:48 1994 --- oleo-1.6jb2/io-term.c Sat Mar 15 17:29:55 1997 *************** *** 18,23 **** --- 18,28 ---- #include #include + #ifdef HAVE_X11_X_H + #include + #else + #include + #endif #include "global.h" *************** *** 77,83 **** /* This should be updated for every release. * The file ANNOUNCE must be udpated as well. */ ! const char oleo_version_string[] = "Oleo version 1.6"; /* This variable is non-zero if the spreadsheet has been changed in any way */ int modified = 0; --- 82,88 ---- /* This should be updated for every release. * The file ANNOUNCE must be udpated as well. */ ! const char oleo_version_string[] = "Oleo version 1.6jb1"; /* This variable is non-zero if the spreadsheet has been changed in any way */ int modified = 0; *************** *** 1100,1105 **** --- 1105,1113 ---- FD_ZERO (&exception_fd_set); FD_ZERO (&exception_pending_fd_set); + if( setlocale(LC_ALL,"") == NULL ) { + panic("Can not set locale."); + } #ifdef HAVE_X11_X_H if (!no_x) get_x11_args (&argc, argv); *************** *** 1185,1201 **** FILE * fp; /* fixme: record file name */ ++optind; ! if (fp = fopen (argv[1], "r")) { if (setjmp (error_exception)) ! fprintf (stderr, " error occured reading %s", argv[1]); else ! read_file_and_run_hooks (fp, 0, argv[1]); fclose (fp); command_line_file = 1; } else ! fprintf (stderr, "Can't open %s: %s", argv[1], err_msg ()); } /* Force the command frame to be rebuilt now that the keymaps exist. */ { --- 1193,1209 ---- FILE * fp; /* fixme: record file name */ ++optind; ! if (fp = fopen (argv[argc-1], "r")) { if (setjmp (error_exception)) ! fprintf (stderr, " error occured reading %s", argv[argc-1]); else ! read_file_and_run_hooks (fp, 0, argv[argc-1]); fclose (fp); command_line_file = 1; } else ! fprintf (stderr, "Can't open %s: %s", argv[argc-1], err_msg ()); } /* Force the command frame to be rebuilt now that the keymaps exist. */ { diff --recursive --context --minimal --new-file oleo-1.6/io-x11.c oleo-1.6jb2/io-x11.c *** oleo-1.6/io-x11.c Sat Jun 4 14:19:33 1994 --- oleo-1.6jb2/io-x11.c Sat Mar 15 16:11:33 1997 *************** *** 19,30 **** #include #include #include ! #define NeedFunctionPrototypes 0 #include #include #include #include #include #include "global.h" #include "utils.h" #include "io-generic.h" --- 19,31 ---- #include #include #include ! #define NeedFunctionPrototypes 1 #include #include #include #include #include + #include #include "global.h" #include "utils.h" #include "io-generic.h" *************** *** 59,71 **** --- 60,126 ---- extern char * x_get_string_resource (XrmDatabase, char *, char *); extern XrmDatabase x_load_resources (Display *, char *, char *); extern char * getenv (const char *); + extern void SetGeometry(XIC , char *, XRectangle *); + extern void GetPreferredGeometry(XIC ,char *, XRectangle *); + extern XIMStyle ChooseBetterStyle(XIMStyle, XIMStyle ); + extern void GeometryCallback(XIC,XPointer,XPointer); + extern int PreeditStartCallback(XIC,XPointer,XPointer); + extern void PreeditDoneCallback(XIC,XPointer,XPointer); + extern void PreeditDrawCallback(XIC,XPointer,XPointer); + extern void PreeditCaretCallback(XIC,XPointer,XPointer); + extern void StatusStartCallback(XIC,XPointer,XPointer); + extern void StatusDoneCallback(XIC,XPointer,XPointer); + extern void StatusDrawCallback(XIC,XPointer,XPointer); #else extern char * x_get_string_resource (); extern XrmDatabase x_load_resources (); extern char * getenv (); + extern void SetGeometry(); + extern void GetPreferredGeometry(); + extern XIMStyle ChooseBetterStyle(); + extern void GeometryCallback(); + extern int PreeditStartCallback(); + extern void PreeditDoneCallback(); + extern void PreeditDrawCallback(); + extern void PreeditCaretCallback(); + extern void StatusStartCallback(); + extern void StatusDoneCallback(); + extern void StatusDrawCallback(); #endif + #ifdef EUC_JP + #define XIC_STATUS_AREA_DEFAULT 64 /* XIM_STATUS_AREA の場合の初期値 */ + + static char *emergency_font_name = "-misc-fixed-medium-r-*--14-*-iso8859-1,\ + -*-fixed-medium-r-*--14-*-jisx0208.1983-*,\ + -*-fixed-medium-r-*--14-*-jisx0201.1976-*"; + static char *cell_font_name = "-misc-fixed-medium-r-*--14-*-iso8859-1,\ + -*-fixed-medium-r-*--14-*-jisx0208.1983-*,\ + -*-fixed-medium-r-*--14-*-jisx0201.1976-*"; + static char *default_font_name = "-misc-fixed-medium-r-*--14-*-iso8859-1,\ + -*-fixed-medium-r-*--14-*-jisx0208.1983-*,\ + -*-fixed-medium-r-*--14-*-jisx0201.1976-*"; + static char *input_font_name = "-misc-fixed-medium-r-*--14-*-iso8859-1,\ + -*-fixed-medium-r-*--14-*-jisx0208.1983-*,\ + -*-fixed-medium-r-*--14-*-jisx0201.1976-*"; + static char *status_font_name = "-misc-fixed-medium-r-*--14-*-iso8859-1,\ + -*-fixed-medium-r-*--14-*-jisx0208.1983-*,\ + -*-fixed-medium-r-*--14-*-jisx0201.1976-*"; + static char *text_line_font_name = "-misc-fixed-medium-r-*--14-*-iso8859-1,\ + -*-fixed-medium-r-*--14-*-jisx0208.1983-*,\ + -*-fixed-medium-r-*--14-*-jisx0201.1976-*"; + static char *label_font_name = "-misc-fixed-medium-r-*--14-*-iso8859-1,\ + -*-fixed-medium-r-*--14-*-jisx0208.1983-*,\ + -*-fixed-medium-r-*--14-*-jisx0201.1976-*"; + static XIM im; + static XIC ic; + void SetPreeditPosition(int xpos); + void SetPreeditArea(int xpos); + #if !defined(MAX) + #define MAX(X,Y) (((X)>(Y))?(X):(Y)) + #endif + #else static char *emergency_font_name = "8x13"; static char *cell_font_name = "times_roman12"; static char *default_font_name = "8x13"; *************** *** 73,78 **** --- 128,134 ---- static char *status_font_name = "6x10"; static char *text_line_font_name = "8x13"; static char *label_font_name = "5x8"; + #endif int cell_font_point_size = 12; static char *default_bg_color_name = "black"; static char *default_fg_color_name = "white"; *************** *** 84,91 **** static int geom_x = 0; static int geom_y = 0; static int geom_w = 675; ! static int geom_h = 350; ! static char geom_string[] = "675x350+0+0"; /* This global is used only during command line and .Xdefaults handling. */ static Display * theDisplay; --- 140,149 ---- static int geom_x = 0; static int geom_y = 0; static int geom_w = 675; ! static int geom_h = 364; ! static char geom_string[] = "675x364+0+0"; ! static int status_h = 0; ! static int convert_h = 0; /* This global is used only during command line and .Xdefaults handling. */ static Display * theDisplay; *************** *** 175,184 **** char ** argv; #endif { XrmInitialize (); #if 0 - XrmDatabase argv_resources; /* Get the command line arguments. */ XrmParseCommand (&argv_resources, x11_options, count_options (x11_options), --- 233,246 ---- char ** argv; #endif { + #if 0 + XrmDatabase argv_resources; + XrmOptionDescList x11_options; + #endif + XrmInitialize (); #if 0 /* Get the command line arguments. */ XrmParseCommand (&argv_resources, x11_options, count_options (x11_options), *************** *** 189,195 **** io_x11_display_name = x_get_string_resource (argv_resources, class_of ("Display"), name_of ("display")); ! #endif if (!io_x11_display_name) io_x11_display_name = ck_savestr (getenv ("DISPLAY")); --- 251,257 ---- io_x11_display_name = x_get_string_resource (argv_resources, class_of ("Display"), name_of ("display")); ! #endif if (!io_x11_display_name) io_x11_display_name = ck_savestr (getenv ("DISPLAY")); *************** *** 197,202 **** --- 259,273 ---- return; theDisplay = XOpenDisplay (io_x11_display_name); + + if ( !XSupportsLocale() ) { + panic("X does not support Locale"); + } + + if ( XSetLocaleModifiers("") == NULL ) { + (void) fprintf(stderr, " Warning: cannot set locale modifiers.\n"); + } + if (!theDisplay) panic ("Can not connect to X. Check your DISPLAY evironment variable."); *************** *** 210,216 **** #if 0 /* Merge in the command line database. */ ! XrmMergeDatabases (argv_resources, rdb); #endif /* Set up the various defaults (staticly declared above). */ --- 281,287 ---- #if 0 /* Merge in the command line database. */ ! XrmMergeDatabases (argv_resources, &rdb); #endif /* Set up the various defaults (staticly declared above). */ *************** *** 252,261 **** --- 323,356 ---- Window window; Cursor mouse_cursor; + #if defined(EUC_JP) + XFontSet input_font_set; + XFontSetExtents *input_font_ext; + XFontSet text_line_font_set; + XFontSetExtents *text_line_font_ext; + XFontSet label_font_set; + XFontSetExtents *label_font_ext; + XFontSet status_font_set; + XFontSetExtents *status_font_ext; + + /* Imput Method */ + XIMStyle im_input_style; + XRectangle ic_preedit_area,ic_status_area; + XIMCallback geometrycallback; + XIMCallback preeditstartcallback; + XIMCallback preeditdonecallback; + XIMCallback preeditdrawcallback; + XIMCallback preeditcaretcallback; + XIMCallback statusstartcallback; + XIMCallback statusdonecallback; + XIMCallback statusdrawcallback; + XPoint spotlocation; + #else XFontStruct *input_font; XFontStruct *text_line_font; XFontStruct *label_font; XFontStruct *status_font; + #endif GC neutral_gc; GC normal_gc; *************** *** 307,331 **** #ifdef __STDC__ static void draw_text_item (Xport xport, int c, int r, int wid, int hgt, ! XFontStruct *font, GC gc, XTextItem *text, int do_clip) #else static void ! draw_text_item (xport, c, r, wid, hgt, font, gc, text, do_clip) ! Xport xport; ! int c; ! int r; ! int wid; ! int hgt; ! XFontStruct *font; GC gc; ! XTextItem *text; int do_clip; #endif { XRectangle clip; int widused; int tab_char; ! XTextItem to_draw; clip.x = c; clip.y = r; --- 402,427 ---- #ifdef __STDC__ static void draw_text_item (Xport xport, int c, int r, int wid, int hgt, ! XFontSet font_set, XFontSetExtents *font_ext,GC gc, XmbTextItem *text, int do_clip) #else static void ! draw_text_item (xport, c, r, wid, hgt, font_set, font_ext,gc, text, do_clip) ! Xport xport; /* 描画ポート */ ! int c; /* X座標 */ ! int r; /* Y座標 */ ! int wid; /* 幅 */ ! int hgt; /* 高さ */ ! XFontSet font_set; /* フォントセット */ ! XFontSetExtents *font_ext; /* フォントサイズ */ GC gc; ! XmbTextItem *text; int do_clip; #endif { XRectangle clip; int widused; int tab_char; ! XmbTextItem to_draw; clip.x = c; clip.y = r; *************** *** 342,349 **** widused = 0; while (to_draw.nchars) { ! XTextItem draw_now; ! XTextItem after_tab; /* Draw tab characters carefully. */ { --- 438,445 ---- widused = 0; while (to_draw.nchars) { ! XmbTextItem draw_now; ! XmbTextItem after_tab; /* Draw tab characters carefully. */ { *************** *** 364,378 **** } draw_burst: ! XDrawImageString (xport->dpy, xport->window, gc, ! c + widused, r + font->ascent, draw_now.chars, draw_now.nchars); ! widused += XTextWidth (font, draw_now.chars, draw_now.nchars); tab_char += draw_now.nchars; if (after_tab.chars) { int tab_stop_col = ((tab_char + 8 - tab_char % 8) ! * font->max_bounds.width); XFillRectangle (xport->dpy, xport->window, xport->neutral_gc, c + widused, r, tab_stop_col - widused, hgt); widused = tab_stop_col; --- 460,474 ---- } draw_burst: ! XmbDrawImageString (xport->dpy, xport->window, font_set, gc, ! c + widused, r - font_ext->max_logical_extent.y, draw_now.chars, draw_now.nchars); ! widused += XmbTextEscapement (font_set, draw_now.chars, draw_now.nchars); tab_char += draw_now.nchars; if (after_tab.chars) { int tab_stop_col = ((tab_char + 8 - tab_char % 8) ! * font_ext->max_logical_extent.width/2); XFillRectangle (xport->dpy, xport->window, xport->neutral_gc, c + widused, r, tab_stop_col - widused, hgt); widused = tab_stop_col; *************** *** 400,431 **** struct input_view * iv = &thePort->input_view; int offset = iv->input_cursor - iv->visibility_begin; int start; ! XTextItem cursor_text; int cwid; int ypos = (iv->current_info ? 0 : input); char * inp; inp = (iv->input_area ? iv->input_area->buf + iv->visibility_begin : ""); ! start = (XTextWidth (thePort->input_font, inp, offset) + iv->prompt_wid); ! cursor_text.font = thePort->input_font->fid; ! cursor_text.nchars = 1; if (iv->input_cursor <= iv->visibility_end) { ! cwid = XTextWidth (thePort->input_font, inp + offset, 1); cursor_text.chars = inp + offset; } else { ! cwid = XTextWidth (thePort->input_font, " ", 1); cursor_text.chars = " "; } draw_text_item (thePort, start, ypos, cwid, input_rows, ! thePort->input_font, (on ? thePort->standout_input_gc : thePort->input_gc), &cursor_text, 1); } #ifdef __STDC__ --- 496,538 ---- struct input_view * iv = &thePort->input_view; int offset = iv->input_cursor - iv->visibility_begin; int start; ! XmbTextItem cursor_text; int cwid; int ypos = (iv->current_info ? 0 : input); char * inp; + int bytes; inp = (iv->input_area ? iv->input_area->buf + iv->visibility_begin : ""); ! start = (XmbTextEscapement (thePort->input_font_set, inp, offset) + iv->prompt_wid); ! cursor_text.delta = 0; ! cursor_text.font_set = thePort->input_font_set; if (iv->input_cursor <= iv->visibility_end) { ! if( *((unsigned char*)(inp + offset)) >= 0xa0) { ! bytes = 2; ! } else { ! bytes = 1; ! } ! cwid = XmbTextEscapement (thePort->input_font_set, inp + offset, bytes); cursor_text.chars = inp + offset; } else { ! bytes = 1; ! cwid = XmbTextEscapement (thePort->input_font_set, " ", bytes); cursor_text.chars = " "; } + cursor_text.nchars = bytes; draw_text_item (thePort, start, ypos, cwid, input_rows, ! thePort->input_font_set,thePort->input_font_ext, (on ? thePort->standout_input_gc : thePort->input_gc), &cursor_text, 1); + if(thePort->im_input_style & XIMPreeditPosition) { + SetPreeditPosition(start); + } } #ifdef __STDC__ *************** *** 455,461 **** char * str; int len; { ! return XTextWidth (thePort->input_font, str, len); } /* This redraws the input area without recomputing anything. */ --- 562,568 ---- char * str; int len; { ! return XmbTextEscapement (thePort->input_font_set, str, len); } /* This redraws the input area without recomputing anything. */ *************** *** 475,489 **** return; if (iv->redraw_needed == FULL_REDRAW) { ! XTextItem text; if (iv->expanded_keymap_prompt) { ! text.font = thePort->input_font->fid; text.chars = iv->expanded_keymap_prompt; text.nchars = strlen (iv->expanded_keymap_prompt); ! draw_text_item (thePort, ! 0, ypos, scr_cols, input_rows, ! thePort->input_font, thePort->input_gc, &text, 0); iv->redraw_needed = NO_REDRAW; if (input_active || iv->current_info) --- 582,596 ---- return; if (iv->redraw_needed == FULL_REDRAW) { ! XmbTextItem text; if (iv->expanded_keymap_prompt) { ! text.font_set = thePort->input_font_set; text.chars = iv->expanded_keymap_prompt; text.nchars = strlen (iv->expanded_keymap_prompt); ! draw_text_item (thePort,0,ypos, scr_cols, input_rows, ! thePort->input_font_set, thePort->input_font_ext, ! thePort->input_gc, &text, 0); iv->redraw_needed = NO_REDRAW; if (input_active || iv->current_info) *************** *** 492,502 **** } else if (iv->prompt_wid) { ! text.font = thePort->input_font->fid; text.chars = iv->prompt; text.nchars = prompt_len (text.chars); draw_text_item (thePort, 0, ypos, iv->prompt_wid, input_rows, ! thePort->input_font, thePort->input_gc, &text, 0); } } --- 599,610 ---- } else if (iv->prompt_wid) { ! text.font_set = thePort->input_font_set; text.chars = iv->prompt; text.nchars = prompt_len (text.chars); draw_text_item (thePort, 0, ypos, iv->prompt_wid, input_rows, ! thePort->input_font_set,thePort->input_font_ext, ! thePort->input_gc, &text, 0); } } *************** *** 519,538 **** : iv->redraw_needed); int xpos = (iv->prompt_wid ! + XTextWidth (thePort->input_font, iv->input_area->buf + iv->visibility_begin, pos - iv->visibility_begin)); int wid = scr_cols - xpos; int hgt = input_rows; ! XTextItem text; ! text.font = thePort->input_font->fid; text.chars = iv->input_area->buf + pos; text.nchars = iv->visibility_end - pos + 1; draw_text_item (thePort, xpos, ypos, wid, hgt, ! thePort->input_font, thePort->input_gc, &text, 0); if (input_active || iv->current_info) --- 627,647 ---- : iv->redraw_needed); int xpos = (iv->prompt_wid ! + XmbTextEscapement (thePort->input_font_set, iv->input_area->buf + iv->visibility_begin, pos - iv->visibility_begin)); int wid = scr_cols - xpos; int hgt = input_rows; ! XmbTextItem text; ! text.font_set = thePort->input_font_set; text.chars = iv->input_area->buf + pos; text.nchars = iv->visibility_end - pos + 1; draw_text_item (thePort, xpos, ypos, wid, hgt, ! thePort->input_font_set,thePort->input_font_ext, ! thePort->input_gc, &text, 0); if (input_active || iv->current_info) *************** *** 650,656 **** static int se_chars_buffered = 0; #define MAX_KEY_TRANSLATION (1024) ! static XComposeStatus compose; #ifdef __STDC__ static void --- 759,766 ---- static int se_chars_buffered = 0; #define MAX_KEY_TRANSLATION (1024) ! /*static XComposeStatus compose;*/ ! Status compose; #ifdef __STDC__ static void *************** *** 665,670 **** --- 775,781 ---- static int pendingw; static int pendingh; static int resize_pending = 0; + static KeySym se_keysym; int events_pending; int len; *************** *** 676,684 **** if ( ((pendingh / height_scale) > 9.) && ((pendingw / width_scale) > 9.)) { ! io_set_scr_size (pendingh, pendingw); resize_pending = 0; } } if (!events_pending) --- 787,823 ---- if ( ((pendingh / height_scale) > 9.) && ((pendingw / width_scale) > 9.)) { ! io_set_scr_size (pendingh - convert_h , pendingw); resize_pending = 0; } + /* + * 対話型で前編集領域と状態表示領域を使用している場合、 + * ウィンドウのリサイズ時に、それらのジオメトリを + * 再交渉すべきである + */ + if ( thePort->im_input_style & XIMStatusArea && !(thePort->im_input_style & XIMPreeditArea)) { + thePort->ic_status_area.x = 0; + thePort->ic_status_area.y = status; + thePort->ic_status_area.width = XIC_STATUS_AREA_DEFAULT; + thePort->ic_status_area.height = status_rows; + GetPreferredGeometry(ic, XNStatusAttributes, &thePort->ic_status_area); + if( thePort->ic_status_area.width > pendingw) { + thePort->ic_status_area.width = pendingw; + } + thePort->ic_status_area.x = 0; + thePort->ic_status_area.y = status; + SetGeometry(ic, XNStatusAttributes, &thePort->ic_status_area); + } + if (thePort->im_input_style & XIMPreeditArea) { + #if 0 + thePort->ic_preedit_area.width = pendingw; + thePort->ic_preedit_area.height = input_rows; + GetPreferredGeometry(ic, XNPreeditAttributes, &thePort->ic_preedit_area); + thePort->ic_preedit_area.x = 0; + thePort->ic_preedit_area.y = input; + SetGeometry(ic, XNPreeditAttributes, &thePort->ic_preedit_area); + #endif + } } if (!events_pending) *************** *** 687,699 **** if (events_pending || blockp) { XNextEvent (thePort->dpy, &event_return); if (event_return.xany.send_event) { /* * Allow other XClients to send oleo commands. */ - static KeySym se_keysym; switch (event_return.type) { --- 826,838 ---- if (events_pending || blockp) { XNextEvent (thePort->dpy, &event_return); + if (XFilterEvent(&event_return,None)) continue; if (event_return.xany.send_event) { /* * Allow other XClients to send oleo commands. */ switch (event_return.type) { *************** *** 709,720 **** se_buf = (char *) ck_remalloc (se_buf, se_buf_allocated); } ! len = XLookupString (&event_return, se_buf + se_chars_buffered, MAX_KEY_TRANSLATION, &se_keysym, &compose); if ((len == 1) && (event_return.xkey.state & Mod1Mask)) se_buf[se_chars_buffered] |= 0x80; if (se_keysym == RetKeySym) { --- 848,870 ---- se_buf = (char *) ck_remalloc (se_buf, se_buf_allocated); } ! len = XmbLookupString (ic,&event_return.xkey, se_buf + se_chars_buffered, MAX_KEY_TRANSLATION, &se_keysym, &compose); + if( compose == XBufferOverflow ) { + se_buf_allocated += len - MAX_KEY_TRANSLATION; + se_buf = + (char *) ck_remalloc (se_buf, se_buf_allocated); + len = XmbLookupString (ic,&event_return.xkey, + se_buf + se_chars_buffered, + len, &se_keysym, &compose); + } + #if 0 + /* ALT */ if ((len == 1) && (event_return.xkey.state & Mod1Mask)) se_buf[se_chars_buffered] |= 0x80; + #endif if (se_keysym == RetKeySym) { *************** *** 748,754 **** events_pending = XPending (thePort->dpy); continue; } ! } else return; --- 898,904 ---- events_pending = XPending (thePort->dpy); continue; } ! } else return; *************** *** 779,789 **** switch (event_return.type) { case KeyPress: ! len = XLookupString (&event_return, input_buf + chars_buffered, ! MAX_KEY_TRANSLATION, 0, &compose); if ((len == 1) && (event_return.xkey.state & Mod1Mask)) input_buf[chars_buffered] |= 0x80; chars_buffered += len; break; --- 929,948 ---- switch (event_return.type) { case KeyPress: ! len = XmbLookupString (ic,&event_return.xkey, input_buf + chars_buffered, ! MAX_KEY_TRANSLATION, &se_keysym, &compose); ! #if 0 ! if( compose == XBufferOverflow ) { ! len = XmbLookupString (ic,&event_return.xkey, ! se_buf + se_chars_buffered, ! len, &se_keysym, &compose); ! } ! #endif ! #if 0 if ((len == 1) && (event_return.xkey.state & Mod1Mask)) input_buf[chars_buffered] |= 0x80; + #endif chars_buffered += len; break; *************** *** 822,827 **** --- 981,987 ---- break; default: + printf("%d\n",event_return.type); break; } events_pending = XPending (thePort->dpy); *************** *** 917,943 **** */ #ifdef __STDC__ static int ! cram (int cols, XFontStruct *font, char *text, int len, char *continuation) #else static int cram (cols, font, text, len, continuation) int cols; ! XFontStruct *font; char *text; int len; char *continuation; #endif { ! int cont_cols = XTextWidth (font, continuation, strlen (continuation)); int cols_used = 0; int x = 0; ! if (XTextWidth (font, text, len) < cols) return len; cols_used = 0; while (x < len && cols_used < (cols - cont_cols)) ! cols_used += XTextWidth (font, text + x, 1); return x; } --- 1077,1103 ---- */ #ifdef __STDC__ static int ! cram (int cols, XFontSet font_set, char *text, int len, char *continuation) #else static int cram (cols, font, text, len, continuation) int cols; ! XFontSet font_set; char *text; int len; char *continuation; #endif { ! int cont_cols = XmbTextEscapement (font_set, continuation, strlen (continuation)); int cols_used = 0; int x = 0; ! if (XmbTextEscapement (font_set, text, len) < cols) return len; cols_used = 0; while (x < len && cols_used < (cols - cont_cols)) ! cols_used += XmbTextEscapement (font_set, text + x, 1); return x; } *************** *** 947,957 **** #ifdef __STDC__ static void ! set_text (XTextItem *xtext, char *text, int len) #else static void set_text (xtext, text, len) ! XTextItem *xtext; char *text; int len; #endif --- 1107,1117 ---- #ifdef __STDC__ static void ! set_text (XmbTextItem *xtext, char *text, int len) #else static void set_text (xtext, text, len) ! XmbTextItem *xtext; char *text; int len; #endif *************** *** 980,986 **** * Low level interface to the input area specificly. */ ! static XTextItem input_text; static int term_cursor_visible = 0; static int input_cursor = 0; /* Position of cursor, if visible */ static int textout; --- 1140,1146 ---- * Low level interface to the input area specificly. */ ! static XmbTextItem input_text; static int term_cursor_visible = 0; static int input_cursor = 0; /* Position of cursor, if visible */ static int textout; *************** *** 1000,1032 **** input, 0, scr_cols, input_rows); return; } ! input_text.font = thePort->input_font->fid; ! draw_text_item (thePort, 0, input, scr_cols, input_rows, thePort->input_font, ! thePort->input_gc, &input_text, 1); if (input_more_mode) { ! XTextItem more_text; ! int mwid = XTextWidth (thePort->input_font, "[more]", 6); more_text.chars = "[MORE]"; more_text.nchars = 6; more_text.delta = 0; ! more_text.font = thePort->input_font->fid; draw_text_item (thePort, scr_cols - mwid, input, mwid, input_rows, ! thePort->input_font, thePort->standout_input_gc, &more_text, 1); } else if (term_cursor_visible) { ! int start = XTextWidth (thePort->input_font, input_text.chars, input_cursor); ! int cwid = XTextWidth (thePort->input_font, input_text.chars + input_cursor, 1); ! XTextItem cursor_text; cursor_text.chars = input_text.chars + input_cursor; cursor_text.nchars = 1; ! cursor_text.font = thePort->input_font->fid; draw_text_item (thePort, start, input, cwid, input_rows, ! thePort->input_font, thePort->standout_input_gc, ! &cursor_text, 1); } } --- 1160,1192 ---- input, 0, scr_cols, input_rows); return; } ! input_text.font_set = thePort->input_font_set; ! draw_text_item (thePort, 0, input, scr_cols, input_rows, thePort->input_font_set, thePort->input_font_ext, thePort->input_gc, &input_text, 1); if (input_more_mode) { ! XmbTextItem more_text; ! int mwid = XmbTextEscapement (thePort->input_font_set, "[more]", 6); more_text.chars = "[MORE]"; more_text.nchars = 6; more_text.delta = 0; ! more_text.font_set = thePort->input_font_set; draw_text_item (thePort, scr_cols - mwid, input, mwid, input_rows, ! thePort->input_font_set,thePort->input_font_ext, ! thePort->standout_input_gc, &more_text, 1); } else if (term_cursor_visible) { ! int start = XmbTextEscapement (thePort->input_font_set, input_text.chars, input_cursor); ! int cwid = XmbTextEscapement (thePort->input_font_set, input_text.chars + input_cursor, 1); ! XmbTextItem cursor_text; cursor_text.chars = input_text.chars + input_cursor; cursor_text.nchars = 1; ! cursor_text.font_set = thePort->input_font_set; draw_text_item (thePort, start, input, cwid, input_rows, ! thePort->input_font_set,thePort->input_font_ext, ! thePort->standout_input_gc,&cursor_text, 1); } } *************** *** 1096,1102 **** /* * Low level interface to the status area specificly. */ ! static XTextItem status_text; #ifdef __STDC__ static void --- 1256,1262 ---- /* * Low level interface to the status area specificly. */ ! static XmbTextItem status_text; #ifdef __STDC__ static void *************** *** 1106,1117 **** draw_status () #endif { if (!x11_opened || thePort->input_view.current_info) return; ! if (user_status) ! draw_text_item (thePort, 0, status, scr_cols, ! status_rows, thePort->status_font, thePort->status_gc, &status_text, 1); } #ifdef __STDC__ --- 1266,1287 ---- draw_status () #endif { + int start = 0; + if (!x11_opened || thePort->input_view.current_info) return; ! if (user_status){ ! if(thePort->im_input_style & XIMStatusArea && !(thePort->im_input_style & XIMPreeditArea) ) { ! start = thePort->ic_status_area.width; ! } ! draw_text_item (thePort, start, status, scr_cols - start, ! status_rows, thePort->status_font_set,thePort->status_font_ext, thePort->status_gc, &status_text, 1); + if(thePort->im_input_style & XIMStatusArea && !(thePort->im_input_style & XIMPreeditArea) ) { + XFillRectangle(thePort->dpy,thePort->window,thePort->neutral_gc, + 0,status,thePort->ic_status_area.width,status_rows); + } + } } #ifdef __STDC__ *************** *** 1124,1130 **** #endif { set_text (&status_text, text, strlen (text)); ! status_text.font = thePort->status_font->fid; draw_status (); } --- 1294,1300 ---- #endif { set_text (&status_text, text, strlen (text)); ! status_text.font_set = thePort->status_font_set; draw_status (); } *************** *** 1172,1183 **** pos += strlen (pos); } *pos++ = ' '; ! mplen = XTextWidth (thePort->status_font, buf, pos - buf); if ((cp = find_cell (curow, cucol)) && cp->cell_formula) { dec = decomp (curow, cucol, cp); ! dlen = XTextWidth (thePort->status_font, dec, strlen (dec)); } else { --- 1342,1353 ---- pos += strlen (pos); } *pos++ = ' '; ! mplen = XmbTextEscapement (thePort->status_font_set, buf, pos - buf); if ((cp = find_cell (curow, cucol)) && cp->cell_formula) { dec = decomp (curow, cucol, cp); ! dlen = XmbTextEscapement (thePort->status_font_set, dec, strlen (dec)); } else { *************** *** 1186,1192 **** } ptr = cell_value_string (curow, cucol); ! plen = XTextWidth (thePort->status_font, ptr, strlen (ptr)); assembled = (char *) ck_malloc (plen + dlen + mplen); if (pos - buf) --- 1356,1362 ---- } ptr = cell_value_string (curow, cucol); ! plen = XmbTextEscapement (thePort->status_font_set, ptr, strlen (ptr)); assembled = (char *) ck_malloc (plen + dlen + mplen); if (pos - buf) *************** *** 1199,1206 **** int wid; l = strlen (ptr); ! c = cram (scr_cols - mplen - thePort->status_font->max_bounds.width, ! thePort->status_font, ptr, l, (dec ? " [...]" : "...")); if (c) bcopy (ptr, pos, c); pos += c; --- 1369,1376 ---- int wid; l = strlen (ptr); ! c = cram (scr_cols - mplen - thePort->status_font_ext->max_logical_extent.width/2, ! thePort->status_font_set, ptr, l, (dec ? " [...]" : "...")); if (c) bcopy (ptr, pos, c); pos += c; *************** *** 1220,1231 **** pos += 3; } *pos++ = ' '; ! wid = XTextWidth (thePort->status_font, assembled, pos - assembled); if (dec) { l = strlen (dec); ! c = cram (scr_cols - wid, thePort->status_font, dec, l, "[...]"); *pos++ = '['; if (c < l) { --- 1390,1401 ---- pos += 3; } *pos++ = ' '; ! wid = XmbTextEscapement (thePort->status_font_set, assembled, pos - assembled); if (dec) { l = strlen (dec); ! c = cram (scr_cols - wid, thePort->status_font_set, dec, l, "[...]"); *pos++ = '['; if (c < l) { *************** *** 1301,1307 **** GC gc; char *font_name; double scale; ! XFontStruct *font; int clipped_to; int cursor:1; }; --- 1471,1478 ---- GC gc; char *font_name; double scale; ! XFontSet font_set; ! XFontSetExtents *font_ext; int clipped_to; int cursor:1; }; *************** *** 1376,1395 **** struct font_memo *font = (font_passed ? font_passed : default_font()); char *font_name = font->names->x_name; double scale = font->scale; struct cell_gc *c = cell_gc_cache; if (cell_gc_basis != cell_font_point_size) { do { if (c->font_name) { - XFreeFont (c->port->dpy, c->font); free (c->font_name); } c->font_name = 0; c->port = 0; ! c->font = 0; c = c->next; } while (c != cell_gc_cache); --- 1547,1577 ---- struct font_memo *font = (font_passed ? font_passed : default_font()); char *font_name = font->names->x_name; + char *font_name2 = font->names->x_name2; double scale = font->scale; struct cell_gc *c = cell_gc_cache; + char **missing; + int missingnum; + char *defstring; + char fontset_name[1024]; + char fontsetstr[1024]; + if (cell_gc_basis != cell_font_point_size) { do { if (c->font_name) { free (c->font_name); } + if (c->font_set) + { + XFreeFontSet (c->port->dpy, c->font_set); + } c->font_name = 0; c->port = 0; ! c->font_set = 0; ! c->font_ext = 0; c = c->next; } while (c != cell_gc_cache); *************** *** 1397,1407 **** } else { do { if ((c->scale == scale) && port == c->port ! && c->font_name && !strcmp (font_name, c->font_name)) { if (cell_gc_cache == c) cell_gc_cache = cell_gc_cache->next; --- 1579,1590 ---- } else { + sprintf(fontset_name,"%s,%s",font_name,font_name2); do { if ((c->scale == scale) && port == c->port ! && c->font_name && !strcmp (fontset_name, c->font_name)) { if (cell_gc_cache == c) cell_gc_cache = cell_gc_cache->next; *************** *** 1423,1429 **** cell_gc_cache = c; if (c->font_name) { ! XFreeFont (c->port->dpy, c->font); free (c->font_name); } c->port = port; --- 1606,1612 ---- cell_gc_cache = c; if (c->font_name) { ! XFreeFontSet (c->port->dpy, c->font_set); free (c->font_name); } c->port = port; *************** *** 1431,1436 **** --- 1614,1620 ---- { char **fontv; int fontc; + fontv = XListFonts (port->dpy, font_name, 1024, &fontc); if (fontv) { *************** *** 1450,1483 **** best = x; } } ! c->font = XLoadQueryFont (port->dpy, fontv[best]); ! XFreeFontNames (fontv); ! } else ! c->font = 0; } ! if (c->font) ! c->font_name = (char *) ck_savestr (font_name); ! else { ! c->font = XLoadQueryFont (port->dpy, cell_font_name); ! if (c->font) c->font_name = ck_savestr (cell_font_name); else { ! c->font = XLoadQueryFont (port->dpy, emergency_font_name); ! if (c->font) c->font_name = ck_savestr (emergency_font_name); else panic ("Unable to load even the emergency font."); } } { XGCValues v; v.font = c->font->fid; XChangeGC (port->dpy, c->gc, GCFont, &v); } check_clipping: --- 1634,1694 ---- best = x; } } ! strcpy(fontsetstr,fontv[best]); ! XFreeFontNames (fontv); ! if( font_name2 ) { ! fontv = XListFonts (port->dpy, font_name2, 1024, &fontc); ! if (fontv) ! { ! int x, best; ! int ideal_size = rint (scale * (double) cell_font_point_size * 10.); ! int best_dist; ! best = 0; ! best_dist = ideal_size - name_to_ps (fontv[0]); ! for (x = 1; x < fontc; ++x) ! { ! int ps = name_to_ps (fontv[x]); ! int tdist = ideal_size - ps; ! if (ABS (tdist) < ABS (best_dist) ! || ((ABS (tdist) == ABS (best_dist)) && (tdist > best_dist))) ! { ! best_dist = tdist; ! best = x; ! } ! } ! strcat(fontsetstr,","); ! strcat(fontsetstr,fontv[best]); ! } /* if(fontv) */ ! } /* if(font_name2) */ ! c->font_set = XCreateFontSet (port->dpy, fontsetstr,&missing,&missingnum,&defstring); ! } /* if(fontv) */ else ! c->font_set = 0; } ! if (c->font_set) { ! c->font_name = (char *) ck_savestr (fontset_name); ! } else { ! c->font_set = XCreateFontSet (port->dpy, cell_font_name,&missing,&missingnum,&defstring); ! if (c->font_set) c->font_name = ck_savestr (cell_font_name); else { ! c->font_set = XCreateFontSet (port->dpy, emergency_font_name,&missing,&missingnum,&defstring); ! if (c->font_set) c->font_name = ck_savestr (emergency_font_name); else panic ("Unable to load even the emergency font."); } } + #if 0 { XGCValues v; v.font = c->font->fid; XChangeGC (port->dpy, c->gc, GCFont, &v); } + #endif check_clipping: *************** *** 1494,1499 **** --- 1705,1711 ---- XChangeGC (port->dpy, c->gc, GCForeground | GCBackground, &v); c->cursor = cursor; } + c->font_ext = XExtentsOfFontSet(c->font_set); return c; } *************** *** 1573,1586 **** #ifdef __STDC__ static void ! place_text (xx_IntRectangle out, struct display *disp, struct cell_display *cd, XFontStruct *font, char *string) #else static void ! place_text (out, disp, cd, font, string) xx_IntRectangle out; struct display *disp; struct cell_display *cd; ! XFontStruct *font; char *string; #endif { --- 1785,1799 ---- #ifdef __STDC__ static void ! place_text (xx_IntRectangle out, struct display *disp, struct cell_display *cd, XFontSet fontset, XFontSetExtents *fontext,char *string) #else static void ! place_text (out, disp, cd, fontset, fontext,string) xx_IntRectangle out; struct display *disp; struct cell_display *cd; ! XFontSet fontset; ! XFontSetExtents *fontext; char *string; #endif { *************** *** 1589,1599 **** int *colx = disp->colx; int *rowy = disp->rowy; struct rng *range = &disp->range; ! int hout = font->ascent + font->descent; ! int wout = XTextWidth (font, string, strlen (string)); int ci = cd->c - range->lc; int ri = cd->r - range->lr; ! int yout = rowy[ri] + heights[ri] - (font->ascent + font->descent); int xout; switch (cd->justification) { --- 1802,1812 ---- int *colx = disp->colx; int *rowy = disp->rowy; struct rng *range = &disp->range; ! int hout = fontext->max_logical_extent.height; ! int wout = XmbTextEscapement (fontset, string, strlen (string)); int ci = cd->c - range->lc; int ri = cd->r - range->lr; ! int yout = rowy[ri] + heights[ri] - fontext->max_logical_extent.height; int xout; switch (cd->justification) { *************** *** 1630,1636 **** else { struct cell_gc *cgc = cell_gc (port, cd->font, 0); ! place_text (&cd->goal, disp, cd, cgc->font, cd->unclipped); } } --- 1843,1849 ---- else { struct cell_gc *cgc = cell_gc (port, cd->font, 0); ! place_text (&cd->goal, disp, cd, cgc->font_set, cgc->font_ext,cd->unclipped); } } *************** *** 1865,1884 **** { if (!cd->clipped) { ! int chr_scale = XTextWidth (cgc->font, "8", 1); int w_avail = xx_IRw (&cd->layout) / chr_scale; int cell_wid = widths[ci] / chr_scale; CELL *cp = find_cell (r, c); cd->clipped = ck_savestr (adjust_prc (cd->unclipped, cp, w_avail, cell_wid, cd->justification)); ! place_text (&cd->clip, disp, cd, cgc->font, cd->clipped); } str = cd->clipped; strbox = &cd->clip; } ! XDrawImageString (port->dpy, port->window, cgc->gc, ! strbox->x + ov, strbox->y + cgc->font->ascent + dn, str, strlen (str)); { struct xx_sIntRectangle tofill[4]; --- 2078,2097 ---- { if (!cd->clipped) { ! int chr_scale = XmbTextEscapement (cgc->font_set, "8", 1); int w_avail = xx_IRw (&cd->layout) / chr_scale; int cell_wid = widths[ci] / chr_scale; CELL *cp = find_cell (r, c); cd->clipped = ck_savestr (adjust_prc (cd->unclipped, cp, w_avail, cell_wid, cd->justification)); ! place_text (&cd->clip, disp, cd, cgc->font_set, cgc->font_ext, cd->clipped); } str = cd->clipped; strbox = &cd->clip; } ! XmbDrawImageString (port->dpy, port->window, cgc->font_set,cgc->gc, ! strbox->x + ov, strbox->y - cgc->font_ext->max_logical_extent.y + dn, str, strlen (str)); { struct xx_sIntRectangle tofill[4]; *************** *** 2054,2068 **** sprintf (buf, "#%d", 1 + win - wins); for (x = len = 0; buf[x]; ++x) { ! int cwid = XTextWidth (thePort->label_font, buf, 1); if (cwid + len > wid2) break; len += cwid; } ! XDrawImageString (thePort->dpy, thePort->window, thePort->label_standout_gc, win->win_over - wid2, ! win->win_down - thePort->label_font->descent, buf, x); rect.x = win->win_over - win->lh_wid; --- 2267,2282 ---- sprintf (buf, "#%d", 1 + win - wins); for (x = len = 0; buf[x]; ++x) { ! int cwid = XmbTextEscapement (thePort->label_font_set, buf, 1); if (cwid + len > wid2) break; len += cwid; } ! XmbDrawImageString (thePort->dpy, thePort->window, ! thePort->label_font_set, thePort->label_standout_gc, win->win_over - wid2, ! win->win_down - ( thePort->label_font_ext->max_logical_extent.height + thePort->label_font_ext->max_logical_extent.y) , buf, x); rect.x = win->win_over - win->lh_wid; *************** *** 2072,2078 **** XSetClipRectangles (thePort->dpy, thePort->label_standout_gc, 0, 0, &rect, 1, YXBanded); ! x = win->win_down + thePort->label_font->ascent; for (cr = win->screen.lr; cr <= win->screen.hr; ++cr) { int hgt = get_scaled_height (cr); --- 2286,2292 ---- XSetClipRectangles (thePort->dpy, thePort->label_standout_gc, 0, 0, &rect, 1, YXBanded); ! x = win->win_down - thePort->label_font_ext->max_logical_extent.y; for (cr = win->screen.lr; cr <= win->screen.hr; ++cr) { int hgt = get_scaled_height (cr); *************** *** 2082,2088 **** sprintf (buf, "%d", cr); else sprintf (buf, "R%d", cr); ! XDrawImageString (thePort->dpy, thePort->window, thePort->label_standout_gc, win->win_over - win->lh_wid, x, buf, strlen (buf)); --- 2296,2303 ---- sprintf (buf, "%d", cr); else sprintf (buf, "R%d", cr); ! XmbDrawImageString (thePort->dpy, thePort->window, ! thePort->label_font_set, thePort->label_standout_gc, win->win_over - win->lh_wid, x, buf, strlen (buf)); *************** *** 2115,2138 **** ptr = buf; sprintf (ptr, "C%u", cr); } ! txtwid = XTextWidth (thePort->label_font, ptr, strlen (ptr)); ! if (txtwid > wid - thePort->label_font->max_bounds.width) { int txtlen = ! ((wid - thePort->label_font->max_bounds.width) ! / XTextWidth (thePort->label_font, "#", 1)); ! txtwid = txtlen * XTextWidth (thePort->label_font, "#", 1); buf[txtlen] = 0; while (txtlen) buf[txtlen--] = '#'; ptr = buf; } ! XDrawImageString (thePort->dpy, thePort->window, thePort->label_standout_gc, x + (wid - txtwid) / 2, ! (win->win_down ! - thePort->label_font->descent), ptr, strlen (ptr)); x += wid; } --- 2330,2354 ---- ptr = buf; sprintf (ptr, "C%u", cr); } ! txtwid = XmbTextEscapement (thePort->label_font_set, ptr, strlen (ptr)); ! if (txtwid > wid - thePort->label_font_ext->max_logical_extent.width/2) { int txtlen = ! ((wid - thePort->label_font_ext->max_logical_extent.width/2) ! / XmbTextEscapement (thePort->label_font_set, "#", 1)); ! txtwid = txtlen * XmbTextEscapement (thePort->label_font_set, "#", 1); buf[txtlen] = 0; while (txtlen) buf[txtlen--] = '#'; ptr = buf; } ! XmbDrawImageString (thePort->dpy, thePort->window, ! thePort->label_font_set, thePort->label_standout_gc, x + (wid - txtwid) / 2, ! win->win_down ! - (thePort->label_font_ext->max_logical_extent.height + thePort->label_font_ext->max_logical_extent.y), ptr, strlen (ptr)); x += wid; } *************** *** 2170,2189 **** int ipos = thePort->input_view.info_pos; int top = ipos + (scr_lines - input_rows) / info_rows - 1; int ypos; ! XTextItem text; if (top >= thePort->input_view.current_info->len) top = thePort->input_view.current_info->len - 1; ypos = input_rows; ! text.font = thePort->text_line_font->fid; while (ipos <= top) { text.chars = thePort->input_view.current_info->text[ipos]; text.nchars = strlen (text.chars); draw_text_item (thePort, 0, ypos, scr_cols, input_rows, ! thePort->text_line_font, thePort->text_line_gc, &text, 0); ypos += info_rows; ++ipos; --- 2386,2405 ---- int ipos = thePort->input_view.info_pos; int top = ipos + (scr_lines - input_rows) / info_rows - 1; int ypos; ! XmbTextItem text; if (top >= thePort->input_view.current_info->len) top = thePort->input_view.current_info->len - 1; ypos = input_rows; ! text.font_set = thePort->text_line_font_set; while (ipos <= top) { text.chars = thePort->input_view.current_info->text[ipos]; text.nchars = strlen (text.chars); draw_text_item (thePort, 0, ypos, scr_cols, input_rows, ! thePort->text_line_font_set, thePort->text_line_font_ext,thePort->text_line_gc, &text, 0); ypos += info_rows; ++ipos; *************** *** 2291,2311 **** #ifdef __STDC__ ! static XFontStruct * reasonable_font (Xport port, char *name) #else ! static XFontStruct * reasonable_font (port, name) Xport port; char *name; #endif { ! XFontStruct *f = XLoadQueryFont (port->dpy, name); if (!f) { printf("(warning) Font %s could not be loaded.\n", name); ! f = XLoadQueryFont (port->dpy, default_font_name); if (!f) { panic ("Default font %s could not be loaded.\n", --- 2507,2530 ---- #ifdef __STDC__ ! static XFontSet reasonable_font (Xport port, char *name) #else ! static XFontSet reasonable_font (port, name) Xport port; char *name; #endif { ! char ** missing; ! int missingnum; ! char *def; ! XFontSet f = XCreateFontSet (port->dpy, name,&missing,&missingnum,&def); if (!f) { printf("(warning) Font %s could not be loaded.\n", name); ! f = XCreateFontSet (port->dpy, default_font_name,&missing,&missingnum,&def); if (!f) { panic ("Default font %s could not be loaded.\n", *************** *** 2326,2331 **** --- 2545,2554 ---- { XGCValues gcv; XWMHints wmhints; + XVaNestedList preedit_list,status_list; + XRectangle area; + XIMStyles *im_supported_styles; + XIMStyle app_supported_styles,style; thePort = (Xport) ck_malloc (sizeof (*thePort)); thePort->cursor_visible = 1; *************** *** 2411,2473 **** XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), (GCForeground | GCBackground), &gcv); ! thePort->input_font = reasonable_font (thePort, input_font_name); ! gcv.font = thePort->input_font->fid; gcv.foreground = thePort->fg_color_pixel; gcv.background = thePort->bg_color_pixel; thePort->input_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground | GCFont), &gcv); gcv.foreground = thePort->bg_color_pixel; gcv.background = thePort->fg_color_pixel; thePort->standout_input_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground | GCFont), &gcv); gcv.foreground = thePort->fg_color_pixel; gcv.background = thePort->bg_color_pixel; ! thePort->status_font = reasonable_font (thePort, status_font_name); ! gcv.font = thePort->status_font->fid; thePort->status_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground | GCFont), &gcv); ! thePort->label_font = reasonable_font (thePort, label_font_name); ! gcv.font = thePort->label_font->fid; gcv.cap_style = CapRound; thePort->label_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground | GCFont | GCCapStyle), &gcv); gcv.background = thePort->fg_color_pixel; gcv.foreground = thePort->bg_color_pixel; thePort->label_standout_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground | GCFont | GCCapStyle), &gcv); gcv.background = thePort->bg_color_pixel; gcv.foreground = thePort->fg_color_pixel; ! thePort->text_line_font = reasonable_font (thePort, text_line_font_name); ! gcv.font = thePort->text_line_font->fid; thePort->text_line_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground | GCFont), &gcv); ! info_rows = (thePort->text_line_font->max_bounds.ascent ! + thePort->text_line_font->max_bounds.descent); gcv.background = thePort->fg_color_pixel; gcv.foreground = thePort->bg_color_pixel; thePort->text_line_standout_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground | GCFont), &gcv); gcv.background = thePort->fg_color_pixel; gcv.foreground = thePort->bg_color_pixel; thePort->text_line_standout_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground | GCFont), &gcv); gcv.background = thePort->bg_color_pixel; gcv.foreground = thePort->fg_color_pixel; --- 2634,2700 ---- XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), (GCForeground | GCBackground), &gcv); ! thePort->input_font_set = reasonable_font (thePort, input_font_name); ! thePort->input_font_ext = XExtentsOfFontSet( thePort->input_font_set ); ! ! /* gcv.font = thePort->input_font->fid; */ gcv.foreground = thePort->fg_color_pixel; gcv.background = thePort->bg_color_pixel; thePort->input_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground ), &gcv); gcv.foreground = thePort->bg_color_pixel; gcv.background = thePort->fg_color_pixel; thePort->standout_input_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground ), &gcv); gcv.foreground = thePort->fg_color_pixel; gcv.background = thePort->bg_color_pixel; ! thePort->status_font_set = reasonable_font (thePort, status_font_name); ! thePort->status_font_ext = XExtentsOfFontSet( thePort->status_font_set ); ! /* gcv.font = thePort->status_font->fid; */ thePort->status_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground ), &gcv); ! thePort->label_font_set = reasonable_font (thePort, label_font_name); ! thePort->label_font_ext = XExtentsOfFontSet( thePort->label_font_set ); ! /* gcv.font = thePort->label_font->fid; */ gcv.cap_style = CapRound; thePort->label_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground | GCCapStyle), &gcv); gcv.background = thePort->fg_color_pixel; gcv.foreground = thePort->bg_color_pixel; thePort->label_standout_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground | GCCapStyle), &gcv); gcv.background = thePort->bg_color_pixel; gcv.foreground = thePort->fg_color_pixel; ! thePort->text_line_font_set = reasonable_font (thePort, text_line_font_name); ! thePort->text_line_font_ext = XExtentsOfFontSet( thePort->text_line_font_set ); ! /* gcv.font = thePort->text_line_font->fid;*/ thePort->text_line_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground ), &gcv); ! info_rows = thePort->text_line_font_ext->max_logical_extent.height; gcv.background = thePort->fg_color_pixel; gcv.foreground = thePort->bg_color_pixel; thePort->text_line_standout_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground ), &gcv); gcv.background = thePort->fg_color_pixel; gcv.foreground = thePort->bg_color_pixel; thePort->text_line_standout_gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), ! (GCForeground | GCBackground ), &gcv); gcv.background = thePort->bg_color_pixel; gcv.foreground = thePort->fg_color_pixel; *************** *** 2479,2485 **** struct cell_gc *cg = (struct cell_gc *) ck_malloc (sizeof (struct cell_gc)); cg->font_name = 0; ! cg->font = 0; cg->clipped_to = 0; cg->cursor = 0; cg->gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), --- 2706,2712 ---- struct cell_gc *cg = (struct cell_gc *) ck_malloc (sizeof (struct cell_gc)); cg->font_name = 0; ! cg->font_set = 0; cg->clipped_to = 0; cg->cursor = 0; cg->gc = XCreateGC (thePort->dpy, DefaultRootWindow (thePort->dpy), *************** *** 2500,2521 **** } } XSelectInput (thePort->dpy, thePort->window, (ExposureMask | StructureNotifyMask | KeyPressMask | ButtonPressMask)); ! io_init_windows (geom_h, geom_w, 1, 2, ! thePort->input_font->ascent + thePort->input_font->descent, ! (thePort->status_font->ascent ! + thePort->status_font->descent), ! thePort->label_font->ascent + thePort->label_font->descent, ! thePort->label_font->max_bounds.width); x11_opened = 1; { struct cell_gc *cgc = cell_gc (thePort, default_font(), 0); ! height_scale = cgc->font->ascent + cgc->font->descent; ! width_scale = XTextWidth (cgc->font, "M", 1); } /* Setup the arrow keys. Modifiers effect the last character --- 2727,2894 ---- } } + /* open IM,IC */ + if ((im = XOpenIM(theDisplay,NULL,NULL,NULL)) == NULL ) { + panic("Couldn't open input methid."); + } + /* 入力型を設定する */ + app_supported_styles = XIMPreeditNone | XIMStatusNone; + #define DISABLE_ON + #if !defined(DISABLE_ON) + app_supported_styles |= XIMPreeditCallbacks|XIMStatusCallbacks; + #endif + #if !defined(DISABLE_OVER) + app_supported_styles |= XIMPreeditPosition|XIMStatusArea; + #endif + #if !defined(DISABLE_OFF) + app_supported_styles |= XIMPreeditArea|XIMStatusArea; + #endif + #if !defined(DISABLE_ROOT) + app_supported_styles |= XIMPreeditNothing|XIMStatusNothing; + #endif + + /* IM が扱える入力型 */ + XGetIMValues(im, XNQueryInputStyle, &im_supported_styles, NULL); + + /* 最良のものを選択する */ + { + int i; + + thePort->im_input_style = 0; + for(i=0; i < im_supported_styles->count_styles; i++) { + style = im_supported_styles->supported_styles[i]; + if ((style & app_supported_styles) == style) /* 処理できれば */ + thePort->im_input_style = ChooseBetterStyle(style, thePort->im_input_style); + } + } + + /* 使える入力型がなければエラーを表示して終了する */ + if (thePort->im_input_style == 0) { + (void)fprintf(stderr, "oleo: application and program do not share a\n"); + (void)fprintf(stderr, "oleo: commonly supported interaction style.\n"); + exit(0); + } + + /* IC を作成する */ + thePort->spotlocation.x = thePort->spotlocation.y = 0; + thePort->preeditstartcallback.client_data = NULL; + thePort->preeditstartcallback.callback = (XIMProc)PreeditStartCallback; + + thePort->preeditdonecallback.client_data = NULL; + thePort->preeditdonecallback.callback = (XIMProc)PreeditDoneCallback; + + thePort->preeditdrawcallback.client_data = NULL; + thePort->preeditdrawcallback.callback = (XIMProc)PreeditDrawCallback; + + thePort->preeditcaretcallback.client_data = NULL; + thePort->preeditcaretcallback.callback = (XIMProc)PreeditCaretCallback; + + thePort->statusstartcallback.client_data = NULL; + thePort->statusstartcallback.callback = (XIMProc)StatusStartCallback; + + thePort->statusdonecallback.client_data = NULL; + thePort->statusdonecallback.callback = (XIMProc)StatusDoneCallback; + + thePort->statusdrawcallback.client_data = NULL; + thePort->statusdrawcallback.callback = (XIMProc)StatusDrawCallback; + + preedit_list = XVaCreateNestedList(0,XNFontSet,thePort->input_font_set + /* + ,XNArea, &thePort->ic_preedit_area + */ + ,XNSpotLocation,&thePort->spotlocation + ,XNPreeditStartCallback,&thePort->preeditstartcallback + ,XNPreeditDrawCallback ,&thePort->preeditdrawcallback + ,XNPreeditDoneCallback ,&thePort->preeditdonecallback + ,XNPreeditCaretCallback,&thePort->preeditcaretcallback + ,NULL); + status_list = XVaCreateNestedList(0,XNFontSet,thePort->status_font_set + /* + ,XNArea, &thePort->ic_status_area + */ + ,XNStatusStartCallback,&thePort->statusstartcallback + ,XNStatusDrawCallback ,&thePort->statusdrawcallback + ,XNStatusDoneCallback ,&thePort->statusdonecallback + ,NULL); + + thePort->geometrycallback.client_data = NULL; + thePort->preeditstartcallback.callback = (XIMProc)GeometryCallback; + + ic = XCreateIC(im,XNInputStyle, thePort->im_input_style, + XNClientWindow, thePort->window, + XNFocusWindow, thePort->window, + XNPreeditAttributes, preedit_list, + XNStatusAttributes, status_list, + XNGeometryCallback, &thePort->geometrycallback, + NULL); + XFree(preedit_list); + XFree(status_list); + if ( ic == NULL ) { + fprintf(stderr,"IC:%x\n",thePort->im_input_style); + panic("Couldn't create IC\n"); + } + + /* Status 領域の調整 */ + if(thePort->im_input_style & XIMStatusArea && + thePort->im_input_style & XIMPreeditArea) { + /* 一番下に前編集エリアと一緒に確保する */ + thePort->ic_status_area.x = 0; + thePort->ic_status_area.y = 0; + thePort->ic_status_area.width = XIC_STATUS_AREA_DEFAULT; + thePort->ic_status_area.height = thePort->status_font_ext->max_logical_extent.height; + GetPreferredGeometry(ic, XNStatusAttributes, &thePort->ic_status_area); + + thePort->ic_preedit_area.x = thePort->ic_status_area.width; + thePort->ic_preedit_area.y = 0; + thePort->ic_preedit_area.width = geom_w - thePort->ic_status_area.width; + thePort->ic_preedit_area.height = thePort->input_font_ext->max_logical_extent.height; + GetPreferredGeometry(ic, XNPreeditAttributes, &thePort->ic_preedit_area); + convert_h = MAX(thePort->ic_status_area.height,thePort->ic_preedit_area.height); + thePort->ic_status_area.x = 0; + thePort->ic_preedit_area.x = thePort->ic_status_area.width; + thePort->ic_preedit_area.height = thePort->ic_preedit_area.height = convert_h; + thePort->ic_preedit_area.y = thePort->ic_status_area.y = geom_h - convert_h; + SetGeometry(ic, XNStatusAttributes, &thePort->ic_status_area); + SetGeometry(ic, XNPreeditAttributes, &thePort->ic_preedit_area); + } else { + /* Status 行に確保する */ + thePort->ic_status_area.x = 0; + thePort->ic_status_area.y = status; + thePort->ic_status_area.width = XIC_STATUS_AREA_DEFAULT; + thePort->ic_status_area.height = status_rows; + GetPreferredGeometry(ic, XNStatusAttributes, &thePort->ic_status_area); + /* + if( thePort->ic_status_area.width > pendingw) { + thePort->ic_status_area.width = pendingw; + status_rows = pendingw; + } + */ + thePort->ic_status_area.x = 0; + thePort->ic_status_area.y = status; + SetGeometry(ic, XNStatusAttributes, &thePort->ic_status_area); + /* ステータス行の高さを合わせる */ + if( status_rows < thePort->ic_status_area.height ) { + status_rows = thePort->ic_status_area.height; + } + } + XSelectInput (thePort->dpy, thePort->window, (ExposureMask | StructureNotifyMask | KeyPressMask | ButtonPressMask)); ! XSetICFocus(ic); ! ! io_init_windows (geom_h - convert_h, geom_w, 1, 2, ! thePort->input_font_ext->max_logical_extent.height, ! thePort->status_font_ext->max_logical_extent.height, ! thePort->label_font_ext->max_logical_extent.height, ! thePort->label_font_ext->max_logical_extent.width); x11_opened = 1; { struct cell_gc *cgc = cell_gc (thePort, default_font(), 0); ! height_scale = cgc->font_ext->max_logical_extent.height; ! width_scale = XmbTextEscapement (cgc->font_set, "M", 1); } /* Setup the arrow keys. Modifiers effect the last character *************** *** 2548,2553 **** --- 2921,2927 ---- static KeySym arrows[] = {XK_Up, XK_Down, XK_Right, XK_Left}; int arrow; + #if !defined(DISAVLE_CURSOR) for (arrow = 0; arrow < 4; ++arrow) { int mod; *************** *** 2562,2567 **** --- 2936,2942 ---- string, strlen(string)); } } + #endif } XMapWindow (thePort->dpy, thePort->window); *************** *** 2656,2668 **** cell_font_point_size = l; { struct cell_gc *cgc = cell_gc (thePort, default_font(), 0); ! height_scale = cgc->font->ascent + cgc->font->descent; ! width_scale = cgc->font->max_bounds.width; } io_set_scr_size (scr_lines, scr_cols); } } ! #endif /* HAVE_X11_X_H */ --- 3031,3283 ---- cell_font_point_size = l; { struct cell_gc *cgc = cell_gc (thePort, default_font(), 0); ! height_scale = cgc->font_ext->max_logical_extent.height; ! width_scale = cgc->font_ext->max_logical_extent.width/2; } io_set_scr_size (scr_lines, scr_cols); } } + /* Call Backs */ ! /* OFF THE SPOT */ ! /* ! * この手続きは、アプリケーションのサイズ制限を設定して、 ! * name 引数の値の応じて IM が望む前編集のあるいは状態表示領域のサイズを返す。 ! * area 引数は、制限を渡し望みのサイズを得るために使用する。 ! */ ! #ifdef __STDC__ ! void ! GetPreferredGeometry(XIC ic,char *name, XRectangle *area) ! #else ! void ! GetPreferredGeometry(ic,name,area) ! XIC ic; ! char *name; /* XNPreeditAttributes または XNStatusAttributes */ ! XRectangle *area; /* 領域のコンストレイント */ ! #endif ! { ! XVaNestedList list; ! ! list = XVaCreateNestedList(0, XNAreaNeeded, area, NULL); ! ! /* コンストレイントを設定 */ ! XSetICValues(ic, XNStatusAttributes, list, NULL); ! ! /* 望むサイズを問い合わせる */ ! XGetICValues(ic, XNStatusAttributes, list, NULL); ! XFree(list); ! } ! ! #ifdef __STDC__ ! void ! SetGeometry(XIC ic, char *name, XRectangle *area) ! #else ! void ! SetGeometry(ic, name, area) ! XIC ic; ! char *name; ! XRectangle *area; ! #endif ! { ! XVaNestedList list; ! ! list = XVaCreateNestedList(0, XNArea, area, NULL); ! XSetICValues(ic, name, list, NULL); ! XFree(list); ! } ! ! /* ! * この関数は、2つの対話型から「より好ましい」ものを選択する。 ! * より複雑な前編集対話型を返す。 ! * 同じ前編集対話型の場合には、より複雑な状態表示入力を返す。 ! * 対話型を順序づける「公式」な方法はないが、 ! * これは合理的なものであろう。 ! * 簡単な発見的手法にしては、この手続きは長い。 ! */ ! ! XIMStyle ! ChooseBetterStyle(XIMStyle style1, XIMStyle style2) ! { ! XIMStyle s,t; ! XIMStyle preedit = XIMPreeditArea | XIMPreeditCallbacks | ! XIMPreeditPosition | XIMPreeditNothing | XIMPreeditNone; ! XIMStyle status = XIMStatusArea | XIMStatusCallbacks | ! XIMStatusNothing | XIMStatusNone; ! ! if (style1 == 0 ) return style2; ! if (style2 == 0 ) return style1; ! if (( style1 & (preedit | status)) == (style2 & (preedit | status))) ! return style1; ! ! s = style1 & preedit; ! t = style2 & preedit; ! if ( s != t ) { ! if ( s | t | XIMPreeditCallbacks ) ! return ( s == XIMPreeditCallbacks )?style1:style2; ! else if ( s | t | XIMPreeditPosition ) ! return ( s == XIMPreeditPosition )?style1:style2; ! else if ( s | t | XIMPreeditArea ) ! return ( s == XIMPreeditArea )?style1:style2; ! else if ( s | t | XIMPreeditNothing ) ! return ( s == XIMPreeditNothing )?style1:style2; ! } else { /* 前編集フラグが同じ場合には、状態表示フラグを比較する。 */ ! s = style1 & status; ! t = style2 & status; ! if ( s | t | XIMStatusCallbacks ) ! return ( s == XIMStatusCallbacks )?style1:style2; ! else if ( s | t | XIMStatusArea ) ! return ( s == XIMStatusArea )?style1:style2; ! else if ( s | t | XIMStatusNothing ) ! return ( s == XIMStatusNothing )?style1:style2; ! } ! } ! ! #ifdef __STDC__ ! void ! GeometryCallback(XIC ic, XPointer client_data, XPointer call_data) ! #else ! void ! GeometryCallback(ic, client_data, call_data) ! XIC ic; ! XPointer client_data; ! XPointer call_data; ! #endif ! { ! XRectangle area; ! ! fprintf(stderr,"%d:\n",__LINE__); ! if (thePort->im_input_style & XIMPreeditArea) { ! GetPreferredGeometry(ic, XNPreeditAttributes, &thePort->ic_preedit_area); ! SetGeometry(ic, XNPreeditAttributes, &thePort->ic_preedit_area); ! } ! if ( thePort->im_input_style & XIMStatusArea) { ! GetPreferredGeometry(ic, XNStatusAttributes, &thePort->ic_status_area); ! SetGeometry(ic, XNStatusAttributes, &thePort->ic_status_area); ! } ! } ! ! #ifdef __STDC__ ! int ! PreeditStartCallback(XIC ic, XPointer client_data, XPointer call_data) ! #else ! int ! PreeditStartCallback(ic, client_data, call_data) ! XIC ic; ! XPointer client_data; ! XPointer call_data; ! #endif ! { ! fprintf(stderr,"%d:\n",__LINE__); ! return 10; ! } ! ! #ifdef __STDC__ ! void ! PreeditDoneCallback(XIC ic, XPointer client_data, XPointer call_data) ! #else ! void ! PreeditDoneCallback(ic, client_data, call_data) ! XIC ic; ! XPointer client_data; ! XPointer call_data; ! #endif ! { ! fprintf(stderr,"%d:\n",__LINE__); ! } ! ! #ifdef __STDC__ ! void ! PreeditDrawCallback(XIC ic, XPointer client_data, XPointer call_data) ! #else ! void ! PreeditDrawCallback(ic, client_data, call_data) ! XIC ic; ! XPointer client_data; ! XPointer call_data; ! #endif ! { ! fprintf(stderr,"%d:\n",__LINE__); ! } ! ! #ifdef __STDC__ ! void ! PreeditCaretCallback(XIC ic, XPointer client_data, XPointer call_data) ! #else ! void ! PreeditCaretCallback(ic, client_data, call_data) ! XIC ic; ! XPointer client_data; ! XPointer call_data; ! #endif ! { ! fprintf(stderr,"%d:\n",__LINE__); ! } ! ! #ifdef __STDC__ ! void ! StatusStartCallback(XIC ic, XPointer client_data, XPointer call_data) ! #else ! void ! StatusStartCallback(ic, client_data, call_data) ! XIC ic; ! XPointer client_data; ! XPointer call_data; ! #endif ! { ! fprintf(stderr,"%d:\n",__LINE__); ! } ! ! #ifdef __STDC__ ! void ! StatusDoneCallback(XIC ic, XPointer client_data, XPointer call_data) ! #else ! void ! StatusDoneCallback(ic, client_data, call_data) ! XIC ic; ! XPointer client_data; ! XPointer call_data; ! #endif ! { ! fprintf(stderr,"%d:\n",__LINE__); ! } ! ! #ifdef __STDC__ ! void ! StatusDrawCallback(XIC ic, XPointer client_data, XPointer call_data) ! #else ! void ! StatusDrawCallback(ic, client_data, call_data) ! XIC ic; ! XPointer client_data; ! XPointer call_data; ! #endif ! { ! fprintf(stderr,"%d:\n",__LINE__); ! } + /* + * XIMPreeditPosition のとき IM の位置を設定する。 + */ + #ifdef __STDC__ + void SetPreeditPosition(int xpos) + #else + void + SetPreeditPosition(xpos) + int xpos; + #endif + { + XVaNestedList list; + + if(!(thePort->im_input_style & XIMPreeditPosition)) { + return; + } + + thePort->spotlocation.x = xpos; + thePort->spotlocation.y = input-thePort->input_font_ext->max_logical_extent.y ; + list = XVaCreateNestedList(0,XNSpotLocation,&thePort->spotlocation,NULL); + XSetICValues(ic,XNPreeditAttributes,list,NULL); + XFree(list); + } + + #endif /* HAVE_X11_X_H */ diff --recursive --context --minimal --new-file oleo-1.6/let.c oleo-1.6jb2/let.c *** oleo-1.6/let.c Thu Jan 1 09:00:00 1970 --- oleo-1.6jb2/let.c Fri Nov 8 01:11:56 1996 *************** *** 0 **** --- 1,96 ---- + /* Copyright (C) 1992, 1993 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + /* このファイルは林田が、コマンドの追加のテストのために作成しました。 */ + + #include "cell.h" + #include "byte-compile.h" + #include "let.h" + + + /* struct value に関しては同じ定義があちこちの *.c に入っている */ + /* .h を作れよ */ + + struct value + { + int type; + union vals x; + }; + + #define Float x.c_d + #define String x.c_s + #define Int x.c_l + #define Value x.c_i + #define Rng x.c_r + + #ifdef __STDC__ + struct value * eval_expression (unsigned char *expr); + #else + struct value * eval_expression (); + #endif + + /* + * This set to cell the value of expression + */ + + /* + * M-x let [Cell] [Expression] + * Expression の式を評価して、その値を Cell で指定されたセルに書き込む + * {let R1C1 R1C1+1} で R1C1 の値を +1 できる + */ + void + do_let(struct rng * r,char *exp) + { + unsigned char *p; + struct value * v; + extern CELL *my_cell; + char buf[256]; + struct ref_to *ref,*ref2; + + if(r->lr != r->hr || r->lc != r->hc) { + /* rng != cell */ + return; + } + + #ifdef TEST + if (!exp) + { + io_error_msg ("Null string to set_cell %s", cell_name (r->lr, r->lc)); + return; + } + #endif + while (*exp == ' ') + exp++; + + if (!*exp) + { + my_cell = find_cell (r->lr, r->lc); + if (!my_cell) + return; + flush_old_value (); + return; + } + my_cell = find_or_make_cell (r->lr, r->lc); + + p = parse_and_compile(exp); + v = eval_expression(p); + + my_cell->cell_formula = p; + flush_old_value (); + SET_TYP(my_cell,v->type); + my_cell->c_z = v->x; + io_pr_cell (r->lr, r->lc, my_cell); + } diff --recursive --context --minimal --new-file oleo-1.6/let.h oleo-1.6jb2/let.h *** oleo-1.6/let.h Thu Jan 1 09:00:00 1970 --- oleo-1.6jb2/let.h Wed Oct 16 23:58:57 1996 *************** *** 0 **** --- 1,32 ---- + #ifndef LETH + #define LETH + + /* Copyright (C) 1992, 1993 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + /* t. lord Sat Sep 12 13:46:16 1992 */ + + + + #ifdef __STDC__ + extern void do_let(struct rng *,char *); + + #else + extern void do_let(); + + #endif + + + #endif diff --recursive --context --minimal --new-file oleo-1.6/line.c oleo-1.6jb2/line.c *** oleo-1.6/line.c Sat Jun 4 01:20:12 1994 --- oleo-1.6jb2/line.c Wed Nov 6 01:07:41 1996 *************** *** 23,33 **** --- 23,48 ---- len++; line->alloc = len + 1; if (line->buf) + #if defined(EUC_JP) + { + line->buf = ck_realloc (line->buf, line->alloc); + line->attr = ck_realloc (line->attr, line->alloc); + } + else + { + line->buf = ck_malloc (line->alloc); + line->attr = ck_malloc (line->alloc); + } + #else line->buf = ck_realloc (line->buf, line->alloc); else line->buf = ck_malloc (line->alloc); + #endif /* EUC_JP */ } strcpy (line->buf, string); + #if defined(EUC_JP) + makeattr(line); + #endif /* EUC_JP */ } #ifdef __STDC__ *************** *** 50,58 **** --- 65,79 ---- len++; line->alloc = len; line->buf = ck_remalloc (line->buf, line->alloc); + #if defined(EUC_JP) + line->attr = ck_remalloc (line->attr, line->alloc); + #endif /* EUC_JP */ } bcopy (string, line->buf, n); line->buf[n] = 0; + #if defined(EUC_JP) + makeattr(line); + #endif /* EUC_JP */ } #define Max(A,B) ((A) > (B) ? (A) : (B)) *************** *** 73,82 **** --- 94,109 ---- { line->alloc = Max (len + n + 1, LINE_MIN); line->buf = ck_remalloc (line->buf, line->alloc); + #if defined(EUC_JP) + line->attr = ck_remalloc (line->attr, line->alloc); + #endif /* EUC_JP */ } if (n) bcopy (string, line->buf + len, n); line->buf[len + n] = '\0'; + #if defined(EUC_JP) + makeattr(line); + #endif /* EUC_JP */ } *************** *** 98,113 **** --- 125,149 ---- if (!line->alloc) { line->buf = ck_malloc (len); + #if defined(EUC_JP) + line->attr = ck_malloc (len); + #endif /* EUC_JP */ line->alloc = len; } else if (line->alloc < len) { line->buf = ck_realloc (line->buf, len); + #if defined(EUC_JP) + line->attr = ck_realloc (line->attr, len); + #endif /* EUC_JP */ line->alloc = len; } var_start (iggy, fmt); vsprintf (line->buf, fmt, iggy); va_end (iggy); + #if defined(EUC_JP) + makeattr(line); + #endif /* EUC_JP */ } #ifdef __STDC__ *************** *** 128,133 **** --- 164,172 ---- { line->alloc = len; line->buf = ck_remalloc (line->buf, len + 1); + #if defined(EUC_JP) + line->attr = ck_remalloc (line->attr, len + 1); + #endif /* EUC_JP */ } line->buf[len--] = '\0'; --old_len; *************** *** 139,144 **** --- 178,186 ---- } while (n--) line->buf[pos + n] = str[n]; + #if defined(EUC_JP) + makeattr(line); + #endif /* EUC_JP */ } #ifdef __STDC__ *************** *** 160,165 **** --- 202,210 ---- ++begin; } line->buf[begin] = '\0'; + #if defined(EUC_JP) + makeattr(line); + #endif /* EUC_JP */ } *************** *** 173,180 **** --- 218,235 ---- #endif { if (line->buf && line->alloc) + #if defined(EUC_JP) + { + free (line->buf); + free (line->attr); + } + #else free (line->buf); + #endif /* EUC_JP */ line->buf = 0; + #if defined(EUC_JP) + line->attr = 0; + #endif /* EUC_JP */ line->alloc = 0; } *************** *** 201,206 **** --- 256,264 ---- { line->alloc = (line->alloc ? line->alloc * 2 : 1); line->buf = ck_remalloc (line->buf, line->alloc); + #if defined(EUC_JP) + line->attr = ck_remalloc (line->attr, line->alloc); + #endif /* EUC_JP */ } if (c != '\\') line->buf[pos++] = c; *************** *** 222,229 **** --- 280,293 ---- { ++line->alloc; line->buf = ck_remalloc (line->buf, line->alloc); + #if defined(EUC_JP) + line->attr = ck_remalloc (line->attr, line->alloc); + #endif /* EUC_JP */ } line->buf[pos] = 0; + #if defined(EUC_JP) + makeattr(line); + #endif /* EUC_JP */ if (line->buf[0] || (c != EOF)) { ++*linec; diff --recursive --context --minimal --new-file oleo-1.6/line.h oleo-1.6jb2/line.h *** oleo-1.6/line.h Sat Jun 4 01:20:14 1994 --- oleo-1.6jb2/line.h Wed Jan 22 21:33:24 1997 *************** *** 19,28 **** --- 19,42 ---- #define LINE_MIN 28 + #if defined(EUC_JP) + #define _ATR1ST (1) /* 1st Byte of EUC */ + #define _ATR2ND (2) /* 2nd Byte of EUC */ + #define _ATRWORD (4) /* start of word */ + #define _ATRGRP (8) /* JIS KIGOU */ + #define _ATRALPHA (16) /* JIS ALPHA */ + #define _ATRHIRA (32) /* JIS HIRAGANA */ + #define _ATRKANA (64) /* JIS KATAKANA */ + #define _ATRKANJI (128) /* JIS KANJI */ + #endif /* EUC_JP */ + struct line { int alloc; char *buf; + #if defined(EUC_JP) + unsigned char *attr; + #endif /* EUC_JP */ }; #define init_line(L) bzero((L), sizeof (struct line)) diff --recursive --context --minimal --new-file oleo-1.6/makeattr.c oleo-1.6jb2/makeattr.c *** oleo-1.6/makeattr.c Thu Jan 1 09:00:00 1970 --- oleo-1.6jb2/makeattr.c Mon Feb 3 21:42:07 1997 *************** *** 0 **** --- 1,261 ---- + /* Copyright (C) 1996, 1997 Hayashida Kuniaki. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + */ + + + + #include + #include "line.h" + + /* + * 語の切り方は、mule のそれを参考にしている。 + */ + + enum kflags { + F_Asc, + F_1st, + F_2nd + }; + + enum char_type { + Mnon, /* 未定義 */ + Mspace, /* 1バイト空白,2バイト空白、タブ、改行など */ + Scntrl, /* 1バイト コントロール、非表示キャラクタ。存在しないはず */ + Salnum, /* 1バイト 英字 */ + Spunct, /* 1バイト 記号 */ + Dpunct, /* 2バイト 記号。漢字コードの区点が 1, 2, 8区のもの */ + Dalnum, /* 2バイト 英数字。漢字コードの区点が 3区のもの */ + Dhiragana,/* 2バイト ひらがな。漢字コードの区点が 4区のもの、および "ー", "゛", "゜" */ + Dkatakana,/* 2バイト カタカナ。漢字コードの区点が 5区のもの、および "ー", "゛", "゜"。*/ + Dgreek, /* 2バイト ギリシャ文字。漢字コードの区点が 6区のもの */ + Dcylil, /* 2バイト キリル文字。漢字コードの区点が 7区のもの。*/ + Dkanji /* 2バイト 漢字。*/ + }; + + char * special_kanji_char[] = { + "ヽ", + "ヾ", + "ゝ", + "ゞ", + "〃", + "仝", + "々", + "〆", + "〇", + NULL + }; + + char * special_kana_char[] = { + "ー", + "゛", + "゜", + "。", + NULL + }; + + enum char_type checkword(unsigned char *,enum char_type,enum char_type); + enum char_type getctyp(enum char_type ,int ); + enum char_type getctyp2(enum char_type ,int ,int ); + /* + * 文字属性設定ルーチン + * line.buf に格納された文字列に対し、line.atr に属性情報を作成する。 + */ + + #if defined(EUC_JP) + void + makeattr(struct line *l) + { + char *p; /* buf をなめるためのポインタ */ + unsigned char *atr; /* */ + unsigned char a; + int ch; /* buf から文字を取り出す */ + int ch1st; /* 2バイトコードの1バイト目 */ + enum kflags kflag = F_Asc; + enum char_type wtyp = Mnon; + enum char_type ctyp; + + p = l->buf; + atr = l->attr; + + while( (ch = (unsigned char)*p++) ){ + a = 0; + if( ch > 0xa0 && ch < 0xff ) { + if( kflag == F_1st) { + kflag = F_2nd; + a &= ~_ATR1ST; + a |= _ATR2ND; + } else { + ch1st = ch; + kflag = F_1st; + a |= _ATR1ST; + a &= ~_ATR2ND; + } + } else { + kflag = F_Asc; + a &= ~(_ATR1ST | _ATR2ND); + } + *atr = a; + /* 語の検査 */ + switch(kflag) { + case F_Asc: + ctyp = getctyp(wtyp,ch); + wtyp = checkword(atr,wtyp,ctyp); + break; + case F_2nd: + ctyp = getctyp2(wtyp,ch1st,ch); + #if 0 + { + FILE *fp; + fp = fopen("a.txt","a"); + fprintf(fp,"%d %d\n",wtyp,ctyp); + fclose(fp); + } + #endif + wtyp = checkword(atr,wtyp,ctyp); + break; + case F_1st: + default: + break; + } + /* atr を進める */ + atr++; + } + } + + /* 語の検査 */ + enum char_type + checkword(unsigned char *atr,enum char_type wtyp,enum char_type ctyp) + { + if( wtyp == Mnon ) { + *atr |= _ATRWORD; + return ctyp; + } + switch(ctyp) { + default: + /* 1バイトコードで Dxxx はこない */ + case Mnon: + case Scntrl: + /* こないはず */ + case Spunct: + *atr |= _ATRWORD; + wtyp = ctyp; + break; + case Mspace: + /* 空白の終りまで語とする */ + wtyp = Mspace; + break; + case Salnum: + if(ctyp != wtyp) { + /* 文字の種類が代われば語 */ + *atr |= _ATRWORD; + wtyp = ctyp; + } + break; + case Dpunct: + *atr |= _ATRWORD; + wtyp = ctyp; + break; + case Dhiragana: + if(wtyp == Dalnum + || wtyp == Dhiragana + || wtyp == Dkatakana + || wtyp == Dgreek + || wtyp == Dcylil + || wtyp == Dkanji ) { + /* 終りまで語とする */ + wtyp = ctyp; + } else { + *atr |= _ATRWORD; + wtyp = ctyp; + } + break; + case Dalnum: + case Dkatakana: + case Dgreek: + case Dcylil: + case Dkanji: + if(ctyp != wtyp) { + *atr |= _ATRWORD; + wtyp = ctyp; + } + break; + } + return wtyp; + } + + enum char_type + getctyp(enum char_type wtyp,int ch) + { + if( isspace(ch) ) { + return Mspace; + } + if( iscntrl(ch) ) { + return Scntrl; + } + if( isalnum(ch) ) { + return Salnum; + } + return Spunct; + } + + enum char_type + getctyp2(enum char_type wtyp,int ch1,int ch2) + { + char **p; + + if( ch1 == 0xa1 ) { + if( ch2 == 0xa1 ) { + return Mspace; + } + for( p = special_kanji_char ; *p ; p++ ) { + if( (*p)[1] == ch2 ) { + return Dkanji; + } + } + for( p = special_kana_char ; *p ; p++ ) { + if( (*p)[1] == ch2 ) { + if( wtyp == Dkatakana ) { + return Dkatakana; + } + return Dhiragana; + } + } + return Dpunct; + } + if( ch1 == 0xa2 ) { + return Dpunct; + } + if( ch1 == 0xa3 ) { + return Dalnum; + } + if( ch1 == 0xa4 ) { + return Dhiragana; + } + if( ch1 == 0xa5 ) { + return Dkatakana; + } + if( ch1 == 0xa6 ) { + return Dcylil; + } + if( ch1 == 0xa7 ) { + return Dgreek; + } + if( ch1 == 0xa8 ) { + return Dpunct; + } + if( ch1 >= 0xb0 && ch1 <= 0xf4 ) { + return Dkanji; + } + return Dpunct; + } + #endif diff --recursive --context --minimal --new-file oleo-1.6/oleofile.c oleo-1.6jb2/oleofile.c *** oleo-1.6/oleofile.c Sat Jun 4 01:20:34 1994 --- oleo-1.6jb2/oleofile.c Wed Nov 6 00:28:30 1996 *************** *** 796,805 **** --- 796,814 ---- if (cp->cell_font->id_memo < 0) { cp->cell_font->id_memo = fnt_map_size++; + #if defined(EUC_JP) + fprintf (fp, "%%F%s,%s,%f,%s,%s\n", + cp->cell_font->names->x_name, + cp->cell_font->names->ps_name, + cp->cell_font->scale, + cp->cell_font->names->x_name2, + cp->cell_font->names->ps_name2); + #else fprintf (fp, "%%F%s,%s,%f\n", cp->cell_font->names->x_name, cp->cell_font->names->ps_name, cp->cell_font->scale); + #endif /* EUC_JP */ } } (void) fprintf (fp, "F;"); diff --recursive --context --minimal --new-file oleo-1.6/parse.tab.c oleo-1.6jb2/parse.tab.c *** oleo-1.6/parse.tab.c Sat Jun 4 15:11:51 1994 --- oleo-1.6jb2/parse.tab.c Thu Jan 1 09:00:00 1970 *************** *** 1,1935 **** - - /* A Bison parser, made from /phydeaux/ni/lord/unsupported/oleo/parse.y with Bison version GNU Bison version 1.22 - */ - - #define YYBISON 1 /* Identify Bison output. */ - - #define NE 258 - #define LE 259 - #define GE 260 - #define NEG 261 - #define L_CELL 262 - #define L_RANGE 263 - #define L_VAR 264 - #define L_CONST 265 - #define L_FN0 266 - #define L_FN1 267 - #define L_FN2 268 - #define L_FN3 269 - #define L_FN4 270 - #define L_FNN 271 - #define L_FN1R 272 - #define L_FN2R 273 - #define L_FN3R 274 - #define L_FN4R 275 - #define L_FNNR 276 - #define L_LE 277 - #define L_NE 278 - #define L_GE 279 - - #line 1 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - - /* Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc. - - This file is part of Oleo, the GNU Spreadsheet. - - Oleo is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - Oleo 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Oleo; see the file COPYING. If not, write to - the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - #line 41 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - - #include "funcdef.h" - - #include - - #define obstack_chunk_alloc ck_malloc - #define obstack_chunk_free free - #include "obstack.h" - #include "sysdef.h" - - #include "global.h" - #include "errors.h" - #include "node.h" - #include "eval.h" - #include "ref.h" - - int yylex (); - #ifdef __STDC__ - void yyerror (char *); - #else - void yyerror (); - #endif - VOIDSTAR parse_hash; - extern VOIDSTAR hash_find(); - - /* This table contains a list of the infix single-char functions */ - unsigned char fnin[] = { - SUM, DIFF, DIV, PROD, MOD, /* AND, OR, */ POW, EQUAL, IF, CONCAT, 0 - }; - - #define YYSTYPE _y_y_s_t_y_p_e - typedef struct node *YYSTYPE; - YYSTYPE parse_return; - #ifdef __STDC__ - YYSTYPE make_list (YYSTYPE, YYSTYPE); - #else - YYSTYPE make_list (); - #endif - - char *instr; - int parse_error = 0; - extern struct obstack tmp_mem; - - - #ifndef YYLTYPE - typedef - struct yyltype - { - int timestamp; - int first_line; - int first_column; - int last_line; - int last_column; - char *text; - } - yyltype; - - #define YYLTYPE yyltype - #endif - - #ifndef YYSTYPE - #define YYSTYPE int - #endif - #include - - #ifndef __cplusplus - #ifndef __STDC__ - #define const - #endif - #endif - - - - #define YYFINAL 131 - #define YYFLAG -32768 - #define YYNTBASE 41 - - #define YYTRANSLATE(x) ((unsigned)(x) <= 279 ? yytranslate[x] : 47) - - static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 19, 2, 2, 2, 16, 5, 2, 38, - 39, 14, 12, 40, 13, 2, 15, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 4, 2, 8, - 6, 10, 3, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 17, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 2, 7, 9, 11, - 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37 - }; - - #if YYDEBUG != 0 - static const short yyprhs[] = { 0, - 0, 2, 4, 6, 8, 12, 17, 24, 33, 44, - 49, 54, 59, 66, 73, 82, 91, 100, 109, 114, - 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, - 160, 164, 168, 172, 175, 178, 182, 186, 189, 191, - 195, 197, 199, 201, 205, 207 - }; - - static const short yyrhs[] = { 42, - 0, 1, 0, 23, 0, 46, 0, 24, 38, 39, - 0, 25, 38, 42, 39, 0, 26, 38, 42, 40, - 42, 39, 0, 27, 38, 42, 40, 42, 40, 42, - 39, 0, 28, 38, 42, 40, 42, 40, 42, 40, - 42, 39, 0, 29, 38, 43, 39, 0, 30, 38, - 21, 39, 0, 30, 38, 22, 39, 0, 31, 38, - 21, 40, 42, 39, 0, 31, 38, 22, 40, 42, - 39, 0, 31, 38, 21, 40, 42, 40, 42, 39, - 0, 31, 38, 22, 40, 42, 40, 42, 39, 0, - 32, 38, 21, 40, 42, 40, 42, 39, 0, 32, - 38, 22, 40, 42, 40, 42, 39, 0, 34, 38, - 45, 39, 0, 42, 3, 42, 4, 42, 0, 42, - 5, 42, 0, 42, 8, 42, 0, 42, 9, 42, - 0, 42, 6, 42, 0, 42, 7, 42, 0, 42, - 10, 42, 0, 42, 11, 42, 0, 42, 12, 42, - 0, 42, 13, 42, 0, 42, 14, 42, 0, 42, - 15, 42, 0, 42, 16, 42, 0, 42, 17, 42, - 0, 13, 42, 0, 19, 42, 0, 38, 42, 39, - 0, 38, 42, 1, 0, 38, 1, 0, 42, 0, - 43, 40, 42, 0, 21, 0, 42, 0, 44, 0, - 45, 40, 44, 0, 20, 0, 22, 0 - }; - - #endif - - #if YYDEBUG != 0 - static const short yyrline[] = { 0, - 86, 88, 94, 95, 96, 98, 102, 106, 110, 114, - 118, 121, 125, 129, 135, 142, 150, 154, 159, 163, - 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, - 214, 218, 222, 226, 241, 245, 247, 255, 262, 264, - 268, 269, 272, 274, 278, 280 - }; - - static const char * const yytname[] = { "$","error","$illegal.","'?'","':'", - "'&'","'='","NE","'<'","LE","'>'","GE","'+'","'-'","'*'","'/'","'%'","'^'","NEG", - "'!'","L_CELL","L_RANGE","L_VAR","L_CONST","L_FN0","L_FN1","L_FN2","L_FN3","L_FN4", - "L_FNN","L_FN1R","L_FN2R","L_FN3R","L_FN4R","L_FNNR","L_LE","L_NE","L_GE","'('", - "')'","','","line","exp","exp_list","range_exp","range_exp_list","cell","" - }; - #endif - - static const short yyr1[] = { 0, - 41, 41, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 43, 43, - 44, 44, 45, 45, 46, 46 - }; - - static const short yyr2[] = { 0, - 1, 1, 1, 1, 3, 4, 6, 8, 10, 4, - 4, 4, 6, 6, 8, 8, 8, 8, 4, 5, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 2, 3, 3, 2, 1, 3, - 1, 1, 1, 3, 1, 1 - }; - - static const short yydefact[] = { 0, - 2, 0, 0, 45, 46, 3, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 4, 34, - 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, - 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, - 41, 42, 43, 0, 37, 36, 0, 21, 24, 25, - 22, 23, 26, 27, 28, 29, 30, 31, 32, 33, - 6, 0, 0, 0, 10, 0, 11, 12, 0, 0, - 0, 0, 19, 0, 0, 0, 0, 0, 40, 0, - 0, 0, 0, 44, 20, 7, 0, 0, 13, 0, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 15, 16, 17, 18, 0, 9, 0, 0, - 0 - }; - - static const short yydefgoto[] = { 129, - 62, 54, 63, 64, 19 - }; - - static const short yypact[] = { 104, - -32768, 486, 486,-32768,-32768,-32768, -37, -22, -16, 10, - 12, 14, 29, 43, 47, 50, 124, 537,-32768,-32768, - -32768, 59, 486, 486, 486, 486, 486, 7, 9, 11, - 464,-32768, 48, 486, 486, 486, 486, 486, 486, 486, - 486, 486, 486, 486, 486, 486, 486,-32768, 332, 173, - 209, 224, 537, 54, 60, 61, 64, 66, 69, 71, - -32768, 537,-32768, 57,-32768,-32768, 522, -2, 193, 193, - 547, 547, 547, 547, 4, 4, 84, 84, 84, 84, - -32768, 486, 486, 486,-32768, 486,-32768,-32768, 486, 486, - 486, 486,-32768, 464, 486, 353, 245, 260, 537, 63, - 158, 281, 296,-32768, 537,-32768, 486, 486,-32768, 486, - -32768, 486, 486, 486, 369, 317, 388, 404, 423, 439, - -32768, 486,-32768,-32768,-32768,-32768, 458,-32768, 115, 116, - -32768 - }; - - static const short yypgoto[] = {-32768, - 0,-32768, 24,-32768,-32768 - }; - - - #define YYLAST 564 - - - static const short yytable[] = { 18, - 22, 20, 21, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 23, 33, 44, 45, 46, - 47, 24, 49, 50, 51, 52, 53, 55, 56, 57, - 58, 59, 60, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 25, 65, 26, - 34, 27, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 34, 28, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 29, 96, 97, 98, 30, 99, 66, 31, 100, 101, - 102, 103, 85, 86, 105, 93, 94, 48, 87, 88, - 47, 109, 110, 89, 1, 90, 115, 116, 91, 117, - 92, 118, 119, 120, 130, 131, 2, 104, 0, 0, - 0, 127, 3, 4, 32, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 2, 16, 0, 0, - 0, 17, 3, 4, 0, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 0, 16, 0, 0, - 34, 17, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 34, 0, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 0, 0, 0, 0, 0, 0, 111, 112,-32768,-32768, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 0, 34, 82, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 34, 0, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 0, 0, 0, 0, 0, 0, 34, 83, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 34, 84, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 0, 0, 0, - 0, 0, 0, 34, 107, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 34, 108, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 0, 0, 0, 0, 0, 0, 34, - 113, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 34, 114, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 0, - 0, 0, 0, 0, 0, 34, 122, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 81, 34, 0, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 0, 0, 0, 0, - 34, 106, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 0, 34, 121, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 0, 0, 0, 0, 34, 123, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 0, 34, 124, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 0, 0, 0, 0, - 34, 125, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 0, 2, 126, 0, 0, - 0, 0, 3, 4, 61, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 128, 16, 2, 0, - 0, 17, 0, 0, 3, 4, 0, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 0, 16, - 0, 0, 0, 17, 34, 95, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 34, - 0, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47,-32768,-32768,-32768,-32768, 42, 43, - 44, 45, 46, 47 - }; - - static const short yycheck[] = { 0, - 38, 2, 3, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 38, 17, 14, 15, 16, - 17, 38, 23, 24, 25, 26, 27, 21, 22, 21, - 22, 21, 22, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 38, 1, 38, - 3, 38, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 3, 38, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 38, 82, 83, 84, 38, 86, 39, 38, 89, 90, - 91, 92, 39, 40, 95, 39, 40, 39, 39, 39, - 17, 39, 40, 40, 1, 40, 107, 108, 40, 110, - 40, 112, 113, 114, 0, 0, 13, 94, -1, -1, - -1, 122, 19, 20, 1, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 13, 34, -1, -1, - -1, 38, 19, 20, -1, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, -1, 34, -1, -1, - 3, 38, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 3, -1, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - -1, -1, -1, -1, -1, -1, 39, 40, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - -1, 3, 40, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 3, -1, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, -1, -1, -1, -1, -1, -1, 3, 40, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 3, 40, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, -1, -1, -1, - -1, -1, -1, 3, 40, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 3, 40, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, -1, -1, -1, -1, -1, -1, 3, - 40, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 3, 40, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, - -1, -1, -1, -1, -1, 3, 40, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 39, 3, -1, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, -1, -1, -1, -1, - 3, 39, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, -1, 3, 39, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, -1, -1, -1, -1, 3, 39, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - -1, 3, 39, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, -1, -1, -1, -1, - 3, 39, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, -1, 13, 39, -1, -1, - -1, -1, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 39, 34, 13, -1, - -1, 38, -1, -1, 19, 20, -1, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, -1, 34, - -1, -1, -1, 38, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 3, - -1, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17 - }; - /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ - #line 3 "/usr/unsupported/lib/bison.simple" - - /* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - - - #ifndef alloca - #ifdef __GNUC__ - #define alloca __builtin_alloca - #else /* not GNU C. */ - #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) - #include - #else /* not sparc */ - #if defined (MSDOS) && !defined (__TURBOC__) - #include - #else /* not MSDOS, or __TURBOC__ */ - #if defined(_AIX) - #include - #pragma alloca - #else /* not MSDOS, __TURBOC__, or _AIX */ - #ifdef __hpux - #ifdef __cplusplus - extern "C" { - void *alloca (unsigned int); - }; - #else /* not __cplusplus */ - void *alloca (); - #endif /* not __cplusplus */ - #endif /* __hpux */ - #endif /* not _AIX */ - #endif /* not MSDOS, or __TURBOC__ */ - #endif /* not sparc. */ - #endif /* not GNU C. */ - #endif /* alloca not defined. */ - - /* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - - /* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - - #define yyerrok (yyerrstatus = 0) - #define yyclearin (yychar = YYEMPTY) - #define YYEMPTY -2 - #define YYEOF 0 - #define YYACCEPT return(0) - #define YYABORT return(1) - #define YYERROR goto yyerrlab1 - /* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - #define YYFAIL goto yyerrlab - #define YYRECOVERING() (!!yyerrstatus) - #define YYBACKUP(token, value) \ - do \ - if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ - while (0) - - #define YYTERROR 1 - #define YYERRCODE 256 - - #ifndef YYPURE - #define YYLEX yylex() - #endif - - #ifdef YYPURE - #ifdef YYLSP_NEEDED - #define YYLEX yylex(&yylval, &yylloc) - #else - #define YYLEX yylex(&yylval) - #endif - #endif - - /* If nonreentrant, generate the variables here */ - - #ifndef YYPURE - - int yychar; /* the lookahead symbol */ - YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ - - #ifdef YYLSP_NEEDED - YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ - #endif - - int yynerrs; /* number of parse errors so far */ - #endif /* not YYPURE */ - - #if YYDEBUG != 0 - int yydebug; /* nonzero means print parse trace */ - /* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ - #endif - - /* YYINITDEPTH indicates the initial size of the parser's stacks */ - - #ifndef YYINITDEPTH - #define YYINITDEPTH 200 - #endif - - /* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - - #if YYMAXDEPTH == 0 - #undef YYMAXDEPTH - #endif - - #ifndef YYMAXDEPTH - #define YYMAXDEPTH 10000 - #endif - - /* Prevent warning if -Wstrict-prototypes. */ - #ifdef __GNUC__ - int yyparse (void); - #endif - - #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ - #define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) - #else /* not GNU C or C++ */ - #ifndef __cplusplus - - /* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ - static void - __yy_bcopy (from, to, count) - char *from; - char *to; - int count; - { - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; - } - - #else /* __cplusplus */ - - /* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ - static void - __yy_bcopy (char *from, char *to, int count) - { - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; - } - - #endif - #endif - - #line 184 "/usr/unsupported/lib/bison.simple" - int - yyparse() - { - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - - #ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; - - #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) - #else - #define YYPOPSTACK (yyvsp--, yyssp--) - #endif - - int yystacksize = YYINITDEPTH; - - #ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; - #ifdef YYLSP_NEEDED - YYLTYPE yylloc; - #endif - #endif - - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - - #if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); - #endif - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss - 1; - yyvsp = yyvs; - #ifdef YYLSP_NEEDED - yylsp = yyls; - #endif - - /* Push a new state, which is found in yystate . */ - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ - yynewstate: - - *++yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; - #ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; - #endif - - /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; - - #ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ - #ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); - #else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); - #endif - - yyss = yyss1; yyvs = yyvs1; - #ifdef YYLSP_NEEDED - yyls = yyls1; - #endif - #else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - return 2; - } - yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; - yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); - __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp)); - yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); - __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp)); - #ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); - __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp)); - #endif - #endif /* no yyoverflow */ - - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; - #ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; - #endif - - #if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); - #endif - - if (yyssp >= yyss + yystacksize - 1) - YYABORT; - } - - #if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); - #endif - - goto yybackup; - yybackup: - - /* Do appropriate processing given the current state. */ - /* Read a lookahead token if we need one and don't already have one. */ - /* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (yychar == YYEMPTY) - { - #if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); - #endif - yychar = YYLEX; - } - - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ - { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - - #if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); - #endif - } - else - { - yychar1 = YYTRANSLATE(yychar); - - #if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ - #ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); - #endif - fprintf (stderr, ")\n"); - } - #endif - } - - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) - goto yydefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - - #if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); - #endif - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - #ifdef YYLSP_NEEDED - *++yylsp = yylloc; - #endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - /* Do the default action for the current state. */ - yydefault: - - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - - /* Do a reduction. yyn is the number of a rule to reduce with. */ - yyreduce: - yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ - - #if YYDEBUG != 0 - if (yydebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } - #endif - - - switch (yyn) { - - case 1: - #line 87 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { parse_return=yyvsp[0]; ; - break;} - case 2: - #line 88 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - if(!parse_error) - parse_error=PARSE_ERR; - parse_return=0; ; - break;} - case 5: - #line 96 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyval=yyvsp[-2]; ; - break;} - case 6: - #line 98 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - (yyvsp[-3])->n_x.v_subs[0]=yyvsp[-1]; - (yyvsp[-3])->n_x.v_subs[1]=(struct node *)0; - yyval=yyvsp[-3]; ; - break;} - case 7: - #line 102 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - (yyvsp[-5])->n_x.v_subs[0]=yyvsp[-3]; - (yyvsp[-5])->n_x.v_subs[1]=yyvsp[-1]; - yyval=yyvsp[-5]; ; - break;} - case 8: - #line 106 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - (yyvsp[-7])->n_x.v_subs[0]=make_list(yyvsp[-5],yyvsp[-3]); - (yyvsp[-7])->n_x.v_subs[1]=yyvsp[-1]; - yyval=yyvsp[-7];; - break;} - case 9: - #line 110 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - (yyvsp[-9])->n_x.v_subs[0]=make_list(yyvsp[-7],yyvsp[-5]); - (yyvsp[-9])->n_x.v_subs[1]=make_list(yyvsp[-3],yyvsp[-1]); - yyval=yyvsp[-9];; - break;} - case 10: - #line 114 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - (yyvsp[-3])->n_x.v_subs[0]=(struct node *)0; - (yyvsp[-3])->n_x.v_subs[1]=yyvsp[-1]; - yyval=yyvsp[-3]; ; - break;} - case 11: - #line 118 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-3]->n_x.v_subs[0]=yyvsp[-1]; - yyval=yyvsp[-3]; ; - break;} - case 12: - #line 121 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-3]->n_x.v_subs[0]=yyvsp[-1]; - yyval=yyvsp[-3]; ; - break;} - case 13: - #line 125 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-5]->n_x.v_subs[0]=yyvsp[-3]; - yyvsp[-5]->n_x.v_subs[1]=yyvsp[-1]; - yyval=yyvsp[-5]; ; - break;} - case 14: - #line 129 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-5]->n_x.v_subs[0]=yyvsp[-3]; - yyvsp[-5]->n_x.v_subs[1]=yyvsp[-1]; - yyval=yyvsp[-5]; ; - break;} - case 15: - #line 135 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - if(yyvsp[-7]->comp_value!=F_INDEX) - parse_error=PARSE_ERR; - yyvsp[-7]->comp_value=F_INDEX2; - yyvsp[-7]->n_x.v_subs[0]=make_list(yyvsp[-5],yyvsp[-3]); - yyvsp[-7]->n_x.v_subs[1]=yyvsp[-1]; - yyval=yyvsp[-7]; ; - break;} - case 16: - #line 142 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - if(yyvsp[-7]->comp_value!=F_INDEX) - parse_error=PARSE_ERR; - yyvsp[-7]->comp_value=F_INDEX2; - yyvsp[-7]->n_x.v_subs[0]=make_list(yyvsp[-5],yyvsp[-3]); - yyvsp[-7]->n_x.v_subs[1]=yyvsp[-1]; - yyval=yyvsp[-7]; ; - break;} - case 17: - #line 150 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - (yyvsp[-7])->n_x.v_subs[0]=make_list(yyvsp[-5],yyvsp[-3]); - (yyvsp[-7])->n_x.v_subs[1]=yyvsp[-1]; - yyval=yyvsp[-7];; - break;} - case 18: - #line 154 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - (yyvsp[-7])->n_x.v_subs[0]=make_list(yyvsp[-5],yyvsp[-3]); - (yyvsp[-7])->n_x.v_subs[1]=yyvsp[-1]; - yyval=yyvsp[-7];; - break;} - case 19: - #line 159 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - (yyvsp[-3])->n_x.v_subs[0]=(struct node *)0; - (yyvsp[-3])->n_x.v_subs[1]=yyvsp[-1]; - yyval=yyvsp[-3]; ; - break;} - case 20: - #line 163 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-3]->comp_value=IF; - yyvsp[-3]->n_x.v_subs[0]=yyvsp[-1]; - yyvsp[-3]->n_x.v_subs[1]=yyvsp[0]; - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-4]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[-2]; - yyval=yyvsp[-3]; ; - break;} - case 21: - #line 174 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 22: - #line 178 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 23: - #line 182 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 24: - #line 186 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 25: - #line 190 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 26: - #line 194 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 27: - #line 198 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 28: - #line 202 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 29: - #line 206 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 30: - #line 210 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 31: - #line 214 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 32: - #line 218 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 33: - #line 222 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2]; - yyvsp[-1]->n_x.v_subs[1]=yyvsp[0]; - yyval = yyvsp[-1]; ; - break;} - case 34: - #line 226 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - if(yyvsp[0]->comp_value==CONST_FLT) { - yyvsp[0]->n_x.v_float= -(yyvsp[0]->n_x.v_float); - /* free($1); */ - yyval=yyvsp[0]; - } else if(yyvsp[0]->comp_value==CONST_INT) { - yyvsp[0]->n_x.v_int= -(yyvsp[0]->n_x.v_int); - /* free($1); */ - yyval=yyvsp[0]; - } else { - yyvsp[-1]->comp_value = NEGATE; - yyvsp[-1]->n_x.v_subs[0]=yyvsp[0]; - yyvsp[-1]->n_x.v_subs[1]=(struct node *)0; - yyval = yyvsp[-1]; - } ; - break;} - case 35: - #line 241 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - yyvsp[-1]->n_x.v_subs[0]=yyvsp[0]; - yyvsp[-1]->n_x.v_subs[1]=(struct node *)0; - yyval = yyvsp[-1]; ; - break;} - case 36: - #line 246 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { yyval = yyvsp[-1]; ; - break;} - case 37: - #line 247 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - if(!parse_error) - parse_error=NO_CLOSE; - ; - break;} - case 38: - #line 255 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { - if(!parse_error) - parse_error=NO_CLOSE; - ; - break;} - case 39: - #line 263 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { yyval = make_list(yyvsp[0], 0); ; - break;} - case 40: - #line 265 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { yyval = make_list(yyvsp[0], yyvsp[-2]); ; - break;} - case 43: - #line 273 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { yyval=make_list(yyvsp[0], 0); ; - break;} - case 44: - #line 275 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { yyval=make_list(yyvsp[0],yyvsp[-2]); ; - break;} - case 45: - #line 279 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - { yyval=yyvsp[0]; ; - break;} - } - /* the action file gets copied in in place of this dollarsign */ - #line 465 "/usr/unsupported/lib/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; - #ifdef YYLSP_NEEDED - yylsp -= yylen; - #endif - - #if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } - #endif - - *++yyvsp = yyval; - - #ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } - #endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTBASE]; - - goto yynewstate; - - yyerrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++yynerrs; - - #ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - yyerror(msg); - free(msg); - } - else - yyerror ("parse error; also virtual memory exceeded"); - } - else - #endif /* YYERROR_VERBOSE */ - yyerror("parse error"); - } - - goto yyerrlab1; - yyerrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; - - #if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); - #endif - - yychar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - - yyerrdefault: /* current state does not do anything special for the error token. */ - - #if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; - #endif - - yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; - #ifdef YYLSP_NEEDED - yylsp--; - #endif - - #if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } - #endif - - yyerrhandle: - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - - #if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); - #endif - - *++yyvsp = yylval; - #ifdef YYLSP_NEEDED - *++yylsp = yylloc; - #endif - - yystate = yyn; - goto yynewstate; - } - #line 282 "/phydeaux/ni/lord/unsupported/oleo/parse.y" - - - void - yyerror FUN1(char *, s) - { - if(!parse_error) - parse_error=PARSE_ERR; - } - - YYSTYPE - make_list FUN2(YYSTYPE, car, YYSTYPE, cdr) - { - YYSTYPE ret; - - ret=(YYSTYPE)obstack_alloc(&tmp_mem,sizeof(*ret)); - ret->comp_value = 0; - ret->n_x.v_subs[0]=car; - ret->n_x.v_subs[1]=cdr; - return ret; - } - - #define ERROR -1 - - extern struct node *yylval; - - #ifdef __STDC__ - unsigned char parse_cell_or_range (char **,struct rng *); - int str_to_col (char ** str); - #else - unsigned char parse_cell_or_range (); - #endif - - int - yylex FUN0() - { - int ch; - struct node *new; - int isflt; - char *begin; - char *tmp_str; - unsigned char byte_value; - int n; - - /* unsigned char *ptr; */ - int nn; - struct function *fp; - int tmp_ch; - - #ifdef TEST - if(!instr) - return ERROR; - #endif - while(isspace(*instr)) - instr++; - ch = *instr++; - if(ch=='(' || ch==',' || ch==')') - return ch; - - new=(struct node *)obstack_alloc(&tmp_mem,sizeof(struct node)); - new->add_byte=0; - new->sub_value=0; - switch(ch) { - case 0: - return 0; - - case '0': case '1': case '2': case '3': case '4': case '5': case '6': - case '7': case '8': case '9': case '.': - isflt = (ch=='.'); - - begin=instr-1; - tmp_str=instr; - - while(isdigit(*tmp_str) || (!isflt && *tmp_str=='.' && ++isflt)) - tmp_str++; - if(*tmp_str=='e' || *tmp_str=='E') { - isflt=1; - tmp_str++; - if(*tmp_str=='-' || *tmp_str=='+') - tmp_str++; - while(isdigit(*tmp_str)) - tmp_str++; - } - if(isflt) { - new->n_x.v_float=astof((char **)(&begin)); - byte_value=CONST_FLT; - } else { - new->n_x.v_int=astol((char **)(&begin)); - if(begin!=tmp_str) { - begin=instr-1; - new->n_x.v_float=astof((char **)(&begin)); - byte_value=CONST_FLT; - } else - byte_value=CONST_INT; - } - ch=L_CONST; - instr=begin; - break; - - case '"': - begin=instr; - while(*instr && *instr!='"') { - if(*instr=='\\' && instr[1]) - instr++; - instr++; - } - if(!*instr) { - parse_error=NO_QUOTE; - return ERROR; - } - tmp_str=new->n_x.v_string=(char *)ck_malloc(1+instr-begin); - while(begin!=instr) { - unsigned char n; - - if(*begin=='\\') { - begin++; - if(begin[0]>='0' && begin[0]<='7') { - if(begin[1]>='0' && begin[1]<='7') { - if(begin[2]>='0' && begin[2]<='7') { - n=(begin[2]-'0') + (010 * (begin[1]-'0')) + ( 0100 * (begin[0]-'0')); - begin+=3; - } else { - n=(begin[1]-'0') + (010 * (begin[0]-'0')); - begin+=2; - } - } else { - n=begin[0]-'0'; - begin++; - } - } else - n= *begin++; - *tmp_str++= n; - } else - *tmp_str++= *begin++; - } - *tmp_str='\0'; - instr++; - byte_value=CONST_STR; - ch=L_CONST; - break; - - case '+': case '-': - - case '*': case '/': case '%': case '&': - /* case '|': */ case '^': case '=': - - case '?': - { - unsigned char *ptr; - - for(ptr= fnin;*ptr;ptr++) - if(the_funs[*ptr].fn_str[0]==ch) - break; - #ifdef TEST - if(!*ptr) - panic("Can't find fnin[] entry for '%c'",ch); - #endif - byte_value= *ptr; - } - break; - - case ':': - byte_value=IF; - break; - - case '!': - case '<': - case '>': - if(*instr!='=') { - byte_value = (ch=='<') ? LESS : (ch=='>') ? GREATER : NOT; - break; - } - instr++; - byte_value = (ch=='<') ? LESSEQ : (ch=='>') ? GREATEQ : NOTEQUAL; - ch = (ch=='<') ? LE : (ch=='>') ? GE : NE; - break; - - case '\'': - case ';': - case '[': - case '\\': - case ']': - case '`': - case '{': - case '}': - case '~': - bad_chr: - parse_error=BAD_CHAR; - return ERROR; - - case '#': - begin=instr-1; - while(*instr && (isalnum(*instr) || *instr=='_')) - instr++; - ch= *instr; - *instr=0; - if(!stricmp(begin,tname)) - byte_value=F_TRUE; - else if(!stricmp(begin,fname)) - byte_value=F_FALSE; - else if(!stricmp(begin,iname) && (begin[4]==0 || !stricmp(begin+4,"inity"))) - byte_value=CONST_INF; - else if(!stricmp(begin,mname) || - !stricmp(begin,"#ninf")) - byte_value=CONST_NINF; - else if(!stricmp(begin,nname) || - !stricmp(begin,"#nan")) - byte_value=CONST_NAN; - else { - for(n=1;n<=ERR_MAX;n++) - if(!stricmp(begin,ename[n])) - break; - if(n>ERR_MAX) - n=BAD_CHAR; - new->n_x.v_int=n; - byte_value=CONST_ERR; - } - *instr=ch; - ch=L_CONST; - break; - - default: - if(!a0 && (ch=='@' || ch=='$')) - goto bad_chr; - - if(a0 && ch=='@') { - begin=instr; - while(*instr && (isalpha(*instr) || isdigit(*instr) || *instr=='_')) - instr++; - n=instr-begin; - } else { - begin=instr-1; - byte_value=parse_cell_or_range(&begin,&(new->n_x.v_rng)); - if(byte_value) { - if((byte_value& ~0x3)==R_CELL) - ch=L_CELL; - else - ch=L_RANGE; - instr=begin; - break; - } - - while(*instr && (isalpha(*instr) || isdigit(*instr) || *instr=='_')) - instr++; - - n=instr-begin; - while(isspace(*instr)) - instr++; - - if(*instr!='(') { - ch=L_VAR; - byte_value=VAR; - new->n_x.v_var=find_or_make_var(begin,n); - break; - } - } - tmp_ch=begin[n]; - begin[n]='\0'; - fp=hash_find(parse_hash,begin); - begin[n]=tmp_ch; - byte_value= ERROR; - if(!fp) { - parse_error=BAD_FUNC; - return ERROR; - } - - if(fp>=the_funs && fp<=&the_funs[USR1]) - byte_value=fp-the_funs; - else { - for(nn=0;nn=&usr_funs[nn][0] && fp<=&usr_funs[nn][usr_n_funs[nn]]) { - byte_value=USR1+nn; - new->sub_value=fp-&usr_funs[nn][0]; - break; - } - } - #ifdef TEST - if(nn==n_usr_funs) { - io_error_msg("Couln't turn fp into a ##"); - parse_error=BAD_FUNC; - return ERROR; - } - #endif - } - - if(fp->fn_argn&X_J) - ch= byte_value==F_IF ? L_FN3 : L_FN2; - else if(fp->fn_argt[0]=='R' || fp->fn_argt[0]=='E') - ch=L_FN1R-1+fp->fn_argn-X_A0; - else - ch=L_FN0 + fp->fn_argn-X_A0; - - break; - } - /* new->node_type=ch; */ - new->comp_value=byte_value; - yylval=new; - return ch; - } - - /* Return value is - 0 if it doesn't look like a cell or a range, - R_CELL if it is a cell (ptr now points past the characters, lr and lc hold the row and col of the cell) - RANGE if it is a range (ptr points past the chars) - */ - unsigned char - parse_cell_or_range FUN2(char **,ptr, struct rng *,retp) - { - if(a0) { - unsigned tmpc,tmpr; - char *p; - int abz = ROWREL|COLREL; - - p= *ptr; - tmpc=0; - if(*p=='$') { - abz-=COLREL; - p++; - } - if(!isalpha(*p)) - return 0; - tmpc=str_to_col(&p); - if(tmpcMAX_COL) - return 0; - if(*p=='$') { - abz-=ROWREL; - p++; - } - if(!isdigit(*p)) - return 0; - for(tmpr=0;isdigit(*p);p++) - tmpr=tmpr*10 + *p - '0'; - - if(tmprMAX_ROW) - return 0; - - if(*p==':' || *p=='.') { - unsigned tmpc1,tmpr1; - - abz = ((abz&COLREL) ? LCREL : 0)|((abz&ROWREL) ? LRREL : 0)|HRREL|HCREL; - p++; - if(*p=='$') { - abz-=HCREL; - p++; - } - if(!isalpha(*p)) - return 0; - tmpc1=str_to_col(&p); - if(tmpc1MAX_COL) - return 0; - if(*p=='$') { - abz-=HRREL; - p++; - } - if(!isdigit(*p)) - return 0; - for(tmpr1=0;isdigit(*p);p++) - tmpr1=tmpr1*10 + *p - '0'; - if(tmpr1MAX_ROW) - return 0; - - if(tmprlr=tmpr; - retp->hr=tmpr1; - } else { - retp->lr=tmpr1; - retp->hr=tmpr; - } - if(tmpclc=tmpc; - retp->hc=tmpc1; - } else { - retp->lc=tmpc1; - retp->hc=tmpc; - } - *ptr= p; - return RANGE | abz; - } - retp->lr = retp->hr = tmpr; - retp->lc = retp->hc = tmpc; - *ptr=p; - return R_CELL | abz; - } else { - char *p; - unsigned char retr; - unsigned char retc; - int ended; - long num; - CELLREF tmp; - - #define CK_ABS_R(x) ((x)MAX_ROW) - - #define CK_REL_R(x) (((x)>0 && MAX_ROW-(x)cur_row)) - - #define CK_ABS_C(x) ((x)MAX_COL) - - #define CK_REL_C(x) (((x)>0 && MAX_COL-(x)cur_col)) - - #define MAYBEREL(p) (*(p)=='[' && (isdigit((p)[1]) || (((p)[1]=='+' || (p)[1]=='-') && isdigit((p)[2])))) - - p= *ptr; - retr=0; - retc=0; - ended=0; - while(ended==0) { - switch(*p) { - case 'r': - case 'R': - if(retr) { - ended++; - break; - } - p++; - retr=R_CELL; - if(isdigit(*p)) { - num=astol(&p); - if (CK_ABS_R(num)) - return 0; - retp->lr= retp->hr=num; - } else if(MAYBEREL(p)) { - p++; - num=astol(&p); - if (CK_REL_R(num)) - return 0; - retp->lr= retp->hr=num+cur_row; - retr|=ROWREL; - if(*p==':') { - retr=RANGE|LRREL|HRREL; - p++; - num=astol(&p); - if (CK_REL_R(num)) - return 0; - retp->hr=num+cur_row; - } - if(*p++!=']') - return 0; - } else if(retc || *p=='c' || *p=='C') { - retr|=ROWREL; - retp->lr= retp->hr=cur_row; - } else - return 0; - if(*p==':' && retr!=(RANGE|LRREL|HRREL)) { - retr= (retr&ROWREL) ? RANGE|LRREL : RANGE; - p++; - if(isdigit(*p)) { - num=astol(&p); - if (CK_ABS_R(num)) - return 0; - retp->hr=num; - } else if(MAYBEREL(p)) { - p++; - num=astol(&p); - if (CK_REL_R(num)) - return 0; - retp->hr=num+cur_row; - retr|=HRREL; - if(*p++!=']') - return 0; - } else - return 0; - } - - if(retc) - ended++; - break; - - case 'c': - case 'C': - if(retc) { - ended++; - break; - } - p++; - retc=R_CELL; - if(isdigit(*p)) { - num=astol(&p); - if (CK_ABS_C(num)) - return 0; - retp->lc= retp->hc=num; - } else if(MAYBEREL(p)) { - p++; - num=astol(&p); - if (CK_REL_C(num)) - return 0; - retp->lc= retp->hc=num+cur_col; - retc|=COLREL; - if(*p==':') { - retc=RANGE|LCREL|HCREL; - p++; - num=astol(&p); - if (CK_REL_C(num)) - return 0; - retp->hc=num+cur_col; - } - if(*p++!=']') - return 0; - } else if(retr || *p=='r' || *p=='R') { - retc|=COLREL; - retp->lc= retp->hc=cur_col; - } else - return 0; - if(*p==':' && retc!=(RANGE|LCREL|HCREL)) { - retc= (retc&COLREL) ? RANGE|LCREL : RANGE; - p++; - if(isdigit(*p)) { - num=astol(&p); - if (CK_ABS_C(num)) - return 0; - retp->hc=num; - } else if(MAYBEREL(p)) { - p++; - num=astol(&p); - if (CK_REL_C(num)) - return 0; - retp->hc=num+cur_col; - retc|=HCREL; - if(*p++!=']') - return 0; - } else - return 0; - } - - if(retr) - ended++; - break; - default: - if(retr) { - *ptr=p; - retp->lc=MIN_COL; - retp->hc=MAX_COL; - if((retr|ROWREL)==(R_CELL|ROWREL)) - return (retr&ROWREL) ? (RANGE|LRREL|HRREL) : RANGE; - else - return retr; - } else if(retc) { - *ptr=p; - retp->lr=MIN_ROW; - retp->hr=MAX_ROW; - if((retc|COLREL)==(R_CELL|COLREL)) - return (retc&COLREL) ? (RANGE|LCREL|HCREL) : RANGE; - else - return retc; - } - return 0; - } - } - if(!retr || !retc) - return 0; - *ptr=p; - if(retp->lr>retp->hr) - tmp=retp->lr,retp->lr=retp->hr,retp->hr=tmp; - if(retp->lc>retp->hc) - tmp=retp->lc,retp->lc=retp->hc,retp->hc=tmp; - - if((retr|ROWREL)==(R_CELL|ROWREL)) { - if((retc|COLREL)==(R_CELL|COLREL)) - return retr|retc; - return (retr&ROWREL) ? (retc|LRREL|HRREL) : retc; - } - if((retc|COLREL)==(R_CELL|COLREL)) - return (retc&COLREL) ? (retr|LCREL|HCREL) : retr; - return retr|retc; - } - } - - int - str_to_col FUN1(char **,str) - { - int ret; - char c,cc,ccc; - #if MAX_COL>702 - char cccc; - #endif - - ret=0; - c=str[0][0]; - if(!isalpha((cc=str[0][1]))) { - (*str)++; - return MIN_COL + (isupper(c) ? c-'A' : c-'a'); - } - if(!isalpha((ccc=str[0][2]))) { - (*str)+=2; - return MIN_COL+26 + (isupper(c) ? c-'A' : c-'a')*26 + (isupper(cc) ? cc-'A' : cc-'a'); - } - #if MAX_COL>702 - if(!isalpha((cccc=str[0][3]))) { - (*str)+=3; - return MIN_COL+702 + (isupper(c) ? c-'A' : c-'a')*26*26 + (isupper(cc) ? cc-'A' : cc-'a')*26 + (isupper(ccc) ? ccc-'A' : ccc-'a'); - } - if(!isalpha(str[0][4])) { - (*str)+=4; - return MIN_COL+18278 + (isupper(c) ? c-'A' : c-'a')*26*26*26 + (isupper(cc) ? cc-'A' : cc-'a')*26*26 + (isupper(ccc) ? ccc-'A' : ccc-'a')*26 + (isupper(cccc) ? cccc-'A' : cccc-'a'); - } - #endif - return 0; - } --- 0 ---- diff --recursive --context --minimal --new-file oleo-1.6/posixtm.c oleo-1.6jb2/posixtm.c *** oleo-1.6/posixtm.c Sat Jun 4 15:11:56 1994 --- oleo-1.6jb2/posixtm.c Thu Jan 1 09:00:00 1970 *************** *** 1,956 **** - - /* A Bison parser, made from /phydeaux/ni/lord/unsupported/oleo/posixtm.y with Bison version GNU Bison version 1.22 - */ - - #define YYBISON 1 /* Identify Bison output. */ - - #define DIGIT 258 - - #line 19 "/phydeaux/ni/lord/unsupported/oleo/posixtm.y" - - #ifdef __GNUC__ - #define alloca __builtin_alloca - #else - #if defined (HAVE_ALLOCA_H) || (defined(sparc) && (defined(sun) || (!defined(USG) && !defined(SVR4) && !defined(__svr4__)))) - #include - #else - #ifdef _AIX - #pragma alloca - #else - char *alloca (); - #endif - #endif - #endif - - #include - #include - #include - - #define YYDEBUG 1 - - /* Lexical analyzer's current scan position in the input string. */ - static char *curpos; - - /* The return value. */ - static struct tm t; - - time_t mktime (); - - #define psxtparse posixtime_psxtparse - static int psxtlex (); - static int psxterror (); - - #ifndef YYLTYPE - typedef - struct psxtltype - { - int timestamp; - int first_line; - int first_column; - int last_line; - int last_column; - char *text; - } - psxtltype; - - #define YYLTYPE psxtltype - #endif - - #ifndef YYSTYPE - #define YYSTYPE int - #endif - #include - - #ifndef __cplusplus - #ifndef __STDC__ - #define const - #endif - #endif - - - - #define YYFINAL 15 - #define YYFLAG -32768 - #define YYNTBASE 5 - - #define YYTRANSLATE(x) ((unsigned)(x) <= 258 ? psxttranslate[x] : 9) - - static const char psxttranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 2, 3 - }; - - #if YYDEBUG != 0 - static const short psxtprhs[] = { 0, - 0, 7, 9, 12, 13, 14, 17 - }; - - static const short psxtrhs[] = { 8, - 8, 8, 8, 6, 7, 0, 8, 0, 8, 8, - 0, 0, 0, 4, 8, 0, 3, 3, 0 - }; - - #endif - - #if YYDEBUG != 0 - static const short psxtrline[] = { 0, - 56, 85, 92, 99, 110, 113, 122 - }; - - static const char * const psxttname[] = { "$","error","$illegal.","DIGIT","'.'", - "date","year","seconds","digitpair","" - }; - #endif - - static const short psxtr1[] = { 0, - 5, 6, 6, 6, 7, 7, 8 - }; - - static const short psxtr2[] = { 0, - 6, 1, 2, 0, 0, 2, 2 - }; - - static const short psxtdefact[] = { 0, - 0, 0, 7, 0, 0, 4, 5, 2, 0, 1, - 3, 6, 0, 0, 0 - }; - - static const short psxtdefgoto[] = { 13, - 7, 10, 2 - }; - - static const short psxtpact[] = { 2, - 5, 2,-32768, 2, 2, 2, -3, 2, 2,-32768, - -32768,-32768, 9, 10,-32768 - }; - - static const short psxtpgoto[] = {-32768, - -32768,-32768, -2 - }; - - - #define YYLAST 10 - - - static const short psxttable[] = { 4, - 9, 5, 6, 8, 1, 11, 12, 3, 14, 15 - }; - - static const short psxtcheck[] = { 2, - 4, 4, 5, 6, 3, 8, 9, 3, 0, 0 - }; - /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ - #line 3 "/usr/unsupported/lib/bison.simple" - - /* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - - - #ifndef alloca - #ifdef __GNUC__ - #define alloca __builtin_alloca - #else /* not GNU C. */ - #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) - #include - #else /* not sparc */ - #if defined (MSDOS) && !defined (__TURBOC__) - #include - #else /* not MSDOS, or __TURBOC__ */ - #if defined(_AIX) - #include - #pragma alloca - #else /* not MSDOS, __TURBOC__, or _AIX */ - #ifdef __hpux - #ifdef __cplusplus - extern "C" { - void *alloca (unsigned int); - }; - #else /* not __cplusplus */ - void *alloca (); - #endif /* not __cplusplus */ - #endif /* __hpux */ - #endif /* not _AIX */ - #endif /* not MSDOS, or __TURBOC__ */ - #endif /* not sparc. */ - #endif /* not GNU C. */ - #endif /* alloca not defined. */ - - /* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - - /* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - - #define psxterrok (psxterrstatus = 0) - #define psxtclearin (psxtchar = YYEMPTY) - #define YYEMPTY -2 - #define YYEOF 0 - #define YYACCEPT return(0) - #define YYABORT return(1) - #define YYERROR goto psxterrlab1 - /* Like YYERROR except do call psxterror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - #define YYFAIL goto psxterrlab - #define YYRECOVERING() (!!psxterrstatus) - #define YYBACKUP(token, value) \ - do \ - if (psxtchar == YYEMPTY && psxtlen == 1) \ - { psxtchar = (token), psxtlval = (value); \ - psxtchar1 = YYTRANSLATE (psxtchar); \ - YYPOPSTACK; \ - goto psxtbackup; \ - } \ - else \ - { psxterror ("syntax error: cannot back up"); YYERROR; } \ - while (0) - - #define YYTERROR 1 - #define YYERRCODE 256 - - #ifndef YYPURE - #define YYLEX psxtlex() - #endif - - #ifdef YYPURE - #ifdef YYLSP_NEEDED - #define YYLEX psxtlex(&psxtlval, &psxtlloc) - #else - #define YYLEX psxtlex(&psxtlval) - #endif - #endif - - /* If nonreentrant, generate the variables here */ - - #ifndef YYPURE - - int psxtchar; /* the lookahead symbol */ - YYSTYPE psxtlval; /* the semantic value of the */ - /* lookahead symbol */ - - #ifdef YYLSP_NEEDED - YYLTYPE psxtlloc; /* location data for the lookahead */ - /* symbol */ - #endif - - int psxtnerrs; /* number of parse errors so far */ - #endif /* not YYPURE */ - - #if YYDEBUG != 0 - int psxtdebug; /* nonzero means print parse trace */ - /* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ - #endif - - /* YYINITDEPTH indicates the initial size of the parser's stacks */ - - #ifndef YYINITDEPTH - #define YYINITDEPTH 200 - #endif - - /* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - - #if YYMAXDEPTH == 0 - #undef YYMAXDEPTH - #endif - - #ifndef YYMAXDEPTH - #define YYMAXDEPTH 10000 - #endif - - /* Prevent warning if -Wstrict-prototypes. */ - #ifdef __GNUC__ - int psxtparse (void); - #endif - - #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ - #define __psxt_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) - #else /* not GNU C or C++ */ - #ifndef __cplusplus - - /* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ - static void - __psxt_bcopy (from, to, count) - char *from; - char *to; - int count; - { - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; - } - - #else /* __cplusplus */ - - /* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ - static void - __psxt_bcopy (char *from, char *to, int count) - { - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; - } - - #endif - #endif - - #line 184 "/usr/unsupported/lib/bison.simple" - int - psxtparse() - { - register int psxtstate; - register int psxtn; - register short *psxtssp; - register YYSTYPE *psxtvsp; - int psxterrstatus; /* number of tokens to shift before error messages enabled */ - int psxtchar1 = 0; /* lookahead token as an internal (translated) token number */ - - short psxtssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE psxtvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *psxtss = psxtssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *psxtvs = psxtvsa; /* to allow psxtoverflow to reallocate them elsewhere */ - - #ifdef YYLSP_NEEDED - YYLTYPE psxtlsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *psxtls = psxtlsa; - YYLTYPE *psxtlsp; - - #define YYPOPSTACK (psxtvsp--, psxtssp--, psxtlsp--) - #else - #define YYPOPSTACK (psxtvsp--, psxtssp--) - #endif - - int psxtstacksize = YYINITDEPTH; - - #ifdef YYPURE - int psxtchar; - YYSTYPE psxtlval; - int psxtnerrs; - #ifdef YYLSP_NEEDED - YYLTYPE psxtlloc; - #endif - #endif - - YYSTYPE psxtval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int psxtlen; - - #if YYDEBUG != 0 - if (psxtdebug) - fprintf(stderr, "Starting parse\n"); - #endif - - psxtstate = 0; - psxterrstatus = 0; - psxtnerrs = 0; - psxtchar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - psxtssp = psxtss - 1; - psxtvsp = psxtvs; - #ifdef YYLSP_NEEDED - psxtlsp = psxtls; - #endif - - /* Push a new state, which is found in psxtstate . */ - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ - psxtnewstate: - - *++psxtssp = psxtstate; - - if (psxtssp >= psxtss + psxtstacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *psxtvs1 = psxtvs; - short *psxtss1 = psxtss; - #ifdef YYLSP_NEEDED - YYLTYPE *psxtls1 = psxtls; - #endif - - /* Get the current used size of the three stacks, in elements. */ - int size = psxtssp - psxtss + 1; - - #ifdef psxtoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ - #ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if psxtoverflow is a macro. */ - psxtoverflow("parser stack overflow", - &psxtss1, size * sizeof (*psxtssp), - &psxtvs1, size * sizeof (*psxtvsp), - &psxtls1, size * sizeof (*psxtlsp), - &psxtstacksize); - #else - psxtoverflow("parser stack overflow", - &psxtss1, size * sizeof (*psxtssp), - &psxtvs1, size * sizeof (*psxtvsp), - &psxtstacksize); - #endif - - psxtss = psxtss1; psxtvs = psxtvs1; - #ifdef YYLSP_NEEDED - psxtls = psxtls1; - #endif - #else /* no psxtoverflow */ - /* Extend the stack our own way. */ - if (psxtstacksize >= YYMAXDEPTH) - { - psxterror("parser stack overflow"); - return 2; - } - psxtstacksize *= 2; - if (psxtstacksize > YYMAXDEPTH) - psxtstacksize = YYMAXDEPTH; - psxtss = (short *) alloca (psxtstacksize * sizeof (*psxtssp)); - __psxt_bcopy ((char *)psxtss1, (char *)psxtss, size * sizeof (*psxtssp)); - psxtvs = (YYSTYPE *) alloca (psxtstacksize * sizeof (*psxtvsp)); - __psxt_bcopy ((char *)psxtvs1, (char *)psxtvs, size * sizeof (*psxtvsp)); - #ifdef YYLSP_NEEDED - psxtls = (YYLTYPE *) alloca (psxtstacksize * sizeof (*psxtlsp)); - __psxt_bcopy ((char *)psxtls1, (char *)psxtls, size * sizeof (*psxtlsp)); - #endif - #endif /* no psxtoverflow */ - - psxtssp = psxtss + size - 1; - psxtvsp = psxtvs + size - 1; - #ifdef YYLSP_NEEDED - psxtlsp = psxtls + size - 1; - #endif - - #if YYDEBUG != 0 - if (psxtdebug) - fprintf(stderr, "Stack size increased to %d\n", psxtstacksize); - #endif - - if (psxtssp >= psxtss + psxtstacksize - 1) - YYABORT; - } - - #if YYDEBUG != 0 - if (psxtdebug) - fprintf(stderr, "Entering state %d\n", psxtstate); - #endif - - goto psxtbackup; - psxtbackup: - - /* Do appropriate processing given the current state. */ - /* Read a lookahead token if we need one and don't already have one. */ - /* psxtresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - psxtn = psxtpact[psxtstate]; - if (psxtn == YYFLAG) - goto psxtdefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* psxtchar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (psxtchar == YYEMPTY) - { - #if YYDEBUG != 0 - if (psxtdebug) - fprintf(stderr, "Reading a token: "); - #endif - psxtchar = YYLEX; - } - - /* Convert token to internal form (in psxtchar1) for indexing tables with */ - - if (psxtchar <= 0) /* This means end of input. */ - { - psxtchar1 = 0; - psxtchar = YYEOF; /* Don't call YYLEX any more */ - - #if YYDEBUG != 0 - if (psxtdebug) - fprintf(stderr, "Now at end of input.\n"); - #endif - } - else - { - psxtchar1 = YYTRANSLATE(psxtchar); - - #if YYDEBUG != 0 - if (psxtdebug) - { - fprintf (stderr, "Next token is %d (%s", psxtchar, psxttname[psxtchar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ - #ifdef YYPRINT - YYPRINT (stderr, psxtchar, psxtlval); - #endif - fprintf (stderr, ")\n"); - } - #endif - } - - psxtn += psxtchar1; - if (psxtn < 0 || psxtn > YYLAST || psxtcheck[psxtn] != psxtchar1) - goto psxtdefault; - - psxtn = psxttable[psxtn]; - - /* psxtn is what to do for this token type in this state. - Negative => reduce, -psxtn is rule number. - Positive => shift, psxtn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (psxtn < 0) - { - if (psxtn == YYFLAG) - goto psxterrlab; - psxtn = -psxtn; - goto psxtreduce; - } - else if (psxtn == 0) - goto psxterrlab; - - if (psxtn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - - #if YYDEBUG != 0 - if (psxtdebug) - fprintf(stderr, "Shifting token %d (%s), ", psxtchar, psxttname[psxtchar1]); - #endif - - /* Discard the token being shifted unless it is eof. */ - if (psxtchar != YYEOF) - psxtchar = YYEMPTY; - - *++psxtvsp = psxtlval; - #ifdef YYLSP_NEEDED - *++psxtlsp = psxtlloc; - #endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (psxterrstatus) psxterrstatus--; - - psxtstate = psxtn; - goto psxtnewstate; - - /* Do the default action for the current state. */ - psxtdefault: - - psxtn = psxtdefact[psxtstate]; - if (psxtn == 0) - goto psxterrlab; - - /* Do a reduction. psxtn is the number of a rule to reduce with. */ - psxtreduce: - psxtlen = psxtr2[psxtn]; - if (psxtlen > 0) - psxtval = psxtvsp[1-psxtlen]; /* implement default value of the action */ - - #if YYDEBUG != 0 - if (psxtdebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - psxtn, psxtrline[psxtn]); - - /* Print the symbols being reduced, and their result. */ - for (i = psxtprhs[psxtn]; psxtrhs[i] > 0; i++) - fprintf (stderr, "%s ", psxttname[psxtrhs[i]]); - fprintf (stderr, " -> %s\n", psxttname[psxtr1[psxtn]]); - } - #endif - - - switch (psxtn) { - - case 1: - #line 62 "/phydeaux/ni/lord/unsupported/oleo/posixtm.y" - { - if (psxtvsp[-5] >= 1 && psxtvsp[-5] <= 12) - t.tm_mon = psxtvsp[-5] - 1; - else { - YYABORT; - } - if (psxtvsp[-4] >= 1 && psxtvsp[-4] <= 31) - t.tm_mday = psxtvsp[-4]; - else { - YYABORT; - } - if (psxtvsp[-3] >= 0 && psxtvsp[-3] <= 23) - t.tm_hour = psxtvsp[-3]; - else { - YYABORT; - } - if (psxtvsp[-2] >= 0 && psxtvsp[-2] <= 59) - t.tm_min = psxtvsp[-2]; - else { - YYABORT; - } - ; - break;} - case 2: - #line 85 "/phydeaux/ni/lord/unsupported/oleo/posixtm.y" - { - t.tm_year = psxtvsp[0]; - /* Deduce the century based on the year. - See POSIX.2 section 4.63.3. */ - if (psxtvsp[0] <= 68) - t.tm_year += 100; - ; - break;} - case 3: - #line 92 "/phydeaux/ni/lord/unsupported/oleo/posixtm.y" - { - t.tm_year = psxtvsp[-1] * 100 + psxtvsp[0]; - if (t.tm_year < 1900) { - YYABORT; - } else - t.tm_year -= 1900; - ; - break;} - case 4: - #line 99 "/phydeaux/ni/lord/unsupported/oleo/posixtm.y" - { - time_t now; - struct tm *tmp; - - /* Use current year. */ - time (&now); - tmp = localtime (&now); - t.tm_year = tmp->tm_year; - ; - break;} - case 5: - #line 110 "/phydeaux/ni/lord/unsupported/oleo/posixtm.y" - { - t.tm_sec = 0; - ; - break;} - case 6: - #line 113 "/phydeaux/ni/lord/unsupported/oleo/posixtm.y" - { - if (psxtvsp[0] >= 0 && psxtvsp[0] <= 61) - t.tm_sec = psxtvsp[0]; - else { - YYABORT; - } - ; - break;} - case 7: - #line 122 "/phydeaux/ni/lord/unsupported/oleo/posixtm.y" - { - psxtval = psxtvsp[-1] * 10 + psxtvsp[0]; - ; - break;} - } - /* the action file gets copied in in place of this dollarsign */ - #line 465 "/usr/unsupported/lib/bison.simple" - - psxtvsp -= psxtlen; - psxtssp -= psxtlen; - #ifdef YYLSP_NEEDED - psxtlsp -= psxtlen; - #endif - - #if YYDEBUG != 0 - if (psxtdebug) - { - short *ssp1 = psxtss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != psxtssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } - #endif - - *++psxtvsp = psxtval; - - #ifdef YYLSP_NEEDED - psxtlsp++; - if (psxtlen == 0) - { - psxtlsp->first_line = psxtlloc.first_line; - psxtlsp->first_column = psxtlloc.first_column; - psxtlsp->last_line = (psxtlsp-1)->last_line; - psxtlsp->last_column = (psxtlsp-1)->last_column; - psxtlsp->text = 0; - } - else - { - psxtlsp->last_line = (psxtlsp+psxtlen-1)->last_line; - psxtlsp->last_column = (psxtlsp+psxtlen-1)->last_column; - } - #endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - psxtn = psxtr1[psxtn]; - - psxtstate = psxtpgoto[psxtn - YYNTBASE] + *psxtssp; - if (psxtstate >= 0 && psxtstate <= YYLAST && psxtcheck[psxtstate] == *psxtssp) - psxtstate = psxttable[psxtstate]; - else - psxtstate = psxtdefgoto[psxtn - YYNTBASE]; - - goto psxtnewstate; - - psxterrlab: /* here on detecting error */ - - if (! psxterrstatus) - /* If not already recovering from an error, report this error. */ - { - ++psxtnerrs; - - #ifdef YYERROR_VERBOSE - psxtn = psxtpact[psxtstate]; - - if (psxtn > YYFLAG && psxtn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -psxtn if nec to avoid negative indexes in psxtcheck. */ - for (x = (psxtn < 0 ? -psxtn : 0); - x < (sizeof(psxttname) / sizeof(char *)); x++) - if (psxtcheck[x + psxtn] == x) - size += strlen(psxttname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (psxtn < 0 ? -psxtn : 0); - x < (sizeof(psxttname) / sizeof(char *)); x++) - if (psxtcheck[x + psxtn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, psxttname[x]); - strcat(msg, "'"); - count++; - } - } - psxterror(msg); - free(msg); - } - else - psxterror ("parse error; also virtual memory exceeded"); - } - else - #endif /* YYERROR_VERBOSE */ - psxterror("parse error"); - } - - goto psxterrlab1; - psxterrlab1: /* here on error raised explicitly by an action */ - - if (psxterrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (psxtchar == YYEOF) - YYABORT; - - #if YYDEBUG != 0 - if (psxtdebug) - fprintf(stderr, "Discarding token %d (%s).\n", psxtchar, psxttname[psxtchar1]); - #endif - - psxtchar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - psxterrstatus = 3; /* Each real token shifted decrements this */ - - goto psxterrhandle; - - psxterrdefault: /* current state does not do anything special for the error token. */ - - #if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - psxtn = psxtdefact[psxtstate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (psxtn) goto psxtdefault; - #endif - - psxterrpop: /* pop the current state because it cannot handle the error token */ - - if (psxtssp == psxtss) YYABORT; - psxtvsp--; - psxtstate = *--psxtssp; - #ifdef YYLSP_NEEDED - psxtlsp--; - #endif - - #if YYDEBUG != 0 - if (psxtdebug) - { - short *ssp1 = psxtss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != psxtssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } - #endif - - psxterrhandle: - - psxtn = psxtpact[psxtstate]; - if (psxtn == YYFLAG) - goto psxterrdefault; - - psxtn += YYTERROR; - if (psxtn < 0 || psxtn > YYLAST || psxtcheck[psxtn] != YYTERROR) - goto psxterrdefault; - - psxtn = psxttable[psxtn]; - if (psxtn < 0) - { - if (psxtn == YYFLAG) - goto psxterrpop; - psxtn = -psxtn; - goto psxtreduce; - } - else if (psxtn == 0) - goto psxterrpop; - - if (psxtn == YYFINAL) - YYACCEPT; - - #if YYDEBUG != 0 - if (psxtdebug) - fprintf(stderr, "Shifting error token, "); - #endif - - *++psxtvsp = psxtlval; - #ifdef YYLSP_NEEDED - *++psxtlsp = psxtlloc; - #endif - - psxtstate = psxtn; - goto psxtnewstate; - } - #line 126 "/phydeaux/ni/lord/unsupported/oleo/posixtm.y" - - static int - psxtlex () - { - char ch = *curpos++; - - if (ch >= '0' && ch <= '9') - { - psxtlval = ch - '0'; - return DIGIT; - } - else if (ch == '.' || ch == 0) - return ch; - else - return '?'; /* Cause an error. */ - } - - static int - psxterror () - { - return 0; - } - - /* Parse a POSIX-style date and return it, or (time_t)-1 for an error. */ - - time_t - posixtime (s) - char *s; - { - curpos = s; - /* Let mktime decide whether it is daylight savings time. */ - t.tm_isdst = -1; - if (psxtparse ()) - return (time_t)-1; - else - return mktime (&t); - } - - /* Parse a POSIX-style date and return it, or NULL for an error. */ - - struct tm * - posixtm (s) - char *s; - { - if (posixtime (s) == -1) - return NULL; - return &t; - } --- 0 ---- diff --recursive --context --minimal --new-file oleo-1.6/posixtm.y oleo-1.6jb2/posixtm.y *** oleo-1.6/posixtm.y Sat Jun 4 01:20:51 1994 --- oleo-1.6jb2/posixtm.y Fri Nov 8 01:40:27 1996 *************** *** 127,133 **** static int yylex () { ! char ch = *curpos++; if (ch >= '0' && ch <= '9') { --- 127,133 ---- static int yylex () { ! unsigned char ch = *curpos++; if (ch >= '0' && ch <= '9') { diff --recursive --context --minimal --new-file oleo-1.6/print.c oleo-1.6jb2/print.c *** oleo-1.6/print.c Sat Jun 4 01:20:53 1994 --- oleo-1.6jb2/print.c Thu May 1 14:23:31 1997 *************** *** 44,56 **** int dpy_wid = display_width (dpy); int dpy_hgt = display_height (dpy); struct font_memo *fm; ! fputs ("%!PS-Adobe-2.0 EPSF-2.0\n", fp); fprintf (fp, "%%%%BoundingBox: %d %d %d %d\n", 0, 0, (int) ((float) dpy_wid * scale), (int) ((float) (dpy_hgt + 1) * scale)); fputs ("%%Creator: oleo\n", fp); ! fputs ("%%DocumentFonts: Times-Roman", fp); for (fm = font_list; fm; fm = fm->next) fprintf (fp, " %s", fm->names->ps_name); fputc ('\n', fp); --- 44,58 ---- int dpy_wid = display_width (dpy); int dpy_hgt = display_height (dpy); struct font_memo *fm; ! ! fputs ("%!PS-Adobe-3.0 EPSF-3.0\n", fp); fprintf (fp, "%%%%BoundingBox: %d %d %d %d\n", 0, 0, (int) ((float) dpy_wid * scale), (int) ((float) (dpy_hgt + 1) * scale)); + fputs ("%%Pages: 0\n", fp); fputs ("%%Creator: oleo\n", fp); ! fputs ("%%DocumentNeededResources: font Times-Roman", fp); for (fm = font_list; fm; fm = fm->next) fprintf (fp, " %s", fm->names->ps_name); fputc ('\n', fp); *************** *** 78,83 **** --- 80,95 ---- fputs ("\\)", fp); else if (*str == '(') fputs ("\\(", fp); + #if defined(EUC_JP) + else if (*((unsigned char *)str) > 0x80) { + #if defined(GHOSTSCRIPT) + fprintf(fp,"\\%03o",*((unsigned char*)str++) ); + fprintf(fp,"\\%03o",0x7f&*((unsigned char*)str) ); + #else + fprintf(fp,"\\%03o",*((unsigned char*)str++) ); + #endif + } + #endif /* EUC_JP */ else fputc (*str, fp); ++str; *************** *** 113,119 **** --- 125,134 ---- scale = hgt / (float) dpy_hgt; put_eps_header (&dpy, scale, wid, hgt, fp); + fprintf (fp, "%%%%BeginProlog\n"); + fprintf (fp, "%% minimum of 2\n"); fprintf (fp, "/min { 2 copy lt { pop } if } def\n"); + fprintf (fp, "%% maxmum of 2\n"); fprintf (fp, "/max { 2 copy lt { exch pop } if } def\n"); fprintf (fp, "/fed { exch def } def\n"); fprintf (fp, "/gget { cvi get } def\n"); *************** *** 136,148 **** --- 151,192 ---- fprintf (fp, "} def\n"); fprintf (fp, "/font-box\n"); fprintf (fp, "{\n"); + #if defined(EUC_JP) + fprintf (fp, " dup /FontType get 0 eq {\n"); + fprintf (fp, " dup /FDepVector get 0 get\n"); + fprintf (fp, " dup /FontBBox get /font-box-box fed\n"); + fprintf (fp, " /FontMatrix get exch /FontMatrix get matrix concatmatrix\n"); + fprintf (fp, " } {\n"); + fprintf (fp, " dup /FontBBox get /font-box-box fed\n"); + fprintf (fp, " /FontMatrix get\n"); + fprintf (fp, " } ifelse /font-box-matrix fed\n"); + #else fprintf (fp, " dup /FontBBox get /font-box-box fed\n"); fprintf (fp, " /FontMatrix get /font-box-matrix fed\n"); + #endif /* EUC_JP */ fprintf (fp, " font-box-box font-box-matrix transform\n"); fprintf (fp, " 4 2 roll font-box-matrix transform\n"); fprintf (fp, " pair-sub \n"); fprintf (fp, "} def\n"); + #if defined(EUC_JP) + if( default_font()->names->ps_name2 ) { + /* 怪しい EUC コンポジットフォントの定義 */ + fprintf (fp, "12 dict begin\n"); + fprintf (fp, " /FontName /DefaultFontName2 def /FontType 0 def /WMode 0 def\n"); + fprintf (fp, " /FMapType 4 def /FontMatrix matrix def /Encoding [0 1] def\n"); + fprintf (fp, " /FDepVector\n"); + fprintf (fp, " [ /%s findfont\n",default_font()->names->ps_name); + fprintf (fp, " /%s findfont\n",default_font()->names->ps_name2); + fprintf (fp, " ] def\n"); + fprintf (fp, " FontName currentdict\n"); + fprintf (fp, "end definefont pop\n"); + fprintf (fp, "/DefaultFontName /DefaultFontName2 def\n"); + } else { + fprintf (fp, "/DefaultFontName /%s def\n", default_font()->names->ps_name); + } + #else fprintf (fp, "/DefaultFontName /%s def\n", default_font()->names->ps_name); + #endif /* EUC_JP */ fprintf (fp, "/BasicDefaultFont DefaultFontName findfont def\n"); fprintf (fp, "/DefaultFontSize Scale round def\n"); fprintf (fp, "/SizeDir 1 def\n"); *************** *** 178,207 **** fprintf (fp, " exch Cols mul add CellsUsed exch true put\n"); fprintf (fp, "} def\n"); fprintf (fp, "\n"); - { - int ri, ci; - for (ri = 0; ri < rows; ++ri) - for (ci = 0; ci < cols; ++ci) - { - struct cell_display * cd = dpy.cells + ri * cols + ci; - if (cd->unclipped) - fprintf (fp, "%d %d setused\n", ri, ci); - } - fprintf (fp, "/Rowy [ \n"); - for (ri = 0; ri < rows; ++ri) - fprintf (fp, " %d\n", dpy.rowy[ri]); - fprintf (fp, "] def\n/Colx [\n"); - for (ci = 0; ci < cols; ++ci) - fprintf (fp, " %d\n", dpy.colx[ci]); - fprintf (fp, "] def\n"); - fprintf (fp, "/Heights [\n"); - for (ri = 0; ri < rows; ++ri) - fprintf (fp, " %d\n", dpy.heights[ri]); - fprintf (fp, "] def\n/Widths [\n"); - for (ci = 0; ci < cols; ++ci) - fprintf (fp, " %d\n", dpy.widths[ci]); - fprintf (fp, "] def\n"); - } fprintf (fp, "\n"); fprintf (fp, "/to-oleo-matrix\n"); fprintf (fp, " 0 PointsTall neg matrix translate \n"); --- 222,227 ---- *************** *** 359,364 **** --- 379,405 ---- fprintf (fp, "{\n"); fprintf (fp, " /CellFont fed\n"); fprintf (fp, " CellFont setfont\n"); + #if defined(EUC_JP) + fprintf (fp, " CellFont /FontType get 0 eq {\n"); + fprintf (fp, " CellFont /FDepVector get 0 get /FontBBox get\n"); + fprintf (fp, " dup dup 0 gget exch 1 gget CellFont /FontMatrix get\n"); + fprintf (fp, " CellFont /FDepVector get 0 get /FontMatrix get matrix concatmatrix\n"); + fprintf (fp, " transform\n"); + fprintf (fp, " neg /CellFontDescent fed\n"); + fprintf (fp, " neg /CellFontLbearing fed\n"); + fprintf (fp, " 3 gget 0 exch CellFont /FontMatrix get\n"); + fprintf (fp, " CellFont /FDepVector get 0 get /FontMatrix get matrix concatmatrix\n"); + fprintf (fp, " transform exch pop\n"); + fprintf (fp, " /CellFontAscent fed\n"); + fprintf (fp, " } {\n"); + fprintf (fp, " CellFont /FontBBox get\n"); + fprintf (fp, " dup dup 0 gget exch 1 gget CellFont /FontMatrix get transform\n"); + fprintf (fp, " neg /CellFontDescent fed\n"); + fprintf (fp, " neg /CellFontLbearing fed 3 gget 0 exch CellFont /FontMatrix get transform exch pop\n"); + fprintf (fp, " /CellFontAscent fed\n"); + fprintf (fp, " } ifelse\n"); + fprintf (fp, "} def\n"); + #else /* EUC_JP */ fprintf (fp, " CellFont /FontBBox get\n"); fprintf (fp, " dup dup 0 gget exch 1 gget CellFont /FontMatrix get transform\n"); fprintf (fp, " neg /CellFontDescent fed\n"); *************** *** 366,371 **** --- 407,413 ---- fprintf (fp, " 3 gget 0 exch CellFont /FontMatrix get transform exch pop\n"); fprintf (fp, " /CellFontAscent fed\n"); fprintf (fp, "} def\n"); + #endif /* EUC_JP */ fprintf (fp, "DefaultFont use-font\n"); fprintf (fp, "\n"); fprintf (fp, "/cell %% str just r c\n"); *************** *** 384,389 **** --- 426,464 ---- fprintf (fp, " cell-s show\n"); fprintf (fp, "} def\n"); fprintf (fp, "\n"); + fprintf (fp, "%%%%EndProlog\n"); + fprintf (fp, "%%%%BeginSetup\n"); + { + struct font_memo *fm; + fprintf (fp, "%%%%IncludeResource: font Times-Roman\n"); + for (fm = font_list; fm; fm = fm->next) + fprintf (fp, "%%%%IncludeResource: font %s\n",fm->names->ps_name); + } + fprintf (fp, "%%%%EndSetup\n"); + { + int ri, ci; + for (ri = 0; ri < rows; ++ri) + for (ci = 0; ci < cols; ++ci) + { + struct cell_display * cd = dpy.cells + ri * cols + ci; + if (cd->unclipped) + fprintf (fp, "%d %d setused\n", ri, ci); + } + fprintf (fp, "/Rowy [ \n"); + for (ri = 0; ri < rows; ++ri) + fprintf (fp, " %d\n", dpy.rowy[ri]); + fprintf (fp, "] def\n/Colx [\n"); + for (ci = 0; ci < cols; ++ci) + fprintf (fp, " %d\n", dpy.colx[ci]); + fprintf (fp, "] def\n"); + fprintf (fp, "/Heights [\n"); + for (ri = 0; ri < rows; ++ri) + fprintf (fp, " %d\n", dpy.heights[ri]); + fprintf (fp, "] def\n/Widths [\n"); + for (ci = 0; ci < cols; ++ci) + fprintf (fp, " %d\n", dpy.widths[ci]); + fprintf (fp, "] def\n"); + } { int ri, ci; struct font_memo * last_font = default_font (); *************** *** 426,431 **** --- 501,507 ---- } } } + fprintf (fp, "%%%%EOF\n"); free_display (&dpy); } diff --recursive --context --minimal --new-file oleo-1.6/printw.c oleo-1.6jb2/printw.c *** oleo-1.6/printw.c Thu Jan 1 09:00:00 1970 --- oleo-1.6jb2/printw.c Mon Feb 3 02:50:23 1997 *************** *** 0 **** --- 1,69 ---- + /* Copyright (C) 1997 Hayashida Kuniaki + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + */ + + #include + #include + + #if defined(EUC_JP) + /* + * 日本語対応 printw + * + * printw が2バイトコードの上位バイトだけを出力していないか確認する。 + * 上位バイトだけが出力されている場合、'#'に置き換える。 + * + * チェックは完全ではないので、信用しないこと + * + * あなたのシステムの curses が真に日本語対応していれば、不要ですので + * 使わないでください。 + * + * 復帰値 + * エラーが発生した時 ERR + * 正常ならばそれ以外 + */ + + #define ERASE_CHAR ('#') + + #if PRINTW_CONST + int + printw(const char *fmt, ...) + #else + /* for Solaris for x86 */ + printw(char *fmt, ...) + #endif + { + va_list ap; /* 可変長引数処理 */ + static unsigned char buf[1024]; /* バッファの大きさに根拠なし */ + int len; /* vsprintf の出力の長さ */ + int i; /* 制御変数 */ + int ch; + + va_start(ap, fmt); + vsprintf(buf, fmt, ap); + va_end(ap); + /* Check Last Char and Replace to space */ + len = strlen(buf); + for( i = 0 ; i < len ; ) { + ch = buf[i++]; + if( ch > 0xa0 && ch < 0xff ) { + if( buf[i] <= 0xa0 || buf[i] >= 0xff ) { + buf[i-1] = ERASE_CHAR; + } else { + i++; + } + } + } + return addstr(buf); + } + + #endif /* defined(EUC_JP) */ diff --recursive --context --minimal --new-file oleo-1.6/stubs.h oleo-1.6jb2/stubs.h *** oleo-1.6/stubs.h Sat Jun 4 01:21:28 1994 --- oleo-1.6jb2/stubs.h Mon Oct 14 02:04:09 1996 *************** *** 52,54 **** --- 52,55 ---- STUB4 ("irii", stub_irii, (int), integer, int, &, range, struct rng *, (int), integer, int, (int), integer, int) STUB5 ("siisi", stub_siisi, (char *), string, char *, (int), integer, int, (int), integer, int, (char *), string, char *, (int), integer, int) + STUB5 ("sssss", stub_sssss, (char *), string, char *, (char *), string, char *, (char *), string, char *,(char *), string, char *,(char *), string, char *) diff --recursive --context --minimal --new-file oleo-1.6/utils.c oleo-1.6jb2/utils.c *** oleo-1.6/utils.c Sat Jun 4 12:52:28 1994 --- oleo-1.6jb2/utils.c Sat Mar 15 14:46:10 1997 *************** *** 16,21 **** --- 16,22 ---- along with Oleo; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + #include #include #include #include "sysdef.h" *************** *** 68,74 **** --- 69,77 ---- #endif /* _DEBUG_MALLOC_INC */ extern int sys_nerr; + #if !(defined(BSD) && ((BSD)>=199306)) extern char *sys_errlist[]; + #endif /* !(defined(BSD) && ((BSD)>=199306)) */ struct id { *************** *** 761,767 **** #endif /* ndef _DEBUG_MALLOC_INC */ #ifdef __STDC__ ! char * err_msg (void) #else char * --- 764,770 ---- #endif /* ndef _DEBUG_MALLOC_INC */ #ifdef __STDC__ ! const char * err_msg (void) #else char * diff --recursive --context --minimal --new-file oleo-1.6/utils.h oleo-1.6jb2/utils.h *** oleo-1.6/utils.h Sat Jun 4 01:21:39 1994 --- oleo-1.6jb2/utils.h Fri Nov 8 01:02:55 1996 *************** *** 43,49 **** extern int string_to_char (char **); extern FILE *xopen_with_backup (const char *,const char *); extern int xclose (FILE *); ! extern char *err_msg (void); extern char *mk_sprintf (char *, ...); extern void init_mem (void); --- 43,49 ---- extern int string_to_char (char **); extern FILE *xopen_with_backup (const char *,const char *); extern int xclose (FILE *); ! extern const char *err_msg (void); extern char *mk_sprintf (char *, ...); extern void init_mem (void); diff --recursive --context --minimal --new-file oleo-1.6/window.c oleo-1.6jb2/window.c *** oleo-1.6/window.c Sat Jun 4 01:21:45 1994 --- oleo-1.6jb2/window.c Mon Mar 17 00:07:21 1997 *************** *** 1299,1307 **** scratch = *out; out->alloc = 0; out->buf = 0; ! sprint_line (out, "%sW;N%d;A%u %u;C%d %d %d;O%s\n", scratch.buf, n + 1, wins[n].win_curow, wins[n].win_cucol, ! 7, 0, 7, buf + 1); free (scratch.buf); } } --- 1299,1314 ---- scratch = *out; out->alloc = 0; out->buf = 0; ! /* By K.Hayashida 1996 */ ! if(buf[0]=='\0') { ! sprint_line (out, "%sW;N%d;A%u %u;C%d %d %d\n", scratch.buf, n + 1, wins[n].win_curow, wins[n].win_cucol, ! 7, 0, 7); ! } else { ! sprint_line (out, "%sW;N%d;A%u %u;C%d %d %d;O%s\n", ! scratch.buf, n + 1, wins[n].win_curow, wins[n].win_cucol, ! 7, 0, 7, buf + 1); /* buf[0] は ',' */ ! } free (scratch.buf); } } *************** *** 1578,1583 **** --- 1585,1592 ---- io_set_input_status (ui, us, 0); nwin = 1; wins = cwin = ck_malloc (sizeof (struct window)); + /* 1996.Feb, 4 By K.Hayashida ,init window struct */ + bzero(cwin,sizeof(struct window)); wins->id = win_id++; wins->win_over = 0; /* This will be fixed by a future set_numcols */ wins->win_down = (label_rows diff --recursive --context --minimal --new-file oleo-1.6/xrdb.c oleo-1.6jb2/xrdb.c *** oleo-1.6/xrdb.c Sat Jun 4 14:06:18 1994 --- oleo-1.6jb2/xrdb.c Sat Mar 15 14:46:54 1997 *************** *** 39,45 **** #endif /* alloca not defined. */ #include - #include "sysdef.h" #if HAVE_SYSINFO #include #endif --- 39,44 ---- *************** *** 47,55 **** /* This should be included before the X include files; otherwise, we get warnings about redefining NULL under BSD 4.3. */ #include ! #define NeedFunctionPrototypes 0 #include #include #include #include #include --- 46,56 ---- /* This should be included before the X include files; otherwise, we get warnings about redefining NULL under BSD 4.3. */ #include ! #define NeedFunctionPrototypes 1 #include + #define XLIB_ILLEGAL_ACCESS #include + #undef XLIB_ILLEGAL_ACCESS #include #include #include *************** *** 58,63 **** --- 59,65 ---- #else #include #endif + #include "sysdef.h" /* * Already included via sysdef.h