rxvt-2.7.10004075500001440000024000000000000764024425100111675ustar gcwstaffrxvt-2.7.10/autoconf004075500001440000024000000000000764024424100130045ustar gcwstaffrxvt-2.7.10/autoconf/aclocal.m4010064400001440000024000000001600707626165300147260ustar gcwstaffdnl> $Id: aclocal.m4,v 1.3 2000/04/16 06:54:35 gcw Exp $ builtin(include, xpm.m4) builtin(include, libtool.m4) rxvt-2.7.10/autoconf/config.sub010075500001440000024000000716740754622527200150720ustar gcwstaff#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. timestamp='2002-09-05' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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 of the License, 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., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa64 | mipsisa64el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39 | mipstx39el \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3d) basic_machine=alpha-cray os=-unicos ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic4x | c4x*) basic_machine=tic4x-unknown os=-coff ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; windows32) basic_machine=i386-pc os=-windows32-msvcrt ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto*) os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: rxvt-2.7.10/autoconf/config.guess010075500001440000024000001157630754622527200154250ustar gcwstaff#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. timestamp='2002-09-03' # This file 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 of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # This shell variable is my proudest work .. or something. --bje set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; (old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; dummy=$tmpdir/dummy ; files="$dummy.c $dummy.o $dummy.rel $dummy" ; trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; rm -f $files ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; unset files' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. eval $set_cc_for_build cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; 3-1307) UNAME_MACHINE="alphaev7" ;; esac fi rm -f $dummy.s $dummy && rmdir $tmpdir echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 rm -f $dummy.c $dummy && rmdir $tmpdir echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 rm -f $dummy.c $dummy && rmdir $tmpdir echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy && rmdir $tmpdir fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 rm -f $dummy.c $dummy && rmdir $tmpdir echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` rm -f $dummy.c && rmdir $tmpdir echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:3*) echo i386-pc-interix3 exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i386-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` rm -f $dummy.c && rmdir $tmpdir test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` rm -f $dummy.c && rmdir $tmpdir test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 rm -f $dummy.c $dummy && rmdir $tmpdir # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: rxvt-2.7.10/autoconf/mkinstalldirs010075500001440000024000000012110651657462400156750ustar gcwstaff#!/bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Last modified: 1994-03-25 # Public domain errstatus=0 for file in ${1+"$@"} ; do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || errstatus=$? fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here rxvt-2.7.10/autoconf/install-sh010075500001440000024000000112440651657462400151020ustar gcwstaff#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # 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. # # 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}" tranformbasename="" 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 rxvt-2.7.10/autoconf/Make.common.in010064400001440000024000000036060740157562000155640ustar gcwstaff# autoconf/Make.common.in -*- Makefile -*- # release date (man), LSM date, version number/name, current maintainer DATE=@DATE@ LSMDATE=@LSMDATE@ VERSION=@VERSION@ VERNAME=rxvt-$(VERSION)# MAINT=Geoff Wing# MAINTEMAIL=# WEBMAINT=Oezguer Kesim# WEBMAINTEMAIL=# WEBPAGE=# FTPSITENAME=ftp.rxvt.org# FTPSITEDIR=/pub/rxvt# #------------------------------------------------------------------------- RXVTNAME=@RXVTNAME@ SHELL = /bin/sh # This variable makes it possible to move the installation root to another # directory. This is useful when you're creating a binary distribution # If empty, normal root will be used. # You can run eg. 'make install DESTDIR=/packages/rxvt-xx' to accomplish # that. # DESTDIR = /usr/local/X11/$(VERNAME) # Installation target directories & other installation stuff prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ mandir = @mandir@/man1 manext = 1 # Tools & program stuff CC = @CC@ CPP = @CPP@ MV = @MV@ RM = @RM@ RMF = @RM@ -f CP = @CP@ LN = @LN@ SED = @SED@ AWK = @AWK@ ECHO = @ECHO@ CMP = @CMP@ TBL = @TBL@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL@ -m 755 INSTALL_DATA = @INSTALL@ -m 644 # Flags & libs # add -DBINDIR=\""$(bindir)/"\" to CPPFLAGS, if we need to spawn a program CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ @XPM_CPPFLAGS@ LDFLAGS = @LDFLAGS@ DEFS = @DEFS@ LIBS = @LIBS@ DINCLUDE = @DINCLUDE@ DLIB = @DLIB@ # X Include directory XINC = @X_CFLAGS@ @XPM_CFLAGS@ # extra libraries needed by X on some systems, X library location XLIB = @X_LIBS@ @XPM_LIBS@ -lX11 @X_EXTRA_LIBS@ LIBTOOL = @LIBTOOL@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(DEBUG) $(DINCLUDE) $(XINC) -I$(basedir) -I$(srcdir) -I. LINK = $(CC) $(CFLAGS) $(LDFLAGS) # End of common section of the Makefile #------------------------------------------------------------------------- rxvt-2.7.10/autoconf/config.h.in010064400001440000024000000246760762502135300151220ustar gcwstaff/* autoconf/config.h.in. Generated from autoconf/configure.in by autoheader. */ /* Define if you want support for Greek Elot-928 & IBM-437 keyboard */ #undef GREEK_SUPPORT /* Define if you want the depth of scrollbars and menus to be less */ #undef HALFSHADOW /* Define to 1 if you have the header file. */ #undef HAVE_ASSERT_H /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define if you have _GNU_SOURCE getpt() */ #undef HAVE_GETPT /* Define to 1 if you have the `grantpt' function. */ #undef HAVE_GRANTPT /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `isastream' function. */ #undef HAVE_ISASTREAM /* Define to 1 if you have the header file. */ #undef HAVE_LASTLOG_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `nanosleep' function. */ #undef HAVE_NANOSLEEP /* Define if nl_langinfo(CODESET) works */ #undef HAVE_NL_LANGINFO /* Define to 1 if you have the `on_exit' function. */ #undef HAVE_ON_EXIT /* Define to 1 if you have the `openpty' function. */ #undef HAVE_OPENPTY /* Define to 1 if you have the `revoke' function. */ #undef HAVE_REVOKE /* Define to 1 if you have the `seteuid' function. */ #undef HAVE_SETEUID /* Define if plain old setlocale works */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `setpgid' function. */ #undef HAVE_SETPGID /* Define to 1 if you have the `setpgrp' function. */ #undef HAVE_SETPGRP /* Define to 1 if you have the `setreuid' function. */ #undef HAVE_SETREUID /* Define to 1 if you have the `setsid' function. */ #undef HAVE_SETSID /* Define to 1 if you have the `setutent' function. */ #undef HAVE_SETUTENT /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define if utmp.h or lastlog.h has struct lastlog */ #undef HAVE_STRUCT_LASTLOG /* Define if utmpx.h or lastlog.h has struct lastlogx */ #undef HAVE_STRUCT_LASTLOGX /* Define if utmp.h has struct utmp */ #undef HAVE_STRUCT_UTMP /* Define if utmpx.h has struct utmpx */ #undef HAVE_STRUCT_UTMPX /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BYTEORDER_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STRREDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the `ttyslot' function. */ #undef HAVE_TTYSLOT /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unlockpt' function. */ #undef HAVE_UNLOCKPT /* Define to 1 if you have the `unsetenv' function. */ #undef HAVE_UNSETENV /* Define to 1 if you have the `updwtmp' function. */ #undef HAVE_UPDWTMP /* Define to 1 if you have the header file. */ #undef HAVE_UTMPX_H /* Define if struct utmpx contains ut_host */ #undef HAVE_UTMPX_HOST /* Define to 1 if you have the header file. */ #undef HAVE_UTMP_H /* Define if struct utmp contains ut_host */ #undef HAVE_UTMP_HOST /* Define if struct utmp contains ut_pid */ #undef HAVE_UTMP_PID /* Define if Xlocale support works */ #undef HAVE_XLOCALE /* Define if you have XPointer typedef */ #undef HAVE_XPOINTER /* Define if setlocale (defined to Xsetlocale) works */ #undef HAVE_XSETLOCALE /* Define to 1 if you have the `_getpty' function. */ #undef HAVE__GETPTY /* Define if lastlog is provided via a directory */ #undef LASTLOG_IS_DIR /* Define if you want to have lastlog support when utmp/utmpx is enabled */ #undef LASTLOG_SUPPORT /* Build shared library version - specify via configure only */ #undef LIBRXVT /* Define if you want Menubar support */ #undef MENUBAR /* Define to have CTRL cause wheel events to accelerate scrolling. Release CTRL to halt scrolling */ #undef MOUSE_SLIP_WHEELING /* Define to use wheel events (button4 and button5) to scroll */ #undef MOUSE_WHEEL /* Define default multichar glyph encoding */ #undef MULTICHAR_ENCODING /* Define to enable multichar glyph language support */ #undef MULTICHAR_SET /* Support NeXT style scrollbars - specify via configure only */ #undef NEXT_SCROLLBAR /* Define if you don't want support for the backspace key */ #undef NO_BACKSPACE_KEY /* Define if you don't want support for the (non-keypad) delete key */ #undef NO_DELETE_KEY /* Define if you don't want handling for rarely used features */ #undef NO_FRILLS /* Define if you don't want support linespace */ #undef NO_LINESPACE /* Define to remove xterm style mouse selection */ #undef NO_NEW_SELECTION /* Define to remove old rxvt (ver 2.20 and before) style selection */ #undef NO_OLD_SELECTION /* Define if you don't want any resources read */ #undef NO_RESOURCES /* Define for continual scrolling when you keep the scrollbar button pressed */ #undef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING /* Disable the secondary screen. Many programs use the secondary screen as their workplace */ #undef NO_SECONDARY_SCREEN /* Define if you don't need to use our replacement string functions */ #undef NO_STRINGS /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to use a 24 bit visual if the screen has 24 bit mode */ #undef PREFER_24BIT /* Define if you need function prototypes */ #undef PROTOTYPES /* Define for first char in devptyXX */ #undef PTYCHAR1 /* Define for second char in devptyXX */ #undef PTYCHAR2 /* Define for this pty type */ #undef PTYS_ARE_CLONE /* Define for this pty type */ #undef PTYS_ARE_GETPT /* Define for this pty type */ #undef PTYS_ARE_GETPTY /* Define for this pty type */ #undef PTYS_ARE_NUMERIC /* Define for this pty type */ #undef PTYS_ARE_OPENPTY /* Define for this pty type */ #undef PTYS_ARE_PTC /* Define for this pty type */ #undef PTYS_ARE_PTMX /* Define for this pty type */ #undef PTYS_ARE_SEARCHED /* Define for this pty type */ #undef PTYS_ARE__GETPTY /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define if you want Rob Nation's own graphic mode */ #undef RXVT_GRAPHICS /* Define location of lastlogx */ #undef RXVT_LASTLOGX_FILE /* Define location of lastlog */ #undef RXVT_LASTLOG_FILE /* Support Rxvt original style scrollbars - specify via configure only */ #undef RXVT_SCROLLBAR /* Set TERMINFO value to the value given by configure */ #undef RXVT_TERMINFO /* Define location of utmpx */ #undef RXVT_UTMPX_FILE /* Define location of utmp */ #undef RXVT_UTMP_FILE /* Define location of wtmpx */ #undef RXVT_WTMPX_FILE /* Define location of wtmp */ #undef RXVT_WTMP_FILE /* The size of a `char', as computed by sizeof. */ #undef SIZEOF_CHAR /* The size of a `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of a `int *', as computed by sizeof. */ #undef SIZEOF_INT_P /* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of a `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG /* The size of a `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* Define to use "smart" resize behavior */ #undef SMART_RESIZE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Set TERM to the value given by configure */ #undef TERMENV /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define if you want your background to use the parent window background */ #undef TRANSPARENT /* Define location of ttys/ttytab */ #undef TTYTAB_FILENAME /* Define if you want 256 colour support */ #undef TTY_256COLOR /* Define to change gid of ttys to group tty */ #undef TTY_GID_SUPPORT /* Define if you want to use XGetDefault instead of our internal version */ #undef USE_XGETDEFAULT /* Define if you want to have XIM (X Input Method) protocol support - required for multibyte characters input */ #undef USE_XIM /* Define if you want to have utmp/utmpx support */ #undef UTMP_SUPPORT /* Define if you want to have wtmp support when utmp/utmpx is enabled */ #undef WTMP_SUPPORT /* Define if you want to have sexy-looking background pixmaps. Needs libXpm */ #undef XPM_BACKGROUND /* Define if you include on a normal include path (be careful) */ #undef XPM_INC_X11 /* Support Xterm style scrollbars - specify via configure only */ #undef XTERM_SCROLLBAR /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define as `__inline' if that's what the C compiler calls it, or to nothing if it is not supported. */ #undef inline /* Define to `int' if does not define. */ #undef mode_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `int' if doesn't define. */ #undef uid_t rxvt-2.7.10/autoconf/configure.in010064400001440000024000001232470763200227300154000ustar gcwstaffdnl# -*- sh -*- dnl# dnl# $Id: configure.in,v 1.126 2003/03/07 02:32:17 gcw Exp $ dnl# dnl# Process this file with autoconf to produce a configure script. dnl# AC_INIT(src/feature.h) AC_CONFIG_AUX_DIR(autoconf) AC_CONFIG_HEADER(config.h:autoconf/config.h.in) dnl RXVT version changequote(, )dnl VERSION=`sed -n -e 's/^.*[ \t]VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` DATE=`sed -n -e 's/^.*[ \t]DATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` LSMDATE=`sed -n -e 's/^.*[ \t]LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` LIBVERSION=`sed -n -e 's/^.*[ \t]LIBVERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` changequote([, ])dnl AC_SUBST(VERSION)dnl AC_SUBST(DATE)dnl AC_SUBST(LSMDATE)dnl AC_SUBST(LIBVERSION)dnl echo "" echo "configuring for rxvt $VERSION" echo "" dnl# Checks for programs. dnl AC_MAKE_SET AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_AWK dnl# system hacks AC_AIX AC_ISC_POSIX AC_ENABLE_SHARED(no)dnl# libtool AC_ENABLE_STATIC(yes)dnl# libtool AC_PROG_LIBTOOL()dnl# libtool MALLOC_TYPE=S support_addstrings=no support_frills=no support_linespace=no support_graphics=no support_inheritpixmap=no support_keepscrolling=no support_menubar=no support_mousewheel=no support_mouseslipwheel=no support_oldselection=no support_utmp=no support_wtmp=no support_lastlog=no support_xim=no support_xpm=no support_scroll_rxvt=no support_scroll_next=no support_scroll_xterm=no multichar_set=no dnl# -------------------------------------------------------------------------- dnl# CHECKING COMMAND LINE OPTIONS dnl# -------------------------------------------------------------------------- if test "x$enable_shared" = xyes; then AC_DEFINE(LIBRXVT, 1, Build shared library version - specify via configure only) INSTALL_LIBRXVT=yes fi AC_SUBST(INSTALL_LIBRXVT) AC_ARG_ENABLE(everything, [ --enable-everything enable standard non-multichoice features: marked * NOTE: this option is order dependent NOTE: automatically enabled with --enable-shared], [if test x$enableval = xyes; then support_24bit=yes support_frills=yes support_linespace=yes support_graphics=yes support_inheritpixmap=yes support_keepscrolling=yes support_lastlog=yes support_menubar=yes support_mousewheel=yes support_mouseslipwheel=yes support_oldselection=yes support_scroll_rxvt=yes support_scroll_next=yes support_scroll_xterm=yes support_utmp=yes support_wtmp=yes support_xim=yes support_xpm=yes fi]) AC_ARG_ENABLE(languages, [ --enable-languages enable multichar glyph language support], [if test x$enableval = xyes; then AC_DEFINE(MULTICHAR_SET, 1, Define to enable multichar glyph language support) multichar_set=yes fi]) AC_ARG_WITH(encoding, [ --with-encoding=NAME set language default encoding to NAME (default: sjis) (eucj|sjis|big5|gb|kr|noenc)], [if test x$enableval = xyes; then withval=`echo $withval | tr '[a-z]' '[A-Z]'` AC_DEFINE_UNQUOTED(MULTICHAR_ENCODING, $withval, Define default multichar glyph encoding) fi]) AC_ARG_ENABLE(utmp, [ --enable-utmp enable utmp (utmpx) support *], [if test x$enableval = xyes -o x$enableval = xno; then support_utmp=$enableval fi]) AC_ARG_ENABLE(wtmp, [ --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)*], [if test x$enableval = xyes -o x$enableval = xno; then support_wtmp=$enableval fi]) AC_ARG_ENABLE(lastlog, [ --enable-lastlog enable lastlog support (requires --enable-utmp) *], [if test x$enableval = xyes -o x$enableval = xno; then support_lastlog=$enableval fi]) AC_ARG_ENABLE(xpm-background, [ --enable-xpm-background enable XPM background pixmaps *], [if test x$enableval = xyes -o x$enableval = xno; then support_xpm=$enableval fi]) AC_ARG_ENABLE(transparency, [ --enable-transparency enable transparent backgrounds *], [if test x$enableval = xyes -o x$enableval = xno; then support_inheritpixmap=$enableval fi]) AC_ARG_ENABLE(menubar, [ --enable-menubar enable menubar *], [if test x$enableval = xyes -o x$enableval = xno; then support_menubar=$enableval fi]) AC_ARG_ENABLE(graphics, [ --enable-graphics enable rxvt own graphics mode (see src/graphics) *], [if test x$enableval = xyes -o x$enableval = xno; then support_graphics=$enableval fi]) AC_ARG_ENABLE(rxvt-scroll, [ --enable-rxvt-scroll enable rxvt style scrollbar *], [if test x$enableval = xyes; then support_scroll_rxvt=yes fi]) AC_ARG_ENABLE(next-scroll, [ --enable-next-scroll enable NeXT style scrollbar *], [if test x$enableval = xyes; then support_scroll_next=yes fi]) AC_ARG_ENABLE(xterm-scroll, [ --enable-xterm-scroll enable Xterm style scrollbar *], [if test x$enableval = xyes; then support_scroll_xterm=yes fi]) AC_ARG_ENABLE(half-shadow, [ --enable-half-shadow use half width/height shadow on rxvt scrollbar], [if test x$enableval = xyes; then AC_DEFINE(HALFSHADOW, 1, Define if you want the depth of scrollbars and menus to be less) fi]) AC_ARG_ENABLE(xim, [ --enable-xim XIM (X Input Method) protocol support *], [if test x$enableval = xyes -o x$enableval = xno; then support_xim=$enableval fi]) AC_ARG_ENABLE(greek, [ --enable-greek enable greek keyboard support], [if test x$enableval = xyes; then AC_DEFINE(GREEK_SUPPORT, 1, Define if you want support for Greek Elot-928 & IBM-437 keyboard) OBJGRKELOT="grkelot.o" fi]) AC_ARG_ENABLE(ttygid, [ --enable-ttygid enable tty setting to group named "tty"], [if test x$enableval = xyes; then AC_DEFINE(TTY_GID_SUPPORT, 1, Define to change gid of ttys to group tty) fi]) AC_ARG_ENABLE(backspace-key, [ --disable-backspace-key disable handling of the backspace key], [if test x$enableval = xno; then AC_DEFINE(NO_BACKSPACE_KEY, 1, Define if you don't want support for the backspace key) fi]) AC_ARG_ENABLE(delete-key, [ --disable-delete-key disable handling of the delete key], [if test x$enableval = xno; then AC_DEFINE(NO_DELETE_KEY, 1, Define if you don't want support for the (non-keypad) delete key) fi]) AC_ARG_ENABLE(resources, [ --disable-resources disable all resource checking], [if test x$enableval = xno; then AC_DEFINE(NO_RESOURCES, 1, Define if you don't want any resources read) fi]) AC_ARG_ENABLE(xgetdefault, [ --enable-xgetdefault enable resources via X instead of our small version], [if test x$enableval = xyes; then AC_DEFINE(USE_XGETDEFAULT, 1, Define if you want to use XGetDefault instead of our internal version) fi]) AC_ARG_ENABLE(strings, [ --enable-strings enable some replacement system functions], [if test x$enableval = xyes -o x$enableval = xno; then support_addstrings=$enableval fi]) AC_ARG_ENABLE(swapscreen, [ --disable-swapscreen disable swap screen support], [if test x$enableval = xno; then AC_DEFINE(NO_SECONDARY_SCREEN, 1, Disable the secondary screen. Many programs use the secondary screen as their workplace) fi]) AC_ARG_ENABLE(frills, [ --enable-frills enable support for rarely used features *], [if test x$enableval = xyes -o x$enableval = xno; then support_frills=$enableval fi]) AC_ARG_ENABLE(linespace, [ --enable-linespace enable support for linespace *], [if test x$enableval = xyes -o x$enableval = xno; then support_linespace=$enableval fi]) AC_ARG_ENABLE(24bit, [ --enable-24bit enable support for using 24bit visuals if available *], [if test x$enableval = xyes -o x$enableval = xno; then support_24bit=$enableval fi]) AC_ARG_ENABLE(keepscrolling, [ --enable-keepscrolling enable continual scrolling on scrollbar arrow press *], [if test x$enableval = xyes -o x$enableval = xno; then support_keepscrolling=$enableval fi]) AC_ARG_ENABLE(mousewheel, [ --enable-mousewheel enable scrolling via mouse wheel or buttons 4 & 5 *], [if test x$enableval = xyes -o x$enableval = xno; then support_mousewheel=$enableval fi]) AC_ARG_ENABLE(slipwheeling, [ --enable-slipwheeling enable slip wheel scrolling (requires previous) *], [if test x$enableval = xyes -o x$enableval = xno; then support_mouseslipwheel=$enableval fi]) AC_ARG_ENABLE(old-selection, [ --enable-old-selection enable v2.20 (& prior) mouse selection style support*], [if test x$enableval = xyes -o x$enableval = xno; then support_oldselection=$enableval fi]) AC_ARG_ENABLE(new-selection, [ --disable-new-selection disable new mouse (xterm) selection style support], [if test x$enableval = xno; then AC_DEFINE(NO_NEW_SELECTION, 1, Define to remove xterm style mouse selection) fi]) AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc enable Gray Watson's malloc - for debugging use], [if test x$enableval = xyes; then MALLOC_TYPE=G DEBUG=-DDEBUG_MALLOC DLIB="-L/usr/local/lib -ldmalloc" DINCLUDE=-I/usr/local/include fi]) AC_ARG_ENABLE(dlmalloc, [ --enable-dlmalloc enable Doug Lea's malloc - for production use NOTE: enable only one malloc package], [if test x$enableval = xyes; then MALLOC_TYPE=D DEBUG= DLIB="-L/usr/local/lib -ldlmalloc" DINCLUDE= fi]) AC_ARG_ENABLE(smart-resize, [ --enable-smart-resize enable smart growth/shrink behaviour], [if test x$enableval = xyes; then AC_DEFINE(SMART_RESIZE, 1, Define to use "smart" resize behavior) fi]) AC_ARG_ENABLE(256-color, [ --enable-256-color enable 256-color support], [if test x$enableval = xyes; then AC_DEFINE(TTY_256COLOR, 1, Define if you want 256 colour support) fi]) AC_ARG_WITH(term, [ --with-term=NAME set the terminal to NAME (default \"xterm\")], [if test x$withval != x; then AC_DEFINE_UNQUOTED(TERMENV, "$withval",Set TERM to the value given by configure) term="$withval" fi]) AC_ARG_WITH(terminfo, [ --with-terminfo=PATH set the path to the terminfo tree to PATH], [if test x$withval != x; then AC_DEFINE_UNQUOTED(RXVT_TERMINFO, "$withval", Set TERMINFO value to the value given by configure) terminfo="$withval" fi]) dnl# -------------------------------------------------------------------------- AC_DEFINE(PROTOTYPES, 1, Define if you need function prototypes) dnl# -------------------------------------------------------------------------- dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure' dnl# if test -z "$CFLAGS"; then if test -z "$CCOPTS"; then CCOPTS='-O' dnl> if test "x$GCC" = xyes; then dnl> if test x$system = xLinux; then dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce' dnl> fi dnl> fi fi CFLAGS="$CCOPTS" fi AC_PATH_PROG(MV, mv, mv) AC_PATH_PROG(RM, rm, rm) AC_PATH_PROG(CP, cp, cp) AC_PATH_PROG(LN, ln, ln) AC_PATH_PROG(SED, sed, sed) AC_PATH_PROG(ECHO, echo, echo) AC_PATH_PROG(CMP, cmp, cmp) AC_PATH_PROG(TBL, tbl) dnl# need a neat way to detect SVR4 or its features dnl# in src/command.c we use these functions: dnl# grantpt(), unlockpt(), ptsname(), which are defined in dnl# - but are these also defined for other systems? dnl# hack to find if this is SVR4 -- who knows? dnl## AC_MSG_CHECKING(for SVR4) dnl## AC_EGREP_CPP(yes, dnl## [#if defined (SVR4) || defined (_SVR4) || defined (__svr4__) dnl## yes; dnl## #endif dnl## ], [AC_MSG_RESULT(yes); AC_DEFINE(PERHAPS_SVR4)], AC_MSG_RESULT(perhaps not?)) AC_PATH_XTRA dnl# the only reasonable way to find libXpm is do-it-yourself dnl# only check if we want xpm-background if test x$support_xpm = xyes; then VT_FIND_LIBXPM if test x$no_xpm = xyes; then support_xpm=needsmanualspecification fi fi dnl# -------------------------------------------------------------------------- dnl# CHECKING FOR HEADER FILES dnl# -------------------------------------------------------------------------- AC_HEADER_SYS_WAIT AC_CHECK_HEADERS( \ assert.h \ fcntl.h \ grp.h \ libc.h \ lastlog.h \ stdarg.h \ stdlib.h \ string.h \ termios.h \ unistd.h \ sys/byteorder.h \ sys/ioctl.h \ sys/select.h \ sys/sockio.h \ sys/strredir.h \ sys/time.h \ utmp.h \ utmpx.h \ ) AC_HEADER_TIME dnl# check to allow both and AC_CACHE_CHECK(whether termios.h and sys/ioctl.h may both be included, rxvt_cv_header_sysioctl, [AC_TRY_COMPILE([#include #include #ifdef HAVE_TERMIOS_H #include #endif], [int a = ECHO;], rxvt_cv_header_sysioctl=yes, rxvt_cv_header_sysioctl=no)]) dnl# ELF systems may want to store paths for dynamic libraries. dnl# Lets see if the compiler can accept "-Rpath" or "-Wl,-Rpath" dnl# At least one version of SunOS wants "-R path" but it's not checked yet. if test -n "$GCC"; then LDARG="-Wl," else LDARG="" fi changequote(, )dnl R_TRANSLATE='s/-L\([^ ]*\)/-L\1 '$LDARG'-rpath '$LDARG'\1/g' changequote([, ])dnl ac_save_CFLAGS=$CFLAGS ac_save_LIBS=$LIBS CFLAGS="$CFLAGS $X_CFLAGS" LIBS=`echo "$LIBS $X_LIBS $X_EXTRA_LIBS -lX11" | sed "$R_TRANSLATE"` AC_CACHE_CHECK([for -rpath dynamic library path recording], rxvt_cv_rpath, [AC_TRY_RUN([ main() { exit(0); (void) XOpenDisplay("foobar"); }], rxvt_cv_rpath=yes, rxvt_cv_rpath=no, dnl AC_MSG_WARN([You may need to check the LIBS line]))]) if test x$rxvt_cv_rpath != xyes; then changequote(, )dnl R_TRANSLATE='s/-L\([^ ]*\)/-L\1 '$LDARG'-R\1/g' changequote([, ])dnl LIBS=`echo "$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11" | sed "$R_TRANSLATE"` AC_CACHE_CHECK([for -R dynamic library path recording], rxvt_cv_R, [AC_TRY_RUN([ main() { exit(0); (void) XOpenDisplay("foobar"); }], rxvt_cv_R=yes, rxvt_cv_R=no, rxvt_cv_R=no)]) if test x$rxvt_cv_R != xyes; then LIBS="$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11" fi fi AC_CACHE_CHECK([for XPointer], rxvt_cv_xpointer, [AC_TRY_COMPILE([#include ], [XPointer dummy;], rxvt_cv_xpointer=yes, rxvt_cv_xpointer=no)]) if test x$rxvt_cv_xpointer = xyes; then AC_DEFINE(HAVE_XPOINTER, 1, Define if you have XPointer typedef) fi LIBS=$ac_save_LIBS CFLAGS=$ac_save_CFLAGS AC_C_CONST AC_C_INLINE dnl> AC_HEADER_STDC dnl# skip this test, Sun always fails anyhow. dnl# -------------------------------------------------------------------------- dnl# CHECKING FOR MISSING TYPEDEFS dnl# -------------------------------------------------------------------------- dnl# Missing typedefs and replacements AC_TYPE_MODE_T dnl> AC_CHECK_TYPE(umode_t, int) dnl> AC_CHECK_TYPE(off_t, long) AC_TYPE_PID_T AC_TYPE_UID_T AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(long long, 8) AC_CHECK_SIZEOF(int *, 4) dnl# see usage below AC_DEFUN(RXVT_CHECK_SIZE, [AC_CACHE_CHECK([for $2], $1, [AC_TRY_COMPILE([#include ], $2 dummy;, [$1=yes], [dnl if test $ac_cv_sizeof_char -ge $3; then $1="$4 char" else if test $ac_cv_sizeof_short -ge $3; then $1="$4 short" else if test $ac_cv_sizeof_int -ge $3; then $1="$4 int" else if test $ac_cv_sizeof_long -ge $3; then $1="$4 long" else if test $ac_cv_sizeof_long_long -ge $3; then $1="$4 long long" else $1="$4 $5" # we _must_ have a (possibly wrong) default fi fi fi fi fi])])] if test x"$$1" != xyes; then $6="typedef $$1 $2;" else if test x"$4" = x; then $6="/* typedef $5 $2; */" else $6="/* typedef $4 $5 $2; */" fi fi dnl ) dnl# dnl# Look for types the system may know about anyway. dnl# RXVT_CHECK_SIZE(rxvt_cv_int16_t, int16_t, 2, , short, rxvt_int16_typedef) AC_SUBST(rxvt_int16_typedef) RXVT_CHECK_SIZE(rxvt_cv_u_int16_t, u_int16_t, 2, unsigned, short, rxvt_u_int16_typedef) AC_SUBST(rxvt_u_int16_typedef) RXVT_CHECK_SIZE(rxvt_cv_int32_t, int32_t, 4, , int, rxvt_int32_typedef) AC_SUBST(rxvt_int32_typedef) RXVT_CHECK_SIZE(rxvt_cv_u_int32_t, u_int32_t, 4, unsigned, int, rxvt_u_int32_typedef) AC_SUBST(rxvt_u_int32_typedef) RXVT_CHECK_SIZE(rxvt_cv_int64_t, int64_t, 8, , long long, rxvt_int64_typedef) AC_SUBST(rxvt_int64_typedef) RXVT_CHECK_SIZE(rxvt_cv_u_int64_t, u_int64_t, 8, unsigned, long long, rxvt_u_int64_typedef) AC_SUBST(rxvt_u_int64_typedef) dnl# dnl# Now look for another we use dnl# if test $ac_cv_sizeof_int_p -eq 8; then rxvt_intp_define="#define intp_t int64_t" rxvt_u_intp_define="#define u_intp_t u_int64_t" else if test $ac_cv_sizeof_int_p -eq 4; then rxvt_intp_define="#define intp_t int32_t" rxvt_u_intp_define="#define u_intp_t u_int32_t" else if test $ac_cv_sizeof_int_p -eq 2; then rxvt_intp_define="#define intp_t int16_t" rxvt_u_intp_define="#define u_intp_t u_int16_t" else rxvt_intp_define="#error set intp_t" rxvt_u_intp_define="#error set u_intp_t" fi fi fi AC_SUBST(rxvt_intp_define) AC_SUBST(rxvt_u_intp_define) dnl# -------------------------------------------------------------------------- dnl# CHECKING FOR LIBRARY FUNCTIONS dnl# -------------------------------------------------------------------------- AC_TYPE_SIGNAL dnl> AC_FUNC_VPRINTF dnl# Note: On Ultrix, setsid() does weirdo stuff, disable it case "$host_alias" in *ultrix) ac_cv_func_setsid='no' ;; *) break;; esac AC_CHECK_FUNCS( \ atexit \ revoke \ unsetenv \ setutent \ seteuid \ setreuid \ setsid \ setpgrp \ setpgid \ openpty \ _getpty \ grantpt \ unlockpt \ isastream \ on_exit \ nanosleep \ updwtmp \ ttyslot \ ) dnl# Note: On NetBSD, openpty() exists in libutil. Don't pull it in dnl# -------------------------------------------------------------------------- dnl# DO ALL UTMP AND WTMP CHECKING dnl# -------------------------------------------------------------------------- dnl# check for host field in utmp structure dnl# -------------------------------------------- AC_CHECK_HEADER(utmp.h, [AC_CACHE_CHECK([for struct utmp], rxvt_cv_struct_utmp, [AC_TRY_COMPILE([#include #include ], [struct utmp ut;], rxvt_cv_struct_utmp=yes, rxvt_cv_struct_utmp=no)]) if test x$rxvt_cv_struct_utmp = xyes; then AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp) fi ] AC_CACHE_CHECK(for ut_host in utmp struct, rxvt_cv_struct_utmp_host, [AC_TRY_COMPILE([#include #include ], [struct utmp ut; ut.ut_host;], rxvt_cv_struct_utmp_host=yes, rxvt_cv_struct_utmp_host=no)]) if test x$rxvt_cv_struct_utmp_host = xyes; then AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host) fi AC_CACHE_CHECK(for ut_pid in utmp struct, rxvt_cv_struct_utmp_pid, [AC_TRY_COMPILE([#include #include ], [struct utmp ut; ut.ut_pid;], rxvt_cv_struct_utmp_pid=yes, rxvt_cv_struct_utmp_pid=no)]) if test x$rxvt_cv_struct_utmp_pid = xyes; then AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid) fi ) dnl# AC_CHECK_HEADER(utmp.h dnl# -------------------------------------------- AC_CHECK_HEADER(utmpx.h, [AC_CACHE_CHECK([for struct utmpx], rxvt_cv_struct_utmpx, [AC_TRY_COMPILE([#include #include ], [struct utmpx ut;], rxvt_cv_struct_utmpx=yes, rxvt_cv_struct_utmpx=no)]) if test x$rxvt_cv_struct_utmpx = xyes; then AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx) fi ] AC_CACHE_CHECK(for host in utmpx struct, rxvt_cv_struct_utmpx_host, [AC_TRY_COMPILE([#include #include ], [struct utmpx utx; utx.ut_host;], rxvt_cv_struct_utmpx_host=yes, rxvt_cv_struct_utmpx_host=no)]) if test x$rxvt_cv_struct_utmpx_host = xyes; then AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host) fi ) dnl# AC_CHECK_HEADER(utmpx.h dnl# -------------------------------------------------------------------------- dnl# check for struct lastlog AC_CACHE_CHECK(for struct lastlog, rxvt_cv_struct_lastlog, [AC_TRY_COMPILE([#include #include #ifdef HAVE_LASTLOG_H #include #endif ], [struct lastlog ll;], rxvt_cv_struct_lastlog=yes, rxvt_cv_struct_lastlog=no)]) if test x$rxvt_cv_struct_lastlog = xyes; then AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog) fi dnl# check for struct lastlogx AC_CACHE_CHECK(for struct lastlogx, rxvt_cv_struct_lastlogx, [AC_TRY_COMPILE([#include #include #ifdef HAVE_LASTLOG_H #include #endif ], [struct lastlogx ll;], rxvt_cv_struct_lastlogx=yes, rxvt_cv_struct_lastlogx=no)]) if test x$rxvt_cv_struct_lastlogx = xyes; then AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx) fi dnl# -------------------------------------------------------------------------- dnl# FIND FILES dnl# -------------------------------------------------------------------------- dnl# find utmp AC_CACHE_CHECK(where utmp is located, rxvt_cv_path_utmp, [AC_TRY_RUN([#include #include #include #include main() { char **u, *utmplist[] = { "/var/run/utmp", "/var/adm/utmp", "/etc/utmp", "/usr/etc/utmp", "/usr/adm/utmp", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1); #ifdef UTMP_FILE fprintf(f, "%s\n", UTMP_FILE); exit(0); #endif #ifdef _PATH_UTMP fprintf(f, "%s\n", _PATH_UTMP); exit(0); #endif for (u = utmplist; *u; u++) { if ((a = fopen(*u, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *u); exit(0); } } exit(0); }], rxvt_cv_path_utmp=`cat conftestval`, rxvt_cv_path_utmp=, dnl AC_MSG_WARN([Define RXVT_UTMP_FILE in config.h manually]))]) if test x$rxvt_cv_path_utmp != x; then AC_DEFINE_UNQUOTED(RXVT_UTMP_FILE, "$rxvt_cv_path_utmp", Define location of utmp) fi dnl# -------------------------------------------------------------------------- dnl# find utmpx - if a utmp file exists at the same location and is more than dnl# a day newer, then dump the utmpx. People leave lots of junk around. AC_CACHE_CHECK(where utmpx is located, rxvt_cv_path_utmpx, [AC_TRY_RUN([#include #include #include #include #include #ifdef HAVE_STRING_H #include #endif main() { char **u, *p, *utmplist[] = { #ifdef UTMPX_FILE UTMPX_FILE, #endif #ifdef _PATH_UTMPX _PATH_UTMPX, #endif "/var/adm/utmpx", "/etc/utmpx", NULL }; FILE *a, *f=fopen("conftestval", "w"); struct stat statu, statux; if (!f) exit(1); for (u = utmplist; *u; u++) { if ((a = fopen(*u, "r")) != NULL || errno == EACCES) { if (stat(*u, &statux) < 0) continue; p = strdup(*u); p[strlen(p) - 1] = '\0'; if (stat(p, &statu) >= 0 && (statu.st_mtime - statux.st_mtime > 86400)) continue; fprintf(f, "%s\n", *u); exit(0); } } exit(0); }], rxvt_cv_path_utmpx=`cat conftestval`, rxvt_cv_path_utmpx=, dnl AC_MSG_WARN([Define RXVT_UTMPX_FILE in config.h manually]))]) if test x$rxvt_cv_path_utmpx != x; then AC_DEFINE_UNQUOTED(RXVT_UTMPX_FILE, "$rxvt_cv_path_utmpx", Define location of utmpx) fi dnl# -------------------------------------------------------------------------- dnl# find wtmp AC_CACHE_CHECK(where wtmp is located, rxvt_cv_path_wtmp, [AC_TRY_RUN([#include #include #ifdef HAVE_UTMP_H #include #endif #include main() { char **w, *wtmplist[] = { "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1); #ifdef WTMP_FILE fprintf(f, "%s\n", WTMP_FILE); exit(0); #endif #ifdef _PATH_WTMP fprintf(f, "%s\n", _PATH_WTMP); exit(0); #endif for (w = wtmplist; *w; w++) { if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *w); exit(0); } } exit(0); }], rxvt_cv_path_wtmp=`cat conftestval`, rxvt_cv_path_wtmp=, dnl AC_MSG_WARN([Define RXVT_WTMP_FILE in config.h manually]))]) if test x$rxvt_cv_path_wtmp != x; then AC_DEFINE_UNQUOTED(RXVT_WTMP_FILE, "$rxvt_cv_path_wtmp", Define location of wtmp) fi dnl# -------------------------------------------------------------------------- dnl# find wtmpx AC_CACHE_CHECK(where wtmpx is located, rxvt_cv_path_wtmpx, [AC_TRY_RUN([#include #ifdef HAVE_UTMPX_H #include #endif #include main() { char **w, *wtmplist[] = { "/var/log/wtmpx", "/var/adm/wtmpx", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1); #ifdef WTMPX_FILE fprintf(f, "%s\n", WTMPX_FILE); exit(0); #endif #ifdef _PATH_WTMPX fprintf(f, "%s\n", _PATH_WTMPX); exit(0); #endif for (w = wtmplist; *w; w++) { if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *w); exit(0); } } exit(0); }], rxvt_cv_path_wtmpx=`cat conftestval`, rxvt_cv_path_wtmpx=, dnl AC_MSG_WARN([Define RXVT_WTMPX_FILE in config.h manually]))]) if test x$rxvt_cv_path_wtmpx != x; then AC_DEFINE_UNQUOTED(RXVT_WTMPX_FILE, "$rxvt_cv_path_wtmpx", Define location of wtmpx) fi dnl# -------------------------------------------------------------------------- dnl# find lastlog AC_CACHE_CHECK(where lastlog is located, rxvt_cv_path_lastlog, [AC_TRY_RUN([#include #include #ifdef HAVE_UTMPX_H #include #elif defined(HAVE_UTMP_H) #include #endif #ifdef HAVE_LASTLOG_H #include #endif #include main() { char **w, *lastloglist[] = { "/var/log/lastlog", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1); #ifdef LASTLOG_FILE fprintf(f, "%s\n", LASTLOG_FILE); exit(0); #endif #ifdef _PATH_LASTLOG fprintf(f, "%s\n", _PATH_LASTLOG); exit(0); #endif for (w = lastloglist; *w; w++) { if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *w); exit(0); } } exit(0); }], rxvt_cv_path_lastlog=`cat conftestval`, rxvt_cv_path_lastlog=, dnl AC_MSG_WARN([Define RXVT_LASTLOG_FILE in config.h manually]))]) if test x$rxvt_cv_path_lastlog != x; then AC_DEFINE_UNQUOTED(RXVT_LASTLOG_FILE, "$rxvt_cv_path_lastlog", Define location of lastlog) if test -d "$rxvt_cv_path_lastlog"; then AC_DEFINE(LASTLOG_IS_DIR, 1, Define if lastlog is provided via a directory) fi fi dnl# -------------------------------------------------------------------------- dnl# find lastlogx AC_CACHE_CHECK(where lastlogx is located, rxvt_cv_path_lastlogx, [AC_TRY_RUN([#include #ifdef HAVE_UTMPX_H #include #endif #include main() { char **w, *wtmplist[] = { "/var/log/lastlogx", "/var/adm/lastlogx", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1); #ifdef LASTLOGX_FILE fprintf(f, "%s\n", LASTLOGX_FILE); exit(0); #endif #ifdef _PATH_LASTLOGX fprintf(f, "%s\n", _PATH_LASTLOGX); exit(0); #endif for (w = wtmplist; *w; w++) { if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *w); exit(0); } } exit(0); }], rxvt_cv_path_lastlogx=`cat conftestval`, rxvt_cv_path_lastlogx=, dnl AC_MSG_WARN([Define RXVT_LASTLOGX_FILE in config.h manually]))]) if test x$rxvt_cv_path_lastlogx != x; then AC_DEFINE_UNQUOTED(RXVT_LASTLOGX_FILE, "$rxvt_cv_path_lastlogx", Define location of lastlogx) fi dnl# -------------------------------------------------------------------------- dnl# find ttys/ttytab AC_CACHE_CHECK(where ttys/ttytab is located, rxvt_cv_path_ttytab, [for ttys_file in dnl /etc/ttys /etc/ttytab; do if test -f "$ttys_file" ; then rxvt_cv_path_ttytab=$ttys_file break fi done ]) if test x$rxvt_cv_path_ttytab != x; then AC_DEFINE_UNQUOTED(TTYTAB_FILENAME, "$rxvt_cv_path_ttytab", Define location of ttys/ttytab) fi dnl# -------------------------------------------------------------------------- dnl# -------------------------------------------------------------------------- dnl# this is a really hack test for some basic Xlocale stuff ac_save_LIBS=$LIBS ac_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $X_CFLAGS" LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lX11" if test x$rxvt_cv_rpath = xyes -o x$rxvt_cv_R = xyes; then LIBS=`echo $LIBS | sed "$R_TRANSLATE"` fi AC_CACHE_CHECK(for working Xlocale, rxvt_cv_func_xlocale, [AC_TRY_RUN([#include main() { char *p; if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p) exit (XSupportsLocale() ? 0 : 1); else exit (1);}], dnl rxvt_cv_func_xlocale=yes, rxvt_cv_func_xlocale=no, dnl AC_MSG_WARN([Define NO_XLOCALE in config.h manually]))]) if test x$rxvt_cv_func_xlocale = xyes; then AC_DEFINE(HAVE_XLOCALE, 1, Define if Xlocale support works) fi AC_CACHE_CHECK(for working X setlocale, rxvt_cv_func_xsetlocale, [AC_TRY_LINK([#define X_LOCALE 1 #include ], [setlocale(LC_CTYPE, "");], rxvt_cv_func_xsetlocale=yes, rxvt_cv_func_xsetlocale=no)]) if test x$rxvt_cv_func_xsetlocale = xyes; then AC_DEFINE(HAVE_XSETLOCALE, 1, Define if setlocale (defined to Xsetlocale) works) fi LIBS=$ac_save_LIBS CFLAGS=$ac_save_CFLAGS AC_CACHE_CHECK(for working plain setlocale, rxvt_cv_func_setlocale, [AC_TRY_LINK([#include ], [setlocale(LC_CTYPE, "");], rxvt_cv_func_setlocale=yes, rxvt_cv_func_setlocale=no)]) if test x$rxvt_cv_func_setlocale = xyes; then AC_DEFINE(HAVE_SETLOCALE, 1, Define if plain old setlocale works) fi AC_CACHE_CHECK(for working nl_langinfo, rxvt_cv_func_nl_langinfo, [AC_TRY_LINK([#include ], [nl_langinfo(CODESET);], rxvt_cv_func_nl_langinfo=yes, rxvt_cv_func_nl_langinfo=no)]) if test x$rxvt_cv_func_nl_langinfo = xyes; then AC_DEFINE(HAVE_NL_LANGINFO, 1, Define if nl_langinfo(CODESET) works) fi AC_CACHE_CHECK(for getpt, rxvt_cv_func_getpt, [AC_TRY_LINK([#define _GNU_SOURCE #ifdef HAVE_STDLIB_H # include #endif], [(void)getpt();], rxvt_cv_func_getpt=yes, rxvt_cv_func_getpt=no)]) if test x$rxvt_cv_func_getpt = xyes; then AC_DEFINE(HAVE_GETPT, 1, Define if you have _GNU_SOURCE getpt() ) fi dnl# if we don't guess right then it's up to the user AC_CACHE_CHECK(for pty/tty type, rxvt_cv_ptys, [if test x$ac_cv_func_openpty = xyes; then rxvt_cv_ptys=OPENPTY else if test x$ac_cv_func__getpty = xyes; then rxvt_cv_ptys=SGI4 else if test -c /dev/ttyp20; then rxvt_cv_ptys=SCO else if test -c /dev/ptym/clone; then rxvt_cv_ptys=HPUX else if test x$rxvt_cv_func_getpt = xyes; then rxvt_cv_ptys=GLIBC else if test -c /dev/ptc -a -c /dev/pts; then rxvt_cv_ptys=PTC else if test -c /dev/ptc -a -d /dev/pts; then rxvt_cv_ptys=PTC else if test -c /dev/ptmx -a -c /dev/pts/0; then rxvt_cv_ptys=STREAMS else if test x$ac_cv_func_grantpt = xyes && test x$ac_cv_func_unlockpt = xyes; then dnl# catch CYGWIN rxvt_cv_ptys=STREAMS else rxvt_cv_ptys=BSD fi fi fi fi fi fi fi fi fi ]) if test x$rxvt_cv_ptys = xOPENPTY; then AC_DEFINE(PTYS_ARE_OPENPTY, 1, Define for this pty type) fi if test x$rxvt_cv_ptys = xSCO; then AC_DEFINE(PTYS_ARE_NUMERIC, 1, Define for this pty type) fi if test x$rxvt_cv_ptys = xSTREAMS; then AC_DEFINE(PTYS_ARE_PTMX, 1, Define for this pty type) fi if test x$rxvt_cv_ptys = xPTC; then AC_DEFINE(PTYS_ARE_PTC, 1, Define for this pty type) fi if test x$rxvt_cv_ptys = xSGI4; then AC_DEFINE(PTYS_ARE__GETPTY, 1, Define for this pty type) fi if test x$rxvt_cv_ptys = xCONVEX; then AC_DEFINE(PTYS_ARE_GETPTY, 1, Define for this pty type) fi if test x$rxvt_cv_ptys = xGLIBC; then AC_DEFINE(PTYS_ARE_GETPT, 1, Define for this pty type) fi if test x$rxvt_cv_ptys = xHPUX; then AC_DEFINE(PTYS_ARE_CLONE, 1, Define for this pty type) fi if test x$rxvt_cv_ptys = xBSD -o x$rxvt_cv_ptys = xHPUX -o x$rxvt_cv_ptys = xGLIBC; then AC_DEFINE(PTYS_ARE_SEARCHED, 1, Define for this pty type) fi AC_CHECKING(for pty ranges) ptys=`echo /dev/pty??` pch1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` pch2=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` if test x$pch1 != x; then AC_DEFINE_UNQUOTED(PTYCHAR1, "$pch1", Define for first char in devptyXX) fi if test x$pch2 != x; then AC_DEFINE_UNQUOTED(PTYCHAR2, "$pch2", Define for second char in devptyXX) fi dnl# FreeBSD needs to link libxpg4 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]) dnl# -------------------------------------------------------------------------- dnl# now add and remove other stuff dnl# -------------------------------------------------------------------------- if test x$support_graphics = xyes; then AC_DEFINE(RXVT_GRAPHICS, 1, Define if you want Rob Nation's own graphic mode) OBJGRAPHICS="graphics.o" fi if test x$support_inheritpixmap = xyes; then AC_DEFINE(TRANSPARENT, 1, Define if you want your background to use the parent window background) fi if test x$support_keepscrolling = xno; then AC_DEFINE(NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING, 1, Define for continual scrolling when you keep the scrollbar button pressed) fi if test x$support_menubar = xyes; then AC_DEFINE(MENUBAR, 1, Define if you want Menubar support) OBJMENUBAR="menubar.o" fi if test x$support_frills = xno; then AC_DEFINE(NO_FRILLS, 1, Define if you don't want handling for rarely used features) fi if test x$support_linespace = xno; then AC_DEFINE(NO_LINESPACE, 1, Define if you don't want support linespace) fi if test x$support_24bit = xyes; then AC_DEFINE(PREFER_24BIT, 1, Define to use a 24 bit visual if the screen has 24 bit mode, even if the default is 8 bit) fi if test x$support_mousewheel = xyes; then AC_DEFINE(MOUSE_WHEEL, 1, Define to use wheel events (button4 and button5) to scroll) fi if test x$support_mouseslipwheel = xyes; then AC_DEFINE(MOUSE_SLIP_WHEELING, 1, Define to have CTRL cause wheel events to accelerate scrolling. Release CTRL to halt scrolling) fi if test x$support_oldselection = xno; then AC_DEFINE(NO_OLD_SELECTION, 1, Define to remove old rxvt (ver 2.20 and before) style selection) fi if test x$support_utmp = xyes; then AC_DEFINE(UTMP_SUPPORT, 1, Define if you want to have utmp/utmpx support) OBJLOGGING="logging.o" fi if test x$support_wtmp = xyes; then AC_DEFINE(WTMP_SUPPORT, 1, Define if you want to have wtmp support when utmp/utmpx is enabled) fi if test x$support_lastlog = xyes; then AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled) fi if test x$support_xim = xyes -o x$multichar_set = xyes; then if test x$rxvt_cv_func_xlocale = xyes; then AC_DEFINE(USE_XIM, 1, Define if you want to have XIM (X Input Method) protocol support - required for multibyte characters input) fi fi if test x$support_xpm = xyes; then AC_DEFINE(XPM_BACKGROUND, 1, Define if you want to have sexy-looking background pixmaps. Needs libXpm) OBJXPM="xpm.o" fi if test x$support_scroll_rxvt = xyes; then AC_DEFINE(RXVT_SCROLLBAR, 1, Support Rxvt original style scrollbars - specify via configure only) OBJSCROLLBAR="scrollbar-rxvt.o" scrolltypes="rxvt" fi if test x$support_scroll_next = xyes; then AC_DEFINE(NEXT_SCROLLBAR, 1, Support NeXT style scrollbars - specify via configure only) OBJSCROLLBAR="$OBJSCROLLBAR scrollbar-next.o" scrolltypes="$scrolltypes next" fi if test x$support_scroll_xterm = xyes; then AC_DEFINE(XTERM_SCROLLBAR, 1, Support Xterm style scrollbars - specify via configure only) OBJSCROLLBAR="$OBJSCROLLBAR scrollbar-xterm.o" scrolltypes="$scrolltypes xterm" fi dnl> AC_CHECK_FUNCS(gettimeofday putenv select socket) CFLAGS=${CFLAGS--O} LDFLAGS=${LDFLAGS--O} CPPFLAGS="$CPPFLAGS" AC_SUBST(DEBUG) AC_SUBST(DINCLUDE) AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(X_CFLAGS) dnl# Attack the libs if test x$rxvt_cv_rpath = xyes -o x$rxvt_cv_R = xyes; then DLIB=`echo $DLIB | sed "$R_TRANSLATE"` LIBS=`echo $LIBS | sed "$R_TRANSLATE"` X_LIBS=`echo $X_LIBS | sed "$R_TRANSLATE"` X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed "$R_TRANSLATE"` XPM_LIBS=`echo $XPM_LIBS | sed "$R_TRANSLATE"` fi AC_SUBST(DLIB) AC_SUBST(LIBS) AC_SUBST(X_LIBS) AC_SUBST(X_EXTRA_LIBS) if test x$support_addstrings = xyes; then OBJSTRINGS="strings.o" else AC_DEFINE(NO_STRINGS, 1, Define if you don't need to use our replacement string functions) fi OBJLIST="command.o defaultfont.o init.o $OBJGRAPHICS $OBJGRKELOT $OBJLOGGING main.o $OBJMENUBAR misc.o netdisp.o ptytty.o screen.o scrollbar.o $OBJSCROLLBAR $OBJSTRINGS xdefaults.o $OBJXPM" AC_SUBST(OBJLIST) LIBOBJLIST=`echo $OBJLIST | sed 's/\.o/.lo/g'` AC_SUBST(LIBOBJLIST) dnl# common parts of the Makefile MCOMMON=./autoconf/Make.common AC_SUBST_FILE(MCOMMON) AC_ARG_PROGRAM RXVTNAME=`echo rxvt|sed "$program_transform_name"` AC_SUBST(RXVTNAME) dnl# test for "sun" or "__sun__" before include sys_ioctl dnl# revert HAVE_BLAH_H into a "#include " AC_DEFUN(RXVT_DEFINE_TO_INCLUDE, dnl [if test "$$3" = "$4" -o "$$5" = "$6"; then $1="#include <$2>" else $1="/* #include <$2> */" fi dnl AC_SUBST($1)]) RXVT_DEFINE_TO_INCLUDE(include_stdarg_h, stdarg.h, ac_cv_header_stdarg_h, yes, notset, dontmatch) RXVT_DEFINE_TO_INCLUDE(include_stdlib_h, stdlib.h, ac_cv_header_stdlib_h, yes, notset, dontmatch) RXVT_DEFINE_TO_INCLUDE(include_unistd_h, unistd.h, ac_cv_header_unistd_h, yes, notset, dontmatch) RXVT_DEFINE_TO_INCLUDE(include_string_h, string.h, ac_cv_header_string_h, yes, notset, dontmatch) RXVT_DEFINE_TO_INCLUDE(include_fcntl_h, fcntl.h, ac_cv_header_fcntl_h, yes, notset, dontmatch) RXVT_DEFINE_TO_INCLUDE(include_util_h, util.h, ac_cv_header_util_h, yes, notset, dontmatch) RXVT_DEFINE_TO_INCLUDE(include_assert_h, assert.h, ac_cv_header_assert_h, yes, notset, dontmatch) RXVT_DEFINE_TO_INCLUDE(include_sys_ioctl_h, sys/ioctl.h, rxvt_cv_header_sysioctl, yes, notset, dontmatch) RXVT_DEFINE_TO_INCLUDE(include_sys_select_h, sys/select.h, ac_cv_header_sys_select_h, yes, notset, dontmatch) RXVT_DEFINE_TO_INCLUDE(include_sys_strredir_h, sys/strredir.h, ac_cv_header_sys_strredir_h, yes, notset, dontmatch) RXVT_DEFINE_TO_INCLUDE(include_sys_time_h, sys/time.h, ac_cv_header_sys_time_h, yes, notset, dontmatch) RXVT_DEFINE_TO_INCLUDE(include_time_h, time.h, ac_cv_header_sys_time_h, no, ac_cv_header_time, yes) if test "$multichar_set" = yes; then lib_multicharset="#define MULTICHAR_SET 1" else lib_multicharset="/* #undef MULTICHAR_SET */" fi AC_SUBST(lib_multicharset) AC_OUTPUT(autoconf/Make.common \ Makefile \ doc/Makefile \ src/Makefile \ src/graphics/Makefile \ src/test/Makefile \ src/rxvtlib.h \ rclock/Makefile \ W11/Makefile \ ) echo "Configuration: Rxvt version: $VERSION : $DATE Source code location: $srcdir Install path: ${prefix}/bin Compiler: $CC Compiler flags: $CFLAGS" if test "$MALLOC_TYPE" = S; then echo " malloc support: system default" fi if test "$MALLOC_TYPE" = G; then echo " malloc support: Gray Watson's dmalloc" fi if test "$MALLOC_TYPE" = D; then echo " malloc support: Doug Lea's malloc" fi if test x$support_xpm = xyes; then echo " Xpm library: $XPM_LIBS" fi echo " Adding modules:" if test x$OBJGRAPHICS != x; then HASIT="yes"; else HASIT="no"; fi echo " graphics.o: "$HASIT if test x$OBJGRKELOT != x; then HASIT="yes"; else HASIT="no"; fi echo " grkelot.o: "$HASIT if test x$OBJLOGGING != x; then HASIT="yes"; else HASIT="no"; fi echo " logging.o: "$HASIT if test x$OBJMENUBAR != x; then HASIT="yes"; else HASIT="no"; fi echo " menubar.o: "$HASIT if test x$support_scroll_rxvt = xyes; then HASIT="yes"; else HASIT="no"; fi echo " scrollbar-rxvt.o: "$HASIT if test x$support_scroll_next = xyes; then HASIT="yes"; else HASIT="no"; fi echo " scrollbar-next.o: "$HASIT if test x$support_scroll_xterm = xyes; then HASIT="yes"; else HASIT="no"; fi echo " scrollbar-xterm.o: "$HASIT if test x$OBJSTRINGS != x; then HASIT="yes"; else HASIT="no"; fi echo " strings.o: "$HASIT if test x$OBJXPM != x; then HASIT="yes"; else HASIT="no"; fi echo " xpm.o: "$HASIT echo " The following are set in config.h " echo " multichar glyph languages: "$multichar_set echo " pty/tty type: "$rxvt_cv_ptys if test x$support_utmp != xyes; then echo " utmp support: disabled " else echo " utmp support: enabled utmp file: $rxvt_cv_path_utmp utmpx file: $rxvt_cv_path_utmpx wtmp file: $rxvt_cv_path_wtmp wtmpx file: $rxvt_cv_path_wtmpx lastlog file: $rxvt_cv_path_lastlog ttys/ttytab file: $rxvt_cv_path_ttytab " fi if test x$term != x; then echo " set TERM to: $term " fi if test x$terminfo != x; then echo " set TERMINFO to: $terminfo " fi if test x$rxvt_cv_ptys = xUNKNOWN; then echo ".----------------------------------------------------------------." echo ". WARNING: could not determine pty/tty type. Do not build until ." echo ". the appropriate PTYS_ARE_* is defined in config.h ." echo ".----------------------------------------------------------------." fi if test x$support_xpm = xneedsmanualspecification; then echo ".----------------------------------------------------------------." echo ". WARNING: --enable-xpm-background was specified however the ." echo ". XPM includes files and libraries could not be found. ." echo ". XPM backgrounds are now being DISABLED! If you want ." echo ". to use them you should rerun configure with the ." echo ". appropriate --with-xpm-includes=/path/to/xpm/includes ." echo ". and --with-xpm-library=/path/to/xpm/library lines. ." echo ".----------------------------------------------------------------." fi if test x$support_xim = xyes -a x$rxvt_cv_func_xlocale = xno; then echo ".----------------------------------------------------------------." echo ". WARNING: --enable-xim was specified however the locale support ." echo ". functions could not be found. ." echo ". XIM is now being DISABLED! ." echo ".----------------------------------------------------------------." fi echo " *** Please check src/feature.h for further options *** " rxvt-2.7.10/autoconf/libtool.m4010064400001440000024000003170030733371744100150000ustar gcwstaff## libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- ## Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ## Originally by Gordon Matzigkeit , 1996 ## ## 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 of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## ## As a special exception to the GNU General Public License, if you ## distribute this file as part of a program that contains a ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. # serial 46 AC_PROG_LIBTOOL AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ]) AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.13)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl _LT_AC_PROG_ECHO_BACKSLASH # Only perform the check for file, if the check method requires it case "$deplibs_check_method" in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE(libtool-lock, [ --disable-libtool-lock avoid locking (might break parallel builds)]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case "$host" in *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.$ac_objext`" in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_SAVE AC_LANG_C AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_RESTORE]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, [AC_TRY_LINK([], [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); DllMain (0, 0, 0);], [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) case "$host/$CC" in *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) # old mingw systems require "-dll" to link a DLL, while more recent ones # require "-mdll" SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mdll" AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) CFLAGS="$SAVE_CFLAGS" ;; *-*-cygwin* | *-*-pw32*) # cygwin systems need to pass --dll to the linker, and not link # crt.o which will require a WinMain@16 definition. lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; esac ;; ]) esac _LT_AC_LTCONFIG_HACK ]) # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN(_LT_AC_CHECK_DLFCN, [AC_CHECK_HEADERS(dlfcn.h) ])# _LT_AC_CHECK_DLFCN # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. [symcode='[BCDEGRST]'] # Regexp to match symbols that can be accessed directly from C. [sympat='\([_A-Za-z][_A-Za-z0-9]*\)'] # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Define system-specific variables. case "$host_os" in aix*) [symcode='[BCDT]'] ;; cygwin* | mingw* | pw32*) [symcode='[ABCDGISTW]'] ;; hpux*) # Its linker distinguishes data from code symbols lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" ;; irix*) [symcode='[BCDEGRST]'] ;; solaris* | sysv5*) [symcode='[BDT]'] ;; sysv4) [symcode='[DFNSTU]'] ;; esac # Handle CRLF in mingw tool chain opt_cr= case "$host_os" in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then [symcode='[ABCDGISTW]'] fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. [lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"] # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } [lt_preloaded_symbols[] =] { EOF sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" if AC_TRY_EVAL(ac_link) && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AC_FD_CC fi else echo "cannot find nm_test_var in $nlist" >&AC_FD_CC fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC fi else echo "$progname: failed program was:" >&AC_FD_CC cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" if test -z "$lt_cv_sys_global_symbol_pipe"; then global_symbol_to_cdecl= else global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" fi if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # --------------------------------- AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], [# Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac fi ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn;t interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case "X$ECHO" in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running ltconfig again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) AC_DIVERT_POP ])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN(_LT_AC_TRY_DLOPEN_SELF, [if test "$cross_compiling" = yes; then : [$4] else AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif fnord() { int i=42;} main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN(AC_LIBTOOL_DLOPEN_SELF, [if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case "$host_os" in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; cygwin* | mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; *) AC_CHECK_LIB(dl, dlopen, [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_FUNC(dlopen, lt_cv_dlopen="dlopen", [AC_CHECK_FUNC(shl_load, lt_cv_dlopen="shl_load", [AC_CHECK_LIB(svld, dlopen, [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB(dld, shl_load, [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case "$lt_cv_dlopen" in dlopen) save_CPPFLAGS="$CPP_FLAGS" AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case "$lt_cv_dlopen_self" in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case "$lt_cv_dlopen_self_static" in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF AC_DEFUN([_LT_AC_LTCONFIG_HACK], [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" need_locks="$enable_libtool_lock" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o if test x"$host" != x"$build"; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case "$host_os" in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac case "$host_os" in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi # Allow CC to be a program name with arguments. set dummy $CC compiler="[$]2" ## FIXME: this should be a separate macro ## AC_MSG_CHECKING([for objdir]) rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null AC_MSG_RESULT($objdir) ## ## END FIXME ## FIXME: this should be a separate macro ## AC_ARG_WITH(pic, [dnl --with-pic try to use only PIC/non-PIC objects [default=use both]], pic_mode="$withval", pic_mode=default) test -z "$pic_mode" && pic_mode=default # We assume here that the value for lt_cv_prog_cc_pic will not be cached # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. AC_MSG_CHECKING([for $compiler option to produce PIC]) AC_CACHE_VAL(lt_cv_prog_cc_pic, [ lt_cv_prog_cc_pic= lt_cv_prog_cc_shlib= lt_cv_prog_cc_wl= lt_cv_prog_cc_static= lt_cv_prog_cc_no_builtin= lt_cv_prog_cc_can_build_shared=$can_build_shared if test "$GCC" = yes; then lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-static' case "$host_os" in beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # we not sure about C++ programs. lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' ;; sysv4*MP*) if test -d /usr/nec; then lt_cv_prog_cc_pic=-Kconform_pic fi ;; *) lt_cv_prog_cc_pic='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case "$host_os" in aix3* | aix4*) # All AIX code is PIC. lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' ;; hpux9* | hpux10* | hpux11*) # Is there a better lt_cv_prog_cc_static that works with the bundled CC? lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" lt_cv_prog_cc_pic='+Z' ;; irix5* | irix6*) lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; newsos6) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' ;; sco3.2v5*) lt_cv_prog_cc_pic='-Kpic' lt_cv_prog_cc_static='-dn' lt_cv_prog_cc_shlib='-belf' ;; solaris*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; sunos4*) lt_cv_prog_cc_pic='-PIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' if test "x$host_vendor" = xsni; then lt_cv_prog_cc_wl='-LD' else lt_cv_prog_cc_wl='-Wl,' fi ;; uts4*) lt_cv_prog_cc_pic='-pic' lt_cv_prog_cc_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_cv_prog_cc_pic='-Kconform_pic' lt_cv_prog_cc_static='-Bstatic' fi ;; *) lt_cv_prog_cc_can_build_shared=no ;; esac fi ]) if test -z "$lt_cv_prog_cc_pic"; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([$lt_cv_prog_cc_pic]) # Check to make sure the pic_flag actually works. AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" AC_TRY_COMPILE([], [], [dnl case "$host_os" in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then # they create non-PIC objects. So, if there were any warnings, we # assume that PIC is not supported. if test -s conftest.err; then lt_cv_prog_cc_pic_works=no else lt_cv_prog_cc_pic_works=yes fi ;; *) lt_cv_prog_cc_pic_works=yes ;; esac ], [dnl lt_cv_prog_cc_pic_works=no ]) CFLAGS="$save_CFLAGS" ]) if test "X$lt_cv_prog_cc_pic_works" = Xno; then lt_cv_prog_cc_pic= lt_cv_prog_cc_can_build_shared=no else lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" fi AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) fi ## ## END FIXME # Check for any special shared library compilation flags. if test -n "$lt_cv_prog_cc_shlib"; then AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | [egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]"] >/dev/null; then : else AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) lt_cv_prog_cc_can_build_shared=no fi fi ## FIXME: this should be a separate macro ## AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl lt_cv_prog_cc_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) LDFLAGS="$save_LDFLAGS" ]) # Belt *and* braces to stop my trousers falling down: test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) pic_flag="$lt_cv_prog_cc_pic" special_shlib_compile_flags="$lt_cv_prog_cc_shlib" wl="$lt_cv_prog_cc_wl" link_static_flag="$lt_cv_prog_cc_static" no_builtin_flag="$lt_cv_prog_cc_no_builtin" can_build_shared="$lt_cv_prog_cc_can_build_shared" ## ## END FIXME ## FIXME: this should be a separate macro ## # Check to see if options -o and -c are simultaneously supported by compiler AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) $rm -r conftest 2>/dev/null mkdir conftest cd conftest echo "int some_variable = 0;" > conftest.$ac_ext mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then compiler_c_o=no else compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&AC_FD_CC compiler_c_o=no fi AC_MSG_RESULT([$compiler_c_o]) CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) compiler_o_lo=no save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" AC_TRY_COMPILE([], [int some_variable = 0;], [dnl # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then compiler_o_lo=no else compiler_o_lo=yes fi ]) AC_MSG_RESULT([$compiler_c_o]) CFLAGS="$save_CFLAGS" else compiler_o_lo=no fi ## ## END FIXME ## FIXME: this should be a separate macro ## # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ## ## END FIXME ## FIXME: this should be a separate macro ## if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no AC_TRY_COMPILE([], [int some_variable = 0;], [dnl # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then compiler_rtti_exceptions=no else compiler_rtti_exceptions=yes fi ]) CFLAGS="$save_CFLAGS" AC_MSG_RESULT([$compiler_rtti_exceptions]) if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi ## ## END FIXME ## FIXME: this should be a separate macro ## # See if the linker supports building shared libraries. AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_into_libs=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= link_all_deplibs=unknown always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case "$host_os" in cygwin* | mingw* | pw32* ) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case "$host_os" in aix3* | aix4*) # On AIX, the GNU linker is very broken ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ test -f $output_objdir/impgen.exe || (cd $output_objdir && \ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soname > $output_objdir/$soname-def' old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ case "$host_os" in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ ;; esac # mingw and cygwin differ, and it's simplest to just exclude the union # of the two symbol sets. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one (in ltdll.c) if test "x$lt_cv_need_dllmain" = "xyes"; then ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' else ltdll_obj= ltdll_cmds= fi # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. # Be careful not to strip the DATA tag left be newer dlltools. export_symbols_cmds="$ltdll_cmds"' $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ [sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//"] < $output_objdir/$soname-def > $export_symbols' # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~ _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \[$]# in 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw* | pw32*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case "$host_os" in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4*) hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' hardcode_libdir_separator=':' if test "$GCC" = yes; then collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi shared_flag='-shared' else shared_flag='${wl}-bM:SRE' hardcode_direct=yes fi allow_undefined_flag=' ${wl}-berok' archive_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' case "$host_os" in [aix4.[01]|aix4.[01].*]) # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on always_export_symbols=yes ;; esac # We don't want to build shared libraries on unknown CPU types. case $host_cpu in powerpc | rs6000) ;; *) ld_shlibs=no ;; esac ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' ;; darwin* | rhapsody*) allow_undefined_flag='-undefined warning' archive_cmds='$CC `if test "$module" = "yes"; then echo -bundle; else echo -dynamiclib; fi` -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' ## What we need is to hardcode the path to the library, not the search path #hardcode_direct=yes #hardcode_libdir_flag_spec='-install_name $libdir/$lib' hardcode_shlibpath_var=no whole_archive_flag_spec='-all_load' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case "$host_os" in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' fi #Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case "$host_os" in [solaris2.[0-5] | solaris2.[0-5].*]) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) if test "x$host_vendor" = xsno; then archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes # is this really true??? else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; unixware7*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi AC_MSG_RESULT([$ld_shlibs]) test "$ld_shlibs" = no && can_build_shared=no ## ## END FIXME ## FIXME: this should be a separate macro ## # Check hardcoding attributes. AC_MSG_CHECKING([how to hardcode library paths into programs]) hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi AC_MSG_RESULT([$hardcode_action]) ## ## END FIXME ## FIXME: this should be a separate macro ## striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ## ## END FIXME reload_cmds='$LD$reload_flag -o $output$reload_objs' test -z "$deplibs_check_method" && deplibs_check_method=unknown ## FIXME: this should be a separate macro ## # PORTME Fill in your ld.so characteristics AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case "$host_os" in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4*) version_type=linux # AIX has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. # We preserve .a as extension for shared libraries though AIX4.2 # and later linker supports .so library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' shlibpath_var=LIBPATH ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | [$Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\'']`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows need_version=no need_lib_prefix=no if test "$GCC" = yes; then library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll' else library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll $libname.lib' fi dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) need_lib_prefix=no need_version=no library_names_spec='${libname}.`if test "$module" = "yes"; then echo so; else echo dylib; fi`' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH postinstall_cmds='chmod +x $lib' ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case "$version_type" in freebsd-elf*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case "$host_os" in freebsd2*) shlibpath_overrides_runpath=yes ;; *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' case "$host_os" in irix5*) libsuff= shlibsuff= ;; *) case "$LD" in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos if test "$with_gnu_ld" = yes; then need_lib_prefix=no need_version=no fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case "$host_vendor" in sni) shlibpath_overrides_runpath=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no ## ## END FIXME ## FIXME: this should be a separate macro ## # Report the final consequences. AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) ## ## END FIXME if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi AC_LIBTOOL_DLOPEN_SELF ## FIXME: this should be a separate macro ## if test "$enable_shared" = yes && test "$GCC" = yes; then case "$archive_cmds" in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], [$rm conftest* echo 'static int dummy;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_cv_prog_cc_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$save_allow_undefined_flag else cat conftest.err 1>&5 fi]) AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) ;; esac fi need_lc=${lt_cv_archive_cmds_need_lc-yes} ## ## END FIXME ## FIXME: this should be a separate macro ## # The second clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then : else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi if test -f "$ltmain"; then trap "$rm \"${ofile}T\"; exit 1" 1 2 15 $rm -f "${ofile}T" echo creating $ofile # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS \ AR AR_FLAGS CC LD LN_S NM SHELL \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ old_striplib striplib file_magic_cmd export_symbols_cmds \ deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case "$var" in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done cat <<__EOF__ > "${ofile}T" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # 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 of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$need_lc # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # The default C compiler. CC=$lt_CC # Is the compiler the GNU C compiler? with_gcc=$GCC # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_pic_flag pic_mode=$pic_mode # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$lt_compiler_o_lo # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_global_symbol_to_cdecl # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case "$host_os" in aix3*) cat <<\EOF >> "${ofile}T" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac case "$host_os" in cygwin* | mingw* | pw32* | os2*) cat <<'EOF' >> "${ofile}T" # This is a source program that is used to create dlls on Windows # Don't remove nor modify the starting and closing comments # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ # This is a source program that is used to create import libraries # on Windows for dlls which lack them. Don't remove nor modify the # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999-2000 Free Software Foundation, Inc. # # This file is part of GNU libtool. # # 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 of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # */ # # #include /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* for strdup() */ # # /* O_BINARY isn't required (or even defined sometimes) under Unix */ # #ifndef O_BINARY # #define O_BINARY 0 # #endif # # static unsigned int # pe_get16 (fd, offset) # int fd; # int offset; # { # unsigned char b[2]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 2); # return b[0] + (b[1]<<8); # } # # static unsigned int # pe_get32 (fd, offset) # int fd; # int offset; # { # unsigned char b[4]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 4); # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # static unsigned int # pe_as32 (ptr) # void *ptr; # { # unsigned char *b = ptr; # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # int # main (argc, argv) # int argc; # char *argv[]; # { # int dll; # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; # unsigned long export_rva, export_size, nsections, secptr, expptr; # unsigned long name_rvas, nexp; # unsigned char *expdata, *erva; # char *filename, *dll_name; # # filename = argv[1]; # # dll = open(filename, O_RDONLY|O_BINARY); # if (!dll) # return 1; # # dll_name = filename; # # for (i=0; filename[i]; i++) # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') # dll_name = filename + i +1; # # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); # # if (num_entries < 1) /* no exports */ # return 1; # # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + # pe_get16 (dll, pe_header_offset + 4 + 16)); # # expptr = 0; # for (i = 0; i < nsections; i++) # { # char sname[8]; # unsigned long secptr1 = secptr + 40 * i; # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); # unsigned long vsize = pe_get32 (dll, secptr1 + 16); # unsigned long fptr = pe_get32 (dll, secptr1 + 20); # lseek(dll, secptr1, SEEK_SET); # read(dll, sname, 8); # if (vaddr <= export_rva && vaddr+vsize > export_rva) # { # expptr = fptr + (export_rva - vaddr); # if (export_rva + export_size > vaddr + vsize) # export_size = vsize - (export_rva - vaddr); # break; # } # } # # expdata = (unsigned char*)malloc(export_size); # lseek (dll, expptr, SEEK_SET); # read (dll, expdata, export_size); # erva = expdata - export_rva; # # nexp = pe_as32 (expdata+24); # name_rvas = pe_as32 (expdata+32); # # printf ("EXPORTS\n"); # for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) mv -f "${ofile}T" "$ofile" || \ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") chmod +x "$ofile" fi ## ## END FIXME ])# _LT_AC_LTCONFIG_HACK # AC_LIBTOOL_DLOPEN - enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) # AC_ENABLE_SHARED - implement the --enable-shared flag # Usage: AC_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(shared, changequote(<<, >>)dnl << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case "$enableval" in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac], enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl ]) # AC_DISABLE_SHARED - set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no)]) # AC_ENABLE_STATIC - implement the --enable-static flag # Usage: AC_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(static, changequote(<<, >>)dnl << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case "$enableval" in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$ac_save_ifs" ;; esac], enable_static=AC_ENABLE_STATIC_DEFAULT)dnl ]) # AC_DISABLE_STATIC - set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no)]) # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(fast-install, changequote(<<, >>)dnl << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case "$enableval" in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$ac_save_ifs" ;; esac], enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl ]) # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no)]) # AC_LIBTOOL_PICMODE - implement the --with-pic flag # Usage: AC_LIBTOOL_PICMODE[(MODE)] # Where MODE is either `yes' or `no'. If omitted, it defaults to # `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default)]) # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case "$MAGIC_CMD" in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case "$deplibs_check_method" in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ]) # AC_PATH_MAGIC - find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) else MAGIC_CMD=: fi fi ]) # AC_PROG_LD - find the path to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case "$ac_prog" in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$lt_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_PROG_LD_GNU ]) # AC_PROG_LD_GNU - AC_DEFUN([AC_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then lt_cv_prog_gnu_ld=yes else lt_cv_prog_gnu_ld=no fi]) with_gnu_ld=$lt_cv_prog_gnu_ld ]) # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker # -- PORTME Some linkers may need a different reload flag. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, [lt_cv_ld_reload_flag='-r']) reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" ]) # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], [AC_CACHE_CHECK([how to recognise dependant libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # ['file_magic [regex]'] -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case "$host_os" in aix4*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'] lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin* | mingw* | pw32*) lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin*|rhapsody*) lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magiic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` ;; freebsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case "$host_cpu" in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. [lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'] lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20*|hpux11*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'] lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) case "$host_os" in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case "$LD" in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case [lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"] ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux-gnu*) case "$host_cpu" in alpha* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;] esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then [lt_cv_deplibs_check_method='file_magic NetBSD/[a-z0-9]* demand paged shared library'] else [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'] fi lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; newos6*) [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'] lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case "$host_vendor" in motorola) [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'] lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;; sni) lt_cv_file_magic_cmd='/bin/file' [lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"] lt_cv_file_magic_test_file=/lib/libc.so ;; esac ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method ]) # AC_PROG_NM - find the path to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_MSG_CHECKING([for BSD-compatible nm]) AC_CACHE_VAL(lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/${ac_tool_prefix}nm if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then lt_cv_path_NM="$tmp_nm -p" break else lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" AC_MSG_RESULT([$NM]) ]) # AC_CHECK_LIBM - check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case "$host" in *-*-beos* | *-*-cygwin* | *-*-pw32*) # These system don't have libm ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, main, LIBM="-lm") ;; esac ]) # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for # the libltdl convenience library and INCLTDL to the include flags for # the libltdl header and adds --enable-ltdl-convenience to the # configure arguments. Note that LIBLTDL and INCLTDL are not # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed # with '${top_builddir}/' and INCLTDL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case "$enable_ltdl_convenience" in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) ]) # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for # the libltdl installable library and INCLTDL to the include flags for # the libltdl header and adds --enable-ltdl-install to the configure # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed # with '${top_srcdir}/' (note the single quotes!). If your package is # not flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, main, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" INCLTDL= fi ]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) rxvt-2.7.10/autoconf/xpm.m4010064400001440000024000000147160757330767100141530ustar gcwstaffdnl> $Id: xpm.m4,v 1.4 2002/12/04 05:11:55 gcw Exp $ dnl> test to find the hard-to-find libXpm dnl> mostly copied from AC_PATH_X & AC_PATH_DIRECT, but explictly set AC_DEFUN(VT_FIND_LIBXPM, [ AC_REQUIRE_CPP() # Initialize some more variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. # If we find XPM, set shell vars xpm_includes and xpm_libraries to the # paths, otherwise set no_xpm=yes. # Uses ac_ vars as temps to allow command line to override cache and checks. AC_MSG_CHECKING(for libXpm) AC_ARG_WITH(xpm_includes, [ --with-xpm-includes=DIR use XPM includes in DIR], xpm_includes="$withval", xpm_includes=NO) AC_ARG_WITH(xpm_library, [ --with-xpm-library=DIR use XPM library in DIR], xpm_libraries="$withval", xpm_libraries=NO) # --without-xpm overrides everything else, but does not touch the cache. AC_ARG_WITH(xpm, [ --with-xpm use XPM]) if test "$with_xpm" = no; then have_xpm=disabled else AC_CACHE_VAL(ac_cv_have_xpm, [ vt_xpm_include_X11=no if test -n "$xpm_includes"; then vt_xpm_includes=$xpm_includes else vt_xpm_includes=NO fi if test -n "$xpm_libraries"; then vt_xpm_libraries=$xpm_libraries else vt_xpm_libraries=NO fi VT_XPM_DIRECT if test "$vt_xpm_includes" = NO -o "$vt_xpm_libraries" = NO; then ac_cv_have_xpm="have_xpm=no" else ac_cv_have_xpm="have_xpm=yes \ vt_xpm_includes=$vt_xpm_includes vt_xpm_libraries=$vt_xpm_libraries \ vt_xpm_include_X11=$vt_xpm_include_X11" fi])dnl eval "$ac_cv_have_xpm" fi if test "$have_xpm" != yes; then AC_MSG_RESULT($have_xpm) no_xpm=yes else if test "$xpm_includes" != NO; then if test "$xpm_includes" = "$vt_xpm_includes"; then if test -r "$xpm_includes/X11/xpm.h"; then vt_xpm_include_X11=yes fi else vt_xpm_include_X11=no if test -z "$xpm_includes"; then AC_TRY_CPP([#include ], vt_xpm_include_X11=yes) else if test -r "$xpm_includes/X11/xpm.h"; then vt_xpm_include_X11=yes fi fi fi vt_xpm_includes=$xpm_includes fi if test "x$xpm_libraries" != xNO; then vt_xpm_libraries=$xpm_libraries fi # Update the cache value to reflect the command line values. ac_cv_have_xpm="have_xpm=yes \ vt_xpm_includes=$vt_xpm_includes vt_xpm_libraries=$vt_xpm_libraries \ vt_xpm_include_X11=$vt_xpm_include_X11" eval "$ac_cv_have_xpm" AC_MSG_RESULT([-I$vt_xpm_includes, -L$vt_xpm_libraries]) if test -n "$vt_xpm_includes"; then XPM_CPPFLAGS="-DHAVE_LIBXPM" fi if test -n "$vt_xpm_includes"; then XPM_CFLAGS="-I$vt_xpm_includes" fi XPM_LIBS="-lXpm" if test -n "$vt_xpm_libraries"; then XPM_LIBS="-L$vt_xpm_libraries $XPM_LIBS" fi if test "x$vt_xpm_include_X11" = xyes; then AC_DEFINE(XPM_INC_X11, 1, Define if you include on a normal include path (be careful)) fi fi AC_SUBST(XPM_CPPFLAGS) AC_SUBST(XPM_CFLAGS) AC_SUBST(XPM_LIBS) ]) dnl Internal subroutine of VT_FIND_LIBXPM dnl Set vt_xpm_include and vt_xpm_libr # -------------- find xpm.h and Xpm.a/Xpm.so/Xpm.sl AC_DEFUN(VT_XPM_DIRECT, [if test "$vt_xpm_includes" = NO; then # Guess where to find xpm.h ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" # First, try using that file with no special directory specified. AC_TRY_CPP([#include ], [# We can compile using X headers with no special include directory. vt_xpm_includes= vt_xpm_include_X11=yes], [CPPFLAGS="$ac_save_CPPFLAGS" # Look for the header file in a standard set of common directories. 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/X11/xpm.h"; then vt_xpm_includes="$ac_dir" vt_xpm_include_X11=yes break else if test -r "$ac_dir/xpm.h"; then vt_xpm_includes=$ac_dir break fi fi done]) fi if test "$vt_xpm_libraries" = NO; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS="$LIBS" LIBS="$LIBS $X_LIBS -lXpm -lX11" AC_TRY_LINK(, [XpmReadFileToPixmap()], [LIBS="$ac_save_LIBS" # We can link libXpm with no special library path. vt_xpm_libraries=], [LIBS="$ac_save_LIBS" # First see if replacing the include by lib works. for ac_dir in \ `echo "$vt_xpm_includes" | sed 's,include/X11,lib,;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 \ \ /usr/openwin/lib \ /usr/openwin/share/lib \ ; \ do dnl XXX Shouldn't this really use AC_TRY_LINK to be portable & robust?? for ac_extension in a so sl; do if test -r $ac_dir/libXpm.$ac_extension; then vt_xpm_libraries=$ac_dir break 2 fi done done]) fi ]) rxvt-2.7.10/autoconf/ltmain.sh010064400001440000024000004041170733371744100147150ustar gcwstaff# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun ltconfig. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # 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 of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" # Parse our command line options once, thoroughly. while test $# -gt 0 do arg="$1" shift case "$arg" in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case "$prev" in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case "$arg" in --help) show_help=yes ;; --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" exit 0 ;; --config) sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 exit 0 ;; --debug) echo "$progname: enabling shell trace mode" set -x ;; --dry-run | -n) run=: ;; --features) echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit 0 ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --quiet | --silent) show=: ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit 1 ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then case "$nonopt" in *cc | *++ | gcc* | *-gcc*) mode=link for arg do case "$arg" in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit 1 fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case "$mode" in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= prev= lastarg= srcfile="$nonopt" suppress_output= user_target=no for arg do case "$prev" in "") ;; xcompiler) # Aesthetically quote the previous argument. prev= lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac # Accept any command-line options. case "$arg" in -o) if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi user_target=next ;; -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; -Xcompiler) prev=xcompiler continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac case "$user_target" in next) # The next one is the -o target name user_target=yes continue ;; yes) # We got the output file user_target=set libobj="$arg" continue ;; esac # Accept the current argument as the source file. lastarg="$srcfile" srcfile="$arg" # Aesthetically quote the previous argument. # Backslashify any backslashes, double quotes, and dollar signs. # These are the only characters that are still specially # interpreted inside of double-quoted scrings. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case "$lastarg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi done case "$user_target" in set) ;; no) # Get the name of the library object. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; *) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSfmso]' case "$libobj" in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case "$libobj" in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 ;; esac if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit 1 fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $libobj" else removelist="$libobj" fi $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case "$host_os" in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" else # Don't build PIC code command="$base_compile $srcfile" fi if test "$build_old_libs" = yes; then lo_libobj="$libobj" dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$libobj"; then dir="$objdir" else dir="$dir/$objdir" fi libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` if test -d "$dir"; then $show "$rm $libobj" $run $rm $libobj else $show "$mkdir $dir" $run $mkdir $dir status=$? if test $status -ne 0 && test ! -d $dir; then exit $status fi fi fi if test "$compiler_o_lo" = yes; then output_obj="$libobj" command="$command -o $output_obj" elif test "$compiler_c_o" = yes; then output_obj="$obj" command="$command -o $output_obj" fi $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed, then go on to compile the next one if test x"$output_obj" != x"$libobj"; then $show "$mv $output_obj $libobj" if $run $mv $output_obj $libobj; then : else error=$? $run $rm $removelist exit $error fi fi # If we have no pic_flag, then copy the object into place and finish. if (test -z "$pic_flag" || test "$pic_mode" != default) && test "$build_old_libs" = yes; then # Rename the .lo from within objdir to obj if test -f $obj; then $show $rm $obj $run $rm $obj fi $show "$mv $libobj $obj" if $run $mv $libobj $obj; then : else error=$? $run $rm $removelist exit $error fi xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` # Now arrange that obj and lo_libobj become the same file $show "(cd $xdir && $LN_S $baseobj $libobj)" if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then exit 0 else error=$? $run $rm $removelist exit $error fi fi # Allow error messages only from the first compilation. suppress_output=' >/dev/null 2>&1' fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $srcfile" else # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" output_obj="$obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed if test x"$output_obj" != x"$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Create an invalid libtool object if no PIC, so that we do not # accidentally link it into a program. if test "$build_libtool_libs" != yes; then $show "echo timestamp > $libobj" $run eval "echo timestamp > \$libobj" || exit $? else # Move the .lo from within objdir $show "$mv $libobj $lo_libobj" if $run $mv $libobj $lo_libobj; then : else error=$? $run $rm $removelist exit $error fi fi fi # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit 0 ;; # libtool link mode link | relink) modename="$modename: link" case "$host" in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invokation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args="$nonopt" compile_command="$nonopt" finalize_command="$nonopt" compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= # We need to know -static, to get the right output filenames. for arg do case "$arg" in -all-static | -static) if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test $# -gt 0; do arg="$1" shift case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case "$prev" in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case "$prev" in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case "$arg" in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit 1 fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case "$arg" in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi prevarg="$arg" case "$arg" in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: not more than one -exported-symbols argument allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case "$dir" in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit 1 fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case "$host" in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case ":$dllsearchpath:" in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "$arg" = "-lc"; then case "$host" in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # These systems don't actually have c library (as such) continue ;; *-*-rhapsody* | *-*-darwin*) # Darwin C library is in the System framework deplibs="$deplibs -framework System" ;; esac elif test "$arg" = "-lm"; then case "$host" in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have math library (as such) continue ;; *-*-rhapsody* | *-*-darwin*) # Darwin math library is in the System framework deplibs="$deplibs -framework System" ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case "$host" in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *-*-rhapsody* | *-*-darwin*) # Darwin C library is in the System framework deplibs="$deplibs -framework System" ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -o) prev=output ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case "$dir" in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case "$flag" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case "$flag" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A library object. if test "$prev" = dlfiles; then # This file was specified with -dlopen. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $arg" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` prev= else libobjs="$libobjs $arg" fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d $output_objdir; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi # Determine the type of output case "$output" in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac libs="$libs $deplib" done deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries uninst_deplibs= # uninstalled libtool libraries uninst_path= # paths that contain uninstalled libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case "$file" in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit 1 ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test $linkmode = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test $pass = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case "$deplib" in -l*) if test $linkmode != lib && test $linkmode != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi if test $pass = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do # Search the libtool library lib="$searchdir/lib${name}.la" if test -f "$lib"; then found=yes break fi done if test "$found" != yes; then if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test $pass = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test $pass = conv; then deplibs="$deplib $deplibs" continue fi if test $pass = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac continue ;; -R*) if test $pass = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test $pass = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then echo echo "*** Warning: This library needs some functionality provided by $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." else echo echo "*** Warning: Linking the shared library $output against the" echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test $pass != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac ;; *.lo | *.$objext) if test $pass = conv; then deplibs="$deplib $deplibs" elif test $linkmode = prog; then if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac if test $found = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 fi # Check to see that this really is a libtool archive. if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes # Read the .la file case "$lib" in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test $linkmode != prog && test $linkmode != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test $pass = conv; then # only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done elif test $linkmode != prog && test $linkmode != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 fi continue fi # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # This library was specified with -dlopen. if test $pass = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # We need an absolute path. case "$ladir" in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later uninst_path="$uninst_path $abs_ladir" fi name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test $pass = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi if test -z "$libdir"; then # link the convenience library if test $linkmode = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test $linkmode = prog && test $pass != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case "$deplib" in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test $linkalldeplibs = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done continue fi if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then uninst_deplibs="$uninst_deplibs $lib" need_relink=yes fi # This is a shared library if test $linkmode = lib && test $hardcode_into_libs = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' eval cmds=\"$extract_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' eval cmds=\"$old_archive_from_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi if test $linkmode = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case "$hardcode_action" in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = no; then case "$host" in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit 1 fi if test -n "$add_shlibpath"; then case ":$compile_shlibpath:" in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test $linkmode = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case ":$finalize_shlibpath:" in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test $linkmode = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case ":$finalize_shlibpath:" in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" add="-l$name" fi if test $linkmode = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test $linkmode = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo echo "*** Warning: This library needs some functionality provided by $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi if test $linkmode = lib; then if test -n "$dependency_libs" && { test $hardcode_into_libs != yes || test $build_old_libs = yes || test $link_static = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case "$libdir" in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done if test $link_all_deplibs != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case "$deplib" in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case "$dir" in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="-L$absdir/$objdir" else eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="-L$absdir" fi ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi fi done dependency_libs="$newdependency_libs" if test $pass = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test $pass != dlopen; then if test $pass != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Make sure that $var contains only unique libraries # and add them in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do case "$deplib" in -L*) new_libs="$deplib $new_libs" ;; *) case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case "$deplib" in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done fi done if test $linkmode = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case "$outputname" in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit 1 else echo echo "*** Warning: Linking the shared library $output against the non-libtool" echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test $# -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. libext=al oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit 1 fi current="$2" revision="$3" age="$4" # Check that each of the things are valid numbers. case "$current" in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case "$revision" in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case "$age" in 0 | [1-9] | [1-9][0-9]*) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac if test $age -gt $current; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 fi # Calculate the version variables. major= versuffix= verstring= case "$version_type" in none) ;; irix) major=`expr $current - $age + 1` verstring="sgi$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test $loop != 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="sgi$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test $loop != 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= verstring="0.0" if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $uninst_path; do lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test $hardcode_into_libs != yes || test $build_old_libs = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case "$host" in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *) # Add libc to deplibs on all other systems if necessary. if test $build_libtool_need_lc = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case "$deplibs_check_method" in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behaviour. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | sed 's/.* -> //'` case "$potliblink" in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | sed 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: This library needs some functionality provided by $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | grep . >/dev/null; then echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" echo "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test $hardcode_into_libs = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Ensure that we have .o objects for linkers which dislike .lo # (e.g. aix) in case we are running --disable-static for obj in $libobjs; do xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` if test ! -f $xdir/$oldobj; then $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? fi done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case "$xlib" in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else eval cmds=\"$archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit 0 fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case "$output" in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case "$xlib" in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" $run eval "echo timestamp > $libobj" || exit $? exit 0 fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" else # Just create a symlink. $show $rm $libobj $run $rm $libobj xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$libobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` $show "(cd $xdir && $LN_S $oldobj $baseobj)" $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 ;; prog) if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case "$host" in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case ":$dllsearchpath:" in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case "$dlsyms" in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`echo "$arg" | sed -e 's%^.*/%%'` $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = {\ " sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr_t) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case "$host" in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test $need_relink = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case "$dir" in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit 0 fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="cd `pwd`; $relink_command" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case "$0" in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`echo $output|sed 's,.exe$,,'` ;; esac $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: uninst_deplibs='$uninst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then echo >> $output "\ program=lt-'$outputname' progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if (eval \$relink_command); then : else $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # win32 systems need to use the prog path for dll # lookup to work *-*-cygwin* | *-*-pw32*) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH exec \$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output fi exit 0 ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case "$xlib" in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else # Ensure that we have .o objects in place in case we decided # not to build a shared library, and have fallen back to building # static libs even though --disable-static was passed! for oldobj in $oldobjs; do if test ! -f $oldobj; then xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$oldobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` $show "(cd $xdir && ${LN_S} $obj $baseobj)" $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? fi done eval cmds=\"$old_archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case "$output" in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case "$deplib" in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" fi $rm $output $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$dlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test $need_relink = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit 0 ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case "$arg" in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit 1 fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test $# -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 fi fi case "$destdir" in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case "$file" in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case "$file" in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi library_names= old_library= relink_command= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 continue fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case "$destfile" in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit 0 ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then uninst_deplibs= relink_command= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Check the variables that should have been set. if test -z "$uninst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 exit 1 fi finalize=yes for lib in $uninst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case "$lib" in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec $SHELL $0 --finish$current_libdirs exit 1 fi exit 0 ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. eval cmds=\"$finish_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do echo " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" echo "more information, such as the ld(1) and ld.so(8) manual pages." echo "----------------------------------------------------------------------" exit 0 ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit 1 fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit 1 fi dir= case "$file" in *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case "$file" in -*) ;; *) # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now actually exec the command. eval "exec \$cmd$args" $echo "$modename: cannot exec \$cmd$args" exit 1 else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit 0 fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case "$arg" in -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit 1 fi for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$objdir" else objdir="$dir/$objdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test $mode = uninstall && objdir="$dir" rmfiles="$file" case "$name" in *.la) # Possibly a libtool archive, so verify it. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test $mode = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. eval cmds=\"$old_postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) if test "$build_old_libs" = yes; then oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` rmfiles="$rmfiles $dir/$oldobj" fi ;; *) # Do a test to see if this is a libtool program. if test $mode = clean && (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$file rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles done exit 0 ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi # test -z "$show_help" # We need to display help for each of the modes. case "$mode" in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE." exit 0 ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: rxvt-2.7.10/W11004075500001440000024000000000000764024424100115365ustar gcwstaffrxvt-2.7.10/W11/X11004075500001440000024000000000000764024424100121075ustar gcwstaffrxvt-2.7.10/W11/X11/Intrinsic.h010064400001440000024000000000270757331033000142730ustar gcwstaff#include rxvt-2.7.10/W11/X11/keysym.h010064400001440000024000000000000757331033000136410ustar gcwstaffrxvt-2.7.10/W11/X11/cursorfont.h010064400001440000024000000000000757331033000145240ustar gcwstaffrxvt-2.7.10/W11/X11/Xutil.h010064400001440000024000000000000757331033000134250ustar gcwstaffrxvt-2.7.10/W11/X11/Xmd.h010064400001440000024000000001720757331033000130620ustar gcwstaff#ifndef XMD_H #define XMD_H 1 /* * Machine dependent declarations */ typedef unsigned int CARD32; #endif /* XMD_H */ rxvt-2.7.10/W11/X11/Xlocale.h010064400001440000024000000000000757331033000137070ustar gcwstaffrxvt-2.7.10/W11/X11/Xlib.h010064400001440000024000001705400757331033000132370ustar gcwstaff/* Copyright 1985, 1986, 1987, 1991, 1998 The Open Group All Rights Reserved. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifndef __XLIB_H #define __XLIB_H /* typedef struct _XrmHashBucketRec; */ typedef unsigned long Atom; typedef unsigned long Time; typedef unsigned long XID; #ifndef Bool #define Bool int #endif typedef int BoolDef; typedef XID Window; typedef XID Drawable; typedef XID Font; typedef XID Pixmap; typedef XID Cursor; typedef XID Colormap; typedef XID KeySym; typedef XID GContext; typedef unsigned char KeyCode; typedef char *XPointer; typedef unsigned long VisualID; #define PIXEL_ALREADY_TYPEDEFED typedef unsigned long Pixel; #define XDestroyImage(ximage) \ ((*((ximage)->f.destroy_image))((ximage))) #define XPutPixel(ximage, x, y, pixel) \ ((*((ximage)->f.put_pixel))((ximage), (x), (y), (pixel))) #define AllPlanes ((unsigned long)~0L) #define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr]) #define DefaultVisual(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_visual) #define DefaultDepth(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth) #define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap) #define DefaultScreen(dpy) (((_XPrivDisplay)dpy)->default_screen) #define BlackPixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->black_pixel) #define WhitePixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->white_pixel) #define RootWindow(dpy, scr) (ScreenOfDisplay(dpy,scr)->root) #define DefaultRootWindow(dpy) (ScreenOfDisplay(dpy,DefaultScreen(dpy))->root) #define DisplayWidth(dpy, scr) (ScreenOfDisplay(dpy,scr)->width) #define DisplayHeight(dpy, scr) (ScreenOfDisplay(dpy,scr)->height) #ifndef None #define None 0L /* universal null resource or null atom */ #endif #define ParentRelative 1L #define CopyFromParent 0L #define PointerWindow 0L /* destination window in SendEvent */ #define InputFocus 1L /* destination window in SendEvent */ #define PointerRoot 1L /* focus window in SetInputFocus */ #define AnyPropertyType 0L /* special Atom, passed to GetProperty */ #define AnyKey 0L /* special Key Code, passed to GrabKey */ #define AnyButton 0L /* special Button Code, passed to GrabButton */ #define AllTemporary 0L /* special Resource ID passed to KillClient */ #define CurrentTime 0L /* special Time */ #define NoSymbol 0L /* special KeySym */ #define NoEventMask 0L #define KeyPressMask (1L<<0) #define KeyReleaseMask (1L<<1) #define ButtonPressMask (1L<<2) #define ButtonReleaseMask (1L<<3) #define EnterWindowMask (1L<<4) #define LeaveWindowMask (1L<<5) #define PointerMotionMask (1L<<6) #define PointerMotionHintMask (1L<<7) #define Button1MotionMask (1L<<8) #define Button2MotionMask (1L<<9) #define Button3MotionMask (1L<<10) #define Button4MotionMask (1L<<11) #define Button5MotionMask (1L<<12) #define ButtonMotionMask (1L<<13) #define KeymapStateMask (1L<<14) #define ExposureMask (1L<<15) #define VisibilityChangeMask (1L<<16) #define StructureNotifyMask (1L<<17) #define ResizeRedirectMask (1L<<18) #define SubstructureNotifyMask (1L<<19) #define SubstructureRedirectMask (1L<<20) #define FocusChangeMask (1L<<21) #define PropertyChangeMask (1L<<22) #define ColormapChangeMask (1L<<23) #define OwnerGrabButtonMask (1L<<24) #define KeyPress 2 #define KeyRelease 3 #define ButtonPress 4 #define ButtonRelease 5 #define MotionNotify 6 #define EnterNotify 7 #define LeaveNotify 8 #define FocusIn 9 #define FocusOut 10 #define KeymapNotify 11 #define Expose 12 #define GraphicsExpose 13 #define NoExpose 14 #define VisibilityNotify 15 #define CreateNotify 16 #define DestroyNotify 17 #define UnmapNotify 18 #define MapNotify 19 #define MapRequest 20 #define ReparentNotify 21 #define ConfigureNotify 22 #define ConfigureRequest 23 #define GravityNotify 24 #define ResizeRequest 25 #define CirculateNotify 26 #define CirculateRequest 27 #define PropertyNotify 28 #define SelectionClear 29 #define SelectionRequest 30 #define SelectionNotify 31 #define ColormapNotify 32 #define ClientMessage 33 #define MappingNotify 34 #define LASTEvent 35 /* must be bigger than any event # */ #define ShiftMask (1<<0) #define LockMask (1<<1) #define ControlMask (1<<2) #define Mod1Mask (1<<3) #define Mod2Mask (1<<4) #define Mod3Mask (1<<5) #define Mod4Mask (1<<6) #define Mod5Mask (1<<7) #define ShiftMapIndex 0 #define LockMapIndex 1 #define ControlMapIndex 2 #define Mod1MapIndex 3 #define Mod2MapIndex 4 #define Mod3MapIndex 5 #define Mod4MapIndex 6 #define Mod5MapIndex 7 #define Button1Mask (1<<8) #define Button2Mask (1<<9) #define Button3Mask (1<<10) #define Button4Mask (1<<11) #define Button5Mask (1<<12) #define AnyModifier (1<<15) /* used in GrabButton, GrabKey */ #define Button1 1 #define Button2 2 #define Button3 3 #define Button4 4 #define Button5 5 #define NotifyNormal 0 #define NotifyGrab 1 #define NotifyUngrab 2 #define NotifyWhileGrabbed 3 #define NotifyHint 1 /* for MotionNotify events */ #define NotifyAncestor 0 #define NotifyVirtual 1 #define NotifyInferior 2 #define NotifyNonlinear 3 #define NotifyNonlinearVirtual 4 #define NotifyPointer 5 #define NotifyPointerRoot 6 #define NotifyDetailNone 7 #define VisibilityUnobscured 0 #define VisibilityPartiallyObscured 1 #define VisibilityFullyObscured 2 #define PlaceOnTop 0 #define PlaceOnBottom 1 #define FamilyInternet 0 #define FamilyDECnet 1 #define FamilyChaos 2 #define PropertyNewValue 0 #define PropertyDelete 1 #define ColormapUninstalled 0 #define ColormapInstalled 1 #define GrabModeSync 0 #define GrabModeAsync 1 #define GrabSuccess 0 #define AlreadyGrabbed 1 #define GrabInvalidTime 2 #define GrabNotViewable 3 #define GrabFrozen 4 #define AsyncPointer 0 #define SyncPointer 1 #define ReplayPointer 2 #define AsyncKeyboard 3 #define SyncKeyboard 4 #define ReplayKeyboard 5 #define AsyncBoth 6 #define SyncBoth 7 #define RevertToNone (int)None #define RevertToPointerRoot (int)PointerRoot #define RevertToParent 2 #define Success 0 /* everything's okay */ #define BadRequest 1 /* bad request code */ #define BadValue 2 /* int parameter out of range */ #define BadWindow 3 /* parameter not a Window */ #define BadPixmap 4 /* parameter not a Pixmap */ #define BadAtom 5 /* parameter not an Atom */ #define BadCursor 6 /* parameter not a Cursor */ #define BadFont 7 /* parameter not a Font */ #define BadMatch 8 /* parameter mismatch */ #define BadDrawable 9 /* parameter not a Pixmap or Window */ #define BadAccess 10 #define BadAlloc 11 /* insufficient resources */ #define BadColor 12 /* no such colormap */ #define BadGC 13 /* parameter not a GC */ #define BadIDChoice 14 /* choice not in range or already used */ #define BadName 15 /* font or color name doesn't exist */ #define BadLength 16 /* Request length incorrect */ #define BadImplementation 17 /* server is defective */ #define FirstExtensionError 128 #define LastExtensionError 255 #define InputOutput 1 #define InputOnly 2 #define CWBackPixmap (1L<<0) #define CWBackPixel (1L<<1) #define CWBorderPixmap (1L<<2) #define CWBorderPixel (1L<<3) #define CWBitGravity (1L<<4) #define CWWinGravity (1L<<5) #define CWBackingStore (1L<<6) #define CWBackingPlanes (1L<<7) #define CWBackingPixel (1L<<8) #define CWOverrideRedirect (1L<<9) #define CWSaveUnder (1L<<10) #define CWEventMask (1L<<11) #define CWDontPropagate (1L<<12) #define CWColormap (1L<<13) #define CWCursor (1L<<14) #define CWX (1<<0) #define CWY (1<<1) #define CWWidth (1<<2) #define CWHeight (1<<3) #define CWBorderWidth (1<<4) #define CWSibling (1<<5) #define CWStackMode (1<<6) #define ForgetGravity 0 #define NorthWestGravity 1 #define NorthGravity 2 #define NorthEastGravity 3 #define WestGravity 4 #define CenterGravity 5 #define EastGravity 6 #define SouthWestGravity 7 #define SouthGravity 8 #define SouthEastGravity 9 #define StaticGravity 10 #define UnmapGravity 0 #define NotUseful 0 #define WhenMapped 1 #define Always 2 #define IsUnmapped 0 #define IsUnviewable 1 #define IsViewable 2 #define SetModeInsert 0 #define SetModeDelete 1 #define DestroyAll 0 #define RetainPermanent 1 #define RetainTemporary 2 #define Above 0 #define Below 1 #define TopIf 2 #define BottomIf 3 #define Opposite 4 #define RaiseLowest 0 #define LowerHighest 1 #define PropModeReplace 0 #define PropModePrepend 1 #define PropModeAppend 2 #define GXclear 0x0 /* 0 */ #define GXand 0x1 /* src AND dst */ #define GXandReverse 0x2 /* src AND NOT dst */ #define GXcopy 0x3 /* src */ #define GXandInverted 0x4 /* NOT src AND dst */ #define GXnoop 0x5 /* dst */ #define GXxor 0x6 /* src XOR dst */ #define GXor 0x7 /* src OR dst */ #define GXnor 0x8 /* NOT src AND NOT dst */ #define GXequiv 0x9 /* NOT src XOR dst */ #define GXinvert 0xa /* NOT dst */ #define GXorReverse 0xb /* src OR NOT dst */ #define GXcopyInverted 0xc /* NOT src */ #define GXorInverted 0xd /* NOT src OR dst */ #define GXnand 0xe /* NOT src OR NOT dst */ #define GXset 0xf /* 1 */ #define LineSolid 0 #define LineOnOffDash 1 #define LineDoubleDash 2 #define CapNotLast 0 #define CapButt 1 #define CapRound 2 #define CapProjecting 3 #define JoinMiter 0 #define JoinRound 1 #define JoinBevel 2 #define FillSolid 0 #define FillTiled 1 #define FillStippled 2 #define FillOpaqueStippled 3 #define EvenOddRule 0 #define WindingRule 1 #define ClipByChildren 0 #define IncludeInferiors 1 #define Unsorted 0 #define YSorted 1 #define YXSorted 2 #define YXBanded 3 #define CoordModeOrigin 0 /* relative to the origin */ #define CoordModePrevious 1 /* relative to previous point */ #define Complex 0 /* paths may intersect */ #define Nonconvex 1 /* no paths intersect, but not convex */ #define Convex 2 /* wholly convex */ #define ArcChord 0 /* join endpoints of arc */ #define ArcPieSlice 1 /* join endpoints to center of arc */ #define GCFunction (1L<<0) #define GCPlaneMask (1L<<1) #define GCForeground (1L<<2) #define GCBackground (1L<<3) #define GCLineWidth (1L<<4) #define GCLineStyle (1L<<5) #define GCCapStyle (1L<<6) #define GCJoinStyle (1L<<7) #define GCFillStyle (1L<<8) #define GCFillRule (1L<<9) #define GCTile (1L<<10) #define GCStipple (1L<<11) #define GCTileStipXOrigin (1L<<12) #define GCTileStipYOrigin (1L<<13) #define GCFont (1L<<14) #define GCSubwindowMode (1L<<15) #define GCGraphicsExposures (1L<<16) #define GCClipXOrigin (1L<<17) #define GCClipYOrigin (1L<<18) #define GCClipMask (1L<<19) #define GCDashOffset (1L<<20) #define GCDashList (1L<<21) #define GCArcMode (1L<<22) #define GCLastBit 22 #define FontLeftToRight 0 #define FontRightToLeft 1 #define FontChange 255 #define XYBitmap 0 /* depth 1, XYFormat */ #define XYPixmap 1 /* depth == drawable depth */ #define ZPixmap 2 /* depth == drawable depth */ #define AllocNone 0 /* create map with no entries */ #define AllocAll 1 /* allocate entire map writeable */ #define DoRed (1<<0) #define DoGreen (1<<1) #define DoBlue (1<<2) #define CursorShape 0 /* largest size that can be displayed */ #define TileShape 1 /* size tiled fastest */ #define StippleShape 2 /* size stippled fastest */ #define AutoRepeatModeOff 0 #define AutoRepeatModeOn 1 #define AutoRepeatModeDefault 2 #define LedModeOff 0 #define LedModeOn 1 #define KBKeyClickPercent (1L<<0) #define KBBellPercent (1L<<1) #define KBBellPitch (1L<<2) #define KBBellDuration (1L<<3) #define KBLed (1L<<4) #define KBLedMode (1L<<5) #define KBKey (1L<<6) #define KBAutoRepeatMode (1L<<7) #define MappingSuccess 0 #define MappingBusy 1 #define MappingFailed 2 #define MappingModifier 0 #define MappingKeyboard 1 #define MappingPointer 2 #define DontPreferBlanking 0 #define PreferBlanking 1 #define DefaultBlanking 2 #define DisableScreenSaver 0 #define DisableScreenInterval 0 #define DontAllowExposures 0 #define AllowExposures 1 #define DefaultExposures 2 #define ScreenSaverReset 0 #define ScreenSaverActive 1 #define HostInsert 0 #define HostDelete 1 #define EnableAccess 1 #define DisableAccess 0 #define StaticGray 0 #define GrayScale 1 #define StaticColor 2 #define PseudoColor 3 #define TrueColor 4 #define DirectColor 5 #define LSBFirst 0 #define MSBFirst 1 #define True 1 #define False 0 #define XK_Alt_L 0xFFE9 /* Left alt */ #define XK_BackSpace 0xFF08 /* back space, back char */ #define XK_Tab 0xFF09 #define XK_Linefeed 0xFF0A /* Linefeed, LF */ #define XK_Clear 0xFF0B #define XK_Return 0xFF0D /* Return, enter */ #define XK_Pause 0xFF13 /* Pause, hold */ #define XK_Scroll_Lock 0xFF14 #define XK_Sys_Req 0xFF15 #define XK_Escape 0xFF1B #define XK_Delete 0xFFFF /* Delete, rubout */ #define XK_Home 0xFF50 #define XK_Left 0xFF51 /* Move left, left arrow */ #define XK_Up 0xFF52 /* Move up, up arrow */ #define XK_Right 0xFF53 /* Move right, right arrow */ #define XK_Down 0xFF54 /* Move down, down arrow */ #define XK_Prior 0xFF55 /* Prior, previous */ #define XK_Page_Up 0xFF55 #define XK_Next 0xFF56 /* Next */ #define XK_Page_Down 0xFF56 #define XK_End 0xFF57 /* EOL */ #define XK_Begin 0xFF58 /* BOL */ #define XK_Select 0xFF60 /* Select, mark */ #define XK_Print 0xFF61 #define XK_Execute 0xFF62 /* Execute, run, do */ #define XK_Insert 0xFF63 /* Insert, insert here */ #define XK_Undo 0xFF65 /* Undo, oops */ #define XK_Redo 0xFF66 /* redo, again */ #define XK_Menu 0xFF67 #define XK_Find 0xFF68 /* Find, search */ #define XK_Cancel 0xFF69 /* Cancel, stop, abort, exit */ #define XK_Help 0xFF6A /* Help */ #define XK_Break 0xFF6B #define XK_Mode_switch 0xFF7E /* Character set switch */ #define XK_script_switch 0xFF7E /* Alias for mode_switch */ #define XK_Num_Lock 0xFF7F #define XK_F1 0xFFBE #define XK_F2 0xFFBF #define XK_F3 0xFFC0 #define XK_F4 0xFFC1 #define XK_F5 0xFFC2 #define XK_F6 0xFFC3 #define XK_F7 0xFFC4 #define XK_F8 0xFFC5 #define XK_F9 0xFFC6 #define XK_F10 0xFFC7 #define XK_F11 0xFFC8 #define XK_L1 0xFFC8 #define XK_F12 0xFFC9 #define VisualNoMask 0x0 #define VisualIDMask 0x1 #define VisualScreenMask 0x2 #define VisualDepthMask 0x4 #define VisualClassMask 0x8 #define VisualRedMaskMask 0x10 #define VisualGreenMaskMask 0x20 #define VisualBlueMaskMask 0x40 #define VisualColormapSizeMask 0x80 #define VisualBitsPerRGBMask 0x100 #define VisualAllMask 0x1FF #define USPosition (1L << 0) /* user specified x, y */ #define USSize (1L << 1) /* user specified width, height */ #define PPosition (1L << 2) /* program specified position */ #define PSize (1L << 3) /* program specified size */ #define PMinSize (1L << 4) /* program specified minimum size */ #define PMaxSize (1L << 5) /* program specified maximum size */ #define PResizeInc (1L << 6) /* program specified resize increments */ #define PAspect (1L << 7) /* program specified min and max aspect ratios */ #define PBaseSize (1L << 8) /* program specified base for incrementing */ #define PWinGravity (1L << 9) /* program specified window gravity */ #define NoValue 0x0000 #define XValue 0x0001 #define YValue 0x0002 #define WidthValue 0x0004 #define HeightValue 0x0008 #define AllValues 0x000F #define XNegative 0x0010 #define YNegative 0x0020 #define XNoMemory -1 #define XLocaleNotSupported -2 #define XConverterNotFound -3 #define LC_CTYPE 2 /* used by rxvt/src/main.c */ #define NormalState 1 #define IconicState 3 #define InputHint (1L << 0) #define StateHint (1L << 1) #define WindowGroupHint (1L << 6) #define XC_left_ptr 68 #define XC_xterm 152 typedef struct _XRegion *Region; typedef struct _XOC *XOC, *XFontSet; typedef struct _XExtData { int number; /* number returned by XRegisterExtension */ struct _XExtData *next; /* next item on list of data for structure */ int (*free_private)( /* called to free private storage */ struct _XExtData *extension ); XPointer private_data; /* data private to this extension. */ } XExtData; typedef struct { /* public to extension, cannot be changed */ int extension; /* extension number */ int major_opcode; /* major op-code assigned by server */ int first_event; /* first event number for the extension */ int first_error; /* first error number for the extension */ } XExtCodes; typedef struct { XExtData *ext_data; /* hook for extension to hang data */ VisualID visualid; /* visual id of this visual */ #if defined(__cplusplus) || defined(c_plusplus) int c_class; /* C++ class of screen (monochrome, etc.) */ #else int class; /* class of screen (monochrome, etc.) */ #endif unsigned long red_mask, green_mask, blue_mask; /* mask values */ int bits_per_rgb; /* log base 2 of distinct color values */ int map_entries; /* color map entries */ } Visual; typedef struct { int depth; /* this depth (Z) of the depth */ int nvisuals; /* number of Visual types at this depth */ Visual *visuals; /* list of visuals possible at this depth */ } Depth; typedef struct { int function; /* logical operation */ unsigned long plane_mask;/* plane mask */ unsigned long foreground;/* foreground pixel */ unsigned long background;/* background pixel */ int line_width; /* line width */ int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */ int cap_style; /* CapNotLast, CapButt, CapRound, CapProjecting */ int join_style; /* JoinMiter, JoinRound, JoinBevel */ int fill_style; /* FillSolid, FillTiled, FillStippled, FillOpaeueStippled */ int fill_rule; /* EvenOddRule, WindingRule */ int arc_mode; /* ArcChord, ArcPieSlice */ Pixmap tile; /* tile pixmap for tiling operations */ Pixmap stipple; /* stipple 1 plane pixmap for stipping */ int ts_x_origin; /* offset for tile or stipple operations */ int ts_y_origin; Font font; /* default text font for text operations */ int subwindow_mode; /* ClipByChildren, IncludeInferiors */ BoolDef graphics_exposures;/* boolean, should exposures be generated */ int clip_x_origin; /* origin for clipping */ int clip_y_origin; Pixmap clip_mask; /* bitmap clipping; other calls for rects */ int dash_offset; /* patterned/dashed line information */ char dashes; } XGCValues; typedef struct _XGC { XExtData *ext_data; /* hook for extension to hang data */ GContext gid; /* protocol ID for graphics context */ int rects; int dashes; XGCValues values; int dirty; } *GC; typedef struct { XExtData *ext_data; /* hook for extension to hang data */ struct _XDisplay *display;/* back pointer to display structure */ Window root; /* Root window id. */ int width, height; /* width and height of screen */ int mwidth, mheight; /* width and height of in millimeters */ int ndepths; /* number of depths possible */ Depth *depths; /* list of allowable depths on the screen */ int root_depth; /* bits per pixel */ Visual *root_visual; /* root visual */ GC default_gc; /* GC for the root root visual */ Colormap cmap; /* default color map */ unsigned long white_pixel; unsigned long black_pixel; /* White and Black pixel values */ int max_maps, min_maps; /* max and min color maps */ int backing_store; /* Never, WhenMapped, Always */ BoolDef save_unders; long root_input_mask; /* initial root input mask */ } Screen; typedef struct { XExtData *ext_data; /* hook for extension to hang data */ int depth; /* depth of this image format */ int bits_per_pixel; /* bits/pixel at this depth */ int scanline_pad; /* scanline must padded to this multiple */ } ScreenFormat; typedef struct _XDisplay { XExtData *ext_data; /* hook for extension to hang data */ struct _XPrivate *private1; int fd; /* Network socket. */ int private2; int proto_major_version;/* major version of server's X protocol */ int proto_minor_version;/* minor version of servers X protocol */ char *vendor; /* vendor of the server hardware */ XID private3; XID private4; XID private5; int private6; XID (*resource_alloc)( /* allocator function */ struct _XDisplay* ); int byte_order; /* screen byte order, LSBFirst, MSBFirst */ int bitmap_unit; /* padding and data requirements */ int bitmap_pad; /* padding requirements on bitmaps */ int bitmap_bit_order; /* LeastSignificant or MostSignificant */ int nformats; /* number of pixmap formats in list */ ScreenFormat *pixmap_format; /* pixmap format list */ int private8; int release; /* release of the server */ struct _XPrivate *private9, *private10; int qlen; /* Length of input event queue */ unsigned long last_request_read; /* seq number of last event read */ unsigned long request; /* sequence number of last request. */ XPointer private11; XPointer private12; XPointer private13; XPointer private14; unsigned max_request_size; /* maximum number 32 bit words in request*/ struct _XrmHashBucketRec *db; int (*private15)( struct _XDisplay* ); char *display_name; /* "host:display" string used on this connect*/ int default_screen; /* default screen for operations */ int nscreens; /* number of screens on this server*/ Screen *screens; /* pointer to list of screens */ unsigned long motion_buffer; /* size of motion buffer */ unsigned long private16; int min_keycode; /* minimum defined keycode */ int max_keycode; /* maximum defined keycode */ XPointer private17; XPointer private18; int private19; char *xdefaults; /* contents of defaults from server */ /* there is more to this structure, but it is private to Xlib */ } Display, *_XPrivDisplay; typedef int StatusDef; typedef struct { /* normal 16 bit characters are two bytes */ unsigned char byte1; unsigned char byte2; } XChar2b; typedef struct { short lbearing; /* origin to left edge of raster */ short rbearing; /* origin to right edge of raster */ short width; /* advance to next char's origin */ short ascent; /* baseline to top edge of raster */ short descent; /* baseline to bottom edge of raster */ unsigned short attributes; /* per char flags (not predefined) */ } XCharStruct; typedef struct { char *res_name; char *res_class; } XClassHint; typedef struct { unsigned long pixel; unsigned short red, green, blue; char flags; /* do_red, do_green, do_blue */ char pad; } XColor; typedef struct _XComposeStatus { XPointer compose_ptr; /* state table pointer */ int chars_matched; /* match state */ } XComposeStatus; /* events --- goes on for a bit */ typedef struct { int type; /* of event */ unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* "event" window it is reported relative to */ Window root; /* root window that the event occurred on */ Window subwindow; /* child window */ Time time; /* milliseconds */ int x, y; /* pointer x, y coordinates in event window */ int x_root, y_root; /* coordinates relative to root */ unsigned int state; /* key or button mask */ unsigned int keycode; /* detail */ BoolDef same_screen; /* same screen flag */ } XKeyEvent; typedef XKeyEvent XKeyPressedEvent; typedef XKeyEvent XKeyReleasedEvent; typedef struct { int type; /* of event */ unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* "event" window it is reported relative to */ Window root; /* root window that the event occurred on */ Window subwindow; /* child window */ Time time; /* milliseconds */ int x, y; /* pointer x, y coordinates in event window */ int x_root, y_root; /* coordinates relative to root */ unsigned int state; /* key or button mask */ unsigned int button; /* detail */ BoolDef same_screen; /* same screen flag */ } XButtonEvent; typedef XButtonEvent XButtonPressedEvent; typedef XButtonEvent XButtonReleasedEvent; typedef struct { int type; /* of event */ unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* "event" window reported relative to */ Window root; /* root window that the event occurred on */ Window subwindow; /* child window */ Time time; /* milliseconds */ int x, y; /* pointer x, y coordinates in event window */ int x_root, y_root; /* coordinates relative to root */ unsigned int state; /* key or button mask */ char is_hint; /* detail */ BoolDef same_screen; /* same screen flag */ } XMotionEvent; typedef XMotionEvent XPointerMovedEvent; typedef struct { int type; /* of event */ unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* "event" window reported relative to */ Window root; /* root window that the event occurred on */ Window subwindow; /* child window */ Time time; /* milliseconds */ int x, y; /* pointer x, y coordinates in event window */ int x_root, y_root; /* coordinates relative to root */ int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ int detail; /* * NotifyAncestor, NotifyVirtual, NotifyInferior, * NotifyNonlinear,NotifyNonlinearVirtual */ BoolDef same_screen; /* same screen flag */ BoolDef focus; /* boolean focus */ unsigned int state; /* key or button mask */ } XCrossingEvent; typedef XCrossingEvent XEnterWindowEvent; typedef XCrossingEvent XLeaveWindowEvent; typedef struct { int type; /* FocusIn or FocusOut */ unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* window of event */ int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ int detail; /* * NotifyAncestor, NotifyVirtual, NotifyInferior, * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer, * NotifyPointerRoot, NotifyDetailNone */ } XFocusChangeEvent; typedef XFocusChangeEvent XFocusInEvent; typedef XFocusChangeEvent XFocusOutEvent; /* generated on EnterWindow and FocusIn when KeyMapState selected */ typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; char key_vector[32]; } XKeymapEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; int x, y; int width, height; int count; /* if non-zero, at least this many more */ } XExposeEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Drawable drawable; int x, y; int width, height; int count; /* if non-zero, at least this many more */ int major_code; /* core is CopyArea or CopyPlane */ int minor_code; /* not defined in the core */ } XGraphicsExposeEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Drawable drawable; int major_code; /* core is CopyArea or CopyPlane */ int minor_code; /* not defined in the core */ } XNoExposeEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; int state; /* Visibility state */ } XVisibilityEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window parent; /* parent of the window */ Window window; /* window id of window created */ int x, y; /* window location */ int width, height; /* size of window */ int border_width; /* border width */ BoolDef override_redirect; /* creation should be overridden */ } XCreateWindowEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; } XDestroyWindowEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; BoolDef from_configure; } XUnmapEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; BoolDef override_redirect; /* boolean, is override set... */ } XMapEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window parent; Window window; } XMapRequestEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; Window parent; int x, y; BoolDef override_redirect; } XReparentEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; int x, y; int width, height; int border_width; Window above; BoolDef override_redirect; } XConfigureEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; int x, y; } XGravityEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; int width, height; } XResizeRequestEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window parent; Window window; int x, y; int width, height; int border_width; Window above; int detail; /* Above, Below, TopIf, BottomIf, Opposite */ unsigned long value_mask; } XConfigureRequestEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; int place; /* PlaceOnTop, PlaceOnBottom */ } XCirculateEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window parent; Window window; int place; /* PlaceOnTop, PlaceOnBottom */ } XCirculateRequestEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; Atom atom; Time time; int state; /* NewValue, Deleted */ } XPropertyEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; Atom selection; Time time; } XSelectionClearEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window owner; Window requestor; Atom selection; Atom target; Atom property; Time time; } XSelectionRequestEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window requestor; Atom selection; Atom target; Atom property; /* ATOM or None */ Time time; } XSelectionEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; Colormap colormap; /* COLORMAP or None */ #if defined(__cplusplus) || defined(c_plusplus) BoolDef c_new; /* C++ */ #else BoolDef new; #endif int state; /* ColormapInstalled, ColormapUninstalled */ } XColormapEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; Atom message_type; int format; union { char b[20]; short s[10]; long l[5]; } data; } XClientMessageEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* unused */ int request; /* one of MappingModifier, MappingKeyboard, MappingPointer */ int first_keycode; /* first keycode */ int count; /* defines range of change w. first_keycode*/ } XMappingEvent; typedef struct { int type; Display *display; /* Display the event was read from */ XID resourceid; /* resource id */ unsigned long serial; /* serial number of failed request */ unsigned char error_code; /* error code of failed request */ unsigned char request_code; /* Major op-code of failed request */ unsigned char minor_code; /* Minor op-code of failed request */ } XErrorEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ BoolDef send_event; /* true if this came from a SendEvent request */ Display *display;/* Display the event was read from */ Window window; /* window on which event was requested in event mask */ } XAnyEvent; /* * this union is defined so Xlib can always use the same sized * event structure internally, to avoid memory fragmentation. */ typedef union _XEvent { int type; /* must not be changed; first element */ XAnyEvent xany; XKeyEvent xkey; XButtonEvent xbutton; XMotionEvent xmotion; XCrossingEvent xcrossing; XFocusChangeEvent xfocus; XExposeEvent xexpose; XGraphicsExposeEvent xgraphicsexpose; XNoExposeEvent xnoexpose; XVisibilityEvent xvisibility; XCreateWindowEvent xcreatewindow; XDestroyWindowEvent xdestroywindow; XUnmapEvent xunmap; XMapEvent xmap; XMapRequestEvent xmaprequest; XReparentEvent xreparent; XConfigureEvent xconfigure; XGravityEvent xgravity; XResizeRequestEvent xresizerequest; XConfigureRequestEvent xconfigurerequest; XCirculateEvent xcirculate; XCirculateRequestEvent xcirculaterequest; XPropertyEvent xproperty; XSelectionClearEvent xselectionclear; XSelectionRequestEvent xselectionrequest; XSelectionEvent xselection; XColormapEvent xcolormap; XClientMessageEvent xclient; XMappingEvent xmapping; XErrorEvent xerror; XKeymapEvent xkeymap; long pad[24]; } XEvent; typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */ Display* /* display */, XErrorEvent* /* error_event */ ); typedef struct { Atom name; unsigned long card32; } XFontProp; typedef struct { XExtData *ext_data; /* hook for extension to hang data */ Font fid; /* Font id for this font */ unsigned direction; /* hint about direction the font is painted */ unsigned min_char_or_byte2;/* first character */ unsigned max_char_or_byte2;/* last character */ unsigned min_byte1; /* first row that exists */ unsigned max_byte1; /* last row that exists */ BoolDef all_chars_exist;/* flag if all characters have non-zero size*/ unsigned default_char; /* char to print for undefined character */ int n_properties; /* how many properties there are */ XFontProp *properties; /* pointer to array of additional properties*/ XCharStruct min_bounds; /* minimum bounds over all existing char*/ XCharStruct max_bounds; /* maximum bounds over all existing char*/ XCharStruct *per_char; /* first_char to last_char information */ int ascent; /* log. extent above baseline for spacing */ int descent; /* log. descent below baseline for spacing */ } XFontStruct; typedef enum { XStringStyle, /* STRING */ XCompoundTextStyle, /* COMPOUND_TEXT */ XTextStyle, /* text in owner's encoding (current locale)*/ XStdICCTextStyle, /* STRING, else COMPOUND_TEXT */ XUTF8StringStyle /* UTF8_STRING */ } XICCEncodingStyle; typedef struct _XIM *XIM; typedef struct _XIC *XIC; /* * Data structure for "image" data, used by image manipulation routines. */ typedef struct _XImage { int width, height; /* size of image */ int xoffset; /* number of pixels offset in X direction */ int format; /* XYBitmap, XYPixmap, ZPixmap */ char *data; /* pointer to image data */ int byte_order; /* data byte order, LSBFirst, MSBFirst */ int bitmap_unit; /* quant. of scanline 8, 16, 32 */ int bitmap_bit_order; /* LSBFirst, MSBFirst */ int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */ int depth; /* depth of image */ int bytes_per_line; /* accelarator to next line */ int bits_per_pixel; /* bits per pixel (ZPixmap) */ unsigned long red_mask; /* bits in z arrangment */ unsigned long green_mask; unsigned long blue_mask; XPointer obdata; /* hook for the object routines to hang on */ struct funcs { /* image manipulation routines */ struct _XImage *(*create_image)( struct _XDisplay* /* display */, Visual* /* visual */, unsigned int /* depth */, int /* format */, int /* offset */, char* /* data */, unsigned int /* width */, unsigned int /* height */, int /* bitmap_pad */, int /* bytes_per_line */); int (*destroy_image) (struct _XImage *); unsigned long (*get_pixel) (struct _XImage *, int, int); int (*put_pixel) (struct _XImage *, int, int, unsigned long); struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int); int (*add_pixel) (struct _XImage *, long); } f; } XImage; typedef struct { int max_keypermod; /* The server's max # of keys per modifier */ KeyCode *modifiermap; /* An 8 by max_keypermod array of modifiers */ } XModifierKeymap; typedef struct { short x, y; } XPoint; typedef struct { short x, y; unsigned short width, height; } XRectangle; typedef struct { short x1, y1, x2, y2; } XSegment; typedef struct { Pixmap background_pixmap; /* background or None or ParentRelative */ unsigned long background_pixel; /* background pixel */ Pixmap border_pixmap; /* border of the window */ unsigned long border_pixel; /* border pixel value */ int bit_gravity; /* one of bit gravity values */ int win_gravity; /* one of the window gravity values */ int backing_store; /* NotUseful, WhenMapped, Always */ unsigned long backing_planes;/* planes to be preseved if possible */ unsigned long backing_pixel;/* value to use in restoring planes */ BoolDef save_under; /* should bits under be saved? (popups) */ long event_mask; /* set of events that should be saved */ long do_not_propagate_mask; /* set of events that should not propagate */ BoolDef override_redirect; /* boolean value for override-redirect */ Colormap colormap; /* color map to be associated with window */ Cursor cursor; /* cursor to be displayed (or None) */ } XSetWindowAttributes; typedef struct { long flags; /* marks which fields in this structure are defined */ int x, y; /* obsolete for new window mgrs, but clients */ int width, height; /* should set so old wm's don't mess up */ int min_width, min_height; int max_width, max_height; int width_inc, height_inc; struct { int x; /* numerator */ int y; /* denominator */ } min_aspect, max_aspect; int base_width, base_height; /* added by ICCCM version 1 */ int win_gravity; /* added by ICCCM version 1 */ } XSizeHints; typedef struct { Colormap colormap; unsigned long red_max; unsigned long red_mult; unsigned long green_max; unsigned long green_mult; unsigned long blue_max; unsigned long blue_mult; unsigned long base_pixel; VisualID visualid; /* added by ICCCM version 1 */ XID killid; /* added by ICCCM version 1 */ } XStandardColormap; typedef struct { unsigned char *value; /* same as Property routines */ Atom encoding; /* prop type */ int format; /* prop data format: 8, 16, or 32 */ unsigned long nitems; /* number of data items in value */ } XTextProperty; typedef struct { Visual *visual; VisualID visualid; int screen; int depth; #if defined(__cplusplus) || defined(c_plusplus) int c_class; /* C++ */ #else int class; #endif unsigned long red_mask; unsigned long green_mask; unsigned long blue_mask; int colormap_size; int bits_per_rgb; } XVisualInfo; typedef struct { long flags; /* marks which fields in this structure are defined */ BoolDef input; /* does this application rely on the window manager to get keyboard input? */ int initial_state; /* see below */ Pixmap icon_pixmap; /* pixmap to be used as icon */ Window icon_window; /* window to be used as icon */ int icon_x, icon_y; /* initial position of icon */ Pixmap icon_mask; /* icon mask bitmap */ XID window_group; /* id of related window group */ /* this structure may be extended in the future */ } XWMHints; typedef struct { int x, y; /* location of window */ int width, height; /* width and height of window */ int border_width; /* border width of window */ int depth; /* depth of window */ Visual *visual; /* the associated visual structure */ Window root; /* root of screen containing window */ #if defined(__cplusplus) || defined(c_plusplus) int c_class; /* C++ InputOutput, InputOnly*/ #else int class; /* InputOutput, InputOnly*/ #endif int bit_gravity; /* one of bit gravity values */ int win_gravity; /* one of the window gravity values */ int backing_store; /* NotUseful, WhenMapped, Always */ unsigned long backing_planes;/* planes to be preserved if possible */ unsigned long backing_pixel;/* value to be used when restoring planes */ BoolDef save_under; /* boolean, should bits under be saved? */ Colormap colormap; /* color map to be associated with window */ BoolDef map_installed; /* boolean, is color map currently installed*/ int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ long all_event_masks; /* set of events all people have interest in*/ long your_event_mask; /* my event mask */ long do_not_propagate_mask; /* set of events that should not propagate */ BoolDef override_redirect; /* boolean value for override-redirect */ Screen *screen; /* back pointer to correct screen */ } XWindowAttributes; struct _XrmHashBucketRec; /* needed for xdefaults.c */ typedef struct _XrmHashBucketRec *XrmDatabase; typedef enum {XrmBindTightly, XrmBindLoosely} XrmBinding, *XrmBindingList; typedef int XrmQuark, *XrmQuarkList; #define NULLQUARK ((XrmQuark) 0) typedef XrmQuark XrmRepresentation; typedef struct { unsigned int size; XPointer addr; } XrmValue, *XrmValuePtr; /* extend for defining an event callback */ #define USING_W11LIB typedef void (proto_W11EventHandler)(XEvent *ev); void W11AddEventHandler(Display *display, proto_W11EventHandler *ev); /* functions */ Display *XOpenDisplay(const char *name); int XCloseDisplay(Display *display); char *XDisplayString(Display *display); int XSync(Display *display,int discard); int XFlush(Display *display); XVisualInfo *XGetVisualInfo( Display *display, long vinm, XVisualInfo *vint, int *n); StatusDef XMatchVisualInfo( Display* display, int screen, int depth, int class, XVisualInfo* vinfo_return); int XClearWindow(Display *display, Window w); Window XCreateSimpleWindow( Display *display, Window parent, int x, int y, unsigned int brd, unsigned int w, unsigned int h, unsigned long bg, unsigned long brd_col); Window XCreateWindow( Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int bw, int depth, unsigned int class, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attr); int XDestroyWindow( Display *display, Window w); StatusDef XGetGeometry( Display *display, Drawable w, Window *root, int *x, int *y, unsigned int *width, unsigned int *height, unsigned int *bw, unsigned int *depth); StatusDef XGetWindowAttributes(Display *display, Window w, XWindowAttributes *wattr); int XSelectInput(Display *display, Window window, long mask); int XMapWindow(Display *display, Window window); int XIconifyWindow(Display *display, Window w, int screen_number); GC XCreateGC( Display *display, Drawable window, unsigned long mask, XGCValues *gc_values); int XFreeGC( Display *display, GC gc); int XSetForeground( Display *display, GC gc, unsigned long color); int XDrawString(Display *display, Drawable window, GC gc, int x, int y, const char* str, int len); int XDrawString16(Display *display, Drawable window, GC gc, int x, int y, const XChar2b* str, int len); int XDrawImageString( Display* display, Drawable d, GC gc, int x, int y, const char* string, int length); int XDrawImageString16(Display *display, Drawable window, GC gc, int x, int y, const XChar2b* str, int len); int XFillRectangle( Display *display, Drawable window, GC gc, int x, int y, unsigned int w, unsigned int h); int XClearArea( Display *display, Window w, int x, int y, unsigned int width, unsigned int height, BoolDef exposures); Region XCreateRegion(); int XClipBox( Region hrgn, XRectangle *rect); int XSetRegion( Display *display, GC gc, Region hrgn); int XDestroyRegion(Region hrgn); int XUnionRectWithRegion(XRectangle *rect, Region hrgnsrc, Region hrgndest); int XDrawArc( Display *display, Drawable w, GC gc, int x, int y, unsigned int width,unsigned int height, int a1, int a2); int XFillArc( Display *display, Drawable w, GC gc, int x, int y, unsigned int width,unsigned height, int a1, int a2); int XFillPolygon( Display *display, Drawable w, GC gc, XPoint *points, int nps, int shape, int mode); int XDrawLine( Display *display, Drawable w, GC gc, int x1,int y1, int x2,int y2); int XDrawLines( Display *display, Drawable w, GC gc, XPoint *points, int nps,int mode); int XDrawPoints( Display *display, Drawable w, GC gc, XPoint *points, int nps, int mode); int XDrawPoint( Display *display, Drawable w, GC gc, int x, int y); int XDrawRectangle( Display *display, Drawable w, GC gc, int x, int y, unsigned int width, unsigned int height); int XDrawSegments( Display *display, Drawable w, GC gc, XSegment *segs, int nsegs); Pixmap XCreatePixmap( Display *display, Drawable drawable, unsigned int width, unsigned int height, unsigned int depth); Pixmap XCreateBitmapFromData(Display *display, Drawable drawable, const char *data, unsigned int width, unsigned int height); int XFreePixmap( Display *display, Pixmap pixmap); int XCopyArea( Display *display, Drawable src, Drawable dest, GC gc, int src_x, int src_y, unsigned int width, unsigned int height, int dest_x, int dest_y); XImage *XGetImage( Display *display, Drawable drawable, int x, int y, unsigned int width, unsigned int height, unsigned long plane_mask, int format); XImage *XCreateImage( Display *display, Visual *visual, unsigned int depth, int format, int offset, char *data, unsigned int width, unsigned int height, int bitmap_pad, int bytes_per_line); int XPutImage( Display *display, Drawable w, GC gc, XImage *image, int sx,int sy,int dx,int dy, unsigned int width,unsigned int height); int XSetWindowBackground( Display *display, Window w, unsigned long bg); int XSetWindowBackgroundPixmap( Display *display, Window w, Pixmap background_tile); int XSetFillStyle( Display *display, GC gc, int fs); int XSetDashes(Display *display, GC gc, int dash_offset, const char * dash_list, int n); int XChangeWindowAttributes( Display *display, Window w, unsigned long vmask, XSetWindowAttributes *attr); int XLowerWindow(Display *display, Window w); int XMapRaised( Display *display, Window w); int XMapSubwindows( Display *display, Window w); StatusDef XQueryTree( Display *display, Window w, Window* root, Window* parent, Window** ch, unsigned int *n); int XRaiseWindow( Display *display, Window w); Window XRootWindow( Display *display, int scr); Window XRootWindowOfScreen(Screen *scr); BoolDef XTranslateCoordinates( Display *display, Window sw, Window dw, int sx, int sy, int *dx, int *dy, Window *ch); int XUnmapWindow(Display *display, Window w); int XCopyGC( Display *display, GC sgc, unsigned long vmask, GC dgc); int XSetClipMask( Display *display, GC gc, Pixmap cmask); int XSetClipRectangles( Display *display, GC gc, int clx, int cly, XRectangle *rs, int n, int order); int XSetFunction( Display *display, GC gc, int fn); int XSetLineAttributes( Display *display, GC gc, unsigned int lw, int ls, int cs, int js); int XSetPlaneMask( Display *display, GC gc, unsigned long pmask); int XSetTile( Display *display, GC gc, Pixmap tile); StatusDef XAllocColorCells( Display *display, Colormap cmap, BoolDef cont, unsigned long *pmasks, unsigned int np, unsigned long *pixels, unsigned int nc); StatusDef XAllocColorPlanes( Display *display, Colormap cmap, BoolDef cont, unsigned long *pixels, int nc, int nr,int ng,int nb, unsigned long *rmask, unsigned long *gmask, unsigned long *bmask); StatusDef XAllocNamedColor(Display *display, Colormap cmap, const char *cname, XColor *cell, XColor *rgb); Colormap XCreateColormap( Display *display, Window w, Visual *visual, int alloc); StatusDef XGetStandardColormap( Display *display, Window w, XStandardColormap *cmapinf, Atom prop); StatusDef XAllocColor( Display *display, Colormap cmap, XColor *xc); int XQueryColor( Display *display, Colormap cmap, XColor *cell); int XQueryColors( Display *display, Colormap cmap, XColor *cells, int nc); int XStoreColor( Display *display, Colormap cmap, XColor *cell); int XStoreColors( Display *display, Colormap cmap, XColor *cells, int nc); char ** XGetFontPath( Display *display, int *nps); BoolDef XGetFontProperty( XFontStruct *fstruct, Atom atom, unsigned long *val); XFontStruct * XLoadQueryFont(Display *display, const char *name); XFontStruct * XQueryFont( Display *display, XID font_id); KeySym XKeycodeToKeysym( Display *display, unsigned int keycode, int index); KeyCode XKeysymToKeycode( Display *display, KeySym keysym); KeySym XStringToKeysym(const char *str); XModifierKeymap * XGetModifierMapping(Display *display); int XFreeModifiermap(XModifierKeymap *modmap); int XSetFont( Display *display, GC gc, Font font); int XSetFontPath( Display *display, char **dirs, int nd); int XTextExtents( XFontStruct *fstruct, const char *str, int nc, int *dir,int *ascent,int *descent, XCharStruct *overall); int XTextExtents16( XFontStruct *fstruct, const XChar2b *str, int nc, int *dir, int *ascent, int *descent, XCharStruct *overall); int XTextWidth( XFontStruct *fstruct, const char *str, int co); int XTextWidth16( XFontStruct *fstruct, const XChar2b *str, int co); int XGetErrorDatabaseText( Display *display, const char *name, const char *msg, const char *defstr, char *buf, int len); int XGetErrorText( Display *display, int code, char *buf, int len); XErrorHandler XSetErrorHandler(XErrorHandler handler); int XDefaultScreen(Display *display); Visual * XDefaultVisual( Display *display, int screen); int XDefaultDepth( Display *display, int screen); Colormap XDefaultColormap( Display *display, int screen); Screen * XScreenOfDisplay( Display *display, int scr); Cursor XCreateFontCursor( Display *display, unsigned int shape); int XRecolorCursor( Display *display, Cursor cursor, XColor *fg,XColor *bg); int XWarpPointer( Display *display, Window sw,Window dw, int sx,int sy, unsigned int swidth,unsigned int sheight, int dx, int dy); int XBell( Display *display, int pc); int XGetInputFocus( Display *display, Window *focus, int *revto); int XSetInputFocus( Display *display, Window focus, int revto, Time time); int XLookupString( XKeyEvent *event, char *buf, int nbytes, KeySym *keysym, XComposeStatus *status); int XRefreshKeyboardMapping(XMappingEvent *event); int XSetClassHint( Display *display, Window w, XClassHint *chints); int XSetNormalHints( Display *display, Window w, XSizeHints *hints); int XSetWMHints( Display *display, Window w, XWMHints *wmhints); StatusDef XSetWMProtocols( Display *display, Window w, Atom *prots, int co); int XStoreName(Display *display, Window w, const char *wname); StatusDef XFetchName( Display *display, Window w, char **window_name_return); int XDoesBackingStore(Screen *scr); XExtCodes * XInitExtension(Display *display, const char *name); int XFree(void *data); char * XServerVendor(Display *display); int XSetIconName(Display *display, Window w, const char *iname); int XGetIconName( Display *display, Window w, char **iname); int XSetSelectionOwner( Display* display, Atom sel, Window owner, Time time); Window XGetSelectionOwner( Display* display, Atom selection); int XConvertSelection( Display *display, Atom sel, Atom target, Atom prop, Window req, Time time); BoolDef XCheckTypedEvent( Display *display, int ev, XEvent *rep); BoolDef XCheckWindowEvent( Display *display, Window w, long emask, XEvent *ev); int XPending(Display *display); int XPutBackEvent(Display *display, XEvent *event); StatusDef XSendEvent( Display *display, Window w, BoolDef prop, long emask, XEvent *event); BoolDef XCheckTypedWindowEvent( Display* display, Window w, int event_type, XEvent* event_return); int XWindowEvent( Display *display, Window w, long emask, XEvent *rep); int XNextEvent( Display *display, XEvent *event); Atom XInternAtom( Display *display, const char *property_name, BoolDef only_if_exists); char * XGetAtomName( Display *display, Atom atom); int XChangeProperty( Display *display, Window window, Atom property, Atom type, int format, int mode, const unsigned char *data, int nelements); int XGetWindowProperty( Display *display, Window window, Atom property, long long_offset, long long_length, BoolDef delete, Atom req_type, Atom *actual_type_return, int *actual_format_return, unsigned long *nitems_return, unsigned long *bytes_after_return, unsigned char **prop_return); char ** XListExtensions( Display *display, int *ret_num); int XFreeExtensionList(char **list); int XChangeGC( Display* display, GC gc, unsigned long mask, XGCValues* gc_values); int XConnectionNumber(Display* display); int XFreeFont(Display* display,XFontStruct* font_struct); char * XSetLocaleModifiers(const char* modifier_list); XIM XOpenIM( Display* dpy, struct _XrmHashBucketRec* rdb, char* res_name, char* res_class); char * XGetIMValues(XIM im , ...); XIC XCreateIC(XIM im , ...); StatusDef XCloseIM(XIM im); BoolDef XFilterEvent(XEvent* event,Window window); char * XrmQuarkToString(void *quark); int XmbLookupString( XIC ic, XKeyPressedEvent* event, char* buffer_return, int bytes_buffer, KeySym* keysym_return, StatusDef* status_return); int XmbTextPropertyToTextList( Display *display, XTextProperty *text_prop, char ***list_return, int *count_return); void XFreeStringList(char **list); int XmbTextListToTextProperty( Display *display, char **list, int count, XICCEncodingStyle style, XTextProperty *text_prop_return); void XSetICFocus(XIC ic); void XUnsetICFocus(XIC ic); BoolDef XQueryPointer( Display* display, Window w, Window* root_return, Window* child_return, int* root_x_return, int* root_y_return, int* win_x_return, int* win_y_return, unsigned int* mask_return); int XParseGeometry( const char* string, int* x, int* y, unsigned int* width, unsigned int* height); int XResizeWindow( Display* display, Window w, unsigned int width, unsigned int height); void XSetWMNormalHints(Display* display,Window w,XSizeHints* hints); void XSetWMProperties( Display* display, Window w, XTextProperty* window_name, XTextProperty* icon_name, char** argv, int argc, XSizeHints* normal_hints, XWMHints* wm_hints, XClassHint* class_hints); int XDefineCursor(Display* display,Window w,Cursor cursor); int XMoveResizeWindow( Display* display, Window w, int x, int y, unsigned int width, unsigned int height); int XMoveWindow( Display* display, Window w, int x, int y); StatusDef XParseColor( Display *display, Colormap map, const char* spec, XColor *colorPtr); int XFreeColors(Display *display, Colormap cmap, unsigned long pixels[], int npixels, unsigned long planes); int XGrabServer(Display *display); int XUngrabServer(Display *display); #endif rxvt-2.7.10/W11/X11/Xatom.h010064400001440000024000000047260757331033000134330ustar gcwstaff#ifndef XATOM_H #define XATOM_H 1 /* THIS IS A GENERATED FILE * * Do not change! Changing this file implies a protocol change! */ #define XA_PRIMARY ((Atom) 1) #define XA_SECONDARY ((Atom) 2) #define XA_ARC ((Atom) 3) #define XA_ATOM ((Atom) 4) #define XA_BITMAP ((Atom) 5) #define XA_CARDINAL ((Atom) 6) #define XA_COLORMAP ((Atom) 7) #define XA_CURSOR ((Atom) 8) #define XA_CUT_BUFFER0 ((Atom) 9) #define XA_CUT_BUFFER1 ((Atom) 10) #define XA_CUT_BUFFER2 ((Atom) 11) #define XA_CUT_BUFFER3 ((Atom) 12) #define XA_CUT_BUFFER4 ((Atom) 13) #define XA_CUT_BUFFER5 ((Atom) 14) #define XA_CUT_BUFFER6 ((Atom) 15) #define XA_CUT_BUFFER7 ((Atom) 16) #define XA_DRAWABLE ((Atom) 17) #define XA_FONT ((Atom) 18) #define XA_INTEGER ((Atom) 19) #define XA_PIXMAP ((Atom) 20) #define XA_POINT ((Atom) 21) #define XA_RECTANGLE ((Atom) 22) #define XA_RESOURCE_MANAGER ((Atom) 23) #define XA_RGB_COLOR_MAP ((Atom) 24) #define XA_RGB_BEST_MAP ((Atom) 25) #define XA_RGB_BLUE_MAP ((Atom) 26) #define XA_RGB_DEFAULT_MAP ((Atom) 27) #define XA_RGB_GRAY_MAP ((Atom) 28) #define XA_RGB_GREEN_MAP ((Atom) 29) #define XA_RGB_RED_MAP ((Atom) 30) #define XA_STRING ((Atom) 31) #define XA_VISUALID ((Atom) 32) #define XA_WINDOW ((Atom) 33) #define XA_WM_COMMAND ((Atom) 34) #define XA_WM_HINTS ((Atom) 35) #define XA_WM_CLIENT_MACHINE ((Atom) 36) #define XA_WM_ICON_NAME ((Atom) 37) #define XA_WM_ICON_SIZE ((Atom) 38) #define XA_WM_NAME ((Atom) 39) #define XA_WM_NORMAL_HINTS ((Atom) 40) #define XA_WM_SIZE_HINTS ((Atom) 41) #define XA_WM_ZOOM_HINTS ((Atom) 42) #define XA_MIN_SPACE ((Atom) 43) #define XA_NORM_SPACE ((Atom) 44) #define XA_MAX_SPACE ((Atom) 45) #define XA_END_SPACE ((Atom) 46) #define XA_SUPERSCRIPT_X ((Atom) 47) #define XA_SUPERSCRIPT_Y ((Atom) 48) #define XA_SUBSCRIPT_X ((Atom) 49) #define XA_SUBSCRIPT_Y ((Atom) 50) #define XA_UNDERLINE_POSITION ((Atom) 51) #define XA_UNDERLINE_THICKNESS ((Atom) 52) #define XA_STRIKEOUT_ASCENT ((Atom) 53) #define XA_STRIKEOUT_DESCENT ((Atom) 54) #define XA_ITALIC_ANGLE ((Atom) 55) #define XA_X_HEIGHT ((Atom) 56) #define XA_QUAD_WIDTH ((Atom) 57) #define XA_WEIGHT ((Atom) 58) #define XA_POINT_SIZE ((Atom) 59) #define XA_RESOLUTION ((Atom) 60) #define XA_COPYRIGHT ((Atom) 61) #define XA_NOTICE ((Atom) 62) #define XA_FONT_NAME ((Atom) 63) #define XA_FAMILY_NAME ((Atom) 64) #define XA_FULL_NAME ((Atom) 65) #define XA_CAP_HEIGHT ((Atom) 66) #define XA_WM_CLASS ((Atom) 67) #define XA_WM_TRANSIENT_FOR ((Atom) 68) #define XA_LAST_PREDEFINED ((Atom) 68) #endif /* XATOM_H */ rxvt-2.7.10/W11/X11/keysymdef.h010064400001440000024000000050100757331033000143260ustar gcwstaff #define XK_Meta_L 0xFFE7 /* Left meta */ #define XK_Meta_R 0xFFE8 /* Right meta */ #define XK_Alt_R 0xFFEA /* Right alt */ #define XK_Super_L 0xFFEB /* Left super */ #define XK_Super_R 0xFFEC /* Right super */ #define XK_Hyper_L 0xFFED /* Left hyper */ #define XK_Hyper_R 0xFFEE /* Right hyper */ #define XK_KP_Space 0xFF80 /* space */ #define XK_KP_Tab 0xFF89 #define XK_KP_Enter 0xFF8D /* enter */ #define XK_KP_F1 0xFF91 /* PF1, KP_A, ... */ #define XK_KP_F2 0xFF92 #define XK_KP_F3 0xFF93 #define XK_KP_F4 0xFF94 #define XK_KP_Home 0xFF95 #define XK_KP_Left 0xFF96 #define XK_KP_Up 0xFF97 #define XK_KP_Right 0xFF98 #define XK_KP_Down 0xFF99 #define XK_KP_Prior 0xFF9A #define XK_KP_Page_Up 0xFF9A #define XK_KP_Next 0xFF9B #define XK_KP_Page_Down 0xFF9B #define XK_KP_End 0xFF9C #define XK_KP_Begin 0xFF9D #define XK_KP_Insert 0xFF9E #define XK_KP_Delete 0xFF9F #define XK_KP_Equal 0xFFBD /* equals */ #define XK_KP_Multiply 0xFFAA #define XK_KP_Add 0xFFAB #define XK_KP_Separator 0xFFAC /* separator, often comma */ #define XK_KP_Subtract 0xFFAD #define XK_KP_Decimal 0xFFAE #define XK_KP_Divide 0xFFAF #define XK_minus 0x02d #define XK_KP_0 0xFFB0 #define XK_KP_1 0xFFB1 #define XK_KP_2 0xFFB2 #define XK_KP_3 0xFFB3 #define XK_KP_4 0xFFB4 #define XK_KP_5 0xFFB5 #define XK_KP_6 0xFFB6 #define XK_KP_7 0xFFB7 #define XK_KP_8 0xFFB8 #define XK_KP_9 0xFFB9 #define XK_L1 0xFFC8 #define XK_L2 0xFFC9 #define XK_F13 0xFFCA #define XK_L3 0xFFCA #define XK_F14 0xFFCB #define XK_L4 0xFFCB #define XK_F15 0xFFCC #define XK_L5 0xFFCC #define XK_F16 0xFFCD #define XK_L6 0xFFCD #define XK_F17 0xFFCE #define XK_L7 0xFFCE #define XK_F18 0xFFCF #define XK_L8 0xFFCF #define XK_F19 0xFFD0 #define XK_L9 0xFFD0 #define XK_F20 0xFFD1 #define XK_L10 0xFFD1 #define XK_F21 0xFFD2 #define XK_R1 0xFFD2 #define XK_F22 0xFFD3 #define XK_R2 0xFFD3 #define XK_F23 0xFFD4 #define XK_R3 0xFFD4 #define XK_F24 0xFFD5 #define XK_R4 0xFFD5 #define XK_F25 0xFFD6 #define XK_R5 0xFFD6 #define XK_F26 0xFFD7 #define XK_R6 0xFFD7 #define XK_F27 0xFFD8 #define XK_R7 0xFFD8 #define XK_F28 0xFFD9 #define XK_R8 0xFFD9 #define XK_F29 0xFFDA #define XK_R9 0xFFDA #define XK_F30 0xFFDB #define XK_R10 0xFFDB #define XK_F31 0xFFDC #define XK_R11 0xFFDC #define XK_F32 0xFFDD #define XK_R12 0xFFDD #define XK_F33 0xFFDE #define XK_R13 0xFFDE #define XK_F34 0xFFDF #define XK_R14 0xFFDF #define XK_F35 0xFFE0 #define XK_R15 0xFFE0 rxvt-2.7.10/W11/w32004075500001440000024000000000000764024424100121515ustar gcwstaffrxvt-2.7.10/W11/w32/xlib.c010075500001440000024000003460610760200341000133310ustar gcwstaff/*****************************************************************\ Library of X window functions which call Windows 32 equivalent functions. Some data structures are maintained by this code, simulating the operation of an X server and window manager. Aug/Sep-92 xyz $$1 Created. Oct-92 abc $$2 Added color stuff. \******************************************************************/ #ifndef __XNT #define __XNT #include #include #include #include #include #include #include "ntdef.h" /* Local Data */ static void NT_set_GC_pen(); static void NT_set_GC_brush(); static HPEN NT_get_GC_pen(); static HBRUSH NT_get_GC_brush(); static HBRUSH NT_get_GC_bgbrush(); void NT_set_rop(); double NT_deg64_to_rad(int a); /*----------------------------------------------------------------*\ | FUNCTIONS TO MAINTAIN AN INTERNAL LIST OF WINDOWS AND THEIR | | ATTRIBUTES - AS WOULD BE MAINTAINED IN THE X SERVER. | \*----------------------------------------------------------------*/ /* Structure to hold pen and brush info in GC ext_data field */ typedef struct NTGC_ { HPEN pen; HBRUSH brush; HBRUSH bgbrush; } NTGC; HDC cjh_get_dc(NT_window *window) { /* pixmaps have to do SelectObject() on their dc's */ if (window->hDC == INVALID_HANDLE) if (window->w == INVALID_HANDLE) { window->hDC= CreateDC("DISPLAY", NULL, NULL, NULL); } else window->hDC=GetDC(window->w); return window->hDC; } int cjh_rel_dc(NT_window *window,HDC dc) { return TRUE; /* return ReleaseDC(window, dc); */ } HDC drawableGetDC(Drawable drawable) { cjh_get_dc((NT_window *)drawable); } int drawableRelDC(Drawable drawable, HDC hDC) { cjh_rel_dc((NT_window *)drawable, hDC); } /*****************************************************************\ Function: XOpenDisplay Inputs: Display name Comments: Fills out a Display structure and a Visual and Screen. Hopefully all the X macros should work with this structure. Note that the default visual is for a True colour screen (24bits). \*****************************************************************/ Display * XOpenDisplay (name) const char *name; { static char vstring[]="NT Xlibemu", *vs,*dn; Display *d = NULL; Screen *scrd; static Depth dlist[1]; static Visual vlist[1]; Colormap cmap; RECT rect; int depth; HDC rootDC = CreateDC("DISPLAY",NULL,NULL,NULL); depth = GetDeviceCaps(rootDC, BITSPIXEL); xtrace("XOpenDisplay\n"); initQ(); dlist[0].depth=depth; dlist[0].nvisuals=1; dlist[0].visuals=vlist; vlist[0].ext_data=NULL; vlist[0].visualid=0; vlist[0].class=PseudoColor; vlist[0].bits_per_rgb=8; vlist[0].map_entries=256; vlist[0].red_mask=255; vlist[0].green_mask=255<<8; vlist[0].blue_mask=255<<16; scrd=(Screen *) allocateMemory (sizeof (Screen)); (NT_window*)(scrd->root)= NT_new_window(); ((NT_window*)(scrd->root))->w=GetDesktopWindow(); ((NT_window*)(scrd->root))->parent=0; GetWindowRect(GetDesktopWindow(),&rect); scrd->width=rect.right-rect.left; scrd->height=rect.bottom-rect.top; scrd->mwidth=260; scrd->mheight=190; scrd->ndepths=1; scrd->depths=dlist; scrd->root_depth=depth; scrd->root_visual=vlist; scrd->default_gc=NULL; scrd->cmap=cmap; scrd->white_pixel=0xffffff; scrd->black_pixel=0; d=(Display *) allocateMemory (sizeof (Display)); scrd->display=d; vs=(char *) allocateMemory (sizeof (char)*strlen (vstring)+1); dn=(char *) allocateMemory (sizeof (char)*strlen (name)+1); strcpy (vs,vstring); strcpy (dn,name); d->ext_data=NULL; d->fd=0; d->proto_major_version=11; d->proto_minor_version=4; d->vendor=vs; d->release=4; d->display_name=dn; d->nscreens=1; d->screens=scrd; d->max_keycode=255; return (d); } int XCloseDisplay(Display *display) { NT_window *wanderer; xtrace("XCloseDisplay\n"); /* Do something ? */ /* Must GlobalDelete all atoms/properties leftover */ return 0; } char * XDisplayString(Display *display) { return (display->display_name); } int XFlush(Display *display) { xtrace("XFlush\n"); return 0; } int XSync(display,discard) Display *display; int discard; { /* Do nothing here either */ return 0; } /*****************************************************************\ Function: XGetVisualInfo Inputs: display, info mask, template, number of matches. Returned: List of XVisualInfo structures, one for each matching Visual. Comments: Behaves like X routine, but there is only ever one Visual, so the returned list is never longer than one. \*****************************************************************/ XVisualInfo * XGetVisualInfo(display,vinm,vint,n) Display *display; long vinm; XVisualInfo *vint; int *n; { static XVisualInfo xvi; int status=1; xtrace("XGetVisualInfo\n"); if ((vinm&VisualIDMask|vinm==VisualAllMask)&& vint->visualid!=display->screens->root_visual->visualid) status=0; if ((vinm&VisualScreenMask|vinm==VisualAllMask)&& vint->screen!=0) status=0; if ((vinm&VisualDepthMask|vinm==VisualAllMask)&& vint->depth!=24) status=0; if ((vinm&VisualClassMask|vinm==VisualAllMask)&& vint->class!=display->screens->root_visual->class) status=0; if ((vinm&VisualRedMaskMask|vinm==VisualAllMask)&& vint->red_mask!=display->screens->root_visual->red_mask) status=0; if ((vinm&VisualGreenMaskMask|vinm==VisualAllMask)&& vint->green_mask!=display->screens->root_visual->green_mask) status=0; if ((vinm&VisualBlueMaskMask|vinm==VisualAllMask)&& vint->blue_mask!=display->screens->root_visual->blue_mask) status=0; if ((vinm&VisualColormapSizeMask|vinm==VisualAllMask)&& vint->colormap_size!=display->screens->root_visual->map_entries) status=0; if ((vinm&VisualBitsPerRGBMask|vinm==VisualAllMask)&& vint->bits_per_rgb!=display->screens->root_visual->bits_per_rgb) status=0; if (status==1) { xvi.visualid=display->screens->root_visual->visualid; xvi.screen=0; xvi.depth=display->screens->root_visual->bits_per_rgb; xvi.class=display->screens->root_visual->class; xvi.red_mask=display->screens->root_visual->red_mask; xvi.green_mask=display->screens->root_visual->green_mask; xvi.blue_mask=display->screens->root_visual->blue_mask; xvi.colormap_size=display->screens->root_visual->map_entries; xvi.bits_per_rgb=display->screens->root_visual->bits_per_rgb; xvi.visual=display->screens->root_visual; *n=1; return (&xvi); } *n=0; return (&xvi); } StatusDef XMatchVisualInfo( Display* display, int screen, int depth, int class, XVisualInfo* vinfo_return) { int status=0; xtrace("XMatchVisualInfo\n"); return status; } /*****************************************************************\ Function: XClearWindow Inputs: display, window Comments: As mentioned, the Window structure is not the one windows recognises. The background colour for the window is stored in this structure. The sequence of GetDC, CreateBrush/Pen, SelectObject, , DeleteObject, ReleaseDC occurs in all the drawing functions. \*****************************************************************/ int XClearWindow(display, w) Display *display; Window w; { RECT rRect; HBRUSH hbrush; HDC hDC; HANDLE oldObj; int oldROP; NT_window *window = (NT_window *)w; xtrace("XClearWindow\n"); if (VALID_WINDOW(window)) { rRect.left= rRect.right=rRect.bottom=rRect.top =0; hDC = cjh_get_dc(window); oldROP = SetROP2(hDC,R2_COPYPEN); hbrush = window->bg; oldObj = SelectObject(hDC, hbrush); GetClientRect(window->w, &rRect); FillRect(hDC, &rRect, hbrush); SelectObject(hDC, oldObj); // DeleteObject(hbrush); SetROP2(hDC,oldROP); cjh_rel_dc(window,hDC); } return 0; } /*****************************************************************\ Function: XCreateSimpleWindow Inputs: display, parent window, geometry, border width, border colour, background colour. Returned: Window ID Comments: The first time a window is made by the application, it has to be registered. To simulate the action of a window manager, the toplevel client window is reparented and a frame window is created. A MapNotify event is sent to the new client. Note that child windows are created in the manner of the default X behaviour, ie. each is clipped individually. NOTE: This routine has now changed. As part of our role as Window manager, we now defer creation of the windows until they are mapped. The fact that a window has been created and not mapped is flagged to other routines by setting the w element of the structure to -1. WE STILL CREATE THE Window STRUCTURES. (SEE XMapWindow) \*****************************************************************/ Window XCreateSimpleWindow(display, parent,x, y, w, h, brd, brd_col, bg) Display *display; Window parent; int x, y; unsigned int brd,w,h; unsigned long bg, brd_col; { NT_window *canvas; xtrace("XCreateSimpleWindow\n"); canvas = NT_new_window(); canvas->x = x; canvas->y = y; canvas->wdth = w; canvas->hght = h; NT_add_child((NT_window *)parent,canvas); canvas->bg=CreateSolidBrush (CNUMTORGB(bg)); canvas->parent=(NT_window *)parent; canvas->title_text = NULL; if (canvas->parent->w == GetDesktopWindow()) { if (x==0 && y==0) { canvas->x = -1; canvas->y = -1; } canvas->top_flag = TRUE; } else canvas->top_flag = 0; return ((Window)canvas); } /*****************************************************************\ Function: XCreateWindow Inputs: display, parent window, geometry, border width, depth, class, visual, attributes mask, attributes structure Returned: Window ID Comments: Simply calls XCreateSimpleWindow. Some of the arguments are ignored :-). \*****************************************************************/ Window XCreateWindow(display,parent,x,y,width,height,bw,depth,class,visual, valuemask,attr) Display *display; Window parent; int x,y; unsigned int width,height,bw; int depth; unsigned int class; Visual *visual; unsigned long valuemask; XSetWindowAttributes *attr; { xtrace("XCreateWindow\n"); return (XCreateSimpleWindow(display,parent,x,y,width,height,bw, attr->border_pixel,attr->background_pixel)); } /*****************************************************************\ Function: XDestroyWindow Inputs: Display, window to be destroyed. Comments: Removes a window from the server. \*****************************************************************/ int XDestroyWindow(display,w) Display *display; Window w; { NT_window *ntw = (NT_window *)w; xtrace("XDestroyWindow\n"); if (ntw->hDC != INVALID_HANDLE) { ReleaseDC(ntw->w,ntw->hDC); ntw->hDC = INVALID_HANDLE; } /*DestroyWindow(w->w);*/ NT_delete_window(ntw); /* Remove window from data structure */ return 0; } /*****************************************************************\ Function: XGetGeometry Inputs: display, window Returned: root window, screen depth, geometry, border width Comments: fetches information from the windows kernel and our display structure. \*****************************************************************/ StatusDef XGetGeometry(display,w,root,x,y,width,height,bw,depth) Display *display; Drawable w; Window *root; int *x,*y; unsigned int *width,*height; unsigned int *bw,*depth; { NT_window *ntw = (NT_window *)w; RECT r; xtrace("XGetGeometry\n"); *root=display->screens[0].root; *depth=24; GetWindowRect(ntw->w,&r); *x=r.left; *y=r.top; GetClientRect(ntw->w,&r); *width=r.right-r.left; if (*widthminx) *width=ntw->minx; *height=r.bottom-r.top; if (*heightminy) *height=ntw->miny; *bw=(*width-(r.right-r.left))/2; return 0; } /*****************************************************************\ Function: XGetWindowAttributes Inputs: display, window, attributes Returned: 1 = ok. Comments: Fills out attributes structure. \*****************************************************************/ StatusDef XGetWindowAttributes(display,w,wattr) Display *display; Window w; XWindowAttributes *wattr; { xtrace("XGetWindowAttributes\n"); XGetGeometry(display,w,&wattr->root,&wattr->x,&wattr->y,&wattr->width, &wattr->height,&wattr->border_width,&wattr->depth); wattr->class=InputOutput; wattr->bit_gravity=StaticGravity; wattr->win_gravity=CenterGravity; wattr->backing_store=NotUseful; wattr->backing_planes=0; wattr->backing_pixel=0; wattr->save_under=0; wattr->colormap=None; wattr->map_installed=TRUE; wattr->map_state=IsViewable; wattr->override_redirect=FALSE; wattr->screen=display->screens; return (1); } int XSelectInput(display, window, mask) Display *display; Window window; long mask; { NT_window *ntw = (NT_window *)window; xtrace("XSelectInput\n"); ntw->mask=mask; return 0; } void NT_dispError(char *msg) { LPVOID lpMsgBuf=NULL; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); MessageBox( NULL, lpMsgBuf, msg, MB_OK|MB_ICONINFORMATION ); LocalFree( lpMsgBuf ); } /*****************************************************************\ Function: XMapWindow Inputs: display, window to be mapped Comments: If the specified window is not already mapped, this routine calls the Windows function which displays it. Again, frames have to be mapped as well as clients. \*****************************************************************/ int XMapWindow(display, window) Display *display; Window window; { NT_window *ntw = (NT_window *)window; RECT rect; unsigned char *hints; Atom property; Atom ret_type; int ret_format; DWORD frame_style; long ret_nitems; long ret_after; HDC hDC; char *title = ""; xtrace("XMapWindow\n"); if (ntw->w == INVALID_HANDLE) { frame_style = WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS; if (ntw->top_flag) { /* frame_style = WS_CLIPCHILDREN; frame_style |= WS_BORDER; frame_style |= WS_THICKFRAME; frame_style |= WS_CAPTION; frame_style |= WS_POPUP; frame_style |= WS_SYSMENU; frame_style |= WS_MINIMIZEBOX; frame_style |= WS_MAXIMIZEBOX; */ frame_style = WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN; ntw->hght += GetSystemMetrics(SM_CYSIZE)+(GetSystemMetrics(SM_CYBORDER)+GetSystemMetrics(SM_CYFRAME))*2; ntw->wdth += (GetSystemMetrics(SM_CXBORDER) + GetSystemMetrics(SM_CXFRAME))*2; title = ntw->title_text; if (ntw->x == -1 && ntw->y == -1) { ntw->x = CW_USEDEFAULT; ntw->y = CW_USEDEFAULT; } } else if (ntw->x == -1 && ntw->y == -1) { GetClientRect(ntw->parent->w,&rect); ntw->x = rect.left; ntw->y = rect.top; ntw->wdth = rect.right-rect.left; ntw->hght = rect.bottom - rect.top; } ntw->hDC = INVALID_HANDLE; if (ntw->parent->w == INVALID_HANDLE) { XMapWindow(display, (Window)ntw->parent); } ntw->w = NT_create_window(title,frame_style, ntw->x,ntw->y,ntw->wdth,ntw->hght, ntw->parent->w); if (ntw->w==NULL) NT_dispError("create window1"); hDC = cjh_get_dc(ntw); PostMessage(ntw->w,USR_MapNotify,0,0); } if (IsWindowVisible(ntw->w)==0) { ShowWindow(ntw->w, SW_SHOW); PostMessage(ntw->w,USR_MapNotify,0,0); } UpdateWindow(ntw->w); return 0; } int XIconifyWindow(Display *display, Window w, int screen_number) { xtrace("XIconifyWindow\n"); return 0; } /*****************************************************************\ Function: XCreateGC Inputs: display, window, mask of setup values, setup values. Returned: GC pointer. Comments: Fills out a GC structure with the X defaults unless the caller specifies otherwise. \*****************************************************************/ GC XCreateGC(display, window, mask, gc_values) Display *display; Drawable window; unsigned long mask; XGCValues *gc_values; { GC local_gc; int size; char *ptr; xtrace("XCreateGC\n"); size = sizeof(GC); ptr = (char *)allocateMemory((size_t)1000); local_gc = (GC)ptr; local_gc->ext_data = NULL; local_gc->gid=(GContext) window; local_gc->rects=FALSE; local_gc->dashes=FALSE; if (mask&GCArcMode) local_gc->values.arc_mode=gc_values->arc_mode; else local_gc->values.arc_mode=ArcPieSlice; if (mask&GCBackground) local_gc->values.background=gc_values->background; else local_gc->values.background=display->screens->white_pixel; if (mask&GCCapStyle) local_gc->values.cap_style=gc_values->cap_style; else local_gc->values.cap_style=CapButt; if (mask&GCClipMask) local_gc->values.clip_mask=gc_values->clip_mask; else local_gc->values.clip_mask=None; if (mask&GCClipXOrigin) local_gc->values.clip_x_origin=gc_values->clip_x_origin; else local_gc->values.clip_x_origin=0; if (mask&GCClipYOrigin) local_gc->values.clip_y_origin=gc_values->clip_y_origin; else local_gc->values.clip_y_origin=0; if (mask&GCDashList) local_gc->values.dashes=gc_values->dashes; else local_gc->values.dashes=4; if (mask&GCDashOffset) local_gc->values.dash_offset=gc_values->dash_offset; else local_gc->values.dash_offset=0; if (mask&GCFillRule) local_gc->values.fill_rule=gc_values->fill_rule; else local_gc->values.fill_rule=EvenOddRule; if (mask&GCFillStyle) local_gc->values.fill_style=gc_values->fill_style; else local_gc->values.fill_style=FillSolid; if (mask&GCFont) local_gc->values.font=gc_values->font; else local_gc->values.font= 999;/*"fixed";*/ if (mask&GCForeground) local_gc->values.foreground=gc_values->foreground; else local_gc->values.foreground=display->screens->black_pixel; if (mask&GCFunction) local_gc->values.function=gc_values->function; else local_gc->values.function=GXcopy; if (mask&GCGraphicsExposures) local_gc->values.graphics_exposures=gc_values->graphics_exposures; else local_gc->values.graphics_exposures=True; if (mask&GCJoinStyle) local_gc->values.join_style=gc_values->join_style; else local_gc->values.join_style=JoinMiter; if (mask&GCLineStyle) local_gc->values.line_style=gc_values->line_style; else local_gc->values.line_style=LineSolid; if (mask&GCLineWidth) local_gc->values.line_width=gc_values->line_width; else local_gc->values.line_width=0; if (mask&GCPlaneMask) local_gc->values.plane_mask=gc_values->plane_mask; else local_gc->values.plane_mask=255; if (mask&GCStipple) local_gc->values.stipple=gc_values->stipple; else local_gc->values.stipple=0; if (mask&GCSubwindowMode) local_gc->values.subwindow_mode=gc_values->subwindow_mode; else local_gc->values.subwindow_mode=ClipByChildren; if (mask&GCTile) local_gc->values.tile=gc_values->tile; else local_gc->values.tile=0; if (mask&GCTileStipXOrigin) local_gc->values.ts_x_origin=gc_values->ts_x_origin; else local_gc->values.ts_x_origin=0; if (mask&GCTileStipYOrigin) local_gc->values.ts_y_origin=gc_values->ts_y_origin; else local_gc->values.ts_y_origin=0; local_gc->dirty = ~0; return (local_gc); } int XFreeGC(display, gc) Display *display; GC gc; { freeMemory(gc); } /*****************************************************************\ Function: XSetForeground Inputs: display, gc, colour. Comments: Colour is an RGB triple (24bits). \*****************************************************************/ int XSetForeground(display, gc, color) Display *display; GC gc; unsigned long color; { xtrace("XSetForegrond\n"); gc->values.foreground=color; gc->dirty |= GCForeground; return 0; } /*****************************************************************\ Function: XDrawString Inputs: display, window, gc, position, string, length of string. Comments: Writes text to the screen in the manner of X windows. Note that the y origin is on the text baseline, ie. the lowest part of a letter o rests on the baseline and descenders fall below it. The text is transparent. \*****************************************************************/ int XDrawString(Display *display, Drawable window, GC gc, int x, int y, const char* str, int len) { HDC hDC; TEXTMETRIC tmet; HFONT old; xtrace("XDrawString\n"); if (VALID_WINDOW(window)) { hDC = drawableGetDC(window); SetBkMode(hDC,TRANSPARENT); SetTextColor(hDC,CNUMTORGB(gc->values.foreground)); old=SelectObject(hDC,(HFONT)gc->values.font); GetTextMetrics(hDC,&tmet); TextOut(hDC,x,y-tmet.tmAscent,str,len); SelectObject(hDC,old); drawableRelDC(window,hDC); } return 0; } int XDrawString16(Display *display, Drawable window, GC gc, int x, int y, const XChar2b* str, int len) { xtrace("XDrawString16\n"); XDrawString(display, window, gc, x, y, (const char*)str, len*2); return 0; } XDrawImageString( Display* display, Drawable d, GC gc, int x, int y, const char* string, int length) { HDC hDC = NULL; TEXTMETRIC tmet; HFONT old; xtrace("XDrawImageString\n"); if (VALID_WINDOW(d)) { hDC = drawableGetDC(d); SetBkMode(hDC,TRANSPARENT); SetBkColor(hDC, CNUMTORGB(gc->values.background)); SetTextColor(hDC,CNUMTORGB(gc->values.foreground)); old=SelectObject(hDC,(HFONT)gc->values.font); if (GetTextMetrics(hDC,&tmet) && length>0) { RECT fill; fill.top = y-tmet.tmAscent; fill.bottom = y+tmet.tmDescent; fill.left = x; fill.right = x + (tmet.tmAveCharWidth * length); FillRect( hDC, &fill, NT_get_GC_bgbrush(hDC,gc)); } TextOut( hDC, x, y-tmet.tmAscent, string, length ); SelectObject(hDC,old); drawableRelDC(d,hDC); } return 0; } int XDrawImageString16(Display *display, Drawable window, GC gc, int x, int y, const XChar2b* str, int len) { xtrace("XDrawImageString16\n"); XDrawImageString(display, window, gc, x, y, (const char*)str, len*2); return 0; } /*****************************************************************\ Function: XFillRectangle Inputs: display, window, gc, geometry. Comments: fills rectangles in uniform colours. No tiles/Pixmaps are implemented yet. \*****************************************************************/ int XFillRectangle (display,window,gc,x,y,w,h) Display *display; Drawable window; GC gc; int x,y; unsigned int w,h; { RECT rct; HBRUSH hbrush; HDC hDC; HANDLE oldObj; int ret; xtrace("XFillRectangle\n"); if (VALID_WINDOW(window)) { hDC = drawableGetDC(window); NT_set_rop(hDC,gc); hbrush = NT_get_GC_brush(hDC,gc); oldObj = SelectObject(hDC, hbrush); rct.left=(LONG) x; rct.right=(LONG) (x+w); rct.top=(LONG) y; rct.bottom=(LONG) (y+h); ret=FillRect(hDC, &rct, hbrush); SelectObject(hDC, oldObj); drawableRelDC(window,hDC); } return (ret); } /*****************************************************************\ Function: XClearArea Inputs: display, geometry, exposure events allowed. Comments: Straightforward. \*****************************************************************/ int XClearArea(display,w,x,y,width,height,exposures) Display *display; Window w; int x,y; unsigned int width,height; BoolDef exposures; { NT_window *ntw = (NT_window *)w; RECT rct; HBRUSH hbrush; HDC hDC; HANDLE oldObj; int oldROP; xtrace("XClearArea\n"); if (VALID_WINDOW(ntw)) { hDC = cjh_get_dc(ntw); oldROP = SetROP2(hDC,R2_COPYPEN); hbrush=ntw->bg; oldObj = SelectObject(hDC,hbrush); GetClientRect(ntw->w,&rct); if ((width != 0) && (height != 0)) { rct.left=(LONG)x; rct.right=(LONG)(x+width); rct.top=(LONG)y; rct.bottom=(LONG)(y+height); FillRect(hDC,&rct,hbrush); } SelectObject(hDC, oldObj); // DeleteObject(hbrush); SetROP2(hDC,oldROP); cjh_rel_dc(ntw,hDC); } return 0; } Region XCreateRegion() { HRGN hrgn; xtrace("XCreateRegion\n"); hrgn=CreateRectRgn(0,0,1,1); return ((Region)hrgn); } /* Untested. The Region stuff needs thinking about. */ int XClipBox(hrgn,rect) Region hrgn; XRectangle *rect; { RECT rct; xtrace("XClipBox\n"); GetRgnBox((HRGN)hrgn,&rct); rect->x=(short)rct.left; rect->y=(short)rct.top; rect->width=(unsigned short)(rct.right-rct.left); rect->height=(unsigned short)(rct.bottom-rct.top); return TRUE;/*(rect);*/ } int XSetRegion(display,gc,hrgn) Display *display; GC gc; Region hrgn; { /* What to do here ? */ xtrace("XSetRegion\n"); return 0; } int XDestroyRegion(hrgn) Region hrgn; { xtrace("XDestroyRegion\n"); DeleteObject(hrgn); return 0; } int XUnionRectWithRegion(rect,hrgnsrc,hrgndest) XRectangle *rect; Region hrgnsrc,hrgndest; { HRGN temp; xtrace("XUnionRectWithRegion\n"); temp=CreateRectRgn(rect->x,rect->y,rect->x+rect->width, rect->y+rect->height); CombineRgn((HRGN)hrgndest,(HRGN)hrgnsrc,temp,RGN_OR); return 0; } /*****************************************************************\ Function: XDrawArc Inputs: display, window, gc, bounding box geometry, arc angles. Comments: Works fine. \*****************************************************************/ int XDrawArc(display,w,gc,x,y,width,height,a1,a2) Display *display; Drawable w; GC gc; int x,y; unsigned int width,height; int a1,a2; { HDC hDC; HPEN hpen; int tmp; double NT_deg64_to_rad(); HANDLE oldObj; xtrace("XDrawArc\n"); if (a2>=0) a2+=a1; else { tmp=a1; a1-=a2; a2=tmp; } if (VALID_WINDOW(w)) { hDC = drawableGetDC(w); hpen = NT_get_GC_pen(hDC,gc); oldObj = SelectObject(hDC,hpen); Arc(hDC,x,y,x+width-1,y+height-1, (int) (x+width/2+width*cos(NT_deg64_to_rad(a1))), (int) (y+height/2-height*sin(NT_deg64_to_rad(a1))), (int) (x+width/2+width*cos(NT_deg64_to_rad(a2))), (int) (y+height/2-height*sin(NT_deg64_to_rad(a2)))); SelectObject(hDC, oldObj); drawableRelDC(w,hDC); } return 0; } /*****************************************************************\ Function: XFillArc Inputs: display, window, gc, geometry as above. Comments: Not tested at all, but should work. \*****************************************************************/ int XFillArc(display,w,gc,x,y,width,height,a1,a2) Display *display; Drawable w; GC gc; int x,y; unsigned int width,height; int a1,a2; { HDC hDC; HBRUSH hbrush; int tmp; HANDLE oldObj; xtrace("XFillArc\n"); if (a2>=0) a2+=a1; else { tmp=a1; a1-=a2; a2=tmp; } if (VALID_WINDOW(w)) { hDC = drawableGetDC(w); hbrush = NT_get_GC_brush(hDC,gc); oldObj = SelectObject(hDC,hbrush); if (gc->values.arc_mode==ArcChord) { Chord(hDC,x,y,x+width,y+height, (int) (x+width/2+width*cos(NT_deg64_to_rad(a1))), (int) (y+height/2+height*sin(NT_deg64_to_rad(a1))), (int) (x+width/2+width*cos(NT_deg64_to_rad(a2))), (int) (y+height/2+height*sin(NT_deg64_to_rad(a2)))); } else { Pie(hDC,x,y,x+width,y+height, (int) (x+width/2+width*cos(NT_deg64_to_rad(a1))), (int) (y+height/2+height*sin(NT_deg64_to_rad(a1))), (int) (x+width/2+width*cos(NT_deg64_to_rad(a2))), (int) (y+height/2+height*sin(NT_deg64_to_rad(a2)))); } SelectObject(hDC, oldObj); drawableRelDC(w,hDC); } return 0; } /*****************************************************************\ Function: XFillPolygon Inputs: display, window, gc, points list, number of points, shape hint, relative drawing mode. Comments: Works for convex polygons. Untested on otherwise. Optimisation hints are unused, as is the mode. \*****************************************************************/ int XFillPolygon(display,w,gc,points,nps,shape,mode) Display *display; Drawable w; GC gc; XPoint *points; int nps,shape,mode; { HBRUSH hbrush; int n; POINT ntps[1000]; HDC hDC; HANDLE oldObj; xtrace("XFillPolygon\n"); /*ntps=allocateMemory(sizeof(POINT)*nps);*/ if (VALID_WINDOW(w)) { hDC = drawableGetDC(w); hbrush = NT_get_GC_brush(hDC,gc); oldObj = SelectObject(hDC,hbrush); for (n=0;nx=(LONG)points->x; (ntps+n)->y=(LONG)(points++)->y; } Polygon(hDC,ntps,nps); SelectObject(hDC, oldObj); drawableRelDC(w,hDC); } /*free(ntps);*/ return 0; } /*****************************************************************\ Function: XDrawLine Inputs: display, window, geometry. Comments: Seems to work ok. \*****************************************************************/ int XDrawLine(display,w,gc,x1,y1,x2,y2) Display *display; Drawable w; GC gc; int x1,y1,x2,y2; { HDC hDC; HPEN hpen; RECT da; HANDLE oldObj; xtrace("XDrawLine\n"); if (VALID_WINDOW(w)) { hDC = drawableGetDC(w); hpen = NT_get_GC_pen(hDC,gc); oldObj = SelectObject(hDC,hpen); MoveToEx(hDC,x1,y1,NULL); LineTo(hDC,x2,y2); SelectObject(hDC, oldObj); drawableRelDC(w,hDC); } return 0; } /*****************************************************************\ Function: XDrawLines Inputs: display, window, gc, points list, number of points, mode. Comments: Untested. \*****************************************************************/ int XDrawLines(display,w,gc,points,nps,mode) Display *display; Drawable w; GC gc; XPoint *points; int nps,mode; { HPEN hpen; int n; POINT pts[1000]; HDC hDC; HANDLE oldObj; xtrace("XDrawLines\n"); pts->x=(LONG)points->x; pts->y=(LONG)points->y; for(n=1;nx=(LONG)(points+n)->x; (pts+n)->y=(LONG)(points+n)->y; } else { (pts+n)->x=(LONG)(points+n)->x+(pts+n-1)->x; (pts+n)->y=(LONG)(points+n)->y+(pts+n-1)->y; } if (VALID_WINDOW(w)) { hDC = drawableGetDC(w); hpen = NT_get_GC_pen(hDC,gc); oldObj = SelectObject(hDC,hpen); Polyline(hDC,pts,nps); SelectObject(hDC, oldObj); drawableRelDC(w,hDC); } return 0; } /*****************************************************************\ Function: XDrawPoints Inputs: display, window, gc, points list, number of points, mode. Comments: Untested. \*****************************************************************/ int XDrawPoints(display,w,gc,points,nps,mode) Display *display; Drawable w; GC gc; XPoint *points; int nps,mode; { HDC hDC; int n; xtrace("XDrawPoints\n"); if (VALID_WINDOW(w)) { hDC = drawableGetDC(w); SetPixelV(hDC,points->x,points->y,CNUMTORGB(gc->values.foreground)); for (n=1;nx,(points+n)->y, CNUMTORGB(gc->values.foreground)); else SetPixelV(hDC,(points+n-1)->x+(points+n)->x, (points+n-1)->y+(points+n)->y, CNUMTORGB(gc->values.foreground)); } drawableRelDC(w,hDC); } return 0; } int XDrawPoint(display,w,gc,x,y) Display *display; Drawable w; GC gc; int x,y; { HDC hDC; xtrace("XDrawPoint\n"); if (VALID_WINDOW(w)) { hDC = drawableGetDC(w); SetPixelV(hDC,x,y,CNUMTORGB(gc->values.foreground)); drawableRelDC(w,hDC); } return 0; } /*****************************************************************\ Function: XDrawRectangle Inputs: display, window, gc, geometry Comments: Seems to work. \*****************************************************************/ int XDrawRectangle(display,w,gc,x,y,width,height) Display *display; Drawable w; GC gc; int x,y; unsigned int width,height; { HDC hDC; RECT rect; HBRUSH hbrush; HPEN hpen; HANDLE oldbrush, oldpen; xtrace("XDrawRectangle\n"); if (VALID_WINDOW(w)) { hDC = drawableGetDC(w); hbrush = NT_get_GC_brush(hDC,gc); rect.left=(LONG)x; rect.right=(LONG)(x+width); rect.top=(LONG)y; rect.bottom=(LONG)(y+height); oldbrush = SelectObject(hDC,GetStockObject(NULL_BRUSH)); hpen = NT_get_GC_pen(hDC,gc); oldpen = SelectObject(hDC,hpen); Rectangle(hDC,(int)rect.left,(int)rect.top,(int)rect.right,(int)rect.bottom); /* FrameRect(hDC,&rect,hbrush); */ SelectObject(hDC, oldbrush); SelectObject(hDC, oldpen); drawableRelDC(w,hDC); } return 0; } /*****************************************************************\ Function: XDrawSegments Inputs: display, window, gc, segment list, number of segments. Comments: Untested. \*****************************************************************/ int XDrawSegments(display,w,gc,segs,nsegs) Display *display; Drawable w; GC gc; XSegment *segs; int nsegs; { HDC hDC; HPEN hpen; int n; HANDLE oldObj; xtrace("XDrawSegments\n"); if (VALID_WINDOW(w)) { hDC = drawableGetDC(w); hpen = NT_get_GC_pen(hDC,gc); oldObj = SelectObject(hDC,hpen); SetBkMode(hDC,TRANSPARENT); for (n=0;nx1,(segs+n)->y1,NULL); LineTo(hDC,(segs+n)->x2,(segs+n)->y2); } SelectObject(hDC, oldObj); drawableRelDC(w,hDC); } return 0; } Pixmap XCreatePixmap(display,drawable,width,height,depth) Display *display; Drawable drawable; unsigned int width, height; unsigned int depth; { RECT rct; NT_window *w = (NT_window *)NT_new_window(); HDC parenthDC = drawableGetDC(drawable); w->hDC = CreateCompatibleDC(parenthDC); w->hBitmap = CreateCompatibleBitmap(parenthDC,width,height); SelectObject(w->hDC, w->hBitmap); rct.left=(LONG) 0; rct.right=(LONG) width; rct.top=(LONG) 0; rct.bottom=(LONG) height; FillRect(w->hDC, &rct, GetStockObject(WHITE_BRUSH)); drawableRelDC(drawable,parenthDC); w->w = NONMAPPED_HANDLE; w->x=0; w->y=0; w->wdth = width; w->hght = height; w->min = depth; return (Pixmap)w; } const char revBytes[]={ 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff }; Pixmap XCreateBitmapFromData(Display *display, Drawable drawable, const char *data, unsigned int width, unsigned int height) { NT_window *w = (NT_window *)NT_new_window(); HDC parenthDC = drawableGetDC(drawable); w->hDC = CreateCompatibleDC(parenthDC); { int i,j; char *newdata; int bytes = (width+7)>>3; int newbytes = (bytes&1)?bytes+1:bytes; newdata = allocateMemory(newbytes*height); for (i=0;ihBitmap = CreateBitmap(width,height,1,1,newdata); freeMemory(newdata); } SelectObject(w->hDC, w->hBitmap); drawableRelDC(drawable,parenthDC); w->x=0; w->y=0; w->wdth = width; w->hght = height; w->min = 1; return (Pixmap)w; } int XFreePixmap(display, pixmap) Display *display; Pixmap pixmap; { NT_window *w = (NT_window *)pixmap; NT_delete_window(w); return 0; } int XCopyArea(display, src, dest, gc, src_x, src_y, width, height, dest_x, dest_y) Display *display; Drawable src, dest; GC gc; int src_x, src_y; unsigned int width, height; int dest_x, dest_y; { HDC hsrc, hdst; hsrc = drawableGetDC(src); if (VALID_WINDOW(dest)) { hdst = drawableGetDC(dest); (void)BitBlt(hdst,dest_x,dest_y,width,height,hsrc,src_x,src_y,SRCCOPY); drawableRelDC(src,hsrc); } drawableRelDC(dest,hdst); return 0; } XImage * NT_XCreateImage() { return NULL; } int NT_XDestroyImage(ximage) XImage *ximage; { /* freeMemory(ximage->data); */ freeMemory(ximage); return 1; } unsigned long NT_XGetPixel(ximage,x,y) XImage *ximage; int x,y; { return 0; } int NT_XPutPixel(ximage,x,y,pixel) XImage *ximage; int x,y; unsigned long pixel; { return 0; } XImage * NT_XSubImage(ximage,x,y,w,h) XImage *ximage; int x,y; unsigned int w,h; { return NULL; } int NT_XAddPixel(ximage,value) XImage *ximage; unsigned long value; { return 0; } XImage * XGetImage(display,drawable,x,y,width,height,plane_mask,format) Display *display; Drawable drawable; int x,y; unsigned int width, height; unsigned long plane_mask; int format; { return NULL; } XImage * XCreateImage(display,visual,depth,format,offset,data,width,height, bitmap_pad, bytes_per_line) Display *display; Visual *visual; unsigned int depth; int format; int offset; char *data; unsigned int width, height; int bitmap_pad, bytes_per_line; { XImage *img = (XImage *) allocateMemory(sizeof(XImage)); if (img) { img->depth = 24; /* depth; */ img->format = format; img->xoffset = offset; img->data = data; img->width = width; img->height = height; img->bitmap_pad = 32; img->bytes_per_line=width*((24)>>3); img->bits_per_pixel = 24; /* depth; */ img->bitmap_bit_order = LSBFirst; img->byte_order = MSBFirst; img->blue_mask = 0x0ff00000; img->green_mask=0x00ff0000; img->red_mask= 0x0000ff00; img->f.create_image = NT_XCreateImage; img->f.destroy_image = NT_XDestroyImage; img->f.get_pixel = NT_XGetPixel; img->f.put_pixel = NT_XPutPixel; img->f.sub_image = NT_XSubImage; img->f.add_pixel = NT_XAddPixel; } return img; } void DrawBitmap(HDC hdc, HBITMAP hBitmap, int xStart, int yStart) { BITMAP bm; HDC hdcMem; DWORD dwSize; POINT ptSize, ptOrg; hdcMem = CreateCompatibleDC(hdc); SelectObject(hdcMem, hBitmap); SetMapMode(hdcMem,GetMapMode(hdc)); GetObject(hBitmap, sizeof(BITMAP), (LPVOID)&bm); ptSize.x = bm.bmWidth; ptSize.y = bm.bmHeight; DPtoLP(hdc, &ptSize,1); ptOrg.x=0; ptOrg.y=0; DPtoLP(hdcMem,&ptOrg,1); BitBlt(hdc,xStart,yStart,ptSize.x,ptSize.y,hdcMem,ptOrg.x,ptOrg.y,SRCCOPY); DeleteDC(hdcMem); } /* static unsigned char wBrickBits[]={ 0xff,0x0c,0x0c,0x0c, 0xff,0xc0,0xc0,0xc0, 0xff,0x0c,0xff,0xff, 0xff,0xff,0xc0,0xc0, 0xff,0x0c,0xff,0xff, 0xff,0xff,0xc0,0xc0, 0xff,0x0c,0x0c,0x0c, 0xff,0xc0,0xc0,0xc0 }; */ int XPutImage(display,w,gc,image,sx,sy,dx,dy,width,height) Display *display; Drawable w; XImage *image; GC gc; int sx,sy,dx,dy; unsigned int width,height; { BITMAPINFO bmInfo; NT_window *pix = (NT_window *)w; int res; if (VALID_WINDOW(w)) { HDC hDC = drawableGetDC(w); bmInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmInfo.bmiHeader.biWidth = width; bmInfo.bmiHeader.biHeight = height; bmInfo.bmiHeader.biPlanes = 1; bmInfo.bmiHeader.biBitCount = 24; /*image->depth; */ bmInfo.bmiHeader.biCompression = BI_RGB; bmInfo.bmiHeader.biSizeImage = 0; bmInfo.bmiHeader.biXPelsPerMeter = 3600; bmInfo.bmiHeader.biYPelsPerMeter = 3600; bmInfo.bmiHeader.biClrUsed = 0; bmInfo.bmiHeader.biClrImportant = 0; res = SetDIBitsToDevice(hDC,0,0,width,height,0,0,0,height,image->data,&bmInfo,DIB_RGB_COLORS); /* BitBlt(CreateDC("DISPLAY",NULL,NULL,NULL),10,0,width,height,hDC,0,0,SRCCOPY); */ if (res==0) printf("SetDIBitsfailed %d\n",res,GetLastError()); drawableRelDC(w,hDC); } return 0; } int XSetWindowBackground(display, w, bg) Display *display; Window w; unsigned long bg; { NT_window *window = (NT_window *)w; xtrace("XSetWindowBackground\n"); DeleteObject(window->bg); window->bg=CreateSolidBrush(CNUMTORGB(bg)); return 0; } int XSetWindowBackgroundPixmap(display, w, background_tile) Display *display; Window w; Pixmap background_tile; { NT_window *window = (NT_window *)w; NT_window *wpix = (NT_window *)background_tile; BITMAPINFO *bmInfo; BITMAP bm; int res; xtrace("XSetWindowBackgroundPixmap\n"); if (background_tile==ParentRelative) { if (!window->parentRelative) { HBITMAP hb = NT_getWallpaper(); if (hb!=NULL) { DeleteObject(window->bg); window->bg = CreatePatternBrush(hb); window->parentRelative=1; NT_configureNotify(window,window->x,window->y); } } } else { GetObject(wpix->hBitmap, sizeof(BITMAP), &bm); bmInfo = allocateMemory(sizeof(BITMAPINFO) + ( (bm.bmBitsPixel>>3)* bm.bmWidth*bm.bmHeight)); bmInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmInfo->bmiHeader.biWidth = bm.bmWidth; bmInfo->bmiHeader.biHeight = bm.bmHeight; bmInfo->bmiHeader.biPlanes = 1; bmInfo->bmiHeader.biBitCount = bm.bmBitsPixel; bmInfo->bmiHeader.biCompression = BI_RGB; bmInfo->bmiHeader.biSizeImage = 0; bmInfo->bmiHeader.biClrImportant = 0; bmInfo->bmiHeader.biClrUsed = 0; res =GetDIBits(wpix->hDC,wpix->hBitmap,0,bm.bmHeight,bmInfo->bmiColors,bmInfo,DIB_RGB_COLORS); if (res==0) printf("getDIBits failed %d\n",res,GetLastError()); DeleteObject(window->bg); window->bg = CreateDIBPatternBrushPt(bmInfo, DIB_RGB_COLORS); freeMemory(bmInfo); } } /*****************************************************************\ Function: XSetFillStyle Inputs: display, gc, fill style. Comments: ZZzzz... \*****************************************************************/ int XSetFillStyle(display,gc,fs) Display *display; GC gc; int fs; { xtrace("XSetFillStyle\n"); gc->values.fill_style=fs; gc->dirty |= GCFillStyle; return 0; } int XSetDashes(Display *display, GC gc, int dash_offset, const char * dash_list, int n) { xtrace("XSetDashes\n"); return 0; } int XChangeWindowAttributes(display,w,vmask,attr) Display *display; Window w; unsigned long vmask; XSetWindowAttributes *attr; { xtrace("XChangeWindowAttributes\n"); return 0; } /*****************************************************************\ Function: XLowerWindow Inputs: display, window to be lowered. Comments: Make sure if the window has a frame that that gets lowered too. \*****************************************************************/ int XLowerWindow(display,w) Display *display; Window w; { NT_window *ntw=(NT_window *)w; xtrace("XLowerWindow\n"); SetWindowPos((HWND)ntw->w,HWND_BOTTOM,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); return 0; } /*****************************************************************\ Function: XMapRaised Inputs: display, window. Comments: Frames get raised first. \*****************************************************************/ int XMapRaised(display,w) Display *display; Window w; { NT_window *ntw=(NT_window *)w; xtrace("XMapRaised\n"); XMapWindow(display,w); SetWindowPos(ntw->w,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); return 0; } /*****************************************************************\ Function: XMapSubwindows Inputs: display, window. Comments: Unfortunately, the optimisations normally made by the X server are not made here. \*****************************************************************/ int XMapSubwindows(display,w) Display *display; Window w; { NT_window *ntw=(NT_window *)w; struct NT_child *tmp; xtrace("XMapSubWindows\n"); tmp=ntw->child; while (tmp!=NULL) { XMapWindow(display,(Window)tmp->w); tmp=tmp->next; } return 0; } /*****************************************************************\ Function: XQueryTree Inputs: display, window. Returned: root window, parent window, list of children, status. Comments: Not fully implemented. The child field is wrong. \*****************************************************************/ StatusDef XQueryTree(display,w,root,parent,ch,n) Display *display; Window w; Window* root; Window* parent; Window** ch; unsigned int *n; { NT_window *ntw=(NT_window *)w; StatusDef status=1; xtrace("XQueryTree\n"); *parent=(Window)ntw->parent; if (ntw->parent==NULL) status=0; *root=display->screens[0].root; *ch=NULL; *n=0; return (status); } /*****************************************************************\ Function: XRaiseWindow Inputs: display, window. Comments: Recursive raising of window and its children. \*****************************************************************/ int XRaiseWindow(display,w) Display *display; Window w; { NT_window *ntw=(NT_window *)w; struct NT_child *tmp; xtrace("XRaiseWindows\n"); BringWindowToTop(ntw->w); tmp=ntw->child; while (tmp!=NULL) { XRaiseWindow(display,(Window)tmp->w); tmp=tmp->next; } return 0; } /*****************************************************************\ Function: XRootWindow Inputs: display, screen number Returned: root window ID. Comments: Info taken from display structure. \*****************************************************************/ Window XRootWindow(display,scr) Display *display; int scr; { xtrace("XRootWindow\n"); return(display->screens[0].root); } /*****************************************************************\ Function: XRootWindowOfScreen Inputs: screen pointer Returned: root window ID. Comments: ZZzzz... \*****************************************************************/ Window XRootWindowOfScreen(scr) Screen *scr; { xtrace("XRootWindowOfScreen\n"); return(scr->root); } /*****************************************************************\ Function: XTranslateCoordinates Inputs: display, source window, destination window, source x, y. Returned: destination x, y, child window if any. Comments: Seems to work properly. \*****************************************************************/ BoolDef XTranslateCoordinates(display,sw,dw,sx,sy,dx,dy,ch) Display *display; Window sw,dw; int sx,sy,*dx,*dy; Window *ch; { xtrace("XTranslateCoordinates\n"); return (True); } /*****************************************************************\ Function: XUnmapWindow Inputs: display, window. Comments: Removes a window and its frame, if it has one, from the screen. \*****************************************************************/ int XUnmapWindow(display,w) Display *display; Window w; { NT_window *ntw=(NT_window *)w; xtrace("XUnmapWindow\n"); ShowWindow(ntw->w,SW_HIDE); return 0; } /*****************************************************************\ Function: XCopyGC Inputs: display, source gc, values mask, destination gc. Comments: Copies masked elements from source to destination. \*****************************************************************/ int XCopyGC(display,sgc,vmask,dgc) Display *display; GC sgc,dgc; unsigned long vmask; { xtrace("XCopyGC\n"); if (vmask&GCFunction) dgc->values.function=sgc->values.function; if (vmask&GCPlaneMask) dgc->values.plane_mask=sgc->values.plane_mask; if (vmask&GCForeground) dgc->values.foreground=sgc->values.foreground; if (vmask&GCBackground) dgc->values.background=sgc->values.background; if (vmask&GCLineWidth) dgc->values.line_width=sgc->values.line_width; if (vmask&GCLineStyle) dgc->values.line_style=sgc->values.line_style; if (vmask&GCCapStyle) dgc->values.cap_style=sgc->values.cap_style; if (vmask&GCJoinStyle) dgc->values.join_style=sgc->values.join_style; if (vmask&GCFillStyle) dgc->values.fill_style=sgc->values.fill_style; if (vmask&GCFillRule) dgc->values.fill_rule=sgc->values.fill_rule; if (vmask&GCTile) dgc->values.tile=sgc->values.tile; if (vmask&GCStipple) dgc->values.stipple=sgc->values.stipple; if (vmask&GCTileStipXOrigin) dgc->values.ts_x_origin=sgc->values.ts_x_origin; if (vmask&GCTileStipYOrigin) dgc->values.ts_y_origin=sgc->values.ts_y_origin; if (vmask&GCFont) dgc->values.font=sgc->values.font; if (vmask&GCSubwindowMode) dgc->values.subwindow_mode=sgc->values.subwindow_mode; if (vmask&GCGraphicsExposures) dgc->values.graphics_exposures=sgc->values.graphics_exposures; if (vmask&GCClipXOrigin) dgc->values.clip_x_origin=sgc->values.clip_x_origin; if (vmask&GCClipYOrigin) dgc->values.clip_y_origin=sgc->values.clip_y_origin; if (vmask&GCClipMask) dgc->values.clip_mask=sgc->values.clip_mask; if (vmask&GCDashList) dgc->values.dashes=sgc->values.dashes; if (vmask&GCArcMode) dgc->values.arc_mode=sgc->values.arc_mode; dgc->dirty = 0xFFFF; return 0; } int XSetClipMask(display,gc,cmask) Display *display; GC gc; Pixmap cmask; { xtrace("XSetClipMask\n"); return 0; } int XSetClipRectangles(display,gc,clx,cly,rs,n,order) Display *display; GC gc; int clx,cly; XRectangle *rs; int n,order; { xtrace("XSetClipRectangles\n"); return 0; } /*****************************************************************\ Function: XSetFunction Inputs: display, gc, graphics operation. Comments: ZZzzz... \*****************************************************************/ int XSetFunction(display,gc,fn) Display *display; GC gc; int fn; { xtrace("XSetFunction\n"); gc->values.function=fn; gc->dirty |= GCFunction; return 0; } /*****************************************************************\ Function: XSetLineAttributes Inputs: display, gc, line width, line style, cap style, join style. Comments: These all have windows equivalents. \*****************************************************************/ int XSetLineAttributes(display,gc,lw,ls,cs,js) Display *display; GC gc; unsigned int lw; int ls,cs,js; { xtrace("XSetLineAttributes\n"); gc->values.line_width=lw; gc->values.line_style=ls; gc->values.cap_style=cs; gc->values.join_style=js; gc->dirty |= GCLineWidth | GCLineStyle | GCCapStyle | GCJoinStyle; return 0; } /*****************************************************************\ Function: XSetPlaneMask Inputs: display, gc, plane mask. Comments: What's a plane mask? \*****************************************************************/ int XSetPlaneMask(display,gc,pmask) Display *display; GC gc; unsigned long pmask; { xtrace("XSetPlaneMask\n"); gc->values.plane_mask=pmask; return 0; } int XSetTile(display,gc,tile) Display *display; GC gc; Pixmap tile; { xtrace("XSetTile\n"); return 0; } StatusDef XAllocColorCells(display,cmap,cont,pmasks,np,pixels,nc) Display *display; Colormap cmap; BoolDef cont; unsigned long *pmasks; unsigned int np; unsigned long *pixels; unsigned int nc; { unsigned int i; xtrace("XAllocColorCells\n"); for (i = 0;ipixel = RGB((BYTE) (xc->red>>8)&0xff, (BYTE) (xc->green>>8)&0xff, (BYTE) (xc->blue>>8)&0xff); return 1; } int XQueryColor(display,cmap,cell) Display *display; Colormap cmap; XColor *cell; { xtrace("XQueryColor\n"); cell->red = (cell->pixel>>8)&0x0ff00; cell->green = (cell->pixel)&0x0ff00; cell->blue = (cell->pixel<<8)&0x0ff00; return 1; } int XQueryColors(display,cmap,cells,nc) Display *display; Colormap cmap; XColor *cells; int nc; { int i; xtrace("XQueryColors\n"); for (i=0;i>8)&0xff00; cells[i].green=(cells[i].pixel)&0xff00; cells[i].blue=(cells[i].pixel<<8)&0xff00; } return 0; } int XStoreColor(display,cmap,cell) Display *display; Colormap cmap; XColor *cell; { xtrace("XStoreColor\n"); return 0; } int XStoreColors(display,cmap,cells,nc) Display *display; Colormap cmap; XColor *cells; int nc; { int i; xtrace("XStoreColors\n"); return 0; } char ** XGetFontPath(display,nps) Display *display; int *nps; { xtrace("XGetFontPath\n"); return (NULL); } BoolDef XGetFontProperty(fstruct,atom,val) XFontStruct *fstruct; Atom atom; unsigned long *val; { xtrace("XGetFontProperty\n"); return (0); } static BYTE getCharSetFromName(const char *name,char **lang) { static struct { char *label; BYTE id; } charset[] = { "-gb2312", GB2312_CHARSET, "-big5", CHINESEBIG5_CHARSET, "-jis", SHIFTJIS_CHARSET, NULL, DEFAULT_CHARSET }; int i; char *p; if (!name) { if (lang) *lang=NULL; return DEFAULT_CHARSET; } else if (lang) *lang=(char *)name+strlen((char *)name); for (i=0; charset[i].label; i++) if (NULL!=(p=strstr(name, charset[i].label))) { if (lang) *lang=p; break; } return charset[i].id; } /* attempts to translate the font name into ** something win32 understands. ** */ Font NT_loadfont(name) char *name; { LOGFONT lf; HFONT hfont; char *p,*q,*lang; int size = 0; char buff[33]; memset(&lf,0,sizeof(lf)); lf.lfHeight = -13; lf.lfWeight = FW_NORMAL; lf.lfFaceName[0]='\0'; lf.lfCharSet = getCharSetFromName(name,&lang); if (name && strstr(name,"-bold")) { lf.lfWeight = FW_BOLD; } for(p=name, q=buff; p&&p<=lang; p++) { if (((!*p || *p=='-') && q!=buff) || (q-buff>31)) { *q++='\0'; if (lf.lfFaceName[0]=='\0') { if (isalpha(buff[0]) || IsDBCSLeadByte(buff[0])) strcpy(lf.lfFaceName, buff); else if (isdigit(buff[0]) && ((q=strchr(buff,'x')) || (q=strchr(buff,'X')))) { strcpy(lf.lfFaceName, "Courier New"); size = -atoi(q+1); } else if (size == 0 && isdigit(buff[0])) size = -atoi(buff); } else if (size == 0 && isdigit(buff[0])) { size = -atoi(buff); } q = buff; } else *q++ = *p; if (!*p) break; } if (size > 99) lf.lfHeight = - (size/10); else if (size) lf.lfHeight = - size; if (!strcmp(lf.lfFaceName,"lucidatypewriter")) strcpy(lf.lfFaceName,"Lucida Console"); else if (lf.lfFaceName[0]=='\0'&&lf.lfCharSet==DEFAULT_CHARSET) strcpy(lf.lfFaceName,"Courier New"); hfont = CreateFontIndirect(&lf); return (Font)hfont; } XFontStruct * XLoadQueryFont(Display *display, const char *name) { XFontStruct *fs; TEXTMETRIC tm; HDC hdc; HWND root; HFONT old; int i; xtrace("XLoadQueryFont\n"); fs = allocateMemory(sizeof(XFontStruct)); fs->fid = NT_loadfont(name); root=GetDesktopWindow(); hdc=GetDC(root); old = SelectObject(hdc, (HFONT)fs->fid); GetTextMetrics(hdc, &tm); fs->min_bounds.width = tm.tmAveCharWidth; fs->max_bounds.width = tm.tmMaxCharWidth; fs->n_properties = 0; fs->properties = NULL; fs->min_char_or_byte2 =tm.tmFirstChar; fs->max_char_or_byte2 =tm.tmLastChar; fs->per_char = (XCharStruct*)allocateMemory(sizeof(XCharStruct)*(tm.tmLastChar+1)); ZeroMemory(fs->per_char, sizeof(XCharStruct)*(tm.tmLastChar+1)); if (!(tm.tmPitchAndFamily & TMPF_FIXED_PITCH)) { for (i=tm.tmFirstChar; i<=tm.tmLastChar; i++) { fs->per_char[i].width = tm.tmAveCharWidth; fs->per_char[i].rbearing = tm.tmAveCharWidth; } } else if (tm.tmPitchAndFamily & TMPF_TRUETYPE) { for (i=tm.tmFirstChar; i<=tm.tmLastChar; i++) { ABC abc; if (!GetCharABCWidths(hdc,i,i,&abc)) { abc.abcA = 0; abc.abcB = tm.tmAveCharWidth; abc.abcC = 0; } fs->per_char[i].lbearing = abc.abcA; fs->per_char[i].width = abc.abcB; fs->per_char[i].rbearing = abc.abcB+abc.abcC; } } else { for (i=tm.tmFirstChar; i<=tm.tmLastChar; i++) { INT fw; if (!GetCharWidth(hdc,i,i,&fw)) { fw = tm.tmAveCharWidth; } fs->per_char[i].lbearing = 0; fs->per_char[i].width = fw; fs->per_char[i].rbearing = fw; } } if (getCharSetFromName(name,NULL) == DEFAULT_CHARSET) { int last = tm.tmLastChar; switch(tm.tmCharSet) { case CHINESEBIG5_CHARSET: case GB2312_CHARSET: case SHIFTJIS_CHARSET: if (tm.tmLastChar > 127) last = 127; break; } if (last >= tm.tmFirstChar) { fs->max_bounds = fs->per_char[last]; fs->min_bounds = fs->per_char[last]; for (i=tm.tmFirstChar; iper_char[i].lbearing > fs->max_bounds.lbearing) fs->max_bounds.lbearing = fs->per_char[i].lbearing; else if(fs->per_char[i].lbearing < fs->min_bounds.lbearing) fs->min_bounds.lbearing = fs->per_char[i].lbearing; if (fs->per_char[i].width > fs->max_bounds.width) fs->max_bounds.width = fs->per_char[i].width; else if(fs->per_char[i].width < fs->min_bounds.width) fs->min_bounds.width = fs->per_char[i].width; if (fs->per_char[i].rbearing > fs->max_bounds.rbearing) fs->max_bounds.rbearing = fs->per_char[i].rbearing; else if(fs->per_char[i].rbearing < fs->min_bounds.rbearing) fs->min_bounds.rbearing = fs->per_char[i].rbearing; } } } fs->ascent = tm.tmAscent; fs->descent= tm.tmDescent; SelectObject(hdc,old); ReleaseDC(root,hdc); return(fs); } XFontStruct * XQueryFont(display, font_id) Display *display; XID font_id; { static XFontStruct fs; xtrace("XQueryFont\n"); return(&fs); } KeySym XKeycodeToKeysym(display, keycode, index) Display *display; unsigned int keycode; int index; { xtrace("XKeycodeToKeysym\n"); if (keycode == 254) return XK_Alt_L; else if (keycode == 255) return XK_Num_Lock; return(NoSymbol); } KeyCode XKeysymToKeycode(display, keysym) Display *display; KeySym keysym; { xtrace("XKeycodeToKeysym\n"); if (keysym == XK_Alt_L) return 254; else if (keysym == XK_Num_Lock) return 255; return(0); } KeySym XStringToKeysym(const char *str) { xtrace("XStringToKeysym\n"); return(NoSymbol); } XModifierKeymap * XGetModifierMapping(display) Display *display; { XModifierKeymap *map = NULL; xtrace("XGetModifierMapping\n"); map = (XModifierKeymap *)allocateMemory(sizeof(XModifierKeymap)); map->max_keypermod = 1; map->modifiermap = (KeyCode *)allocateMemory(sizeof(KeyCode)*8); map->modifiermap[0]=0; map->modifiermap[1]=0; map->modifiermap[2]=0; map->modifiermap[3]=XKeysymToKeycode(display,XK_Alt_L); map->modifiermap[4]=0; map->modifiermap[5]=0; map->modifiermap[6]=0; map->modifiermap[7]=XKeysymToKeycode(display,XK_Num_Lock); return(map); } int XFreeModifiermap(XModifierKeymap *modmap) { xtrace("XFreeModifiermap\n"); freeMemory(modmap->modifiermap); freeMemory(modmap); return 0; } int XSetFont(display,gc,font) Display *display; GC gc; Font font; { xtrace("XSetFont\n"); gc->values.font = font; return 0; } int XSetFontPath(display,dirs,nd) Display *display; char **dirs; int nd; { xtrace("XSetFontPath\n"); return 0; } /*****************************************************************\ Function: XTextExtents Inputs: font structure, string, string length. Returned: writing direction, max ascent, max descent, font overall characteristics. Comments: The design of windows fonts is similar to X, as far as ascent and descent are concerned. However, they are positioned differently on the screen (see XDrawText). \*****************************************************************/ static HDC desktopHDC; static int firstTE = TRUE; int XTextExtents(fstruct,str,nc,dir,ascent,descent,overall) XFontStruct *fstruct; const char *str; int nc; int *dir,*ascent,*descent; XCharStruct *overall; { TEXTMETRIC tmet; HDC hdc; SIZE tsize; HWND desktop; HFONT old; xtrace("XTextExtents\n"); if (firstTE) { firstTE = FALSE; desktop=GetDesktopWindow(); desktopHDC=GetDC(desktop); } hdc = desktopHDC; old = SelectObject(hdc, (HFONT)fstruct->fid); GetTextMetrics(hdc,&tmet); GetTextExtentPoint(hdc,str,nc,&tsize); *dir=FontLeftToRight; *ascent=tmet.tmAscent + 1; *descent=tmet.tmDescent; overall->ascent=(short)(tmet.tmAscent + 1); overall->descent=(short)tmet.tmDescent; overall->width=(short)tsize.cx; overall->lbearing=0; overall->rbearing=(short)tsize.cx; /* cjh_rel_dc(desktop,hdc);*/ SelectObject(hdc,old); return 0; } int XTextExtents16(fstruct,str,nc,dir,ascent,descent,overall) XFontStruct *fstruct; const XChar2b *str; int nc; int *dir,*ascent,*descent; XCharStruct *overall; { xtrace("XTextExtents16\n"); return 0; } /*****************************************************************\ Function: XTextWidth Inputs: font structure, string, length of string. Returned: String width in pixels. Comments: \*****************************************************************/ int XTextWidth(fstruct,str,co) XFontStruct *fstruct; const char *str; int co; { HDC hdc; SIZE tsize; HWND root; HFONT old; xtrace("XTextWidth\n"); if(firstTE) { firstTE = FALSE; root=GetDesktopWindow(); hdc=GetDC(root); } old = SelectObject(hdc, (HFONT)fstruct->fid); GetTextExtentPoint(hdc,str,co,&tsize); SelectObject(hdc,old); /*cjh_rel_dc(root,hdc);*/ return (tsize.cx); } int XTextWidth16(fstruct,str,co) XFontStruct *fstruct; const XChar2b *str; int co; { xtrace("XTextWidth16\n"); return 0; } int XGetErrorDatabaseText(display,name,msg,defstr,buf,len) Display *display; const char *name,*msg; const char *defstr; char *buf; int len; { static char def_err[]="Errors not implemented"; int n; xtrace("XGetErrorDatabaseText\n"); while (ndefault_screen); } Visual * XDefaultVisual(display, screen) Display *display; int screen; { xtrace("XDefaultVisual\n"); return DefaultVisual(display, screen); } int XDefaultDepth(display, screen) Display *display; int screen; { xtrace("XDefaultDepth\n"); return DefaultDepth(display, screen); } Colormap XDefaultColormap(display, screen) Display *display; int screen; { xtrace("XDefaultColormap\n"); return DefaultColormap(display, screen); } /*****************************************************************\ Function: XScreenOfDisplay Inputs: display,screen number Returned: screen list. Comments: \*****************************************************************/ Screen * XScreenOfDisplay(display,scr) Display *display; int scr; { xtrace("XScreenOfDisplay\n"); return (display->screens); } Cursor XCreateFontCursor(display,shape) Display *display; unsigned int shape; { xtrace("XCreateFontCursor\n"); return 0; } int XRecolorCursor(display,cursor,fg,bg) Display *display; Cursor cursor; XColor *fg,*bg; { xtrace("XRecolorCursor\n"); return 0; } /*****************************************************************\ Function: XWarpPointer Inputs: display, source window, destination window, source window geometry, destination x, y. Comments: Not knowingly tested. \*****************************************************************/ int XWarpPointer(display,sw,dw,sx,sy,swidth,sheight,dx,dy) Display *display; Window sw,dw; int sx,sy; unsigned int swidth,sheight; int dx,dy; { NT_window *ntsw=(NT_window *)sw; NT_window *ntdw=(NT_window *)dw; POINT cpt,tmp; RECT srct; HDC hDC; xtrace("XWarpPointer\n"); GetCursorPos(&cpt); if (ntsw==None) { if (ntdw==None) SetCursorPos(dx,dy); else { tmp.x=dx; tmp.y=dy; ClientToScreen(ntdw->w,&tmp); SetCursorPos(tmp.x,tmp.y); } } else { GetWindowRect(ntsw->w,&srct); tmp.x=sx; tmp.y=sy; ClientToScreen(ntsw->w,&tmp); if (swidth==0) swidth=srct.right-sx; if (sheight==0) sheight=srct.bottom-sy; hDC = cjh_get_dc(ntdw); if (cpt.x>=tmp.x && cpt.x=tmp.y && cpt.yw,&tmp); SetCursorPos(tmp.x,tmp.y); } } cjh_rel_dc(ntdw,hDC); } return 0; } /*****************************************************************\ Function: XBell Inputs: display, percent loudness. Comments: Don't throw away your CD just yet. \*****************************************************************/ int XBell(display,pc) Display *display; int pc; { xtrace("XBell\n"); MessageBeep(MB_OK); return 0; } /*****************************************************************\ Function: XGetInputFocus Inputs: display, focus window, revert to window. Comments: We don't have the data in place for the revert to field to work. \*****************************************************************/ int XGetInputFocus(display,focus,revto) Display *display; Window *focus; int *revto; { xtrace("XGetInputFocus\n"); *focus=(Window)GetFocus(); /* Note: returns NULL if the focus window */ revto=RevertToNone; /* belongs to another thread. */ return 0; } /*****************************************************************\ Function: XSetInputFocus Inputs: display, focus window, revert to window, time. Comments: Set focus to requested client window. \*****************************************************************/ int XSetInputFocus(display,focus,revto,time) Display *display; Window focus; int revto; Time time; { NT_window *ntw=(NT_window *)focus; xtrace("XSetInputFocus\n"); SetFocus(ntw->w); return 0; } int XLookupString(event,buf,nbytes,keysym,status) XKeyEvent *event; char *buf; int nbytes; KeySym *keysym; XComposeStatus *status; { xtrace("XLookupString\n"); *buf=event->keycode; *keysym=event->keycode; return 1; } int XRefreshKeyboardMapping(event) XMappingEvent *event; { xtrace("XRefreshKeyboardMapping\n"); return 0; } int XSetClassHint(display,w,chints) Display *display; Window w; XClassHint *chints; { xtrace("XSetClassHint\n"); return 0; } /*****************************************************************\ Function: XSetNormalHints Inputs: display, window, size hints. Comments: Assuming the role of the window manager, we alter the window geometry as requested. \*****************************************************************/ int XSetNormalHints(display,w,hints) Display *display; Window w; XSizeHints *hints; { NT_window *ntw=(NT_window *)w; UINT ff; xtrace("XSetNormalHints\n"); if (!hints->flags&PPosition) ff=SWP_NOMOVE; else ff=0; if (!hints->flags&PSize) ff=ff|SWP_NOSIZE; if (hints->flags &USPosition) { ntw->x = hints->x; ntw->y = hints->y; } if (hints->flags & USSize) { ntw->wdth = hints->width; ntw->hght = hints->height; } if (hints->flags&PMinSize) { ntw->minx = hints->min_width; ntw->miny = hints->min_height; } if (VALID_WINDOW(ntw) && (hints->flags & USSize || hints->flags &USPosition)) { SetWindowPos(ntw->w,HWND_TOPMOST,hints->x,hints->y, hints->width,hints->height,ff|SWP_SHOWWINDOW); } return 0; } int XSetWMHints(display,w,wmhints) Display *display; Window w; XWMHints *wmhints; { xtrace("XSetWMHints\n"); return 0; } StatusDef XSetWMProtocols(display,w,prots,co) Display *display; Window w; Atom *prots; int co; { xtrace("XSetWMProtocols\n"); return 0; } /*****************************************************************\ Function: XStoreName Inputs: display, window, window name. Comments: Only set names to the frame windows, otherwise captions appear in the client areas. \*****************************************************************/ int XStoreName(display,w,wname) Display *display; Window w; const char *wname; { NT_window *ntw=(NT_window *)w; int status = 0; xtrace("XStoreName\n"); if (ntw->top_flag) { ntw->title_text = strdup(wname); if (VALID_WINDOW(ntw)) status = SetWindowText (ntw->w , wname); } return(status); } StatusDef XFetchName( Display *display, Window w, char **window_name_return) { NT_window *ntw=(NT_window *)w; int status = 1; xtrace("XFetchName\n"); *window_name_return = NULL; if (ntw->title_text!=NULL) { *window_name_return = strdup(ntw->title_text); status =0; } return(status); } /*****************************************************************\ Function: XDoesBackingStore Inputs: screen Comments: No backing store at the moment. Windows doesn't seem to support it, unless we do it ourselves with compatible bitmaps. \*****************************************************************/ int XDoesBackingStore(scr) Screen *scr; { xtrace("XDoesBackingStore\n"); return(0); } XExtCodes * XInitExtension(display,name) Display *display; const char *name; { xtrace("XInitExtension\n"); return 0; } /*****************************************************************\ Function: XFree Inputs: data to be freed. Comments: This might need changing sometime. No crashes so far. \*****************************************************************/ int XFree(data) void *data; { xtrace("XFree\n"); freeMemory(data); return 0; } /*****************************************************************\ Function: XServerVendor Inputs: display. Returned: string of vendor's name. Comments: Copied from the display structure. \*****************************************************************/ char * XServerVendor(display) Display *display; { xtrace("XServerVendor\n"); return (display->vendor); } int XSetIconName(display,w,iname) Display *display; Window w; const char *iname; { xtrace("XSetIconName\n"); return 0; } int XGetIconName(display,w,iname) Display *display; Window w; char **iname; { xtrace("XGetIconName\n"); *iname = NULL; return 0; } int XSetSelectionOwner(display, sel, owner, time) Display* display; Atom sel; Window owner; Time time; { HWND hwnd = owner ? ((NT_window*)owner)->w : NULL; HWND cowner = GetClipboardOwner(); OpenClipboard(hwnd); if (cowner==hwnd) catchNextDestroyClipboard(); EmptyClipboard(); CloseClipboard(); return 0; } Window XGetSelectionOwner(display,selection) Display* display; Atom selection; { HWND hwnd = NULL; Window w; xtrace("XGetSelectionOwner\n"); hwnd = GetClipboardOwner(); w = (Window)NT_find_window_from_id(hwnd); if (!w) w=None; return w; } /*****************************************************************\ Function: NT_set_rop Inputs: window device context, X graphics context Comments: Sets the graphics drawing operation. \*****************************************************************/ void NT_set_rop(hdc,gc) HDC hdc; GC gc; { switch (gc->values.function) { case GXclear: SetROP2(hdc,R2_BLACK); break; case GXand: SetROP2(hdc,R2_MASKPEN); break; case GXandReverse: SetROP2(hdc,R2_MASKPENNOT); break; case GXcopy: SetROP2(hdc,R2_COPYPEN); break; case GXnoop: SetROP2(hdc,R2_NOP); break; case GXxor: SetROP2(hdc,R2_XORPEN);/*XORPEN);*/ break; case GXor: SetROP2(hdc,R2_MERGEPEN); break; case GXnor: SetROP2(hdc,R2_NOTMERGEPEN); break; case GXequiv: SetROP2(hdc,R2_NOTXORPEN); break; case GXinvert: SetROP2(hdc,R2_NOT); break; case GXorReverse: SetROP2(hdc,R2_MERGEPENNOT); break; case GXcopyInverted: SetROP2(hdc,R2_NOTCOPYPEN); break; case GXorInverted: SetROP2(hdc,R2_MERGENOTPEN); break; case GXnand: SetROP2(hdc,R2_NOTMASKPEN); break; case GXset: SetROP2(hdc,R2_WHITE); break; } } /*****************************************************************\ Function: NT_check_update_GC Inputs: gc - Graphics Context Comments: Check what has changed in the GC and modify the pen and brush accordingly. \*****************************************************************/ static int NT_check_update_GC(gc) GC gc; { DWORD style=PS_GEOMETRIC; LOGBRUSH lbr; int width; NTGC *lntgc; if ( gc->ext_data == NULL ) { gc->ext_data = (XExtData *)allocateMemory(sizeof(XExtData)); lntgc = (NTGC *)allocateMemory(sizeof(NTGC)); gc->ext_data->private_data = (char *)lntgc; lntgc->pen = INVALID_HANDLE; lntgc->brush = INVALID_HANDLE; lntgc->bgbrush = INVALID_HANDLE; gc->dirty=~0; } if ((gc->dirty & GCForeground) || (gc->dirty & GCLineStyle) || (gc->dirty & GCCapStyle) || (gc->dirty & GCJoinStyle) || (gc->dirty & GCLineWidth) ) { lbr.lbStyle=BS_SOLID; lbr.lbColor=CNUMTORGB(gc->values.foreground); lbr.lbHatch=0; if (gc->values.line_style==LineDoubleDash) style|=PS_DASHDOT; else if (gc->values.line_style==LineOnOffDash) style|=PS_DASH; else style|=PS_SOLID; if (gc->values.cap_style==CapProjecting) style|=PS_ENDCAP_SQUARE; else if (gc->values.cap_style==CapRound) style|=PS_ENDCAP_ROUND; else style|=PS_ENDCAP_FLAT; if (gc->values.join_style==JoinRound) style|=PS_JOIN_ROUND; else if (gc->values.join_style==JoinMiter) style|=PS_JOIN_MITER; else style|=PS_JOIN_BEVEL; width=gc->values.line_width; if (width==0) width=1; lntgc = (NTGC *)gc->ext_data->private_data; if ( lntgc->pen != INVALID_HANDLE ) DeleteObject(lntgc->pen); lntgc->pen = ExtCreatePen(style,width,&lbr,0,NULL); } if (gc->values.fill_style != FillSolid) { if ((gc->dirty & GCStipple)) { NT_window *pixmap = (NT_window *)gc->values.stipple; lntgc->brush = CreatePatternBrush(pixmap->hBitmap); } } else if ((gc->dirty & GCForeground) ) { lntgc = (NTGC *)gc->ext_data->private_data; if ( lntgc->brush != INVALID_HANDLE ) DeleteObject(lntgc->brush); lntgc->brush = CreateSolidBrush(CNUMTORGB(gc->values.foreground)); } if ((gc->dirty & GCBackground) ) { lntgc = (NTGC *)gc->ext_data->private_data; if ( lntgc->bgbrush != INVALID_HANDLE ) DeleteObject(lntgc->bgbrush); lntgc->bgbrush = CreateSolidBrush(CNUMTORGB(gc->values.background)); } gc->dirty = 0; return(1); } /*****************************************************************\ Function: NT_get_GC_pen Inputs: device context, graphics context Comments: Sets the device context and pen according to the graphics context. \*****************************************************************/ static HPEN NT_get_GC_pen(hdc,gc) HDC hdc; GC gc; { NTGC *lntgc; NT_check_update_GC(gc); NT_set_rop(hdc,gc); lntgc = (NTGC *)gc->ext_data->private_data; return(lntgc->pen); } /*****************************************************************\ Function: NT_get_GC_brush Inputs: device context, graphics context Returns: handle for brush. Comments: Same as above for painting operations. \*****************************************************************/ static HBRUSH NT_get_GC_brush(hdc,gc) HDC hdc; GC gc; { NTGC *lntgc; NT_check_update_GC(gc); if (gc->values.fill_rule==EvenOddRule) SetPolyFillMode(hdc,ALTERNATE); else SetPolyFillMode(hdc,WINDING); if (gc->values.fill_style == FillSolid || gc->values.fill_style == FillOpaqueStippled) { SetTextColor(hdc, CNUMTORGB(gc->values.foreground)); SetBkColor(hdc, CNUMTORGB(gc->values.background)); } NT_set_rop(hdc,gc); lntgc = (NTGC *)gc->ext_data->private_data; return(lntgc->brush); } static HBRUSH NT_get_GC_bgbrush(hdc,gc) HDC hdc; GC gc; { NTGC *lntgc; NT_check_update_GC(gc); lntgc = (NTGC *)gc->ext_data->private_data; return(lntgc->bgbrush); } /*****************************************************************\ Function: NT_deg64_to_rad Inputs: angle (in 64ths of a degree) Comments: Converts int angle to double in radians. \*****************************************************************/ double NT_deg64_to_rad(a) int a; { return ((double)a/64.0*0.017453); } /******************************************************************/ /* */ /* Atoms and properties code. */ /* */ /******************************************************************/ static char **nt_atoms; static int num_nt_atoms = 0; static int max_num_nt_atoms = 0; #define ATOMS_BLOCK_SIZE 40 /******************************************************************\ Function: XInternAtom Inputs: Display, property name, creation flag. Comments: Could be made much more efficient. \******************************************************************/ Atom XInternAtom(display, property_name, only_if_exists) Display *display; const char *property_name; BoolDef only_if_exists; { int i; char **new_nt_atoms; xtrace("XInternAtom\n"); if (strcmp(property_name,"VT_SELECTION")==0) { return XA_LAST_PREDEFINED + 667; } for (i=0;i< num_nt_atoms ;i++) if (strcmp(nt_atoms[i],property_name) == 0) return XA_LAST_PREDEFINED + i; if (only_if_exists) return None; if (num_nt_atoms >= max_num_nt_atoms) { new_nt_atoms = (char **)realloc(nt_atoms,(max_num_nt_atoms + ATOMS_BLOCK_SIZE)*sizeof(char *)); if (!new_nt_atoms) return None; nt_atoms = new_nt_atoms; max_num_nt_atoms+= ATOMS_BLOCK_SIZE; nt_atoms[num_nt_atoms] = allocateMemory(strlen(property_name)+1); if (!nt_atoms[num_nt_atoms]) return None; strcpy(nt_atoms[num_nt_atoms],property_name); return (XA_LAST_PREDEFINED + num_nt_atoms++); } } /******************************************************************\ Function: XGetAtomName Inputs: Display,Atom Comments: None. \******************************************************************/ char * XGetAtomName(display,atom) Display *display; Atom atom; { char *ret_string; xtrace("XGetAtomName\n"); if (atom > num_nt_atoms + XA_LAST_PREDEFINED) return NULL; if (! (ret_string = allocateMemory(strlen(nt_atoms[atom - XA_LAST_PREDEFINED])+1))) return FALSE; strcpy(ret_string,nt_atoms[atom]); return ret_string; } /******************************************************************\ Function: XChangeProperty Inputs: Display,Window,Property,type,format,mode,data, nelements. Comments: None. \******************************************************************/ int XChangeProperty( Display *display, Window window, Atom property, Atom type, int format, int mode, const unsigned char *data, int nelements) { NT_window *ntw=(NT_window *)window; struct NT_prop_list *wanderer, *new; xtrace("XChangeProperty\n"); if (property == XA_CUT_BUFFER0 && type==XA_STRING) { HGLOBAL handle=NULL; char *buffer=NULL; int i,j,cr=0; for (i=0; iw); buffer = GlobalLock(handle); for (i=j=0; ivalues.arc_mode=gc_values->arc_mode; if (mask&GCBackground) gc->values.background=gc_values->background; if (mask&GCCapStyle) gc->values.cap_style=gc_values->cap_style; if (mask&GCClipMask) gc->values.clip_mask=gc_values->clip_mask; if (mask&GCClipXOrigin) gc->values.clip_x_origin=gc_values->clip_x_origin; if (mask&GCClipYOrigin) gc->values.clip_y_origin=gc_values->clip_y_origin; if (mask&GCDashList) gc->values.dashes=gc_values->dashes; if (mask&GCDashOffset) gc->values.dash_offset=gc_values->dash_offset; if (mask&GCFillRule) gc->values.fill_rule=gc_values->fill_rule; if (mask&GCFillStyle) gc->values.fill_style=gc_values->fill_style; if (mask&GCFont) gc->values.font=gc_values->font; if (mask&GCForeground) gc->values.foreground=gc_values->foreground; if (mask&GCFunction) gc->values.function=gc_values->function; if (mask&GCGraphicsExposures) gc->values.graphics_exposures=gc_values->graphics_exposures; if (mask&GCJoinStyle) gc->values.join_style=gc_values->join_style; if (mask&GCLineStyle) gc->values.line_style=gc_values->line_style; if (mask&GCLineWidth) gc->values.line_width=gc_values->line_width; if (mask&GCPlaneMask) gc->values.plane_mask=gc_values->plane_mask; if (mask&GCStipple) gc->values.stipple=gc_values->stipple; if (mask&GCSubwindowMode) gc->values.subwindow_mode=gc_values->subwindow_mode; if (mask&GCTile) gc->values.tile=gc_values->tile; if (mask&GCTileStipXOrigin) gc->values.ts_x_origin=gc_values->ts_x_origin; if (mask&GCTileStipYOrigin) gc->values.ts_y_origin=gc_values->ts_y_origin; gc->dirty |= mask; return 0; } int XConnectionNumber(Display* display) { int fd; xtrace("XConnectionNumber\n"); fd = open ("/dev/windows", O_NONBLOCK, 0); return fd; } XFreeFont(Display* display,XFontStruct* font_struct) { xtrace("XFreeFont\n"); return 0; } char * _Xsetlocale(int category, const char *name) { xtrace("Xsetlocale\n"); return (char *)name; } char * XSetLocaleModifiers(const char* modifier_list) { xtrace("XSetLocaleModifiers\n"); return NULL; } XIM XOpenIM( Display* dpy, struct _XrmHashBucketRec* rdb, char* res_name, char* res_class) { xtrace("XOpenIM\n"); return 0; } char * XGetIMValues(XIM im , ...) { xtrace("XGetIMValues\n"); return NULL; } XIC XCreateIC(XIM im , ...) { xtrace("XCreateIC\n"); return 0; } StatusDef XCloseIM(XIM im) { xtrace("XCloseIM\n"); return 0; } char * XrmQuarkToString(void *quark) { xtrace("XrmQuarkToString\n"); return NULL; } int XmbLookupString( XIC ic, XKeyPressedEvent* event, char* buffer_return, int bytes_buffer, KeySym* keysym_return, StatusDef* status_return) { xtrace("XmbLookupString\n"); return 0; } int XmbTextPropertyToTextList( Display *display, XTextProperty *text_prop, char ***list_return, int *count_return) { xtrace("XmbTextPropertyToTextList\n"); /* in the future copy this, for 2.7.1 rxvt leaks this, so don't yet */ *list_return = (char **)allocateMemory(sizeof(char *)); *list_return[0] = text_prop->value; *count_return = 1; return 0; } void XFreeStringList(char **list) { freeMemory(list); } int XmbTextListToTextProperty( Display *display, char **list, int count, XICCEncodingStyle style, XTextProperty *text_prop_return) { int ret = 0; if (count!=1) ret = XNoMemory; text_prop_return->value = strdup(list[0]); switch (style) { case XStringStyle: text_prop_return->encoding = XA_STRING; break; /* case XCompoundTextStyle: text_prop_return->encoding = XA_COMPOUND; break; */ default: ret = XLocaleNotSupported; } text_prop_return->format = 8; text_prop_return->nitems = count; return ret; } void XmbDrawString( Display *display, Drawable d, XFontSet font_set, GC gc, int x, int y, char *string, int num_bytes) { xtrace("XmbDrawString\n"); } void XSetICFocus(XIC ic) { xtrace("XSetICFocus\n"); } void XUnsetICFocus(XIC ic) { xtrace("XUnsetICFocus\n"); } /* lifted from emacs */ /* * XParseGeometry parses strings of the form * "=x{+-}{+-}", where * width, height, xoffset, and yoffset are unsigned integers. * Example: "=80x24+300-49" * The equal sign is optional. * It returns a bitmask that indicates which of the four values * were actually found in the string. For each value found, * the corresponding argument is updated; for each value * not found, the corresponding argument is left unchanged. */ static int read_integer (string, NextString) register char *string; char **NextString; { register int Result = 0; int Sign = 1; if (*string == '+') string++; else if (*string == '-') { string++; Sign = -1; } for (; (*string >= '0') && (*string <= '9'); string++) { Result = (Result * 10) + (*string - '0'); } *NextString = string; if (Sign >= 0) return (Result); else return (-Result); } /* lifted from emacs */ int XParseGeometry( const char* string, int* x, int* y, unsigned int* width, unsigned int* height) { int mask = NoValue; register char *strind; unsigned int tempWidth, tempHeight; int tempX, tempY; char *nextCharacter; if ((string == NULL) || (*string == '\0')) return (mask); if (*string == '=') string++; /* ignore possible '=' at beg of geometry spec */ strind = (char *)string; if (*strind != '+' && *strind != '-' && *strind != 'x') { tempWidth = read_integer (strind, &nextCharacter); if (strind == nextCharacter) return (0); strind = nextCharacter; mask |= WidthValue; } if (*strind == 'x' || *strind == 'X') { strind++; tempHeight = read_integer (strind, &nextCharacter); if (strind == nextCharacter) return (0); strind = nextCharacter; mask |= HeightValue; } if ((*strind == '+') || (*strind == '-')) { if (*strind == '-') { strind++; tempX = -read_integer (strind, &nextCharacter); if (strind == nextCharacter) return (0); strind = nextCharacter; mask |= XNegative; } else { strind++; tempX = read_integer (strind, &nextCharacter); if (strind == nextCharacter) return (0); strind = nextCharacter; } mask |= XValue; if ((*strind == '+') || (*strind == '-')) { if (*strind == '-') { strind++; tempY = -read_integer (strind, &nextCharacter); if (strind == nextCharacter) return (0); strind = nextCharacter; mask |= YNegative; } else { strind++; tempY = read_integer (strind, &nextCharacter); if (strind == nextCharacter) return (0); strind = nextCharacter; } mask |= YValue; } } /* If strind isn't at the end of the string the it's an invalid geometry specification. */ if (*strind != '\0') return (0); if (mask & XValue) *x = tempX; if (mask & YValue) *y = tempY; if (mask & WidthValue) *width = tempWidth; if (mask & HeightValue) *height = tempHeight; return (mask); } XResizeWindow( Display* display, Window w, unsigned int width, unsigned int height) { RECT r; NT_window *ntw=(NT_window *)w; xtrace("XResizeWindow\n"); r.left = ntw->x; r.top = ntw->y; r.right = r.left + width; r.bottom = r.top + height; if (ntw->top_flag) AdjustWindowRect(&r, WS_OVERLAPPEDWINDOW, FALSE); if (VALID_WINDOW(ntw)) MoveWindow(ntw->w, r.left, r.top, r.right-r.left, r.bottom-r.top,TRUE); return 0; } void XSetWMNormalHints(Display* display,Window w,XSizeHints* hints) { xtrace("XSetWMNormalHints\n"); XSetNormalHints(display,w,hints); } void XSetWMProperties( Display* display, Window w, XTextProperty* window_name, XTextProperty* icon_name, char** argv, int argc, XSizeHints* normal_hints, XWMHints* wm_hints, XClassHint* class_hints) { xtrace("XSetWMProperties\n"); XSetNormalHints(display,w,normal_hints); } XDefineCursor(Display* display,Window w,Cursor cursor) { xtrace("XDefineCursor\n"); return 0; } XMoveResizeWindow( Display* display, Window w, int x, int y, unsigned int width, unsigned int height) { NT_window *ntw=(NT_window *)w; xtrace("XMoveResizeWindow\n"); ntw->x = x; ntw->y = y; ntw->wdth = width; ntw->hght = height; if (VALID_WINDOW(ntw)) { NT_moveWindow(ntw,TRUE); } } XMoveWindow( Display* display, Window w, int x, int y) { NT_window *ntw=(NT_window *)w; xtrace("XMoveWindow\n"); ntw->x = x; ntw->y = y; if (VALID_WINDOW(ntw)) { NT_moveWindow(ntw,TRUE); } return 0; } /* * xcolors.c -- * * This file contains the routines used to map from X color * names to RGB and pixel values. * * Copyright (c) 1996 by Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * SCCS: @(#) xcolors.c 1.3 96/12/17 13:07:02 */ /* * Define an array that defines the mapping from color names to RGB values. * Note that this array must be kept sorted alphabetically so that the * binary search used in XParseColor will succeed. */ typedef struct { char *name; unsigned char red; unsigned char green; unsigned char blue; } XColorEntry; static XColorEntry xColors[] = { "alice blue", 240, 248, 255, "AliceBlue", 240, 248, 255, "antique white", 250, 235, 215, "AntiqueWhite", 250, 235, 215, "AntiqueWhite1", 255, 239, 219, "AntiqueWhite2", 238, 223, 204, "AntiqueWhite3", 205, 192, 176, "AntiqueWhite4", 139, 131, 120, "aquamarine", 127, 255, 212, "aquamarine1", 127, 255, 212, "aquamarine2", 118, 238, 198, "aquamarine3", 102, 205, 170, "aquamarine4", 69, 139, 116, "azure", 240, 255, 255, "azure1", 240, 255, 255, "azure2", 224, 238, 238, "azure3", 193, 205, 205, "azure4", 131, 139, 139, "beige", 245, 245, 220, "bisque", 255, 228, 196, "bisque1", 255, 228, 196, "bisque2", 238, 213, 183, "bisque3", 205, 183, 158, "bisque4", 139, 125, 107, "black", 0, 0, 0, "blanched almond", 255, 235, 205, "BlanchedAlmond", 255, 235, 205, "blue", 0, 0, 255, "blue violet", 138, 43, 226, "blue1", 0, 0, 255, "blue2", 0, 0, 238, "blue3", 0, 0, 205, "blue4", 0, 0, 139, "BlueViolet", 138, 43, 226, "brown", 165, 42, 42, "brown1", 255, 64, 64, "brown2", 238, 59, 59, "brown3", 205, 51, 51, "brown4", 139, 35, 35, "burlywood", 222, 184, 135, "burlywood1", 255, 211, 155, "burlywood2", 238, 197, 145, "burlywood3", 205, 170, 125, "burlywood4", 139, 115, 85, "cadet blue", 95, 158, 160, "CadetBlue", 95, 158, 160, "CadetBlue1", 152, 245, 255, "CadetBlue2", 142, 229, 238, "CadetBlue3", 122, 197, 205, "CadetBlue4", 83, 134, 139, "chartreuse", 127, 255, 0, "chartreuse1", 127, 255, 0, "chartreuse2", 118, 238, 0, "chartreuse3", 102, 205, 0, "chartreuse4", 69, 139, 0, "chocolate", 210, 105, 30, "chocolate1", 255, 127, 36, "chocolate2", 238, 118, 33, "chocolate3", 205, 102, 29, "chocolate4", 139, 69, 19, "coral", 255, 127, 80, "coral1", 255, 114, 86, "coral2", 238, 106, 80, "coral3", 205, 91, 69, "coral4", 139, 62, 47, "cornflower blue", 100, 149, 237, "CornflowerBlue", 100, 149, 237, "cornsilk", 255, 248, 220, "cornsilk1", 255, 248, 220, "cornsilk2", 238, 232, 205, "cornsilk3", 205, 200, 177, "cornsilk4", 139, 136, 120, "cyan", 0, 255, 255, "cyan1", 0, 255, 255, "cyan2", 0, 238, 238, "cyan3", 0, 205, 205, "cyan4", 0, 139, 139, "dark goldenrod", 184, 134, 11, "dark green", 0, 100, 0, "dark khaki", 189, 183, 107, "dark olive green", 85, 107, 47, "dark orange", 255, 140, 0, "dark orchid", 153, 50, 204, "dark salmon", 233, 150, 122, "dark sea green", 143, 188, 143, "dark slate blue", 72, 61, 139, "dark slate gray", 47, 79, 79, "dark slate grey", 47, 79, 79, "dark turquoise", 0, 206, 209, "dark violet", 148, 0, 211, "DarkGoldenrod", 184, 134, 11, "DarkGoldenrod1", 255, 185, 15, "DarkGoldenrod2", 238, 173, 14, "DarkGoldenrod3", 205, 149, 12, "DarkGoldenrod4", 139, 101, 8, "DarkGreen", 0, 100, 0, "DarkKhaki", 189, 183, 107, "DarkOliveGreen", 85, 107, 47, "DarkOliveGreen1", 202, 255, 112, "DarkOliveGreen2", 188, 238, 104, "DarkOliveGreen3", 162, 205, 90, "DarkOliveGreen4", 110, 139, 61, "DarkOrange", 255, 140, 0, "DarkOrange1", 255, 127, 0, "DarkOrange2", 238, 118, 0, "DarkOrange3", 205, 102, 0, "DarkOrange4", 139, 69, 0, "DarkOrchid", 153, 50, 204, "DarkOrchid1", 191, 62, 255, "DarkOrchid2", 178, 58, 238, "DarkOrchid3", 154, 50, 205, "DarkOrchid4", 104, 34, 139, "DarkSalmon", 233, 150, 122, "DarkSeaGreen", 143, 188, 143, "DarkSeaGreen1", 193, 255, 193, "DarkSeaGreen2", 180, 238, 180, "DarkSeaGreen3", 155, 205, 155, "DarkSeaGreen4", 105, 139, 105, "DarkSlateBlue", 72, 61, 139, "DarkSlateGray", 47, 79, 79, "DarkSlateGray1", 151, 255, 255, "DarkSlateGray2", 141, 238, 238, "DarkSlateGray3", 121, 205, 205, "DarkSlateGray4", 82, 139, 139, "DarkSlateGrey", 47, 79, 79, "DarkTurquoise", 0, 206, 209, "DarkViolet", 148, 0, 211, "deep pink", 255, 20, 147, "deep sky blue", 0, 191, 255, "DeepPink", 255, 20, 147, "DeepPink1", 255, 20, 147, "DeepPink2", 238, 18, 137, "DeepPink3", 205, 16, 118, "DeepPink4", 139, 10, 80, "DeepSkyBlue", 0, 191, 255, "DeepSkyBlue1", 0, 191, 255, "DeepSkyBlue2", 0, 178, 238, "DeepSkyBlue3", 0, 154, 205, "DeepSkyBlue4", 0, 104, 139, "dim gray", 105, 105, 105, "dim grey", 105, 105, 105, "DimGray", 105, 105, 105, "DimGrey", 105, 105, 105, "dodger blue", 30, 144, 255, "DodgerBlue", 30, 144, 255, "DodgerBlue1", 30, 144, 255, "DodgerBlue2", 28, 134, 238, "DodgerBlue3", 24, 116, 205, "DodgerBlue4", 16, 78, 139, "firebrick", 178, 34, 34, "firebrick1", 255, 48, 48, "firebrick2", 238, 44, 44, "firebrick3", 205, 38, 38, "firebrick4", 139, 26, 26, "floral white", 255, 250, 240, "FloralWhite", 255, 250, 240, "forest green", 34, 139, 34, "ForestGreen", 34, 139, 34, "gainsboro", 220, 220, 220, "ghost white", 248, 248, 255, "GhostWhite", 248, 248, 255, "gold", 255, 215, 0, "gold1", 255, 215, 0, "gold2", 238, 201, 0, "gold3", 205, 173, 0, "gold4", 139, 117, 0, "goldenrod", 218, 165, 32, "goldenrod1", 255, 193, 37, "goldenrod2", 238, 180, 34, "goldenrod3", 205, 155, 29, "goldenrod4", 139, 105, 20, "gray", 190, 190, 190, "gray0", 0, 0, 0, "gray1", 3, 3, 3, "gray10", 26, 26, 26, "gray100", 255, 255, 255, "gray11", 28, 28, 28, "gray12", 31, 31, 31, "gray13", 33, 33, 33, "gray14", 36, 36, 36, "gray15", 38, 38, 38, "gray16", 41, 41, 41, "gray17", 43, 43, 43, "gray18", 46, 46, 46, "gray19", 48, 48, 48, "gray2", 5, 5, 5, "gray20", 51, 51, 51, "gray21", 54, 54, 54, "gray22", 56, 56, 56, "gray23", 59, 59, 59, "gray24", 61, 61, 61, "gray25", 64, 64, 64, "gray26", 66, 66, 66, "gray27", 69, 69, 69, "gray28", 71, 71, 71, "gray29", 74, 74, 74, "gray3", 8, 8, 8, "gray30", 77, 77, 77, "gray31", 79, 79, 79, "gray32", 82, 82, 82, "gray33", 84, 84, 84, "gray34", 87, 87, 87, "gray35", 89, 89, 89, "gray36", 92, 92, 92, "gray37", 94, 94, 94, "gray38", 97, 97, 97, "gray39", 99, 99, 99, "gray4", 10, 10, 10, "gray40", 102, 102, 102, "gray41", 105, 105, 105, "gray42", 107, 107, 107, "gray43", 110, 110, 110, "gray44", 112, 112, 112, "gray45", 115, 115, 115, "gray46", 117, 117, 117, "gray47", 120, 120, 120, "gray48", 122, 122, 122, "gray49", 125, 125, 125, "gray5", 13, 13, 13, "gray50", 127, 127, 127, "gray51", 130, 130, 130, "gray52", 133, 133, 133, "gray53", 135, 135, 135, "gray54", 138, 138, 138, "gray55", 140, 140, 140, "gray56", 143, 143, 143, "gray57", 145, 145, 145, "gray58", 148, 148, 148, "gray59", 150, 150, 150, "gray6", 15, 15, 15, "gray60", 153, 153, 153, "gray61", 156, 156, 156, "gray62", 158, 158, 158, "gray63", 161, 161, 161, "gray64", 163, 163, 163, "gray65", 166, 166, 166, "gray66", 168, 168, 168, "gray67", 171, 171, 171, "gray68", 173, 173, 173, "gray69", 176, 176, 176, "gray7", 18, 18, 18, "gray70", 179, 179, 179, "gray71", 181, 181, 181, "gray72", 184, 184, 184, "gray73", 186, 186, 186, "gray74", 189, 189, 189, "gray75", 191, 191, 191, "gray76", 194, 194, 194, "gray77", 196, 196, 196, "gray78", 199, 199, 199, "gray79", 201, 201, 201, "gray8", 20, 20, 20, "gray80", 204, 204, 204, "gray81", 207, 207, 207, "gray82", 209, 209, 209, "gray83", 212, 212, 212, "gray84", 214, 214, 214, "gray85", 217, 217, 217, "gray86", 219, 219, 219, "gray87", 222, 222, 222, "gray88", 224, 224, 224, "gray89", 227, 227, 227, "gray9", 23, 23, 23, "gray90", 229, 229, 229, "gray91", 232, 232, 232, "gray92", 235, 235, 235, "gray93", 237, 237, 237, "gray94", 240, 240, 240, "gray95", 242, 242, 242, "gray96", 245, 245, 245, "gray97", 247, 247, 247, "gray98", 250, 250, 250, "gray99", 252, 252, 252, "green", 0, 255, 0, "green yellow", 173, 255, 47, "green1", 0, 255, 0, "green2", 0, 238, 0, "green3", 0, 205, 0, "green4", 0, 139, 0, "GreenYellow", 173, 255, 47, "grey", 190, 190, 190, "grey0", 0, 0, 0, "grey1", 3, 3, 3, "grey10", 26, 26, 26, "grey100", 255, 255, 255, "grey11", 28, 28, 28, "grey12", 31, 31, 31, "grey13", 33, 33, 33, "grey14", 36, 36, 36, "grey15", 38, 38, 38, "grey16", 41, 41, 41, "grey17", 43, 43, 43, "grey18", 46, 46, 46, "grey19", 48, 48, 48, "grey2", 5, 5, 5, "grey20", 51, 51, 51, "grey21", 54, 54, 54, "grey22", 56, 56, 56, "grey23", 59, 59, 59, "grey24", 61, 61, 61, "grey25", 64, 64, 64, "grey26", 66, 66, 66, "grey27", 69, 69, 69, "grey28", 71, 71, 71, "grey29", 74, 74, 74, "grey3", 8, 8, 8, "grey30", 77, 77, 77, "grey31", 79, 79, 79, "grey32", 82, 82, 82, "grey33", 84, 84, 84, "grey34", 87, 87, 87, "grey35", 89, 89, 89, "grey36", 92, 92, 92, "grey37", 94, 94, 94, "grey38", 97, 97, 97, "grey39", 99, 99, 99, "grey4", 10, 10, 10, "grey40", 102, 102, 102, "grey41", 105, 105, 105, "grey42", 107, 107, 107, "grey43", 110, 110, 110, "grey44", 112, 112, 112, "grey45", 115, 115, 115, "grey46", 117, 117, 117, "grey47", 120, 120, 120, "grey48", 122, 122, 122, "grey49", 125, 125, 125, "grey5", 13, 13, 13, "grey50", 127, 127, 127, "grey51", 130, 130, 130, "grey52", 133, 133, 133, "grey53", 135, 135, 135, "grey54", 138, 138, 138, "grey55", 140, 140, 140, "grey56", 143, 143, 143, "grey57", 145, 145, 145, "grey58", 148, 148, 148, "grey59", 150, 150, 150, "grey6", 15, 15, 15, "grey60", 153, 153, 153, "grey61", 156, 156, 156, "grey62", 158, 158, 158, "grey63", 161, 161, 161, "grey64", 163, 163, 163, "grey65", 166, 166, 166, "grey66", 168, 168, 168, "grey67", 171, 171, 171, "grey68", 173, 173, 173, "grey69", 176, 176, 176, "grey7", 18, 18, 18, "grey70", 179, 179, 179, "grey71", 181, 181, 181, "grey72", 184, 184, 184, "grey73", 186, 186, 186, "grey74", 189, 189, 189, "grey75", 191, 191, 191, "grey76", 194, 194, 194, "grey77", 196, 196, 196, "grey78", 199, 199, 199, "grey79", 201, 201, 201, "grey8", 20, 20, 20, "grey80", 204, 204, 204, "grey81", 207, 207, 207, "grey82", 209, 209, 209, "grey83", 212, 212, 212, "grey84", 214, 214, 214, "grey85", 217, 217, 217, "grey86", 219, 219, 219, "grey87", 222, 222, 222, "grey88", 224, 224, 224, "grey89", 227, 227, 227, "grey9", 23, 23, 23, "grey90", 229, 229, 229, "grey91", 232, 232, 232, "grey92", 235, 235, 235, "grey93", 237, 237, 237, "grey94", 240, 240, 240, "grey95", 242, 242, 242, "grey96", 245, 245, 245, "grey97", 247, 247, 247, "grey98", 250, 250, 250, "grey99", 252, 252, 252, "honeydew", 240, 255, 240, "honeydew1", 240, 255, 240, "honeydew2", 224, 238, 224, "honeydew3", 193, 205, 193, "honeydew4", 131, 139, 131, "hot pink", 255, 105, 180, "HotPink", 255, 105, 180, "HotPink1", 255, 110, 180, "HotPink2", 238, 106, 167, "HotPink3", 205, 96, 144, "HotPink4", 139, 58, 98, "indian red", 205, 92, 92, "IndianRed", 205, 92, 92, "IndianRed1", 255, 106, 106, "IndianRed2", 238, 99, 99, "IndianRed3", 205, 85, 85, "IndianRed4", 139, 58, 58, "ivory", 255, 255, 240, "ivory1", 255, 255, 240, "ivory2", 238, 238, 224, "ivory3", 205, 205, 193, "ivory4", 139, 139, 131, "khaki", 240, 230, 140, "khaki1", 255, 246, 143, "khaki2", 238, 230, 133, "khaki3", 205, 198, 115, "khaki4", 139, 134, 78, "lavender", 230, 230, 250, "lavender blush", 255, 240, 245, "LavenderBlush", 255, 240, 245, "LavenderBlush1", 255, 240, 245, "LavenderBlush2", 238, 224, 229, "LavenderBlush3", 205, 193, 197, "LavenderBlush4", 139, 131, 134, "lawn green", 124, 252, 0, "LawnGreen", 124, 252, 0, "lemon chiffon", 255, 250, 205, "LemonChiffon", 255, 250, 205, "LemonChiffon1", 255, 250, 205, "LemonChiffon2", 238, 233, 191, "LemonChiffon3", 205, 201, 165, "LemonChiffon4", 139, 137, 112, "light blue", 173, 216, 230, "light coral", 240, 128, 128, "light cyan", 224, 255, 255, "light goldenrod", 238, 221, 130, "light goldenrod yellow", 250, 250, 210, "light gray", 211, 211, 211, "light grey", 211, 211, 211, "light pink", 255, 182, 193, "light salmon", 255, 160, 122, "light sea green", 32, 178, 170, "light sky blue", 135, 206, 250, "light slate blue", 132, 112, 255, "light slate gray", 119, 136, 153, "light slate grey", 119, 136, 153, "light steel blue", 176, 196, 222, "light yellow", 255, 255, 224, "LightBlue", 173, 216, 230, "LightBlue1", 191, 239, 255, "LightBlue2", 178, 223, 238, "LightBlue3", 154, 192, 205, "LightBlue4", 104, 131, 139, "LightCoral", 240, 128, 128, "LightCyan", 224, 255, 255, "LightCyan1", 224, 255, 255, "LightCyan2", 209, 238, 238, "LightCyan3", 180, 205, 205, "LightCyan4", 122, 139, 139, "LightGoldenrod", 238, 221, 130, "LightGoldenrod1", 255, 236, 139, "LightGoldenrod2", 238, 220, 130, "LightGoldenrod3", 205, 190, 112, "LightGoldenrod4", 139, 129, 76, "LightGoldenrodYellow", 250, 250, 210, "LightGray", 211, 211, 211, "LightGrey", 211, 211, 211, "LightPink", 255, 182, 193, "LightPink1", 255, 174, 185, "LightPink2", 238, 162, 173, "LightPink3", 205, 140, 149, "LightPink4", 139, 95, 101, "LightSalmon", 255, 160, 122, "LightSalmon1", 255, 160, 122, "LightSalmon2", 238, 149, 114, "LightSalmon3", 205, 129, 98, "LightSalmon4", 139, 87, 66, "LightSeaGreen", 32, 178, 170, "LightSkyBlue", 135, 206, 250, "LightSkyBlue1", 176, 226, 255, "LightSkyBlue2", 164, 211, 238, "LightSkyBlue3", 141, 182, 205, "LightSkyBlue4", 96, 123, 139, "LightSlateBlue", 132, 112, 255, "LightSlateGray", 119, 136, 153, "LightSlateGrey", 119, 136, 153, "LightSteelBlue", 176, 196, 222, "LightSteelBlue1", 202, 225, 255, "LightSteelBlue2", 188, 210, 238, "LightSteelBlue3", 162, 181, 205, "LightSteelBlue4", 110, 123, 139, "LightYellow", 255, 255, 224, "LightYellow1", 255, 255, 224, "LightYellow2", 238, 238, 209, "LightYellow3", 205, 205, 180, "LightYellow4", 139, 139, 122, "lime green", 50, 205, 50, "LimeGreen", 50, 205, 50, "linen", 250, 240, 230, "magenta", 255, 0, 255, "magenta1", 255, 0, 255, "magenta2", 238, 0, 238, "magenta3", 205, 0, 205, "magenta4", 139, 0, 139, "maroon", 176, 48, 96, "maroon1", 255, 52, 179, "maroon2", 238, 48, 167, "maroon3", 205, 41, 144, "maroon4", 139, 28, 98, "medium aquamarine", 102, 205, 170, "medium blue", 0, 0, 205, "medium orchid", 186, 85, 211, "medium purple", 147, 112, 219, "medium sea green", 60, 179, 113, "medium slate blue", 123, 104, 238, "medium spring green", 0, 250, 154, "medium turquoise", 72, 209, 204, "medium violet red", 199, 21, 133, "MediumAquamarine", 102, 205, 170, "MediumBlue", 0, 0, 205, "MediumOrchid", 186, 85, 211, "MediumOrchid1", 224, 102, 255, "MediumOrchid2", 209, 95, 238, "MediumOrchid3", 180, 82, 205, "MediumOrchid4", 122, 55, 139, "MediumPurple", 147, 112, 219, "MediumPurple1", 171, 130, 255, "MediumPurple2", 159, 121, 238, "MediumPurple3", 137, 104, 205, "MediumPurple4", 93, 71, 139, "MediumSeaGreen", 60, 179, 113, "MediumSlateBlue", 123, 104, 238, "MediumSpringGreen", 0, 250, 154, "MediumTurquoise", 72, 209, 204, "MediumVioletRed", 199, 21, 133, "midnight blue", 25, 25, 112, "MidnightBlue", 25, 25, 112, "mint cream", 245, 255, 250, "MintCream", 245, 255, 250, "misty rose", 255, 228, 225, "MistyRose", 255, 228, 225, "MistyRose1", 255, 228, 225, "MistyRose2", 238, 213, 210, "MistyRose3", 205, 183, 181, "MistyRose4", 139, 125, 123, "moccasin", 255, 228, 181, "navajo white", 255, 222, 173, "NavajoWhite", 255, 222, 173, "NavajoWhite1", 255, 222, 173, "NavajoWhite2", 238, 207, 161, "NavajoWhite3", 205, 179, 139, "NavajoWhite4", 139, 121, 94, "navy", 0, 0, 128, "navy blue", 0, 0, 128, "NavyBlue", 0, 0, 128, "old lace", 253, 245, 230, "OldLace", 253, 245, 230, "olive drab", 107, 142, 35, "OliveDrab", 107, 142, 35, "OliveDrab1", 192, 255, 62, "OliveDrab2", 179, 238, 58, "OliveDrab3", 154, 205, 50, "OliveDrab4", 105, 139, 34, "orange", 255, 165, 0, "orange red", 255, 69, 0, "orange1", 255, 165, 0, "orange2", 238, 154, 0, "orange3", 205, 133, 0, "orange4", 139, 90, 0, "OrangeRed", 255, 69, 0, "OrangeRed1", 255, 69, 0, "OrangeRed2", 238, 64, 0, "OrangeRed3", 205, 55, 0, "OrangeRed4", 139, 37, 0, "orchid", 218, 112, 214, "orchid1", 255, 131, 250, "orchid2", 238, 122, 233, "orchid3", 205, 105, 201, "orchid4", 139, 71, 137, "pale goldenrod", 238, 232, 170, "pale green", 152, 251, 152, "pale turquoise", 175, 238, 238, "pale violet red", 219, 112, 147, "PaleGoldenrod", 238, 232, 170, "PaleGreen", 152, 251, 152, "PaleGreen1", 154, 255, 154, "PaleGreen2", 144, 238, 144, "PaleGreen3", 124, 205, 124, "PaleGreen4", 84, 139, 84, "PaleTurquoise", 175, 238, 238, "PaleTurquoise1", 187, 255, 255, "PaleTurquoise2", 174, 238, 238, "PaleTurquoise3", 150, 205, 205, "PaleTurquoise4", 102, 139, 139, "PaleVioletRed", 219, 112, 147, "PaleVioletRed1", 255, 130, 171, "PaleVioletRed2", 238, 121, 159, "PaleVioletRed3", 205, 104, 137, "PaleVioletRed4", 139, 71, 93, "papaya whip", 255, 239, 213, "PapayaWhip", 255, 239, 213, "peach puff", 255, 218, 185, "PeachPuff", 255, 218, 185, "PeachPuff1", 255, 218, 185, "PeachPuff2", 238, 203, 173, "PeachPuff3", 205, 175, 149, "PeachPuff4", 139, 119, 101, "peru", 205, 133, 63, "pink", 255, 192, 203, "pink1", 255, 181, 197, "pink2", 238, 169, 184, "pink3", 205, 145, 158, "pink4", 139, 99, 108, "plum", 221, 160, 221, "plum1", 255, 187, 255, "plum2", 238, 174, 238, "plum3", 205, 150, 205, "plum4", 139, 102, 139, "powder blue", 176, 224, 230, "PowderBlue", 176, 224, 230, "purple", 160, 32, 240, "purple1", 155, 48, 255, "purple2", 145, 44, 238, "purple3", 125, 38, 205, "purple4", 85, 26, 139, "red", 255, 0, 0, "red1", 255, 0, 0, "red2", 238, 0, 0, "red3", 205, 0, 0, "red4", 139, 0, 0, "rosy brown", 188, 143, 143, "RosyBrown", 188, 143, 143, "RosyBrown1", 255, 193, 193, "RosyBrown2", 238, 180, 180, "RosyBrown3", 205, 155, 155, "RosyBrown4", 139, 105, 105, "royal blue", 65, 105, 225, "RoyalBlue", 65, 105, 225, "RoyalBlue1", 72, 118, 255, "RoyalBlue2", 67, 110, 238, "RoyalBlue3", 58, 95, 205, "RoyalBlue4", 39, 64, 139, "saddle brown", 139, 69, 19, "SaddleBrown", 139, 69, 19, "salmon", 250, 128, 114, "salmon1", 255, 140, 105, "salmon2", 238, 130, 98, "salmon3", 205, 112, 84, "salmon4", 139, 76, 57, "sandy brown", 244, 164, 96, "SandyBrown", 244, 164, 96, "sea green", 46, 139, 87, "SeaGreen", 46, 139, 87, "SeaGreen1", 84, 255, 159, "SeaGreen2", 78, 238, 148, "SeaGreen3", 67, 205, 128, "SeaGreen4", 46, 139, 87, "seashell", 255, 245, 238, "seashell1", 255, 245, 238, "seashell2", 238, 229, 222, "seashell3", 205, 197, 191, "seashell4", 139, 134, 130, "sienna", 160, 82, 45, "sienna1", 255, 130, 71, "sienna2", 238, 121, 66, "sienna3", 205, 104, 57, "sienna4", 139, 71, 38, "sky blue", 135, 206, 235, "SkyBlue", 135, 206, 235, "SkyBlue1", 135, 206, 255, "SkyBlue2", 126, 192, 238, "SkyBlue3", 108, 166, 205, "SkyBlue4", 74, 112, 139, "slate blue", 106, 90, 205, "slate gray", 112, 128, 144, "slate grey", 112, 128, 144, "SlateBlue", 106, 90, 205, "SlateBlue1", 131, 111, 255, "SlateBlue2", 122, 103, 238, "SlateBlue3", 105, 89, 205, "SlateBlue4", 71, 60, 139, "SlateGray", 112, 128, 144, "SlateGray1", 198, 226, 255, "SlateGray2", 185, 211, 238, "SlateGray3", 159, 182, 205, "SlateGray4", 108, 123, 139, "SlateGrey", 112, 128, 144, "snow", 255, 250, 250, "snow1", 255, 250, 250, "snow2", 238, 233, 233, "snow3", 205, 201, 201, "snow4", 139, 137, 137, "spring green", 0, 255, 127, "SpringGreen", 0, 255, 127, "SpringGreen1", 0, 255, 127, "SpringGreen2", 0, 238, 118, "SpringGreen3", 0, 205, 102, "SpringGreen4", 0, 139, 69, "steel blue", 70, 130, 180, "SteelBlue", 70, 130, 180, "SteelBlue1", 99, 184, 255, "SteelBlue2", 92, 172, 238, "SteelBlue3", 79, 148, 205, "SteelBlue4", 54, 100, 139, "tan", 210, 180, 140, "tan1", 255, 165, 79, "tan2", 238, 154, 73, "tan3", 205, 133, 63, "tan4", 139, 90, 43, "thistle", 216, 191, 216, "thistle1", 255, 225, 255, "thistle2", 238, 210, 238, "thistle3", 205, 181, 205, "thistle4", 139, 123, 139, "tomato", 255, 99, 71, "tomato1", 255, 99, 71, "tomato2", 238, 92, 66, "tomato3", 205, 79, 57, "tomato4", 139, 54, 38, "turquoise", 64, 224, 208, "turquoise1", 0, 245, 255, "turquoise2", 0, 229, 238, "turquoise3", 0, 197, 205, "turquoise4", 0, 134, 139, "violet", 238, 130, 238, "violet red", 208, 32, 144, "VioletRed", 208, 32, 144, "VioletRed1", 255, 62, 150, "VioletRed2", 238, 58, 140, "VioletRed3", 205, 50, 120, "VioletRed4", 139, 34, 82, "wheat", 245, 222, 179, "wheat1", 255, 231, 186, "wheat2", 238, 216, 174, "wheat3", 205, 186, 150, "wheat4", 139, 126, 102, "white", 255, 255, 255, "white smoke", 245, 245, 245, "WhiteSmoke", 245, 245, 245, "yellow", 255, 255, 0, "yellow green", 154, 205, 50, "yellow1", 255, 255, 0, "yellow2", 238, 238, 0, "yellow3", 205, 205, 0, "yellow4", 139, 139, 0, "YellowGreen", 154, 205, 50, NULL, 0, 0, 0 }; /* * This value will be set to the number of colors in the color table * the first time it is needed. */ static int numXColors = 0; /* * Forward declarations for functions used only in this file. */ static int FindColor(const char *name, XColor *colorPtr); int strcasecmp(const char *a, const char *b) { int i=0,c; if((a==NULL)||(b==NULL)) return -1; while(((!(c=toupper(a[i])-toupper(b[i])))&&a[i]&&b[i])) i++; return c; } /* *---------------------------------------------------------------------- * * FindColor -- * * This routine finds the color entry that corresponds to the * specified color. * * Results: * Returns non-zero on success. The RGB values of the XColor * will be initialized to the proper values on success. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int FindColor(name, colorPtr) const char *name; XColor *colorPtr; { int l, u, r, i; /* * Count the number of elements in the color array if we haven't * done so yet. */ if (numXColors == 0) { XColorEntry *ePtr; for (ePtr = xColors; ePtr->name != NULL; ePtr++) { numXColors++; } } /* * Perform a binary search on the sorted array of colors. */ l = 0; u = numXColors - 1; while (l <= u) { i = (l + u) / 2; r = strcasecmp(name, xColors[i].name); if (r == 0) { break; } else if (r < 0) { u = i-1; } else { l = i+1; } } if (l > u) { return 0; } colorPtr->red = xColors[i].red << 8; colorPtr->green = xColors[i].green << 8; colorPtr->blue = xColors[i].blue << 8; return 1; } /* *---------------------------------------------------------------------- * * XParseColor -- * * Partial implementation of X color name parsing interface. * * Results: * Returns non-zero on success. * * Side effects: * None. * *---------------------------------------------------------------------- */ StatusDef XParseColor(display, map, spec, colorPtr) Display *display; Colormap map; const char* spec; XColor *colorPtr; { if (spec[0] == '#') { char fmt[16]; int i, red, green, blue; if ((i = strlen(spec+1))%3) { return 0; } i /= 3; sprintf(fmt, "%%%dx%%%dx%%%dx", i, i, i); if (sscanf(spec+1, fmt, &red, &green, &blue) != 3) { return 0; } colorPtr->red = ((unsigned short) red) << (4 * (4 - i)); colorPtr->green = ((unsigned short) green) << (4 * (4 - i)); colorPtr->blue = ((unsigned short) blue) << (4 * (4 - i)); } else { if (!FindColor(spec, colorPtr)) { return 0; } } colorPtr->pixel = ((colorPtr->red)>>8)&0xff; colorPtr->flags = DoRed|DoGreen|DoBlue; colorPtr->pad = 0; return 1; } /** xpm support */ int XFreeColors(display, cmap, pixels, npixels, planes) Display *display; Colormap cmap; unsigned long pixels[]; int npixels; unsigned long planes; { return 0; } int XGrabServer(display) Display *display; { return 0; } int XUngrabServer(display) Display *display; { return 0; } #endif rxvt-2.7.10/W11/w32/ntutil.c010064400001440000024000000211240757331033100137070ustar gcwstaff#include "ntdef.h" static struct NT_window *window_list=NULL; void freeMemory(void *p) { if (p!=NULL) free(p); } void * allocateMemory(int s) { void *p=NULL; if (s) { p=(void *)malloc(s); if (p) memset(p,0,s); } return p; } /*---------------------------------------------------*\ | Function: NT_new_window | | Purpose: Add a new window id to the Window table | | Return: Pointer to the new Window structure. | \*---------------------------------------------------*/ struct NT_window * NT_new_window() { struct NT_window *new; xtrace("NT_new_window\n"); new = (struct NT_window *) allocateMemory (sizeof(struct NT_window)); new->next = window_list; new->child=NULL; new->min = 1; new->minx =0; new->miny =0; new->w = INVALID_HANDLE; new->parent= NULL; new->hBitmap = INVALID_HANDLE; new->hDC = INVALID_HANDLE; window_list = new; cjh_printf("NEW window %x\n",window_list); return(window_list); } /*---------------------------------------------------*\ | Function: NT_delete_window | | Purpose: Remove a window from the window list | | Input: w - pointer to window data | | Return: TRUE if deleted | \*---------------------------------------------------*/ int NT_delete_window(struct NT_window *w) { NT_window *f; xtrace("NT_delete_window\n"); if (w->w != INVALID_HANDLE) { /* ShowWindow(w->w,SW_HIDE);*/ DestroyWindow(w->w); w->w=INVALID_HANDLE; } if (w->hBitmap != INVALID_HANDLE) { DeleteObject(w->hBitmap); w->hBitmap = INVALID_HANDLE; } if (w->hDC != INVALID_HANDLE) { DeleteDC(w->hDC); w->hDC=INVALID_HANDLE; } if (window_list == w) window_list=w->next; else { for (f=window_list; f!=NULL && f->next!=w; f=f->next); if (f!=NULL) f->next = w->next; } freeMemory(w); return TRUE; } /*------------------------------------------------*\ | Function: NT_find_window_from_id | | Purpose: Find the window in the window list | | from the HWND id of the window. | | Input: w - Window id (Windows HWND) | | Return: pointer to NT_window structure for w. | \*------------------------------------------------*/ struct NT_window * NT_find_window_from_id(HWND w) { struct NT_window *current = window_list; /* xtrace("NT_find_window_from_id\n"); */ while ( current != NULL && current->w != w ) current = current->next; if(current) return(current); current=window_list; return NULL; } /*****************************************************************\ Function: NT_add_child Inputs: parent and child window IDs. Returned: 1 Comments: When a child window is created (eg. client canvas) we update our internal list of windows and their children. New children are added to the front of the list. \*****************************************************************/ int NT_add_child(parent,child) NT_window *parent,*child; { struct NT_child *new; new=(struct NT_child *) allocateMemory (sizeof(struct NT_child)); new->w=child; new->next = parent->child; parent->child=new; return(1); } struct NT_window * NT_find_child(NT_window *w,unsigned long mask, unsigned long val) { struct NT_window *ret = NULL; struct NT_child *child = NULL; if (w) { if ((w->mask&mask)==val) ret=w; child = w->child; while(!ret && child) { ret = NT_find_child(child->w, mask, val); child=child->next; } } return ret; } /*****************************************************************\ Function: NT_del_child Inputs: parent and child window IDs. Returned: TRUE if window is removed, FALSE otherwise. Comments: Finds child window if it exits, and it so removes it from the window list. \*****************************************************************/ int NT_del_child(parent,child) struct NT_window *parent; struct NT_window *child; { struct NT_child *current,*last; int status=FALSE; if (parent->child==NULL) { } else if (parent->child->w==child) { current = parent->child; parent->child=parent->child->next; freeMemory(current); status=TRUE; } else { last=parent->child; current=parent->child->next; while (current->w!=child && current!=NULL) { last=current; current=current->next; } if (current!=NULL) { last->next=current->next; freeMemory(current); status=TRUE; } } return(status); } /*****************************************************************\ Function: WinMain Inputs: instance, previous instance, command line arguments, default start up. Comments: Called instead of main() as the execution entry point. \*****************************************************************/ #ifdef NOTCYGWIN #define MAX_COMMAND_ARGS 20 static HANDLE hInstance,hPrevInstance; int APIENTRY WinMain(HINSTANCE hInst,HINSTANCE hPrevInst,LPSTR lpCmdLine,int nCmdShow) { static char *command_args[MAX_COMMAND_ARGS]; static int num_command_args; static char proEng[] = "proe"; char *wordPtr,*tempPtr; int i,quote; hInstance=hInst; hPrevInstance=hPrevInst; for (i=0;iw, ntw->x,ntw->y,ntw->wdth,ntw->hght,repaint); NT_configureNotify(ntw,ntw->x,ntw->y); } NT_set_origin(NT_window *ntw,int x, int y) { HDC hdc; hdc = GetDC(ntw->w); SetBrushOrgEx(hdc,-x,-y,NULL); ReleaseDC(ntw->w,hdc); } NT_confChild(NT_window *ntw,int x, int y) { HDC hdc; struct NT_child *child = NULL; if (ntw) { if (ntw->parentRelative) NT_set_origin(ntw,x,y); child = ntw->child; while(child && child->w) { NT_confChild(child->w, child->w->x+x, child->w->y+y); child=child->next; } } } NT_configureNotify(NT_window *ntw,int x, int y) { while(ntw && ntw->parent) { ntw=ntw->parent; } NT_confChild(ntw,ntw->x,ntw->y); } /* HBITMAP NT_getWallpaper() { WCHAR wszWallpaper [MAX_PATH]; CHAR szWallpaper[MAX_PATH]; HRESULT hr; HBITMAP hb = NULL; IActiveDesktop* pIAD = NULL; do { CoInitialize ( NULL ); hr = CoCreateInstance ( CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER, IID_IActiveDesktop, (void**) &pIAD ); if (! SUCCEEDED(hr) ) break; hr = pIAD->GetWallpaper ( wszWallpaper, MAX_PATH, 0 ); if (! SUCCEEDED(hr) ) break; wsprintf(szWallpaper,"%ls",wszWallpaper); hb = LoadImage(NULL, szWallpaper, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE ); } while(0); if (pIAD) pIAD->Release(); CoUninitialize(); return hb; } */ rxvt-2.7.10/W11/w32/ntdef.h010064400001440000024000000037500757331033100135020ustar gcwstaff #ifndef __NTDEF #define __NTDEF #include #define INVALID_HANDLE ((HANDLE) -2) #define NONMAPPED_HANDLE ((HANDLE) -3) #define VALID_WINDOW(x) (x && (((NT_window *)x)->w != INVALID_HANDLE)) #define xtrace #define cjh_printf #define CNUMTORGB(x) x /* #define printf(x) *//* x */ /* #define SetSystemPaletteUse(x) *//* x */ /* Windows NT Special event aliases */ #define USR_MapNotify 0x0401 #define USR_EnterNotify 0x0402 #define USR_LeaveNotify 0x0403 #define USR_Expose 0x0404 #define USR_ResizeRequest 0x0405 #define USR_WakeUp 0x0406 #define USR_ConvertSelection 0x0407 struct NT_child { struct NT_window *w; struct NT_child *next; } NT_child; typedef struct NT_window { HWND w; HBRUSH bg; int parentRelative; struct NT_window *parent; /* parent of this window */ struct NT_window *next; /* next window in list */ struct NT_child *child; /* points to list of children */ int x, y; /* Position */ unsigned int wdth, hght; /* Dimensions */ char *title_text; struct NT_prop_list *props; /* linked list of properties.*/ HDC hDC; HBITMAP hBitmap; int min; int minx, miny; /* minimum window size */ int top_flag; long mask; /* selectInputMask */ } NT_window; /* Routine declarations */ struct NT_window *NT_find_window_from_id(); int NT_delete_window(); struct NT_window *NT_new_window(); int NT_add_child(NT_window *parent,NT_window *child); struct NT_window *NT_find_child(NT_window *w,unsigned long mask, unsigned long val); int NT_del_child(NT_window *parent,NT_window *child); void freeMemory(void *p); void *allocateMemory(int s); void initQ(); void catchNextDestroyClipboard(); void NT_SetAtom(ATOM class); HWND NT_create_window(char *title,DWORD style,int x,int y,int w, int h,HWND parent); LONG NT_handleMsg(HWND hWnd,UINT message,UINT wParam,LONG lParam); HBITMAP NT_getWallpaper(); void NT_moveWindow(NT_window *ntw, BOOL repaint); #endif rxvt-2.7.10/W11/w32/event.c010064400001440000024000000600610760200340700135100ustar gcwstaff #include #include #include #include "ntdef.h" /* a crude method to avoid losing the selection when calling EmptyClipboard, which is necessary to do every time the selection content changes, otherwise windows apps use a cached copy of the selection */ static volatile int destroyClipboardCatcher = 0; static NT_window *NT_CWIN = NULL; void catchNextDestroyClipboard() { destroyClipboardCatcher=1; } typedef struct WinEvent_ { NT_window *window; UINT message; UINT wParam; LONG lParam; } WinEvent; #define W11_QSIZE 100 typedef struct WinEventQ_ { int num; int avail; int next; int count; int dispatch; proto_W11EventHandler *handler; WinEvent list[W11_QSIZE]; } WinEventQ; static WinEventQ *wineventq = NULL; void initQ() { int i; WinEventQ *q = (WinEventQ *)allocateMemory(sizeof(WinEventQ)); q->num=W11_QSIZE-1; q->avail=0; q->next=0; q->count=0; q->dispatch=0; q->handler=NULL; for (i=0; ilist[i].message=0; q->list[i].window = NULL; } wineventq = q; } static int getQdEvent(WinEventQ *q, XEvent *ev) { WinEvent we; if (q->count<=0) { cjh_printf("Queue is empty\n"); return 0; } we = q->list[q->next]; WinEventToXEvent(&we,ev); q->next++; q->count--; if (q->next>q->num) q->next=0; return 1; } static void QSendEvent(WinEventQ *q) { XEvent e; if (q->handler != NULL) { if (getQdEvent(q,&e)) (q->handler)(&e); } } static int QEvent(WinEventQ *q, NT_window *window,UINT message,UINT wParam,LONG lParam) { q->list[q->avail].window=window; q->list[q->avail].message=message; q->list[q->avail].wParam=wParam; q->list[q->avail].lParam=lParam; q->avail++; q->count++; if (q->avail>q->num) q->avail=0; if (q->dispatch) QSendEvent(q); return 1; } /* Allow application to install an event handler call back. This will make some actions such as moving the window work better. The event handler should look like: void process_xevent(XEvent *ev) { } To install it: W11AddEventHandler(display,process_xevent); The specific problem is that calling DefWindowProc() in response to a WM_SYSCOMMAND will cause windows to run its own event loop waiting for the mouse up event. The application therefore cannot rely on it's main event loop to get run for each event. Without running multiple threads, or setjmp, there is little recourse for alerting the application in the traditional X manner to Expose events while the window is being moved. */ void W11AddEventHandler(Display *d, proto_W11EventHandler *ev) { wineventq->handler = ev; } static void doTranslateMessage(MSG *m) { if ((m->message == WM_KEYDOWN) && ((m->wParam == VK_BACK) || (m->wParam == VK_ADD) || (m->wParam == VK_SUBTRACT))) return; if ((m->message == WM_SYSKEYDOWN) && (m->wParam == VK_F10)) { m->message = WM_KEYDOWN; return; } TranslateMessage(m); } static LONG NT_default(HWND hWnd,UINT message,UINT wParam,LONG lParam) { return DefWindowProc(hWnd, message, wParam, lParam); } static void NT_wakeup(HWND hWnd) { PostMessage(hWnd,USR_WakeUp,0,0L); } /*****************************************************************\ Function: MainWndProc Inputs: Window handle, message, message parameters. Comments: This is called when messages are sent to the application but not to the application's message queue. If an event can be processed, it is done here. The equivalent XEvent is filled out in l_event, which is picked up in the X event routines. Some events are not received from Windows, eg Enter/LeaveNotify, so these are made up as required. Caution: The application does not see HWND, but Window. \*****************************************************************/ /* queued messages WM_KEYDOWN WM_KEYUP WM_CHAR WM_MOUSEMOVE WM_BUTTONxx WM_TIMER WM_PAINT WM_QUIT */ LONG NT_handleMsg( HWND hWnd, /* window handle */ UINT message, /* type of message */ UINT wParam, /* additional information */ LONG lParam) /* additional information */ { RECT rect; WINDOWPOS *posStruct; unsigned long int st=0L; NT_window *window; long mask; PAINTSTRUCT paintStruct; /* if (message == WM_CLOSE) exit(0); */ window = NT_find_window_from_id(hWnd); if (window == NULL) return (NT_default(hWnd, message, wParam, lParam)); mask = window->mask; switch (message) { /* we'll handle these, later */ case WM_KILLFOCUS: QEvent(wineventq,window,message,wParam,lParam); NT_wakeup(hWnd); break; case WM_SETFOCUS: case WM_QUIT: case WM_CLOSE: case WM_DESTROY: case WM_SYSCHAR: /* alt-keys go here */ case WM_CHAR: case WM_LBUTTONDBLCLK: case WM_MBUTTONDBLCLK: case WM_RBUTTONDBLCLK: case USR_MapNotify: case USR_EnterNotify: case WM_MOVE: #if defined(WIN9X) case WM_SIZING: #endif case WM_SIZE: QEvent(wineventq,window,message,wParam,lParam); break; case WM_DESTROYCLIPBOARD: if (destroyClipboardCatcher) destroyClipboardCatcher=0; else { QEvent(wineventq,window,message,wParam,lParam); NT_wakeup(hWnd); } break; case WM_PAINT: BeginPaint(hWnd,&paintStruct); FillRect(paintStruct.hdc, &paintStruct.rcPaint,window->bg); QEvent(wineventq,window,message, (((paintStruct.rcPaint.right-paintStruct.rcPaint.left)&0xffff) | (((paintStruct.rcPaint.bottom-paintStruct.rcPaint.top)&0xffff)<<16)), (((paintStruct.rcPaint.left)&0xffff) | (((paintStruct.rcPaint.top)&0xffff)<<16))); EndPaint(hWnd,&paintStruct); break; /* capture the mouse on button down to emulate x */ case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: SetCapture(hWnd); QEvent(wineventq,window,message,wParam,lParam); break; case WM_MBUTTONUP: case WM_LBUTTONUP: case WM_RBUTTONUP: ReleaseCapture(); QEvent(wineventq,window,message,wParam,lParam); break; case WM_MOUSEMOVE: if ((mask&PointerMotionMask) || ((mask&Button1MotionMask)&& (wParam&MK_LBUTTON)) || ((mask&Button2MotionMask)&& (wParam&MK_MBUTTON)) || ((mask&Button3MotionMask)&& (wParam&MK_RBUTTON)) || ((mask&ButtonMotionMask)&&((wParam&(MK_LBUTTON|MK_MBUTTON|MK_RBUTTON)))) ) QEvent(wineventq,window,message,wParam,lParam); else return (NT_default(hWnd, message, wParam, lParam)); break; case WM_MOUSEWHEEL: /* this event only seems to go to the top most window. see if child windows accept it. */ window = NT_find_child(window,ButtonPressMask|Button2MotionMask|Button3MotionMask, ButtonPressMask|Button3MotionMask ); if (window && ((window->mask)&ButtonPressMask)) QEvent(wineventq,window,message,wParam,lParam); else return (NT_default(hWnd, message, wParam, lParam)); break; case WM_ERASEBKGND: /* don't erase the background */ return 1; break; case WM_SYSCOMMAND: wineventq->dispatch++; NT_default(hWnd, message, wParam, lParam); wineventq->dispatch--; break; case WM_KEYDOWN: switch (wParam) { case VK_CANCEL: case VK_CLEAR: case VK_PAUSE: case VK_PRIOR: case VK_NEXT: case VK_END: case VK_HOME: case VK_LEFT: case VK_UP: case VK_RIGHT: case VK_DOWN: case VK_SELECT: case VK_PRINT: case VK_EXECUTE: case VK_INSERT: case VK_DELETE: case VK_HELP: case VK_NUMLOCK: case VK_SCROLL: case VK_BACK: case VK_F1: case VK_F2: case VK_F3: case VK_F4: case VK_F5: case VK_F6: case VK_F7: case VK_F8: case VK_F9: case VK_F10: case VK_F11: case VK_F12: case VK_ADD: case VK_SUBTRACT: QEvent(wineventq,window,message,wParam,lParam); break; default: return (NT_default(hWnd, message, wParam, lParam)); break; } break; default: /* Passes it on if unproccessed */ return (NT_default(hWnd, message, wParam, lParam)); } return 0L; } /*****************************************************************\ Function: NT_get_state Inputs: Comments: Get the keyboard state \*****************************************************************/ static unsigned int NT_get_state() { unsigned int state = 0; if (GetKeyState(VK_SHIFT) & 0x8000) state |= ShiftMask; if (GetKeyState(VK_CONTROL) & 0x8000) { if (!(GetKeyState(VK_MENU) & 0x8000)) state |= ControlMask; } else if (GetKeyState(VK_MENU) & 0x8000) state |= Mod1Mask; if (GetKeyState(VK_CAPITAL) & 0x0001) state |= LockMask; if (GetKeyState(VK_NUMLOCK) & 0x0001) state |= Mod5Mask; if (GetKeyState(VK_SCROLL) & 0x0001) state |= Mod3Mask; if (GetKeyState(VK_LBUTTON) & 0x8000) state |= Button1Mask; if (GetKeyState(VK_MBUTTON) & 0x8000) state |= Button2Mask; if (GetKeyState(VK_RBUTTON) & 0x8000) state |= Button3Mask; return state; } int WinEventToXEvent( WinEvent *we, XEvent *event) { POINT pt; RECT rect; unsigned long int st=0L; UINT key; HWND hWnd; UINT wParam; LONG lParam; NT_window *window; do { if (event==NULL) break; if (we == NULL) break; window = we->window; wParam = we->wParam; lParam = we->lParam; event->type=-1; event->xbutton.subwindow = None; hWnd = window->w; switch (we->message) { case WM_SETFOCUS: event->type=FocusIn; event->xfocus.window=(Window)window; break; case WM_KILLFOCUS: event->type=FocusOut; event->xfocus.window=(Window)window; break; /* case WM_ERASEBKGND: */ case WM_PAINT: event->type=Expose; event->xexpose.x=LOWORD(lParam); /* right */ event->xexpose.y=HIWORD(lParam); /* top */ event->xexpose.width=LOWORD(wParam); event->xexpose.height=HIWORD(wParam); event->xexpose.count=0; event->xexpose.window=(Window)window; break; case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK: event->type = ButtonPress; event->xbutton.x = LOWORD (lParam); event->xbutton.y = HIWORD (lParam); if ( wParam & MK_SHIFT ) event->xbutton.button=Button2; else event->xbutton.button=Button1; event->xbutton.window = (Window)window; event->xbutton.time=GetTickCount(); break; case WM_LBUTTONUP: event->type=ButtonRelease; event->xbutton.x=LOWORD(lParam); event->xbutton.y=HIWORD (lParam); if ( wParam & MK_SHIFT ) event->xbutton.button=Button2; else event->xbutton.button=Button1; event->xbutton.window=(Window)window; event->xbutton.time=GetTickCount(); break; case WM_MBUTTONDOWN: case WM_MBUTTONDBLCLK: event->type=ButtonPress; event->xbutton.x=LOWORD(lParam); event->xbutton.y=HIWORD (lParam); event->xbutton.button=Button2; event->xbutton.window=(Window)window; event->xbutton.time=GetTickCount(); break; case WM_MBUTTONUP: event->type=ButtonRelease; event->xbutton.x=LOWORD(lParam); event->xbutton.y=HIWORD (lParam); event->xbutton.button=Button2; event->xbutton.window=(Window)window; event->xbutton.time=GetTickCount(); break; case WM_RBUTTONDOWN: case WM_RBUTTONDBLCLK: event->type=ButtonPress; event->xbutton.x=LOWORD(lParam); event->xbutton.y=HIWORD (lParam); event->xbutton.button=Button3; event->xbutton.window=(Window)window; event->xbutton.time=GetTickCount(); break; case WM_RBUTTONUP: event->type=ButtonRelease; event->xbutton.x=LOWORD(lParam); event->xbutton.y=HIWORD (lParam); event->xbutton.button=Button3; event->xbutton.window=(Window)window; event->xbutton.time=GetTickCount(); break; case WM_MOUSEMOVE: if (hWnd!=(HWND)NT_CWIN) /* Mouse in different window? */ { if (NT_CWIN==NULL) /* No previous window */ { event->type = EnterNotify; event->xcrossing.x = LOWORD(lParam); event->xcrossing.y = HIWORD(lParam); event->xcrossing.window = (Window)window; } else { event->type=LeaveNotify; event->xcrossing.x=LOWORD(lParam); event->xcrossing.y=HIWORD(lParam); event->xcrossing.window = (Window)NT_find_window_from_id(NT_CWIN); } } else { event->type=MotionNotify; /* Fill out mouse event */ event->xmotion.window=(Window)window; event->xmotion.x=pt.x=LOWORD(lParam); event->xmotion.y=pt.y=HIWORD(lParam); event->xmotion.time=GetTickCount(); ClientToScreen(hWnd,&pt); /* Translate coordinates */ event->xmotion.x_root=pt.x; event->xmotion.y_root=pt.y; if (wParam&MK_CONTROL) st|=ControlMask; if (wParam&MK_SHIFT) st|=ShiftMask; if (wParam&MK_LBUTTON) st|=Button1Mask; if (wParam&MK_MBUTTON) st|=Button2Mask; if (wParam&MK_RBUTTON) st|=Button3Mask; event->xmotion.state=st; } NT_CWIN=(NT_window *)hWnd; break; case WM_MOUSEWHEEL: event->type=ButtonRelease; event->xbutton.x=LOWORD(lParam); event->xbutton.y=HIWORD (lParam); event->xbutton.button=HIWORD(wParam)>32768?Button5:Button4; event->xbutton.window=(Window)window; event->xbutton.time=GetTickCount(); if (wParam&MK_CONTROL) st|=ControlMask; if (wParam&MK_SHIFT) st|=ShiftMask; if (wParam&MK_LBUTTON) st|=Button1Mask; if (wParam&MK_MBUTTON) st|=Button2Mask; if (wParam&MK_RBUTTON) st|=Button3Mask; event->xbutton.state=st; break; case WM_SYSCHAR: case WM_CHAR: event->type=KeyPress; event->xkey.state=NT_get_state(); event->xkey.x=event->xkey.y=0; /* Inside the window */ event->xkey.keycode=LOWORD(wParam); switch (event->xkey.keycode) { case VK_ADD: event->xkey.keycode=XK_KP_Add; break; case VK_SUBTRACT:event->xkey.keycode=XK_KP_Subtract; break; } if (GetKeyState(VK_CONTROL) & 0x8000) { if (event->xkey.keycode == 32) { event->xkey.keycode=0; } if (event->xkey.keycode >255 ) { event->xkey.keycode=0; } } event->xkey.window=(Window)window; break; case WM_KEYDOWN: event->type=KeyPress; switch (wParam) { case VK_CANCEL: key=XK_Cancel; break; case VK_CLEAR: key=XK_Clear; break; /* causes AltGr to create a keypress */ /* case VK_MENU: key=XK_Alt_L; break;*/ case VK_PAUSE: key=XK_Pause; break; case VK_PRIOR: key=XK_Prior; break; case VK_NEXT: key=XK_Next; break; case VK_END: key=XK_End; break; case VK_HOME: key=XK_Home; break; case VK_LEFT: key=XK_Left; break; case VK_UP: key=XK_Up; break; case VK_RIGHT: key=XK_Right; break; case VK_DOWN: key=XK_Down; break; case VK_SELECT: key=XK_Select; break; case VK_PRINT: key=XK_Print; break; case VK_EXECUTE: key=XK_Execute; break; case VK_INSERT: key=XK_Insert; break; case VK_DELETE: key=XK_Delete; break; case VK_HELP: key=XK_Help; break; case VK_NUMLOCK: key=XK_Num_Lock; break; case VK_SCROLL: key=XK_Scroll_Lock; break; case VK_BACK: key=XK_BackSpace; break; case VK_F1: key=XK_F1; break; case VK_F2: key=XK_F2; break; case VK_F3: key=XK_F3; break; case VK_F4: key=XK_F4; break; case VK_F5: key=XK_F5; break; case VK_F6: key=XK_F6; break; case VK_F7: key=XK_F7; break; case VK_F8: key=XK_F8; break; case VK_F9: key=XK_F9; break; case VK_F10: key=XK_F10; break; case VK_F11: key=XK_F11; break; case VK_F12: key=XK_F12; break; case VK_ADD: key=XK_KP_Add; break; case VK_SUBTRACT:key=XK_KP_Subtract; break; default: key=0; break; } if (key == 0) { event->type = -1; } else { event->xkey.keycode=key; event->xkey.window=(Window)window; event->xkey.state=NT_get_state(); event->xkey.x=event->xkey.y=0; /* Inside the window */ } break; case WM_DESTROY: case WM_QUIT: case WM_CLOSE: event->type = ClientMessage; event->xclient.format = 32; event->xclient.data.l[0] = XInternAtom(NULL,"WM_DELETE_WINDOW", FALSE); break; case USR_EnterNotify: event->type = EnterNotify; event->xcrossing.x = LOWORD(lParam); event->xcrossing.y = HIWORD(lParam); event->xcrossing.window = (Window)window; break; case WM_MOVE: if (window->min==0) { window->x = LOWORD(lParam); window->y = HIWORD(lParam); NT_configureNotify(window,window->x,window->y); event->type = ConfigureNotify; event->xconfigure.window = (Window)window; event->xconfigure.x = 0; /* client area is always @ 0 */ event->xconfigure.y = 0; event->xconfigure.width = window->wdth; event->xconfigure.height = window->hght; event->xconfigure.above = Above; } break; case WM_SIZING: event->type = ConfigureNotify; window->wdth = LOWORD(lParam); if (window->wdthminx) window->wdth = window->minx; window->hght = HIWORD(lParam); if (window->hghtminx) window->hght = window->miny; NT_configureNotify(window,window->x,window->y); event->xconfigure.window = (Window)window; event->xconfigure.x = 0; event->xconfigure.y = 0; event->xconfigure.width = window->wdth; event->xconfigure.height = window->hght; event->xconfigure.above = Above; break; case WM_SIZE: switch(wParam) { case SIZE_MINIMIZED: event->type=UnmapNotify; window->min=1; break; default: event->type = ConfigureNotify; window->wdth = LOWORD(lParam); if (window->wdthminx) window->wdth = window->minx; window->hght = HIWORD(lParam); if (window->hghtminx) window->hght = window->miny; event->xconfigure.window = (Window)window; event->xconfigure.x = 0; event->xconfigure.y = 0; event->xconfigure.width = window->wdth; event->xconfigure.height = window->hght; event->xconfigure.above = Above; #if !defined(WIN9X) if (window->min) event->type=MapNotify; #endif window->min=0; break; } break; case WM_DESTROYCLIPBOARD: event->type = SelectionClear; event->xselectionclear.time = GetTickCount(); break; case USR_MapNotify: event->type=MapNotify; break; case USR_ConvertSelection: event->type=SelectionNotify; event->xselection.requestor = (Window)window; event->xselection.property = XA_CUT_BUFFER0; break; default: break; } } while(0); return (event==NULL?0: (event->type==-1?0:1)); } /*****************************************************************\ Function: XCheckWindowEvent Inputs: display, window, event mask. Returned: pointer to filled in event structure, status. Comments: This is fudged at the moment to work with the toolkit. The event system needs rewriting to account properly for event masks. \*****************************************************************/ BoolDef XCheckTypedEvent(display,ev,rep) Display *display; int ev; XEvent *rep; { xtrace("XCheckTypedEvent\n"); return (False); } BoolDef XCheckWindowEvent(display,w,emask,ev) Display *display; Window w; long emask; XEvent *ev; { NT_window *ntw=(NT_window *)w; MSG msg; BoolDef status = 0; xtrace("XCheckWindowEvent\n"); if (emask&0) if (PeekMessage(&msg,ntw->w,USR_MapNotify, USR_MapNotify,PM_REMOVE)|| PeekMessage(&msg,ntw->w,WM_PAINT,WM_PAINT,PM_REMOVE)) { cjh_printf("removed message\n"); ev->type=ConfigureNotify; status = 1; } return(status); } /* XPending checks for x events pending. We don't know if we have x events until we process the win events. */ int XPending (display) Display *display; { MSG msg; /* xtrace("XPending\n"); */ while(wineventq->count<=0 && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { doTranslateMessage(&msg); DispatchMessage(&msg); } return wineventq->count; } int XPutBackEvent(display,event) Display *display; XEvent *event; { xtrace("XPutBackEvent\n"); return 0; } StatusDef XSendEvent(display,w,prop,emask,event) Display *display; Window w; BoolDef prop; long emask; XEvent *event; { xtrace("XSendEvent\n"); return 0; } /* I'm tempted to flush the windows queue ** before checking, but I think that would ** break the assumtion that most of the WM_PAINT ** messges are only going to be dispatched when ** the app is directly calling us. */ BoolDef XCheckTypedWindowEvent( Display* display, Window w, int event_type, XEvent* event_return) { int i,j; xtrace("XCheckTypedWindowEvent\n"); if (w==0) return 0; /* i = wineventq->next; while(i != wineventq->avail) { if (wineventq->list[i].window==(NT_window*)w) { WinEventToXEvent(&wineventq->list[i],event_return); if (event_return->type == event_type) { break; } } i++; if (i>wineventq->num) i=0; } if (i != wineventq->avail) { while(i != wineventq->next) { j =i-1; if (j<0) j= wineventq->num; copyWinEvent(&wineventq->list[i],&wineventq->list[j]); i = j; } wineventq->next++; wineventq->count--; cjh_printf("removed an event\n"); return 1; } */ return 0; } /*****************************************************************\ Function: XWindowEvent Inputs: display, window, event mask. Returned: pointer to filled in event structure. Comments: This is fudged at the moment to work with the toolkit. The event system needs rewriting to account properly for event masks. \*****************************************************************/ int XWindowEvent(display,w,emask,rep) Display *display; Window w; long emask; XEvent *rep; { NT_window *ntw=(NT_window *)w; MSG msg; xtrace("XWindowEvent\n"); if (emask&ExposureMask) { GetMessage(&msg,ntw->w,USR_MapNotify,USR_MapNotify); rep->type=ConfigureNotify; } return 0; } /*****************************************************************\ Function: XNextEvent Inputs: display, event structure pointer. Comments: Windows routines receive messages (events) in two ways: firstly by GetMessage, which takes messages from the calling thread's message queue, and secondly by the window function being called with events as arguments. To simulate the X system, we get messages from the queue and pass them to the window function anyway, which processes them and fills out the local XEvent structure. DispatchMessage calls the window procedure and waits until it returns. Translate message turns WM_KEYUP/DOWN messages into WM_CHAR. \*****************************************************************/ int XNextEvent(Display *display,XEvent *event) { MSG msg; xtrace("XNextEvent\n"); /* if there isn't already an event in the pipe, this will block */ while(wineventq->count <= 0 && GetMessage(&msg, NULL, 0, 0)>0) { doTranslateMessage(&msg); DispatchMessage(&msg); } if (wineventq->count>0) { getQdEvent(wineventq,event); } else { /* hmm, GetMessage failed, maybe we're supposed to quit */ event->type=ClientMessage; event->xclient.format = 32; event->xclient.data.l[0] = XInternAtom(NULL,"WM_DELETE_WINDOW", FALSE); return 1; } return 1; } BoolDef XFilterEvent(XEvent* event,Window window) { xtrace("XFilterEvent\n"); return 0; } BoolDef XQueryPointer( Display* display, Window w, Window* root_return, Window* child_return, int* root_x_return, int* root_y_return, int* win_x_return, int* win_y_return, unsigned int* mask_return) { POINT point; RECT rect; xtrace("XQueryPointer\n"); GetCursorPos(&point); *root_x_return = point.x; *root_y_return = point.y; GetWindowRect(((NT_window*)w)->w,&rect); *win_x_return= point.x - rect.left; *win_y_return= point.y - rect.top; *mask_return = NT_get_state(); return True; } int XConvertSelection( Display *display, Atom sel, Atom target, Atom prop, Window req, Time time) { xtrace("XConvertSelection\n"); QEvent(wineventq,(NT_window*)req,USR_ConvertSelection,0,0L); NT_wakeup(((NT_window*)req)->w); return 0; } rxvt-2.7.10/W11/w32/Makefile010064400001440000024000000010540757331033000136630ustar gcwstaff CFLAGS=-O first_rule: all all allbin: ../lib/libW11.dll alldoc tags: ../lib/libW11.dll: xlib.o ntutil.o event.o dllwrap --export-all-symbols -o ../lib/libW11.dll xlib.o ntutil.o event.o -mwindows xlib.o: xlib.c ntdef.h gcc -c xlib.c ${CFLAGS} -I.. -mwin32 ntutil.o: ntutil.c ntdef.h gcc -c ntutil.c ${CFLAGS} -I.. -mwin32 event.o: event.c ntdef.h gcc -c event.c ${CFLAGS} -I.. -mwin32 debug: gcc -c xlib.c -g -I.. -mwin32 gcc -c event.c -g -I.. -mwin32 gcc -c ntutil.c -g -I.. -mwin32 clean: -rm ../lib/libW11.dll xlib.o ntutil.o event.o rxvt-2.7.10/W11/wrap004075500001440000024000000000000764024424100125075ustar gcwstaffrxvt-2.7.10/W11/wrap/Makefile010064400001440000024000000006130757331033100142220ustar gcwstaff CFLAGS=-O first_rule: all all allbin: ../lib/libX11.a alldoc tags: ../lib/libX11.a: wrap.o rxvt_res.o ar r ../lib/libX11.a wrap.o rxvt_res.o wrap.o: wrap.c xwrappers.gen gcc ${CFLAGS} -c wrap.c -I.. -mwin32 rxvt_res.o: rxvt.rc windres -i rxvt.rc -o rxvt_res.o xwrappers.gen: ../X11/Xlib.h perl mkproxy.pl ../X11/Xlib.h > xwrappers.gen clean: -rm wrap.o rxvt_res.o ../lib/libX11.a rxvt-2.7.10/W11/wrap/wrap.h010064400001440000024000000000520757331033100137010ustar gcwstaff#define IDI_RXTV 101 #define IDI_RXVT 102 rxvt-2.7.10/W11/wrap/wrap.c010064400001440000024000000130620757331033100137010ustar gcwstaff #include #include #include #include #include #include "wrap.h" void __cdecl WinMainCRTStartup(void) { mainCRTStartup(); } static void *_lib=NULL; static char *_libname = NULL; static void *_loadfunc(char *name) { void *f = NULL; if (_lib==NULL) { if (_libname==NULL) { fprintf(stderr,"%s called before XOpenDisplay!\n",name); exit(3); } _lib = LoadLibrary(_libname); if (_lib == NULL) { fprintf(stderr,"failed to load %s.dll\n",_libname); exit(1); } } f = GetProcAddress(_lib,name); if (f==NULL) { fprintf(stderr,"failed to find %s\n",name); exit(2); } return f; } static void _freelib() { FreeLibrary(_lib); _lib=NULL; } typedef LONG (proto_WndProc)(HWND hWnd,UINT message,UINT wParam,LONG lParam); static proto_WndProc *func_WndProc = NULL; LONG __stdcall WndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam) { if (!func_WndProc) func_WndProc=(proto_WndProc *)_loadfunc("NT_handleMsg"); return (func_WndProc)(hWnd,message,wParam,lParam); } static void hideConsole() { HWND conwin; HANDLE hConsole; CONSOLE_SCREEN_BUFFER_INFO buffInfo; SECURITY_ATTRIBUTES sa; char app_name[40]; sprintf(app_name, "rxvt%08x", (unsigned int)GetCurrentThreadId()); /* from eConsole source */ sa.nLength = sizeof(sa); sa.bInheritHandle = TRUE; sa.lpSecurityDescriptor = NULL; hConsole = CreateFile( "CONOUT$", GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, &sa, OPEN_EXISTING, 0, 0 ); if (GetConsoleScreenBufferInfo(hConsole,&buffInfo) && buffInfo.dwCursorPosition.X==0 && buffInfo.dwCursorPosition.Y==0) { /* find the console window, from eConsole source */ SetConsoleTitle( app_name ); while ((conwin = FindWindow( NULL, app_name))==NULL) Sleep( 40 ); ShowWindowAsync(conwin, SW_HIDE); } } ATOM _register_window_class() { WNDCLASS wc; HANDLE curInstance = GetModuleHandleA(NULL); char app_name[40]; sprintf(app_name, "rxvt%08x", (unsigned int)GetCurrentThreadId()); hideConsole(); wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; /* CS_OWNDC */ wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = curInstance; wc.hIcon = LoadIcon(curInstance, MAKEINTRESOURCE( IDI_RXVT )); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = NULL; wc.lpszMenuName = NULL; wc.lpszClassName = app_name; return RegisterClass(&wc); } typedef void (proto_NT_SetAtom)(ATOM class); static proto_NT_SetAtom *func_NT_SetAtom = NULL; void _set_atom(ATOM class) { if (!func_NT_SetAtom) func_NT_SetAtom=(proto_NT_SetAtom *)_loadfunc("NT_SetAtom"); (func_NT_SetAtom)(class); } typedef void (proto_W11AddEventHandler)(Display *d, proto_W11EventHandler *ev); static proto_W11AddEventHandler *func_W11AddEventHandler = NULL; void W11AddEventHandler(Display *d, proto_W11EventHandler *ev) { if (func_W11AddEventHandler) (func_W11AddEventHandler)(d,ev); } typedef Display * (proto_XOpenDisplay)(const char *name); static proto_XOpenDisplay *func_XOpenDisplay = NULL; Display * XOpenDisplay(const char *name) { ATOM class; char *env_var=NULL; if (_libname==NULL) { env_var = getenv("W11_LIBRARY"); if (env_var!=NULL) _libname = strdup(env_var); else if (name==NULL || !strcmp(name,":0")) { _libname="libW11"; class = _register_window_class(); _set_atom(class); func_W11AddEventHandler=(proto_W11AddEventHandler *)_loadfunc("W11AddEventHandler"); } else _libname="libX11"; } if (!func_XOpenDisplay) func_XOpenDisplay=(proto_XOpenDisplay *)_loadfunc("XOpenDisplay"); return (func_XOpenDisplay)(name); } typedef struct { char *name; XPointer value; } XIMArg; static void _XIMVaToList(va_list var, XIMArg *args) { char *attr; int i = 0; if (!args) return; for (attr = va_arg(var, char*); attr && i<11; attr = va_arg(var, char*)) { args->name = attr; args->value = va_arg(var, XPointer); args++; i++; } for(;i<11;i++) { args->name=NULL; args->value=NULL; args++; } } typedef XIC (proto_XCreateIC)(XIM im, ...); static proto_XCreateIC *func_XCreateIC = NULL; XIC XCreateIC(XIM im, ...) { va_list var; XIMArg a[11]; va_start(var, im); _XIMVaToList(var, a); va_end(var); if (a[10].name!=NULL) { fprintf(stderr,"call to XCreateIC with more than 20 args\n"); exit(5); } if (!func_XCreateIC) func_XCreateIC=(proto_XCreateIC *)_loadfunc("XCreateIC"); return (func_XCreateIC)(im, a[0].name, a[0].value, a[1].name, a[1].value, a[2].name, a[2].value, a[3].name, a[3].value, a[4].name, a[4].value, a[5].name, a[5].value, a[6].name, a[6].value, a[7].name, a[7].value, a[8].name, a[8].value, a[9].name, a[9].value, NULL); } typedef char * (proto_XGetIMValues)(XIM im, ...); static proto_XGetIMValues *func_XGetIMValues = NULL; char * XGetIMValues(XIM im, ...) { va_list var; XIMArg a[11]; va_start(var, im); _XIMVaToList(var, a); va_end(var); if (a[10].name!=NULL) { fprintf(stderr,"call to XGetIMValues with more than 20 args\n"); exit(5); } if (!func_XGetIMValues) func_XGetIMValues=(proto_XGetIMValues *)_loadfunc("XGetIMValues"); return (func_XGetIMValues)(im, a[0].name, a[0].value, a[1].name, a[1].value, a[2].name, a[2].value, a[3].name, a[3].value, a[4].name, a[4].value, a[5].name, a[5].value, a[6].name, a[6].value, a[7].name, a[7].value, a[8].name, a[8].value, a[9].name, a[9].value, NULL); } #include "xwrappers.gen" rxvt-2.7.10/W11/wrap/rxvt.rc010075500001440000024000000007150760200341000141070ustar gcwstaff#include "wrap.h" IDI_RXVT ICON DISCARDABLE PRELOAD "rxvt.ico" 1 VERSIONINFO FILEVERSION 2, 7, 9, 3 PRODUCTVERSION 2, 7, 9, 3 FILESUBTYPE 0 BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "04090000" BEGIN VALUE "FileDescription", "rxvt\000" VALUE "FileVersion", "2.7.9-3\000" VALUE "InternalName", "rxvt\000" VALUE "OriginalFilename", "rxvt.exe\000" VALUE "ProductName","rxvt\000" VALUE "ProductVersion","2.7.9-3\000" END END END rxvt-2.7.10/W11/wrap/rxvt.ico010064400001440000024000000263560757331033100142750ustar gcwstaffh6 ¨ ž00¨F( ÞßçççïççïççïççïççïççïççïççïççïççïççïççïÞÛÞµ²µÆÇÆïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ŒŽŒ¥¦¥ÿÿÿÿÿÿïïï­ª­½º½ïó÷ÿÿÿÿÿÿÎÏÎïëïÿÿÿÿÿÿÿÿÿ9<9989ÿÿÿÿÿÿïïïµ²µµ¶µï×Þÿ¢¥ÿžœÿ÷÷„†„Ö×Öÿÿÿÿÿÿ9<9989ÿÿÿÿÿÿïïïÆ¾Æ½º½ïó÷ÿÿÿÿÿÿÎÏÎïëïÿÿÿÿÿÿÿÿÿ9<9989ÿÿÿÿÿÿïï”ÆÃÆïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ”–”sqs”’”ÿÿÿÿÿÿïïŒ½¾½ïó÷ÎÏÎÿÿÿÖÓÖ÷÷÷ÎËÎÞÛÞçãçÿÿÿ­ª­Ö×ÖÿÿÿÿÿÿïïŒ½¾½ïó÷œžœÿÿÿ÷÷÷JIJïï異¥¥¢¥ÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿïïŒ½¾½ïó÷œžœ”–”ÎÏÎÖ×ÖÎËÎÆÃÆÆÇÆÖÓÖsqsÞÛÞÿÿÿÿÿÿïïï”–”µ¶µïïïÿûÿÿûÿÿûÿÿûÿÿûÿÿûÿÿûÿÿûÿ÷ó÷ÿûÿÿûÿÿûÿïëï”’”µ²µ¥†{„aRsMBs0”U1µyZÖž{ïÇ¥­¢œ­¢œ­¢œ­¢œµ¦”µ®­µª¥Æ²¥µš”Þ¢¥­}{ŒU9¥iRµyZÖž{ïÇ­ÎÓÖÎÓÖ¥¦¥¥¦¥­¢œµº½ŒŽŒ½¶­½ª¥µš”­Ž„œqc­ŠsÆžŒÖ¶¥ïϽçßÖçßÖÞ×ÎçßÖÞÓÆçßÖçßÖÞÏÆÿÿÿÿÿÿ( @ ÎÏÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆËÎÆÇÆÆËÎÆËÎÆËÞßçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞœšœ­®­µ¶µÞãçÞßçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ¥¦¥µ²µœžœÞãçÞßçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿœšœ101101101101„†„ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ¥¢¥­ª­­ª­ÞãçÞßçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ{}{cecÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ½¶½œšœœšœÞãçÞßçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿcecµ²µÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ{}{cecÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞÆÃÆµ²µœžœÞãçÞßçÿÏÎÿÿÿÿÿÿÿqsÿmkÿÿÿÿÿÿœžœZ]ZÎÏÎÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ{}{cecÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞÆÃÆµ²µœžœÞãçÞßçÿ×ÖÿYZÿYZÿÏÎÿ²µÿÛÞÿÿÿµ²µcec¥¢¥ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ{}{cecÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞÆÃÆÆÃÆ­¦­ÞãçÞßçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿJMJœžœÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ{}{cecÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞœšœ­®­½º½ÞãçÞßçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ÷÷÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ{}{cecÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ„†„”–”­ª­ÞãçÞßçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ{}{cecÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ„†„”–”­ª­ÞãçÞßçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿçççÎÏÎÎÏÎÎÏÎÎÏÎçãçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ„†„”–”­ª­ÞãçÞßçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ„†„”–”­ª­ÞãçÞßçÿÿÿ{}{½¾½ÿÿÿÿÿÿÿÿÿZYZïïïïïïJMJïïïÿÿÿsqs{}{ÿÿÿÿÿÿÿÿÿsqs),)9<9ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ„†„”–”­ª­ÞãçÞßçÿÿÿ{}{½¾½ÿÿÿÿÿÿÿÿÿçãçJMJZYZÎÏÎÿÿÿ÷ó÷ZYZJMJïëïÿÿÿÿÿÿcecÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ„†„”–”­ª­ÞãçÞßçÿÿÿ{}{½¾½ÿÿÿÿÿÿÿÿÿÿÿÿJMJ),)÷ó÷ÿÿÿœžœµ²µ½¾½ŒŽŒÿÿÿÿÿÿcecÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ„†„”–”­ª­ÞãçÞßçÿÿÿ{}{JMJŒŽŒ9<9ÿÿÿŒŽŒœšœÎÏ΄†„ÿÿÿ101÷÷÷ÿÿÿcecÿÿÿœšœ9<9œšœœšœÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ{}{ŒŠŒœžœÞãçÞßçÿÿÿÞßÞïïïÎÏÎÎÏÎÿÿÿÎÏÎÿÿÿÿÿÿÎÏÎïïïÞßÞÿÿÿÿÿÿÞÛÞïïï½¾½JMJ½¾½½¾½ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ­ª­µ²µœžœÞãçÞßçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿçãçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞßÞ”’”­ª­¥¦¥ÞãçÞßç÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ÞÛÞ„‚„ŒŠŒŒŽŒÖ×ÖÞßçc RRRZk${8ŒM)œ]9­mR½‚cÆ’sÞ¦„纜ïÇ­µ¢”µ¢”µ¢”µ¢”­žŒµ¢”µ¢”µ¢”µ¢”ƪŒ½ªœµ¢”µ¢”µ¢”µžŒÞÓÆÞßçŒaRµ¶µµ¶µµ¶µkYRk${8ŒM)œ]9­mR½‚cÆ’sÞ¦„纜÷ÓµÎÓÖcik{}„ÎÓÖ¥¦¥¥ª­œž¥œž¥­²µ­–„Þß眞¥ÆÇΜž¥­¦œÞÓÆÞßçŒeRÆÇÆÆÇÆÆÇÆk]R„E)½–ŒÆžŒœ]B­mR½‚cÎ’sÞ¦Œçºœ÷ÓµÎÓÖÎÓÖÎÓÖÎÓÖ¥¦¥¥ª­ÎÓÖÎÓÖ¥ª­­–„Þß眢¥!½¾Æ­¦œÞÓÆÞßçŒeR÷qs÷qs÷qssE9k${8ŒM)œ]9­mR½‚cÆ’sÞ¦„纜÷ÓµÎÓÖÎÓÖÎÓÖÎÓÖ¥¦¥œž¥cikcik­²µ­–„Þß眞¥ÆÇΜž¥­¦œÞÓÆÞßç{A)œqZœqZœqZsA)k${8ŒM)œ]9­mR½‚cÆ’sÞ¦„纜÷ϵïÛÎïÛÎïÛÎïÛÎξ­ïÛÎïÛÎïÛÎïÛÎÖ²”ïßÎïÛÎïÛÎïÛÎÖ¾­ÞÓÆçççÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÞãçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(0`ÎËµº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½µº½Þãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÏÎÎÇÎÞÛÞÎËÎÞÛÞÞÛÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„µ¶µœ–œ”–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„çãç­ª­{y{ÞÛÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­­ª­­ª­­ª­­ª­­ª­­ª­çãçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇε®µÆ¾Æµ²µŒ†ŒÞÛÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇÎ¥¢¥ÎËÎÎËÎÎËÎÖÏÖÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇÎ¥¢¥{u{{u{{u{ÖÏÖÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿçãçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇÎÎÇε²µµ²µ”–”ÎÇÎÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿsqs989ÆÇÆÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇÎÎÇε²µµ²µ”–”ÎÇÎÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿª­ÿãçÿÿÿÿÿÿÆÇÆ989RURÖ×Öÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇÎÎÇε²µµ²µ”–”ÎÇÎÎÓÖÞãçïó÷ÿURÿãçÿÿÿÿÇÆÿÿURÿ89ÿÿÿÿÿÿÿÿÿÿÿÿÆÇÆ)()989ÆÇÆÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇÎÎÇε²µµ²µ”–”ÎÇÎÎÓÖÞãçïó÷ÿÇÆÿ89ÿURÿÿÇÆÿÿÿÿŽŒÿª­ÿÿÿÿÿÿçãçRUR)()ŒŽŒÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇÎÎÇε²µµ²µ”–”ÎÇÎÎÓÖÞãçïó÷ÿÿÿÿÇÆÿª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿçãçsqs­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇε®µÞÛÞÞÛÞÖÓÖÞ×ÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿsqsŒŽŒÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­­ª­­ª­­ª­­ª­­ª­­ª­çãçÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿRURRURÿÿÿÿÿÿÿÿÿsqsÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÆÇÆ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿsqsRURÿÿÿRUR989ÿÿÿÿÿÿÿÿÿÆÇÆ989çãçÿÿÿÿÿÿÿÿÿÿÿÿRURsqsÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ989989)()çãçÿÿÿÿÿÿÿÿÿ989ŒŽŒsqssqsÿÿÿÿÿÿÿÿÿÿÿÿRUR­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿ­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿŒŽŒRURÿÿÿÿÿÿÿÿÿçãçÿÿÿçãçÿÿÿÿÿÿÿÿÿÿÿÿRUR­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿ­ª­­ª­ÿÿÿÆÇÆŒŽŒÿÿÿÿÿÿÆÇÆÆÇÆ)()ŒŽŒÿÿÿÿÿÿsqssqsÿÿÿÿÿÿsqsŒŽŒÿÿÿÿÿÿÿÿÿRUR­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿ­ª­)()RURRURRURÿÿÿÿÿÿ)(){}{ÿÿÿ½¾½ÿÿÿÿÿÿÖ×ÖÿÿÿÿÿÿÖ×Ö)()ÿÿÿÖ×Ö{}{)()RUR{}{{}{Ö×ÖÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„”–””–””–”ÞÛÞÎÓÖÞãçïó÷ÿÿÿÆÇÆRURçãçsqsRURŒŽŒÿÿÿ­ª­sqsÿÿÿÿÿÿÿÿÿŒŽŒ­ª­çãçsqsÿÿÿÿÿÿÿÿÿÿÿÿRURÖ×ÖÆÇÆRUR989RURRURÆÇÆÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇÎŒŽŒ”–””–”{u{ÎËÎÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRUR­ª­ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇÎŒŽŒÞ×Þµ²µ{}{ÞÛÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇ΄‚„ÞÛÞ”’”ŒŽŒÞÛÞÎÓÖÞãçïó÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÎÇÎsus„‚„ŒŠŒ„‚„ÎÇÎÎÓÖÞãçÆ¶µ½¦œ½¦œ½¦œ½¦œ½¦œ½¦œ½¦œ½¦œÆª¥Æ®¥Î¶­Îº­ÎºµÖ¾µÖýÖǽÞÏÆÞÓÆç×ÎçÛÎïßÖïßÖïßÖïßÖïßÖïßÖïßÖïßÖïßÖïßÖïßÖïßÖïßÖïßÖïßÖïßÖïßÖïßÖïßÖÞÏÆµ¦œµ¦œµ¦œµ¦œ½®¥ÎÓÖÞãçŒ]Jk$k$k$k$k$k$k$k$s0„); $file=~s/[^\000]+\/\* functions \*\///; $file=~s/#endif\s+$//; foreach my $def (split(/\s*;\s*/,$file)) { $def =~ s/\s+/ /g; my $paren = ($def=~s/\(([^\(\)]*)\)\s*//)?$1:''; my $type = ($def=~s/^([^\000]*\s+\*?)//)?$1:''; $type=~s/^\s+//; $type=~s/\s+$//; push(@list,{def=>$def,type=>$type,paren=>$paren}); } foreach my $s (sort {$a->{def} cmp $b->{def}} @list) { my $def = $s->{def}; my $type = $s->{type}; my $paren=$s->{paren}; my $params = $paren; $params=~s/[\[\]\*]//g; $params=~s/\s+,/,/g; $params=~s/[^,\s]+\s+//g; next if ($params =~ /\.\.\./); next if ($def eq 'XOpenDisplay'); my $return = $type eq 'void' ? '':'return '; print " typedef $type (proto_$def)($paren); static proto_$def *func_$def = NULL; $type $def($paren) { if (!func_$def) func_$def=(proto_$def *)_loadfunc(\"$def\"); $return(func_$def)($params); } "; } rxvt-2.7.10/W11/wrap/xwrappers.gen010064400001440000024000001737620757331033100153300ustar gcwstaff typedef StatusDef (proto_XAllocColor)( Display *display, Colormap cmap, XColor *xc); static proto_XAllocColor *func_XAllocColor = NULL; StatusDef XAllocColor( Display *display, Colormap cmap, XColor *xc) { if (!func_XAllocColor) func_XAllocColor=(proto_XAllocColor *)_loadfunc("XAllocColor"); return (func_XAllocColor)( display, cmap, xc); } typedef StatusDef (proto_XAllocColorCells)( Display *display, Colormap cmap, BoolDef cont, unsigned long *pmasks, unsigned int np, unsigned long *pixels, unsigned int nc); static proto_XAllocColorCells *func_XAllocColorCells = NULL; StatusDef XAllocColorCells( Display *display, Colormap cmap, BoolDef cont, unsigned long *pmasks, unsigned int np, unsigned long *pixels, unsigned int nc) { if (!func_XAllocColorCells) func_XAllocColorCells=(proto_XAllocColorCells *)_loadfunc("XAllocColorCells"); return (func_XAllocColorCells)( display, cmap, cont, pmasks, np, pixels, nc); } typedef StatusDef (proto_XAllocColorPlanes)( Display *display, Colormap cmap, BoolDef cont, unsigned long *pixels, int nc, int nr,int ng,int nb, unsigned long *rmask, unsigned long *gmask, unsigned long *bmask); static proto_XAllocColorPlanes *func_XAllocColorPlanes = NULL; StatusDef XAllocColorPlanes( Display *display, Colormap cmap, BoolDef cont, unsigned long *pixels, int nc, int nr,int ng,int nb, unsigned long *rmask, unsigned long *gmask, unsigned long *bmask) { if (!func_XAllocColorPlanes) func_XAllocColorPlanes=(proto_XAllocColorPlanes *)_loadfunc("XAllocColorPlanes"); return (func_XAllocColorPlanes)( display, cmap, cont, pixels, nc, nr,ng,nb, rmask, gmask, bmask); } typedef StatusDef (proto_XAllocNamedColor)(Display *display, Colormap cmap, const char *cname, XColor *cell, XColor *rgb); static proto_XAllocNamedColor *func_XAllocNamedColor = NULL; StatusDef XAllocNamedColor(Display *display, Colormap cmap, const char *cname, XColor *cell, XColor *rgb) { if (!func_XAllocNamedColor) func_XAllocNamedColor=(proto_XAllocNamedColor *)_loadfunc("XAllocNamedColor"); return (func_XAllocNamedColor)(display, cmap, cname, cell, rgb); } typedef int (proto_XBell)( Display *display, int pc); static proto_XBell *func_XBell = NULL; int XBell( Display *display, int pc) { if (!func_XBell) func_XBell=(proto_XBell *)_loadfunc("XBell"); return (func_XBell)( display, pc); } typedef int (proto_XChangeGC)( Display* display, GC gc, unsigned long mask, XGCValues* gc_values); static proto_XChangeGC *func_XChangeGC = NULL; int XChangeGC( Display* display, GC gc, unsigned long mask, XGCValues* gc_values) { if (!func_XChangeGC) func_XChangeGC=(proto_XChangeGC *)_loadfunc("XChangeGC"); return (func_XChangeGC)( display, gc, mask, gc_values); } typedef int (proto_XChangeProperty)( Display *display, Window window, Atom property, Atom type, int format, int mode, const unsigned char *data, int nelements); static proto_XChangeProperty *func_XChangeProperty = NULL; int XChangeProperty( Display *display, Window window, Atom property, Atom type, int format, int mode, const unsigned char *data, int nelements) { if (!func_XChangeProperty) func_XChangeProperty=(proto_XChangeProperty *)_loadfunc("XChangeProperty"); return (func_XChangeProperty)( display, window, property, type, format, mode, data, nelements); } typedef int (proto_XChangeWindowAttributes)( Display *display, Window w, unsigned long vmask, XSetWindowAttributes *attr); static proto_XChangeWindowAttributes *func_XChangeWindowAttributes = NULL; int XChangeWindowAttributes( Display *display, Window w, unsigned long vmask, XSetWindowAttributes *attr) { if (!func_XChangeWindowAttributes) func_XChangeWindowAttributes=(proto_XChangeWindowAttributes *)_loadfunc("XChangeWindowAttributes"); return (func_XChangeWindowAttributes)( display, w, vmask, attr); } typedef BoolDef (proto_XCheckTypedEvent)( Display *display, int ev, XEvent *rep); static proto_XCheckTypedEvent *func_XCheckTypedEvent = NULL; BoolDef XCheckTypedEvent( Display *display, int ev, XEvent *rep) { if (!func_XCheckTypedEvent) func_XCheckTypedEvent=(proto_XCheckTypedEvent *)_loadfunc("XCheckTypedEvent"); return (func_XCheckTypedEvent)( display, ev, rep); } typedef BoolDef (proto_XCheckTypedWindowEvent)( Display* display, Window w, int event_type, XEvent* event_return); static proto_XCheckTypedWindowEvent *func_XCheckTypedWindowEvent = NULL; BoolDef XCheckTypedWindowEvent( Display* display, Window w, int event_type, XEvent* event_return) { if (!func_XCheckTypedWindowEvent) func_XCheckTypedWindowEvent=(proto_XCheckTypedWindowEvent *)_loadfunc("XCheckTypedWindowEvent"); return (func_XCheckTypedWindowEvent)( display, w, event_type, event_return); } typedef BoolDef (proto_XCheckWindowEvent)( Display *display, Window w, long emask, XEvent *ev); static proto_XCheckWindowEvent *func_XCheckWindowEvent = NULL; BoolDef XCheckWindowEvent( Display *display, Window w, long emask, XEvent *ev) { if (!func_XCheckWindowEvent) func_XCheckWindowEvent=(proto_XCheckWindowEvent *)_loadfunc("XCheckWindowEvent"); return (func_XCheckWindowEvent)( display, w, emask, ev); } typedef int (proto_XClearArea)( Display *display, Window w, int x, int y, unsigned int width, unsigned int height, BoolDef exposures); static proto_XClearArea *func_XClearArea = NULL; int XClearArea( Display *display, Window w, int x, int y, unsigned int width, unsigned int height, BoolDef exposures) { if (!func_XClearArea) func_XClearArea=(proto_XClearArea *)_loadfunc("XClearArea"); return (func_XClearArea)( display, w, x, y, width, height, exposures); } typedef int (proto_XClearWindow)(Display *display, Window w); static proto_XClearWindow *func_XClearWindow = NULL; int XClearWindow(Display *display, Window w) { if (!func_XClearWindow) func_XClearWindow=(proto_XClearWindow *)_loadfunc("XClearWindow"); return (func_XClearWindow)(display, w); } typedef int (proto_XClipBox)( Region hrgn, XRectangle *rect); static proto_XClipBox *func_XClipBox = NULL; int XClipBox( Region hrgn, XRectangle *rect) { if (!func_XClipBox) func_XClipBox=(proto_XClipBox *)_loadfunc("XClipBox"); return (func_XClipBox)( hrgn, rect); } typedef int (proto_XCloseDisplay)(Display *display); static proto_XCloseDisplay *func_XCloseDisplay = NULL; int XCloseDisplay(Display *display) { if (!func_XCloseDisplay) func_XCloseDisplay=(proto_XCloseDisplay *)_loadfunc("XCloseDisplay"); return (func_XCloseDisplay)(display); } typedef StatusDef (proto_XCloseIM)(XIM im); static proto_XCloseIM *func_XCloseIM = NULL; StatusDef XCloseIM(XIM im) { if (!func_XCloseIM) func_XCloseIM=(proto_XCloseIM *)_loadfunc("XCloseIM"); return (func_XCloseIM)(im); } typedef int (proto_XConnectionNumber)(Display* display); static proto_XConnectionNumber *func_XConnectionNumber = NULL; int XConnectionNumber(Display* display) { if (!func_XConnectionNumber) func_XConnectionNumber=(proto_XConnectionNumber *)_loadfunc("XConnectionNumber"); return (func_XConnectionNumber)(display); } typedef int (proto_XConvertSelection)( Display *display, Atom sel, Atom target, Atom prop, Window req, Time time); static proto_XConvertSelection *func_XConvertSelection = NULL; int XConvertSelection( Display *display, Atom sel, Atom target, Atom prop, Window req, Time time) { if (!func_XConvertSelection) func_XConvertSelection=(proto_XConvertSelection *)_loadfunc("XConvertSelection"); return (func_XConvertSelection)( display, sel, target, prop, req, time); } typedef int (proto_XCopyArea)( Display *display, Drawable src, Drawable dest, GC gc, int src_x, int src_y, unsigned int width, unsigned int height, int dest_x, int dest_y); static proto_XCopyArea *func_XCopyArea = NULL; int XCopyArea( Display *display, Drawable src, Drawable dest, GC gc, int src_x, int src_y, unsigned int width, unsigned int height, int dest_x, int dest_y) { if (!func_XCopyArea) func_XCopyArea=(proto_XCopyArea *)_loadfunc("XCopyArea"); return (func_XCopyArea)( display, src, dest, gc, src_x, src_y, width, height, dest_x, dest_y); } typedef int (proto_XCopyGC)( Display *display, GC sgc, unsigned long vmask, GC dgc); static proto_XCopyGC *func_XCopyGC = NULL; int XCopyGC( Display *display, GC sgc, unsigned long vmask, GC dgc) { if (!func_XCopyGC) func_XCopyGC=(proto_XCopyGC *)_loadfunc("XCopyGC"); return (func_XCopyGC)( display, sgc, vmask, dgc); } typedef Pixmap (proto_XCreateBitmapFromData)(Display *display, Drawable drawable, const char *data, unsigned int width, unsigned int height); static proto_XCreateBitmapFromData *func_XCreateBitmapFromData = NULL; Pixmap XCreateBitmapFromData(Display *display, Drawable drawable, const char *data, unsigned int width, unsigned int height) { if (!func_XCreateBitmapFromData) func_XCreateBitmapFromData=(proto_XCreateBitmapFromData *)_loadfunc("XCreateBitmapFromData"); return (func_XCreateBitmapFromData)(display, drawable, data, width, height); } typedef Colormap (proto_XCreateColormap)( Display *display, Window w, Visual *visual, int alloc); static proto_XCreateColormap *func_XCreateColormap = NULL; Colormap XCreateColormap( Display *display, Window w, Visual *visual, int alloc) { if (!func_XCreateColormap) func_XCreateColormap=(proto_XCreateColormap *)_loadfunc("XCreateColormap"); return (func_XCreateColormap)( display, w, visual, alloc); } typedef Cursor (proto_XCreateFontCursor)( Display *display, unsigned int shape); static proto_XCreateFontCursor *func_XCreateFontCursor = NULL; Cursor XCreateFontCursor( Display *display, unsigned int shape) { if (!func_XCreateFontCursor) func_XCreateFontCursor=(proto_XCreateFontCursor *)_loadfunc("XCreateFontCursor"); return (func_XCreateFontCursor)( display, shape); } typedef GC (proto_XCreateGC)( Display *display, Drawable window, unsigned long mask, XGCValues *gc_values); static proto_XCreateGC *func_XCreateGC = NULL; GC XCreateGC( Display *display, Drawable window, unsigned long mask, XGCValues *gc_values) { if (!func_XCreateGC) func_XCreateGC=(proto_XCreateGC *)_loadfunc("XCreateGC"); return (func_XCreateGC)( display, window, mask, gc_values); } typedef XImage * (proto_XCreateImage)( Display *display, Visual *visual, unsigned int depth, int format, int offset, char *data, unsigned int width, unsigned int height, int bitmap_pad, int bytes_per_line); static proto_XCreateImage *func_XCreateImage = NULL; XImage * XCreateImage( Display *display, Visual *visual, unsigned int depth, int format, int offset, char *data, unsigned int width, unsigned int height, int bitmap_pad, int bytes_per_line) { if (!func_XCreateImage) func_XCreateImage=(proto_XCreateImage *)_loadfunc("XCreateImage"); return (func_XCreateImage)( display, visual, depth, format, offset, data, width, height, bitmap_pad, bytes_per_line); } typedef Pixmap (proto_XCreatePixmap)( Display *display, Drawable drawable, unsigned int width, unsigned int height, unsigned int depth); static proto_XCreatePixmap *func_XCreatePixmap = NULL; Pixmap XCreatePixmap( Display *display, Drawable drawable, unsigned int width, unsigned int height, unsigned int depth) { if (!func_XCreatePixmap) func_XCreatePixmap=(proto_XCreatePixmap *)_loadfunc("XCreatePixmap"); return (func_XCreatePixmap)( display, drawable, width, height, depth); } typedef Region (proto_XCreateRegion)(); static proto_XCreateRegion *func_XCreateRegion = NULL; Region XCreateRegion() { if (!func_XCreateRegion) func_XCreateRegion=(proto_XCreateRegion *)_loadfunc("XCreateRegion"); return (func_XCreateRegion)(); } typedef Window (proto_XCreateSimpleWindow)( Display *display, Window parent, int x, int y, unsigned int brd, unsigned int w, unsigned int h, unsigned long bg, unsigned long brd_col); static proto_XCreateSimpleWindow *func_XCreateSimpleWindow = NULL; Window XCreateSimpleWindow( Display *display, Window parent, int x, int y, unsigned int brd, unsigned int w, unsigned int h, unsigned long bg, unsigned long brd_col) { if (!func_XCreateSimpleWindow) func_XCreateSimpleWindow=(proto_XCreateSimpleWindow *)_loadfunc("XCreateSimpleWindow"); return (func_XCreateSimpleWindow)( display, parent, x, y, brd, w, h, bg, brd_col); } typedef Window (proto_XCreateWindow)( Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int bw, int depth, unsigned int class, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attr); static proto_XCreateWindow *func_XCreateWindow = NULL; Window XCreateWindow( Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int bw, int depth, unsigned int class, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attr) { if (!func_XCreateWindow) func_XCreateWindow=(proto_XCreateWindow *)_loadfunc("XCreateWindow"); return (func_XCreateWindow)( display, parent, x, y, width, height, bw, depth, class, visual, valuemask, attr); } typedef Colormap (proto_XDefaultColormap)( Display *display, int screen); static proto_XDefaultColormap *func_XDefaultColormap = NULL; Colormap XDefaultColormap( Display *display, int screen) { if (!func_XDefaultColormap) func_XDefaultColormap=(proto_XDefaultColormap *)_loadfunc("XDefaultColormap"); return (func_XDefaultColormap)( display, screen); } typedef int (proto_XDefaultDepth)( Display *display, int screen); static proto_XDefaultDepth *func_XDefaultDepth = NULL; int XDefaultDepth( Display *display, int screen) { if (!func_XDefaultDepth) func_XDefaultDepth=(proto_XDefaultDepth *)_loadfunc("XDefaultDepth"); return (func_XDefaultDepth)( display, screen); } typedef int (proto_XDefaultScreen)(Display *display); static proto_XDefaultScreen *func_XDefaultScreen = NULL; int XDefaultScreen(Display *display) { if (!func_XDefaultScreen) func_XDefaultScreen=(proto_XDefaultScreen *)_loadfunc("XDefaultScreen"); return (func_XDefaultScreen)(display); } typedef Visual * (proto_XDefaultVisual)( Display *display, int screen); static proto_XDefaultVisual *func_XDefaultVisual = NULL; Visual * XDefaultVisual( Display *display, int screen) { if (!func_XDefaultVisual) func_XDefaultVisual=(proto_XDefaultVisual *)_loadfunc("XDefaultVisual"); return (func_XDefaultVisual)( display, screen); } typedef int (proto_XDefineCursor)(Display* display,Window w,Cursor cursor); static proto_XDefineCursor *func_XDefineCursor = NULL; int XDefineCursor(Display* display,Window w,Cursor cursor) { if (!func_XDefineCursor) func_XDefineCursor=(proto_XDefineCursor *)_loadfunc("XDefineCursor"); return (func_XDefineCursor)(display,w,cursor); } typedef int (proto_XDestroyRegion)(Region hrgn); static proto_XDestroyRegion *func_XDestroyRegion = NULL; int XDestroyRegion(Region hrgn) { if (!func_XDestroyRegion) func_XDestroyRegion=(proto_XDestroyRegion *)_loadfunc("XDestroyRegion"); return (func_XDestroyRegion)(hrgn); } typedef int (proto_XDestroyWindow)( Display *display, Window w); static proto_XDestroyWindow *func_XDestroyWindow = NULL; int XDestroyWindow( Display *display, Window w) { if (!func_XDestroyWindow) func_XDestroyWindow=(proto_XDestroyWindow *)_loadfunc("XDestroyWindow"); return (func_XDestroyWindow)( display, w); } typedef char * (proto_XDisplayString)(Display *display); static proto_XDisplayString *func_XDisplayString = NULL; char * XDisplayString(Display *display) { if (!func_XDisplayString) func_XDisplayString=(proto_XDisplayString *)_loadfunc("XDisplayString"); return (func_XDisplayString)(display); } typedef int (proto_XDoesBackingStore)(Screen *scr); static proto_XDoesBackingStore *func_XDoesBackingStore = NULL; int XDoesBackingStore(Screen *scr) { if (!func_XDoesBackingStore) func_XDoesBackingStore=(proto_XDoesBackingStore *)_loadfunc("XDoesBackingStore"); return (func_XDoesBackingStore)(scr); } typedef int (proto_XDrawArc)( Display *display, Drawable w, GC gc, int x, int y, unsigned int width,unsigned int height, int a1, int a2); static proto_XDrawArc *func_XDrawArc = NULL; int XDrawArc( Display *display, Drawable w, GC gc, int x, int y, unsigned int width,unsigned int height, int a1, int a2) { if (!func_XDrawArc) func_XDrawArc=(proto_XDrawArc *)_loadfunc("XDrawArc"); return (func_XDrawArc)( display, w, gc, x, y, width,height, a1, a2); } typedef int (proto_XDrawImageString)( Display* display, Drawable d, GC gc, int x, int y, const char* string, int length); static proto_XDrawImageString *func_XDrawImageString = NULL; int XDrawImageString( Display* display, Drawable d, GC gc, int x, int y, const char* string, int length) { if (!func_XDrawImageString) func_XDrawImageString=(proto_XDrawImageString *)_loadfunc("XDrawImageString"); return (func_XDrawImageString)( display, d, gc, x, y, string, length); } typedef int (proto_XDrawImageString16)(Display *display, Drawable window, GC gc, int x, int y, const XChar2b* str, int len); static proto_XDrawImageString16 *func_XDrawImageString16 = NULL; int XDrawImageString16(Display *display, Drawable window, GC gc, int x, int y, const XChar2b* str, int len) { if (!func_XDrawImageString16) func_XDrawImageString16=(proto_XDrawImageString16 *)_loadfunc("XDrawImageString16"); return (func_XDrawImageString16)(display, window, gc, x, y, str, len); } typedef int (proto_XDrawLine)( Display *display, Drawable w, GC gc, int x1,int y1, int x2,int y2); static proto_XDrawLine *func_XDrawLine = NULL; int XDrawLine( Display *display, Drawable w, GC gc, int x1,int y1, int x2,int y2) { if (!func_XDrawLine) func_XDrawLine=(proto_XDrawLine *)_loadfunc("XDrawLine"); return (func_XDrawLine)( display, w, gc, x1,y1, x2,y2); } typedef int (proto_XDrawLines)( Display *display, Drawable w, GC gc, XPoint *points, int nps,int mode); static proto_XDrawLines *func_XDrawLines = NULL; int XDrawLines( Display *display, Drawable w, GC gc, XPoint *points, int nps,int mode) { if (!func_XDrawLines) func_XDrawLines=(proto_XDrawLines *)_loadfunc("XDrawLines"); return (func_XDrawLines)( display, w, gc, points, nps,mode); } typedef int (proto_XDrawPoint)( Display *display, Drawable w, GC gc, int x, int y); static proto_XDrawPoint *func_XDrawPoint = NULL; int XDrawPoint( Display *display, Drawable w, GC gc, int x, int y) { if (!func_XDrawPoint) func_XDrawPoint=(proto_XDrawPoint *)_loadfunc("XDrawPoint"); return (func_XDrawPoint)( display, w, gc, x, y); } typedef int (proto_XDrawPoints)( Display *display, Drawable w, GC gc, XPoint *points, int nps, int mode); static proto_XDrawPoints *func_XDrawPoints = NULL; int XDrawPoints( Display *display, Drawable w, GC gc, XPoint *points, int nps, int mode) { if (!func_XDrawPoints) func_XDrawPoints=(proto_XDrawPoints *)_loadfunc("XDrawPoints"); return (func_XDrawPoints)( display, w, gc, points, nps, mode); } typedef int (proto_XDrawRectangle)( Display *display, Drawable w, GC gc, int x, int y, unsigned int width, unsigned int height); static proto_XDrawRectangle *func_XDrawRectangle = NULL; int XDrawRectangle( Display *display, Drawable w, GC gc, int x, int y, unsigned int width, unsigned int height) { if (!func_XDrawRectangle) func_XDrawRectangle=(proto_XDrawRectangle *)_loadfunc("XDrawRectangle"); return (func_XDrawRectangle)( display, w, gc, x, y, width, height); } typedef int (proto_XDrawSegments)( Display *display, Drawable w, GC gc, XSegment *segs, int nsegs); static proto_XDrawSegments *func_XDrawSegments = NULL; int XDrawSegments( Display *display, Drawable w, GC gc, XSegment *segs, int nsegs) { if (!func_XDrawSegments) func_XDrawSegments=(proto_XDrawSegments *)_loadfunc("XDrawSegments"); return (func_XDrawSegments)( display, w, gc, segs, nsegs); } typedef int (proto_XDrawString)(Display *display, Drawable window, GC gc, int x, int y, const char* str, int len); static proto_XDrawString *func_XDrawString = NULL; int XDrawString(Display *display, Drawable window, GC gc, int x, int y, const char* str, int len) { if (!func_XDrawString) func_XDrawString=(proto_XDrawString *)_loadfunc("XDrawString"); return (func_XDrawString)(display, window, gc, x, y, str, len); } typedef int (proto_XDrawString16)(Display *display, Drawable window, GC gc, int x, int y, const XChar2b* str, int len); static proto_XDrawString16 *func_XDrawString16 = NULL; int XDrawString16(Display *display, Drawable window, GC gc, int x, int y, const XChar2b* str, int len) { if (!func_XDrawString16) func_XDrawString16=(proto_XDrawString16 *)_loadfunc("XDrawString16"); return (func_XDrawString16)(display, window, gc, x, y, str, len); } typedef StatusDef (proto_XFetchName)( Display *display, Window w, char **window_name_return); static proto_XFetchName *func_XFetchName = NULL; StatusDef XFetchName( Display *display, Window w, char **window_name_return) { if (!func_XFetchName) func_XFetchName=(proto_XFetchName *)_loadfunc("XFetchName"); return (func_XFetchName)( display, w, window_name_return); } typedef int (proto_XFillArc)( Display *display, Drawable w, GC gc, int x, int y, unsigned int width,unsigned height, int a1, int a2); static proto_XFillArc *func_XFillArc = NULL; int XFillArc( Display *display, Drawable w, GC gc, int x, int y, unsigned int width,unsigned height, int a1, int a2) { if (!func_XFillArc) func_XFillArc=(proto_XFillArc *)_loadfunc("XFillArc"); return (func_XFillArc)( display, w, gc, x, y, width,height, a1, a2); } typedef int (proto_XFillPolygon)( Display *display, Drawable w, GC gc, XPoint *points, int nps, int shape, int mode); static proto_XFillPolygon *func_XFillPolygon = NULL; int XFillPolygon( Display *display, Drawable w, GC gc, XPoint *points, int nps, int shape, int mode) { if (!func_XFillPolygon) func_XFillPolygon=(proto_XFillPolygon *)_loadfunc("XFillPolygon"); return (func_XFillPolygon)( display, w, gc, points, nps, shape, mode); } typedef int (proto_XFillRectangle)( Display *display, Drawable window, GC gc, int x, int y, unsigned int w, unsigned int h); static proto_XFillRectangle *func_XFillRectangle = NULL; int XFillRectangle( Display *display, Drawable window, GC gc, int x, int y, unsigned int w, unsigned int h) { if (!func_XFillRectangle) func_XFillRectangle=(proto_XFillRectangle *)_loadfunc("XFillRectangle"); return (func_XFillRectangle)( display, window, gc, x, y, w, h); } typedef BoolDef (proto_XFilterEvent)(XEvent* event,Window window); static proto_XFilterEvent *func_XFilterEvent = NULL; BoolDef XFilterEvent(XEvent* event,Window window) { if (!func_XFilterEvent) func_XFilterEvent=(proto_XFilterEvent *)_loadfunc("XFilterEvent"); return (func_XFilterEvent)(event,window); } typedef int (proto_XFlush)(Display *display); static proto_XFlush *func_XFlush = NULL; int XFlush(Display *display) { if (!func_XFlush) func_XFlush=(proto_XFlush *)_loadfunc("XFlush"); return (func_XFlush)(display); } typedef int (proto_XFree)(void *data); static proto_XFree *func_XFree = NULL; int XFree(void *data) { if (!func_XFree) func_XFree=(proto_XFree *)_loadfunc("XFree"); return (func_XFree)(data); } typedef int (proto_XFreeColors)(Display *display, Colormap cmap, unsigned long pixels[], int npixels, unsigned long planes); static proto_XFreeColors *func_XFreeColors = NULL; int XFreeColors(Display *display, Colormap cmap, unsigned long pixels[], int npixels, unsigned long planes) { if (!func_XFreeColors) func_XFreeColors=(proto_XFreeColors *)_loadfunc("XFreeColors"); return (func_XFreeColors)(display, cmap, pixels, npixels, planes); } typedef int (proto_XFreeExtensionList)(char **list); static proto_XFreeExtensionList *func_XFreeExtensionList = NULL; int XFreeExtensionList(char **list) { if (!func_XFreeExtensionList) func_XFreeExtensionList=(proto_XFreeExtensionList *)_loadfunc("XFreeExtensionList"); return (func_XFreeExtensionList)(list); } typedef int (proto_XFreeFont)(Display* display,XFontStruct* font_struct); static proto_XFreeFont *func_XFreeFont = NULL; int XFreeFont(Display* display,XFontStruct* font_struct) { if (!func_XFreeFont) func_XFreeFont=(proto_XFreeFont *)_loadfunc("XFreeFont"); return (func_XFreeFont)(display,font_struct); } typedef int (proto_XFreeGC)( Display *display, GC gc); static proto_XFreeGC *func_XFreeGC = NULL; int XFreeGC( Display *display, GC gc) { if (!func_XFreeGC) func_XFreeGC=(proto_XFreeGC *)_loadfunc("XFreeGC"); return (func_XFreeGC)( display, gc); } typedef int (proto_XFreeModifiermap)(XModifierKeymap *modmap); static proto_XFreeModifiermap *func_XFreeModifiermap = NULL; int XFreeModifiermap(XModifierKeymap *modmap) { if (!func_XFreeModifiermap) func_XFreeModifiermap=(proto_XFreeModifiermap *)_loadfunc("XFreeModifiermap"); return (func_XFreeModifiermap)(modmap); } typedef int (proto_XFreePixmap)( Display *display, Pixmap pixmap); static proto_XFreePixmap *func_XFreePixmap = NULL; int XFreePixmap( Display *display, Pixmap pixmap) { if (!func_XFreePixmap) func_XFreePixmap=(proto_XFreePixmap *)_loadfunc("XFreePixmap"); return (func_XFreePixmap)( display, pixmap); } typedef void (proto_XFreeStringList)(char **list); static proto_XFreeStringList *func_XFreeStringList = NULL; void XFreeStringList(char **list) { if (!func_XFreeStringList) func_XFreeStringList=(proto_XFreeStringList *)_loadfunc("XFreeStringList"); (func_XFreeStringList)(list); } typedef char * (proto_XGetAtomName)( Display *display, Atom atom); static proto_XGetAtomName *func_XGetAtomName = NULL; char * XGetAtomName( Display *display, Atom atom) { if (!func_XGetAtomName) func_XGetAtomName=(proto_XGetAtomName *)_loadfunc("XGetAtomName"); return (func_XGetAtomName)( display, atom); } typedef int (proto_XGetErrorDatabaseText)( Display *display, const char *name, const char *msg, const char *defstr, char *buf, int len); static proto_XGetErrorDatabaseText *func_XGetErrorDatabaseText = NULL; int XGetErrorDatabaseText( Display *display, const char *name, const char *msg, const char *defstr, char *buf, int len) { if (!func_XGetErrorDatabaseText) func_XGetErrorDatabaseText=(proto_XGetErrorDatabaseText *)_loadfunc("XGetErrorDatabaseText"); return (func_XGetErrorDatabaseText)( display, name, msg, defstr, buf, len); } typedef int (proto_XGetErrorText)( Display *display, int code, char *buf, int len); static proto_XGetErrorText *func_XGetErrorText = NULL; int XGetErrorText( Display *display, int code, char *buf, int len) { if (!func_XGetErrorText) func_XGetErrorText=(proto_XGetErrorText *)_loadfunc("XGetErrorText"); return (func_XGetErrorText)( display, code, buf, len); } typedef char ** (proto_XGetFontPath)( Display *display, int *nps); static proto_XGetFontPath *func_XGetFontPath = NULL; char ** XGetFontPath( Display *display, int *nps) { if (!func_XGetFontPath) func_XGetFontPath=(proto_XGetFontPath *)_loadfunc("XGetFontPath"); return (func_XGetFontPath)( display, nps); } typedef BoolDef (proto_XGetFontProperty)( XFontStruct *fstruct, Atom atom, unsigned long *val); static proto_XGetFontProperty *func_XGetFontProperty = NULL; BoolDef XGetFontProperty( XFontStruct *fstruct, Atom atom, unsigned long *val) { if (!func_XGetFontProperty) func_XGetFontProperty=(proto_XGetFontProperty *)_loadfunc("XGetFontProperty"); return (func_XGetFontProperty)( fstruct, atom, val); } typedef StatusDef (proto_XGetGeometry)( Display *display, Drawable w, Window *root, int *x, int *y, unsigned int *width, unsigned int *height, unsigned int *bw, unsigned int *depth); static proto_XGetGeometry *func_XGetGeometry = NULL; StatusDef XGetGeometry( Display *display, Drawable w, Window *root, int *x, int *y, unsigned int *width, unsigned int *height, unsigned int *bw, unsigned int *depth) { if (!func_XGetGeometry) func_XGetGeometry=(proto_XGetGeometry *)_loadfunc("XGetGeometry"); return (func_XGetGeometry)( display, w, root, x, y, width, height, bw, depth); } typedef int (proto_XGetIconName)( Display *display, Window w, char **iname); static proto_XGetIconName *func_XGetIconName = NULL; int XGetIconName( Display *display, Window w, char **iname) { if (!func_XGetIconName) func_XGetIconName=(proto_XGetIconName *)_loadfunc("XGetIconName"); return (func_XGetIconName)( display, w, iname); } typedef XImage * (proto_XGetImage)( Display *display, Drawable drawable, int x, int y, unsigned int width, unsigned int height, unsigned long plane_mask, int format); static proto_XGetImage *func_XGetImage = NULL; XImage * XGetImage( Display *display, Drawable drawable, int x, int y, unsigned int width, unsigned int height, unsigned long plane_mask, int format) { if (!func_XGetImage) func_XGetImage=(proto_XGetImage *)_loadfunc("XGetImage"); return (func_XGetImage)( display, drawable, x, y, width, height, plane_mask, format); } typedef int (proto_XGetInputFocus)( Display *display, Window *focus, int *revto); static proto_XGetInputFocus *func_XGetInputFocus = NULL; int XGetInputFocus( Display *display, Window *focus, int *revto) { if (!func_XGetInputFocus) func_XGetInputFocus=(proto_XGetInputFocus *)_loadfunc("XGetInputFocus"); return (func_XGetInputFocus)( display, focus, revto); } typedef XModifierKeymap * (proto_XGetModifierMapping)(Display *display); static proto_XGetModifierMapping *func_XGetModifierMapping = NULL; XModifierKeymap * XGetModifierMapping(Display *display) { if (!func_XGetModifierMapping) func_XGetModifierMapping=(proto_XGetModifierMapping *)_loadfunc("XGetModifierMapping"); return (func_XGetModifierMapping)(display); } typedef Window (proto_XGetSelectionOwner)( Display* display, Atom selection); static proto_XGetSelectionOwner *func_XGetSelectionOwner = NULL; Window XGetSelectionOwner( Display* display, Atom selection) { if (!func_XGetSelectionOwner) func_XGetSelectionOwner=(proto_XGetSelectionOwner *)_loadfunc("XGetSelectionOwner"); return (func_XGetSelectionOwner)( display, selection); } typedef StatusDef (proto_XGetStandardColormap)( Display *display, Window w, XStandardColormap *cmapinf, Atom prop); static proto_XGetStandardColormap *func_XGetStandardColormap = NULL; StatusDef XGetStandardColormap( Display *display, Window w, XStandardColormap *cmapinf, Atom prop) { if (!func_XGetStandardColormap) func_XGetStandardColormap=(proto_XGetStandardColormap *)_loadfunc("XGetStandardColormap"); return (func_XGetStandardColormap)( display, w, cmapinf, prop); } typedef XVisualInfo * (proto_XGetVisualInfo)( Display *display, long vinm, XVisualInfo *vint, int *n); static proto_XGetVisualInfo *func_XGetVisualInfo = NULL; XVisualInfo * XGetVisualInfo( Display *display, long vinm, XVisualInfo *vint, int *n) { if (!func_XGetVisualInfo) func_XGetVisualInfo=(proto_XGetVisualInfo *)_loadfunc("XGetVisualInfo"); return (func_XGetVisualInfo)( display, vinm, vint, n); } typedef StatusDef (proto_XGetWindowAttributes)(Display *display, Window w, XWindowAttributes *wattr); static proto_XGetWindowAttributes *func_XGetWindowAttributes = NULL; StatusDef XGetWindowAttributes(Display *display, Window w, XWindowAttributes *wattr) { if (!func_XGetWindowAttributes) func_XGetWindowAttributes=(proto_XGetWindowAttributes *)_loadfunc("XGetWindowAttributes"); return (func_XGetWindowAttributes)(display, w, wattr); } typedef int (proto_XGetWindowProperty)( Display *display, Window window, Atom property, long long_offset, long long_length, BoolDef delete, Atom req_type, Atom *actual_type_return, int *actual_format_return, unsigned long *nitems_return, unsigned long *bytes_after_return, unsigned char **prop_return); static proto_XGetWindowProperty *func_XGetWindowProperty = NULL; int XGetWindowProperty( Display *display, Window window, Atom property, long long_offset, long long_length, BoolDef delete, Atom req_type, Atom *actual_type_return, int *actual_format_return, unsigned long *nitems_return, unsigned long *bytes_after_return, unsigned char **prop_return) { if (!func_XGetWindowProperty) func_XGetWindowProperty=(proto_XGetWindowProperty *)_loadfunc("XGetWindowProperty"); return (func_XGetWindowProperty)( display, window, property, long_offset, long_length, delete, req_type, actual_type_return, actual_format_return, nitems_return, bytes_after_return, prop_return); } typedef int (proto_XGrabServer)(Display *display); static proto_XGrabServer *func_XGrabServer = NULL; int XGrabServer(Display *display) { if (!func_XGrabServer) func_XGrabServer=(proto_XGrabServer *)_loadfunc("XGrabServer"); return (func_XGrabServer)(display); } typedef int (proto_XIconifyWindow)(Display *display, Window w, int screen_number); static proto_XIconifyWindow *func_XIconifyWindow = NULL; int XIconifyWindow(Display *display, Window w, int screen_number) { if (!func_XIconifyWindow) func_XIconifyWindow=(proto_XIconifyWindow *)_loadfunc("XIconifyWindow"); return (func_XIconifyWindow)(display, w, screen_number); } typedef XExtCodes * (proto_XInitExtension)(Display *display, const char *name); static proto_XInitExtension *func_XInitExtension = NULL; XExtCodes * XInitExtension(Display *display, const char *name) { if (!func_XInitExtension) func_XInitExtension=(proto_XInitExtension *)_loadfunc("XInitExtension"); return (func_XInitExtension)(display, name); } typedef Atom (proto_XInternAtom)( Display *display, const char *property_name, BoolDef only_if_exists); static proto_XInternAtom *func_XInternAtom = NULL; Atom XInternAtom( Display *display, const char *property_name, BoolDef only_if_exists) { if (!func_XInternAtom) func_XInternAtom=(proto_XInternAtom *)_loadfunc("XInternAtom"); return (func_XInternAtom)( display, property_name, only_if_exists); } typedef KeySym (proto_XKeycodeToKeysym)( Display *display, unsigned int keycode, int index); static proto_XKeycodeToKeysym *func_XKeycodeToKeysym = NULL; KeySym XKeycodeToKeysym( Display *display, unsigned int keycode, int index) { if (!func_XKeycodeToKeysym) func_XKeycodeToKeysym=(proto_XKeycodeToKeysym *)_loadfunc("XKeycodeToKeysym"); return (func_XKeycodeToKeysym)( display, keycode, index); } typedef KeyCode (proto_XKeysymToKeycode)( Display *display, KeySym keysym); static proto_XKeysymToKeycode *func_XKeysymToKeycode = NULL; KeyCode XKeysymToKeycode( Display *display, KeySym keysym) { if (!func_XKeysymToKeycode) func_XKeysymToKeycode=(proto_XKeysymToKeycode *)_loadfunc("XKeysymToKeycode"); return (func_XKeysymToKeycode)( display, keysym); } typedef char ** (proto_XListExtensions)( Display *display, int *ret_num); static proto_XListExtensions *func_XListExtensions = NULL; char ** XListExtensions( Display *display, int *ret_num) { if (!func_XListExtensions) func_XListExtensions=(proto_XListExtensions *)_loadfunc("XListExtensions"); return (func_XListExtensions)( display, ret_num); } typedef XFontStruct * (proto_XLoadQueryFont)(Display *display, const char *name); static proto_XLoadQueryFont *func_XLoadQueryFont = NULL; XFontStruct * XLoadQueryFont(Display *display, const char *name) { if (!func_XLoadQueryFont) func_XLoadQueryFont=(proto_XLoadQueryFont *)_loadfunc("XLoadQueryFont"); return (func_XLoadQueryFont)(display, name); } typedef int (proto_XLookupString)( XKeyEvent *event, char *buf, int nbytes, KeySym *keysym, XComposeStatus *status); static proto_XLookupString *func_XLookupString = NULL; int XLookupString( XKeyEvent *event, char *buf, int nbytes, KeySym *keysym, XComposeStatus *status) { if (!func_XLookupString) func_XLookupString=(proto_XLookupString *)_loadfunc("XLookupString"); return (func_XLookupString)( event, buf, nbytes, keysym, status); } typedef int (proto_XLowerWindow)(Display *display, Window w); static proto_XLowerWindow *func_XLowerWindow = NULL; int XLowerWindow(Display *display, Window w) { if (!func_XLowerWindow) func_XLowerWindow=(proto_XLowerWindow *)_loadfunc("XLowerWindow"); return (func_XLowerWindow)(display, w); } typedef int (proto_XMapRaised)( Display *display, Window w); static proto_XMapRaised *func_XMapRaised = NULL; int XMapRaised( Display *display, Window w) { if (!func_XMapRaised) func_XMapRaised=(proto_XMapRaised *)_loadfunc("XMapRaised"); return (func_XMapRaised)( display, w); } typedef int (proto_XMapSubwindows)( Display *display, Window w); static proto_XMapSubwindows *func_XMapSubwindows = NULL; int XMapSubwindows( Display *display, Window w) { if (!func_XMapSubwindows) func_XMapSubwindows=(proto_XMapSubwindows *)_loadfunc("XMapSubwindows"); return (func_XMapSubwindows)( display, w); } typedef int (proto_XMapWindow)(Display *display, Window window); static proto_XMapWindow *func_XMapWindow = NULL; int XMapWindow(Display *display, Window window) { if (!func_XMapWindow) func_XMapWindow=(proto_XMapWindow *)_loadfunc("XMapWindow"); return (func_XMapWindow)(display, window); } typedef StatusDef (proto_XMatchVisualInfo)( Display* display, int screen, int depth, int class, XVisualInfo* vinfo_return); static proto_XMatchVisualInfo *func_XMatchVisualInfo = NULL; StatusDef XMatchVisualInfo( Display* display, int screen, int depth, int class, XVisualInfo* vinfo_return) { if (!func_XMatchVisualInfo) func_XMatchVisualInfo=(proto_XMatchVisualInfo *)_loadfunc("XMatchVisualInfo"); return (func_XMatchVisualInfo)( display, screen, depth, class, vinfo_return); } typedef int (proto_XMoveResizeWindow)( Display* display, Window w, int x, int y, unsigned int width, unsigned int height); static proto_XMoveResizeWindow *func_XMoveResizeWindow = NULL; int XMoveResizeWindow( Display* display, Window w, int x, int y, unsigned int width, unsigned int height) { if (!func_XMoveResizeWindow) func_XMoveResizeWindow=(proto_XMoveResizeWindow *)_loadfunc("XMoveResizeWindow"); return (func_XMoveResizeWindow)( display, w, x, y, width, height); } typedef int (proto_XMoveWindow)( Display* display, Window w, int x, int y); static proto_XMoveWindow *func_XMoveWindow = NULL; int XMoveWindow( Display* display, Window w, int x, int y) { if (!func_XMoveWindow) func_XMoveWindow=(proto_XMoveWindow *)_loadfunc("XMoveWindow"); return (func_XMoveWindow)( display, w, x, y); } typedef int (proto_XNextEvent)( Display *display, XEvent *event); static proto_XNextEvent *func_XNextEvent = NULL; int XNextEvent( Display *display, XEvent *event) { if (!func_XNextEvent) func_XNextEvent=(proto_XNextEvent *)_loadfunc("XNextEvent"); return (func_XNextEvent)( display, event); } typedef XIM (proto_XOpenIM)( Display* dpy, struct _XrmHashBucketRec* rdb, char* res_name, char* res_class); static proto_XOpenIM *func_XOpenIM = NULL; XIM XOpenIM( Display* dpy, struct _XrmHashBucketRec* rdb, char* res_name, char* res_class) { if (!func_XOpenIM) func_XOpenIM=(proto_XOpenIM *)_loadfunc("XOpenIM"); return (func_XOpenIM)( dpy, rdb, res_name, res_class); } typedef StatusDef (proto_XParseColor)( Display *display, Colormap map, const char* spec, XColor *colorPtr); static proto_XParseColor *func_XParseColor = NULL; StatusDef XParseColor( Display *display, Colormap map, const char* spec, XColor *colorPtr) { if (!func_XParseColor) func_XParseColor=(proto_XParseColor *)_loadfunc("XParseColor"); return (func_XParseColor)( display, map, spec, colorPtr); } typedef int (proto_XParseGeometry)( const char* string, int* x, int* y, unsigned int* width, unsigned int* height); static proto_XParseGeometry *func_XParseGeometry = NULL; int XParseGeometry( const char* string, int* x, int* y, unsigned int* width, unsigned int* height) { if (!func_XParseGeometry) func_XParseGeometry=(proto_XParseGeometry *)_loadfunc("XParseGeometry"); return (func_XParseGeometry)( string, x, y, width, height); } typedef int (proto_XPending)(Display *display); static proto_XPending *func_XPending = NULL; int XPending(Display *display) { if (!func_XPending) func_XPending=(proto_XPending *)_loadfunc("XPending"); return (func_XPending)(display); } typedef int (proto_XPutBackEvent)(Display *display, XEvent *event); static proto_XPutBackEvent *func_XPutBackEvent = NULL; int XPutBackEvent(Display *display, XEvent *event) { if (!func_XPutBackEvent) func_XPutBackEvent=(proto_XPutBackEvent *)_loadfunc("XPutBackEvent"); return (func_XPutBackEvent)(display, event); } typedef int (proto_XPutImage)( Display *display, Drawable w, GC gc, XImage *image, int sx,int sy,int dx,int dy, unsigned int width,unsigned int height); static proto_XPutImage *func_XPutImage = NULL; int XPutImage( Display *display, Drawable w, GC gc, XImage *image, int sx,int sy,int dx,int dy, unsigned int width,unsigned int height) { if (!func_XPutImage) func_XPutImage=(proto_XPutImage *)_loadfunc("XPutImage"); return (func_XPutImage)( display, w, gc, image, sx,sy,dx,dy, width,height); } typedef int (proto_XQueryColor)( Display *display, Colormap cmap, XColor *cell); static proto_XQueryColor *func_XQueryColor = NULL; int XQueryColor( Display *display, Colormap cmap, XColor *cell) { if (!func_XQueryColor) func_XQueryColor=(proto_XQueryColor *)_loadfunc("XQueryColor"); return (func_XQueryColor)( display, cmap, cell); } typedef int (proto_XQueryColors)( Display *display, Colormap cmap, XColor *cells, int nc); static proto_XQueryColors *func_XQueryColors = NULL; int XQueryColors( Display *display, Colormap cmap, XColor *cells, int nc) { if (!func_XQueryColors) func_XQueryColors=(proto_XQueryColors *)_loadfunc("XQueryColors"); return (func_XQueryColors)( display, cmap, cells, nc); } typedef XFontStruct * (proto_XQueryFont)( Display *display, XID font_id); static proto_XQueryFont *func_XQueryFont = NULL; XFontStruct * XQueryFont( Display *display, XID font_id) { if (!func_XQueryFont) func_XQueryFont=(proto_XQueryFont *)_loadfunc("XQueryFont"); return (func_XQueryFont)( display, font_id); } typedef BoolDef (proto_XQueryPointer)( Display* display, Window w, Window* root_return, Window* child_return, int* root_x_return, int* root_y_return, int* win_x_return, int* win_y_return, unsigned int* mask_return); static proto_XQueryPointer *func_XQueryPointer = NULL; BoolDef XQueryPointer( Display* display, Window w, Window* root_return, Window* child_return, int* root_x_return, int* root_y_return, int* win_x_return, int* win_y_return, unsigned int* mask_return) { if (!func_XQueryPointer) func_XQueryPointer=(proto_XQueryPointer *)_loadfunc("XQueryPointer"); return (func_XQueryPointer)( display, w, root_return, child_return, root_x_return, root_y_return, win_x_return, win_y_return, mask_return); } typedef StatusDef (proto_XQueryTree)( Display *display, Window w, Window* root, Window* parent, Window** ch, unsigned int *n); static proto_XQueryTree *func_XQueryTree = NULL; StatusDef XQueryTree( Display *display, Window w, Window* root, Window* parent, Window** ch, unsigned int *n) { if (!func_XQueryTree) func_XQueryTree=(proto_XQueryTree *)_loadfunc("XQueryTree"); return (func_XQueryTree)( display, w, root, parent, ch, n); } typedef int (proto_XRaiseWindow)( Display *display, Window w); static proto_XRaiseWindow *func_XRaiseWindow = NULL; int XRaiseWindow( Display *display, Window w) { if (!func_XRaiseWindow) func_XRaiseWindow=(proto_XRaiseWindow *)_loadfunc("XRaiseWindow"); return (func_XRaiseWindow)( display, w); } typedef int (proto_XRecolorCursor)( Display *display, Cursor cursor, XColor *fg,XColor *bg); static proto_XRecolorCursor *func_XRecolorCursor = NULL; int XRecolorCursor( Display *display, Cursor cursor, XColor *fg,XColor *bg) { if (!func_XRecolorCursor) func_XRecolorCursor=(proto_XRecolorCursor *)_loadfunc("XRecolorCursor"); return (func_XRecolorCursor)( display, cursor, fg,bg); } typedef int (proto_XRefreshKeyboardMapping)(XMappingEvent *event); static proto_XRefreshKeyboardMapping *func_XRefreshKeyboardMapping = NULL; int XRefreshKeyboardMapping(XMappingEvent *event) { if (!func_XRefreshKeyboardMapping) func_XRefreshKeyboardMapping=(proto_XRefreshKeyboardMapping *)_loadfunc("XRefreshKeyboardMapping"); return (func_XRefreshKeyboardMapping)(event); } typedef int (proto_XResizeWindow)( Display* display, Window w, unsigned int width, unsigned int height); static proto_XResizeWindow *func_XResizeWindow = NULL; int XResizeWindow( Display* display, Window w, unsigned int width, unsigned int height) { if (!func_XResizeWindow) func_XResizeWindow=(proto_XResizeWindow *)_loadfunc("XResizeWindow"); return (func_XResizeWindow)( display, w, width, height); } typedef Window (proto_XRootWindow)( Display *display, int scr); static proto_XRootWindow *func_XRootWindow = NULL; Window XRootWindow( Display *display, int scr) { if (!func_XRootWindow) func_XRootWindow=(proto_XRootWindow *)_loadfunc("XRootWindow"); return (func_XRootWindow)( display, scr); } typedef Window (proto_XRootWindowOfScreen)(Screen *scr); static proto_XRootWindowOfScreen *func_XRootWindowOfScreen = NULL; Window XRootWindowOfScreen(Screen *scr) { if (!func_XRootWindowOfScreen) func_XRootWindowOfScreen=(proto_XRootWindowOfScreen *)_loadfunc("XRootWindowOfScreen"); return (func_XRootWindowOfScreen)(scr); } typedef Screen * (proto_XScreenOfDisplay)( Display *display, int scr); static proto_XScreenOfDisplay *func_XScreenOfDisplay = NULL; Screen * XScreenOfDisplay( Display *display, int scr) { if (!func_XScreenOfDisplay) func_XScreenOfDisplay=(proto_XScreenOfDisplay *)_loadfunc("XScreenOfDisplay"); return (func_XScreenOfDisplay)( display, scr); } typedef int (proto_XSelectInput)(Display *display, Window window, long mask); static proto_XSelectInput *func_XSelectInput = NULL; int XSelectInput(Display *display, Window window, long mask) { if (!func_XSelectInput) func_XSelectInput=(proto_XSelectInput *)_loadfunc("XSelectInput"); return (func_XSelectInput)(display, window, mask); } typedef StatusDef (proto_XSendEvent)( Display *display, Window w, BoolDef prop, long emask, XEvent *event); static proto_XSendEvent *func_XSendEvent = NULL; StatusDef XSendEvent( Display *display, Window w, BoolDef prop, long emask, XEvent *event) { if (!func_XSendEvent) func_XSendEvent=(proto_XSendEvent *)_loadfunc("XSendEvent"); return (func_XSendEvent)( display, w, prop, emask, event); } typedef char * (proto_XServerVendor)(Display *display); static proto_XServerVendor *func_XServerVendor = NULL; char * XServerVendor(Display *display) { if (!func_XServerVendor) func_XServerVendor=(proto_XServerVendor *)_loadfunc("XServerVendor"); return (func_XServerVendor)(display); } typedef int (proto_XSetClassHint)( Display *display, Window w, XClassHint *chints); static proto_XSetClassHint *func_XSetClassHint = NULL; int XSetClassHint( Display *display, Window w, XClassHint *chints) { if (!func_XSetClassHint) func_XSetClassHint=(proto_XSetClassHint *)_loadfunc("XSetClassHint"); return (func_XSetClassHint)( display, w, chints); } typedef int (proto_XSetClipMask)( Display *display, GC gc, Pixmap cmask); static proto_XSetClipMask *func_XSetClipMask = NULL; int XSetClipMask( Display *display, GC gc, Pixmap cmask) { if (!func_XSetClipMask) func_XSetClipMask=(proto_XSetClipMask *)_loadfunc("XSetClipMask"); return (func_XSetClipMask)( display, gc, cmask); } typedef int (proto_XSetClipRectangles)( Display *display, GC gc, int clx, int cly, XRectangle *rs, int n, int order); static proto_XSetClipRectangles *func_XSetClipRectangles = NULL; int XSetClipRectangles( Display *display, GC gc, int clx, int cly, XRectangle *rs, int n, int order) { if (!func_XSetClipRectangles) func_XSetClipRectangles=(proto_XSetClipRectangles *)_loadfunc("XSetClipRectangles"); return (func_XSetClipRectangles)( display, gc, clx, cly, rs, n, order); } typedef int (proto_XSetDashes)(Display *display, GC gc, int dash_offset, const char * dash_list, int n); static proto_XSetDashes *func_XSetDashes = NULL; int XSetDashes(Display *display, GC gc, int dash_offset, const char * dash_list, int n) { if (!func_XSetDashes) func_XSetDashes=(proto_XSetDashes *)_loadfunc("XSetDashes"); return (func_XSetDashes)(display, gc, dash_offset, dash_list, n); } typedef XErrorHandler (proto_XSetErrorHandler)(XErrorHandler handler); static proto_XSetErrorHandler *func_XSetErrorHandler = NULL; XErrorHandler XSetErrorHandler(XErrorHandler handler) { if (!func_XSetErrorHandler) func_XSetErrorHandler=(proto_XSetErrorHandler *)_loadfunc("XSetErrorHandler"); return (func_XSetErrorHandler)(handler); } typedef int (proto_XSetFillStyle)( Display *display, GC gc, int fs); static proto_XSetFillStyle *func_XSetFillStyle = NULL; int XSetFillStyle( Display *display, GC gc, int fs) { if (!func_XSetFillStyle) func_XSetFillStyle=(proto_XSetFillStyle *)_loadfunc("XSetFillStyle"); return (func_XSetFillStyle)( display, gc, fs); } typedef int (proto_XSetFont)( Display *display, GC gc, Font font); static proto_XSetFont *func_XSetFont = NULL; int XSetFont( Display *display, GC gc, Font font) { if (!func_XSetFont) func_XSetFont=(proto_XSetFont *)_loadfunc("XSetFont"); return (func_XSetFont)( display, gc, font); } typedef int (proto_XSetFontPath)( Display *display, char **dirs, int nd); static proto_XSetFontPath *func_XSetFontPath = NULL; int XSetFontPath( Display *display, char **dirs, int nd) { if (!func_XSetFontPath) func_XSetFontPath=(proto_XSetFontPath *)_loadfunc("XSetFontPath"); return (func_XSetFontPath)( display, dirs, nd); } typedef int (proto_XSetForeground)( Display *display, GC gc, unsigned long color); static proto_XSetForeground *func_XSetForeground = NULL; int XSetForeground( Display *display, GC gc, unsigned long color) { if (!func_XSetForeground) func_XSetForeground=(proto_XSetForeground *)_loadfunc("XSetForeground"); return (func_XSetForeground)( display, gc, color); } typedef int (proto_XSetFunction)( Display *display, GC gc, int fn); static proto_XSetFunction *func_XSetFunction = NULL; int XSetFunction( Display *display, GC gc, int fn) { if (!func_XSetFunction) func_XSetFunction=(proto_XSetFunction *)_loadfunc("XSetFunction"); return (func_XSetFunction)( display, gc, fn); } typedef void (proto_XSetICFocus)(XIC ic); static proto_XSetICFocus *func_XSetICFocus = NULL; void XSetICFocus(XIC ic) { if (!func_XSetICFocus) func_XSetICFocus=(proto_XSetICFocus *)_loadfunc("XSetICFocus"); (func_XSetICFocus)(ic); } typedef int (proto_XSetIconName)(Display *display, Window w, const char *iname); static proto_XSetIconName *func_XSetIconName = NULL; int XSetIconName(Display *display, Window w, const char *iname) { if (!func_XSetIconName) func_XSetIconName=(proto_XSetIconName *)_loadfunc("XSetIconName"); return (func_XSetIconName)(display, w, iname); } typedef int (proto_XSetInputFocus)( Display *display, Window focus, int revto, Time time); static proto_XSetInputFocus *func_XSetInputFocus = NULL; int XSetInputFocus( Display *display, Window focus, int revto, Time time) { if (!func_XSetInputFocus) func_XSetInputFocus=(proto_XSetInputFocus *)_loadfunc("XSetInputFocus"); return (func_XSetInputFocus)( display, focus, revto, time); } typedef int (proto_XSetLineAttributes)( Display *display, GC gc, unsigned int lw, int ls, int cs, int js); static proto_XSetLineAttributes *func_XSetLineAttributes = NULL; int XSetLineAttributes( Display *display, GC gc, unsigned int lw, int ls, int cs, int js) { if (!func_XSetLineAttributes) func_XSetLineAttributes=(proto_XSetLineAttributes *)_loadfunc("XSetLineAttributes"); return (func_XSetLineAttributes)( display, gc, lw, ls, cs, js); } typedef char * (proto_XSetLocaleModifiers)(const char* modifier_list); static proto_XSetLocaleModifiers *func_XSetLocaleModifiers = NULL; char * XSetLocaleModifiers(const char* modifier_list) { if (!func_XSetLocaleModifiers) func_XSetLocaleModifiers=(proto_XSetLocaleModifiers *)_loadfunc("XSetLocaleModifiers"); return (func_XSetLocaleModifiers)(modifier_list); } typedef int (proto_XSetNormalHints)( Display *display, Window w, XSizeHints *hints); static proto_XSetNormalHints *func_XSetNormalHints = NULL; int XSetNormalHints( Display *display, Window w, XSizeHints *hints) { if (!func_XSetNormalHints) func_XSetNormalHints=(proto_XSetNormalHints *)_loadfunc("XSetNormalHints"); return (func_XSetNormalHints)( display, w, hints); } typedef int (proto_XSetPlaneMask)( Display *display, GC gc, unsigned long pmask); static proto_XSetPlaneMask *func_XSetPlaneMask = NULL; int XSetPlaneMask( Display *display, GC gc, unsigned long pmask) { if (!func_XSetPlaneMask) func_XSetPlaneMask=(proto_XSetPlaneMask *)_loadfunc("XSetPlaneMask"); return (func_XSetPlaneMask)( display, gc, pmask); } typedef int (proto_XSetRegion)( Display *display, GC gc, Region hrgn); static proto_XSetRegion *func_XSetRegion = NULL; int XSetRegion( Display *display, GC gc, Region hrgn) { if (!func_XSetRegion) func_XSetRegion=(proto_XSetRegion *)_loadfunc("XSetRegion"); return (func_XSetRegion)( display, gc, hrgn); } typedef int (proto_XSetSelectionOwner)( Display* display, Atom sel, Window owner, Time time); static proto_XSetSelectionOwner *func_XSetSelectionOwner = NULL; int XSetSelectionOwner( Display* display, Atom sel, Window owner, Time time) { if (!func_XSetSelectionOwner) func_XSetSelectionOwner=(proto_XSetSelectionOwner *)_loadfunc("XSetSelectionOwner"); return (func_XSetSelectionOwner)( display, sel, owner, time); } typedef int (proto_XSetTile)( Display *display, GC gc, Pixmap tile); static proto_XSetTile *func_XSetTile = NULL; int XSetTile( Display *display, GC gc, Pixmap tile) { if (!func_XSetTile) func_XSetTile=(proto_XSetTile *)_loadfunc("XSetTile"); return (func_XSetTile)( display, gc, tile); } typedef int (proto_XSetWMHints)( Display *display, Window w, XWMHints *wmhints); static proto_XSetWMHints *func_XSetWMHints = NULL; int XSetWMHints( Display *display, Window w, XWMHints *wmhints) { if (!func_XSetWMHints) func_XSetWMHints=(proto_XSetWMHints *)_loadfunc("XSetWMHints"); return (func_XSetWMHints)( display, w, wmhints); } typedef void (proto_XSetWMNormalHints)(Display* display,Window w,XSizeHints* hints); static proto_XSetWMNormalHints *func_XSetWMNormalHints = NULL; void XSetWMNormalHints(Display* display,Window w,XSizeHints* hints) { if (!func_XSetWMNormalHints) func_XSetWMNormalHints=(proto_XSetWMNormalHints *)_loadfunc("XSetWMNormalHints"); (func_XSetWMNormalHints)(display,w,hints); } typedef void (proto_XSetWMProperties)( Display* display, Window w, XTextProperty* window_name, XTextProperty* icon_name, char** argv, int argc, XSizeHints* normal_hints, XWMHints* wm_hints, XClassHint* class_hints); static proto_XSetWMProperties *func_XSetWMProperties = NULL; void XSetWMProperties( Display* display, Window w, XTextProperty* window_name, XTextProperty* icon_name, char** argv, int argc, XSizeHints* normal_hints, XWMHints* wm_hints, XClassHint* class_hints) { if (!func_XSetWMProperties) func_XSetWMProperties=(proto_XSetWMProperties *)_loadfunc("XSetWMProperties"); (func_XSetWMProperties)( display, w, window_name, icon_name, argv, argc, normal_hints, wm_hints, class_hints); } typedef StatusDef (proto_XSetWMProtocols)( Display *display, Window w, Atom *prots, int co); static proto_XSetWMProtocols *func_XSetWMProtocols = NULL; StatusDef XSetWMProtocols( Display *display, Window w, Atom *prots, int co) { if (!func_XSetWMProtocols) func_XSetWMProtocols=(proto_XSetWMProtocols *)_loadfunc("XSetWMProtocols"); return (func_XSetWMProtocols)( display, w, prots, co); } typedef int (proto_XSetWindowBackground)( Display *display, Window w, unsigned long bg); static proto_XSetWindowBackground *func_XSetWindowBackground = NULL; int XSetWindowBackground( Display *display, Window w, unsigned long bg) { if (!func_XSetWindowBackground) func_XSetWindowBackground=(proto_XSetWindowBackground *)_loadfunc("XSetWindowBackground"); return (func_XSetWindowBackground)( display, w, bg); } typedef int (proto_XSetWindowBackgroundPixmap)( Display *display, Window w, Pixmap background_tile); static proto_XSetWindowBackgroundPixmap *func_XSetWindowBackgroundPixmap = NULL; int XSetWindowBackgroundPixmap( Display *display, Window w, Pixmap background_tile) { if (!func_XSetWindowBackgroundPixmap) func_XSetWindowBackgroundPixmap=(proto_XSetWindowBackgroundPixmap *)_loadfunc("XSetWindowBackgroundPixmap"); return (func_XSetWindowBackgroundPixmap)( display, w, background_tile); } typedef int (proto_XStoreColor)( Display *display, Colormap cmap, XColor *cell); static proto_XStoreColor *func_XStoreColor = NULL; int XStoreColor( Display *display, Colormap cmap, XColor *cell) { if (!func_XStoreColor) func_XStoreColor=(proto_XStoreColor *)_loadfunc("XStoreColor"); return (func_XStoreColor)( display, cmap, cell); } typedef int (proto_XStoreColors)( Display *display, Colormap cmap, XColor *cells, int nc); static proto_XStoreColors *func_XStoreColors = NULL; int XStoreColors( Display *display, Colormap cmap, XColor *cells, int nc) { if (!func_XStoreColors) func_XStoreColors=(proto_XStoreColors *)_loadfunc("XStoreColors"); return (func_XStoreColors)( display, cmap, cells, nc); } typedef int (proto_XStoreName)(Display *display, Window w, const char *wname); static proto_XStoreName *func_XStoreName = NULL; int XStoreName(Display *display, Window w, const char *wname) { if (!func_XStoreName) func_XStoreName=(proto_XStoreName *)_loadfunc("XStoreName"); return (func_XStoreName)(display, w, wname); } typedef KeySym (proto_XStringToKeysym)(const char *str); static proto_XStringToKeysym *func_XStringToKeysym = NULL; KeySym XStringToKeysym(const char *str) { if (!func_XStringToKeysym) func_XStringToKeysym=(proto_XStringToKeysym *)_loadfunc("XStringToKeysym"); return (func_XStringToKeysym)(str); } typedef int (proto_XSync)(Display *display,int discard); static proto_XSync *func_XSync = NULL; int XSync(Display *display,int discard) { if (!func_XSync) func_XSync=(proto_XSync *)_loadfunc("XSync"); return (func_XSync)(display,discard); } typedef int (proto_XTextExtents)( XFontStruct *fstruct, const char *str, int nc, int *dir,int *ascent,int *descent, XCharStruct *overall); static proto_XTextExtents *func_XTextExtents = NULL; int XTextExtents( XFontStruct *fstruct, const char *str, int nc, int *dir,int *ascent,int *descent, XCharStruct *overall) { if (!func_XTextExtents) func_XTextExtents=(proto_XTextExtents *)_loadfunc("XTextExtents"); return (func_XTextExtents)( fstruct, str, nc, dir,ascent,descent, overall); } typedef int (proto_XTextExtents16)( XFontStruct *fstruct, const XChar2b *str, int nc, int *dir, int *ascent, int *descent, XCharStruct *overall); static proto_XTextExtents16 *func_XTextExtents16 = NULL; int XTextExtents16( XFontStruct *fstruct, const XChar2b *str, int nc, int *dir, int *ascent, int *descent, XCharStruct *overall) { if (!func_XTextExtents16) func_XTextExtents16=(proto_XTextExtents16 *)_loadfunc("XTextExtents16"); return (func_XTextExtents16)( fstruct, str, nc, dir, ascent, descent, overall); } typedef int (proto_XTextWidth)( XFontStruct *fstruct, const char *str, int co); static proto_XTextWidth *func_XTextWidth = NULL; int XTextWidth( XFontStruct *fstruct, const char *str, int co) { if (!func_XTextWidth) func_XTextWidth=(proto_XTextWidth *)_loadfunc("XTextWidth"); return (func_XTextWidth)( fstruct, str, co); } typedef int (proto_XTextWidth16)( XFontStruct *fstruct, const XChar2b *str, int co); static proto_XTextWidth16 *func_XTextWidth16 = NULL; int XTextWidth16( XFontStruct *fstruct, const XChar2b *str, int co) { if (!func_XTextWidth16) func_XTextWidth16=(proto_XTextWidth16 *)_loadfunc("XTextWidth16"); return (func_XTextWidth16)( fstruct, str, co); } typedef BoolDef (proto_XTranslateCoordinates)( Display *display, Window sw, Window dw, int sx, int sy, int *dx, int *dy, Window *ch); static proto_XTranslateCoordinates *func_XTranslateCoordinates = NULL; BoolDef XTranslateCoordinates( Display *display, Window sw, Window dw, int sx, int sy, int *dx, int *dy, Window *ch) { if (!func_XTranslateCoordinates) func_XTranslateCoordinates=(proto_XTranslateCoordinates *)_loadfunc("XTranslateCoordinates"); return (func_XTranslateCoordinates)( display, sw, dw, sx, sy, dx, dy, ch); } typedef int (proto_XUngrabServer)(Display *display); static proto_XUngrabServer *func_XUngrabServer = NULL; int XUngrabServer(Display *display) { if (!func_XUngrabServer) func_XUngrabServer=(proto_XUngrabServer *)_loadfunc("XUngrabServer"); return (func_XUngrabServer)(display); } typedef int (proto_XUnionRectWithRegion)(XRectangle *rect, Region hrgnsrc, Region hrgndest); static proto_XUnionRectWithRegion *func_XUnionRectWithRegion = NULL; int XUnionRectWithRegion(XRectangle *rect, Region hrgnsrc, Region hrgndest) { if (!func_XUnionRectWithRegion) func_XUnionRectWithRegion=(proto_XUnionRectWithRegion *)_loadfunc("XUnionRectWithRegion"); return (func_XUnionRectWithRegion)(rect, hrgnsrc, hrgndest); } typedef int (proto_XUnmapWindow)(Display *display, Window w); static proto_XUnmapWindow *func_XUnmapWindow = NULL; int XUnmapWindow(Display *display, Window w) { if (!func_XUnmapWindow) func_XUnmapWindow=(proto_XUnmapWindow *)_loadfunc("XUnmapWindow"); return (func_XUnmapWindow)(display, w); } typedef void (proto_XUnsetICFocus)(XIC ic); static proto_XUnsetICFocus *func_XUnsetICFocus = NULL; void XUnsetICFocus(XIC ic) { if (!func_XUnsetICFocus) func_XUnsetICFocus=(proto_XUnsetICFocus *)_loadfunc("XUnsetICFocus"); (func_XUnsetICFocus)(ic); } typedef int (proto_XWarpPointer)( Display *display, Window sw,Window dw, int sx,int sy, unsigned int swidth,unsigned int sheight, int dx, int dy); static proto_XWarpPointer *func_XWarpPointer = NULL; int XWarpPointer( Display *display, Window sw,Window dw, int sx,int sy, unsigned int swidth,unsigned int sheight, int dx, int dy) { if (!func_XWarpPointer) func_XWarpPointer=(proto_XWarpPointer *)_loadfunc("XWarpPointer"); return (func_XWarpPointer)( display, sw,dw, sx,sy, swidth,sheight, dx, dy); } typedef int (proto_XWindowEvent)( Display *display, Window w, long emask, XEvent *rep); static proto_XWindowEvent *func_XWindowEvent = NULL; int XWindowEvent( Display *display, Window w, long emask, XEvent *rep) { if (!func_XWindowEvent) func_XWindowEvent=(proto_XWindowEvent *)_loadfunc("XWindowEvent"); return (func_XWindowEvent)( display, w, emask, rep); } typedef int (proto_XmbLookupString)( XIC ic, XKeyPressedEvent* event, char* buffer_return, int bytes_buffer, KeySym* keysym_return, StatusDef* status_return); static proto_XmbLookupString *func_XmbLookupString = NULL; int XmbLookupString( XIC ic, XKeyPressedEvent* event, char* buffer_return, int bytes_buffer, KeySym* keysym_return, StatusDef* status_return) { if (!func_XmbLookupString) func_XmbLookupString=(proto_XmbLookupString *)_loadfunc("XmbLookupString"); return (func_XmbLookupString)( ic, event, buffer_return, bytes_buffer, keysym_return, status_return); } typedef int (proto_XmbTextListToTextProperty)( Display *display, char **list, int count, XICCEncodingStyle style, XTextProperty *text_prop_return); static proto_XmbTextListToTextProperty *func_XmbTextListToTextProperty = NULL; int XmbTextListToTextProperty( Display *display, char **list, int count, XICCEncodingStyle style, XTextProperty *text_prop_return) { if (!func_XmbTextListToTextProperty) func_XmbTextListToTextProperty=(proto_XmbTextListToTextProperty *)_loadfunc("XmbTextListToTextProperty"); return (func_XmbTextListToTextProperty)( display, list, count, style, text_prop_return); } typedef int (proto_XmbTextPropertyToTextList)( Display *display, XTextProperty *text_prop, char ***list_return, int *count_return); static proto_XmbTextPropertyToTextList *func_XmbTextPropertyToTextList = NULL; int XmbTextPropertyToTextList( Display *display, XTextProperty *text_prop, char ***list_return, int *count_return) { if (!func_XmbTextPropertyToTextList) func_XmbTextPropertyToTextList=(proto_XmbTextPropertyToTextList *)_loadfunc("XmbTextPropertyToTextList"); return (func_XmbTextPropertyToTextList)( display, text_prop, list_return, count_return); } typedef char * (proto_XrmQuarkToString)(void *quark); static proto_XrmQuarkToString *func_XrmQuarkToString = NULL; char * XrmQuarkToString(void *quark) { if (!func_XrmQuarkToString) func_XrmQuarkToString=(proto_XrmQuarkToString *)_loadfunc("XrmQuarkToString"); return (func_XrmQuarkToString)(quark); } rxvt-2.7.10/W11/Makefile.xpm010064400001440000024000000003400757331033000140500ustar gcwstafffirst_rule: all all allbin alldoc: -mkdir lib cd xpm-3.4k/lib; make -f Makefile.noX CC=gcc INCLUDES=-I../.. DESTLIBDIR=../../lib DESTINCLUDEDIR=../../X11 all install tags clean: cd xpm-3.4k/lib; make -f Makefile.noX $@ rxvt-2.7.10/W11/Makefile.in010064400001440000024000000026710757331033000136630ustar gcwstaff @MCOMMON@ srcdir = @srcdir@ VPATH = @srcdir@ .PATH: @srcdir@ top_builddir = .. basedir = .. thisdir = W11 XPMDIR=xpm-3.4k MKDIR = @top_srcdir@/autoconf/mkinstalldirs first_rule: all all allbin alldoc: -mkdir lib cd wrap; make $@ cd w32; make $@ if test -d $(XPMDIR); then make -f Makefile.xpm; fi tags clean: cd wrap; make $@ cd w32; make $@ if test -d $(XPMDIR); then make -f Makefile.xpm $@; fi realclean: clean cleandir: realclean install: $(INSTALL_PROGRAM) lib/libW11.dll $(bindir)/libW11.dll # # Distribution variables # DIST = Makefile.in Makefile.xpm DISTX11 = X11/Intrinsic.h X11/Xatom.h X11/Xlib.h X11/Xlocale.h X11/Xmd.h \ X11/Xutil.h X11/cursorfont.h X11/keysym.h X11/keysymdef.h DISTw32 = w32/Makefile w32/event.c w32/ntdef.h w32/ntutil.c w32/xlib.c DISTwrap = wrap/Makefile wrap/mkproxy.pl wrap/rxtv.ico wrap/rxvt.ico \ wrap/rxvt.rc wrap/wrap.c wrap/wrap.h wrap/xwrappers.gen distclean: realclean if test $(srcdir) = .; then $(MAKE) realclean; fi (cd $(srcdir); $(RMF) Makefile) distdirs: mkdir $(basedir)/../$(VERNAME)/$(thisdir) mkdir $(basedir)/../$(VERNAME)/$(thisdir)/X11 mkdir $(basedir)/../$(VERNAME)/$(thisdir)/w32 mkdir $(basedir)/../$(VERNAME)/$(thisdir)/wrap distcopy: $(CP) -p $(DIST) $(basedir)/../$(VERNAME)/$(thisdir) $(CP) -p $(DISTX11) $(basedir)/../$(VERNAME)/$(thisdir)/X11 $(CP) -p $(DISTw32) $(basedir)/../$(VERNAME)/$(thisdir)/w32 $(CP) -p $(DISTwrap) $(basedir)/../$(VERNAME)/$(thisdir)/wrap rxvt-2.7.10/src004075500001440000024000000000000764024424100117555ustar gcwstaffrxvt-2.7.10/src/graphics004075500001440000024000000000000764024425100135565ustar gcwstaffrxvt-2.7.10/src/graphics/Makefile.in010064400001440000024000000021640717275514100157070ustar gcwstaff# test/graphics/Makefile.in -*- Makefile -*- # $Id: Makefile.in,v 1.5 2000/10/17 02:57:57 gcw Exp $ @MCOMMON@ srcdir = @srcdir@ VPATH = @srcdir@ .PATH: @srcdir@ basedir = ../.. thisdir = src/graphics first_rule: qplot dummy: SRCS = grxlib.c qplot.c OBJS = grxlib.o qplot.o HDRS = grxlib.h # # Distribution variables # DIST = $(HDRS) $(SRCS) README data Makefile.in # inference rules .c.o: $(COMPILE) -I$(srcdir)/.. -c $< #------------------------------------------------------------------------- all: graphics: qplot qplot: $(OBJS) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) -lm tags: $(SRCS) ctags $(SRCS) alldoc: allbin: qplot clean: $(RMF) qplot core a.out *.o *.bak *~ realclean: clean $(RMF) tags cleandir: realclean distclean: (cd $(srcdir); $(RMF) qplot *~ *.o core a.out) if test $(srcdir) = .; then $(MAKE) realclean; fi (cd $(srcdir); $(RMF) Makefile) install uninstall: distdirs: mkdir $(basedir)/../$(VERNAME)/$(thisdir) distcopy: $(CP) -p $(DIST) $(basedir)/../$(VERNAME)/$(thisdir) # ----------------------------------------------------------------------- # forget dependencies, there are too few rxvt-2.7.10/src/graphics/data010064400001440000024000000000460651657470200144760ustar gcwstaff0 1e+4 1e+4 2e+4 2e+6 5e+2 5e+2 7e+5 rxvt-2.7.10/src/graphics/README010064400001440000024000000000450651657470200145210ustar gcwstaffThis is an example of rxvt graphics. rxvt-2.7.10/src/graphics/qplot.c010064400001440000024000000133500717273620100151400ustar gcwstaff/* * $Id: qplot.c,v 1.6 2000/10/17 02:41:15 gcw Exp $ */ #include #include #include #include #include "grxlib.h" #define Real float #ifndef GRX_SCALE # define GRX_SCALE 10000 #endif #define DEFAULT_DATA_FILE "data" static void axis_round(Real * min, Real * max, Real * grid_spacing) { int logspace; logspace = (int)(log10((*max - *min) / 10.0) + 0.5); *grid_spacing = pow(10, (double)logspace); *min = (Real) ((int)(*min / (*grid_spacing))) * (*grid_spacing); *max = (Real) ((int)(*max / (*grid_spacing)) + 1) * (*grid_spacing); } static int nice_end(int junk) { CloseGraphics(); putchar('\n'); exit(EXIT_SUCCESS); return 0; } int main(int argc, char **argv) { char *file = NULL; int Do_Start = 1, tmp; int m, p, i, j, n, nchars, theight, twidth, xclick, yclick; int downx = 1000, downy = 1000, upx, upy; long id, winclick; Real xmax, xmin, ymax, ymin, xdiff, ydiff, xgrid_spacing, ygrid_spacing; Real *x, *y, *nls; LineFunction linetype = StartLine; char axis[100], line[256]; FILE *fd; x = (Real *)malloc(1000000 * sizeof(Real)); y = (Real *)malloc(1000000 * sizeof(Real)); nls = (Real *)malloc(1000 * sizeof(Real)); if (x == NULL || y == NULL || nls == NULL) { fprintf(stderr, "Can't allocate initial memory\n"); exit(1); } ymax = xmax = -HUGE_VAL; ymin = xmin = HUGE_VAL; for (i = 1; i < argc; i++) { if (*argv[i] == '-') { if (!strcmp(argv[i], "-nl")) linetype = StartPoint; else if (argv[i][1] == '\0') /* use stdin */ file = argv[i]; else { fprintf(stderr, "Usage:\n\t %s [options] [file]\n\n", argv[0]); fprintf(stderr, "where options include:\n" " -pt plot with points instead of lines\n\n"); fprintf(stderr, "file name `-' specifies stdin\n" "if no file name is specified, " "the default is \"%s\"\n\n", DEFAULT_DATA_FILE); return EXIT_FAILURE; } } else file = argv[i]; } if (file && !strcmp(file, "-")) { fd = stdin; file = "stdin"; } else { if (file == NULL) file = DEFAULT_DATA_FILE; if ((fd = fopen(file, "r")) == NULL) { fprintf(stderr, "%s: can't open file \"%s\"\n", argv[0], file); return EXIT_FAILURE; } } m = 0; p = 0; while (fgets(line, sizeof(line), fd) != NULL) { if (sscanf(line, "%f %f", &x[m], &y[m]) == 2) { if (x[m] > xmax) xmax = x[m]; else if (x[m] < xmin) xmin = x[m]; if (y[m] > ymax) ymax = y[m]; else if (y[m] < ymin) ymin = y[m]; m++; } else { nls[p] = m; p++; } } nls[p++] = m; if (m == 0) return; signal(SIGTERM, nice_end); signal(SIGSTOP, nice_end); signal(SIGTSTP, nice_end); signal(SIGINT, nice_end); signal(SIGQUIT, nice_end); if (!InitializeGraphics(1)) return EXIT_FAILURE; n = 1; do { axis_round(&xmin, &xmax, &xgrid_spacing); axis_round(&ymin, &ymax, &ygrid_spacing); id = CreateWin(0, 0, GRX_SCALE, GRX_SCALE); if (id == 0) { fprintf(stderr, "Help id = 0\n"); return EXIT_FAILURE; } /* Fill the window in black for real eye-catching graphics! */ ForeColor(0); StartFill(id); FillArea(0, 0, GRX_SCALE, GRX_SCALE); Done(); /* draw outline box in white */ ForeColor(7); /* Draw outline box */ StartLine(id); Extend(1000, 1000); Extend(1000, 9000); Extend(9000, 9000); Extend(9000, 1000); Extend(1000, 1000); Done(); /* Draw the data - either lines or dots */ xdiff = 8000 / (xmax - xmin); ydiff = 8000 / (ymax - ymin); for (i = j = 0; j < p; j++) { int n = 0; ForeColor(j % 6 + 1); while (((x[i] < xmin) || (x[i] > xmax) || (y[i] < ymin) || (y[i] > ymax)) && (i < nls[j])) i++; while (i < nls[j]) { if (n == 0) linetype(id); Extend(1000 + (x[i] - xmin) * xdiff, 9000 - (y[i] - ymin) * ydiff); n++; if (n > 450) { Done(); n = 0; continue; } i++; while ((i < nls[j]) && ((x[i] < xmin) || (x[i] > xmax) || (y[i] < ymin) || (y[i] > ymax))) i++; } if (n > 0) Done(); } /* Do axis labels in black */ ForeColor(7); QueryWin(id, &twidth, &theight); PlaceText(id, GRX_SCALE / 2, 0, HCENTER_TEXT | TOP_TEXT, file); PlaceText(id, GRX_SCALE / 2, GRX_SCALE, HCENTER_TEXT | BOTTOM_TEXT, "X"); PlaceText(id, 0, GRX_SCALE / 2, LEFT_TEXT | VCENTER_TEXT, "Y"); sprintf(axis, "%f", ymax); nchars = 1000 / twidth; axis[nchars] = 0; PlaceText(id, GRX_SCALE / 10, GRX_SCALE / 10, RIGHT_TEXT | TOP_TEXT, axis); sprintf(axis, "%f", ymin); axis[nchars] = 0; PlaceText(id, GRX_SCALE / 10, 9 * GRX_SCALE / 10, RIGHT_TEXT | BOTTOM_TEXT, axis); sprintf(axis, "%f", xmax); PlaceText(id, 9 * GRX_SCALE / 10, 9 * GRX_SCALE / 10, HCENTER_TEXT | TOP_TEXT, axis); sprintf(axis, "%f", xmin); PlaceText(id, GRX_SCALE / 10, 9 * GRX_SCALE / 10, HCENTER_TEXT | TOP_TEXT, axis); fflush(stdout); do { n = WaitForCarriageReturn(&winclick, &xclick, &yclick); switch (n) { case 1: downx = xclick; downy = yclick; break; case 2: upx = xclick; upy = yclick; if (upx < downx) { tmp = downx; downx = upx; upx = tmp; } if (upy < downy) { tmp = downy; downy = upy; upy = tmp; } xmin = (xmax - xmin) * (downx - 1000) / (8000) + xmin; xmax = (xmax - xmin) * (upx - 1000) / (8000) + xmin; ymax = ymax - (ymax - ymin) * (downy - 1000) / (8000); ymin = ymax - (ymax - ymin) * (upy - 1000) / (8000); break; } } while (n && (n != 2)); } while (n); nice_end(EXIT_SUCCESS); return EXIT_SUCCESS; } /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/graphics/grxlib.c010064400001440000024000000070520717273620100152720ustar gcwstaff/* * $Id: grxlib.c,v 1.5 2000/10/17 02:39:56 gcw Exp $ */ #include "../../config.h" #include "rxvt.h" #include "init.h" /* for GET_TERMIOS / SET_TERMIOS */ #include "grxlib.h" /*----------------------------------------------------------------------*/ void Done(void) { putchar(':'); } void StartLine(long id) { printf("\033GL%ld", id); } void StartPoint(long id) { printf("\033GP%ld", id); } void StartFill(long id) { printf("\033GF%ld", id); } void Extend(int x, int y) { printf(";%d;%d", x, y); } void FillArea(int x1, int y1, int x2, int y2) { printf(";%d;%d;%d;%d", x1, y1, x2, y2); } void PlaceText(long id, int x, int y, int mode, char *text) { printf("\033GT%ld;%d;%d;%d;%d:%s", id, x, y, mode, strlen(text), text); fflush(stdout); } void ClearWindow(long id) { printf("\033GC%ld:", id); } void ForeColor(int col) { printf("\033[3%dm", (col < 0 || col > 7) ? 0 : col); } void DefaultRendition(void) { printf("\033[m"); } #define LINESZ 100 static char line[LINESZ]; static FILE *infd = NULL; long CreateWin(int x, int y, int w, int h) { long id = 0; fflush(stdout); printf("\033GW%d;%d;%d;%d:", x, y, w, h); fflush(stdout); while (1) { if ((fgets(line, LINESZ, infd) != NULL) && (sscanf(line, "\033W%ld", &id) == 1)) break; } return id; } void QueryWin(long id, int *nfwidth, int *nfheight) { int id1, x, y, width, height, fwidth, fheight; printf("\033GG%ld:", id); fflush(stdout); while (1) { if ((fgets(line, sizeof(line), infd) != NULL) && (sscanf(line, "\033G%ld %ld %ld %ld %ld %ld %ld %ld %ld", &id1, &x, &y, &width, &height, &fwidth, &fheight, nfwidth, nfheight) != 0)) break; } } int WaitForCarriageReturn(long *win, int *x, int *y) { int i, len; fgets(line, LINESZ, infd); line[LINESZ - 1] = 0; len = strlen(line); for (i = 0; i < len; i++) { if (line[i] == '\033') { int ret = 1; i++; switch (line[i]) { case 'R': ret++; /* drop */ case 'P': sscanf(&line[i + 1], "%ld;%d;%d", win, x, y); return ret; break; } } } return 0; } static int fno2; static ttymode_t ttmode; int InitializeGraphics(int scroll_text_up) { int fno, i; char *screen_tty; struct winsize winsize; fno = fileno(stdout); if (!isatty(fno)) { fprintf(stderr, "stdout must be a tty\n"); return 0; } screen_tty = ttyname(fno); #ifdef HAVE_TERMIOS_H GET_TERMIOS(fno, &ttmode); ttmode.c_lflag &= ~ECHO; SET_TERMIOS(fno, &ttmode); #endif infd = fopen(screen_tty, "rw"); #ifdef HAVE_TERMIOS_H fno2 = fileno(infd); GET_TERMIOS(fno2, &ttmode); ttmode.c_lflag &= ~ECHO; SET_TERMIOS(fno2, &ttmode); #endif /* query rxvt to find if graphics are available */ fflush(stdout); printf("\033GQ"); fflush(stdout); while (1) { if ((fgets(line, LINESZ, infd) != NULL) && (sscanf(line, "\033G%d", &i) == 1)) { if (!i) { fprintf(stderr, "rxvt graphics not available\n"); CloseGraphics(); return 0; } break; } } if (scroll_text_up) { ioctl(fno, TIOCGWINSZ, &winsize); fflush(stdout); for (i = 0; i < winsize.ws_row; i++) putchar('\n'); fflush(stdout); } return i; } void CloseGraphics(void) { DefaultRendition(); fflush(stdout); #ifdef HAVE_TERMIOS_H ttmode.c_lflag |= ECHO; SET_TERMIOS(fno2, &ttmode); #endif fclose(infd); } /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/graphics/grxlib.h010064400001440000024000000020240651657423500153010ustar gcwstaff/* * $Id: grxlib.h,v 1.2 1998/04/20 07:26:21 mason Exp $ */ #include "rxvtgrx.h" /* text alignment */ /*function pointer to either StartLine or StartPoint */ typedef void (*LineFunction) (long id); #ifdef __cplusplus extern "C" { #endif extern void StartLine (long id); extern void StartPoint (long id); extern void Extend (int x, int y); extern void StartFill (long id); extern void FillArea (int x1, int y1, int x2, int y2); extern void Done (void); extern void PlaceText (long id, int x, int y, int mode, char *text); extern void ClearWindow (long id); extern long CreateWin (int x, int y, int w, int h); extern void QueryWin (long id, int *nfwidth, int *nfheight); extern void ForeColor (int color); extern void DefaultRendition (void); extern int WaitForCarriageReturn (long *win, int *x, int *y); extern int InitializeGraphics (int scroll_text_up); extern void CloseGraphics (void); #ifdef __cplusplus } #endif /*----------------------- end-of-file (C header) -----------------------*/ rxvt-2.7.10/src/test004075500001440000024000000000000764024425100127355ustar gcwstaffrxvt-2.7.10/src/test/Makefile.in010064400001440000024000000040740757330767100150760ustar gcwstaff#make src/test/Makefile.in -*- Makefile -*- @MCOMMON@ srcdir = @srcdir@ VPATH = @srcdir@ .PATH: @srcdir@ basedir = ../.. thisdir = src/test first_rule: dummy: SRCS = gettty.c strings-memmove.c OBJS = gettty.o strings-memmove.o HDRS = # # Distribution variables # DEBUG= -DDEBUG_TTY DIST = $(HDRS) $(SRCS) Makefile.in # inference rules .c.o: $(CC) -c $(CPPFLAGS) $(XINC) -I. -I$(basedir) -I$(srcdir) $(DEFS) $(CFLAGS) $< #------------------------------------------------------------------------- all: tests: @(cd $(srcdir)/..; ${MAKE} .protos) @${MAKE} tests-bin run-tests tests-bin: gettty gettty-debug strings-memmove run-tests: @echo "" @echo "RUNNING TESTS ----" @echo "Testing open of (pty/tty) pseudo-tty pairs" @./gettty concise || ./gettty-debug @echo "Testing possible replacement for memmove() with --enable-strings" @./strings-memmove gettty: gettty.o ptytty.o $(CC) $(LDFLAGS) -o $@ gettty.o ptytty.o $(LIBS) gettty-debug: gettty.o ptytty-debug.o $(CC) $(LDFLAGS) -o $@ gettty.o ptytty-debug.o $(LIBS) ptytty.o: $(srcdir)/../ptytty.c $(CC) -o ptytty.o $(CPPFLAGS) $(CFLAGS) -c $(srcdir)/../ptytty.c ptytty-debug.o: $(srcdir)/../ptytty.c $(CC) -o ptytty-debug.o $(CPPFLAGS) $(CFLAGS) $(DEBUG) -c $(srcdir)/../ptytty.c strings-memmove: strings-memmove.o $(CC) $(LDFLAGS) -o $@ strings-memmove.o $(LIBS) $(srcdir)/../strings.intpro: $(srcdir)/../strings.c (cd $(srcdir)/..; ${MAKE} strings.intpro) tags: $(SRCS) ctags $(SRCS) allbin: alldoc: clean: $(RMF) gettty strings-memmove core a.out *.o *.bak *~ realclean: clean $(RMF) tags cleandir: realclean distclean: (cd $(srcdir); $(RMF) strings-memmove *~ *.o core a.out) if test $(srcdir) = .; then $(MAKE) realclean; fi (cd $(srcdir); $(RMF) Makefile) install: uninstall: distdirs: mkdir $(basedir)/../$(VERNAME)/$(thisdir) distcopy: $(CP) -p $(DIST) $(basedir)/../$(VERNAME)/$(thisdir) # ----------------------------------------------------------------------- # DO NOT DELETE: ugly dependency list follows strings-memmove.o: strings-memmove.c $(srcdir)/../strings.c $(srcdir)/../strings.intpro rxvt-2.7.10/src/test/strings-memmove.c010064400001440000024000000023220726252331600163120ustar gcwstaff#include "../../config.h" #include "../rxvt.h" # /* hack! */ define memset rmemset # /* hack! */ define memmove rmemmove void *memset __PROTO((void *p, int c1, size_t len)); void *memmove __PROTO((void *d, const void *s, size_t len)); # /* hack! */ include "../strings.c" # /* hack! */ undef memmove # /* hack! */ undef memset #define OFF 16 #define BUFSZ 300 unsigned char buf1[BUFSZ], buf2[BUFSZ], buf3[BUFSZ]; int main() { int i, j, k, a; int res; res = 0; for (i = 0; i < OFF; i++) for (j = 0; j < OFF; j++) for (k = 0; k < OFF; k++) { memset(buf2, 127, BUFSZ); memset(buf3, 127, BUFSZ); for (a = 1; a < 256; a++) buf1[OFF + i + a - 1] = a; rmemmove(buf2 + OFF + k, buf1 + OFF + i, 256 - OFF + j); memmove(buf3 + OFF + k, buf1 + OFF + i, 256 - OFF + j); for (a = 0; a < (int)sizeof buf2; a++) if (buf2[a] != buf3[a]) { res = 1; printf("Test BAD, Start = +%d, Size = +%d, Dest =+ %d: ", i, j, k); printf(" -1=%02x, 0=%02x, %d=%02x, %d=%02x\n", buf2[OFF + k - 1], buf2[OFF + k], 255 - OFF + j, buf2[k + 255 + j], 256 - OFF + j, buf2[k + 256 + j]); break; } } if (res == 0) printf("OK\n"); exit(res); } rxvt-2.7.10/src/test/gettty.c010064400001440000024000000034660726252331600145100ustar gcwstaff#include "../../config.h" #include #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include int verb = 1; int main(int argc) { int i, pid; int fd_pty, fd_tty; const char *ttydev; if (argc != 1) verb = 0; fd_pty = fd_tty = -1; ttydev = NULL; fd_pty = rxvt_get_pty(&fd_tty, &ttydev); if (fd_pty < 0) { fprintf(stderr, "rxvt_get_pty() failed\n"); exit(1); } if (verb) fprintf(stderr, "rxvt_get_pty() OK. Found %s (opened pty fd: %d)\n", ttydev, fd_pty); if (fd_tty < 0) { # ifdef HAVE_REVOKE revoke(ttydev); # endif if ((fd_tty = rxvt_get_tty(ttydev)) < 0) { fprintf(stderr, "rxvt_get_tty() failed on %s", ttydev); exit(1); } if (verb) fprintf(stderr, "rxvt_get_tty() OK. (opened tty fd: %d)\n", fd_tty); } else if (verb) fprintf(stderr, "Didn't call: rxvt_get_tty() (already have fd)\n"); for (i = 0; i < 255; i++) if (i != fd_pty && i != 2 && i != fd_tty) close(i); pid = fork(); if (pid) { int exitst = 1; int j = 0; close(fd_tty); for ( ; ++j < 5; ) { if (waitpid(-1, &i, WNOHANG) != 0) break; sleep(1); } if (j == 5) kill(pid, 2); if (WIFEXITED(i)) { exitst = WEXITSTATUS(i); if (exitst == 0) fprintf(stderr, "OK\n"); else fprintf(stderr, "Failed. Child exit status: %d\n", WEXITSTATUS(i)); } else fprintf(stderr, "Interrupted\n"); exit(exitst); } close(fd_pty); if (verb) fprintf(stderr, "Calling: rxvt_control_tty\n"); i = rxvt_control_tty(fd_tty, ttydev); if (i < 0) { fprintf(stderr, "could not obtain control of tty\n"); exit(1); } exit(0); /* NOTREACHED */ } rxvt-2.7.10/src/command.h010064400001440000024000000046640733020561200136250ustar gcwstaff/* * $Id: command.h,v 1.24 2000/11/17 12:06:12 gcw Exp $ */ #ifndef _COMMAND_H_ #define _COMMAND_H_ #define STRING_MAX 512 /* max string size for process_rxvt_xterm_seq() */ #define ESC_ARGS 32 /* max # of args for esc sequences */ #ifdef OFFIX_DND # define DndFile 2 # define DndDir 5 # define DndLink 7 #endif /* a large REFRESH_PERIOD causes problems with `cat' */ #define REFRESH_PERIOD 1 #ifndef MULTICLICK_TIME # define MULTICLICK_TIME 500 #endif #ifndef SCROLLBAR_INITIAL_DELAY # ifdef NEXT_SCROLLER # define SCROLLBAR_INITIAL_DELAY 20 # else # define SCROLLBAR_INITIAL_DELAY 40 # endif #endif #ifndef SCROLLBAR_CONTINUOUS_DELAY # define SCROLLBAR_CONTINUOUS_DELAY 2 #endif /* * key-strings: if only these keys were standardized */ #ifdef LINUX_KEYS # define KS_HOME "\033[1~" /* Home == Find */ # define KS_END "\033[4~" /* End == Select */ #else # define KS_HOME "\033[7~" /* Home */ # define KS_END "\033[8~" /* End */ #endif #ifdef SCROLL_ON_SHIFT # define SCROLL_SHIFTKEY (shft) #else # define SCROLL_SHIFTKEY 0 #endif #ifdef SCROLL_ON_CTRL # define SCROLL_CTRLKEY (ctrl) #else # define SCROLL_CTRLKEY 0 #endif #ifdef SCROLL_ON_META # define SCROLL_METAKEY (meta) #else # define SCROLL_METAKEY 0 #endif #define IS_SCROLL_MOD (SCROLL_SHIFTKEY || SCROLL_CTRLKEY || SCROLL_METAKEY) /* * ESC-Z processing: * * By stealing a sequence to which other xterms respond, and sending the * same number of characters, but having a distinguishable sequence, * we can avoid having a timeout (when not under an rxvt) for every login * shell to auto-set its DISPLAY. * * This particular sequence is even explicitly stated as obsolete since * about 1985, so only very old software is likely to be confused, a * confusion which can likely be remedied through termcap or TERM. Frankly, * I doubt anyone will even notice. We provide a #ifdef just in case they * don't care about auto-display setting. Just in case the ancient * software in question is broken enough to be case insensitive to the 'c' * character in the answerback string, we make the distinguishing * characteristic be capitalization of that character. The length of the * two strings should be the same so that identical read(2) calls may be * used. */ #define VT100_ANS "\033[?1;2c" /* vt100 answerback */ #ifndef ESCZ_ANSWER # define ESCZ_ANSWER VT100_ANS /* obsolete ANSI ESC[c */ #endif #include "command.intpro" /* PROTOS for internal routines */ #endif /* _COMMAND_H_ */ rxvt-2.7.10/src/xpm.extpro010064400001440000024000000003740764024231400141030ustar gcwstaffint rxvt_scale_pixmap __PROTO((rxvt_t *r, const char *geom)); void rxvt_resize_pixmap __PROTO((rxvt_t *r)); Pixmap rxvt_set_bgPixmap __PROTO((rxvt_t *r, const char *file)); rxvt-2.7.10/src/xdefaults.extpro010064400001440000024000000004660764024231400153000ustar gcwstaffvoid rxvt_usage __PROTO((int type)); void rxvt_get_options __PROTO((rxvt_t *r, int argc, const char *const *argv)); void rxvt_extract_resources __PROTO((rxvt_t *r, Display *display __attribute__((unused)), const char *name)); rxvt-2.7.10/src/strings.extpro010064400001440000024000000031160764024231400147650ustar gcwstaffint strcasecmp __PROTO((const char *s1, const char *s2)); int strncasecmp __PROTO((const char *s1, const char *s2, size_t n)); char * strcpy __PROTO((char *d, const char *s)); char * strncpy __PROTO((char *d, const char *s, size_t len)); int strcmp __PROTO((const char *s1, const char *s2)); int strncmp __PROTO((const char *s1, const char *s2, size_t len)); char * strcat __PROTO((char *s1, const char *s2)); char * strncat __PROTO((char *s1, const char *s2, size_t len)); size_t strlen __PROTO((const char *s)); char * strdup __PROTO((const char *s)); char * index __PROTO((const char *s, int c)); char * strchr __PROTO((const char *s, int c)); char * rindex __PROTO((const char *s, int c)); char * strrchr __PROTO((const char *s, int c)); void * memcpy __PROTO((void *s1, const void *s2, size_t len)); void * memmove __PROTO((void *d, const void *s, size_t len)); void bzero __PROTO((void *b, size_t len)); void * memset __PROTO((void *p, int c1, size_t len)); rxvt-2.7.10/src/scrollbar-xterm.extpro010064400001440000024000000002330764024231400164110ustar gcwstaffint rxvt_scrollbar_show_xterm __PROTO((rxvt_t *r, int update __attribute__((unused)), int last_top, int last_bot, int scrollbar_len)); rxvt-2.7.10/src/scrollbar-next.extpro010064400001440000024000000002030764024231400162250ustar gcwstaffint rxvt_scrollbar_show_next __PROTO((rxvt_t *r, int update, int last_top, int last_bot, int scrollbar_len)); rxvt-2.7.10/src/scrollbar-rxvt.extpro010064400001440000024000000002330764024231400162550ustar gcwstaffint rxvt_scrollbar_show_rxvt __PROTO((rxvt_t *r, int update __attribute__((unused)), int last_top, int last_bot, int scrollbar_len)); rxvt-2.7.10/src/scrollbar.extpro010064400001440000024000000005760764024231400152660ustar gcwstaffint rxvt_scrollbar_mapping __PROTO((rxvt_t *r, int map)); void rxvt_Resize_scrollBar __PROTO((rxvt_t *r)); int rxvt_scrollbar_show __PROTO((rxvt_t *r, int update)); void rxvt_setup_scrollbar __PROTO((rxvt_t *r, const char *scrollalign, const char *scrollstyle, const char *thickness)); rxvt-2.7.10/src/screen.extpro010064400001440000024000000113110764024231400145470ustar gcwstaffvoid rxvt_scr_reset __PROTO((rxvt_t *r)); void rxvt_scr_release __PROTO((rxvt_t *r)); void rxvt_scr_poweron __PROTO((rxvt_t *r)); void rxvt_scr_cursor __PROTO((rxvt_t *r, int mode)); int rxvt_scr_change_screen __PROTO((rxvt_t *r, int scrn)); void rxvt_scr_color __PROTO((rxvt_t *r, unsigned int color, int fgbg)); void rxvt_scr_rendition __PROTO((rxvt_t *r, int set, int style)); int rxvt_scroll_text __PROTO((rxvt_t *r, int row1, int row2, int count, int spec)); void rxvt_scr_add_lines __PROTO((rxvt_t *r, const unsigned char *str, int nlines, int len)); void rxvt_scr_backspace __PROTO((rxvt_t *r)); void rxvt_scr_tab __PROTO((rxvt_t *r, int count)); void rxvt_scr_backindex __PROTO((rxvt_t *r)); void rxvt_scr_forwardindex __PROTO((rxvt_t *r)); void rxvt_scr_gotorc __PROTO((rxvt_t *r, int row, int col, int relative)); void rxvt_scr_index __PROTO((rxvt_t *r, enum page_dirn direction)); void rxvt_scr_erase_line __PROTO((rxvt_t *r, int mode)); void rxvt_scr_erase_screen __PROTO((rxvt_t *r, int mode)); void rxvt_scr_E __PROTO((rxvt_t *r)); void rxvt_scr_insdel_lines __PROTO((rxvt_t *r, int count, int insdel)); void rxvt_scr_insdel_chars __PROTO((rxvt_t *r, int count, int insdel)); void rxvt_scr_scroll_region __PROTO((rxvt_t *r, int top, int bot)); void rxvt_scr_cursor_visible __PROTO((rxvt_t *r, int mode)); void rxvt_scr_autowrap __PROTO((rxvt_t *r, int mode)); void rxvt_scr_relative_origin __PROTO((rxvt_t *r, int mode)); void rxvt_scr_insert_mode __PROTO((rxvt_t *r, int mode)); void rxvt_scr_set_tab __PROTO((rxvt_t *r, int mode)); void rxvt_scr_rvideo_mode __PROTO((rxvt_t *r, int mode)); void rxvt_scr_report_position __PROTO((rxvt_t *r)); void rxvt_scr_charset_choose __PROTO((rxvt_t *r, int set)); void rxvt_scr_charset_set __PROTO((rxvt_t *r, int set, unsigned int ch)); void rxvt_euc2jis __PROTO((unsigned char *str, int len)); void rxvt_set_multichar_encoding __PROTO((rxvt_t *r, const char *str)); int rxvt_scr_get_fgcolor __PROTO((rxvt_t *r)); int rxvt_scr_get_bgcolor __PROTO((rxvt_t *r)); void rxvt_scr_expose __PROTO((rxvt_t *r, int x, int y, int width, int height, Bool refresh)); void rxvt_scr_touch __PROTO((rxvt_t *r, Bool refresh)); int rxvt_scr_move_to __PROTO((rxvt_t *r, int y, int len)); int rxvt_scr_page __PROTO((rxvt_t *r, enum page_dirn direction, int nlines)); void rxvt_scr_bell __PROTO((rxvt_t *r)); void rxvt_scr_printscreen __PROTO((rxvt_t *r, int fullhist)); void rxvt_scr_refresh __PROTO((rxvt_t *r, unsigned char refresh_type)); void rxvt_scr_clear __PROTO((rxvt_t *r)); void rxvt_scr_dump __PROTO((rxvt_t *r, int fd)); void rxvt_selection_check __PROTO((rxvt_t *r, int check_more)); int rxvt_selection_paste __PROTO((rxvt_t *r, Window win, Atom prop, Bool delete_prop)); void rxvt_selection_property __PROTO((rxvt_t *r, Window win, Atom prop)); void rxvt_selection_request __PROTO((rxvt_t *r, Time tm, int x, int y)); void rxvt_selection_clear __PROTO((rxvt_t *r)); void rxvt_selection_make __PROTO((rxvt_t *r, Time tm)); void rxvt_selection_click __PROTO((rxvt_t *r, int clicks, int x, int y)); void rxvt_selection_extend __PROTO((rxvt_t *r, int x, int y, int flag)); void rxvt_selection_rotate __PROTO((rxvt_t *r, int x, int y)); void rxvt_selection_send __PROTO((rxvt_t *r, const XSelectionRequestEvent *rq)); void rxvt_pixel_position __PROTO((rxvt_t *r, int *x, int *y)); void rxvt_setPosition __PROTO((rxvt_t *r, XPoint *pos)); rxvt-2.7.10/src/ptytty.extpro010064400001440000024000000004150764024231400146500ustar gcwstaffint rxvt_get_pty __PROTO((int *fd_tty, const char **ttydev)); int rxvt_get_tty __PROTO((const char *ttydev)); int rxvt_control_tty __PROTO((int fd_tty, const char *ttydev)); rxvt-2.7.10/src/netdisp.extpro010064400001440000024000000001220764024231300147330ustar gcwstaffchar * rxvt_network_display __PROTO((const char *display)); rxvt-2.7.10/src/misc.extpro010064400001440000024000000017050764024231300142300ustar gcwstaffchar * rxvt_r_basename __PROTO((const char *str)); void rxvt_print_error __PROTO((const char *fmt,...)); int rxvt_Str_match __PROTO((const char *s1, const char *s2)); const char * rxvt_Str_skip_space __PROTO((const char *str)); char * rxvt_Str_trim __PROTO((char *str)); int rxvt_Str_escaped __PROTO((char *str)); char ** rxvt_splitcommastring __PROTO((const char *cs)); char * rxvt_File_find __PROTO((const char *file, const char *ext, const char *path)); void rxvt_Draw_Shadow __PROTO((Display *Xdisplay, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h)); void rxvt_Draw_Triangle __PROTO((Display *Xdisplay, Window win, GC topShadow, GC botShadow, int x, int y, int w, int type)); rxvt-2.7.10/src/menubar.extpro010064400001440000024000000006440764024231300147270ustar gcwstaffvoid rxvt_menubar_read __PROTO((rxvt_t *r, const char *filename)); void rxvt_menubar_dispatch __PROTO((rxvt_t *r, char *str)); void rxvt_menubar_expose __PROTO((rxvt_t *r)); void rxvt_menubar_control __PROTO((rxvt_t *r, XButtonEvent *ev)); void rxvt_map_menuBar __PROTO((rxvt_t *r, int map)); rxvt-2.7.10/src/main.extpro010064400001440000024000000043530764024231300142230ustar gcwstaffRETSIGTYPE rxvt_Child_signal __PROTO((int sig __attribute__((unused)))); RETSIGTYPE rxvt_Exit_signal __PROTO((int sig)); void rxvt_clean_exit __PROTO((void)); void * rxvt_malloc __PROTO((size_t size)); void * rxvt_calloc __PROTO((size_t number, size_t size)); void * rxvt_realloc __PROTO((void *ptr, size_t size)); void rxvt_privileged_utmp __PROTO((rxvt_t *r, char action)); void rxvt_privileged_ttydev __PROTO((rxvt_t *r, char action)); void rxvt_window_calc __PROTO((rxvt_t *r, unsigned int width, unsigned int height)); void rxvt_tt_winsize __PROTO((int fd, unsigned short col, unsigned short row)); void rxvt_change_font __PROTO((rxvt_t *r, int init, const char *fontname)); void rxvt_set_title __PROTO((rxvt_t *r, const char *str)); void rxvt_set_iconName __PROTO((rxvt_t *r, const char *str)); void rxvt_set_window_color __PROTO((rxvt_t *r, int idx, const char *color)); void rxvt_recolour_cursor __PROTO((rxvt_t *r)); int rxvt_rXParseAllocColor __PROTO((rxvt_t *r, XColor *screen_in_out, const char *colour)); int rxvt_rXAllocColor __PROTO((rxvt_t *r, XColor *screen_in_out, const char *colour)); void rxvt_resize_all_windows __PROTO((rxvt_t *r, unsigned int width, unsigned int height, int ignoreparent)); void rxvt_set_widthheight __PROTO((rxvt_t *r, unsigned int width, unsigned int height)); void rxvt_IMSendSpot __PROTO((rxvt_t *r)); void rxvt_setTermFontSet __PROTO((rxvt_t *r, int idx)); void rxvt_IMInstantiateCallback __PROTO((Display *unused __attribute__((unused)), XPointer client_data __attribute__((unused)), XPointer call_data __attribute__((unused)))); void rxvt_IMSetStatusPosition __PROTO((rxvt_t *r)); rxvt_t * rxvt_get_r __PROTO((void)); rxvt-2.7.10/src/logging.extpro010064400001440000024000000002670764024231300147250ustar gcwstaffvoid rxvt_makeutent __PROTO((rxvt_t *r, const char *pty, const char *hostname)); void rxvt_cleanutent __PROTO((rxvt_t *r)); rxvt-2.7.10/src/init.extpro010064400001440000024000000011270764024231300142360ustar gcwstaffint rxvt_init_vars __PROTO((rxvt_t *r)); void rxvt_init_secondary __PROTO((rxvt_t *r)); const char ** rxvt_init_resources __PROTO((rxvt_t *r, int argc, const char *const *argv)); void rxvt_init_env __PROTO((rxvt_t *r)); void rxvt_init_xlocale __PROTO((rxvt_t *r)); void rxvt_init_command __PROTO((rxvt_t *r, const char *const *argv)); void rxvt_Create_Windows __PROTO((rxvt_t *r, int argc, const char *const *argv)); rxvt-2.7.10/src/grkelot.extpro010064400001440000024000000006560764024231300147500ustar gcwstaffvoid greek_init __PROTO((void)); void greek_end __PROTO((void)); void greek_reset __PROTO((void)); void greek_setmode __PROTO((int greek_mode)); int greek_getmode __PROTO((void)); int greek_xlat __PROTO((char *s, int num_chars)); rxvt-2.7.10/src/graphics.extpro010064400001440000024000000014320764024231300150720ustar gcwstaffvoid rxvt_Gr_ButtonReport __PROTO((rxvt_t *r, int but, int x, int y)); void rxvt_Gr_do_graphics __PROTO((rxvt_t *r, int cmd, unsigned int nargs, int args[], unsigned char *text)); void rxvt_Gr_scroll __PROTO((rxvt_t *r, int count)); void rxvt_Gr_ClearScreen __PROTO((rxvt_t *r)); void rxvt_Gr_ChangeScreen __PROTO((rxvt_t *r)); void rxvt_Gr_expose __PROTO((rxvt_t *r, Window win)); void rxvt_Gr_Resize __PROTO((rxvt_t *r, int w __attribute__((unused)), int h)); void rxvt_Gr_reset __PROTO((rxvt_t *r)); int rxvt_Gr_Displayed __PROTO((rxvt_t *r)); rxvt-2.7.10/src/defaultfont.extpro010064400001440000024000000001320764024231300156010ustar gcwstaffvoid rxvt_set_defaultfont __PROTO((rxvt_t *r, const char *rs[])); rxvt-2.7.10/src/command.extpro010064400001440000024000000013660764024231300147160ustar gcwstaffunsigned int rxvt_cmd_write __PROTO((rxvt_t *r, const unsigned char *str, unsigned int count)); void rxvt_W11_process_x_event __PROTO((XEvent *ev)); int rxvt_check_our_parents __PROTO((rxvt_t *r)); FILE * rxvt_popen_printer __PROTO((rxvt_t *r)); int rxvt_pclose_printer __PROTO((FILE *stream)); void rxvt_xterm_seq __PROTO((rxvt_t *r, int op, const char *str, unsigned char resp __attribute__((unused)))); void rxvt_tt_printf __PROTO((rxvt_t *r, const char *fmt,...)); void rxvt_tt_write __PROTO((rxvt_t *r, const unsigned char *d, unsigned int len)); rxvt-2.7.10/src/xpm.intpro010064400001440000024000000002570764024231500140760ustar gcwstaffvoid rxvt_pixmap_incr __PROTO((unsigned int *wh, unsigned int *xy, float *incr, float *p, unsigned int widthheight, unsigned int xpmwidthheight)); rxvt-2.7.10/src/xdefaults.intpro010064400001440000024000000007600764024231500152700ustar gcwstaffBool rxvt_define_key __PROTO((XrmDatabase *database __attribute__((unused)), XrmBindingList bindings __attribute__((unused)), XrmQuarkList quarks, XrmRepresentation *type __attribute__((unused)), XrmValue *value, XPointer closure __attribute__((unused)))); int rxvt_parse_keysym __PROTO((rxvt_t *r, const char *str, const char *arg)); void rxvt_get_xdefaults __PROTO((rxvt_t *r, FILE *stream, const char *name)); rxvt-2.7.10/src/strings.intpro010064400001440000024000000000000764024231500147450ustar gcwstaffrxvt-2.7.10/src/scrollbar-xterm.intpro010064400001440000024000000000000764024231500163740ustar gcwstaffrxvt-2.7.10/src/scrollbar-next.intpro010064400001440000024000000004620764024231500162270ustar gcwstaffPixmap rxvt_renderPixmap __PROTO((rxvt_t *r, const char *const *data, int width, int height)); void rxvt_init_scrollbar_stuff __PROTO((rxvt_t *r)); void rxvt_drawBevel __PROTO((rxvt_t *r, Drawable d, int x1, int y1, int w, int h)); rxvt-2.7.10/src/scrollbar-rxvt.intpro010064400001440000024000000001530764024231400162500ustar gcwstaffvoid rxvt_Draw_button __PROTO((rxvt_t *r, int x, int y, int state, int dirn)); rxvt-2.7.10/src/scrollbar.intpro010064400001440000024000000000000764024231400152360ustar gcwstaffrxvt-2.7.10/src/screen.intpro010064400001440000024000000030610764024231400145440ustar gcwstaffvoid rxvt_blank_line __PROTO((text_t *et, rend_t *er, unsigned int width, rend_t efs)); void rxvt_blank_screen_mem __PROTO((rxvt_t *r, text_t **tp, rend_t **rp, unsigned int row, rend_t efs)); void rxvt_scr_reset_realloc __PROTO((rxvt_t *r)); void rxvt_set_font_style __PROTO((rxvt_t *r)); void rxvt_sjis2jis __PROTO((unsigned char *str, int len)); void rxvt_decodedummy __PROTO((unsigned char *str __attribute__((unused)), int len __attribute__((unused)))); int rxvt_scr_changeview __PROTO((rxvt_t *r, u_int16_t oldviewstart)); void rxvt_scr_reverse_selection __PROTO((rxvt_t *r)); void rxvt_PasteIt __PROTO((rxvt_t *r, const unsigned char *data, unsigned int nitems)); int rxvt_selection_request_other __PROTO((rxvt_t *r, Atom target, int selnum)); void rxvt_selection_start_colrow __PROTO((rxvt_t *r, int col, int row)); void rxvt_selection_delimit_word __PROTO((rxvt_t *r, enum page_dirn dirn, const row_col_t *mark, row_col_t *ret)); void rxvt_selection_adjust_kanji __PROTO((rxvt_t *r)); void rxvt_selection_extend_colrow __PROTO((rxvt_t *r, int32_t col, int32_t row, int button3, int buttonpress, int clickchange)); void rxvt_selection_remove_trailing_spaces __PROTO((rxvt_t *r)); void rxvt_debug_colors __PROTO((void)); rxvt-2.7.10/src/ptytty.intpro010064400001440000024000000000000764024231400146300ustar gcwstaffrxvt-2.7.10/src/netdisp.intpro010064400001440000024000000000000764024231400147210ustar gcwstaffrxvt-2.7.10/src/misc.intpro010064400001440000024000000001660764024231400142230ustar gcwstaffchar * rxvt_File_search_path __PROTO((const char *pathlist, const char *file, const char *ext)); rxvt-2.7.10/src/menubar.intpro010064400001440000024000000054230764024231400147220ustar gcwstaffmenuitem_t * rxvt_menuitem_find __PROTO((const menu_t *menu, const char *name)); void rxvt_menuitem_free __PROTO((rxvt_t *r, menu_t *menu, menuitem_t *item)); int rxvt_action_type __PROTO((action_t *action, unsigned char *str)); int rxvt_action_dispatch __PROTO((rxvt_t *r, action_t *action)); int rxvt_menuarrow_find __PROTO((char name)); void rxvt_menuarrow_free __PROTO((rxvt_t *r, char name)); void rxvt_menuarrow_add __PROTO((rxvt_t *r, char *string)); menuitem_t * rxvt_menuitem_add __PROTO((menu_t *menu, const char *name, const char *name2, const char *action)); char * rxvt_menu_find_base __PROTO((rxvt_t *r, menu_t **menu, char *path)); menu_t * rxvt_menu_delete __PROTO((rxvt_t *r, menu_t *menu)); menu_t * rxvt_menu_add __PROTO((rxvt_t *r, menu_t *parent, char *path)); void rxvt_drawbox_menubar __PROTO((rxvt_t *r, int x, int len, int state)); void rxvt_drawtriangle __PROTO((rxvt_t *r, int x, int y, int state)); void rxvt_drawbox_menuitem __PROTO((rxvt_t *r, int y, int state)); void rxvt_print_menu_ancestors __PROTO((menu_t *menu)); void rxvt_print_menu_descendants __PROTO((menu_t *menu)); void rxvt_menu_show __PROTO((rxvt_t *r)); void rxvt_menu_display __PROTO((rxvt_t *r, void (*update)(rxvt_t *))); void rxvt_menu_hide_all __PROTO((rxvt_t *r)); void rxvt_menu_hide __PROTO((rxvt_t *r)); void rxvt_menu_clear __PROTO((rxvt_t *r, menu_t *menu)); void rxvt_menubar_clear __PROTO((rxvt_t *r)); bar_t * rxvt_menubar_find __PROTO((rxvt_t *r, const char *name)); int rxvt_menubar_push __PROTO((rxvt_t *r, const char *name)); void rxvt_menubar_remove __PROTO((rxvt_t *r, const char *name)); void rxvt_action_decode __PROTO((FILE *fp, action_t *act)); void rxvt_menu_dump __PROTO((FILE *fp, menu_t *menu)); void rxvt_menubar_dump __PROTO((rxvt_t *r, FILE *fp)); void rxvt_draw_Arrows __PROTO((rxvt_t *r, int name, int state)); int rxvt_menubar_mapping __PROTO((rxvt_t *r, int map)); int rxvt_menu_select __PROTO((rxvt_t *r, XButtonEvent *ev)); void rxvt_menubar_select __PROTO((rxvt_t *r, XButtonEvent *ev)); rxvt-2.7.10/src/main.intpro010064400001440000024000000022700764024231400142120ustar gcwstaffint rxvt_xerror_handler __PROTO((const Display *display __attribute__((unused)), const XErrorEvent *event)); void rxvt_privileges __PROTO((rxvt_t *r, int mode)); void rxvt_font_up_down __PROTO((rxvt_t *r, int n, int direction)); int rxvt_get_fontwidest __PROTO((XFontStruct *f)); void rxvt_set_colorfgbg __PROTO((rxvt_t *r)); void rxvt_setSize __PROTO((rxvt_t *r, XRectangle *size)); void rxvt_setColor __PROTO((rxvt_t *r, unsigned long *fg, unsigned long *bg)); Bool rxvt_IMisRunning __PROTO((rxvt_t *r)); void rxvt_setPreeditArea __PROTO((rxvt_t *r, XRectangle *preedit_rect, XRectangle *status_rect, XRectangle *needed_rect)); void rxvt_IMDestroyCallback __PROTO((XIM xim __attribute__((unused)), XPointer client_data __attribute__((unused)), XPointer call_data __attribute__((unused)))); Bool rxvt_IM_get_IC __PROTO((rxvt_t *r)); void rxvt_set_r __PROTO((rxvt_t *r)); rxvt-2.7.10/src/logging.intpro010064400001440000024000000004710764024231400147150ustar gcwstaffint rxvt_write_bsd_utmp __PROTO((int utmp_pos, struct utmp *wu)); void rxvt_update_wtmp __PROTO((const char *fname, const struct utmp *putmp)); void rxvt_update_lastlog __PROTO((const char *fname, const char *pty, const char *host)); rxvt-2.7.10/src/init.intpro010064400001440000024000000010630764024231400142300ustar gcwstaffint rxvt_getdtablesize __PROTO((void)); void rxvt_Get_Colours __PROTO((rxvt_t *r)); void rxvt_color_aliases __PROTO((rxvt_t *r, int idx)); void rxvt_get_ourmods __PROTO((rxvt_t *r)); int rxvt_run_command __PROTO((rxvt_t *r, const char *const *argv)); int rxvt_run_child __PROTO((rxvt_t *r, const char *const *argv)); void rxvt_get_ttymode __PROTO((ttymode_t *tio)); rxvt-2.7.10/src/grkelot.intpro010064400001440000024000000013100764024231400147270ustar gcwstaffvoid kstate_setcurr __PROTO((int stateno)); void kstate_init __PROTO((void)); void kstate_end __PROTO((void)); void kstate_init_all __PROTO((int greek_mode)); void kstate_end_all __PROTO((void)); void kstate_reset __PROTO((void)); void kstate_add_xlat __PROTO((char *str)); void kstate_add_switcher __PROTO((char *str)); void kstate_set_life __PROTO((char *str)); unsigned int kstate_cxlat __PROTO((unsigned int c)); rxvt-2.7.10/src/graphics.intpro010064400001440000024000000012640764024231400150700ustar gcwstaffvoid rxvt_Gr_NewWindow __PROTO((rxvt_t *r, int nargs, int args[])); void rxvt_Gr_ClearWindow __PROTO((rxvt_t *r, grwin_t *grwin)); void rxvt_Gr_Text __PROTO((rxvt_t *r, grwin_t *grwin, grcmd_t *data)); void rxvt_Gr_Geometry __PROTO((rxvt_t *r, grwin_t *grwin, grcmd_t *data __attribute__((unused)))); void rxvt_Gr_DestroyWindow __PROTO((rxvt_t *r, grwin_t *grwin)); void rxvt_Gr_Dispatch __PROTO((rxvt_t *r, grwin_t *grwin, grcmd_t *data)); void rxvt_Gr_Redraw __PROTO((rxvt_t *r, grwin_t *grwin)); rxvt-2.7.10/src/defaultfont.intpro010064400001440000024000000000000764024231400155660ustar gcwstaffrxvt-2.7.10/src/command.intpro010064400001440000024000000032420764024231400147040ustar gcwstaffvoid rxvt_lookup_key __PROTO((rxvt_t *r, XKeyEvent *ev)); unsigned char rxvt_cmd_getc __PROTO((rxvt_t *r)); void rxvt_mouse_report __PROTO((rxvt_t *r, const XButtonEvent *ev)); void rxvt_process_x_event __PROTO((rxvt_t *r, XEvent *ev)); void rxvt_button_press __PROTO((rxvt_t *r, XButtonEvent *ev)); void rxvt_button_release __PROTO((rxvt_t *r, XButtonEvent *ev)); void rxvt_process_print_pipe __PROTO((rxvt_t *r)); void rxvt_process_nonprinting __PROTO((rxvt_t *r, unsigned char ch)); void rxvt_process_escape_vt52 __PROTO((rxvt_t *r, unsigned char ch)); void rxvt_process_escape_seq __PROTO((rxvt_t *r)); void rxvt_process_csi_seq __PROTO((rxvt_t *r)); void rxvt_process_window_ops __PROTO((rxvt_t *r, const int *args, unsigned int nargs)); unsigned char * rxvt_get_to_st __PROTO((rxvt_t *r, unsigned char *ends_how)); void rxvt_process_dcs_seq __PROTO((rxvt_t *r)); void rxvt_process_osc_seq __PROTO((rxvt_t *r)); int rxvt_privcases __PROTO((rxvt_t *r, int mode, unsigned long bit)); void rxvt_process_terminal_mode __PROTO((rxvt_t *r, int mode, int priv __attribute__((unused)), unsigned int nargs, const int *arg)); void rxvt_process_sgr_mode __PROTO((rxvt_t *r, unsigned int nargs, const int *arg)); void rxvt_process_graphics __PROTO((rxvt_t *r)); rxvt-2.7.10/src/makeextprotos-awk010064400001440000024000000010420733020561500154340ustar gcwstaff/^\/\* EXTPROTO \*\/$/ { getline # function return printf "%-16s ", $0 cline="" while (index(cline, "{") == 0 && index(cline, "#") == 0) { getline # function name and args cline=cline $0 } gsub(/[\t\n]/, " ", cline) gsub(/[ ]+/, " ", cline) l = index(cline, "(") m = index(cline, "{") n = index(cline, "#") if (n > 0) { m = n } outstring = sprintf("%%-32.%ds __PROTO(", l - 1) printf outstring, cline reststring = substr(cline, l, m - l) printf reststring print ");" } rxvt-2.7.10/src/makeintprotos-awk010064400001440000024000000010420733020561500154260ustar gcwstaff/^\/\* INTPROTO \*\/$/ { getline # function return printf "%-16s ", $0 cline="" while (index(cline, "{") == 0 && index(cline, "#") == 0) { getline # function name and args cline=cline $0 } gsub(/[\t\n]/, " ", cline) gsub(/[ ]+/, " ", cline) l = index(cline, "(") m = index(cline, "{") n = index(cline, "#") if (n > 0) { m = n } outstring = sprintf("%%-32.%ds __PROTO(", l - 1) printf outstring, cline reststring = substr(cline, l, m - l) printf reststring print ");" } rxvt-2.7.10/src/.indent.pro010064400001440000024000000014560733020561000141110ustar gcwstaff--dont-format-comments --procnames-start-lines --parameter-indentation4 --indent-level4 --line-comments-indentation4 --cuddle-else --brace-indent0 --start-left-side-of-comments --no-blank-lines-after-commas --blank-lines-after-declarations --blank-lines-after-procedures --comment-indentation33 --declaration-comment-column33 --no-comment-delimiters-on-blank-lines --continuation-indentation4 --case-indentation0 --else-endif-column33 --no-space-after-casts --no-blank-before-sizeof --declaration-indentation16 --continue-at-parentheses --no-space-after-function-call-names --swallow-optional-blank-lines --space-special-semicolon --tab-size8 --line-length79 --braces-on-if-line --braces-on-struct-decl-line --leave-preprocessor-space --no-space-after-parentheses --honour-newlines --break-before-boolean-operator rxvt-2.7.10/src/rxvtlib.h.in010064400001440000024000000310220762753252400143100ustar gcwstaff/* * $Id: rxvtlib.h.in,v 1.10 2003/02/28 00:58:43 gcw Exp $ */ #ifndef _RXVTLIB_H_ /* include once only */ #define _RXVTLIB_H_ /* * section 1 generated by GNU autoconf for @build@ * this section may be changed as appropriate _before_ building */ /***************************************************************************** * SECTION 1 * *****************************************************************************/ /* * The following line MUST not be changed without also changing * config.h in the main directory before building */ @lib_multicharset@ /***************************************************************************** * INCLUDES * *****************************************************************************/ #include #include #include @include_stdarg_h@ @include_stdlib_h@ #include @include_unistd_h@ @include_string_h@ @include_fcntl_h@ @include_util_h@ @include_assert_h@ @include_sys_ioctl_h@ @include_sys_time_h@ @include_time_h@ @include_sys_select_h@ @include_sys_strredir_h@ #include #include #include /* Xlib, Xutil, Xresource, Xfuncproto */ /* * If we haven't pulled in typedef's like int16_t then do them ourself * type of (normal and unsigned) basic sizes */ @rxvt_int16_typedef@ @rxvt_u_int16_typedef@ @rxvt_int32_typedef@ @rxvt_u_int32_typedef@ @rxvt_int64_typedef@ @rxvt_u_int64_typedef@ /* whatever normal size corresponds to a integer pointer */ @rxvt_intp_define@ /* whatever normal size corresponds to a unsigned integer pointer */ @rxvt_u_intp_define@ /***************************************************************************** * SECTION 2 * * DO NOT TOUCH ANYTHING BELOW HERE * *****************************************************************************/ struct rxvt_vars; /* defined later on */ struct rxvt_hidden; /* not defined here */ #define scrollbar_visible(rxvtvars) ((rxvtvars)->scrollBar.state) #define menubar_visible(rxvtvars) ((rxvtvars)->menuBar.state) typedef struct { int32_t row; int32_t col; } row_col_t; typedef unsigned char text_t; #if defined(TTY_256COLOR) || defined(MULTICHAR_SET) #define rend_t u_int32_t #else #define rend_t u_int16_t #endif /* * TermWin elements limits * width : 1 <= width * height : 1 <= height * ncol : 1 <= ncol <= MAX(int16_t) * nrow : 1 <= nrow <= MAX(int16_t) * saveLines : 0 <= saveLines <= MAX(int16_t) * nscrolled : 0 <= nscrolled <= saveLines * view_start: 0 <= view_start <= nscrolled */ typedef struct { u_int16_t width; /* window width [pixels] */ u_int16_t height; /* window height [pixels] */ u_int16_t fwidth; /* font width [pixels] */ u_int16_t fheight; /* font height [pixels] */ u_int16_t propfont; /* font proportional flags */ u_int16_t ncol; /* window columns [characters] */ u_int16_t nrow; /* window rows [characters] */ u_int16_t focus; /* window has focus */ u_int16_t mapped; /* window state mapped? */ u_int16_t int_bwidth; /* internal border width */ u_int16_t ext_bwidth; /* external border width */ u_int16_t lineSpace; /* number of extra pixels between rows */ u_int16_t saveLines; /* number of lines that fit in scrollback */ u_int16_t nscrolled; /* number of line actually scrolled */ u_int16_t view_start; /* scrollback view starts here */ Window parent[6]; /* parent identifiers - we're parent[0] */ Window vt; /* vt100 window */ GC gc; /* GC for drawing text */ XFontStruct *font; /* main font structure */ XFontStruct *boldFont; /* bold font */ XFontStruct *boldFont_loaded; /* bold font loaded */ XFontStruct *mfont; /* Multichar font structure */ XFontSet fontset; Pixmap pixmap; } TermWin_t; /* * screen accounting: * screen_t elements * text: Contains all text information including the scrollback buffer. * Each line is length TermWin.ncol * tlen: The length of the line or -1 for wrapped lines. * rend: Contains rendition information: font, bold, colour, etc. * * Note: Each line for both text and rend are only allocated on demand, and * text[x] is allocated <=> rend[x] is allocated for all x. * row: Cursor row position : 0 <= row < TermWin.nrow * col: Cursor column position : 0 <= col < TermWin.ncol * tscroll: Scrolling region top row inclusive : 0 <= row < TermWin.nrow * bscroll: Scrolling region bottom row inclusive : 0 <= row < TermWin.nrow * * selection_t elements * clicks: 1, 2 or 3 clicks - 4 indicates a special condition of 1 where * nothing is selected * beg: row/column of beginning of selection : never past mark * mark: row/column of initial click : never past end * end: row/column of one character past end of selection * * Note: -TermWin.nscrolled <= beg.row <= mark.row <= end.row < TermWin.nrow * * Note: col == -1 ==> we're left of screen * * Layout of text/rend information in the screen_t text/rend structures: * Rows [0] ... [TermWin.saveLines - 1] * scrollback region : we're only here if TermWin.view_start != 0 * Rows [TermWin.saveLines] ... [TermWin.saveLines + TermWin.nrow - 1] * normal `unscrolled' screen region */ typedef struct { text_t **text; /* _all_ the text */ int16_t *tlen; /* length of each text line */ rend_t **rend; /* rendition, uses RS_ flags */ row_col_t cur; /* cursor position on the screen */ u_int16_t tscroll; /* top of settable scroll region */ u_int16_t bscroll; /* bottom of settable scroll region */ u_int16_t charset; /* character set number [0..3] */ unsigned int flags; /* see below */ row_col_t s_cur; /* saved cursor position */ u_int16_t s_charset; /* saved character set number [0..3] */ char s_charset_char; rend_t s_rstyle; /* saved rendition style */ } screen_t; typedef struct { unsigned char *text; /* selected text */ u_int32_t len; /* length of selected text */ enum { SELECTION_CLEAR = 0, /* nothing selected */ SELECTION_INIT, /* marked a point */ SELECTION_BEGIN, /* started a selection */ SELECTION_CONT, /* continued selection */ SELECTION_DONE /* selection put in CUT_BUFFER0 */ } op; /* current operation */ short screen; /* screen being used */ short clicks; /* number of clicks */ row_col_t beg; /* beginning of selection <= mark */ row_col_t mark; /* point of initial click <= end */ row_col_t end; /* one character past end point */ } selection_t; typedef enum { OLD_SELECT, OLD_WORD_SELECT, NEW_SELECT } sstyle_t; /* ------------------------------------------------------------------------- */ /* screen_t flags */ #define Screen_Relative (1<<0) /* relative origin mode flag */ #define Screen_VisibleCursor (1<<1) /* cursor visible? */ #define Screen_Autowrap (1<<2) /* auto-wrap flag */ #define Screen_Insert (1<<3) /* insert mode (vs. overstrike) */ #define Screen_WrapNext (1<<4) /* need to wrap for next char? */ #define Screen_DefaultFlags (Screen_VisibleCursor|Screen_Autowrap) /* rxvt_vars.Options */ #define Opt_console (1LU<<0) #define Opt_loginShell (1LU<<1) #define Opt_iconic (1LU<<2) #define Opt_visualBell (1LU<<3) #define Opt_mapAlert (1LU<<4) #define Opt_reverseVideo (1LU<<5) #define Opt_utmpInhibit (1LU<<6) #define Opt_scrollBar (1LU<<7) #define Opt_scrollBar_right (1LU<<8) #define Opt_scrollBar_floating (1LU<<9) #define Opt_meta8 (1LU<<10) #define Opt_scrollTtyOutput (1LU<<11) #define Opt_scrollTtyKeypress (1LU<<12) #define Opt_transparent (1LU<<13) #define Opt_transparent_all (1LU<<14) #define Opt_mc_hack (1LU<<15) #define Opt_tripleclickwords (1LU<<16) #define Opt_scrollWithBuffer (1LU<<17) #define Opt_jumpScroll (1LU<<18) #define Opt_mouseWheelScrollPage (1LU<<19) /* place holder used for parsing command-line options */ #define Opt_Reverse (1LU<<30) #define Opt_Boolean (1LU<<31) #define DEFAULT_OPTIONS (Opt_scrollBar | Opt_scrollTtyOutput \ | Opt_jumpScroll) #define PROPFONT_NORMAL (1<<0) #define PROPFONT_BOLD (1<<1) #define PROPFONT_MULTI (1<<2) /* ------------------------------------------------------------------------- */ typedef enum { EUCJ, SJIS, /* Japanese KANJI methods */ BIG5, CNS, /* Chinese BIG5 methods: CNS not implemented */ GB, /* Chinese GB method */ EUCKR, /* Korean method */ NOENC /* no encoding */ } ENC_METHOD; typedef struct { short method; void (*func)(unsigned char *, int); char *name; } KNOWN_ENCODINGS; typedef struct { short state; Window win; } menuBar_t; typedef struct { char state; /* scrollbar state */ char init; /* scrollbar has been initialised */ short beg; /* slider sub-window begin height */ short end; /* slider sub-window end height */ short top; /* slider top position */ short bot; /* slider bottom position */ short style; /* style: rxvt, xterm, next */ short width; /* scrollbar width */ Window win; int (*update)(struct rxvt_vars *, int, int, int, int); } scrollBar_t; typedef struct rxvt_vars { /* * These ``hidden'' items are not for public consumption and * must not be accessed externally */ struct rxvt_hidden *h; /* * Exposed items * Changes to structure here require library version number change */ TermWin_t TermWin; scrollBar_t scrollBar; menuBar_t menuBar; Display *Xdisplay; unsigned long Options; XSizeHints szHint; Colormap Xcmap; Pixel *PixColors; short numPixColors; Cursor TermWin_cursor; /* cursor for vt window */ int Xdepth; int sb_shadow; /* scrollbar shadow width */ int Xfd; /* file descriptor of X server connection */ int cmd_fd; /* pty file descriptor; connected to command */ int tty_fd; /* tty file descriptor; connected to child */ int num_fds; /* number of file descriptors being used */ int numlock_state; text_t **drawn_text; /* text drawn on screen (characters) */ rend_t **drawn_rend; /* text drawn on screen (rendition) */ text_t **buf_text; rend_t **buf_rend; char *tabs; /* per location: 1 == tab-stop */ screen_t screen; screen_t swap; selection_t selection; sstyle_t selection_style; ENC_METHOD encoding_method; } rxvt_t; /***************************************************************************** * PROTOTYPES * *****************************************************************************/ void rxvt_main_loop(rxvt_t *); rxvt_t *rxvt_init(int, const char *const *); #endif /* _RXVTLIB_H_ */ rxvt-2.7.10/src/gcc-Wall010075500001440000024000000013430733020561300134050ustar gcwstaff#!/bin/sh # gcc -Wall plus other important warnings not included in -Wall for arg do case $arg in -O*) Wuninitialized=-Wuninitialized;; # only makes sense with `-O' esac done exec gcc \ -Wall $Wuninitialized \ -Wwrite-strings \ -Wcast-qual \ -Wbad-function-cast \ -Wpointer-arith \ -Wstrict-prototypes \ -Wmissing-prototypes \ -Wmissing-declarations \ -Wnested-externs \ -Wtraditional \ -Wconversion \ -Wcomment \ -Wcast-align \ -Winline \ -Wshadow \ -Wredundant-decls \ -Wid-clash-31 \ "$@" # -Wall implies: # -Wimplicit # -Wreturn-type # -Wunused # -Wswitch # -Wformat # -Wchar-subscripts # -Wparentheses # -Wmissing-braces ------------------------------------------------------------------------------ rxvt-2.7.10/src/Makefile.in010064400001440000024000000176420740157562000141130ustar gcwstaff# $Id: Makefile.in,v 1.58 2001/11/30 02:50:52 gcw Exp $ @MCOMMON@ LINT = lint -DNARROWPROTO=1 $(XINC) -chapbxz srcdir = @srcdir@ VPATH = @srcdir@ .PATH: @srcdir@ top_builddir = .. basedir = .. thisdir = src MKDIR = @top_srcdir@/autoconf/mkinstalldirs # for developers: the following debug options may be used # -DDEBUG_CMD -DDEBUG_MAIN -DDEBUG_MENU -DDEBUG_MENUARROWS # -DDEBUG_MENUBAR_STACKING -DDEBUG_MENU_LAYOUT -DDEBUG_RESOURCES # -DDEBUG_SCREEN -DDEBUG_SEARCH_PATH -DDEBUG_SELECT -DDEBUG_TTY # -DDEBUG_TTYMODE -DDEBUG_X DEBUG=-DDEBUG_STRICT @DEBUG@ first_rule: all dummy: LIBSRCS = command.c defaultfont.c graphics.c grkelot.c init.c logging.c \ main.c menubar.c misc.c netdisp.c ptytty.c screen.c scrollbar.c \ scrollbar-rxvt.c scrollbar-next.c scrollbar-xterm.c strings.c \ xdefaults.c xpm.c SRCS = rxvt.c $(LIBSRCS) HDRS = command.h defaultfont.h feature.h grkelot.h init.h logging.h \ menubar.h netdisp.h protos.h rxvt.h rxvtgrx.h version.h EXTRAHDRS = rxvtlib.h OBJS = @OBJLIST@ rxvt.o LIBOBJS = @LIBOBJLIST@ LIBVERSION = @LIBVERSION@ INSTALL_LIBRXVT = @INSTALL_LIBRXVT@ RXVT_BASENAME=`$(ECHO) $(RXVTNAME)|$(SED) 's/$(EXEEXT)$$//'|$(SED) '$(transform)'` RXVT_BINNAME=$(DESTDIR)$(bindir)/$(RXVT_BASENAME)$(EXEEXT) RXVT_VERNAME=$(DESTDIR)$(bindir)/$(RXVT_BASENAME)-$(VERSION)$(EXEEXT) RXVT_OLDNAME=$(DESTDIR)$(bindir)/$(RXVT_BASENAME)-old$(EXEEXT) EXTPROS = command.extpro defaultfont.extpro graphics.extpro grkelot.extpro \ init.extpro logging.extpro main.extpro menubar.extpro misc.extpro \ netdisp.extpro ptytty.extpro screen.extpro scrollbar.extpro \ scrollbar-rxvt.extpro scrollbar-next.extpro scrollbar-xterm.extpro \ strings.extpro xdefaults.extpro xpm.extpro INTPROS = command.intpro defaultfont.intpro graphics.intpro grkelot.intpro \ init.intpro logging.intpro main.intpro menubar.intpro misc.intpro \ netdisp.intpro ptytty.intpro screen.intpro scrollbar.intpro \ scrollbar-rxvt.intpro scrollbar-next.intpro scrollbar-xterm.intpro \ strings.intpro xdefaults.intpro xpm.intpro DEPS = rxvt.h rxvtlib.h ${basedir}/config.h feature.h .protos # # Distribution variables # DIST = $(HDRS) $(SRCS) Makefile.in gcc-Wall rxvtlib.h.in .indent.pro \ makeintprotos-awk makeextprotos-awk $(INTPROS) $(EXTPROS) .protos .SUFFIXES: .c .o .extpro .intpro .lo #------------------------------------------------------------------------- # inference rules .c.o: $(COMPILE) -c $< .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .s.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .S.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< .c.intpro: @$(RMF) $@.tmp @$(AWK) -f $(srcdir)/makeintprotos-awk $< > $@.tmp @if $(CMP) -s $@ $@.tmp ; then : ; else $(ECHO) "$(AWK) -f $(srcdir)/makeintprotos-awk $< > $@"; $(CP) $@.tmp $@; fi @$(RMF) $@.tmp .c.extpro: @$(RMF) $@.tmp @$(AWK) -f $(srcdir)/makeextprotos-awk $< > $@.tmp @if $(CMP) -s $@ $@.tmp ; then : ; else $(ECHO) "$(AWK) -f $(srcdir)/makeextprotos-awk $< > $@"; $(CP) $@.tmp $@; fi @$(RMF) $@.tmp #------------------------------------------------------------------------- all: allbin rxvt: version.h rxvt.o librxvt.la $(LIBTOOL) --mode=link $(LINK) rxvt.o librxvt.la $(LIBS) $(XLIB) $(DLIB) -o $@ .protos: $(EXTPROS) @$(RMF) .protos date >.protos librxvt.la: $(LIBOBJS) $(LIBTOOL) --mode=link $(LINK) -rpath $(libdir) -version-info $(LIBVERSION) $(LIBOBJS) $(LIBS) -o $@ #------------------------------------------------------------------------- tags: $(SRCS) $(HDRS) $(EXTRAHDRS) ctags $(SRCS) $(HDRS) $(EXTRAHDRS) allbin: .protos rxvt alldoc: clean: $(RMF) rxvt core a.out *.o *.lo *.bak *~ *.intpro *.extpro .libs/* librxvt.la tmpproto .protos *.tmp realclean: clean $(RMF) tags librxvt.h cleandir: realclean distclean: realclean if test $(srcdir) = .; then $(MAKE) realclean; fi (cd $(srcdir); $(RMF) Makefile) install: allbin alldoc $(MKDIR) $(DESTDIR)$(includedir) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) @if test x$(INSTALL_LIBRXVT) = xyes; then \ $(ECHO) "$(LIBTOOL) --mode=install $(INSTALL_DATA) rxvtlib.h $(DESTDIR)$(includedir)/rxvtlib.h"; \ $(LIBTOOL) --mode=install $(INSTALL_DATA) rxvtlib.h $(DESTDIR)$(includedir)/rxvtlib.h; \ $(ECHO) "$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) librxvt.la $(DESTDIR)$(libdir)/librxvt.la"; \ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) librxvt.la $(DESTDIR)$(libdir)/librxvt.la; \ fi @if test -f $(RXVT_BINNAME); then \ $(ECHO) "$(RMF) $(RXVT_OLDNAME)"; \ $(RMF) $(RXVT_OLDNAME); \ $(ECHO) "$(MV) $(RXVT_BINNAME) $(RXVT_OLDNAME)"; \ $(MV) $(RXVT_BINNAME) $(RXVT_OLDNAME); \ fi @$(ECHO) "$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) rxvt $(RXVT_VERNAME)" @$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) rxvt $(RXVT_VERNAME) @$(ECHO) "$(LN) $(RXVT_VERNAME) $(RXVT_BINNAME)" @$(LN) $(RXVT_VERNAME) $(RXVT_BINNAME) uninstall: @$(ECHO) $(RMF) $(RXVT_VERNAME) @$(RMF) $(RXVT_VERNAME) @$(ECHO) "$(LIBTOOL) --mode=uninstall $(RMF) $(RXVT_BINNAME)" @$(LIBTOOL) --mode=uninstall $(RMF) $(RXVT_BINNAME) @if test x$(INSTALL_LIBRXVT) = xyes; then \ $(ECHO) "$(LIBTOOL) --mode=uninstall $(RMF) $(DESTDIR)$(libdir)/librxvt.la"; \ $(LIBTOOL) --mode=uninstall $(RMF) $(DESTDIR)$(libdir)/librxvt.la; \ $(ECHO) "$(LIBTOOL) --mode=uninstall $(RMF) $(DESTDIR)$(includedir)/rxvtlib.h"; \ $(LIBTOOL) --mode=uninstall $(RMF) $(DESTDIR)$(includedir)/rxvtlib.h; \ fi distdirs: mkdir $(basedir)/../$(VERNAME)/$(thisdir) distcopy: .protos $(INTPROS) $(CP) -p $(DIST) $(basedir)/../$(VERNAME)/$(thisdir) # ----------------------------------------------------------------------- # DO NOT DELETE: nice dependency list follows command.o: command.c $(DEPS) command.intpro command.h version.h defaultfont.o: defaultfont.c $(DEPS) defaultfont.intpro defaultfont.h graphics.o: graphics.c $(DEPS) graphics.intpro grkelot.o: grkelot.c $(DEPS) grkelot.intpro grkelot.h init.o: init.c $(DEPS) init.intpro init.h logging.o: logging.c $(DEPS) logging.intpro logging.h main.o: main.c $(DEPS) main.intpro menubar.o: menubar.c $(DEPS) menubar.intpro menubar.h version.h misc.o: misc.c $(DEPS) misc.intpro netdisp.o: netdisp.c $(DEPS) netdisp.intpro netdisp.h ptytty.o: ptytty.c $(DEPS) ptytty.intpro rxvt.o: rxvt.c $(DEPS) screen.o: screen.c $(DEPS) screen.intpro scrollbar.o: scrollbar.c $(DEPS) scrollbar.intpro scrollbar-rxvt.o: scrollbar-rxvt.c $(DEPS) scrollbar-rxvt.intpro scrollbar-next.o: scrollbar-next.c $(DEPS) scrollbar-next.intpro scrollbar-xterm.o: scrollbar-xterm.c $(DEPS) scrollbar-xterm.intpro strings.o: strings.c $(DEPS) strings.intpro xdefaults.o: xdefaults.c $(DEPS) xdefaults.intpro version.h xpm.o: xpm.c $(DEPS) xpm.intpro command.lo: command.c $(DEPS) command.intpro command.h version.h defaultfont.lo: defaultfont.c $(DEPS) defaultfont.intpro defaultfont.h graphics.lo: graphics.c $(DEPS) graphics.intpro grkelot.lo: grkelot.c $(DEPS) grkelot.intpro grkelot.h init.lo: init.c $(DEPS) init.intpro init.h logging.lo: logging.c $(DEPS) logging.intpro logging.h main.lo: main.c $(DEPS) main.intpro menubar.lo: menubar.c $(DEPS) menubar.intpro menubar.h version.h misc.lo: misc.c $(DEPS) misc.intpro netdisp.lo: netdisp.c $(DEPS) netdisp.intpro netdisp.h ptytty.lo: ptytty.c $(DEPS) ptytty.intpro rxvt.lo: rxvt.c $(DEPS) screen.lo: screen.c $(DEPS) screen.intpro scrollbar.lo: scrollbar.c $(DEPS) scrollbar.intpro scrollbar-rxvt.lo: scrollbar-rxvt.c $(DEPS) scrollbar-rxvt.intpro scrollbar-next.lo: scrollbar-next.c $(DEPS) scrollbar-next.intpro scrollbar-xterm.lo: scrollbar-xterm.c $(DEPS) scrollbar-xterm.intpro strings.lo: strings.c $(DEPS) strings.intpro xdefaults.lo: xdefaults.c $(DEPS) xdefaults.intpro version.h xpm.lo: xpm.c $(DEPS) xpm.intpro rxvt-2.7.10/src/xpm.c010064400001440000024000000230110733020615500127740ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: xpm.c *----------------------------------------------------------------------* * $Id: xpm.c,v 1.49 2001/07/27 06:38:37 gcw Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1997 Carsten Haitzler * Copyright (c) 1997,1998 Oezguer Kesim * Copyright (c) 1998-2001 Geoff Wing * * 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 of the License, 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. *---------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "xpm.intpro" /* PROTOS for internal routines */ #ifdef XPM_BACKGROUND /* * These GEOM strings indicate absolute size/position: * @ `WxH+X+Y' * @ `WxH+X' -> Y = X * @ `WxH' -> Y = X = 50 * @ `W+X+Y' -> H = W * @ `W+X' -> H = W, Y = X * @ `W' -> H = W, X = Y = 50 * @ `0xH' -> H *= H/100, X = Y = 50 (W unchanged) * @ `Wx0' -> W *= W/100, X = Y = 50 (H unchanged) * @ `=+X+Y' -> (H, W unchanged) * @ `=+X' -> Y = X (H, W unchanged) * * These GEOM strings adjust position relative to current position: * @ `+X+Y' * @ `+X' -> Y = X * * And this GEOM string is for querying current scale/position: * @ `?' */ /* EXTPROTO */ int rxvt_scale_pixmap(rxvt_t *r, const char *geom) { int flags, changed = 0; int x = 0, y = 0; unsigned int w = 0, h = 0; unsigned int n; char *p, *str; bgPixmap_t *bgpixmap = &(r->h->bgPixmap); #define MAXLEN_GEOM sizeof("[1000x1000+1000+1000]") if (geom == NULL) return 0; str = rxvt_malloc(MAXLEN_GEOM + 1); if (!STRCMP(geom, "?")) { sprintf(str, "[%dx%d+%d+%d]", /* can't presume snprintf() ! */ min(bgpixmap->w, 9999), min(bgpixmap->h, 9999), min(bgpixmap->x, 9999), min(bgpixmap->y, 9999)); rxvt_xterm_seq(r, XTerm_title, str, CHAR_ST); free(str); return 0; } if ((p = STRCHR(geom, ';')) == NULL) p = STRCHR(geom, '\0'); n = (p - geom); if (n <= MAXLEN_GEOM) { STRNCPY(str, geom, n); str[n] = '\0'; flags = XParseGeometry(str, &x, &y, &w, &h); if (!flags) { flags |= WidthValue; w = 0; } /* default is tile */ if (flags & WidthValue) { if (!(flags & XValue)) x = 50; if (!(flags & HeightValue)) h = w; if (w && !h) { w = (bgpixmap->w * w) / 100; h = bgpixmap->h; } else if (h && !w) { w = bgpixmap->w; h = (bgpixmap->h * h) / 100; } if (w > 1000) w = 1000; if (h > 1000) h = 1000; if (bgpixmap->w != (short)w) { bgpixmap->w = (short)w; changed++; } if (bgpixmap->h != (short)h) { bgpixmap->h = (short)h; changed++; } } if (!(flags & YValue)) { if (flags & XNegative) flags |= YNegative; y = x; } if (!(flags & WidthValue) && geom[0] != '=') { x += bgpixmap->x; y += bgpixmap->y; } else { if (flags & XNegative) x += 100; if (flags & YNegative) y += 100; } MIN_IT(x, 100); MIN_IT(y, 100); MAX_IT(x, 0); MAX_IT(y, 0); if (bgpixmap->x != x) { bgpixmap->x = x; changed++; } if (bgpixmap->y != y) { bgpixmap->y = y; changed++; } } free(str); return changed; } /* EXTPROTO */ void rxvt_resize_pixmap(rxvt_t *r) { XGCValues gcvalue; GC gc; unsigned int width = TermWin_TotalWidth(); unsigned int height = TermWin_TotalHeight(); if (r->TermWin.pixmap != None) XFreePixmap(r->Xdisplay, r->TermWin.pixmap); if (r->h->bgPixmap.pixmap == None) { /* So be it: I'm not using pixmaps */ r->TermWin.pixmap = None; if (!(r->Options & Opt_transparent) || r->h->am_transparent == 0) XSetWindowBackground(r->Xdisplay, r->TermWin.vt, r->PixColors[Color_bg]); return; } gcvalue.foreground = r->PixColors[Color_bg]; gc = XCreateGC(r->Xdisplay, r->TermWin.vt, GCForeground, &gcvalue); if (r->h->bgPixmap.pixmap != None) { /* we have a specified pixmap */ unsigned int w = r->h->bgPixmap.w, h = r->h->bgPixmap.h, x = r->h->bgPixmap.x, y = r->h->bgPixmap.y; unsigned int xpmh = r->h->xpmAttr.height, xpmw = r->h->xpmAttr.width; /* * don't zoom pixmap too much nor expand really small pixmaps */ if (w > 1000 || h > 1000) w = 1; else if (width > (10 * xpmw) || height > (10 * xpmh)) w = 0; /* tile */ if (w == 0) { /* basic X tiling - let the X server do it */ r->TermWin.pixmap = XCreatePixmap(r->Xdisplay, r->TermWin.vt, xpmw, xpmh, (unsigned int)XDEPTH); XCopyArea(r->Xdisplay, r->h->bgPixmap.pixmap, r->TermWin.pixmap, gc, 0, 0, xpmw, xpmh, 0, 0); } else { float incr, p; Pixmap tmp; r->TermWin.pixmap = XCreatePixmap(r->Xdisplay, r->TermWin.vt, width, height, (unsigned int)XDEPTH); /* * horizontal scaling */ rxvt_pixmap_incr(&w, &x, &incr, &p, width, xpmw); tmp = XCreatePixmap(r->Xdisplay, r->TermWin.vt, width, xpmh, (unsigned int)XDEPTH); XFillRectangle(r->Xdisplay, tmp, gc, 0, 0, width, xpmh); for ( /*nil */ ; x < w; x++, p += incr) { if (p >= xpmw) p = 0; /* copy one column from the original pixmap to the tmp pixmap */ XCopyArea(r->Xdisplay, r->h->bgPixmap.pixmap, tmp, gc, (int)p, 0, 1, xpmh, (int)x, 0); } /* * vertical scaling */ rxvt_pixmap_incr(&h, &y, &incr, &p, height, xpmh); if (y > 0) XFillRectangle(r->Xdisplay, r->TermWin.pixmap, gc, 0, 0, width, y); if (h < height) XFillRectangle(r->Xdisplay, r->TermWin.pixmap, gc, 0, (int)h, width, height - h + 1); for ( /*nil */ ; y < h; y++, p += incr) { if (p >= xpmh) p = 0; /* copy one row from the tmp pixmap to the main pixmap */ XCopyArea(r->Xdisplay, tmp, r->TermWin.pixmap, gc, 0, (int)p, width, 1, 0, (int)y); } XFreePixmap(r->Xdisplay, tmp); } } XSetWindowBackgroundPixmap(r->Xdisplay, r->TermWin.vt, r->TermWin.pixmap); XFreeGC(r->Xdisplay, gc); r->h->am_transparent = 0; XClearWindow(r->Xdisplay, r->TermWin.vt); XSync(r->Xdisplay, False); } /* * Calculate tiling sizes and increments * At start, p == 0, incr == xpmwidthheight */ /* INTPROTO */ void rxvt_pixmap_incr(unsigned int *wh, unsigned int *xy, float *incr, float *p, unsigned int widthheight, unsigned int xpmwidthheight) { unsigned int cwh, cxy; float cincr, cp; cp = 0; cincr = (float)xpmwidthheight; cxy = *xy; cwh = *wh; if (cwh == 1) { /* display one image, no horizontal/vertical scaling */ cincr = (float)widthheight; if (xpmwidthheight <= widthheight) { cwh = xpmwidthheight; cxy = (cxy * (widthheight - cwh)) / 100; /* beware! order */ cwh += cxy; } else { cxy = 0; cwh = widthheight; } } else if (cwh < 10) { /* fit WH images across/down screen */ cincr *= cwh; cxy = 0; cwh = widthheight; } else { cincr *= 100.0 / cwh; if (cwh < 100) { /* contract */ float pos; cwh = (cwh * widthheight) / 100; pos = (float)cxy / 100 * widthheight - (cwh / 2); cxy = (widthheight - cwh); if (pos <= 0) cxy = 0; else if (pos < cxy) cxy = pos; cwh += cxy; } else { /* expand */ if (cxy > 0) { /* position */ float pos; pos = (float)cxy / 100 * xpmwidthheight - (cincr / 2); cp = xpmwidthheight - cincr; if (pos <= 0) cp = 0; else if (pos < cp) cp = pos; } cxy = 0; cwh = widthheight; } } cincr /= widthheight; *wh = cwh; *xy = cxy; *incr = cincr; *p = cp; } /* EXTPROTO */ Pixmap rxvt_set_bgPixmap(rxvt_t *r, const char *file) { char *f; assert(file != NULL); if (r->h->bgPixmap.pixmap != None) { XFreePixmap(r->Xdisplay, r->h->bgPixmap.pixmap); r->h->bgPixmap.pixmap = None; } XSetWindowBackground(r->Xdisplay, r->TermWin.vt, r->PixColors[Color_bg]); if (*file != '\0') { /* XWindowAttributes attr; */ /* * we already have the required attributes */ /* XGetWindowAttributes(r->Xdisplay, r->TermWin.vt, &attr); */ r->h->xpmAttr.closeness = 30000; r->h->xpmAttr.colormap = XCMAP; r->h->xpmAttr.visual = XVISUAL; r->h->xpmAttr.depth = XDEPTH; r->h->xpmAttr.valuemask = (XpmCloseness | XpmColormap | XpmVisual | XpmDepth | XpmSize | XpmReturnPixels); /* search environment variables here too */ f = (char *)rxvt_File_find(file, ".xpm", r->h->rs[Rs_path]); if (f == NULL || XpmReadFileToPixmap(r->Xdisplay, Xroot, f, &r->h->bgPixmap.pixmap, NULL, &r->h->xpmAttr)) { char *p; /* semi-colon delimited */ if ((p = STRCHR(file, ';')) == NULL) p = STRCHR(file, '\0'); rxvt_print_error("couldn't load XPM file \"%.*s\"", (p - file), file); } free(f); } rxvt_resize_pixmap(r); return r->h->bgPixmap.pixmap; } #endif /* XPM_BACKGROUND */ rxvt-2.7.10/src/xdefaults.c010064400001440000024000000757630762753252600142310ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: xdefaults.c *----------------------------------------------------------------------* * $Id: xdefaults.c,v 1.108 2003/02/28 00:58:43 gcw Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1994 Robert Nation * - original version * Copyright (c) 1997,1998 mj olesen * * 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 of the License, 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. *----------------------------------------------------------------------*/ /*----------------------------------------------------------------------* * get resources from ~/.Xdefaults or ~/.Xresources with the memory-saving * default or with XGetDefault() (#define USE_XGETDEFAULT) *----------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "version.h" #include "xdefaults.intpro" /* PROTOS for internal routines */ /* #define DEBUG_RESOURCES */ static const char *const xnames[2] = { ".Xdefaults", ".Xresources" }; /*{{{ monolithic option/resource structure: */ /* * `string' options MUST have a usage argument * `switch' and `boolean' options have no argument * if there's no desc(ription), it won't appear in rxvt_usage() */ /* INFO() - descriptive information only */ #define INFO(opt, arg, desc) \ {0, -1, NULL, (opt), (arg), (desc)} /* STRG() - command-line option, with/without resource */ #define STRG(rsp, kw, opt, arg, desc) \ {0, (rsp), (kw), (opt), (arg), (desc)} /* RSTRG() - resource/long-option */ #define RSTRG(rsp, kw, arg) \ {0, (rsp), (kw), NULL, (arg), NULL} /* BOOL() - regular boolean `-/+' flag */ #define BOOL(rsp, kw, opt, flag, desc) \ {(Opt_Boolean|(flag)), (rsp), (kw), (opt), NULL, (desc)} /* SWCH() - `-' flag */ #define SWCH(opt, flag, desc) \ {(flag), -1, NULL, (opt), NULL, (desc)} /* convenient macros */ #define optList_strlen(i) \ (optList[i].flag ? 0 : (optList[i].arg ? STRLEN(optList[i].arg) : 1)) #define optList_isBool(i) \ (optList[i].flag & Opt_Boolean) #define optList_isReverse(i) \ (optList[i].flag & Opt_Reverse) #define optList_size() \ (sizeof(optList) / sizeof(optList[0])) static const struct { const unsigned long flag; /* Option flag */ const int doff; /* data offset */ const char *kw; /* keyword */ const char *opt; /* option */ const char *arg; /* argument */ const char *desc; /* description */ } optList[] = { STRG(Rs_display_name, NULL, "d", NULL, NULL), /* short form */ STRG(Rs_display_name, NULL, "display", "string", "X server to contact"), STRG(Rs_term_name, "termName", "tn", "string", "value of the TERM environment variable"), STRG(Rs_geometry, NULL, "g", NULL, NULL), /* short form */ STRG(Rs_geometry, "geometry", "geometry", "geometry", "size (in characters) and position"), SWCH("C", Opt_console, "intercept console messages"), SWCH("iconic", Opt_iconic, "start iconic"), SWCH("ic", Opt_iconic, NULL), /* short form */ BOOL(Rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, "reverse video"), BOOL(Rs_loginShell, "loginShell", "ls", Opt_loginShell, "login shell"), BOOL(Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, "jump scrolling"), #ifdef HAVE_SCROLLBARS BOOL(Rs_scrollBar, "scrollBar", "sb", Opt_scrollBar, "scrollbar"), BOOL(Rs_scrollBar_right, "scrollBar_right", "sr", Opt_scrollBar_right, "scrollbar right"), BOOL(Rs_scrollBar_floating, "scrollBar_floating", "st", Opt_scrollBar_floating, "scrollbar without a trough"), #endif BOOL(Rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, NULL), BOOL(Rs_scrollTtyOutput, NULL, "si", Opt_Reverse | Opt_scrollTtyOutput, "scroll-on-tty-output inhibit"), BOOL(Rs_scrollTtyKeypress, "scrollTtyKeypress", "sk", Opt_scrollTtyKeypress, "scroll-on-keypress"), BOOL(Rs_scrollWithBuffer, "scrollWithBuffer", "sw", Opt_scrollWithBuffer, "scroll-with-buffer"), #ifdef TRANSPARENT BOOL(Rs_transparent, "inheritPixmap", "ip", Opt_transparent, "inherit parent pixmap"), BOOL(Rs_transparent_all, "inheritPixmapforce", "ipf", Opt_transparent_all, "forcefully inherit root pixmap"), SWCH("tr", Opt_transparent, NULL), #endif BOOL(Rs_utmpInhibit, "utmpInhibit", "ut", Opt_utmpInhibit, "utmp inhibit"), #ifndef NO_BELL BOOL(Rs_visualBell, "visualBell", "vb", Opt_visualBell, "visual bell"), # if ! defined(NO_MAPALERT) && defined(MAPALERT_OPTION) BOOL(Rs_mapAlert, "mapAlert", NULL, Opt_mapAlert, NULL), # endif #endif #ifdef META8_OPTION BOOL(Rs_meta8, "meta8", NULL, Opt_meta8, NULL), #endif #ifdef MOUSE_WHEEL BOOL(Rs_mouseWheelScrollPage, "mouseWheelScrollPage", NULL, Opt_mouseWheelScrollPage, NULL), #endif #ifdef MULTICHAR_SET BOOL(Rs_mc_hack, "multibyte_cursor", "mcc", Opt_mc_hack, "Multibyte character cursor movement"), #endif #ifndef NO_FRILLS BOOL(Rs_tripleclickwords, "tripleclickwords", "tcw", Opt_tripleclickwords, "triple click word selection"), #endif STRG(Rs_color + Color_bg, "background", "bg", "color", "background color"), STRG(Rs_color + Color_fg, "foreground", "fg", "color", "foreground color"), RSTRG(Rs_color + minCOLOR + 0, "color0", "color"), RSTRG(Rs_color + minCOLOR + 1, "color1", "color"), RSTRG(Rs_color + minCOLOR + 2, "color2", "color"), RSTRG(Rs_color + minCOLOR + 3, "color3", "color"), RSTRG(Rs_color + minCOLOR + 4, "color4", "color"), RSTRG(Rs_color + minCOLOR + 5, "color5", "color"), RSTRG(Rs_color + minCOLOR + 6, "color6", "color"), RSTRG(Rs_color + minCOLOR + 7, "color7", "color"), #ifndef NO_BRIGHTCOLOR RSTRG(Rs_color + minBrightCOLOR + 0, "color8", "color"), RSTRG(Rs_color + minBrightCOLOR + 1, "color9", "color"), RSTRG(Rs_color + minBrightCOLOR + 2, "color10", "color"), RSTRG(Rs_color + minBrightCOLOR + 3, "color11", "color"), RSTRG(Rs_color + minBrightCOLOR + 4, "color12", "color"), RSTRG(Rs_color + minBrightCOLOR + 5, "color13", "color"), RSTRG(Rs_color + minBrightCOLOR + 6, "color14", "color"), RSTRG(Rs_color + minBrightCOLOR + 7, "color15", "color"), #endif /* NO_BRIGHTCOLOR */ #ifndef NO_BOLD_UNDERLINE_REVERSE RSTRG(Rs_color + Color_BD, "colorBD", "color"), RSTRG(Rs_color + Color_UL, "colorUL", "color"), RSTRG(Rs_color + Color_RV, "colorRV", "color"), #endif /* ! NO_BOLD_UNDERLINE_REVERSE */ #ifdef KEEP_SCROLLCOLOR RSTRG(Rs_color + Color_scroll, "scrollColor", "color"), RSTRG(Rs_color + Color_trough, "troughColor", "color"), #endif /* KEEP_SCROLLCOLOR */ #ifdef OPTION_HC STRG(Rs_color + Color_HC, "highlightColor", "hc", "color", "highlight color"), #endif #if defined (XPM_BACKGROUND) || (MENUBAR_MAX) RSTRG(Rs_path, "path", "search path"), #endif /* defined (XPM_BACKGROUND) || (MENUBAR_MAX) */ #ifdef XPM_BACKGROUND STRG(Rs_backgroundPixmap, "backgroundPixmap", "pixmap", "file[;geom]", "background pixmap"), #endif /* XPM_BACKGROUND */ #if (MENUBAR_MAX) RSTRG(Rs_menu, "menu", "name[;tag]"), #endif #ifndef NO_BOLDFONT STRG(Rs_boldFont, "boldFont", "fb", "fontname", "bold text font"), #endif STRG(Rs_font + 0, "font", "fn", "fontname", "normal text font"), /* fonts: command-line option = resource name */ #if MAX_NFONTS > 1 RSTRG(Rs_font + 1, "font1", "fontname"), #endif #if MAX_NFONTS > 2 RSTRG(Rs_font + 2, "font2", "fontname"), #endif #if MAX_NFONTS > 3 RSTRG(Rs_font + 3, "font3", "fontname"), #endif #if MAX_NFONTS > 4 RSTRG(Rs_font + 4, "font4", "fontname"), #endif #if MAX_NFONTS > 5 RSTRG(Rs_font + 5, "font5", "fontname"), #endif #if MAX_NFONTS > 6 RSTRG(Rs_font + 6, "font6", "fontname"), #endif #if MAX_NFONTS > 7 RSTRG(Rs_font + 7, "font7", "fontname"), #endif #ifdef MULTICHAR_SET STRG(Rs_mfont + 0, "mfont", "fm", "fontname", "multichar font"), /* fonts: command-line option = resource name */ # if MAX_NFONTS > 1 RSTRG(Rs_mfont + 1, "mfont1", "fontname"), # endif # if MAX_NFONTS > 2 RSTRG(Rs_mfont + 2, "mfont2", "fontname"), # endif # if MAX_NFONTS > 3 RSTRG(Rs_mfont + 3, "mfont3", "fontname"), # endif # if MAX_NFONTS > 4 RSTRG(Rs_mfont + 4, "mfont4", "fontname"), # endif # if MAX_NFONTS > 5 RSTRG(Rs_mfont + 5, "mfont5", "fontname"), # endif # if MAX_NFONTS > 6 RSTRG(Rs_mfont + 6, "mfont6", "fontname"), # endif # if MAX_NFONTS > 7 RSTRG(Rs_mfont + 7, "mfont7", "fontname"), # endif #endif /* MULTICHAR_SET */ #ifdef MULTICHAR_SET STRG(Rs_multichar_encoding, "multichar_encoding", "km", "mode", "multichar encoding; mode = eucj|sjis|big5|gb|kr|noenc"), #endif /* MULTICHAR_SET */ #ifdef USE_XIM STRG(Rs_inputMethod, "inputMethod", "im", "name", "name of input method"), STRG(Rs_preeditType, "preeditType", "pt", "style", "input style: style = OverTheSpot|OffTheSpot|Root"), #endif /* USE_XIM */ #ifdef GREEK_SUPPORT STRG(Rs_greek_keyboard, "greek_keyboard", "grk", "mode", "greek keyboard mapping; mode = iso | ibm"), RSTRG(Rs_greektoggle_key, "greektoggle_key", "keysym"), #endif STRG(Rs_name, NULL, "name", "string", "client instance, icon, and title strings"), STRG(Rs_title, "title", "title", "string", "title name for window"), STRG(Rs_title, NULL, "T", NULL, NULL), /* short form */ STRG(Rs_iconName, "iconName", "n", "string", "icon name for window"), #ifndef NO_CURSORCOLOR STRG(Rs_color + Color_cursor, "cursorColor", "cr", "color", "cursor color"), /* command-line option = resource name */ RSTRG(Rs_color + Color_cursor2, "cursorColor2", "color"), #endif /* NO_CURSORCOLOR */ STRG(Rs_color + Color_pointer, "pointerColor", "pr", "color", "pointer color"), STRG(Rs_color + Color_border, "borderColor", "bd", "color", "border color"), STRG(Rs_saveLines, "saveLines", "sl", "number", "number of scrolled lines to save"), #ifndef NO_FRILLS STRG(Rs_ext_bwidth, "externalBorder", "w", "number", "external border in pixels"), STRG(Rs_ext_bwidth, NULL, "bw", NULL, NULL), STRG(Rs_ext_bwidth, NULL, "borderwidth", NULL, NULL), STRG(Rs_int_bwidth, "internalBorder", "b", "number", "internal border in pixels"), #endif #ifndef NO_LINESPACE STRG(Rs_lineSpace, "lineSpace", "lsp", "number", "number of extra pixels between rows"), #endif STRG(Rs_scrollBar_thickness, "thickness", "sbt", "number", "scrollbar thickness/width in pixels"), #ifndef NO_BACKSPACE_KEY RSTRG(Rs_backspace_key, "backspacekey", "string"), #endif #ifndef NO_DELETE_KEY RSTRG(Rs_delete_key, "deletekey", "string"), #endif RSTRG(Rs_selectstyle, "selectstyle", "mode"), RSTRG(Rs_scrollstyle, "scrollstyle", "mode"), #ifdef HAVE_SCROLLBARS RSTRG(Rs_scrollBar_align, "scrollBar_align", "mode"), #endif #ifdef PRINTPIPE RSTRG(Rs_print_pipe, "print-pipe", "string"), #endif #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) RSTRG(Rs_bigfont_key, "bigfont_key", "keysym"), RSTRG(Rs_smallfont_key, "smallfont_key", "keysym"), #endif STRG(Rs_modifier, "modifier", "mod", "modifier", "meta modifier = alt|meta|hyper|super|mod1|...|mod5"), INFO("xrm", "string", "X resource"), #ifdef CUTCHAR_RESOURCE RSTRG(Rs_cutchars, "cutchars", "string"), #endif /* CUTCHAR_RESOURCE */ RSTRG(Rs_answerbackstring, "answerbackString", "string"), INFO("e", "command arg ...", "command to execute") }; #undef INFO #undef STRG #undef RSTRG #undef SWCH #undef BOOL /*}}} */ static const char releasestring[] = "Rxvt v" VERSION " - released: " DATE "\n"; static const char optionsstring[] = "Options: " #if defined(XPM_BACKGROUND) "XPM," #endif #if defined(TRANSPARENT) "transparent," #endif #if defined(UTMP_SUPPORT) "utmp," #endif #if defined(MENUBAR) "menubar," #endif #if !defined(NO_FRILLS) "frills," #endif #if !defined(NO_LINESPACE) "linespace," #endif #if defined(PREFER_24BIT) "24bit," #endif #if defined(USE_XIM) "XIM," #endif #if defined(MULTICHAR_SET) "multichar_languages," #endif "scrollbars=" #if !defined(HAVE_SCROLLBARS) "NONE" #else # if defined(RXVT_SCROLLBAR) "rxvt" # if defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) "+" # endif # endif # if defined(NEXT_SCROLLBAR) "NeXT" # if defined(XTERM_SCROLLBAR) "+" # endif # endif # if defined(XTERM_SCROLLBAR) "xterm" # endif #endif "," #if defined(GREEK_SUPPORT) "Greek," #endif #if defined(RXVT_GRAPHICS) "graphics," #endif #if defined(NO_BACKSPACE_KEY) "no_backspace," #endif #if defined(NO_DELETE_KEY) "no_delete," #endif #if !defined(NO_STRINGS) "strings," #endif #if defined(TTY_256COLOR) "256colour," #endif #if defined(NO_RESOURCES) "NoResources" #else # if defined(USE_XGETDEFAULT) "XGetDefaults" # else ".Xdefaults" # endif #endif "\nUsage: "; /* Usage */ #define INDENT 18 /*{{{ usage: */ /*----------------------------------------------------------------------*/ /* EXTPROTO */ void rxvt_usage(int type) { unsigned int i, col; write(STDERR_FILENO, releasestring, sizeof(releasestring) - 1); write(STDERR_FILENO, optionsstring, sizeof(optionsstring) - 1); write(STDERR_FILENO, APL_NAME, sizeof(APL_NAME) - 1); switch (type) { case 0: /* brief listing */ fprintf(stderr, " [-help] [--help]\n"); for (col = 1, i = 0; i < optList_size(); i++) if (optList[i].desc != NULL) { int len = 0; if (!optList_isBool(i)) { len = optList_strlen(i); if (len > 0) len++; /* account for space */ } #ifdef DEBUG_STRICT assert(optList[i].opt != NULL); #endif len += 4 + STRLEN(optList[i].opt) + (optList_isBool(i) ? 2: 0); col += len; if (col > 79) { /* assume regular width */ putc('\n', stderr); col = 1 + len; } fprintf(stderr, " [-%s%s", (optList_isBool(i) ? "/+" : ""), optList[i].opt); if (optList_strlen(i)) fprintf(stderr, " %s]", optList[i].arg); else fprintf(stderr, "]"); } break; case 1: /* full command-line listing */ fprintf(stderr, " [options] [-e command args]\n\n" "where options include:\n"); for (i = 0; i < optList_size(); i++) if (optList[i].desc != NULL) { #ifdef DEBUG_STRICT assert(optList[i].opt != NULL); #endif fprintf(stderr, " %s%s %-*s%s%s\n", (optList_isBool(i) ? "-/+" : "-"), optList[i].opt, (INDENT - STRLEN(optList[i].opt) + (optList_isBool(i) ? 0 : 2)), (optList[i].arg ? optList[i].arg : ""), (optList_isBool(i) ? "turn on/off " : ""), optList[i].desc); } fprintf(stderr, "\n --help to list long-options"); break; case 2: /* full resource listing */ fprintf(stderr, " [options] [-e command args]\n\n" "where resources (long-options) include:\n"); for (i = 0; i < optList_size(); i++) if (optList[i].kw != NULL) fprintf(stderr, " %s: %*s%s\n", optList[i].kw, (INDENT - STRLEN(optList[i].kw)), "", /* XXX */ (optList_isBool(i) ? "boolean" : optList[i].arg)); #ifdef KEYSYM_RESOURCE fprintf(stderr, " " "keysym.sym" ": %*s%s\n", (INDENT - sizeof("keysym.sym") + 1), "", /* XXX */ "keysym"); #endif fprintf(stderr, "\n -help to list options"); break; } fprintf(stderr, "\n\n"); exit(EXIT_FAILURE); /* NOTREACHED */ } /*}}} */ /*{{{ get command-line options before getting resources */ /* EXTPROTO */ void rxvt_get_options(rxvt_t *r, int argc, const char *const *argv) { int i, bad_option = 0; static const char On[3] = "ON", Off[4] = "OFF"; for (i = 1; i < argc; i++) { unsigned int entry, longopt = 0; const char *flag, *opt; opt = argv[i]; #ifdef DEBUG_RESOURCES fprintf(stderr, "argv[%d] = %s: ", i, opt); #endif if (*opt == '-') { flag = On; if (*++opt == '-') longopt = *opt++; /* long option */ } else if (*opt == '+') { flag = Off; if (*++opt == '+') longopt = *opt++; /* long option */ } else { bad_option = 1; rxvt_print_error("bad option \"%s\"", opt); continue; } if (!STRCMP(opt, "help")) rxvt_usage(longopt ? 2 : 1); if (!STRCMP(opt, "h")) rxvt_usage(0); /* feature: always try to match long-options */ for (entry = 0; entry < optList_size(); entry++) if ((optList[entry].kw && !STRCMP(opt, optList[entry].kw)) || (!longopt && optList[entry].opt && !STRCMP(opt, optList[entry].opt))) break; if (entry < optList_size()) { if (optList_isReverse(entry)) flag = flag == On ? Off : On; if (optList_strlen(entry)) { /* string value */ const char *str = argv[++i]; #ifdef DEBUG_RESOURCES fprintf(stderr, "string (%s,%s) = ", optList[entry].opt ? optList[entry].opt : "nil", optList[entry].kw ? optList[entry].kw : "nil"); #endif if (flag == On && str && (optList[entry].doff != -1)) { #ifdef DEBUG_RESOURCES fprintf(stderr, "\"%s\"\n", str); #endif r->h->rs[optList[entry].doff] = str; /* * special cases are handled in main.c:main() to allow * X resources to set these values before we settle for * default values */ } #ifdef DEBUG_RESOURCES else fprintf(stderr, "???\n"); #endif } else { /* boolean value */ #ifdef DEBUG_RESOURCES fprintf(stderr, "boolean (%s,%s) = %s\n", optList[entry].opt, optList[entry].kw, flag); #endif if (flag == On) r->Options |= (optList[entry].flag); else r->Options &= ~(optList[entry].flag); if (optList[entry].doff != -1) r->h->rs[optList[entry].doff] = flag; } } else #ifdef KEYSYM_RESOURCE /* if (!STRNCMP(opt, "keysym.", sizeof("keysym.") - 1)) */ if (rxvt_Str_match(opt, "keysym.")) { const char *str = argv[++i]; if (str != NULL) rxvt_parse_keysym(r, opt + sizeof("keysym.") - 1, str); } else #endif { /* * various old-style options, just ignore * Obsolete since about Jan 96, * so they can probably eventually be removed */ const char *msg = "bad"; if (longopt) { opt--; bad_option = 1; } else if (!STRCMP(opt, "7") || !STRCMP(opt, "8") #ifdef GREEK_SUPPORT /* obsolete 12 May 1996 (v2.17) */ || !rxvt_Str_match(opt, "grk") #endif ) msg = "obsolete"; else bad_option = 1; rxvt_print_error("%s option \"%s\"", msg, --opt); } } if (bad_option) rxvt_usage(0); } /*}}} */ #ifndef NO_RESOURCES /*----------------------------------------------------------------------*/ # ifdef KEYSYM_RESOURCE /* * Define key from XrmEnumerateDatabase. * quarks will be something like * "rxvt" "keysym" "0xFF01" * value will be a string */ /* ARGSUSED */ /* INTPROTO */ Bool rxvt_define_key(XrmDatabase *database __attribute__((unused)), XrmBindingList bindings __attribute__((unused)), XrmQuarkList quarks, XrmRepresentation *type __attribute__((unused)), XrmValue *value, XPointer closure __attribute__((unused))) { int last; rxvt_t *r = rxvt_get_r(); for (last = 0; quarks[last] != NULLQUARK; last++) /* look for last quark in list */ ; last--; rxvt_parse_keysym(r, XrmQuarkToString(quarks[last]), (char *)value->addr); return False; } /* * look for something like this (XK_Delete) * rxvt*keysym.0xFFFF: "\177" * * arg will be * NULL for ~/.Xdefaults and * non-NULL for command-line options (need to allocate) */ #define NEWARGLIM 500 /* `reasonable' size */ /* INTPROTO */ int rxvt_parse_keysym(rxvt_t *r, const char *str, const char *arg) { int n, sym; char *key_string, *newarg = NULL; char newargstr[NEWARGLIM]; if (arg == NULL) { if ((n = rxvt_Str_match(str, "keysym.")) == 0) return 0; str += n; /* skip `keysym.' */ } /* some scanf() have trouble with a 0x prefix */ if (isdigit(str[0])) { if (str[0] == '0' && toupper(str[1]) == 'X') str += 2; if (arg) { if (sscanf(str, (STRCHR(str, ':') ? "%x:" : "%x"), &sym) != 1) return -1; } else { if (sscanf(str, "%x:", &sym) != 1) return -1; /* cue to ':', it's there since sscanf() worked */ STRNCPY(newargstr, STRCHR(str, ':') + 1, NEWARGLIM - 1); newargstr[NEWARGLIM - 1] = '\0'; newarg = newargstr; } } else { /* * convert keysym name to keysym number */ STRNCPY(newargstr, str, NEWARGLIM - 1); newargstr[NEWARGLIM - 1] = '\0'; if (arg == NULL) { if ((newarg = STRCHR(newargstr, ':')) == NULL) return -1; *newarg++ = '\0'; /* terminate keysym name */ } if ((sym = XStringToKeysym(newargstr)) == None) return -1; } if (sym < 0xFF00 || sym > 0xFFFF) /* we only do extended keys */ return -1; sym &= 0xFF; if (r->h->Keysym_map[sym] != NULL) /* already set ? */ return -1; if (newarg == NULL) { STRNCPY(newargstr, arg, NEWARGLIM - 1); newargstr[NEWARGLIM - 1] = '\0'; newarg = newargstr; } rxvt_Str_trim(newarg); if (*newarg == '\0' || (n = rxvt_Str_escaped(newarg)) == 0) return -1; MIN_IT(n, 255); key_string = rxvt_malloc((n + 1) * sizeof(char)); key_string[0] = n; STRNCPY(key_string + 1, newarg, n); r->h->Keysym_map[sym] = (unsigned char *)key_string; return 1; } # endif /* KEYSYM_RESOURCE */ # ifndef USE_XGETDEFAULT /*{{{ rxvt_get_xdefaults() */ /* * the matching algorithm used for memory-save fake resources */ /* INTPROTO */ void rxvt_get_xdefaults(rxvt_t *r, FILE *stream, const char *name) { unsigned int len; char *str, buffer[256]; if (stream == NULL) return; len = STRLEN(name); while ((str = fgets(buffer, sizeof(buffer), stream)) != NULL) { unsigned int entry, n; while (*str && isspace(*str)) str++; /* leading whitespace */ if ((str[len] != '*' && str[len] != '.') || (len && STRNCMP(str, name, len))) continue; str += (len + 1); /* skip `name*' or `name.' */ # ifdef KEYSYM_RESOURCE if (!rxvt_parse_keysym(r, str, NULL)) # endif /* KEYSYM_RESOURCE */ for (entry = 0; entry < optList_size(); entry++) { const char *kw = optList[entry].kw; if (kw == NULL) continue; n = STRLEN(kw); if (str[n] == ':' && rxvt_Str_match(str, kw)) { /* skip `keyword:' */ str += (n + 1); rxvt_Str_trim(str); n = STRLEN(str); if (n && r->h->rs[optList[entry].doff] == NULL) { /* not already set */ int s; char *p = rxvt_malloc((n + 1) * sizeof(char)); STRCPY(p, str); r->h->rs[optList[entry].doff] = p; if (optList_isBool(entry)) { s = STRCASECMP(str, "TRUE") == 0 || STRCASECMP(str, "YES") == 0 || STRCASECMP(str, "ON") == 0 || STRCASECMP(str, "1") == 0; if (optList_isReverse(entry)) s = !s; if (s) r->Options |= (optList[entry].flag); else r->Options &= ~(optList[entry].flag); } } break; } } } rewind(stream); } /*}}} */ # endif /* ! USE_XGETDEFAULT */ #endif /* NO_RESOURCES */ /*{{{ read the resources files */ /* * using XGetDefault() or the hand-rolled replacement */ /* ARGSUSED */ /* EXTPROTO */ void rxvt_extract_resources(rxvt_t *r, Display *display __attribute__((unused)), const char *name) { #ifndef NO_RESOURCES # if defined XAPPLOADDIR # if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) /* Compute the path of the possibly available localized Rxvt file */ char *localepath = NULL; if (r->h->locale != NULL) { /* XXX: must limit length of string */ localepath = rxvt_malloc(256); sprintf(localepath, XAPPLOADDIRLOCALE "/" APL_SUBCLASS, (int)(258 - sizeof(XAPPLOADDIRLOCALE) - sizeof(APL_SUBCLASS)), r->h->locale); /* 258 = 255 + 4 (-.*s) - 1 (/) */ } { # endif # endif # ifdef USE_XGETDEFAULT /* * get resources using the X library function */ int entry; # ifdef XrmEnumOneLevel int i; char *displayResource, *xe; XrmName name_prefix[3]; XrmClass class_prefix[3]; XrmDatabase database, rdb1; char fname[1024]; XrmInitialize(); database = NULL; /* Get any Xserver defaults */ displayResource = XResourceManagerString(display); if (displayResource != NULL) database = XrmGetStringDatabase(displayResource); # ifdef HAVE_EXTRA_XRESOURCE_FILES /* Add in ~/.Xdefaults or ~/.Xresources */ { char *ptr; if ((ptr = (char *)getenv("HOME")) == NULL) ptr = "."; for (i = 0; i < (sizeof(xnames) / sizeof(xnames[0])); i++) { sprintf(fname, "%-.*s/%s", sizeof(fname) - STRLEN(xnames[i]) - 2, ptr, xnames[i]); if ((rdb1 = XrmGetFileDatabase(fname)) != NULL) { XrmMergeDatabases(rdb1, &database); # ifndef HAVE_BOTH_XRESOURCE_FILES break; # endif } } } # endif /* Add in XENVIRONMENT file */ if ((xe = (char *)getenv("XENVIRONMENT")) != NULL && (rdb1 = XrmGetFileDatabase(xe)) != NULL) XrmMergeDatabases(rdb1, &database); /* Add in Rxvt file */ # if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) if (localepath == NULL || (rdb1 = XrmGetFileDatabase(localepath)) == NULL) # endif rdb1 = XrmGetFileDatabase(XAPPLOADDIR "/" APL_SUBCLASS); if (rdb1 != NULL) XrmMergeDatabases(rdb1, &database); /* Add in $XAPPLRESDIR/Rxvt only; not bothering with XUSERFILESEARCHPATH */ if ((xe = (char *)getenv("XAPPLRESDIR")) != NULL) { sprintf(fname, "%-.*s/" APL_SUBCLASS, sizeof(fname) - sizeof(APL_SUBCLASS) - 2, xe); if ((rdb1 = XrmGetFileDatabase(fname)) != NULL) XrmMergeDatabases(rdb1, &database); } XrmSetDatabase(display, database); # endif /* * Query resources for options that affect us */ for (entry = 0; entry < optList_size(); entry++) { int s; char *p, *p0; const char *kw = optList[entry].kw; if (kw == NULL || r->h->rs[optList[entry].doff] != NULL) continue; /* previously set */ p = XGetDefault(display, name, kw); p0 = XGetDefault(display, "!INVALIDPROGRAMMENAMEDONTMATCH!", kw); if (p == NULL || (p0 && STRCMP(p, p0) == 0)) { p = XGetDefault(display, APL_SUBCLASS, kw); if (p == NULL || (p0 && STRCMP(p, p0) == 0)) p = XGetDefault(display, APL_CLASS, kw); } if (p == NULL && p0) p = p0; if (p) { r->h->rs[optList[entry].doff] = p; if (optList_isBool(entry)) { s = STRCASECMP(p, "TRUE") == 0 || STRCASECMP(p, "YES") == 0 || STRCASECMP(p, "ON") == 0 || STRCASECMP(p, "1") == 0; if (optList_isReverse(entry)) s = !s; if (s) r->Options |= (optList[entry].flag); else r->Options &= ~(optList[entry].flag); } } } /* * [R5 or later]: enumerate the resource database */ # ifdef XrmEnumOneLevel # ifdef KEYSYM_RESOURCE name_prefix[0] = XrmStringToName(name); name_prefix[1] = XrmStringToName("keysym"); name_prefix[2] = NULLQUARK; class_prefix[0] = XrmStringToName(APL_SUBCLASS); class_prefix[1] = XrmStringToName("Keysym"); class_prefix[2] = NULLQUARK; /* XXX: Need to check sizeof(rxvt_t) == sizeof(XPointer) */ XrmEnumerateDatabase(XrmGetDatabase(display), name_prefix, class_prefix, XrmEnumOneLevel, rxvt_define_key, NULL); name_prefix[0] = XrmStringToName(APL_CLASS); name_prefix[1] = XrmStringToName("keysym"); class_prefix[0] = XrmStringToName(APL_CLASS); class_prefix[1] = XrmStringToName("Keysym"); /* XXX: Need to check sizeof(rxvt_t) == sizeof(XPointer) */ XrmEnumerateDatabase(XrmGetDatabase(display), name_prefix, class_prefix, XrmEnumOneLevel, rxvt_define_key, NULL); # endif # endif # else /* USE_XGETDEFAULT */ /* get resources the hard way, but save lots of memory */ FILE *fd = NULL; char *home; if ((home = getenv("HOME")) != NULL) { unsigned int i, len = STRLEN(home) + 2; char *f = NULL; for (i = 0; i < (sizeof(xnames) / sizeof(xnames[0])); i++) { f = rxvt_realloc(f, (len + STRLEN(xnames[i])) * sizeof(char)); sprintf(f, "%s/%s", home, xnames[i]); if ((fd = fopen(f, "r")) != NULL) break; } free(f); } /* * The normal order to match resources is the following: * @ global resources (partial match, ~/.Xdefaults) * @ application file resources (XAPPLOADDIR/Rxvt) * @ class resources (~/.Xdefaults) * @ private resources (~/.Xdefaults) * * However, for the hand-rolled resources, the matching algorithm * checks if a resource string value has already been allocated * and won't overwrite it with (in this case) a less specific * resource value. * * This avoids multiple allocation. Also, when we've called this * routine command-line string options have already been applied so we * needn't to allocate for those resources. * * So, search in resources from most to least specific. * * Also, use a special sub-class so that we can use either or both of * "XTerm" and "Rxvt" as class names. */ rxvt_get_xdefaults(r, fd, name); rxvt_get_xdefaults(r, fd, APL_SUBCLASS); # if defined(XAPPLOADDIR) && defined(USE_XAPPLOADDIR) { FILE *ad = NULL; # if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) if (localepath == NULL || (ad = fopen(localepath, "r")) == NULL) # endif ad = fopen(XAPPLOADDIR "/" APL_SUBCLASS, "r"); if (ad != NULL) { rxvt_get_xdefaults(r, ad, APL_SUBCLASS); rxvt_get_xdefaults(r, ad, ""); fclose(ad); } } # endif /* XAPPLOADDIR */ rxvt_get_xdefaults(r, fd, APL_CLASS); rxvt_get_xdefaults(r, fd, ""); /* partial match */ if (fd != NULL) fclose(fd); # endif /* USE_XGETDEFAULT */ # if defined XAPPLOADDIR # if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) } /* Free the path of the possibly available localized Rxvt file */ free(localepath); # endif # endif #endif /* NO_RESOURCES */ /* * even without resources, at least do this setup for command-line * options and command-line long options */ #ifdef MULTICHAR_SET rxvt_set_multichar_encoding(r, r->h->rs[Rs_multichar_encoding]); #endif #ifdef GREEK_SUPPORT /* this could be a function in grkelot.c */ /* void set_greek_keyboard (const char * str); */ if (r->h->rs[Rs_greek_keyboard]) { if (!STRCMP(r->h->rs[Rs_greek_keyboard], "iso")) greek_setmode(GREEK_ELOT928); /* former -grk9 */ else if (!STRCMP(r->h->rs[Rs_greek_keyboard], "ibm")) greek_setmode(GREEK_IBM437); /* former -grk4 */ } { KeySym sym; if (r->h->rs[Rs_greektoggle_key] && ((sym = XStringToKeysym(r->h->rs[Rs_greektoggle_key])) != 0)) r->h->ks_greekmodeswith = sym; } #endif /* GREEK_SUPPORT */ #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) { KeySym sym; if (r->h->rs[Rs_bigfont_key] && ((sym = XStringToKeysym(r->h->rs[Rs_bigfont_key])) != 0)) r->h->ks_bigfont = sym; if (r->h->rs[Rs_smallfont_key] && ((sym = XStringToKeysym(r->h->rs[Rs_smallfont_key])) != 0)) r->h->ks_smallfont = sym; } #endif } /*}}} */ /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/strings.c010064400001440000024000000156230733020615500136730ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: strings.c *----------------------------------------------------------------------* * $Id: strings.c,v 1.14 2001/07/27 06:38:37 gcw Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1997-2001 Geoff Wing * * 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 of the License, 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. *----------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "strings.intpro" /* PROTOS for internal routines */ #ifndef NO_STDLIB /*----------------------------------------------------------------------*/ /* * a replacement for strcasecmp() to avoid linking an entire library. * Mark Olesen added this in 2.15 but for which OS & library? - Geoff Wing */ /* EXTPROTO */ int strcasecmp(const char *s1, const char *s2) { for ( ; tolower(*s1) == tolower(*s2); s1++, s2++) if (!*s1) return 0; return (int)(tolower(*s1) - tolower(*s2)); } /* EXTPROTO */ int strncasecmp(const char *s1, const char *s2, size_t n) { for ( ; n-- && (tolower(*s1) == tolower(*s2)); s1++, s2++) if (!*s1) return 0; if (n == 0) return 0; return (int)(tolower(*s1) - tolower(*s2)); } /* EXTPROTO */ char * strcpy(char *d, const char *s) { char *r = d; for ( ; (*r++ = *s++) != '\0'; ) ; return d; } /* EXTPROTO */ char * strncpy(char *d, const char *s, size_t len) { char *r = d; if (len) for ( ; len; len--) if ((*r++ = *s++) == '\0') { for ( ; --len; ) *r++ = '\0'; break; } return d; } /* EXTPROTO */ int strcmp(const char *s1, const char *s2) { for ( ; (*s1 == *s2++); ) if (*s1++ == '\0') return 0; return (int) ((unsigned char) *s1 - (unsigned char) *--s2); } /* EXTPROTO */ int strncmp(const char *s1, const char *s2, size_t len) { if (len) { for ( ; len-- && (*s1++ == *s2++); ) ; if (++len) return (int) ((unsigned char) *--s1 - (unsigned char) *--s2); } return 0; } /* EXTPROTO */ char * strcat(char *s1, const char *s2) { char *r = s1; if (*r != '\0') for ( ; *++r != '\0'; ) ; for ( ; (*r++ = *s2++) != '\0'; ) ; return s1; } /* EXTPROTO */ char * strncat(char *s1, const char *s2, size_t len) { char *r = s1; if (*r != '\0') for ( ; *++r != '\0'; ) ; for ( ; len-- && ((*r++ = *s2++) != '\0'); ) ; *r = '\0'; return s1; } /* EXTPROTO */ size_t strlen(const char *s) { size_t len = 0; for ( ; *s++ != '\0'; len++) ; return len; } /* EXTPROTO */ char * strdup(const char *s) { size_t len = STRLEN(s) + 1; char *c; if ((c = malloc(len)) != NULL) MEMCPY(c, s, len); return c; } /* EXTPROTO */ char * index(const char *s, int c) { return STRCHR(s, c); } /* EXTPROTO */ char * strchr(const char *s, int c) { char *p = NULL; for (;;) { if (*s == (char)c) { p = (char *)s; break; } if (*s++ == '\0') break; } return p; } /* EXTPROTO */ char * rindex(const char *s, int c) { return STRRCHR(s, c); } /* EXTPROTO */ char * strrchr(const char *s, int c) { char *p = NULL; for (;;) { if (*s == (char)c) p = (char *)s; if (*s++ == '\0') break; } return p; } /* EXTPROTO */ void * memcpy(void *s1, const void *s2, size_t len) { /* has extra stack and time but less code space */ return MEMMOVE(s1, s2, len); } /*--------------------------------------------------------------------------* * Possibly faster memmove() by Geoff Wing *--------------------------------------------------------------------------*/ /* EXTPROTO */ void * memmove(void *d, const void *s, size_t len) { u_intp_t i; unsigned char *dst = (unsigned char *)d; const unsigned char *src = (const unsigned char *)s; if (len && d != s) { if ((u_intp_t)d < (u_intp_t)s) { /* forwards */ i = (-(u_intp_t)dst) & (SIZEOF_INT_P - 1); if (len >= 16 && i == ((-(u_intp_t)src) & (SIZEOF_INT_P - 1))) { /* speed up since src & dst are offset correctly */ len -= (size_t)i; for ( ; i--; ) *dst++ = *src++; for (i = (u_intp_t)(len / SIZEOF_INT_P); i--; ) *((u_intp_t *)dst)++ = *((const u_intp_t *)src)++; len &= (SIZEOF_INT_P - 1); } for ( ; len--; ) *dst++ = *src++; } else { /* backwards */ dst += len; src += len; i = ((u_intp_t)dst) & (SIZEOF_INT_P - 1); if (len >= 16 && i == (((u_intp_t)src) & (SIZEOF_INT_P - 1))) { /* speed up since src & dst are offset correctly */ len -= (size_t)i; for ( ; i--; ) *--dst = *--src; for (i = (u_intp_t)(len / SIZEOF_INT_P); i--; ) *--((u_intp_t *)dst) = *--((const u_intp_t *)src); len &= (SIZEOF_INT_P - 1); } for ( ; len--; ) *--dst = *--src; } } return d; } /*--------------------------------------------------------------------------* * Possibly faster memset() by Geoff Wing * presumptions: * 1) intp_t write the best * 2) SIZEOF_INT_P == power of 2 *--------------------------------------------------------------------------*/ /* EXTPROTO */ void bzero(void *b, size_t len) { MEMSET(b, 0, len); } /* EXTPROTO */ void * memset(void *p, int c1, size_t len) { u_intp_t i, val; unsigned char c = (unsigned char) c1; unsigned char *lp = (unsigned char *) p; if (len) { if (len >= 16) { /* < 16 probably not worth all the calculations */ /* write out preceding characters so we align on an integer boundary */ if ((i = ((-(u_intp_t)p) & (SIZEOF_INT_P - 1)))) { len -= (size_t)i; for (; i--;) *lp++ = c; } /* do the fast writing */ val = (c << 8) + c; #if SIZEOF_INT_P >= 4 val |= (val << 16); #endif #if SIZEOF_INT_P >= 8 val |= (val << 32); #endif #if SIZEOF_INT_P == 16 val |= (val << 64); #endif for (i = (u_intp_t)(len / SIZEOF_INT_P); i--;) *((u_intp_t *)lp)++ = val; len &= (SIZEOF_INT_P - 1); } /* write trailing characters */ for (; len--;) *lp++ = c; } return p; } #endif /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/scrollbar-xterm.c010064400001440000024000000063520745443524300153320ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: scrollbar-xterm.c *----------------------------------------------------------------------* * $Id: scrollbar-xterm.c,v 1.11 2002/04/09 00:49:23 gcw Exp $ * * Copyright (c) 1997,1998 mj olesen * Copyright (c) 1999-2001 Geoff Wing * * 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 of the License, 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. *----------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "scrollbar-xterm.intpro" /* PROTOS for internal routines */ /*----------------------------------------------------------------------*/ #define x_stp_width 8 #define x_stp_height 2 const unsigned char x_stp_bits[] = { 0x55, 0xaa }; /* EXTPROTO */ int rxvt_scrollbar_show_xterm(rxvt_t *r, int update __attribute__((unused)), int last_top, int last_bot, int scrollbar_len) { int xsb = 0; int sbwidth = r->scrollBar.width - 1; if ((r->scrollBar.init & R_SB_XTERM) == 0) { XGCValues gcvalue; r->scrollBar.init |= R_SB_XTERM; gcvalue.stipple = XCreateBitmapFromData(r->Xdisplay, r->scrollBar.win, (char *)x_stp_bits, x_stp_width, x_stp_height); if (!gcvalue.stipple) { rxvt_print_error("can't create bitmap"); exit(EXIT_FAILURE); } gcvalue.fill_style = FillOpaqueStippled; gcvalue.foreground = r->PixColors[Color_fg]; gcvalue.background = r->PixColors[Color_bg]; r->h->xscrollbarGC = XCreateGC(r->Xdisplay, r->scrollBar.win, GCForeground | GCBackground | GCFillStyle | GCStipple, &gcvalue); gcvalue.foreground = r->PixColors[Color_border]; r->h->ShadowGC = XCreateGC(r->Xdisplay, r->scrollBar.win, GCForeground, &gcvalue); } /* instead of XClearWindow (r->Xdisplay, r->scrollBar.win); */ xsb = (r->Options & Opt_scrollBar_right) ? 1 : 0; if (last_top < r->scrollBar.top) XClearArea(r->Xdisplay, r->scrollBar.win, r->sb_shadow + xsb, last_top, sbwidth, (r->scrollBar.top - last_top), False); if (r->scrollBar.bot < last_bot) XClearArea(r->Xdisplay, r->scrollBar.win, r->sb_shadow + xsb, r->scrollBar.bot, sbwidth, (last_bot - r->scrollBar.bot), False); /* scrollbar slider */ XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->xscrollbarGC, xsb + 1, r->scrollBar.top, sbwidth - 2, scrollbar_len); XDrawLine(r->Xdisplay, r->scrollBar.win, r->h->ShadowGC, xsb ? 0 : sbwidth, r->scrollBar.beg, xsb ? 0 : sbwidth, r->scrollBar.end); return 1; } /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/scrollbar-next.c010064400001440000024000000225070733020615500151400ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: scrollbar-next.c *----------------------------------------------------------------------* * $Id: scrollbar-next.c,v 1.15 2001/07/27 06:38:37 gcw Exp $ * * Copyright (c) 1997,1998 mj olesen * Copyright (c) 1998 Alfredo K. Kojima * - N*XTstep like scrollbars * Copyright (c) 1999-2001 Geoff Wing * * 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 of the License, 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. *----------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "scrollbar-next.intpro" /* PROTOS for internal routines */ /*----------------------------------------------------------------------*/ #define n_stp_width 8 #define n_stp_height 2 const unsigned char n_stp_bits[] = { 0x55, 0xaa }; /* * N*XTSTEP like scrollbar - written by Alfredo K. Kojima */ #define SCROLLER_DIMPLE_WIDTH 6 #define SCROLLER_DIMPLE_HEIGHT 6 #define ARROW_WIDTH 13 #define ARROW_HEIGHT 13 const char *const SCROLLER_DIMPLE[] = { ".%###.", "%#%%%%", "#%%...", "#%.. ", "#%. ", ".%. ." }; const char *const SCROLLER_ARROW_UP[] = { ".............", ".............", "......%......", "......#......", ".....%#%.....", ".....###.....", "....%###%....", "....#####....", "...%#####%...", "...#######...", "..%#######%..", ".............", "............." }; const char *const SCROLLER_ARROW_DOWN[] = { ".............", ".............", "..%#######%..", "...#######...", "...%#####%...", "....#####....", "....%###%....", ".....###.....", ".....%#%.....", "......#......", "......%......", ".............", "............." }; const char *const HI_SCROLLER_ARROW_UP[] = { " ", " ", " % ", " % ", " %%% ", " %%% ", " %%%%% ", " %%%%% ", " %%%%%%% ", " %%%%%%% ", " %%%%%%%%% ", " ", " " }; const char *const HI_SCROLLER_ARROW_DOWN[] = { " ", " ", " %%%%%%%%% ", " %%%%%%% ", " %%%%%%% ", " %%%%% ", " %%%%% ", " %%% ", " %%% ", " % ", " % ", " ", " " }; /* INTPROTO */ Pixmap rxvt_renderPixmap(rxvt_t *r, const char *const *data, int width, int height) { char a; int x, y; Pixmap d; GC pointcolour; d = XCreatePixmap(r->Xdisplay, r->scrollBar.win, width, height, XDEPTH); for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { if ((a = data[y][x]) == ' ' || a == 'w') pointcolour = r->h->whiteGC; else if (a == '.' || a == 'l') pointcolour = r->h->grayGC; else if (a == '%' || a == 'd') pointcolour = r->h->darkGC; else /* if (a == '#' || a == 'b' || a) */ pointcolour = r->h->blackGC; XDrawPoint(r->Xdisplay, d, pointcolour, x, y); } } return d; } /* INTPROTO */ void rxvt_init_scrollbar_stuff(rxvt_t *r) { XGCValues gcvalue; XColor xcol; Pixmap stipple; unsigned long light, dark; gcvalue.graphics_exposures = False; gcvalue.foreground = r->PixColors[Color_Black]; r->h->blackGC = XCreateGC(r->Xdisplay, r->scrollBar.win, GCForeground | GCGraphicsExposures, &gcvalue); gcvalue.foreground = r->PixColors[Color_White]; r->h->whiteGC = XCreateGC(r->Xdisplay, r->scrollBar.win, GCForeground | GCGraphicsExposures, &gcvalue); xcol.red = 0xaeba; xcol.green = 0xaaaa; xcol.blue = 0xaeba; if (!rxvt_rXAllocColor(r, &xcol, "light gray")) xcol.pixel = r->PixColors[Color_AntiqueWhite]; light = gcvalue.foreground = xcol.pixel; r->h->grayGC = XCreateGC(r->Xdisplay, r->scrollBar.win, GCForeground | GCGraphicsExposures, &gcvalue); xcol.red = 0x51aa; xcol.green = 0x5555; xcol.blue = 0x5144; if (!rxvt_rXAllocColor(r, &xcol, "dark gray")) xcol.pixel = r->PixColors[Color_Grey25]; dark = gcvalue.foreground = xcol.pixel; r->h->darkGC = XCreateGC(r->Xdisplay, r->scrollBar.win, GCForeground | GCGraphicsExposures, &gcvalue); stipple = XCreateBitmapFromData(r->Xdisplay, r->scrollBar.win, (char *)n_stp_bits, n_stp_width, n_stp_height); gcvalue.foreground = dark; gcvalue.background = light; gcvalue.fill_style = FillOpaqueStippled; gcvalue.stipple = stipple; /* XSetWindowBackground(r->Xdisplay, r->scrollBar.win, r->PixColors[Color_Red]); */ r->h->stippleGC = XCreateGC(r->Xdisplay, r->scrollBar.win, GCForeground | GCBackground | GCStipple | GCFillStyle | GCGraphicsExposures, &gcvalue); r->h->dimple = rxvt_renderPixmap(r, SCROLLER_DIMPLE, SCROLLER_DIMPLE_WIDTH, SCROLLER_DIMPLE_HEIGHT); r->h->upArrow = rxvt_renderPixmap(r, SCROLLER_ARROW_UP, ARROW_WIDTH, ARROW_HEIGHT); r->h->downArrow = rxvt_renderPixmap(r, SCROLLER_ARROW_DOWN, ARROW_WIDTH, ARROW_HEIGHT); r->h->upArrowHi = rxvt_renderPixmap(r, HI_SCROLLER_ARROW_UP, ARROW_WIDTH, ARROW_HEIGHT); r->h->downArrowHi = rxvt_renderPixmap(r, HI_SCROLLER_ARROW_DOWN, ARROW_WIDTH, ARROW_HEIGHT); } /* Draw bevel & arrows */ /* INTPROTO */ void rxvt_drawBevel(rxvt_t *r, Drawable d, int x1, int y1, int w, int h) { int x2, y2; x2 = x1 + w - 1; /* right point */ y2 = y1 + h - 1; /* bottom point */ /* white top and left */ XDrawLine(r->Xdisplay, d, r->h->whiteGC, x1, y1, x2, y1); XDrawLine(r->Xdisplay, d, r->h->whiteGC, x1, y1, x1, y2); /* black bottom and right */ XDrawLine(r->Xdisplay, d, r->h->blackGC, x1, y2, x2, y2); XDrawLine(r->Xdisplay, d, r->h->blackGC, x2, y1, x2, y2); /* dark inside bottom and right */ x1++, y1++, x2--, y2--; /* move in one point */ XDrawLine(r->Xdisplay, d, r->h->darkGC, x1, y2, x2, y2); XDrawLine(r->Xdisplay, d, r->h->darkGC, x2, y1, x2, y2); } /* EXTPROTO */ int rxvt_scrollbar_show_next(rxvt_t *r, int update, int last_top, int last_bot, int scrollbar_len) { int height = r->scrollBar.end + SB_BUTTON_TOTAL_HEIGHT + SB_PADDING; Drawable s; if ((r->scrollBar.init & R_SB_NEXT) == 0) { r->scrollBar.init |= R_SB_NEXT; rxvt_init_scrollbar_stuff(r); } if (r->TermWin.nscrolled == 0 || !update) { XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->grayGC, 0, 0, SB_WIDTH_NEXT + 1, height); XDrawRectangle(r->Xdisplay, r->scrollBar.win, r->h->blackGC, 0, -SB_BORDER_WIDTH, SB_WIDTH_NEXT, height + SB_BORDER_WIDTH); XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->stippleGC, SB_LEFT_PADDING, 0, SB_BUTTON_WIDTH, height); } if (r->TermWin.nscrolled) { if (last_top < r->scrollBar.top || !update) XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->stippleGC, SB_LEFT_PADDING, SB_PADDING + last_top, SB_BUTTON_WIDTH, r->scrollBar.top - last_top); if (r->scrollBar.bot < last_bot || !update) XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->stippleGC, SB_LEFT_PADDING, r->scrollBar.bot + SB_PADDING, SB_BUTTON_WIDTH, (last_bot - r->scrollBar.bot)); XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->grayGC, SB_LEFT_PADDING, r->scrollBar.top + SB_PADDING, SB_BUTTON_WIDTH, scrollbar_len); XCopyArea(r->Xdisplay, r->h->dimple, r->scrollBar.win, r->h->whiteGC, 0, 0, SCROLLER_DIMPLE_WIDTH, SCROLLER_DIMPLE_HEIGHT, (SB_WIDTH_NEXT - SCROLLER_DIMPLE_WIDTH) / 2, r->scrollBar.top + SB_BEVEL_WIDTH_UPPER_LEFT + (scrollbar_len - SCROLLER_DIMPLE_HEIGHT) / 2); rxvt_drawBevel(r, r->scrollBar.win, SB_BUTTON_BEVEL_X, r->scrollBar.top + SB_PADDING, SB_BUTTON_WIDTH, scrollbar_len); rxvt_drawBevel(r, r->scrollBar.win, SB_BUTTON_BEVEL_X, height - SB_BUTTON_BOTH_HEIGHT, SB_BUTTON_WIDTH, SB_BUTTON_HEIGHT); rxvt_drawBevel(r, r->scrollBar.win, SB_BUTTON_BEVEL_X, height - SB_BUTTON_SINGLE_HEIGHT, SB_BUTTON_WIDTH, SB_BUTTON_HEIGHT); s = (scrollbar_isUp()) ? r->h->upArrowHi : r->h->upArrow; XCopyArea(r->Xdisplay, s, r->scrollBar.win, r->h->whiteGC, 0, 0, ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X, height - SB_BUTTON_BOTH_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT); s = (scrollbar_isDn()) ? r->h->downArrowHi : r->h->downArrow; XCopyArea(r->Xdisplay, s, r->scrollBar.win, r->h->whiteGC, 0, 0, ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X, height - SB_BUTTON_SINGLE_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT); } return 1; } /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/scrollbar-rxvt.c010064400001440000024000000124750745443524300152010ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: scrollbar-rxvt.c *----------------------------------------------------------------------* * $Id: scrollbar-rxvt.c,v 1.10 2002/04/09 00:49:23 gcw Exp $ * * Copyright (c) 1997,1998 mj olesen * Copyright (c) 1999-2001 Geoff Wing * * 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 of the License, 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. *----------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "scrollbar-rxvt.intpro" /* PROTOS for internal routines */ /*----------------------------------------------------------------------*/ /* draw triangular button with a shadow of SHADOW (1 or 2) pixels */ /* INTPROTO */ void rxvt_Draw_button(rxvt_t *r, int x, int y, int state, int dirn) { unsigned int sz, sz2; XPoint pt[3]; GC top, bot; sz = r->scrollBar.width; sz2 = sz / 2; switch (state) { case +1: top = r->h->topShadowGC; bot = r->h->botShadowGC; break; case -1: top = r->h->botShadowGC; bot = r->h->topShadowGC; break; default: top = bot = r->h->scrollbarGC; break; } /* fill triangle */ pt[0].x = x; pt[1].x = x + sz - 1; pt[2].x = x + sz2; if (dirn == UP) { pt[0].y = pt[1].y = y + sz - 1; pt[2].y = y; } else { pt[0].y = pt[1].y = y; pt[2].y = y + sz - 1; } XFillPolygon(r->Xdisplay, r->scrollBar.win, r->h->scrollbarGC, pt, 3, Convex, CoordModeOrigin); /* draw base */ XDrawLine(r->Xdisplay, r->scrollBar.win, (dirn == UP ? bot : top), pt[0].x, pt[0].y, pt[1].x, pt[1].y); /* draw shadow on left */ pt[1].x = x + sz2 - 1; pt[1].y = y + (dirn == UP ? 0 : sz - 1); XDrawLine(r->Xdisplay, r->scrollBar.win, top, pt[0].x, pt[0].y, pt[1].x, pt[1].y); #if (SHADOW > 1) /* doubled */ pt[0].x++; if (dirn == UP) { pt[0].y--; pt[1].y++; } else { pt[0].y++; pt[1].y--; } XDrawLine(r->Xdisplay, r->scrollBar.win, top, pt[0].x, pt[0].y, pt[1].x, pt[1].y); #endif /* draw shadow on right */ pt[1].x = x + sz - 1; /* pt[2].x = x + sz2; */ pt[1].y = y + (dirn == UP ? sz - 1 : 0); pt[2].y = y + (dirn == UP ? 0 : sz - 1); XDrawLine(r->Xdisplay, r->scrollBar.win, bot, pt[2].x, pt[2].y, pt[1].x, pt[1].y); #if (SHADOW > 1) /* doubled */ pt[1].x--; if (dirn == UP) { pt[2].y++; pt[1].y--; } else { pt[2].y--; pt[1].y++; } XDrawLine(r->Xdisplay, r->scrollBar.win, bot, pt[2].x, pt[2].y, pt[1].x, pt[1].y); #endif } /* EXTPROTO */ int rxvt_scrollbar_show_rxvt(rxvt_t *r, int update __attribute__((unused)), int last_top, int last_bot, int scrollbar_len) { int sbshadow = r->sb_shadow; int sbwidth = (int)r->scrollBar.width; if ((r->scrollBar.init & R_SB_RXVT) == 0) { XGCValues gcvalue; r->scrollBar.init |= R_SB_RXVT; gcvalue.foreground = r->PixColors[Color_trough]; if (sbshadow) { XSetWindowBackground(r->Xdisplay, r->scrollBar.win, gcvalue.foreground); XClearWindow(r->Xdisplay, r->scrollBar.win); } } else { /* instead of XClearWindow (r->Xdisplay, r->scrollBar.win); */ if (last_top < r->scrollBar.top) XClearArea(r->Xdisplay, r->scrollBar.win, sbshadow, last_top, sbwidth, (r->scrollBar.top - last_top), False); if (r->scrollBar.bot < last_bot) XClearArea(r->Xdisplay, r->scrollBar.win, sbshadow, r->scrollBar.bot, sbwidth, (last_bot - r->scrollBar.bot), False); } /* scrollbar slider */ #ifdef SB_BORDER { int xofs; if (r->Options & Opt_scrollBar_right) xofs = 0; else xofs = sbshadow ? sbwidth : sbwidth - 1; XDrawLine(r->Xdisplay, r->scrollBar.win, r->h->botShadowGC, xofs, 0, xofs, r->scrollBar.end + sbwidth); } #endif XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->scrollbarGC, sbshadow, r->scrollBar.top, sbwidth, scrollbar_len); if (sbshadow) /* trough shadow */ rxvt_Draw_Shadow(r->Xdisplay, r->scrollBar.win, r->h->botShadowGC, r->h->topShadowGC, 0, 0, sbwidth + 2 * sbshadow, /* scrollbar_TotalWidth() */ r->scrollBar.end + (sbwidth + 1) + sbshadow); /* shadow for scrollbar slider */ rxvt_Draw_Shadow(r->Xdisplay, r->scrollBar.win, r->h->topShadowGC, r->h->botShadowGC, sbshadow, r->scrollBar.top, sbwidth, scrollbar_len); /* * Redraw scrollbar arrows */ rxvt_Draw_button(r, sbshadow, sbshadow, (scrollbar_isUp() ? -1 : +1), UP); rxvt_Draw_button(r, sbshadow, (r->scrollBar.end + 1), (scrollbar_isDn() ? -1 : +1), DN); return 1; } /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/scrollbar.c010064400001440000024000000151300745671707200141740ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: scrollbar.c *----------------------------------------------------------------------* * $Id: scrollbar.c,v 1.43 2002/04/09 05:12:29 gcw Exp $ * * Copyright (c) 1997,1998 mj olesen * Copyright (c) 1998 Alfredo K. Kojima * - N*XTstep like scrollbars * Copyright (c) 1999-2001 Geoff Wing * * 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 of the License, 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. *----------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "scrollbar.intpro" /* PROTOS for internal routines */ /*----------------------------------------------------------------------*/ /* * Map or unmap a scrollbar. Returns non-zero upon change of state */ /* EXTPROTO */ int rxvt_scrollbar_mapping(rxvt_t *r, int map) { int change = 0; #ifdef HAVE_SCROLLBARS if (map && !scrollbar_visible(r)) { scrollbar_setIdle(); if (!r->scrollBar.win) rxvt_Resize_scrollBar(r); if (r->scrollBar.win) { XMapWindow(r->Xdisplay, r->scrollBar.win); change = 1; } } else if (!map && scrollbar_visible(r)) { r->scrollBar.state = 0; XUnmapWindow(r->Xdisplay, r->scrollBar.win); change = 1; } #endif return change; } /* EXTPROTO */ void rxvt_Resize_scrollBar(rxvt_t *r) { #ifdef HAVE_SCROLLBARS int delayed_init = 0; #define R_SCROLLBEG_XTERM 0 #define R_SCROLLEND_XTERM r->szHint.height #define R_SCROLLBEG_NEXT 0 #define R_SCROLLEND_NEXT r->szHint.height - (SB_BUTTON_TOTAL_HEIGHT + \ SB_PADDING) #define R_SCROLLBEG_RXVT (r->scrollBar.width + 1) + r->sb_shadow #define R_SCROLLEND_RXVT r->szHint.height - R_SCROLLBEG_RXVT - \ (2 * r->sb_shadow) #if defined(XTERM_SCROLLBAR) if (r->scrollBar.style == R_SB_XTERM) { r->scrollBar.beg = R_SCROLLBEG_XTERM; r->scrollBar.end = R_SCROLLEND_XTERM; r->scrollBar.update = rxvt_scrollbar_show_xterm; } #endif #if defined(NEXT_SCROLLBAR) if (r->scrollBar.style == R_SB_NEXT) { r->scrollBar.beg = R_SCROLLBEG_NEXT; r->scrollBar.end = R_SCROLLEND_NEXT; r->scrollBar.update = rxvt_scrollbar_show_next; } #endif #if defined(RXVT_SCROLLBAR) if (r->scrollBar.style == R_SB_RXVT) { r->scrollBar.beg = R_SCROLLBEG_RXVT; r->scrollBar.end = R_SCROLLEND_RXVT; r->scrollBar.update = rxvt_scrollbar_show_rxvt; } #endif if (!r->scrollBar.win) { /* create the scrollbar window */ r->scrollBar.win = XCreateSimpleWindow(r->Xdisplay, r->TermWin.parent[0], r->h->window_sb_x, 0, scrollbar_TotalWidth(), r->szHint.height, 0, r->PixColors[Color_fg], r->PixColors[Color_bg]); #ifdef DEBUG_X XStoreName(r->Xdisplay, r->scrollBar.win, "scrollbar"); #endif XDefineCursor(r->Xdisplay, r->scrollBar.win, r->h->cursor_leftptr); XSelectInput(r->Xdisplay, r->scrollBar.win, (ExposureMask | ButtonPressMask | ButtonReleaseMask | Button1MotionMask | Button2MotionMask | Button3MotionMask)); delayed_init = 1; } rxvt_scrollbar_show(r, 1); if (delayed_init) XMapWindow(r->Xdisplay, r->scrollBar.win); #endif } /* * Update current scrollbar view w.r.t. slider heights, etc. */ /* EXTPROTO */ int rxvt_scrollbar_show(rxvt_t *r, int update) { int ret = 0; #ifdef HAVE_SCROLLBARS int top, bot, len, adj; if (!scrollbar_visible(r)) return 0; if (update) { top = (r->TermWin.nscrolled - r->TermWin.view_start); bot = top + (r->TermWin.nrow - 1); len = max((r->TermWin.nscrolled + (r->TermWin.nrow - 1)), 1); adj = (((bot - top) * scrollbar_size()) % len) > 0 ? 1 : 0; r->scrollBar.top = (r->scrollBar.beg + (top * scrollbar_size()) / len); r->h->scrollbar_len = ((bot - top) * scrollbar_size()) / len + scrollbar_minheight() + adj; r->scrollBar.bot = (r->scrollBar.top + r->h->scrollbar_len); /* no change */ if (r->scrollBar.top == r->h->last_top && r->scrollBar.bot == r->h->last_bot && (r->scrollBar.state == r->h->last_state || !scrollbar_isUpDn())) return 0; } ret = r->scrollBar.update(r, update, r->h->last_top, r->h->last_bot, r->h->scrollbar_len); r->h->last_top = r->scrollBar.top; r->h->last_bot = r->scrollBar.bot; r->h->last_state = r->scrollBar.state; #endif return ret; } /* EXTPROTO */ void rxvt_setup_scrollbar(rxvt_t *r, const char *scrollalign, const char *scrollstyle, const char *thickness) { #ifdef HAVE_SCROLLBARS int i; short style, width; # if defined(RXVT_SCROLLBAR) || !(defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR)) style = R_SB_RXVT; # else # ifdef NEXT_SCROLLBAR style = R_SB_NEXT; # elif defined(XTERM_SCROLLBAR) style = R_SB_XTERM; # endif # endif # if (defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR)) if (scrollstyle) { # ifdef NEXT_SCROLLBAR if (STRNCASECMP(scrollstyle, "next", 4) == 0) style = R_SB_NEXT; # endif # ifdef XTERM_SCROLLBAR if (STRNCASECMP(scrollstyle, "xterm", 5) == 0) style = R_SB_XTERM; # endif } # endif if (style == R_SB_NEXT) width = SB_WIDTH_NEXT; else if (style == R_SB_XTERM) width = SB_WIDTH_XTERM; else /* if (style == R_SB_RXVT) */ width = SB_WIDTH_RXVT; if (style != R_SB_NEXT) /* dishonour request - for now */ if (thickness && (i = atoi(thickness)) >= SB_WIDTH_MINIMUM) width = min(i, SB_WIDTH_MAXIMUM); # if defined(RXVT_SCROLLBAR) if (!(r->Options & Opt_scrollBar_floating) && style == R_SB_RXVT) r->sb_shadow = SHADOW; # endif r->scrollBar.style = style; r->scrollBar.width = width; /* r->h->scrollbar_align = R_SB_ALIGN_CENTRE; */ if (scrollalign) { if (STRNCASECMP(scrollalign, "top", 3) == 0) r->h->scrollbar_align = R_SB_ALIGN_TOP; else if (STRNCASECMP(scrollalign, "bottom", 6) == 0) r->h->scrollbar_align = R_SB_ALIGN_BOTTOM; } #endif } /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/screen.c010064400001440000024000003301150763736344600134760ustar gcwstaff/*--------------------------------*-C-*--------------------------------------* * File: screen.c *---------------------------------------------------------------------------* * $Id: screen.c,v 1.258 2003/03/23 16:55:50 gcw Exp $ * * Copyright (c) 1997-2001 Geoff Wing * * 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 of the License, 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. *--------------------------------------------------------------------------*/ /* * We handle _all_ screen updates and selections */ #include "../config.h" /* NECESSARY */ #define INTERN_SCREEN #include "rxvt.h" /* NECESSARY */ #include "screen.intpro" /* PROTOS for internal routines */ #include /* get the typedef for CARD32 */ /* ------------------------------------------------------------------------- */ #ifdef MULTICHAR_SET #define RESET_CHSTAT(H) \ if ((H)->chstat == WBYTE) \ (H)->chstat = SBYTE, (H)->lost_multi = 1 const KNOWN_ENCODINGS known_encodings[] = { { SJIS, rxvt_sjis2jis, "sjis" }, { EUCJ, rxvt_euc2jis, "eucj" }, { GB, rxvt_euc2jis, "gb" }, { BIG5, rxvt_decodedummy, "big5" }, { EUCKR, rxvt_euc2jis, "kr" }, { NOENC, rxvt_decodedummy, "noenc" }, { 0, NULL, NULL } }; #else # define RESET_CHSTAT(H) #endif /* ------------------------------------------------------------------------- */ #define PROP_SIZE 16384 #define TABSIZE 8 /* default tab size */ /* ------------------------------------------------------------------------- * * GENERAL SCREEN AND SELECTION UPDATE ROUTINES * * ------------------------------------------------------------------------- */ #define ZERO_SCROLLBACK(R) \ if (((R)->Options & Opt_scrollTtyOutput) == Opt_scrollTtyOutput) \ (R)->TermWin.view_start = 0 #define CLEAR_SELECTION(R) \ (R)->selection.beg.row = (R)->selection.beg.col \ = (R)->selection.end.row = (R)->selection.end.col = 0 #define CLEAR_ALL_SELECTION(R) \ (R)->selection.beg.row = (R)->selection.beg.col \ = (R)->selection.mark.row = (R)->selection.mark.col \ = (R)->selection.end.row = (R)->selection.end.col = 0 #define ROW_AND_COL_IS_AFTER(A, B, C, D) \ (((A) > (C)) || (((A) == (C)) && ((B) > (D)))) #define ROW_AND_COL_IS_BEFORE(A, B, C, D) \ (((A) < (C)) || (((A) == (C)) && ((B) < (D)))) #define ROW_AND_COL_IN_ROW_AFTER(A, B, C, D) \ (((A) == (C)) && ((B) > (D))) #define ROW_AND_COL_IN_ROW_AT_OR_AFTER(A, B, C, D) \ (((A) == (C)) && ((B) >= (D))) #define ROW_AND_COL_IN_ROW_BEFORE(A, B, C, D) \ (((A) == (C)) && ((B) < (D))) #define ROW_AND_COL_IN_ROW_AT_OR_BEFORE(A, B, C, D) \ (((A) == (C)) && ((B) <= (D))) /* these must be row_col_t */ #define ROWCOL_IS_AFTER(X, Y) \ ROW_AND_COL_IS_AFTER((X).row, (X).col, (Y).row, (Y).col) #define ROWCOL_IS_BEFORE(X, Y) \ ROW_AND_COL_IS_BEFORE((X).row, (X).col, (Y).row, (Y).col) #define ROWCOL_IN_ROW_AFTER(X, Y) \ ROW_AND_COL_IN_ROW_AFTER((X).row, (X).col, (Y).row, (Y).col) #define ROWCOL_IN_ROW_BEFORE(X, Y) \ ROW_AND_COL_IN_ROW_BEFORE((X).row, (X).col, (Y).row, (Y).col) #define ROWCOL_IN_ROW_AT_OR_AFTER(X, Y) \ ROW_AND_COL_IN_ROW_AT_OR_AFTER((X).row, (X).col, (Y).row, (Y).col) #define ROWCOL_IN_ROW_AT_OR_BEFORE(X, Y) \ ROW_AND_COL_IN_ROW_AT_OR_BEFORE((X).row, (X).col, (Y).row, (Y).col) /* * CLEAR_ROWS : clear rows starting from row * CLEAR_CHARS: clear chars starting from pixel position * ERASE_ROWS : set rows starting from row to the foreground colour */ #define drawBuffer (r->TermWin.vt) #define CLEAR_ROWS(row, num) \ if (r->TermWin.mapped) \ XClearArea(r->Xdisplay, drawBuffer, r->TermWin.int_bwidth, \ Row2Pixel(row), (unsigned int)r->TermWin.width, \ (unsigned int)Height2Pixel(num), False) #define CLEAR_CHARS(x, y, num) \ if (r->TermWin.mapped) \ XClearArea(r->Xdisplay, drawBuffer, x, y, \ (unsigned int)Width2Pixel(num), \ (unsigned int)Height2Pixel(1), False) #define ERASE_ROWS(row, num) \ XFillRectangle(r->Xdisplay, drawBuffer, r->TermWin.gc, \ r->TermWin.int_bwidth, Row2Pixel(row), \ (unsigned int)r->TermWin.width, \ (unsigned int)Height2Pixel(num)) /* ------------------------------------------------------------------------- * * SCREEN `COMMON' ROUTINES * * ------------------------------------------------------------------------- */ /* Fill part/all of a line with blanks. */ /* INTPROTO */ void rxvt_blank_line(text_t *et, rend_t *er, unsigned int width, rend_t efs) { MEMSET(et, ' ', (size_t)width); efs &= ~RS_baseattrMask; for (; width--;) *er++ = efs; } /* ------------------------------------------------------------------------- */ /* Fill a full line with blanks - make sure it is allocated first */ /* INTPROTO */ void rxvt_blank_screen_mem(rxvt_t *r, text_t **tp, rend_t **rp, unsigned int row, rend_t efs) { int width = r->TermWin.ncol; rend_t *er; #ifdef DEBUG_STRICT assert((tp[row] && rp[row]) || (tp[row] == NULL && rp[row] == NULL)); #endif if (tp[row] == NULL) { tp[row] = rxvt_malloc(sizeof(text_t) * width); rp[row] = rxvt_malloc(sizeof(rend_t) * width); } MEMSET(tp[row], ' ', width); efs &= ~RS_baseattrMask; for (er = rp[row]; width--;) *er++ = efs; } /* ------------------------------------------------------------------------- * * SCREEN INITIALISATION * * ------------------------------------------------------------------------- */ /* EXTPROTO */ void rxvt_scr_reset(rxvt_t *r) { unsigned int ncol, nrow, prev_ncol, prev_nrow, total_rows, prev_total_rows; unsigned int p, q; int k; rend_t setrstyle; D_SCREEN((stderr, "rxvt_scr_reset()")); r->TermWin.view_start = 0; RESET_CHSTAT(r->h); r->h->num_scr = 0; prev_ncol = r->h->prev_ncol; prev_nrow = r->h->prev_nrow; if (r->TermWin.ncol == 0) r->TermWin.ncol = 80; if (r->TermWin.nrow == 0) r->TermWin.nrow = 24; ncol = r->TermWin.ncol; nrow = r->TermWin.nrow; if (ncol == prev_ncol && nrow == prev_nrow) return; r->h->want_refresh = 1; total_rows = nrow + r->TermWin.saveLines; prev_total_rows = prev_nrow + r->TermWin.saveLines; r->screen.tscroll = 0; r->screen.bscroll = nrow - 1; if (prev_nrow == 0) { /* * A: first time called so just malloc everything : don't rely on realloc * Note: this is still needed so that all the scrollback lines are NULL */ r->screen.text = rxvt_calloc(total_rows, sizeof(text_t *)); r->buf_text = rxvt_calloc(total_rows, sizeof(text_t *)); r->drawn_text = rxvt_calloc(nrow, sizeof(text_t *)); r->swap.text = rxvt_calloc(nrow, sizeof(text_t *)); r->screen.tlen = rxvt_calloc(total_rows, sizeof(int16_t)); r->swap.tlen = rxvt_calloc(nrow, sizeof(int16_t)); r->screen.rend = rxvt_calloc(total_rows, sizeof(rend_t *)); r->buf_rend = rxvt_calloc(total_rows, sizeof(rend_t *)); r->drawn_rend = rxvt_calloc(nrow, sizeof(rend_t *)); r->swap.rend = rxvt_calloc(nrow, sizeof(rend_t *)); for (p = 0; p < nrow; p++) { q = p + r->TermWin.saveLines; rxvt_blank_screen_mem(r, r->screen.text, r->screen.rend, q, DEFAULT_RSTYLE); rxvt_blank_screen_mem(r, r->swap.text, r->swap.rend, p, DEFAULT_RSTYLE); r->screen.tlen[q] = r->swap.tlen[p] = 0; rxvt_blank_screen_mem(r, r->drawn_text, r->drawn_rend, p, DEFAULT_RSTYLE); } MEMSET(r->h->charsets, 'B', sizeof(r->h->charsets)); r->TermWin.nscrolled = 0; /* no saved lines */ r->h->rstyle = DEFAULT_RSTYLE; r->screen.flags = Screen_DefaultFlags; r->screen.cur.row = r->screen.cur.col = 0; r->screen.charset = 0; r->h->current_screen = PRIMARY; rxvt_scr_cursor(r, SAVE); #if NSCREENS r->swap.flags = Screen_DefaultFlags; r->swap.cur.row = r->swap.cur.col = 0; r->swap.charset = 0; r->h->current_screen = SECONDARY; rxvt_scr_cursor(r, SAVE); r->h->current_screen = PRIMARY; #endif r->selection.text = NULL; r->selection.len = 0; r->selection.op = SELECTION_CLEAR; r->selection.screen = PRIMARY; r->selection.clicks = 0; CLEAR_ALL_SELECTION(r); r->h->rvideo = 0; #ifdef MULTICHAR_SET r->h->multi_byte = 0; r->h->lost_multi = 0; r->h->chstat = SBYTE; #endif } else { /* * B1: add or delete rows as appropriate */ setrstyle = DEFAULT_RSTYLE; if (nrow < prev_nrow) { /* delete rows */ k = min(r->TermWin.nscrolled, prev_nrow - nrow); rxvt_scroll_text(r, 0, (int)prev_nrow - 1, k, 1); for (p = nrow; p < prev_nrow; p++) { q = p + r->TermWin.saveLines; if (r->screen.text[q]) { #ifdef DEBUG_STRICT assert(r->screen.rend[q]); #endif free(r->screen.text[q]); free(r->screen.rend[q]); } if (r->swap.text[p]) { #ifdef DEBUG_STRICT assert(r->swap.rend[p]); #endif free(r->swap.text[p]); free(r->swap.rend[p]); } #ifdef DEBUG_STRICT assert(r->drawn_text[p] && r->drawn_rend[p]); #endif free(r->drawn_text[p]); free(r->drawn_rend[p]); } /* we have fewer rows so fix up cursor position */ MIN_IT(r->screen.cur.row, (int32_t)nrow - 1); MIN_IT(r->swap.cur.row, (int32_t)nrow - 1); rxvt_scr_reset_realloc(r); /* realloc _last_ */ } else if (nrow > prev_nrow) { /* add rows */ rxvt_scr_reset_realloc(r); /* realloc _first_ */ k = min(r->TermWin.nscrolled, nrow - prev_nrow); for (p = prev_total_rows; p < total_rows; p++) { r->screen.tlen[p] = 0; r->screen.text[p] = NULL; r->screen.rend[p] = NULL; } for (p = prev_total_rows; p < total_rows - k; p++) rxvt_blank_screen_mem(r, r->screen.text, r->screen.rend, p, setrstyle); for (p = prev_nrow; p < nrow; p++) { r->swap.tlen[p] = 0; r->swap.text[p] = NULL; r->swap.rend[p] = NULL; r->drawn_text[p] = NULL; r->drawn_rend[p] = NULL; rxvt_blank_screen_mem(r, r->swap.text, r->swap.rend, p, setrstyle); rxvt_blank_screen_mem(r, r->drawn_text, r->drawn_rend, p, setrstyle); } if (k > 0) { rxvt_scroll_text(r, 0, (int)nrow - 1, -k, 1); r->screen.cur.row += k; r->screen.s_cur.row += k; r->TermWin.nscrolled -= k; } #ifdef DEBUG_STRICT assert(r->screen.cur.row < r->TermWin.nrow); assert(r->swap.cur.row < r->TermWin.nrow); #else /* drive with your eyes closed */ MIN_IT(r->screen.cur.row, nrow - 1); MIN_IT(r->swap.cur.row, nrow - 1); #endif } /* B2: resize columns */ if (ncol != prev_ncol) { for (p = 0; p < total_rows; p++) { if (r->screen.text[p]) { r->screen.text[p] = rxvt_realloc(r->screen.text[p], ncol * sizeof(text_t)); r->screen.rend[p] = rxvt_realloc(r->screen.rend[p], ncol * sizeof(rend_t)); MIN_IT(r->screen.tlen[p], (int16_t)ncol); if (ncol > prev_ncol) rxvt_blank_line(&(r->screen.text[p][prev_ncol]), &(r->screen.rend[p][prev_ncol]), ncol - prev_ncol, setrstyle); } } for (p = 0; p < nrow; p++) { r->drawn_text[p] = rxvt_realloc(r->drawn_text[p], ncol * sizeof(text_t)); r->drawn_rend[p] = rxvt_realloc(r->drawn_rend[p], ncol * sizeof(rend_t)); if (r->swap.text[p]) { r->swap.text[p] = rxvt_realloc(r->swap.text[p], ncol * sizeof(text_t)); r->swap.rend[p] = rxvt_realloc(r->swap.rend[p], ncol * sizeof(rend_t)); MIN_IT(r->swap.tlen[p], (int16_t)ncol); if (ncol > prev_ncol) rxvt_blank_line(&(r->swap.text[p][prev_ncol]), &(r->swap.rend[p][prev_ncol]), ncol - prev_ncol, setrstyle); } if (ncol > prev_ncol) rxvt_blank_line(&(r->drawn_text[p][prev_ncol]), &(r->drawn_rend[p][prev_ncol]), ncol - prev_ncol, setrstyle); } MIN_IT(r->screen.cur.col, (int16_t)ncol - 1); MIN_IT(r->swap.cur.col, (int16_t)ncol - 1); } if (r->tabs) free(r->tabs); } r->tabs = rxvt_malloc(ncol * sizeof(char)); for (p = 0; p < ncol; p++) r->tabs[p] = (p % TABSIZE == 0) ? 1 : 0; r->h->prev_nrow = nrow; r->h->prev_ncol = ncol; rxvt_tt_winsize(r->cmd_fd, r->TermWin.ncol, r->TermWin.nrow); } /* INTPROTO */ void rxvt_scr_reset_realloc(rxvt_t *r) { u_int16_t total_rows, nrow; nrow = r->TermWin.nrow; total_rows = nrow + r->TermWin.saveLines; /* *INDENT-OFF* */ r->screen.text = rxvt_realloc(r->screen.text, total_rows * sizeof(text_t *)); r->buf_text = rxvt_realloc(r->buf_text , total_rows * sizeof(text_t *)); r->drawn_text = rxvt_realloc(r->drawn_text , nrow * sizeof(text_t *)); r->swap.text = rxvt_realloc(r->swap.text , nrow * sizeof(text_t *)); r->screen.tlen = rxvt_realloc(r->screen.tlen, total_rows * sizeof(int16_t)); r->swap.tlen = rxvt_realloc(r->swap.tlen , total_rows * sizeof(int16_t)); r->screen.rend = rxvt_realloc(r->screen.rend, total_rows * sizeof(rend_t *)); r->buf_rend = rxvt_realloc(r->buf_rend , total_rows * sizeof(rend_t *)); r->drawn_rend = rxvt_realloc(r->drawn_rend , nrow * sizeof(rend_t *)); r->swap.rend = rxvt_realloc(r->swap.rend , nrow * sizeof(rend_t *)); /* *INDENT-ON* */ } /* ------------------------------------------------------------------------- */ /* * Free everything. That way malloc debugging can find leakage. */ /* EXTPROTO */ void rxvt_scr_release(rxvt_t *r) { u_int16_t total_rows; int i; total_rows = r->TermWin.nrow + r->TermWin.saveLines; for (i = 0; i < total_rows; i++) { if (r->screen.text[i]) { /* then so is r->screen.rend[i] */ free(r->screen.text[i]); #ifdef DEBUG_STRICT assert(r->screen.rend[i]); #endif free(r->screen.rend[i]); } } for (i = 0; i < r->TermWin.nrow; i++) { free(r->drawn_text[i]); free(r->drawn_rend[i]); free(r->swap.text[i]); free(r->swap.rend[i]); } free(r->screen.text); free(r->screen.tlen); free(r->screen.rend); free(r->drawn_text); free(r->drawn_rend); free(r->swap.text); free(r->swap.tlen); free(r->swap.rend); free(r->buf_text); free(r->buf_rend); free(r->tabs); /* NULL these so if anything tries to use them, we'll know about it */ r->screen.text = r->drawn_text = r->swap.text = NULL; r->screen.rend = r->drawn_rend = r->swap.rend = NULL; r->screen.tlen = r->swap.tlen = NULL; r->buf_text = NULL; r->buf_rend = NULL; r->tabs = NULL; } /* ------------------------------------------------------------------------- */ /* * Hard reset */ /* EXTPROTO */ void rxvt_scr_poweron(rxvt_t *r) { D_SCREEN((stderr, "rxvt_scr_poweron()")); rxvt_scr_release(r); r->h->prev_nrow = r->h->prev_ncol = 0; rxvt_scr_reset(r); rxvt_scr_clear(r); rxvt_scr_refresh(r, SLOW_REFRESH); rxvt_Gr_reset(r); } /* ------------------------------------------------------------------------- * * PROCESS SCREEN COMMANDS * * ------------------------------------------------------------------------- */ /* * Save and Restore cursor * XTERM_SEQ: Save cursor : ESC 7 * XTERM_SEQ: Restore cursor: ESC 8 */ /* EXTPROTO */ void rxvt_scr_cursor(rxvt_t *r, int mode) { screen_t *s; D_SCREEN((stderr, "rxvt_scr_cursor(%c)", mode)); #if NSCREENS && !defined(NO_SECONDARY_SCREEN_CURSOR) if (r->h->current_screen == SECONDARY) s = &(r->swap); else #endif s = &(r->screen); switch (mode) { case SAVE: s->s_cur.row = s->cur.row; s->s_cur.col = s->cur.col; s->s_rstyle = r->h->rstyle; s->s_charset = s->charset; s->s_charset_char = r->h->charsets[s->charset]; break; case RESTORE: r->h->want_refresh = 1; s->cur.row = s->s_cur.row; s->cur.col = s->s_cur.col; s->flags &= ~Screen_WrapNext; r->h->rstyle = s->s_rstyle; s->charset = s->s_charset; r->h->charsets[s->charset] = s->s_charset_char; rxvt_set_font_style(r); break; } /* boundary check in case screen size changed between SAVE and RESTORE */ MIN_IT(s->cur.row, r->TermWin.nrow - 1); MIN_IT(s->cur.col, r->TermWin.ncol - 1); #ifdef DEBUG_STRICT assert(s->cur.row >= 0); assert(s->cur.col >= 0); #else /* drive with your eyes closed */ MAX_IT(s->cur.row, 0); MAX_IT(s->cur.col, 0); #endif } /* ------------------------------------------------------------------------- */ /* * Swap between primary and secondary screens * XTERM_SEQ: Primary screen : ESC [ ? 4 7 h * XTERM_SEQ: Secondary screen: ESC [ ? 4 7 l */ /* EXTPROTO */ int rxvt_scr_change_screen(rxvt_t *r, int scrn) { int i; #if NSCREENS int offset; #endif r->h->want_refresh = 1; D_SCREEN((stderr, "rxvt_scr_change_screen(%d)", scrn)); r->TermWin.view_start = 0; RESET_CHSTAT(r->h); if (r->h->current_screen == scrn) return r->h->current_screen; rxvt_selection_check(r, 2); /* check for boundary cross */ SWAP_IT(r->h->current_screen, scrn, int); #if NSCREENS r->h->num_scr = 0; offset = r->TermWin.saveLines; for (i = r->h->prev_nrow; i--;) { SWAP_IT(r->screen.text[i + offset], r->swap.text[i], text_t *); SWAP_IT(r->screen.tlen[i + offset], r->swap.tlen[i], int16_t); SWAP_IT(r->screen.rend[i + offset], r->swap.rend[i], rend_t *); } SWAP_IT(r->screen.cur.row, r->swap.cur.row, int16_t); SWAP_IT(r->screen.cur.col, r->swap.cur.col, int16_t); # ifdef DEBUG_STRICT assert((r->screen.cur.row >= 0) && (r->screen.cur.row < r->h->prev_nrow)); assert((r->screen.cur.col >= 0) && (r->screen.cur.col < r->h->prev_ncol)); # else /* drive with your eyes closed */ MAX_IT(r->screen.cur.row, 0); MIN_IT(r->screen.cur.row, r->h->prev_nrow - 1); MAX_IT(r->screen.cur.col, 0); MIN_IT(r->screen.cur.col, r->h->prev_ncol - 1); # endif SWAP_IT(r->screen.charset, r->swap.charset, int16_t); SWAP_IT(r->screen.flags, r->swap.flags, int); r->screen.flags |= Screen_VisibleCursor; r->swap.flags |= Screen_VisibleCursor; if (rxvt_Gr_Displayed(r)) { rxvt_Gr_scroll(r, 0); rxvt_Gr_ChangeScreen(r); } #else # ifdef SCROLL_ON_NO_SECONDARY if (rxvt_Gr_Displayed(r)) rxvt_Gr_ClearScreen(r); if (r->h->current_screen == PRIMARY && !rxvt_Gr_Displayed(r)) rxvt_scroll_text(r, 0, (r->h->prev_nrow - 1), r->h->prev_nrow, 0); # endif #endif return scrn; } /* ------------------------------------------------------------------------- */ /* * Change the colour for following text */ /* EXTPROTO */ void rxvt_scr_color(rxvt_t *r, unsigned int color, int fgbg) { color &= RS_fgMask; if (fgbg == Color_fg) r->h->rstyle = SET_FGCOLOR(r->h->rstyle, color); else r->h->rstyle = SET_BGCOLOR(r->h->rstyle, color); } /* ------------------------------------------------------------------------- */ /* * Change the rendition style for following text */ /* EXTPROTO */ void rxvt_scr_rendition(rxvt_t *r, int set, int style) { if (set) r->h->rstyle |= style; else if (style == ~RS_None) r->h->rstyle = DEFAULT_RSTYLE | (r->h->rstyle & RS_fontMask); else r->h->rstyle &= ~style; } /* ------------------------------------------------------------------------- */ /* * Scroll text between and inclusive, by lines * count positive ==> scroll up * count negative ==> scroll down * spec == 0 for normal routines */ /* EXTPROTO */ int rxvt_scroll_text(rxvt_t *r, int row1, int row2, int count, int spec) { int i, j; long nscrolled; if (count == 0 || (row1 > row2)) return 0; r->h->want_refresh = 1; D_SCREEN((stderr, "rxvt_scroll_text(%d,%d,%d,%d): %s", row1, row2, count, spec, (r->h->current_screen == PRIMARY) ? "Primary" : "Secondary")); if ((count > 0) && (row1 == 0) && (r->h->current_screen == PRIMARY)) { nscrolled = (long)r->TermWin.nscrolled + (long)count;; if (nscrolled > (long)r->TermWin.saveLines) r->TermWin.nscrolled = r->TermWin.saveLines; else r->TermWin.nscrolled = (u_int16_t)nscrolled; if ((r->Options & Opt_scrollWithBuffer) && r->TermWin.view_start != 0 && r->TermWin.view_start != r->TermWin.saveLines) rxvt_scr_page(r, UP, count); } else if (!spec) row1 += r->TermWin.saveLines; row2 += r->TermWin.saveLines; if (r->selection.op && r->h->current_screen == r->selection.screen) { i = r->selection.beg.row + r->TermWin.saveLines; j = r->selection.end.row + r->TermWin.saveLines; if ((i < row1 && j > row1) || (i < row2 && j > row2) || (i - count < row1 && i >= row1) || (i - count > row2 && i <= row2) || (j - count < row1 && j >= row1) || (j - count > row2 && j <= row2)) { CLEAR_ALL_SELECTION(r); r->selection.op = SELECTION_CLEAR; /* XXX: too aggressive? */ } else if (j >= row1 && j <= row2) { /* move selected region too */ r->selection.beg.row -= count; r->selection.end.row -= count; r->selection.mark.row -= count; } } rxvt_selection_check(r, 0); /* _after_ r->TermWin.nscrolled update */ r->h->num_scr += count; j = count; if (count < 0) count = -count; i = row2 - row1 + 1; MIN_IT(count, i); if (j > 0) { /* A: scroll up */ /* A1: Copy lines that will get clobbered by the rotation */ for (i = 0, j = row1; i < count; i++, j++) { r->buf_text[i] = r->screen.text[j]; r->buf_rend[i] = r->screen.rend[j]; } /* A2: Rotate lines */ for (j = row1, i = j + count; i <= row2; i++, j++) { r->screen.tlen[j] = r->screen.tlen[i]; r->screen.text[j] = r->screen.text[i]; r->screen.rend[j] = r->screen.rend[i]; } j = row2 - count + 1, i = count; } else /* if (j < 0) */ { /* B: scroll down */ /* B1: Copy lines that will get clobbered by the rotation */ for (i = 0, j = row2; i < count; i++, j--) { r->buf_text[i] = r->screen.text[j]; r->buf_rend[i] = r->screen.rend[j]; } /* B2: Rotate lines */ for (j = row2, i = j - count; i >= row1; i--, j--) { r->screen.tlen[j] = r->screen.tlen[i]; r->screen.text[j] = r->screen.text[i]; r->screen.rend[j] = r->screen.rend[i]; } j = row1, i = count; count = -count; } /* C: Resurrect lines */ for (; i--; j++) { r->screen.tlen[j] = 0; r->screen.text[j] = r->buf_text[i]; r->screen.rend[j] = r->buf_rend[i]; if (!spec) /* line length may not equal TermWin.ncol */ rxvt_blank_screen_mem(r, r->screen.text, r->screen.rend, (unsigned int)j, r->h->rstyle); } if (rxvt_Gr_Displayed(r)) rxvt_Gr_scroll(r, count); return count; } /* ------------------------------------------------------------------------- */ /* * Add text given in of length to screen struct */ /* EXTPROTO */ void rxvt_scr_add_lines(rxvt_t *r, const unsigned char *str, int nlines, int len) { unsigned char checksel, clearsel; char c; int i, row, last_col; text_t *stp; rend_t *srp; struct rxvt_hidden *h = r->h; if (len <= 0) /* sanity */ return; h->want_refresh = 1; last_col = r->TermWin.ncol; D_SCREEN((stderr, "rxvt_scr_add_lines(%d,%d)", nlines, len)); ZERO_SCROLLBACK(r); if (nlines > 0) { nlines += (r->screen.cur.row - r->screen.bscroll); if ((nlines > 0) && (r->screen.tscroll == 0) && (r->screen.bscroll == (r->TermWin.nrow - 1))) { /* _at least_ this many lines need to be scrolled */ rxvt_scroll_text(r, r->screen.tscroll, r->screen.bscroll, nlines, 0); r->screen.cur.row -= nlines; } } #ifdef DEBUG_STRICT assert(r->screen.cur.col < last_col); assert((r->screen.cur.row < r->TermWin.nrow) && (r->screen.cur.row >= -(int32_t)r->TermWin.nscrolled)); #else /* drive with your eyes closed */ MIN_IT(r->screen.cur.col, last_col - 1); MIN_IT(r->screen.cur.row, r->TermWin.nrow - 1); MAX_IT(r->screen.cur.row, -(int32_t)r->TermWin.nscrolled); #endif row = r->screen.cur.row + r->TermWin.saveLines; checksel = (r->selection.op && h->current_screen == r->selection.screen) ? 1 : 0; clearsel = 0; stp = r->screen.text[row]; srp = r->screen.rend[row]; #ifdef MULTICHAR_SET if (h->lost_multi && r->screen.cur.col > 0 && IS_MULTI1(srp[r->screen.cur.col - 1]) && *str != '\n' && *str != '\r' && *str != '\t') h->chstat = WBYTE; #endif for (i = 0; i < len;) { c = str[i++]; switch (c) { case '\t': rxvt_scr_tab(r, 1); continue; case '\n': if (r->screen.tlen[row] != -1) /* XXX: think about this */ MAX_IT(r->screen.tlen[row], r->screen.cur.col); r->screen.flags &= ~Screen_WrapNext; if (r->screen.cur.row == r->screen.bscroll) rxvt_scroll_text(r, r->screen.tscroll, r->screen.bscroll, 1, 0); else if (r->screen.cur.row < (r->TermWin.nrow - 1)) row = (++r->screen.cur.row) + r->TermWin.saveLines; stp = r->screen.text[row]; /* _must_ refresh */ srp = r->screen.rend[row]; /* _must_ refresh */ RESET_CHSTAT(h); continue; case '\r': if (r->screen.tlen[row] != -1) /* XXX: think about this */ MAX_IT(r->screen.tlen[row], r->screen.cur.col); r->screen.flags &= ~Screen_WrapNext; r->screen.cur.col = 0; RESET_CHSTAT(h); continue; default: #ifdef MULTICHAR_SET if (r->encoding_method == NOENC) { if (c == 127) continue; break; } h->rstyle &= ~RS_multiMask; if (h->chstat == WBYTE) { h->rstyle |= RS_multi2; /* multibyte 2nd byte */ h->chstat = SBYTE; if ((r->encoding_method == EUCJ) || (r->encoding_method == GB)) c |= 0x80; /* maybe overkill, but makes it selectable */ } else if (h->chstat == SBYTE) { if (h->multi_byte || (c & 0x80)) { /* multibyte 1st byte */ h->rstyle |= RS_multi1; h->chstat = WBYTE; if ((r->encoding_method == EUCJ) || (r->encoding_method == GB)) c |= 0x80; /* maybe overkill, but makes selectable */ } } else #endif if (c == 127) continue; /* yummmm..... */ break; } if (checksel /* see if we're writing within selection */ && !ROWCOL_IS_BEFORE(r->screen.cur, r->selection.beg) && ROWCOL_IS_BEFORE(r->screen.cur, r->selection.end)) { checksel = 0; clearsel = 1; } if (r->screen.flags & Screen_WrapNext) { r->screen.tlen[row] = -1; if (r->screen.cur.row == r->screen.bscroll) rxvt_scroll_text(r, r->screen.tscroll, r->screen.bscroll, 1, 0); else if (r->screen.cur.row < (r->TermWin.nrow - 1)) row = (++r->screen.cur.row) + r->TermWin.saveLines; stp = r->screen.text[row]; /* _must_ refresh */ srp = r->screen.rend[row]; /* _must_ refresh */ r->screen.cur.col = 0; r->screen.flags &= ~Screen_WrapNext; } if (r->screen.flags & Screen_Insert) rxvt_scr_insdel_chars(r, 1, INSERT); #ifdef MULTICHAR_SET if (IS_MULTI1(h->rstyle) && r->screen.cur.col > 0 && IS_MULTI1(srp[r->screen.cur.col - 1])) { stp[r->screen.cur.col - 1] = ' '; srp[r->screen.cur.col - 1] &= ~RS_multiMask; } else if (IS_MULTI2(h->rstyle) && r->screen.cur.col < (last_col - 1) && IS_MULTI2(srp[r->screen.cur.col + 1])) { stp[r->screen.cur.col + 1] = ' '; srp[r->screen.cur.col + 1] &= ~RS_multiMask; } #endif stp[r->screen.cur.col] = c; srp[r->screen.cur.col] = h->rstyle; if (r->screen.cur.col < (last_col - 1)) r->screen.cur.col++; else { r->screen.tlen[row] = last_col; if (r->screen.flags & Screen_Autowrap) r->screen.flags |= Screen_WrapNext; } } if (r->screen.tlen[row] != -1) /* XXX: think about this */ MAX_IT(r->screen.tlen[row], r->screen.cur.col); /* * If we wrote anywhere in the selected area, kill the selection * XXX: should we kill the mark too? Possibly, but maybe that * should be a similar check. */ if (clearsel) CLEAR_SELECTION(r); #ifdef DEBUG_STRICT assert(r->screen.cur.row >= 0); #else /* drive with your eyes closed */ MAX_IT(r->screen.cur.row, 0); #endif } /* ------------------------------------------------------------------------- */ /* * Process Backspace. Move back the cursor back a position, wrap if have to * XTERM_SEQ: CTRL-H */ /* EXTPROTO */ void rxvt_scr_backspace(rxvt_t *r) { RESET_CHSTAT(r->h); r->h->want_refresh = 1; if (r->screen.cur.col == 0) { if (r->screen.cur.row > 0) { #ifdef TERMCAP_HAS_BW r->screen.cur.col = r->TermWin.ncol - 1; r->screen.cur.row--; return; #endif } } else if ((r->screen.flags & Screen_WrapNext) == 0) rxvt_scr_gotorc(r, 0, -1, RELATIVE); r->screen.flags &= ~Screen_WrapNext; } /* ------------------------------------------------------------------------- */ /* * Process Horizontal Tab * count: +ve = forward; -ve = backwards * XTERM_SEQ: CTRL-I */ /* EXTPROTO */ void rxvt_scr_tab(rxvt_t *r, int count) { int i, x; D_SCREEN((stderr, "rxvt_scr_tab(%d)", count)); r->h->want_refresh = 1; RESET_CHSTAT(r->h); i = x = r->screen.cur.col; if (count == 0) return; else if (count > 0) { for (; ++i < r->TermWin.ncol; ) if (r->tabs[i]) { x = i; if (!--count) break; } if (count) x = r->TermWin.ncol - 1; } else /* if (count < 0) */ { for (; --i >= 0; ) if (r->tabs[i]) { x = i; if (!++count) break; } if (count) x = 0; } if (x != r->screen.cur.col) rxvt_scr_gotorc(r, 0, x, R_RELATIVE); } /* ------------------------------------------------------------------------- */ /* * Process DEC Back Index * XTERM_SEQ: ESC 6 * Move cursor left in row. If we're at the left boundary, shift everything * in that row right. Clear left column. */ #ifndef NO_FRILLS /* EXTPROTO */ void rxvt_scr_backindex(rxvt_t *r) { if (r->screen.cur.col > 0) rxvt_scr_gotorc(r, 0, -1, R_RELATIVE | C_RELATIVE); else { if (r->screen.tlen[r->screen.cur.row + r->TermWin.saveLines] == 0) return; /* um, yeah? */ rxvt_scr_insdel_chars(r, 1, INSERT); } } #endif /* ------------------------------------------------------------------------- */ /* * Process DEC Forward Index * XTERM_SEQ: ESC 9 * Move cursor right in row. If we're at the right boundary, shift everything * in that row left. Clear right column. */ #ifndef NO_FRILLS /* EXTPROTO */ void rxvt_scr_forwardindex(rxvt_t *r) { int row; if (r->screen.cur.col < r->TermWin.ncol - 1) rxvt_scr_gotorc(r, 0, 1, R_RELATIVE | C_RELATIVE); else { row = r->screen.cur.row + r->TermWin.saveLines; if (r->screen.tlen[row] == 0) return; /* um, yeah? */ else if (r->screen.tlen[row] == -1) r->screen.tlen[row] = r->TermWin.ncol; rxvt_scr_gotorc(r, 0, 0, R_RELATIVE); rxvt_scr_insdel_chars(r, 1, DELETE); rxvt_scr_gotorc(r, 0, r->TermWin.ncol - 1, R_RELATIVE); } } #endif /* ------------------------------------------------------------------------- */ /* * Goto Row/Column */ /* EXTPROTO */ void rxvt_scr_gotorc(rxvt_t *r, int row, int col, int relative) { r->h->want_refresh = 1; ZERO_SCROLLBACK(r); RESET_CHSTAT(r->h); if (rxvt_Gr_Displayed(r)) rxvt_Gr_scroll(r, 0); D_SCREEN((stderr, "rxvt_scr_gotorc(r:%s%d,c:%s%d): from (r:%d,c:%d)", (relative & R_RELATIVE ? "+" : ""), row, (relative & C_RELATIVE ? "+" : ""), col, r->screen.cur.row, r->screen.cur.col)); r->screen.cur.col = ((relative & C_RELATIVE) ? (r->screen.cur.col + col) : col); MAX_IT(r->screen.cur.col, 0); MIN_IT(r->screen.cur.col, r->TermWin.ncol - 1); r->screen.flags &= ~Screen_WrapNext; if (relative & R_RELATIVE) { if (row > 0) { if (r->screen.cur.row <= r->screen.bscroll && (r->screen.cur.row + row) > r->screen.bscroll) r->screen.cur.row = r->screen.bscroll; else r->screen.cur.row += row; } else if (row < 0) { if (r->screen.cur.row >= r->screen.tscroll && (r->screen.cur.row + row) < r->screen.tscroll) r->screen.cur.row = r->screen.tscroll; else r->screen.cur.row += row; } } else { if (r->screen.flags & Screen_Relative) { /* relative origin mode */ r->screen.cur.row = row + r->screen.tscroll; MIN_IT(r->screen.cur.row, r->screen.bscroll); } else r->screen.cur.row = row; } MAX_IT(r->screen.cur.row, 0); MIN_IT(r->screen.cur.row, r->TermWin.nrow - 1); } /* ------------------------------------------------------------------------- */ /* * direction should be UP or DN */ /* EXTPROTO */ void rxvt_scr_index(rxvt_t *r, enum page_dirn direction) { int dirn; r->h->want_refresh = 1; dirn = ((direction == UP) ? 1 : -1); D_SCREEN((stderr, "rxvt_scr_index(%d)", dirn)); ZERO_SCROLLBACK(r); RESET_CHSTAT(r->h); if (rxvt_Gr_Displayed(r)) rxvt_Gr_scroll(r, 0); r->screen.flags &= ~Screen_WrapNext; if ((r->screen.cur.row == r->screen.bscroll && direction == UP) || (r->screen.cur.row == r->screen.tscroll && direction == DN)) rxvt_scroll_text(r, r->screen.tscroll, r->screen.bscroll, dirn, 0); else r->screen.cur.row += dirn; MAX_IT(r->screen.cur.row, 0); MIN_IT(r->screen.cur.row, r->TermWin.nrow - 1); rxvt_selection_check(r, 0); } /* ------------------------------------------------------------------------- */ /* * Erase part or whole of a line * XTERM_SEQ: Clear line to right: ESC [ 0 K * XTERM_SEQ: Clear line to left : ESC [ 1 K * XTERM_SEQ: Clear whole line : ESC [ 2 K */ /* EXTPROTO */ void rxvt_scr_erase_line(rxvt_t *r, int mode) { unsigned int row, col, num; r->h->want_refresh = 1; D_SCREEN((stderr, "rxvt_scr_erase_line(%d) at screen row: %d", mode, r->screen.cur.row)); ZERO_SCROLLBACK(r); RESET_CHSTAT(r->h); if (rxvt_Gr_Displayed(r)) rxvt_Gr_scroll(r, 0); rxvt_selection_check(r, 1); r->screen.flags &= ~Screen_WrapNext; row = r->TermWin.saveLines + r->screen.cur.row; switch (mode) { case 0: /* erase to end of line */ col = r->screen.cur.col; num = r->TermWin.ncol - col; MIN_IT(r->screen.tlen[row], (int16_t)col); if (ROWCOL_IN_ROW_AT_OR_AFTER(r->selection.beg, r->screen.cur) || ROWCOL_IN_ROW_AT_OR_AFTER(r->selection.end, r->screen.cur)) CLEAR_SELECTION(r); break; case 1: /* erase to beginning of line */ col = 0; num = r->screen.cur.col + 1; if (ROWCOL_IN_ROW_AT_OR_BEFORE(r->selection.beg, r->screen.cur) || ROWCOL_IN_ROW_AT_OR_BEFORE(r->selection.end, r->screen.cur)) CLEAR_SELECTION(r); break; case 2: /* erase whole line */ col = 0; num = r->TermWin.ncol; r->screen.tlen[row] = 0; if (r->selection.beg.row <= r->screen.cur.row && r->selection.end.row >= r->screen.cur.row) CLEAR_SELECTION(r); break; default: return; } if (r->screen.text[row]) rxvt_blank_line(&(r->screen.text[row][col]), &(r->screen.rend[row][col]), num, r->h->rstyle); else rxvt_blank_screen_mem(r, r->screen.text, r->screen.rend, row, r->h->rstyle); } /* ------------------------------------------------------------------------- */ /* * Erase part of whole of the screen * XTERM_SEQ: Clear screen after cursor : ESC [ 0 J * XTERM_SEQ: Clear screen before cursor: ESC [ 1 J * XTERM_SEQ: Clear whole screen : ESC [ 2 J */ /* EXTPROTO */ void rxvt_scr_erase_screen(rxvt_t *r, int mode) { int num; int32_t row, row_offset; rend_t ren; XGCValues gcvalue; r->h->want_refresh = 1; D_SCREEN((stderr, "rxvt_scr_erase_screen(%d) at screen row: %d", mode, r->screen.cur.row)); ZERO_SCROLLBACK(r); RESET_CHSTAT(r->h); row_offset = (int32_t)r->TermWin.saveLines; switch (mode) { case 0: /* erase to end of screen */ rxvt_selection_check(r, 1); rxvt_scr_erase_line(r, 0); row = r->screen.cur.row + 1; /* possible OOB */ num = r->TermWin.nrow - row; break; case 1: /* erase to beginning of screen */ rxvt_selection_check(r, 3); rxvt_scr_erase_line(r, 1); row = 0; num = r->screen.cur.row; break; case 2: /* erase whole screen */ rxvt_selection_check(r, 3); rxvt_Gr_ClearScreen(r); row = 0; num = r->TermWin.nrow; break; default: return; } r->h->refresh_type |= REFRESH_BOUNDS; if (r->selection.op && r->h->current_screen == r->selection.screen && ((r->selection.beg.row >= row && r->selection.beg.row <= row + num) || (r->selection.end.row >= row && r->selection.end.row <= row + num))) CLEAR_SELECTION(r); if (row >= r->TermWin.nrow) /* Out Of Bounds */ return; MIN_IT(num, (r->TermWin.nrow - row)); if (r->h->rstyle & (RS_RVid | RS_Uline)) ren = (rend_t) ~RS_None; else if (GET_BASEBG(r->h->rstyle) == Color_bg) { ren = DEFAULT_RSTYLE; CLEAR_ROWS(row, num); } else { ren = (r->h->rstyle & (RS_fgMask | RS_bgMask)); gcvalue.foreground = r->PixColors[GET_BGCOLOR(r->h->rstyle)]; XChangeGC(r->Xdisplay, r->TermWin.gc, GCForeground, &gcvalue); ERASE_ROWS(row, num); gcvalue.foreground = r->PixColors[Color_fg]; XChangeGC(r->Xdisplay, r->TermWin.gc, GCForeground, &gcvalue); } for (; num--; row++) { rxvt_blank_screen_mem(r, r->screen.text, r->screen.rend, (unsigned int)(row + row_offset), r->h->rstyle); r->screen.tlen[row + row_offset] = 0; rxvt_blank_line(r->drawn_text[row], r->drawn_rend[row], (unsigned int)r->TermWin.ncol, ren); } } /* ------------------------------------------------------------------------- */ /* * Fill the screen with `E's * XTERM_SEQ: Screen Alignment Test: ESC # 8 */ /* EXTPROTO */ void rxvt_scr_E(rxvt_t *r) { int i, j, k; rend_t *r1, fs; r->h->want_refresh = 1; r->h->num_scr_allow = 0; ZERO_SCROLLBACK(r); RESET_CHSTAT(r->h); rxvt_selection_check(r, 3); fs = r->h->rstyle; for (k = r->TermWin.saveLines, i = r->TermWin.nrow; i--; k++) { r->screen.tlen[k] = r->TermWin.ncol; /* make the `E's selectable */ MEMSET(r->screen.text[k], 'E', r->TermWin.ncol); for (r1 = r->screen.rend[k], j = r->TermWin.ncol; j--; ) *r1++ = fs; } } /* ------------------------------------------------------------------------- */ /* * Insert/Delete lines */ /* EXTPROTO */ void rxvt_scr_insdel_lines(rxvt_t *r, int count, int insdel) { int end; ZERO_SCROLLBACK(r); RESET_CHSTAT(r->h); if (rxvt_Gr_Displayed(r)) rxvt_Gr_scroll(r, 0); rxvt_selection_check(r, 1); if (r->screen.cur.row > r->screen.bscroll) return; end = r->screen.bscroll - r->screen.cur.row + 1; if (count > end) { if (insdel == DELETE) return; else if (insdel == INSERT) count = end; } r->screen.flags &= ~Screen_WrapNext; rxvt_scroll_text(r, r->screen.cur.row, r->screen.bscroll, insdel * count, 0); } /* ------------------------------------------------------------------------- */ /* * Insert/Delete characters from the current position */ /* EXTPROTO */ void rxvt_scr_insdel_chars(rxvt_t *r, int count, int insdel) { int col, row; rend_t tr; text_t *stp; rend_t *srp; int16_t *slp; r->h->want_refresh = 1; ZERO_SCROLLBACK(r); #if 0 RESET_CHSTAT(r->h); #endif if (rxvt_Gr_Displayed(r)) rxvt_Gr_scroll(r, 0); if (count <= 0) return; rxvt_selection_check(r, 1); MIN_IT(count, (r->TermWin.ncol - r->screen.cur.col)); row = r->screen.cur.row + r->TermWin.saveLines; r->screen.flags &= ~Screen_WrapNext; stp = r->screen.text[row]; srp = r->screen.rend[row]; slp = &(r->screen.tlen[row]); switch (insdel) { case INSERT: for (col = r->TermWin.ncol - 1; (col - count) >= r->screen.cur.col; col--) { stp[col] = stp[col - count]; srp[col] = srp[col - count]; } if (*slp != -1) { *slp += count; MIN_IT(*slp, r->TermWin.ncol); } if (r->selection.op && r->h->current_screen == r->selection.screen && ROWCOL_IN_ROW_AT_OR_AFTER(r->selection.beg, r->screen.cur)) { if (r->selection.end.row != r->screen.cur.row || (r->selection.end.col + count >= r->TermWin.ncol)) CLEAR_SELECTION(r); else { /* shift selection */ r->selection.beg.col += count; r->selection.mark.col += count; /* XXX: yes? */ r->selection.end.col += count; } } rxvt_blank_line(&(stp[r->screen.cur.col]), &(srp[r->screen.cur.col]), (unsigned int)count, r->h->rstyle); break; case ERASE: r->screen.cur.col += count; /* don't worry if > r->TermWin.ncol */ rxvt_selection_check(r, 1); r->screen.cur.col -= count; rxvt_blank_line(&(stp[r->screen.cur.col]), &(srp[r->screen.cur.col]), (unsigned int)count, r->h->rstyle); break; case DELETE: tr = srp[r->TermWin.ncol - 1] & (RS_fgMask | RS_bgMask | RS_baseattrMask); for (col = r->screen.cur.col; (col + count) < r->TermWin.ncol; col++) { stp[col] = stp[col + count]; srp[col] = srp[col + count]; } rxvt_blank_line(&(stp[r->TermWin.ncol - count]), &(srp[r->TermWin.ncol - count]), (unsigned int)count, tr); if (*slp == -1) /* break line continuation */ *slp = r->TermWin.ncol; *slp -= count; MAX_IT(*slp, 0); if (r->selection.op && r->h->current_screen == r->selection.screen && ROWCOL_IN_ROW_AT_OR_AFTER(r->selection.beg, r->screen.cur)) { if (r->selection.end.row != r->screen.cur.row || (r->screen.cur.col >= r->selection.beg.col - count) || r->selection.end.col >= r->TermWin.ncol) CLEAR_SELECTION(r); else { /* shift selection */ r->selection.beg.col -= count; r->selection.mark.col -= count; /* XXX: yes? */ r->selection.end.col -= count; } } break; } #if 0 if (IS_MULTI2(srp[0])) { srp[0] &= ~RS_multiMask; stp[0] = ' '; } if (IS_MULTI1(srp[r->TermWin.ncol - 1])) { srp[r->TermWin.ncol - 1] &= ~RS_multiMask; stp[r->TermWin.ncol - 1] = ' '; } #endif } /* ------------------------------------------------------------------------- */ /* * Set the scrolling region * XTERM_SEQ: Set region - inclusive: ESC [ ; r */ /* EXTPROTO */ void rxvt_scr_scroll_region(rxvt_t *r, int top, int bot) { MAX_IT(top, 0); MIN_IT(bot, r->TermWin.nrow - 1); if (top > bot) return; r->screen.tscroll = top; r->screen.bscroll = bot; rxvt_scr_gotorc(r, 0, 0, 0); } /* ------------------------------------------------------------------------- */ /* * Make the cursor visible/invisible * XTERM_SEQ: Make cursor visible : ESC [ ? 25 h * XTERM_SEQ: Make cursor invisible: ESC [ ? 25 l */ /* EXTPROTO */ void rxvt_scr_cursor_visible(rxvt_t *r, int mode) { r->h->want_refresh = 1; if (mode) r->screen.flags |= Screen_VisibleCursor; else r->screen.flags &= ~Screen_VisibleCursor; } /* ------------------------------------------------------------------------- */ /* * Set/unset automatic wrapping * XTERM_SEQ: Set Wraparound : ESC [ ? 7 h * XTERM_SEQ: Unset Wraparound: ESC [ ? 7 l */ /* EXTPROTO */ void rxvt_scr_autowrap(rxvt_t *r, int mode) { if (mode) r->screen.flags |= Screen_Autowrap; else r->screen.flags &= ~(Screen_Autowrap | Screen_WrapNext); } /* ------------------------------------------------------------------------- */ /* * Set/unset margin origin mode * Absolute mode: line numbers are counted relative to top margin of screen * and the cursor can be moved outside the scrolling region. * Relative mode: line numbers are relative to top margin of scrolling region * and the cursor cannot be moved outside. * XTERM_SEQ: Set Absolute: ESC [ ? 6 h * XTERM_SEQ: Set Relative: ESC [ ? 6 l */ /* EXTPROTO */ void rxvt_scr_relative_origin(rxvt_t *r, int mode) { if (mode) r->screen.flags |= Screen_Relative; else r->screen.flags &= ~Screen_Relative; rxvt_scr_gotorc(r, 0, 0, 0); } /* ------------------------------------------------------------------------- */ /* * Set insert/replace mode * XTERM_SEQ: Set Insert mode : ESC [ ? 4 h * XTERM_SEQ: Set Replace mode: ESC [ ? 4 l */ /* EXTPROTO */ void rxvt_scr_insert_mode(rxvt_t *r, int mode) { if (mode) r->screen.flags |= Screen_Insert; else r->screen.flags &= ~Screen_Insert; } /* ------------------------------------------------------------------------- */ /* * Set/Unset tabs * XTERM_SEQ: Set tab at current column : ESC H * XTERM_SEQ: Clear tab at current column: ESC [ 0 g * XTERM_SEQ: Clear all tabs : ESC [ 3 g */ /* EXTPROTO */ void rxvt_scr_set_tab(rxvt_t *r, int mode) { if (mode < 0) MEMSET(r->tabs, 0, r->TermWin.ncol * sizeof(char)); else if (r->screen.cur.col < r->TermWin.ncol) r->tabs[r->screen.cur.col] = (mode ? 1 : 0); } /* ------------------------------------------------------------------------- */ /* * Set reverse/normal video * XTERM_SEQ: Reverse video: ESC [ ? 5 h * XTERM_SEQ: Normal video : ESC [ ? 5 l */ /* EXTPROTO */ void rxvt_scr_rvideo_mode(rxvt_t *r, int mode) { XGCValues gcvalue; if (r->h->rvideo != mode) { r->h->rvideo = mode; SWAP_IT(r->PixColors[Color_fg], r->PixColors[Color_bg], Pixel); #if defined(XPM_BACKGROUND) if (r->h->bgPixmap.pixmap == None) #endif #if defined(TRANSPARENT) if (!(r->Options & Opt_transparent) || r->h->am_transparent == 0) #endif XSetWindowBackground(r->Xdisplay, r->TermWin.vt, r->PixColors[Color_bg]); gcvalue.foreground = r->PixColors[Color_fg]; gcvalue.background = r->PixColors[Color_bg]; XChangeGC(r->Xdisplay, r->TermWin.gc, GCBackground | GCForeground, &gcvalue); rxvt_scr_clear(r); rxvt_scr_touch(r, True); } } /* ------------------------------------------------------------------------- */ /* * Report current cursor position * XTERM_SEQ: Report position: ESC [ 6 n */ /* EXTPROTO */ void rxvt_scr_report_position(rxvt_t *r) { rxvt_tt_printf(r, "\033[%d;%dR", r->screen.cur.row + 1, r->screen.cur.col + 1); } /* ------------------------------------------------------------------------- * * FONTS * * ------------------------------------------------------------------------- */ /* * Set font style */ /* INTPROTO */ void rxvt_set_font_style(rxvt_t *r) { r->h->rstyle &= ~RS_fontMask; switch (r->h->charsets[r->screen.charset]) { case '0': /* DEC Special Character & Line Drawing Set */ r->h->rstyle |= RS_acsFont; break; case 'A': /* United Kingdom (UK) */ r->h->rstyle |= RS_ukFont; break; case 'B': /* United States (USASCII) */ break; case '<': /* Multinational character set */ break; case '5': /* Finnish character set */ break; case 'C': /* Finnish character set */ break; case 'K': /* German character set */ break; } } /* ------------------------------------------------------------------------- */ /* * Choose a font * XTERM_SEQ: Invoke G0 character set: CTRL-O * XTERM_SEQ: Invoke G1 character set: CTRL-N * XTERM_SEQ: Invoke G2 character set: ESC N * XTERM_SEQ: Invoke G3 character set: ESC O */ /* EXTPROTO */ void rxvt_scr_charset_choose(rxvt_t *r, int set) { r->screen.charset = set; rxvt_set_font_style(r); } /* ------------------------------------------------------------------------- */ /* * Set a font * XTERM_SEQ: Set G0 character set: ESC ( * XTERM_SEQ: Set G1 character set: ESC ) * XTERM_SEQ: Set G2 character set: ESC * * XTERM_SEQ: Set G3 character set: ESC + * See set_font_style for possible values for */ /* EXTPROTO */ void rxvt_scr_charset_set(rxvt_t *r, int set, unsigned int ch) { #ifdef MULTICHAR_SET r->h->multi_byte = !!(set < 0); set = abs(set); #endif r->h->charsets[set] = (unsigned char)ch; rxvt_set_font_style(r); } /* ------------------------------------------------------------------------- * * MULTIPLE-CHARACTER FONT SET MANIPULATION FUNCTIONS * * ------------------------------------------------------------------------- */ #ifdef MULTICHAR_SET /* EXTPROTO */ void rxvt_euc2jis(unsigned char *str, int len) { int i; for (i = 0; i < len; i++) str[i] &= 0x7F; } /* ------------------------------------------------------------------------- */ /* INTPROTO */ void rxvt_sjis2jis(unsigned char *str, int len) { int i; unsigned char *high, *low; for (i = 0; i < len; i += 2, str += 2) { high = str; low = str + 1; (*high) -= (*high > 0x9F ? 0xB1 : 0x71); *high = (*high) * 2 + 1; if (*low > 0x9E) { *low -= 0x7E; (*high)++; } else { if (*low > 0x7E) (*low)--; *low -= 0x1F; } } } /* INTPROTO */ void rxvt_decodedummy(unsigned char *str __attribute__((unused)), int len __attribute__((unused))) { } /* EXTPROTO */ void rxvt_set_multichar_encoding(rxvt_t *r, const char *str) { KNOWN_ENCODINGS *a; if (str && *str) { for (a = (KNOWN_ENCODINGS *)known_encodings; a->name; a++) { if (STRCASECMP(str, a->name) == 0) { r->encoding_method = a->method; r->h->multichar_decode = a->func; break; } } } } #endif /* MULTICHAR_SET */ /* ------------------------------------------------------------------------- * * GRAPHICS COLOURS * * ------------------------------------------------------------------------- */ #ifdef RXVT_GRAPHICS /* EXTPROTO */ int rxvt_scr_get_fgcolor(rxvt_t *r) { return GET_FGCOLOR(r->h->rstyle); } /* ------------------------------------------------------------------------- */ /* EXTPROTO */ int rxvt_scr_get_bgcolor(rxvt_t *r) { return GET_BGCOLOR(r->h->rstyle); } #endif /* ------------------------------------------------------------------------- * * MAJOR SCREEN MANIPULATION * * ------------------------------------------------------------------------- */ /* * Refresh an area */ enum { PART_BEG = 0, PART_END, RC_COUNT }; /* EXTPROTO */ void rxvt_scr_expose(rxvt_t *r, int x, int y, int width, int height, Bool refresh) { int i; row_col_t rc[RC_COUNT]; if (r->drawn_text == NULL) /* sanity check */ return; #ifdef DEBUG_STRICT x = max(x, (int)r->TermWin.int_bwidth); x = min(x, (int)r->TermWin.width); y = max(y, (int)r->TermWin.int_bwidth); y = min(y, (int)r->TermWin.height); #endif /* round down */ rc[PART_BEG].col = Pixel2Col(x); rc[PART_BEG].row = Pixel2Row(y); /* round up */ rc[PART_END].col = Pixel2Width(x + width + r->TermWin.fwidth - 1); rc[PART_END].row = Pixel2Row(y + height + r->TermWin.fheight - 1); /* sanity checks */ for (i = PART_BEG; i < RC_COUNT; i++) { MIN_IT(rc[i].col, r->TermWin.ncol - 1); MIN_IT(rc[i].row, r->TermWin.nrow - 1); } D_SCREEN((stderr, "rxvt_scr_expose(x:%d, y:%d, w:%d, h:%d) area (c:%d,r:%d)-(c:%d,r:%d)", x, y, width, height, rc[PART_BEG].col, rc[PART_BEG].row, rc[PART_END].col, rc[PART_END].row)); for (i = rc[PART_BEG].row; i <= rc[PART_END].row; i++) MEMSET(&(r->drawn_text[i][rc[PART_BEG].col]), 0, rc[PART_END].col - rc[PART_BEG].col + 1); if (refresh) rxvt_scr_refresh(r, SLOW_REFRESH | REFRESH_BOUNDS); } /* ------------------------------------------------------------------------- */ /* * Refresh the entire screen */ /* EXTPROTO */ void rxvt_scr_touch(rxvt_t *r, Bool refresh) { rxvt_scr_expose(r, 0, 0, r->TermWin.width, r->TermWin.height, refresh); } /* ------------------------------------------------------------------------- */ /* * Move the display so that the line represented by scrollbar value Y is at * the top of the screen */ /* EXTPROTO */ int rxvt_scr_move_to(rxvt_t *r, int y, int len) { long p = 0; u_int16_t oldviewstart; oldviewstart = r->TermWin.view_start; if (y < len) { p = (r->TermWin.nrow + r->TermWin.nscrolled) * (len - y) / len; p -= (long)(r->TermWin.nrow - 1); p = max(p, 0); } r->TermWin.view_start = (u_int16_t)min(p, r->TermWin.nscrolled); D_SCREEN((stderr, "rxvt_scr_move_to(%d, %d) view_start:%d", y, len, r->TermWin.view_start)); return rxvt_scr_changeview(r, oldviewstart); } /* ------------------------------------------------------------------------- */ /* * Page the screen up/down nlines * direction should be UP or DN */ /* EXTPROTO */ int rxvt_scr_page(rxvt_t *r, enum page_dirn direction, int nlines) { int n; u_int16_t oldviewstart; D_SCREEN((stderr, "rxvt_scr_page(%s, %d) view_start:%d", ((direction == UP) ? "UP" : "DN"), nlines, r->TermWin.view_start)); #ifdef DEBUG_STRICT assert((nlines >= 1) && (nlines <= r->TermWin.nrow)); #endif oldviewstart = r->TermWin.view_start; if (direction == UP) { n = r->TermWin.view_start + nlines; r->TermWin.view_start = min(n, r->TermWin.nscrolled); } else { n = r->TermWin.view_start - nlines; r->TermWin.view_start = max(n, 0); } return rxvt_scr_changeview(r, oldviewstart); } /* INTPROTO */ int rxvt_scr_changeview(rxvt_t *r, u_int16_t oldviewstart) { if (r->TermWin.view_start != oldviewstart) { r->h->want_refresh = 1; if (rxvt_Gr_Displayed(r)) rxvt_Gr_scroll(r, 0); r->h->num_scr -= (r->TermWin.view_start - oldviewstart); } return (int)(r->TermWin.view_start - oldviewstart); } /* ------------------------------------------------------------------------- */ /* EXTPROTO */ void rxvt_scr_bell(rxvt_t *r) { #ifndef NO_BELL # ifndef NO_MAPALERT # ifdef MAPALERT_OPTION if (r->Options & Opt_mapAlert) # endif XMapWindow(r->Xdisplay, r->TermWin.parent[0]); # endif if (r->Options & Opt_visualBell) { rxvt_scr_rvideo_mode(r, !r->h->rvideo); /* refresh also done */ rxvt_scr_rvideo_mode(r, !r->h->rvideo); /* refresh also done */ } else XBell(r->Xdisplay, 0); #endif } /* ------------------------------------------------------------------------- */ /* ARGSUSED */ /* EXTPROTO */ void rxvt_scr_printscreen(rxvt_t *r, int fullhist) { #ifdef PRINTPIPE int i, r1, nrows, row_offset; text_t *t; FILE *fd; if ((fd = rxvt_popen_printer(r)) == NULL) return; nrows = r->TermWin.nrow; row_offset = r->TermWin.saveLines; if (!fullhist) row_offset -= r->TermWin.view_start; else { nrows += r->TermWin.nscrolled; row_offset -= r->TermWin.nscrolled; } for (r1 = 0; r1 < nrows; r1++) { t = r->screen.text[r1 + row_offset]; for (i = r->TermWin.ncol - 1; i >= 0; i--) if (!isspace(t[i])) break; fprintf(fd, "%.*s\n", (i + 1), t); } rxvt_pclose_printer(fd); #endif } /* ------------------------------------------------------------------------- */ /* * Refresh the screen * r->drawn_text/r->drawn_rend contain the screen information before the update. * r->screen.text/r->screen.rend contain what the screen will change to. */ #define DRAW_STRING(Func, x, y, str, len) \ Func(r->Xdisplay, drawBuffer, r->TermWin.gc, (x), (y), (str), (len)) #if defined (NO_BRIGHTCOLOR) || defined (VERYBOLD) # define MONO_BOLD(x) ((x) & (RS_Bold|RS_Blink)) # define MONO_BOLD_FG(x, fg) MONO_BOLD(x) #else # define MONO_BOLD(x) \ (((x) & (RS_Bold | RS_fgMask)) == (RS_Bold | Color_fg)) # define MONO_BOLD_FG(x, fg) (((x) & RS_Bold) && (fg) == Color_fg) #endif #define FONT_WIDTH(X, Y) \ (X)->per_char[(Y) - (X)->min_char_or_byte2].width #define FONT_RBEAR(X, Y) \ (X)->per_char[(Y) - (X)->min_char_or_byte2].rbearing #define FONT_LBEAR(X, Y) \ (X)->per_char[(Y) - (X)->min_char_or_byte2].lbearing #define IS_FONT_CHAR(X, Y) \ ((Y) >= (X)->min_char_or_byte2 && (Y) <= (X)->max_char_or_byte2) /* EXTPROTO */ void rxvt_scr_refresh(rxvt_t *r, unsigned char refresh_type) { unsigned char clearfirst, /* first character writes before cell */ clearlast, /* last character writes beyond cell */ must_clear, /* use draw_string not draw_image_string */ #ifndef NO_BOLDFONT bfont, /* we've changed font to bold font */ #endif rvid, /* reverse video this position */ wbyte; /* we're in multibyte */ char morecur = 0;/* */ #ifdef TTY_256COLOR u_int16_t fore, back; /* desired foreground/background */ #else unsigned char fore, back; /* desired foreground/background */ #endif int16_t col, row, /* column/row we're processing */ ocrow, /* old cursor row */ len, wlen; /* text length screen/buffer */ int i, /* tmp */ row_offset; /* basic offset in screen structure */ #ifndef NO_CURSORCOLOR rend_t cc1; /* store colours at cursor position(s) */ # ifdef MULTICHAR_SET rend_t cc2; /* store colours at cursor position(s) */ # endif #endif XGCValues gcvalue; /* Graphics Context values */ rend_t *drp, *srp; /* drawn-rend-pointer, screen-rend-pointer */ text_t *dtp, *stp; /* drawn-text-pointer, screen-text-pointer */ char *buffer; /* local copy of r->h->buffer */ struct rxvt_hidden *h = r->h; int (*draw_string) () = XDrawString; int (*draw_image_string) () = XDrawImageString; if (refresh_type == NO_REFRESH || !r->TermWin.mapped) return; /* * A: set up vars */ clearfirst = clearlast = must_clear = wbyte = 0; #ifndef NO_BOLDFONT bfont = 0; #endif if (h->currmaxcol < r->TermWin.ncol) { h->currmaxcol = r->TermWin.ncol; h->buffer = rxvt_realloc(h->buffer, sizeof(char) * (h->currmaxcol + 1)); } buffer = h->buffer; h->refresh_count = 0; row_offset = r->TermWin.saveLines - r->TermWin.view_start; /* * always go back to the base font - it's much safer */ XSetFont(r->Xdisplay, r->TermWin.gc, r->TermWin.font->fid); if ((refresh_type & REFRESH_BOUNDS)) { clearfirst = clearlast = 1; h->refresh_type &= ~REFRESH_BOUNDS; } #if defined(XPM_BACKGROUND) must_clear |= (h->bgPixmap.pixmap != None); #endif #if defined(TRANSPARENT) must_clear |= ((r->Options & Opt_transparent) && h->am_transparent); #endif ocrow = h->oldcursor.row; /* is there an old outline cursor on screen? */ /* set base colours to avoid check in "single glyph writing" below */ gcvalue.foreground = r->PixColors[Color_fg]; gcvalue.background = r->PixColors[Color_bg]; /* * B: reverse any characters which are selected */ rxvt_scr_reverse_selection(r); /* * C: set the cursor character(s) */ { unsigned char setoldcursor; rend_t ccol1, /* Cursor colour */ ccol2; /* Cursor colour2 */ if ((r->screen.flags & Screen_VisibleCursor) && r->TermWin.focus) { srp = &(r->screen.rend[r->screen.cur.row + r->TermWin.saveLines] [r->screen.cur.col]); *srp ^= RS_RVid; #ifndef NO_CURSORCOLOR cc1 = *srp & (RS_fgMask | RS_bgMask); if (XDEPTH > 2 && ISSET_PIXCOLOR(h, Color_cursor)) ccol1 = Color_cursor; else #ifdef CURSOR_COLOR_IS_RENDITION_COLOR ccol1 = GET_FGCOLOR(h->rstyle); #else ccol1 = Color_fg; #endif if (XDEPTH > 2 && ISSET_PIXCOLOR(h, Color_cursor)) ccol2 = Color_cursor2; else #ifdef CURSOR_COLOR_IS_RENDITION_COLOR ccol2 = GET_BGCOLOR(h->rstyle); #else ccol2 = Color_bg; #endif *srp = SET_FGCOLOR(*srp, ccol1); *srp = SET_BGCOLOR(*srp, ccol2); #endif #ifdef MULTICHAR_SET if (IS_MULTI1(*srp)) { if (r->screen.cur.col < r->TermWin.ncol - 2 && IS_MULTI2(*++srp)) morecur = 1; } else if (IS_MULTI2(*srp)) { if (r->screen.cur.col > 0 && IS_MULTI1(*--srp)) morecur = -1; } if (morecur) { *srp ^= RS_RVid; # ifndef NO_CURSORCOLOR cc2 = *srp & (RS_fgMask | RS_bgMask); *srp = SET_FGCOLOR(*srp, ccol1); *srp = SET_BGCOLOR(*srp, ccol2); # endif } #endif } /* make sure no outline cursor is left around */ setoldcursor = 0; if (ocrow != -1) { if (r->screen.cur.row + r->TermWin.view_start != ocrow || r->screen.cur.col != h->oldcursor.col) { if (ocrow < r->TermWin.nrow && h->oldcursor.col < r->TermWin.ncol) { r->drawn_rend[ocrow][h->oldcursor.col] ^= (RS_RVid | RS_Uline); #ifdef MULTICHAR_SET if (h->oldcursormulti) { col = h->oldcursor.col + h->oldcursormulti; if (col < r->TermWin.ncol) r->drawn_rend[ocrow][col] ^= (RS_RVid | RS_Uline); } #endif } if (r->TermWin.focus || !(r->screen.flags & Screen_VisibleCursor)) h->oldcursor.row = -1; else setoldcursor = 1; } } else if (!r->TermWin.focus) setoldcursor = 1; if (setoldcursor) { if (r->screen.cur.row + r->TermWin.view_start >= r->TermWin.nrow) h->oldcursor.row = -1; else { h->oldcursor.row = r->screen.cur.row + r->TermWin.view_start; h->oldcursor.col = r->screen.cur.col; #ifdef MULTICHAR_SET h->oldcursormulti = morecur; #endif } } } #ifndef NO_SLOW_LINK_SUPPORT /* * D: CopyArea pass - very useful for slower links * This has been deliberately kept simple. */ i = h->num_scr; if (refresh_type == FAST_REFRESH && h->num_scr_allow && i && abs(i) < r->TermWin.nrow && !must_clear) { int16_t nits; int j; rend_t *drp2; text_t *dtp2; j = r->TermWin.nrow; wlen = len = -1; row = i > 0 ? 0 : j - 1; for (; j-- >= 0; row += (i > 0 ? 1 : -1)) { if (row + i >= 0 && row + i < r->TermWin.nrow && row + i != ocrow) { stp = r->screen.text[row + row_offset]; srp = r->screen.rend[row + row_offset]; dtp = r->drawn_text[row]; dtp2 = r->drawn_text[row + i]; drp = r->drawn_rend[row]; drp2 = r->drawn_rend[row + i]; for (nits = 0, col = r->TermWin.ncol; col--; ) if (stp[col] != dtp2[col] || srp[col] != drp2[col]) nits--; else if (stp[col] != dtp[col] || srp[col] != drp[col]) nits++; if (nits > 8) { /* XXX: arbitrary choice */ for (col = r->TermWin.ncol; col--; ) { *dtp++ = *dtp2++; *drp++ = *drp2++; } if (len == -1) len = row; wlen = row; continue; } } if (len != -1) { /* also comes here at end if needed because of >= above */ if (wlen < len) SWAP_IT(wlen, len, int); D_SCREEN((stderr, "rxvt_scr_refresh(): XCopyArea: %d -> %d (height: %d)", len + i, len, wlen - len + 1)); XCopyArea(r->Xdisplay, r->TermWin.vt, r->TermWin.vt, r->TermWin.gc, 0, Row2Pixel(len + i), (unsigned int)TermWin_TotalWidth(), (unsigned int)Height2Pixel(wlen - len + 1), 0, Row2Pixel(len)); len = -1; } } } #endif /* * E: main pass across every character */ for (row = 0; row < r->TermWin.nrow; row++) { unsigned char clear_next = 0; int j, xpixel, /* x offset for start of drawing (font) */ ypixel, /* y offset for start of drawing (font) */ ypixelc; /* y offset for top of drawing */ unsigned long gcmask; /* Graphics Context mask */ const XFontStruct *wf; /* which font are we in */ stp = r->screen.text[row + row_offset]; srp = r->screen.rend[row + row_offset]; dtp = r->drawn_text[row]; drp = r->drawn_rend[row]; #ifndef NO_PIXEL_DROPPING_AVOIDANCE /* * E1: pixel dropping avoidance. Do this before the main refresh on the line. * Require a refresh where pixels may have been dropped into our * area by a neighbour character which has now changed * TODO: this could be integrated into E2 but might be too messy */ # ifdef NO_BOLDFONT wf = r->TermWin.font; # endif for (col = 0; col < r->TermWin.ncol; col++) { unsigned char is_font_char, is_same_char; text_t t; t = dtp[col]; is_same_char = (t == stp[col] && drp[col] == srp[col]); if (!clear_next && (is_same_char || t == 0 /* screen cleared elsewhere */ || t == ' ')) continue; if (clear_next) { /* previous char caused change here */ clear_next = 0; dtp[col] = 0; if (is_same_char) /* don't cascade into next char */ continue; } j = MONO_BOLD(drp[col]) ? 1 : 0; # ifndef NO_BOLDFONT wf = (j && r->TermWin.boldFont) ? r->TermWin.boldFont : r->TermWin.font; # endif /* * TODO: consider if anything special needs to happen with: * #if defined(MULTICHAR_SET) && ! defined(NO_BOLDOVERSTRIKE_MULTI) */ is_font_char = (wf->per_char && IS_FONT_CHAR(wf, t)) ? 1 : 0; if (!is_font_char || FONT_LBEAR(wf, t) < 0) { if (col == 0) clearfirst = 1; else dtp[col - 1] = 0; } if (!is_font_char || (FONT_WIDTH(wf, t) < (FONT_RBEAR(wf, t) + j))) { if (col == r->TermWin.ncol - 1) clearlast = 1; else clear_next = 1; } } #endif /* NO_PIXEL_DROPPING_AVOIDANCE */ /* * E2: OK, now the real pass */ ypixelc = (int)Row2Pixel(row); ypixel = ypixelc + r->TermWin.font->ascent; for (col = 0; col < r->TermWin.ncol; col++) { unsigned char fontdiff,/* current font size != base font size */ fprop; /* proportional font used */ rend_t rend; /* rendition value */ /* compare new text with old - if exactly the same then continue */ rend = srp[col]; /* screen rendition (target rendtion) */ if (stp[col] == dtp[col] /* Must match characters to skip. */ && (rend == drp[col] /* Either rendition the same or */ || (stp[col] == ' ' /* space w/ no background change */ && GET_BGATTR(rend) == GET_BGATTR(drp[col])))) { if (!IS_MULTI1(rend)) continue; #ifdef MULTICHAR_SET else { /* first byte is Kanji so compare second bytes */ if (stp[col + 1] == dtp[col + 1]) { /* assume no corrupt characters on the screen */ col++; continue; } } #endif } /* redraw one or more characters */ fontdiff = 0; len = 0; buffer[len++] = dtp[col] = stp[col]; drp[col] = rend; xpixel = Col2Pixel(col); /* * Find out the longest string we can write out at once */ #ifndef NO_BOLDFONT if (MONO_BOLD(rend) && r->TermWin.boldFont != NULL) fprop = (r->TermWin.propfont & PROPFONT_BOLD); else #endif fprop = (r->TermWin.propfont & PROPFONT_NORMAL); #ifdef MULTICHAR_SET if (IS_MULTI1(rend) && col < r->TermWin.ncol - 1 && IS_MULTI2(srp[col + 1])) { if (!wbyte && r->TermWin.mfont) { wbyte = 1; XSetFont(r->Xdisplay, r->TermWin.gc, r->TermWin.mfont->fid); fontdiff = (r->TermWin.propfont & PROPFONT_MULTI); draw_string = XDrawString16; draw_image_string = XDrawImageString16; } if (r->TermWin.mfont == NULL) { buffer[0] = buffer[1] = ' '; len = 2; col++; } else { /* double stepping - we're in multibyte font mode */ for (; ++col < r->TermWin.ncol;) { /* XXX: could check sanity on 2nd byte */ dtp[col] = stp[col]; drp[col] = srp[col]; buffer[len++] = stp[col]; col++; if (fprop) /* proportional multibyte font mode */ break; if ((col == r->TermWin.ncol) || (srp[col] != rend)) break; if ((stp[col] == dtp[col]) && (srp[col] == drp[col]) && (stp[col + 1] == dtp[col + 1])) break; if (len == h->currmaxcol) break; dtp[col] = stp[col]; drp[col] = srp[col]; buffer[len++] = stp[col]; } col--; } if (buffer[0] & 0x80) (h->multichar_decode)(buffer, len); wlen = len / 2; } else { if (rend & RS_multi1) { /* corrupt character - you're outta there */ rend &= ~RS_multiMask; drp[col] = rend; /* TODO check: may also want */ dtp[col] = ' '; /* to poke into stp/srp */ buffer[0] = ' '; } if (wbyte) { wbyte = 0; XSetFont(r->Xdisplay, r->TermWin.gc, r->TermWin.font->fid); draw_string = XDrawString; draw_image_string = XDrawImageString; } #else { #endif if (!fprop) { /* single stepping - `normal' mode */ for (i = 0; ++col < r->TermWin.ncol - 1;) { if (rend != srp[col]) break; buffer[len++] = stp[col]; if ((stp[col] != dtp[col]) || (srp[col] != drp[col])) { if (must_clear && (i++ > (len / 2))) break; dtp[col] = stp[col]; drp[col] = srp[col]; i = 0; } else if (must_clear || (stp[col] != ' ' && ++i > 32)) break; } col--; /* went one too far. move back */ len -= i; /* dump any matching trailing chars */ } wlen = len; } buffer[len] = '\0'; /* * Determine the attributes for the string */ fore = GET_FGCOLOR(rend); back = GET_BGCOLOR(rend); rend = GET_ATTR(rend); switch (rend & RS_fontMask) { case RS_acsFont: for (i = 0; i < len; i++) if (buffer[i] == 0x5f) buffer[i] = 0x7f; else if (buffer[i] > 0x5f && buffer[i] < 0x7f) buffer[i] -= 0x5f; break; case RS_ukFont: for (i = 0; i < len; i++) if (buffer[i] == '#') buffer[i] = 0x1e; /* pound sign */ break; } rvid = (rend & RS_RVid) ? 1 : 0; #ifdef OPTION_HC if (!rvid && (rend & RS_Blink)) { if (XDEPTH > 2 && ISSET_PIXCOLOR(h, Color_HC) && r->PixColors[fore] != r->PixColors[Color_HC] && r->PixColors[back] != r->PixColors[Color_HC]) back = Color_HC; else rvid = !rvid; /* fall back */ } #endif if (rvid) { #ifdef TTY_256COLOR SWAP_IT(fore, back, u_int16_t); #else SWAP_IT(fore, back, unsigned char); #endif #ifndef NO_BOLD_UNDERLINE_REVERSE if (XDEPTH > 2 && ISSET_PIXCOLOR(h, Color_RV) && r->PixColors[fore] != r->PixColors[Color_RV]) back = Color_RV; #endif } gcmask = 0; if (back != Color_bg) { gcvalue.background = r->PixColors[back]; gcmask = GCBackground; } if (fore != Color_fg) { gcvalue.foreground = r->PixColors[fore]; gcmask |= GCForeground; } #ifndef NO_BOLD_UNDERLINE_REVERSE else if (rend & RS_Bold) { if (XDEPTH > 2 && ISSET_PIXCOLOR(h, Color_BD) && r->PixColors[fore] != r->PixColors[Color_BD] && r->PixColors[back] != r->PixColors[Color_BD]) { gcvalue.foreground = r->PixColors[Color_BD]; gcmask |= GCForeground; # ifndef VERYBOLD rend &= ~RS_Bold; /* we've taken care of it */ # endif } } else if (rend & RS_Uline) { if (XDEPTH > 2 && ISSET_PIXCOLOR(h, Color_UL) && r->PixColors[fore] != r->PixColors[Color_UL] && r->PixColors[back] != r->PixColors[Color_UL]) { gcvalue.foreground = r->PixColors[Color_UL]; gcmask |= GCForeground; rend &= ~RS_Uline; /* we've taken care of it */ } } #endif if (gcmask) XChangeGC(r->Xdisplay, r->TermWin.gc, gcmask, &gcvalue); #ifndef NO_BOLDFONT if (!wbyte && MONO_BOLD_FG(rend, fore) && r->TermWin.boldFont != NULL) { bfont = 1; XSetFont(r->Xdisplay, r->TermWin.gc, r->TermWin.boldFont->fid); fontdiff = (r->TermWin.propfont & PROPFONT_BOLD); rend &= ~RS_Bold; /* we've taken care of it */ } else if (bfont) { bfont = 0; XSetFont(r->Xdisplay, r->TermWin.gc, r->TermWin.font->fid); } #endif /* * Actually do the drawing of the string here */ if (back == Color_bg && must_clear) { CLEAR_CHARS(xpixel, ypixelc, len); for (i = 0; i < len; i++) /* don't draw empty strings */ if (buffer[i] != ' ') { DRAW_STRING(draw_string, xpixel, ypixel, buffer, wlen); break; } } else if (fprop || fontdiff) { /* single glyph writing */ unsigned long gctmp; gctmp = gcvalue.foreground; gcvalue.foreground = gcvalue.background; XChangeGC(r->Xdisplay, r->TermWin.gc, GCForeground, &gcvalue); XFillRectangle(r->Xdisplay, drawBuffer, r->TermWin.gc, xpixel, ypixelc, (unsigned int)Width2Pixel(len), (unsigned int)(Height2Pixel(1) - r->TermWin.lineSpace)); gcvalue.foreground = gctmp; XChangeGC(r->Xdisplay, r->TermWin.gc, GCForeground, &gcvalue); DRAW_STRING(draw_string, xpixel, ypixel, buffer, wlen); } else DRAW_STRING(draw_image_string, xpixel, ypixel, buffer, wlen); #ifndef NO_BOLDOVERSTRIKE # ifdef NO_BOLDOVERSTRIKE_MULTI if (!wbyte) # endif if (MONO_BOLD_FG(rend, fore)) DRAW_STRING(draw_string, xpixel + 1, ypixel, buffer, wlen); #endif if ((rend & RS_Uline) && (r->TermWin.font->descent > 1)) XDrawLine(r->Xdisplay, drawBuffer, r->TermWin.gc, xpixel, ypixel + 1, xpixel + Width2Pixel(len) - 1, ypixel + 1); if (gcmask) { /* restore normal colours */ gcvalue.foreground = r->PixColors[Color_fg]; gcvalue.background = r->PixColors[Color_bg]; XChangeGC(r->Xdisplay, r->TermWin.gc, gcmask, &gcvalue); } } /* for (col....) */ } /* for (row....) */ /* * G: cleanup cursor and display outline cursor in necessary */ if (r->screen.flags & Screen_VisibleCursor) { if (r->TermWin.focus) { srp = &(r->screen.rend[r->screen.cur.row + r->TermWin.saveLines] [r->screen.cur.col]); *srp ^= RS_RVid; #ifndef NO_CURSORCOLOR *srp = (*srp & ~(RS_fgMask | RS_bgMask)) | cc1; #endif #ifdef MULTICHAR_SET if (morecur) { srp += morecur; *srp ^= RS_RVid; # ifndef NO_CURSORCOLOR *srp = (*srp & ~(RS_fgMask | RS_bgMask)) | cc2; # endif } #endif } else if (h->oldcursor.row >= 0) { #ifndef NO_CURSORCOLOR unsigned long gcmask; /* Graphics Context mask */ gcmask = 0; if (XDEPTH > 2 && ISSET_PIXCOLOR(h, Color_cursor)) { gcvalue.foreground = r->PixColors[Color_cursor]; gcmask = GCForeground; XChangeGC(r->Xdisplay, r->TermWin.gc, gcmask, &gcvalue); gcvalue.foreground = r->PixColors[Color_fg]; } #endif XDrawRectangle(r->Xdisplay, drawBuffer, r->TermWin.gc, Col2Pixel(h->oldcursor.col + morecur), Row2Pixel(h->oldcursor.row), (unsigned int)(Width2Pixel(1 + (morecur ? 1 : 0)) - 1), (unsigned int)(Height2Pixel(1) - r->TermWin.lineSpace - 1)); #ifndef NO_CURSORCOLOR if (gcmask) /* restore normal colours */ XChangeGC(r->Xdisplay, r->TermWin.gc, gcmask, &gcvalue); #endif } } /* * H: cleanup selection */ rxvt_scr_reverse_selection(r); /* * I: other general cleanup */ if (clearfirst && r->TermWin.int_bwidth) /* * clear the whole screen height, note that width == 0 is treated * specially by XClearArea */ XClearArea(r->Xdisplay, r->TermWin.vt, 0, 0, (unsigned int)r->TermWin.int_bwidth, (unsigned int)TermWin_TotalHeight(), False); if (clearlast && r->TermWin.int_bwidth) /* * clear the whole screen height, note that width == 0 is treated * specially by XClearArea */ XClearArea(r->Xdisplay, r->TermWin.vt, r->TermWin.width + r->TermWin.int_bwidth, 0, (unsigned int)r->TermWin.int_bwidth, (unsigned int)TermWin_TotalHeight(), False); if (refresh_type & SMOOTH_REFRESH) XSync(r->Xdisplay, False); h->num_scr = 0; h->num_scr_allow = 1; h->want_refresh = 0; /* screen is current */ } /* ------------------------------------------------------------------------- */ /* EXTPROTO */ void rxvt_scr_clear(rxvt_t *r) { if (!r->TermWin.mapped) return; r->h->num_scr_allow = 0; r->h->want_refresh = 1; #ifdef TRANSPARENT if ((r->Options & Opt_transparent) && (r->h->am_pixmap_trans == 0)) { int i; if (!(r->Options & Opt_transparent_all)) i = 0; else i = (int)(sizeof(r->TermWin.parent) / sizeof(Window)); for (; i--;) if (r->TermWin.parent[i] != None) XClearWindow(r->Xdisplay, r->TermWin.parent[i]); } #endif XClearWindow(r->Xdisplay, r->TermWin.vt); } /* ------------------------------------------------------------------------- */ /* INTPROTO */ void rxvt_scr_reverse_selection(rxvt_t *r) { int i, col, row, end_row; rend_t *srp; if (r->selection.op && r->h->current_screen == r->selection.screen) { end_row = r->TermWin.saveLines - r->TermWin.view_start; i = r->selection.beg.row + r->TermWin.saveLines; row = r->selection.end.row + r->TermWin.saveLines; if (i >= end_row) col = r->selection.beg.col; else { col = 0; i = end_row; } end_row += r->TermWin.nrow; for (; i < row && i < end_row; i++, col = 0) for (srp = r->screen.rend[i]; col < r->TermWin.ncol; col++) #ifndef OPTION_HC srp[col] ^= RS_RVid; #else srp[col] ^= RS_Blink; #endif if (i == row && i < end_row) for (srp = r->screen.rend[i]; col < r->selection.end.col; col++) #ifndef OPTION_HC srp[col] ^= RS_RVid; #else srp[col] ^= RS_Blink; #endif } } /* ------------------------------------------------------------------------- */ /* * Dump the whole scrollback and screen to the passed filedescriptor. The * invoking routine must close the fd. */ #if 0 /* EXTPROTO */ void rxvt_scr_dump(rxvt_t *r, int fd) { int row, wrote; unsigned int width, towrite; char r1[] = "\n"; for (row = r->TermWin.saveLines - r->TermWin.nscrolled; row < r->TermWin.saveLines + r->TermWin.nrow - 1; row++) { width = r->screen.tlen[row] >= 0 ? r->screen.tlen[row] : r->TermWin.ncol; for (towrite = width; towrite; towrite -= wrote) { wrote = write(fd, &(r->screen.text[row][width - towrite]), towrite); if (wrote < 0) return; /* XXX: death, no report */ } if (r->screen.tlen[row] >= 0) if (write(fd, r1, 1) <= 0) return; /* XXX: death, no report */ } } #endif /* ------------------------------------------------------------------------- * * CHARACTER SELECTION * * ------------------------------------------------------------------------- */ /* * -r->TermWin.nscrolled <= (selection row) <= r->TermWin.nrow - 1 */ /* EXTPROTO */ void rxvt_selection_check(rxvt_t *r, int check_more) { row_col_t pos; if (!r->selection.op) return; pos.row = pos.col = 0; if ((r->selection.beg.row < -(int32_t)r->TermWin.nscrolled) || (r->selection.beg.row >= r->TermWin.nrow) || (r->selection.mark.row < -(int32_t)r->TermWin.nscrolled) || (r->selection.mark.row >= r->TermWin.nrow) || (r->selection.end.row < -(int32_t)r->TermWin.nscrolled) || (r->selection.end.row >= r->TermWin.nrow) || (check_more == 1 && r->h->current_screen == r->selection.screen && !ROWCOL_IS_BEFORE(r->screen.cur, r->selection.beg) && ROWCOL_IS_BEFORE(r->screen.cur, r->selection.end)) || (check_more == 2 && ROWCOL_IS_BEFORE(r->selection.beg, pos) && ROWCOL_IS_AFTER(r->selection.end, pos)) || (check_more == 3 && ROWCOL_IS_AFTER(r->selection.end, pos)) || (check_more == 4 /* screen width change */ && (r->selection.beg.row != r->selection.end.row || r->selection.end.col > r->TermWin.ncol))) CLEAR_SELECTION(r); } /* ------------------------------------------------------------------------- */ /* * Paste a selection direct to the command fd */ /* INTPROTO */ void rxvt_PasteIt(rxvt_t *r, const unsigned char *data, unsigned int nitems) { unsigned int i, j, n; unsigned char *ds = rxvt_malloc(PROP_SIZE); /* convert normal newline chars into common keyboard Return key sequence */ for (i = 0; i < nitems; i += PROP_SIZE) { n = min(nitems - i, PROP_SIZE); MEMCPY(ds, data + i, n); for (j = 0; j < n; j++) if (ds[j] == '\n') ds[j] = '\r'; rxvt_tt_write(r, ds, (int)n); } free(ds); } /* ------------------------------------------------------------------------- */ /* * Respond to a notification that a primary selection has been sent * EXT: SelectionNotify */ /* EXTPROTO */ int rxvt_selection_paste(rxvt_t *r, Window win, Atom prop, Bool delete_prop) { long nread = 0; unsigned long bytes_after; XTextProperty ct; #ifdef MULTICHAR_SET int dummy_count; char **cl; #endif D_SELECT((stderr, "rxvt_selection_paste(%08lx, %lu, %d), wait=%2x", win, (unsigned long)prop, (int)delete_prop, r->h->selection_wait)); if (prop == None) { /* check for failed XConvertSelection */ #ifdef MULTICHAR_SET if ((r->h->selection_type & Sel_CompoundText)) { int selnum = r->h->selection_type & Sel_whereMask; r->h->selection_type = 0; if (selnum != Sel_direct) rxvt_selection_request_other(r, XA_STRING, selnum); } #endif return 0; } for (;;) { if (XGetWindowProperty(r->Xdisplay, win, prop, (long)(nread / 4), (long)(PROP_SIZE / 4), delete_prop, AnyPropertyType, &ct.encoding, &ct.format, &ct.nitems, &bytes_after, &ct.value) != Success) break; if (ct.encoding == 0) { D_SELECT((stderr, "rxvt_selection_paste: property didn't exist!")); break; } if (ct.value == NULL) { D_SELECT((stderr, "rxvt_selection_paste: property shooting blanks!")); continue; } if (ct.nitems == 0) { D_SELECT((stderr, "rxvt_selection_paste: property empty - also INCR end")); if (r->h->selection_wait == Sel_normal && nread == 0) { /* * pass through again trying CUT_BUFFER0 if we've come from * XConvertSelection() but nothing was presented */ D_SELECT((stderr, "rxvt_selection_request: pasting CUT_BUFFER0")); rxvt_selection_paste(r, Xroot, XA_CUT_BUFFER0, False); } nread = -1; /* discount any previous stuff */ break; } nread += ct.nitems; #ifdef MULTICHAR_SET if (XmbTextPropertyToTextList(r->Xdisplay, &ct, &cl, &dummy_count) == Success && cl) { rxvt_PasteIt(r, cl[0], STRLEN(cl[0])); XFreeStringList(cl); } else #endif rxvt_PasteIt(r, ct.value, (unsigned int)ct.nitems); if (bytes_after == 0) break; XFree(ct.value); } if (ct.value) XFree(ct.value); if (r->h->selection_wait == Sel_normal) r->h->selection_wait = Sel_none; D_SELECT((stderr, "rxvt_selection_paste: bytes written: %ld", nread)); return (int)nread; } /* * INCR support originally provided by Paul Sheer */ /* EXTPROTO */ void rxvt_selection_property(rxvt_t *r, Window win, Atom prop) { int reget_time = 0; if (prop == None) return; D_SELECT((stderr, "rxvt_selection_property(%08lx, %lu)", win, (unsigned long)prop)); if (r->h->selection_wait == Sel_normal) { int a, afmt; Atom atype; unsigned long bytes_after, nitems; unsigned char *s = NULL; a = XGetWindowProperty(r->Xdisplay, win, prop, 0L, 1L, False, r->h->xa[XA_INCR], &atype, &afmt, &nitems, &bytes_after, &s); if (s) XFree(s); if (a != Success) return; #ifndef __CYGWIN32__ if (atype == r->h->xa[XA_INCR]) { /* start an INCR transfer */ D_SELECT((stderr, "rxvt_selection_property: INCR: starting transfer")); XDeleteProperty(r->Xdisplay, win, prop); XFlush(r->Xdisplay); reget_time = 1; r->h->selection_wait = Sel_incr; } #endif } else if (r->h->selection_wait == Sel_incr) { reget_time = 1; if (rxvt_selection_paste(r, win, prop, True) == -1) { D_SELECT((stderr, "rxvt_selection_property: INCR: clean end")); r->h->selection_wait = Sel_none; r->h->timeout[TIMEOUT_INCR].tv_sec = 0; /* turn off timer */ } } if (reget_time) { /* received more data so reget time */ (void)gettimeofday(&(r->h->timeout[TIMEOUT_INCR]), NULL); r->h->timeout[TIMEOUT_INCR].tv_sec += 10; /* ten seconds wait */ } } /* ------------------------------------------------------------------------- */ /* * Request the current selection: * Order: > internal selection if available * > PRIMARY, SECONDARY, CLIPBOARD if ownership is claimed (+) * > CUT_BUFFER0 * (+) if ownership is claimed but property is empty, rxvt_selection_paste() * will auto fallback to CUT_BUFFER0 * EXT: button 2 release */ /* EXTPROTO */ void rxvt_selection_request(rxvt_t *r, Time tm, int x, int y) { D_SELECT((stderr, "rxvt_selection_request(%lu, %d, %d)", tm, x, y)); if (x < 0 || x >= r->TermWin.width || y < 0 || y >= r->TermWin.height) return; /* outside window */ if (r->selection.text != NULL) { /* internal selection */ D_SELECT((stderr, "rxvt_selection_request: pasting internal")); rxvt_PasteIt(r, r->selection.text, r->selection.len); return; } else { int i; r->h->selection_request_time = tm; r->h->selection_wait = Sel_normal; for (i = Sel_Primary; i <= Sel_Clipboard; i++) { #ifdef MULTICHAR_SET r->h->selection_type = Sel_CompoundText; #else r->h->selection_type = 0; #endif if (rxvt_selection_request_other(r, #ifdef MULTICHAR_SET r->h->xa[XA_COMPOUND_TEXT], #else XA_STRING, #endif i)) return; } } r->h->selection_wait = Sel_none; /* don't loop in rxvt_selection_paste() */ D_SELECT((stderr, "rxvt_selection_request: pasting CUT_BUFFER0")); rxvt_selection_paste(r, Xroot, XA_CUT_BUFFER0, False); } /* INTPROTO */ int rxvt_selection_request_other(rxvt_t *r, Atom target, int selnum) { Atom sel; #ifdef DEBUG_SELECT char *debug_xa_names[] = { "PRIMARY", "SECONDARY", "CLIPBOARD" }; #endif r->h->selection_type |= selnum; if (selnum == Sel_Primary) sel = XA_PRIMARY; else if (selnum == Sel_Secondary) sel = XA_SECONDARY; else sel = r->h->xa[XA_CLIPBOARD]; if (XGetSelectionOwner(r->Xdisplay, sel) != None) { D_SELECT((stderr, "rxvt_selection_request_other: pasting %s", debug_xa_names[selnum])); XConvertSelection(r->Xdisplay, sel, target, r->h->xa[XA_VT_SELECTION], r->TermWin.vt, r->h->selection_request_time); return 1; } return 0; } /* ------------------------------------------------------------------------- */ /* * Clear all selected text * EXT: SelectionClear */ /* EXTPROTO */ void rxvt_selection_clear(rxvt_t *r) { D_SELECT((stderr, "rxvt_selection_clear()")); r->h->want_refresh = 1; if (r->selection.text) free(r->selection.text); r->selection.text = NULL; r->selection.len = 0; CLEAR_SELECTION(r); } /* ------------------------------------------------------------------------- */ /* * Copy a selection into the cut buffer * EXT: button 1 or 3 release */ /* EXTPROTO */ void rxvt_selection_make(rxvt_t *r, Time tm) { int i, col, end_col, row, end_row; unsigned char *new_selection_text; char *str; text_t *t; D_SELECT((stderr, "rxvt_selection_make(): r->selection.op=%d, r->selection.clicks=%d", r->selection.op, r->selection.clicks)); switch (r->selection.op) { case SELECTION_CONT: break; case SELECTION_INIT: CLEAR_SELECTION(r); /* FALLTHROUGH */ case SELECTION_BEGIN: r->selection.op = SELECTION_DONE; /* FALLTHROUGH */ default: return; } r->selection.op = SELECTION_DONE; if (r->selection.clicks == 4) return; /* nothing selected, go away */ i = (r->selection.end.row - r->selection.beg.row + 1) * (r->TermWin.ncol + 1) + 1; str = rxvt_malloc(i * sizeof(char)); new_selection_text = (unsigned char *)str; col = r->selection.beg.col; MAX_IT(col, 0); row = r->selection.beg.row + r->TermWin.saveLines; end_row = r->selection.end.row + r->TermWin.saveLines; /* * A: rows before end row */ for (; row < end_row; row++, col = 0) { t = &(r->screen.text[row][col]); if ((end_col = r->screen.tlen[row]) == -1) end_col = r->TermWin.ncol; for (; col < end_col; col++) *str++ = *t++; if (r->screen.tlen[row] != -1) *str++ = '\n'; } /* * B: end row */ t = &(r->screen.text[row][col]); end_col = r->screen.tlen[row]; if (end_col == -1 || r->selection.end.col <= end_col) end_col = r->selection.end.col; MIN_IT(end_col, r->TermWin.ncol); /* CHANGE */ for (; col < end_col; col++) *str++ = *t++; #ifndef NO_OLD_SELECTION if (r->selection_style == OLD_SELECT) if (end_col == r->TermWin.ncol) *str++ = '\n'; #endif #ifndef NO_NEW_SELECTION if (r->selection_style != OLD_SELECT) if (end_col != r->selection.end.col) *str++ = '\n'; #endif *str = '\0'; if ((i = STRLEN((char *)new_selection_text)) == 0) { free(new_selection_text); return; } r->selection.len = i; if (r->selection.text) free(r->selection.text); r->selection.text = new_selection_text; XSetSelectionOwner(r->Xdisplay, XA_PRIMARY, r->TermWin.vt, tm); if (XGetSelectionOwner(r->Xdisplay, XA_PRIMARY) != r->TermWin.vt) rxvt_print_error("can't get primary selection"); XChangeProperty(r->Xdisplay, Xroot, XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace, r->selection.text, (int)r->selection.len); r->h->selection_time = tm; D_SELECT((stderr, "rxvt_selection_make(): r->selection.len=%d", r->selection.len)); } /* ------------------------------------------------------------------------- */ /* * Mark or select text based upon number of clicks: 1, 2, or 3 * EXT: button 1 press */ /* EXTPROTO */ void rxvt_selection_click(rxvt_t *r, int clicks, int x, int y) { D_SELECT((stderr, "rxvt_selection_click(%d, %d, %d)", clicks, x, y)); clicks = ((clicks - 1) % 3) + 1; r->selection.clicks = clicks; /* save clicks so extend will work */ rxvt_selection_start_colrow(r, Pixel2Col(x), Pixel2Row(y)); if (clicks == 2 || clicks == 3) rxvt_selection_extend_colrow(r, r->selection.mark.col, r->selection.mark.row + r->TermWin.view_start, 0, /* button 3 */ 1, /* button press */ 0); /* click change */ } /* ------------------------------------------------------------------------- */ /* * Mark a selection at the specified col/row */ /* INTPROTO */ void rxvt_selection_start_colrow(rxvt_t *r, int col, int row) { r->h->want_refresh = 1; r->selection.mark.col = col; r->selection.mark.row = row - r->TermWin.view_start; MAX_IT(r->selection.mark.row, -(int32_t)r->TermWin.nscrolled); MIN_IT(r->selection.mark.row, r->TermWin.nrow - 1); MAX_IT(r->selection.mark.col, 0); MIN_IT(r->selection.mark.col, r->TermWin.ncol - 1); if (r->selection.op) { /* clear the old selection */ r->selection.beg.row = r->selection.end.row = r->selection.mark.row; r->selection.beg.col = r->selection.end.col = r->selection.mark.col; } r->selection.op = SELECTION_INIT; r->selection.screen = r->h->current_screen; } /* ------------------------------------------------------------------------- */ /* * Word select: select text for 2 clicks * We now only find out the boundary in one direction */ /* what do we want: spaces/tabs are delimiters or cutchars or non-cutchars */ #define DELIMIT_TEXT(x) \ (((x) == ' ' || (x) == '\t') ? 2 : (STRCHR(r->h->rs[Rs_cutchars], (x)) != NULL)) #ifdef MULTICHAR_SET # define DELIMIT_REND(x) (((x) & RS_multiMask) ? 1 : 0) #else # define DELIMIT_REND(x) 1 #endif /* INTPROTO */ void rxvt_selection_delimit_word(rxvt_t *r, enum page_dirn dirn, const row_col_t *mark, row_col_t *ret) { int col, row, dirnadd, tcol, trow, w1, w2; row_col_t bound; text_t *stp; rend_t *srp; if (dirn == UP) { bound.row = r->TermWin.saveLines - r->TermWin.nscrolled - 1; bound.col = 0; dirnadd = -1; } else { bound.row = r->TermWin.saveLines + r->TermWin.nrow; bound.col = r->TermWin.ncol - 1; dirnadd = 1; } row = mark->row + r->TermWin.saveLines; col = mark->col; MAX_IT(col, 0); /* find the edge of a word */ stp = &(r->screen.text[row][col]); w1 = DELIMIT_TEXT(*stp); if (r->selection_style != NEW_SELECT) { if (w1 == 1) { stp += dirnadd; if (DELIMIT_TEXT(*stp) == 1) goto Old_Word_Selection_You_Die; col += dirnadd; } w1 = 0; } srp = (&r->screen.rend[row][col]); w2 = DELIMIT_REND(*srp); for (;;) { for (; col != bound.col; col += dirnadd) { stp += dirnadd; if (DELIMIT_TEXT(*stp) != w1) break; srp += dirnadd; if (DELIMIT_REND(*srp) != w2) break; } if ((col == bound.col) && (row != bound.row)) { if (r->screen.tlen[(row - (dirn == UP ? 1 : 0))] == -1) { trow = row + dirnadd; tcol = dirn == UP ? r->TermWin.ncol - 1 : 0; if (r->screen.text[trow] == NULL) break; stp = &(r->screen.text[trow][tcol]); srp = &(r->screen.rend[trow][tcol]); if (DELIMIT_TEXT(*stp) != w1 || DELIMIT_REND(*srp) != w2) break; row = trow; col = tcol; continue; } } break; } Old_Word_Selection_You_Die: D_SELECT((stderr, "rxvt_selection_delimit_word(%s,...) @ (r:%3d, c:%3d) has boundary (r:%3d, c:%3d)", (dirn == UP ? "up " : "down"), mark->row, mark->col, row - r->TermWin.saveLines, col)); if (dirn == DN) col++; /* put us on one past the end */ /* Poke the values back in */ ret->row = row - r->TermWin.saveLines; ret->col = col; } /* ------------------------------------------------------------------------- */ /* * Extend the selection to the specified x/y pixel location * EXT: button 3 press; button 1 or 3 drag * flag == 0 ==> button 1 * flag == 1 ==> button 3 press * flag == 2 ==> button 3 motion */ /* EXTPROTO */ void rxvt_selection_extend(rxvt_t *r, int x, int y, int flag) { int col, row; col = Pixel2Col(x); row = Pixel2Row(y); MAX_IT(row, 0); MIN_IT(row, r->TermWin.nrow - 1); MAX_IT(col, 0); MIN_IT(col, r->TermWin.ncol); #ifndef NO_NEW_SELECTION /* * If we're selecting characters (single click) then we must check first * if we are at the same place as the original mark. If we are then * select nothing. Otherwise, if we're to the right of the mark, you have to * be _past_ a character for it to be selected. */ if (r->selection_style != OLD_SELECT) { if (((r->selection.clicks % 3) == 1) && !flag && (col == r->selection.mark.col && (row == r->selection.mark.row + r->TermWin.view_start))) { /* select nothing */ r->selection.beg.row = r->selection.end.row = 0; r->selection.beg.col = r->selection.end.col = 0; r->selection.clicks = 4; r->h->want_refresh = 1; D_SELECT((stderr, "rxvt_selection_extend() r->selection.clicks = 4")); return; } } #endif if (r->selection.clicks == 4) r->selection.clicks = 1; rxvt_selection_extend_colrow(r, col, row, !!flag, /* ? button 3 */ flag == 1 ? 1 : 0, /* ? button press */ 0); /* no click change */ } #ifdef MULTICHAR_SET /* INTPROTO */ void rxvt_selection_adjust_kanji(rxvt_t *r) { int c1, r1; if (r->selection.beg.col > 0) { r1 = r->selection.beg.row + r->TermWin.saveLines; c1 = r->selection.beg.col; if (IS_MULTI2(r->screen.rend[r1][c1]) && IS_MULTI1(r->screen.rend[r1][c1 - 1])) r->selection.beg.col--; } if (r->selection.end.col < r->TermWin.ncol) { r1 = r->selection.end.row + r->TermWin.saveLines; c1 = r->selection.end.col; if (IS_MULTI1(r->screen.rend[r1][c1 - 1]) && IS_MULTI2(r->screen.rend[r1][c1])) r->selection.end.col++; } } #endif /* MULTICHAR_SET */ /* ------------------------------------------------------------------------- */ /* * Extend the selection to the specified col/row */ /* INTPROTO */ void rxvt_selection_extend_colrow(rxvt_t *r, int32_t col, int32_t row, int button3, int buttonpress, int clickchange) { int16_t ncol = r->TermWin.ncol; int end_col; row_col_t pos; enum { LEFT, RIGHT } closeto = RIGHT; D_SELECT((stderr, "rxvt_selection_extend_colrow(c:%d, r:%d, %d, %d) clicks:%d, op:%d", col, row, button3, buttonpress, r->selection.clicks, r->selection.op)); D_SELECT((stderr, "rxvt_selection_extend_colrow() ENT b:(r:%d,c:%d) m:(r:%d,c:%d), e:(r:%d,c:%d)", r->selection.beg.row, r->selection.beg.col, r->selection.mark.row, r->selection.mark.col, r->selection.end.row, r->selection.end.col)); r->h->want_refresh = 1; switch (r->selection.op) { case SELECTION_INIT: CLEAR_SELECTION(r); r->selection.op = SELECTION_BEGIN; /* FALLTHROUGH */ case SELECTION_BEGIN: if (row != r->selection.mark.row || col != r->selection.mark.col || (!button3 && buttonpress)) r->selection.op = SELECTION_CONT; break; case SELECTION_DONE: r->selection.op = SELECTION_CONT; /* FALLTHROUGH */ case SELECTION_CONT: break; case SELECTION_CLEAR: rxvt_selection_start_colrow(r, col, row); /* FALLTHROUGH */ default: return; } if (r->selection.beg.col == r->selection.end.col && r->selection.beg.col != r->selection.mark.col && r->selection.beg.row == r->selection.end.row && r->selection.beg.row != r->selection.mark.row) { r->selection.beg.col = r->selection.end.col = r->selection.mark.col; r->selection.beg.row = r->selection.end.row = r->selection.mark.row; D_SELECT((stderr, "rxvt_selection_extend_colrow() ENT2 b:(r:%d,c:%d) m:(r:%d,c:%d), e:(r:%d,c:%d)", r->selection.beg.row, r->selection.beg.col, r->selection.mark.row, r->selection.mark.col, r->selection.end.row, r->selection.end.col)); } pos.col = col; pos.row = row; pos.row -= r->TermWin.view_start; /* adjust for scroll */ #ifndef NO_OLD_SELECTION /* * This mimics some of the selection behaviour of version 2.20 and before. * There are no ``selection modes'', button3 is always character extension. * Note: button3 drag is always available, c.f. v2.20 * Selection always terminates (left or right as appropriate) at the mark. */ if (r->selection_style == OLD_SELECT) { if (r->selection.clicks == 1 || button3) { if (r->h->hate_those_clicks) { r->h->hate_those_clicks = 0; if (r->selection.clicks == 1) { r->selection.beg.row = r->selection.mark.row; r->selection.beg.col = r->selection.mark.col; } else { r->selection.mark.row = r->selection.beg.row; r->selection.mark.col = r->selection.beg.col; } } if (ROWCOL_IS_BEFORE(pos, r->selection.mark)) { r->selection.end.row = r->selection.mark.row; r->selection.end.col = r->selection.mark.col + 1; r->selection.beg.row = pos.row; r->selection.beg.col = pos.col; } else { r->selection.beg.row = r->selection.mark.row; r->selection.beg.col = r->selection.mark.col; r->selection.end.row = pos.row; r->selection.end.col = pos.col + 1; } # ifdef MULTICHAR_SET rxvt_selection_adjust_kanji(r); # endif /* MULTICHAR_SET */ } else if (r->selection.clicks == 2) { rxvt_selection_delimit_word(r, UP, &(r->selection.mark), &(r->selection.beg)); rxvt_selection_delimit_word(r, DN, &(r->selection.mark), &(r->selection.end)); r->h->hate_those_clicks = 1; } else if (r->selection.clicks == 3) { r->selection.beg.row = r->selection.end.row = r->selection.mark.row; r->selection.beg.col = 0; r->selection.end.col = ncol; r->h->hate_those_clicks = 1; } D_SELECT((stderr, "rxvt_selection_extend_colrow() EXIT b:(r:%d,c:%d) m:(r:%d,c:%d), e:(r:%d,c:%d)", r->selection.beg.row, r->selection.beg.col, r->selection.mark.row, r->selection.mark.col, r->selection.end.row, r->selection.end.col)); return; } #endif /* ! NO_OLD_SELECTION */ #ifndef NO_NEW_SELECTION /* selection_style must not be OLD_SELECT to get here */ /* * This is mainly xterm style selection with a couple of differences, mainly * in the way button3 drag extension works. * We're either doing: button1 drag; button3 press; or button3 drag * a) button1 drag : select around a midpoint/word/line - that point/word/line * is always at the left/right edge of the r->selection. * b) button3 press: extend/contract character/word/line at whichever edge of * the selection we are closest to. * c) button3 drag : extend/contract character/word/line - we select around * a point/word/line which is either the start or end of the selection * and it was decided by whichever point/word/line was `fixed' at the * time of the most recent button3 press */ if (button3 && buttonpress) { /* button3 press */ /* * first determine which edge of the selection we are closest to */ if (ROWCOL_IS_BEFORE(pos, r->selection.beg) || (!ROWCOL_IS_AFTER(pos, r->selection.end) && (((pos.col - r->selection.beg.col) + ((pos.row - r->selection.beg.row) * ncol)) < ((r->selection.end.col - pos.col) + ((r->selection.end.row - pos.row) * ncol))))) closeto = LEFT; if (closeto == LEFT) { r->selection.beg.row = pos.row; r->selection.beg.col = pos.col; r->selection.mark.row = r->selection.end.row; r->selection.mark.col = r->selection.end.col - (r->selection.clicks == 2); } else { r->selection.end.row = pos.row; r->selection.end.col = pos.col; r->selection.mark.row = r->selection.beg.row; r->selection.mark.col = r->selection.beg.col; } } else { /* button1 drag or button3 drag */ if (ROWCOL_IS_AFTER(r->selection.mark, pos)) { if ((r->selection.mark.row == r->selection.end.row) && (r->selection.mark.col == r->selection.end.col) && clickchange && r->selection.clicks == 2) r->selection.mark.col--; r->selection.beg.row = pos.row; r->selection.beg.col = pos.col; r->selection.end.row = r->selection.mark.row; r->selection.end.col = r->selection.mark.col + (r->selection.clicks == 2); } else { r->selection.beg.row = r->selection.mark.row; r->selection.beg.col = r->selection.mark.col; r->selection.end.row = pos.row; r->selection.end.col = pos.col; } } if (r->selection.clicks == 1) { end_col = r->screen.tlen[r->selection.beg.row + r->TermWin.saveLines]; if (end_col != -1 && r->selection.beg.col > end_col) { #if 1 r->selection.beg.col = ncol; #else if (r->selection.beg.row != r->selection.end.row) r->selection.beg.col = ncol; else r->selection.beg.col = r->selection.mark.col; #endif } end_col = r->screen.tlen[r->selection.end.row + r->TermWin.saveLines]; if (end_col != -1 && r->selection.end.col > end_col) r->selection.end.col = ncol; # ifdef MULTICHAR_SET rxvt_selection_adjust_kanji(r); # endif /* MULTICHAR_SET */ } else if (r->selection.clicks == 2) { if (ROWCOL_IS_AFTER(r->selection.end, r->selection.beg)) r->selection.end.col--; rxvt_selection_delimit_word(r, UP, &(r->selection.beg), &(r->selection.beg)); rxvt_selection_delimit_word(r, DN, &(r->selection.end), &(r->selection.end)); } else if (r->selection.clicks == 3) { #ifndef NO_FRILLS if ((r->Options & Opt_tripleclickwords)) { int end_row; rxvt_selection_delimit_word(r, UP, &(r->selection.beg), &(r->selection.beg)); end_row = r->screen.tlen[r->selection.mark.row + r->TermWin.saveLines]; for (end_row = r->selection.mark.row; end_row < r->TermWin.nrow; end_row++) { end_col = r->screen.tlen[end_row + r->TermWin.saveLines]; if (end_col != -1) { r->selection.end.row = end_row; r->selection.end.col = end_col; rxvt_selection_remove_trailing_spaces(r); break; } } } else #endif { if (ROWCOL_IS_AFTER(r->selection.mark, r->selection.beg)) r->selection.mark.col++; r->selection.beg.col = 0; r->selection.end.col = ncol; } } if (button3 && buttonpress) { /* mark may need to be changed */ if (closeto == LEFT) { r->selection.mark.row = r->selection.end.row; r->selection.mark.col = r->selection.end.col - (r->selection.clicks == 2); } else { r->selection.mark.row = r->selection.beg.row; r->selection.mark.col = r->selection.beg.col; } } D_SELECT((stderr, "rxvt_selection_extend_colrow() EXIT b:(r:%d,c:%d) m:(r:%d,c:%d), e:(r:%d,c:%d)", r->selection.beg.row, r->selection.beg.col, r->selection.mark.row, r->selection.mark.col, r->selection.end.row, r->selection.end.col)); #endif /* ! NO_NEW_SELECTION */ } #ifndef NO_FRILLS /* INTPROTO */ void rxvt_selection_remove_trailing_spaces(rxvt_t *r) { int32_t end_col, end_row; text_t *stp; end_col = r->selection.end.col; end_row = r->selection.end.row; for ( ; end_row >= r->selection.beg.row; ) { stp = r->screen.text[end_row + r->TermWin.saveLines]; while (--end_col >= 0) { if (stp[end_col] != ' ' && stp[end_col] != '\t') break; } if (end_col >= 0 || r->screen.tlen[end_row - 1 + r->TermWin.saveLines] != -1) { r->selection.end.col = end_col + 1; r->selection.end.row = end_row; break; } end_row--; end_col = r->TermWin.ncol; } if (r->selection.mark.row > r->selection.end.row) { r->selection.mark.row = r->selection.end.row; r->selection.mark.col = r->selection.end.col; } else if (r->selection.mark.row == r->selection.end.row && r->selection.mark.col > r->selection.end.col) r->selection.mark.col = r->selection.end.col; } #endif /* ------------------------------------------------------------------------- */ /* * Double click on button 3 when already selected * EXT: button 3 double click */ /* EXTPROTO */ void rxvt_selection_rotate(rxvt_t *r, int x, int y) { r->selection.clicks = r->selection.clicks % 3 + 1; rxvt_selection_extend_colrow(r, Pixel2Col(x), Pixel2Row(y), 1, 0, 1); } /* ------------------------------------------------------------------------- */ /* * On some systems, the Atom typedef is 64 bits wide. We need to have a type * that is exactly 32 bits wide, because a format of 64 is not allowed by * the X11 protocol. */ typedef CARD32 Atom32; /* ------------------------------------------------------------------------- */ /* * Respond to a request for our current selection * EXT: SelectionRequest */ /* EXTPROTO */ void rxvt_selection_send(rxvt_t *r, const XSelectionRequestEvent *rq) { XSelectionEvent ev; #ifdef USE_XIM Atom32 target_list[4]; #else Atom32 target_list[3]; #endif Atom target; XTextProperty ct; XICCEncodingStyle style; char *cl[2], dummy[1]; ev.type = SelectionNotify; ev.property = None; ev.display = rq->display; ev.requestor = rq->requestor; ev.selection = rq->selection; ev.target = rq->target; ev.time = rq->time; if (rq->target == r->h->xa[XA_TARGETS]) { target_list[0] = (Atom32) r->h->xa[XA_TARGETS]; target_list[1] = (Atom32) XA_STRING; target_list[2] = (Atom32) r->h->xa[XA_TEXT]; #ifdef USE_XIM target_list[3] = (Atom32) r->h->xa[XA_COMPOUND_TEXT]; #endif XChangeProperty(r->Xdisplay, rq->requestor, rq->property, XA_ATOM, (8 * sizeof(target_list[0])), PropModeReplace, (unsigned char *)target_list, (sizeof(target_list) / sizeof(target_list[0]))); ev.property = rq->property; } else if (rq->target == r->h->xa[XA_MULTIPLE]) { /* TODO: Handle MULTIPLE */ } else if (rq->target == r->h->xa[XA_TIMESTAMP] && r->selection.text) { XChangeProperty(r->Xdisplay, rq->requestor, rq->property, XA_INTEGER, (8 * sizeof(Time)), PropModeReplace, (unsigned char *)&r->h->selection_time, 1); ev.property = rq->property; } else if (rq->target == XA_STRING || rq->target == r->h->xa[XA_COMPOUND_TEXT] || rq->target == r->h->xa[XA_TEXT]) { #ifdef USE_XIM short freect = 0; #endif int selectlen; #ifdef USE_XIM if (rq->target != XA_STRING) { target = r->h->xa[XA_COMPOUND_TEXT]; style = (rq->target == r->h->xa[XA_COMPOUND_TEXT]) ? XCompoundTextStyle : XStdICCTextStyle; } else #endif { target = XA_STRING; style = XStringStyle; } if (r->selection.text) { cl[0] = (char *)r->selection.text; selectlen = r->selection.len; } else { cl[0] = dummy; *dummy = '\0'; selectlen = 0; } #ifdef USE_XIM if (XmbTextListToTextProperty(r->Xdisplay, cl, 1, style, &ct) == Success) /* if we failed to convert then send it raw */ freect = 1; else #endif { ct.value = (unsigned char *)cl[0]; ct.nitems = selectlen; } XChangeProperty(r->Xdisplay, rq->requestor, rq->property, target, 8, PropModeReplace, ct.value, (int)ct.nitems); ev.property = rq->property; #ifdef USE_XIM if (freect) XFree(ct.value); #endif } XSendEvent(r->Xdisplay, rq->requestor, False, 0L, (XEvent *)&ev); } /* ------------------------------------------------------------------------- * * MOUSE ROUTINES * * ------------------------------------------------------------------------- */ /* * return col/row values corresponding to x/y pixel values */ /* EXTPROTO */ void rxvt_pixel_position(rxvt_t *r, int *x, int *y) { *x = Pixel2Col(*x); /* MAX_IT(*x, 0); MIN_IT(*x, r->TermWin.ncol - 1); */ *y = Pixel2Row(*y); /* MAX_IT(*y, 0); MIN_IT(*y, r->TermWin.nrow - 1); */ } /* ------------------------------------------------------------------------- */ #ifdef USE_XIM /* EXTPROTO */ void rxvt_setPosition(rxvt_t *r, XPoint *pos) { XWindowAttributes xwa; XGetWindowAttributes(r->Xdisplay, r->TermWin.vt, &xwa); pos->x = Col2Pixel(r->screen.cur.col) + xwa.x; pos->y = Height2Pixel((r->screen.cur.row + 1)) + xwa.y - r->TermWin.lineSpace; } #endif /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- * * DEBUG ROUTINES * * ------------------------------------------------------------------------- */ #if 0 /* INTPROTO */ void rxvt_debug_colors(void) { int color; const char *name[] = { "fg", "bg", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white" }; fprintf(stderr, "Color ( "); if (r->h->rstyle & RS_RVid) fprintf(stderr, "rvid "); if (r->h->rstyle & RS_Bold) fprintf(stderr, "bold "); if (r->h->rstyle & RS_Blink) fprintf(stderr, "blink "); if (r->h->rstyle & RS_Uline) fprintf(stderr, "uline "); fprintf(stderr, "): "); color = GET_FGCOLOR(r->h->rstyle); #ifndef NO_BRIGHTCOLOR if (color >= minBrightCOLOR && color <= maxBrightCOLOR) { color -= (minBrightCOLOR - minCOLOR); fprintf(stderr, "bright "); } #endif fprintf(stderr, "%s on ", name[color]); color = GET_BGCOLOR(r->h->rstyle); #ifndef NO_BRIGHTCOLOR if (color >= minBrightCOLOR && color <= maxBrightCOLOR) { color -= (minBrightCOLOR - minCOLOR); fprintf(stderr, "bright "); } #endif fprintf(stderr, "%s\n", name[color]); } #endif rxvt-2.7.10/src/ptytty.c010064400001440000024000000206400754227756700135760ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: ptytty.c *----------------------------------------------------------------------* * $Id: ptytty.c,v 1.6 2002/09/19 07:40:23 gcw Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1999-2001 Geoff Wing * * 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 of the License, 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. *---------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ /* * Try to be self-contained except for the above autoconfig'd defines */ #include #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #if defined(HAVE_STRING_H) # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #if defined(PTYS_ARE_PTMX) && !defined(__CYGWIN32__) # include /* for I_PUSH */ #endif #ifdef DEBUG_TTY # define D_TTY(x) fprintf x ; fputc('\n', stderr) ; fflush(stderr) #else # define D_TTY(x) #endif /* ------------------------------------------------------------------------- * * GET PSEUDO TELETYPE - MASTER AND SLAVE * * ------------------------------------------------------------------------- */ /* * Returns pty file descriptor, or -1 on failure * If successful, ttydev is set to the name of the slave device. * fd_tty _may_ also be set to an open fd to the slave device */ /* EXTPROTO */ int rxvt_get_pty(int *fd_tty, const char **ttydev) { int pfd; #ifdef PTYS_ARE_OPENPTY char tty_name[sizeof "/dev/pts/????\0"]; if (openpty(&pfd, fd_tty, tty_name, NULL, NULL) != -1) { *ttydev = strdup(tty_name); return pfd; } #endif #ifdef PTYS_ARE__GETPTY *ttydev = _getpty(&pfd, O_RDWR | O_NDELAY | O_NOCTTY, 0622, 0); if (*ttydev != NULL) return pfd; #endif #ifdef PTYS_ARE_GETPTY char *ptydev; while ((ptydev = getpty()) != NULL) if ((pfd = open(ptydev, O_RDWR | O_NOCTTY, 0)) >= 0) { *ttydev = ptydev; return pfd; } #endif #if defined(HAVE_GRANTPT) && defined(HAVE_UNLOCKPT) # if defined(PTYS_ARE_GETPT) || defined(PTYS_ARE_PTMX) { extern char *ptsname(); # ifdef PTYS_ARE_GETPT pfd = getpt(); # else pfd = open("/dev/ptmx", O_RDWR | O_NOCTTY, 0); # endif if (pfd >= 0) { if (grantpt(pfd) == 0 /* change slave permissions */ && unlockpt(pfd) == 0) { /* slave now unlocked */ *ttydev = ptsname(pfd); /* get slave's name */ return pfd; } close(pfd); } } # endif #endif #ifdef PTYS_ARE_PTC if ((pfd = open("/dev/ptc", O_RDWR | O_NOCTTY, 0)) >= 0) { *ttydev = ttyname(pfd); return pfd; } #endif #ifdef PTYS_ARE_CLONE if ((pfd = open("/dev/ptym/clone", O_RDWR | O_NOCTTY, 0)) >= 0) { *ttydev = ptsname(pfd); return pfd; } #endif #ifdef PTYS_ARE_NUMERIC { int idx; char *c1, *c2; char pty_name[] = "/dev/ptyp???"; char tty_name[] = "/dev/ttyp???"; c1 = &(pty_name[sizeof(pty_name) - 4]); c2 = &(tty_name[sizeof(tty_name) - 4]); for (idx = 0; idx < 256; idx++) { sprintf(c1, "%d", idx); sprintf(c2, "%d", idx); if (access(tty_name, F_OK) < 0) { idx = 256; break; } if ((pfd = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { if (access(tty_name, R_OK | W_OK) == 0) { *ttydev = strdup(tty_name); return pfd; } close(pfd); } } } #endif #ifdef PTYS_ARE_SEARCHED { const char *c1, *c2; char pty_name[] = "/dev/pty??"; char tty_name[] = "/dev/tty??"; # ifndef PTYCHAR1 # define PTYCHAR1 "pqrstuvwxyz" # endif # ifndef PTYCHAR2 # define PTYCHAR2 "0123456789abcdef" # endif for (c1 = PTYCHAR1; *c1; c1++) { pty_name[(sizeof(pty_name) - 3)] = tty_name[(sizeof(pty_name) - 3)] = *c1; for (c2 = PTYCHAR2; *c2; c2++) { pty_name[(sizeof(pty_name) - 2)] = tty_name[(sizeof(pty_name) - 2)] = *c2; if ((pfd = open(pty_name, O_RDWR | O_NOCTTY, 0)) >= 0) { if (access(tty_name, R_OK | W_OK) == 0) { *ttydev = strdup(tty_name); return pfd; } close(pfd); } } } } #endif return -1; } /*----------------------------------------------------------------------*/ /* * Returns tty file descriptor, or -1 on failure */ /* EXTPROTO */ int rxvt_get_tty(const char *ttydev) { return open(ttydev, O_RDWR | O_NOCTTY, 0); } /*----------------------------------------------------------------------*/ /* * Make our tty a controlling tty so that /dev/tty points to us */ /* EXTPROTO */ int rxvt_control_tty(int fd_tty, const char *ttydev) { #ifndef __QNX__ int fd; D_TTY((stderr, "rxvt_control_tty(): pid: %d, tty fd: %d, dev: %s", getpid(), fd_tty, ttydev)); /* ---------------------------------------- */ # ifdef HAVE_SETSID setsid(); # endif # if defined(HAVE_SETPGID) setpgid(0, 0); # elif defined(HAVE_SETPGRP) setpgrp(0, 0); # endif /* ---------------------------------------- */ # ifdef TIOCNOTTY fd = open("/dev/tty", O_RDWR | O_NOCTTY); D_TTY((stderr, "rxvt_control_tty(): Voiding tty associations: previous=%s", fd < 0 ? "no" : "yes")); if (fd >= 0) { ioctl(fd, TIOCNOTTY, NULL); /* void tty associations */ close(fd); } # endif /* ---------------------------------------- */ fd = open("/dev/tty", O_RDWR | O_NOCTTY); D_TTY((stderr, "rxvt_control_tty(): /dev/tty has controlling tty? %s", fd < 0 ? "no (good)" : "yes (bad)")); if (fd >= 0) close(fd); /* ouch: still have controlling tty */ /* ---------------------------------------- */ #if defined(PTYS_ARE_PTMX) && defined(I_PUSH) /* * Push STREAMS modules: * ptem: pseudo-terminal hardware emulation module. * ldterm: standard terminal line discipline. * ttcompat: V7, 4BSD and XENIX STREAMS compatibility module. * * After we push the STREAMS modules, the first open() on the slave side * (i.e. the next section between the dashes giving us "tty opened OK") * should make the "ptem" (or "ldterm" depending upon either which OS * version or which set of manual pages you have) module give us a * controlling terminal. We must already have close()d the master side * fd in this child process before we push STREAMS modules on because the * documentation is really unclear about whether it is any close() on * the master side or the last close() - i.e. a proper STREAMS dismantling * close() - on the master side which causes a hang up to be sent * through - Geoff Wing */ # ifdef HAVE_ISASTREAM if (isastream(fd_tty) == 1) # endif { D_TTY((stderr, "rxvt_control_tty(): Pushing STREAMS modules")); ioctl(fd_tty, I_PUSH, "ptem"); ioctl(fd_tty, I_PUSH, "ldterm"); ioctl(fd_tty, I_PUSH, "ttcompat"); } #endif /* ---------------------------------------- */ # if defined(TIOCSCTTY) fd = ioctl(fd_tty, TIOCSCTTY, NULL); D_TTY((stderr, "rxvt_control_tty(): ioctl(..,TIOCSCTTY): %d", fd)); # elif defined(TIOCSETCTTY) fd = ioctl(fd_tty, TIOCSETCTTY, NULL); D_TTY((stderr, "rxvt_control_tty(): ioctl(..,TIOCSETCTTY): %d", fd)); # else fd = open(ttydev, O_RDWR); D_TTY((stderr, "rxvt_control_tty(): tty open%s", fd < 0 ? " failure" : "ed OK")); if (fd >= 0) close(fd); # endif /* ---------------------------------------- */ fd = open("/dev/tty", O_WRONLY); D_TTY((stderr, "rxvt_control_tty(): do we have controlling tty now: %s", fd < 0 ? "no (fatal)" : "yes (good)")); if (fd < 0) return -1; /* fatal */ close(fd); /* ---------------------------------------- */ D_TTY((stderr, "rxvt_control_tty(): tcgetpgrp(): %d getpgrp(): %d", tcgetpgrp(fd_tty), getpgrp())); /* ---------------------------------------- */ #endif /* ! __QNX__ */ return 0; } /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/netdisp.c010064400001440000024000000067760733020615500136610ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: netdisp.c *----------------------------------------------------------------------* * $Id: netdisp.c,v 1.16 2001/07/27 06:38:37 gcw Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1996 Chuck Blake * - original version * Copyright (c) 1997 mj olesen * Copyright (c) 1997,1998 Oezguer Kesim * * 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 of the License, 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. *----------------------------------------------------------------------*/ /*----------------------------------------------------------------------* * support for resolving the actual IP number of the host for remote * DISPLAYs. When the display is local (i.e. :0), we add support for * sending the first non-loopback interface IP number as the DISPLAY * instead of just sending the incorrect ":0". This way telnet/rlogin * shells can actually get the correct information into DISPLAY for * xclients. *----------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #ifdef DISPLAY_IS_IP #include "netdisp.h" /*----------------------------------------------------------------------*/ /* return NULL a pointer to buffer which may be freed */ /* EXTPROTO */ char * rxvt_network_display(const char *display) { char buffer[1024], *rval = NULL; struct ifconf ifc; struct ifreq *ifr; int i, skfd; if (display[0] != ':' && STRNCMP(display, "unix:", 5)) return (char *) display; /* nothing to do */ ifc.ifc_len = sizeof(buffer); /* Get names of all ifaces */ ifc.ifc_buf = buffer; if ((skfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { perror("socket"); return NULL; } if (ioctl(skfd, SIOCGIFCONF, &ifc) < 0) { perror("SIOCGIFCONF"); close(skfd); return NULL; } for (i = 0, ifr = ifc.ifc_req; i < (ifc.ifc_len / sizeof(struct ifreq)); i++, ifr++) { struct ifreq ifr2; STRCPY(ifr2.ifr_name, ifr->ifr_name); if (ioctl(skfd, SIOCGIFADDR, &ifr2) >= 0) { unsigned long addr; struct sockaddr_in *p_addr; p_addr = (struct sockaddr_in *)&(ifr2.ifr_addr); addr = htonl((unsigned long)p_addr->sin_addr.s_addr); /* * not "0.0.0.0" or "127.0.0.1" - so format the address */ if (addr && addr != 0x7F000001) { char *colon = STRCHR(display, ':'); if (colon == NULL) colon = ":0.0"; rval = rxvt_malloc(STRLEN(colon) + 16); sprintf(rval, "%d.%d.%d.%d%s", (int)((addr >> 030) & 0xFF), (int)((addr >> 020) & 0xFF), (int)((addr >> 010) & 0xFF), (int)(addr & 0xFF), colon); break; } } } close(skfd); return rval; } #endif /* DISPLAY_IS_IP */ /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/misc.c010064400001440000024000000241010736077407100131360ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: misc.c *----------------------------------------------------------------------* * $Id: misc.c,v 1.39 2001/10/10 07:17:49 gcw Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1996 mj olesen Queen's Univ at Kingston * Copyright (c) 1997,1998 Oezguer Kesim * Copyright (c) 1998-2000 Geoff Wing * * 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 of the License, 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. *----------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "misc.intpro" /* PROTOS for internal routines */ /* EXTPROTO */ char * rxvt_r_basename(const char *str) { char *base = STRRCHR(str, '/'); return (char *)(base ? base + 1 : str); } /* * Print an error message */ /* EXTPROTO */ void rxvt_print_error(const char *fmt,...) { va_list arg_ptr; va_start(arg_ptr, fmt); fprintf(stderr, APL_NAME ": "); vfprintf(stderr, fmt, arg_ptr); fprintf(stderr, "\n"); va_end(arg_ptr); } /* * check that the first characters of S1 match S2 * * No Match * return: 0 * Match * return: STRLEN (S2) */ /* EXTPROTO */ int rxvt_Str_match(const char *s1, const char *s2) { int n = STRLEN(s2); return ((STRNCMP(s1, s2, n) == 0) ? n : 0); } /* EXTPROTO */ const char * rxvt_Str_skip_space(const char *str) { if (str) while (*str && isspace(*str)) str++; return str; } /* * remove leading/trailing space and strip-off leading/trailing quotes. * in place. */ /* EXTPROTO */ char * rxvt_Str_trim(char *str) { char *r, *s; int n; if (!str || !*str) /* shortcut */ return str; /* skip leading spaces */ for (s = str; *s && isspace(*s); s++) ; /* goto end of string */ for (n = 0, r = s; *r++; n++) ; r -= 2; /* dump return */ if (n > 0 && *r == '\n') n--, r--; /* backtrack along trailing spaces */ for (; n > 0 && isspace(*r); r--, n--) ; /* skip matching leading/trailing quotes */ if (*s == '"' && *r == '"' && n > 1) { s++; n -= 2; } /* copy back over: forwards copy */ for (r = str; n; n--) *r++ = *s++; *r = '\0'; return str; } /* * in-place interpretation of string: * * backslash-escaped: "\a\b\E\e\n\r\t", "\octal" * Ctrl chars: ^@ .. ^_, ^? * * Emacs-style: "M-" prefix * * Also, * "M-x" prefixed strings, append "\r" if needed * "\E]" prefixed strings (XTerm escape sequence) append ST if needed * * returns the converted string length */ /* EXTPROTO */ int rxvt_Str_escaped(char *str) { char ch, *s, *d; int i, num, append = 0; if (!str || !*str) return 0; d = s = str; if (*s == 'M' && s[1] == '-') { /* Emacs convenience, replace leading `M-..' with `\E..' */ *d++ = C0_ESC; s += 2; if (toupper(*s) == 'X') /* append carriage-return for `M-xcommand' */ for (*d++ = 'x', append = '\r', s++; isspace(*s); s++) ; } for (; (ch = *s++);) { if (ch == '\\') { ch = *s++; if (ch >= '0' && ch <= '7') { /* octal */ num = ch - '0'; for (i = 0; i < 2; i++, s++) { ch = *s; if (ch < '0' || ch > '7') break; num = num * 8 + ch - '0'; } ch = (char)num; } else if (ch == 'a') ch = C0_BEL; /* bell */ else if (ch == 'b') ch = C0_BS; /* backspace */ else if (ch == 'E' || ch == 'e') ch = C0_ESC; /* escape */ else if (ch == 'n') ch = '\n'; /* newline */ else if (ch == 'r') ch = '\r'; /* carriage-return */ else if (ch == 't') ch = C0_HT; /* tab */ } else if (ch == '^') { ch = *s++; ch = toupper(ch); ch = (ch == '?' ? 127 : (ch - '@')); } *d++ = ch; } /* ESC] is an XTerm escape sequence, must be terminated */ if (*str == '\0' && str[1] == C0_ESC && str[2] == ']') append = CHAR_ST; /* add trailing character as required */ if (append && d[-1] != append) *d++ = append; *d = '\0'; return (d - str); } /* * Split a comma-separated string into an array, stripping leading and * trailing spaces (and paired quotes) from each entry. Empty strings * are properly returned * Caller should free each entry and array when done */ /* EXTPROTO */ char ** rxvt_splitcommastring(const char *cs) { int l, n, p; const char *s, *t; char **ret; if ((s = cs) == NULL) s = ""; for (n = 1, t = s; *t; t++) if (*t == ',') n++; ret = malloc((n + 1) * sizeof(char *)); ret[n] = NULL; for (l = 0, t = s; l < n; l++) { for ( ; *t && *t != ','; t++) ; p = t - s; ret[l] = malloc(p + 1); strncpy(ret[l], s, p); ret[l][p] = '\0'; rxvt_Str_trim(ret[l]); s = ++t; } return ret; } /*----------------------------------------------------------------------* * file searching */ /* #define DEBUG_SEARCH_PATH */ #if defined (XPM_BACKGROUND) || (MENUBAR_MAX) /* * search for FILE in the current working directory, and within the * colon-delimited PATHLIST, adding the file extension EXT if required. * * FILE is either semi-colon or zero terminated */ /* INTPROTO */ char * rxvt_File_search_path(const char *pathlist, const char *file, const char *ext) { int maxpath, len; const char *p, *path; char name[256]; if (!access(file, R_OK)) /* found (plain name) in current directory */ return STRDUP(file); /* semi-colon delimited */ if ((p = STRCHR(file, ';'))) len = (p - file); else len = STRLEN(file); #ifdef DEBUG_SEARCH_PATH getcwd(name, sizeof(name)); fprintf(stderr, "pwd: \"%s\"\n", name); fprintf(stderr, "find: \"%.*s\"\n", len, file); #endif /* leave room for an extra '/' and trailing '\0' */ maxpath = sizeof(name) - (len + (ext ? STRLEN(ext) : 0) + 2); if (maxpath <= 0) return NULL; /* check if we can find it now */ STRNCPY(name, file, len); name[len] = '\0'; if (!access(name, R_OK)) return STRDUP(name); if (ext) { STRCAT(name, ext); if (!access(name, R_OK)) return STRDUP(name); } for (path = pathlist; path != NULL && *path != '\0'; path = p) { int n; /* colon delimited */ if ((p = STRCHR(path, ':')) == NULL) p = STRCHR(path, '\0'); n = (p - path); if (*p != '\0') p++; if (n > 0 && n <= maxpath) { STRNCPY(name, path, n); if (name[n - 1] != '/') name[n++] = '/'; name[n] = '\0'; STRNCAT(name, file, len); if (!access(name, R_OK)) return STRDUP(name); if (ext) { STRCAT(name, ext); if (!access(name, R_OK)) return STRDUP(name); } } } return NULL; } /* EXTPROTO */ char * rxvt_File_find(const char *file, const char *ext, const char *path) { char *f; if (file == NULL || *file == '\0') return NULL; /* search environment variables here too */ if ((f = rxvt_File_search_path(path, file, ext)) == NULL) #ifdef PATH_ENV if ((f = rxvt_File_search_path(getenv(PATH_ENV), file, ext)) == NULL) #endif f = rxvt_File_search_path(getenv("PATH"), file, ext); #ifdef DEBUG_SEARCH_PATH if (f) fprintf(stderr, "found: \"%s\"\n", f); #endif return f; } #endif /* defined (XPM_BACKGROUND) || (MENUBAR_MAX) */ /*----------------------------------------------------------------------* * miscellaneous drawing routines */ /* * Draw top/left and bottom/right border shadows around windows */ #if defined(RXVT_SCROLLBAR) || defined(MENUBAR) /* EXTPROTO */ void rxvt_Draw_Shadow(Display *Xdisplay, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h) { int shadow; shadow = (w == 0 || h == 0) ? 1 : SHADOW; w += x - 1; h += y - 1; for (; shadow-- > 0; x++, y++, w--, h--) { XDrawLine(Xdisplay, win, topShadow, x, y, w, y); XDrawLine(Xdisplay, win, topShadow, x, y, x, h); XDrawLine(Xdisplay, win, botShadow, w, h, w, y + 1); XDrawLine(Xdisplay, win, botShadow, w, h, x + 1, h); } } #endif /* button shapes */ #ifdef MENUBAR /* EXTPROTO */ void rxvt_Draw_Triangle(Display *Xdisplay, Window win, GC topShadow, GC botShadow, int x, int y, int w, int type) { switch (type) { case 'r': /* right triangle */ XDrawLine(Xdisplay, win, topShadow, x, y, x, y + w); XDrawLine(Xdisplay, win, topShadow, x, y, x + w, y + w / 2); XDrawLine(Xdisplay, win, botShadow, x, y + w, x + w, y + w / 2); break; case 'l': /* left triangle */ XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x + w, y); XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x, y + w / 2); XDrawLine(Xdisplay, win, topShadow, x, y + w / 2, x + w, y); break; case 'd': /* down triangle */ XDrawLine(Xdisplay, win, topShadow, x, y, x + w / 2, y + w); XDrawLine(Xdisplay, win, topShadow, x, y, x + w, y); XDrawLine(Xdisplay, win, botShadow, x + w, y, x + w / 2, y + w); break; case 'u': /* up triangle */ XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x + w / 2, y); XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x, y + w); XDrawLine(Xdisplay, win, topShadow, x, y + w, x + w / 2, y); break; #if 0 case 's': /* square */ XDrawLine(Xdisplay, win, topShadow, x + w, y, x, y); XDrawLine(Xdisplay, win, topShadow, x, y, x, y + w); XDrawLine(Xdisplay, win, botShadow, x, y + w, x + w, y + w); XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x + w, y); break; #endif } } #endif /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/menubar.c010064400001440000024000001457670755031634000136520ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: menubar.c *----------------------------------------------------------------------* * $Id: menubar.c,v 1.56 2002/10/07 14:38:27 gcw Exp $ * * Copyright (c) 1997,1998 mj olesen * * 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 of the License, 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. *----------------------------------------------------------------------* * refer.html (or refer.txt) contains up-to-date documentation. The * summary that appears at the end of this file was taken from there. *----------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #ifdef MENUBAR #include "version.h" #include "menubar.h" #include "menubar.intpro" /* PROTOS for internal routines */ #define Menu_PixelWidth(menu) \ (2 * SHADOW + Width2Pixel ((menu)->width + 3 * HSPACE)) static const struct { const char name; /* (l)eft, (u)p, (d)own, (r)ight */ const unsigned char str[5]; /* str[0] = STRLEN (str+1) */ } Arrows[NARROWS] = { { 'l', "\003\033[D" }, { 'u', "\003\033[A" }, { 'd', "\003\033[B" }, { 'r', "\003\033[C" } }; /*}}} */ /* * find an item called NAME in MENU */ /* INTPROTO */ menuitem_t * rxvt_menuitem_find(const menu_t *menu, const char *name) { menuitem_t *item; #ifdef DEBUG_STRICT assert(name != NULL); assert(menu != NULL); #endif /* find the last item in the menu, this is good for separators */ for (item = menu->tail; item != NULL; item = item->prev) { if (item->entry.type == MenuSubMenu) { if (!STRCMP(name, (item->entry.submenu.menu)->name)) break; } else if ((isSeparator(name) && isSeparator(item->name)) || !STRCMP(name, item->name)) break; } return item; } /* * unlink ITEM from its MENU and free its memory */ /* INTPROTO */ void rxvt_menuitem_free(rxvt_t *r, menu_t *menu, menuitem_t *item) { /* disconnect */ menuitem_t *prev, *next; #ifdef DEBUG_STRICT assert(menu != NULL); #endif prev = item->prev; next = item->next; if (prev != NULL) prev->next = next; if (next != NULL) next->prev = prev; /* new head, tail */ if (menu->tail == item) menu->tail = prev; if (menu->head == item) menu->head = next; switch (item->entry.type) { case MenuAction: case MenuTerminalAction: free(item->entry.action.str); break; case MenuSubMenu: rxvt_menu_delete(r, item->entry.submenu.menu); break; } if (item->name != NULL) free(item->name); if (item->name2 != NULL) free(item->name2); free(item); } /* * sort command vs. terminal actions and * remove the first character of STR if it's '\0' */ /* INTPROTO */ int rxvt_action_type(action_t *action, unsigned char *str) { unsigned int len; #if defined (DEBUG_MENU) || defined (DEBUG_MENUARROWS) len = STRLEN(str); fprintf(stderr, "(len %d) = %s\n", len, str); #else len = rxvt_Str_escaped((char *)str); #endif if (!len) return -1; /* sort command vs. terminal actions */ action->type = MenuAction; if (str[0] == '\0') { /* the functional equivalent: memmove (str, str+1, len); */ unsigned char *dst = (str); unsigned char *src = (str + 1); unsigned char *end = (str + len); while (src <= end) *dst++ = *src++; len--; /* decrement length */ if (str[0] != '\0') action->type = MenuTerminalAction; } action->str = str; action->len = len; return 0; } /* INTPROTO */ int rxvt_action_dispatch(rxvt_t *r, action_t *action) { switch (action->type) { case MenuTerminalAction: rxvt_cmd_write(r, action->str, action->len); break; case MenuAction: rxvt_tt_write(r, action->str, action->len); break; default: return -1; break; } return 0; } /* return the arrow index corresponding to NAME */ /* INTPROTO */ int rxvt_menuarrow_find(char name) { int i; for (i = 0; i < NARROWS; i++) if (name == Arrows[i].name) return i; return -1; } /* free the memory associated with arrow NAME of the current menubar */ /* INTPROTO */ void rxvt_menuarrow_free(rxvt_t *r, char name) { int i; if (name) { i = rxvt_menuarrow_find(name); if (i >= 0) { action_t *act = &(r->h->CurrentBar->arrows[i]); switch (act->type) { case MenuAction: case MenuTerminalAction: free(act->str); act->str = NULL; act->len = 0; break; } act->type = MenuLabel; } } else { for (i = 0; i < NARROWS; i++) rxvt_menuarrow_free(r, Arrows[i].name); } } /* INTPROTO */ void rxvt_menuarrow_add(rxvt_t *r, char *string) { int i; unsigned xtra_len; char *p; struct { char *str; int len; } beg = { NULL, 0 }, end = { NULL, 0 }, *cur, parse[NARROWS]; MEMSET(parse, 0, sizeof(parse)); /* fprintf(stderr, "add arrows = `%s'\n", string); */ for (p = string; p != NULL && *p; string = p) { p = (string + 3); /* fprintf(stderr, "parsing at %s\n", string); */ switch (string[1]) { case 'b': cur = &beg; break; case 'e': cur = &end; break; default: i = rxvt_menuarrow_find(string[1]); if (i >= 0) cur = &(parse[i]); else continue; /* not found */ break; } string = p; cur->str = string; cur->len = 0; if (cur == &end) { p = STRCHR(string, '\0'); } else { char *next = string; while (1) { p = STRCHR(next, '<'); if (p != NULL) { if (p[1] && p[2] == '>') break; /* parsed */ } else { if (beg.str == NULL) /* no end needed */ p = STRCHR(next, '\0'); break; } next = (p + 1); } } if (p == NULL) return; cur->len = (p - string); } #ifdef DEBUG_MENUARROWS cur = &beg; fprintf(stderr, "(len %d) = %.*s\n", cur->len, cur->len, (cur->str ? cur->str : "")); for (i = 0; i < NARROWS; i++) { cur = &(parse[i]); fprintf(stderr, "<%c>(len %d) = %.*s\n", Arrows[i].name, cur->len, cur->len, (cur->str ? cur->str : "")); } cur = &end; fprintf(stderr, "(len %d) = %.*s\n", cur->len, cur->len, (cur->str ? cur->str : "")); #endif xtra_len = (beg.len + end.len); for (i = 0; i < NARROWS; i++) { if (xtra_len || parse[i].len) rxvt_menuarrow_free(r, Arrows[i].name); } for (i = 0; i < NARROWS; i++) { unsigned char *str; unsigned int len; if (!parse[i].len) continue; str = rxvt_malloc(parse[i].len + xtra_len + 1); len = 0; if (beg.len) { STRNCPY(str + len, beg.str, beg.len); len += beg.len; } STRNCPY(str + len, parse[i].str, parse[i].len); len += parse[i].len; if (end.len) { STRNCPY(str + len, end.str, end.len); len += end.len; } str[len] = '\0'; #ifdef DEBUG_MENUARROWS fprintf(stderr, "<%c>(len %d) = %s\n", Arrows[i].name, len, str); #endif if (rxvt_action_type(&(r->h->CurrentBar->arrows[i]), str) < 0) free(str); } } /* INTPROTO */ menuitem_t * rxvt_menuitem_add(menu_t *menu, const char *name, const char *name2, const char *action) { menuitem_t *item; unsigned int len; #ifdef DEBUG_STRICT assert(name != NULL); assert(action != NULL); #endif if (menu == NULL) return NULL; if (isSeparator(name)) { /* add separator, no action */ name = ""; action = ""; } else { /* * add/replace existing menu item */ item = rxvt_menuitem_find(menu, name); if (item != NULL) { if (item->name2 != NULL && name2 != NULL) { free(item->name2); item->len2 = 0; item->name2 = NULL; } switch (item->entry.type) { case MenuAction: case MenuTerminalAction: free(item->entry.action.str); item->entry.action.str = NULL; break; } goto Item_Found; } } /* allocate a new itemect */ item = (menuitem_t *) rxvt_malloc(sizeof(menuitem_t)); item->len2 = 0; item->name2 = NULL; len = STRLEN(name); item->name = rxvt_malloc(len + 1); STRCPY(item->name, name); if (name[0] == '.' && name[1] != '.') len = 0; /* hidden menu name */ item->len = len; /* add to tail of list */ item->prev = menu->tail; item->next = NULL; if (menu->tail != NULL) (menu->tail)->next = item; menu->tail = item; /* fix head */ if (menu->head == NULL) menu->head = item; /* * add action */ Item_Found: if (name2 != NULL && item->name2 == NULL) { len = STRLEN(name2); if (len == 0) item->name2 = NULL; else { item->name2 = rxvt_malloc(len + 1); STRCPY(item->name2, name2); } item->len2 = len; } item->entry.type = MenuLabel; len = STRLEN(action); if (len == 0 && item->name2 != NULL) { action = item->name2; len = item->len2; } if (len) { unsigned char *str = rxvt_malloc(len + 1); STRCPY(str, action); if (rxvt_action_type(&(item->entry.action), str) < 0) free(str); } /* new item and a possible increase in width */ if (menu->width < (item->len + item->len2)) menu->width = (item->len + item->len2); return item; } /* * search for the base starting menu for NAME. * return a pointer to the portion of NAME that remains */ /* INTPROTO */ char * rxvt_menu_find_base(rxvt_t *r, menu_t **menu, char *path) { menu_t *m = NULL; menuitem_t *item; #ifdef DEBUG_STRICT assert(menu != NULL); assert(r->h->CurrentBar != NULL); #endif if (path[0] == '\0') return path; if (STRCHR(path, '/') != NULL) { char *p = path; while ((p = STRCHR(p, '/')) != NULL) { p++; if (*p == '/') path = p; } if (path[0] == '/') { path++; *menu = NULL; } while ((p = STRCHR(path, '/')) != NULL) { p[0] = '\0'; if (path[0] == '\0') return NULL; if (!STRCMP(path, DOT)) { /* nothing to do */ } else if (!STRCMP(path, DOTS)) { if (*menu != NULL) *menu = (*menu)->parent; } else { path = rxvt_menu_find_base(r, menu, path); if (path[0] != '\0') { /* not found */ p[0] = '/'; /* fix-up name again */ return path; } } path = (p + 1); } } if (!STRCMP(path, DOTS)) { path += STRLEN(DOTS); if (*menu != NULL) *menu = (*menu)->parent; return path; } /* find this menu */ if (*menu == NULL) { for (m = r->h->CurrentBar->tail; m != NULL; m = m->prev) { if (!STRCMP(path, m->name)) break; } } else { /* find this menu */ for (item = (*menu)->tail; item != NULL; item = item->prev) { if (item->entry.type == MenuSubMenu && !STRCMP(path, (item->entry.submenu.menu)->name)) { m = (item->entry.submenu.menu); break; } } } if (m != NULL) { *menu = m; path += STRLEN(path); } return path; } /* * delete this entire menu */ /* INTPROTO */ menu_t * rxvt_menu_delete(rxvt_t *r, menu_t *menu) { menu_t *parent = NULL, *prev, *next; menuitem_t *item; bar_t *CurrentBar = r->h->CurrentBar; #ifdef DEBUG_STRICT assert(CurrentBar != NULL); #endif /* delete the entire menu */ if (menu == NULL) return NULL; parent = menu->parent; /* unlink MENU */ prev = menu->prev; next = menu->next; if (prev != NULL) prev->next = next; if (next != NULL) next->prev = prev; /* fix the index */ if (parent == NULL) { const int len = (menu->len + HSPACE); if (CurrentBar->tail == menu) CurrentBar->tail = prev; if (CurrentBar->head == menu) CurrentBar->head = next; for (next = menu->next; next != NULL; next = next->next) next->x -= len; } else { for (item = parent->tail; item != NULL; item = item->prev) { if (item->entry.type == MenuSubMenu && item->entry.submenu.menu == menu) { item->entry.submenu.menu = NULL; rxvt_menuitem_free(r, menu->parent, item); break; } } } item = menu->tail; while (item != NULL) { menuitem_t *p = item->prev; rxvt_menuitem_free(r, menu, item); item = p; } if (menu->name != NULL) free(menu->name); free(menu); return parent; } /* INTPROTO */ menu_t * rxvt_menu_add(rxvt_t *r, menu_t *parent, char *path) { menu_t *menu; bar_t *CurrentBar = r->h->CurrentBar; #ifdef DEBUG_STRICT assert(CurrentBar != NULL); #endif if (STRCHR(path, '/') != NULL) { char *p; if (path[0] == '/') { /* shouldn't happen */ path++; parent = NULL; } while ((p = STRCHR(path, '/')) != NULL) { p[0] = '\0'; if (path[0] == '\0') return NULL; parent = rxvt_menu_add(r, parent, path); path = (p + 1); } } if (!STRCMP(path, DOTS)) return (parent != NULL ? parent->parent : parent); if (!STRCMP(path, DOT) || path[0] == '\0') return parent; /* allocate a new menu */ menu = (menu_t *) rxvt_malloc(sizeof(menu_t)); menu->width = 0; menu->parent = parent; menu->len = STRLEN(path); menu->name = rxvt_malloc((menu->len + 1)); STRCPY(menu->name, path); /* initialize head/tail */ menu->head = menu->tail = NULL; menu->prev = menu->next = NULL; menu->win = None; menu->x = menu->y = menu->w = menu->h = 0; menu->item = NULL; /* add to tail of list */ if (parent == NULL) { menu->prev = CurrentBar->tail; if (CurrentBar->tail != NULL) CurrentBar->tail->next = menu; CurrentBar->tail = menu; if (CurrentBar->head == NULL) CurrentBar->head = menu; /* fix head */ if (menu->prev) menu->x = (menu->prev->x + menu->prev->len + HSPACE); } else { menuitem_t *item; item = rxvt_menuitem_add(parent, path, "", ""); if (item == NULL) { free(menu); return parent; } #ifdef DEBUG_STRICT assert(item->entry.type == MenuLabel); #endif item->entry.type = MenuSubMenu; item->entry.submenu.menu = menu; } return menu; } /* INTPROTO */ void rxvt_drawbox_menubar(rxvt_t *r, int x, int len, int state) { GC top, bot; x = Width2Pixel(x); len = Width2Pixel(len + HSPACE); if (x >= r->TermWin.width) return; else if (x + len >= r->TermWin.width) len = (TermWin_TotalWidth() - x); #ifdef MENUBAR_SHADOW_IN state = -state; #endif switch (state) { case +1: top = r->h->topShadowGC; bot = r->h->botShadowGC; break; /* SHADOW_OUT */ case -1: top = r->h->botShadowGC; bot = r->h->topShadowGC; break; /* SHADOW_IN */ default: top = bot = r->h->scrollbarGC; break; /* neutral */ } rxvt_Draw_Shadow(r->Xdisplay, r->menuBar.win, top, bot, x, 0, len, menuBar_TotalHeight()); } /* INTPROTO */ void rxvt_drawtriangle(rxvt_t *r, int x, int y, int state) { GC top, bot; int w; #ifdef MENU_SHADOW_IN state = -state; #endif switch (state) { case +1: top = r->h->topShadowGC; bot = r->h->botShadowGC; break; /* SHADOW_OUT */ case -1: top = r->h->botShadowGC; bot = r->h->topShadowGC; break; /* SHADOW_IN */ default: top = bot = r->h->scrollbarGC; break; /* neutral */ } w = Height2Pixel(1) - 2 * SHADOW; x -= SHADOW + (3 * w / 2); y += SHADOW * 3; rxvt_Draw_Triangle(r->Xdisplay, r->h->ActiveMenu->win, top, bot, x, y, w, 'r'); } /* INTPROTO */ void rxvt_drawbox_menuitem(rxvt_t *r, int y, int state) { GC top, bot; #ifdef MENU_SHADOW_IN state = -state; #endif switch (state) { case +1: top = r->h->topShadowGC; bot = r->h->botShadowGC; break; /* SHADOW_OUT */ case -1: top = r->h->botShadowGC; bot = r->h->topShadowGC; break; /* SHADOW_IN */ default: top = bot = r->h->scrollbarGC; break; /* neutral */ } rxvt_Draw_Shadow(r->Xdisplay, r->h->ActiveMenu->win, top, bot, SHADOW + 0, SHADOW + y, r->h->ActiveMenu->w - 2 * (SHADOW), HEIGHT_TEXT + 2 * SHADOW); XFlush(r->Xdisplay); } #ifdef DEBUG_MENU_LAYOUT /* INTPROTO */ void rxvt_print_menu_ancestors(menu_t *menu) { if (menu == NULL) { fprintf(stderr, "Top Level menu\n"); return; } fprintf(stderr, "menu %s ", menu->name); if (menu->parent != NULL) { menuitem_t *item; for (item = menu->parent->head; item != NULL; item = item->next) { if (item->entry.type == MenuSubMenu && item->entry.submenu.menu == menu) { break; } } if (item == NULL) { fprintf(stderr, "is an orphan!\n"); return; } } fprintf(stderr, "\n"); rxvt_print_menu_ancestors(menu->parent); } /* INTPROTO */ void rxvt_print_menu_descendants(menu_t *menu) { menuitem_t *item; menu_t *parent; int i, level = 0; parent = menu; do { level++; parent = parent->parent; } while (parent != NULL); for (i = 0; i < level; i++) fprintf(stderr, ">"); fprintf(stderr, "%s\n", menu->name); for (item = menu->head; item != NULL; item = item->next) { if (item->entry.type == MenuSubMenu) { if (item->entry.submenu.menu == NULL) fprintf(stderr, "> %s == NULL\n", item->name); else rxvt_print_menu_descendants(item->entry.submenu.menu); } else { for (i = 0; i < level; i++) fprintf(stderr, "+"); if (item->entry.type == MenuLabel) fprintf(stderr, "label: "); fprintf(stderr, "%s\n", item->name); } } for (i = 0; i < level; i++) fprintf(stderr, "<"); fprintf(stderr, "\n"); } #endif /* pop up/down the current menu and redraw the menuBar button */ /* INTPROTO */ void rxvt_menu_show(rxvt_t *r) { int x, y, xright; menu_t *ActiveMenu = r->h->ActiveMenu; menuitem_t *item; if (ActiveMenu == NULL) return; x = ActiveMenu->x; if (ActiveMenu->parent == NULL) { register int h; rxvt_drawbox_menubar(r, x, ActiveMenu->len, -1); x = Width2Pixel(x); ActiveMenu->y = 1; ActiveMenu->w = Menu_PixelWidth(ActiveMenu); if ((x + ActiveMenu->w) >= r->TermWin.width) x = (TermWin_TotalWidth() - ActiveMenu->w); /* find the height */ for (h = 0, item = ActiveMenu->head; item != NULL; item = item->next) h += isSeparator(item->name) ? HEIGHT_SEPARATOR : HEIGHT_TEXT + 2 * SHADOW; ActiveMenu->h = h + 2 * SHADOW; } if (ActiveMenu->win == None) { ActiveMenu->win = XCreateSimpleWindow(r->Xdisplay, r->TermWin.vt, x, ActiveMenu->y, ActiveMenu->w, ActiveMenu->h, 0, r->PixColors[Color_fg], r->PixColors[Color_scroll]); XMapWindow(r->Xdisplay, ActiveMenu->win); } rxvt_Draw_Shadow(r->Xdisplay, ActiveMenu->win, r->h->topShadowGC, r->h->botShadowGC, 0, 0, ActiveMenu->w, ActiveMenu->h); /* determine the correct right-alignment */ for (xright = 0, item = ActiveMenu->head; item != NULL; item = item->next) if (item->len2 > xright) xright = item->len2; for (y = 0, item = ActiveMenu->head; item != NULL; item = item->next) { const int xoff = (SHADOW + Width2Pixel(HSPACE) / 2); register int h; GC gc = r->h->menubarGC; if (isSeparator(item->name)) { rxvt_Draw_Shadow(r->Xdisplay, ActiveMenu->win, r->h->topShadowGC, r->h->botShadowGC, SHADOW, y + SHADOW + 1, ActiveMenu->w - 2 * SHADOW, 0); h = HEIGHT_SEPARATOR; } else { char *name = item->name; int len = item->len; if (item->entry.type == MenuLabel) { gc = r->h->botShadowGC; } else if (item->entry.type == MenuSubMenu) { int x1, y1; menuitem_t *it; menu_t *menu = item->entry.submenu.menu; rxvt_drawtriangle(r, ActiveMenu->w, y, +1); name = menu->name; len = menu->len; y1 = ActiveMenu->y + y; menu->w = Menu_PixelWidth(menu); /* place sub-menu at midpoint of parent menu */ x1 = ActiveMenu->w / 2; if (x1 > menu->w) /* right-flush menu if too small */ x1 += (x1 - menu->w); x1 += x; /* find the height of this submenu */ for (h = 0, it = menu->head; it != NULL; it = it->next) h += isSeparator(it->name) ? HEIGHT_SEPARATOR : HEIGHT_TEXT + 2 * SHADOW; menu->h = h + 2 * SHADOW; /* ensure menu is in window limits */ if ((x1 + menu->w) >= r->TermWin.width) x1 = (TermWin_TotalWidth() - menu->w); if ((y1 + menu->h) >= r->TermWin.height) y1 = (TermWin_TotalHeight() - menu->h); menu->x = (x1 < 0 ? 0 : x1); menu->y = (y1 < 0 ? 0 : y1); } else if (item->name2 && !STRCMP(name, item->name2)) name = NULL; if (len && name) { #ifdef USE_XIM if (r->TermWin.fontset) XmbDrawString(r->Xdisplay, ActiveMenu->win, r->TermWin.fontset, gc, xoff, 2 * SHADOW + y + r->TermWin.font->ascent + 1, name, len); else #endif XDrawString(r->Xdisplay, ActiveMenu->win, gc, xoff, 2 * SHADOW + y + r->TermWin.font->ascent + 1, name, len); } len = item->len2; name = item->name2; if (len && name) { #ifdef USE_XIM if (r->TermWin.fontset) XmbDrawString(r->Xdisplay, ActiveMenu->win, r->TermWin.fontset, gc, ActiveMenu->w - (xoff + Width2Pixel(xright)), 2 * SHADOW + y + r->TermWin.font->ascent + 1, name, len); else #endif XDrawString(r->Xdisplay, ActiveMenu->win, gc, ActiveMenu->w - (xoff + Width2Pixel(xright)), 2 * SHADOW + y + r->TermWin.font->ascent + 1, name, len); } h = HEIGHT_TEXT + 2 * SHADOW; } y += h; } } /* INTPROTO */ void rxvt_menu_display(rxvt_t *r, void (*update)(rxvt_t *)) { menu_t *ActiveMenu = r->h->ActiveMenu; if (ActiveMenu == NULL) return; if (ActiveMenu->win != None) XDestroyWindow(r->Xdisplay, ActiveMenu->win); ActiveMenu->win = None; ActiveMenu->item = NULL; if (ActiveMenu->parent == NULL) rxvt_drawbox_menubar(r, ActiveMenu->x, ActiveMenu->len, +1); r->h->ActiveMenu = ActiveMenu->parent; update(r); } /* INTPROTO */ void rxvt_menu_hide_all(rxvt_t *r) { rxvt_menu_display(r, rxvt_menu_hide_all); } /* INTPROTO */ void rxvt_menu_hide(rxvt_t *r) { rxvt_menu_display(r, rxvt_menu_show); } /* INTPROTO */ void rxvt_menu_clear(rxvt_t *r, menu_t *menu) { if (menu != NULL) { menuitem_t *item = menu->tail; while (item != NULL) { rxvt_menuitem_free(r, menu, item); /* it didn't get freed ... why? */ if (item == menu->tail) return; item = menu->tail; } menu->width = 0; } } /* INTPROTO */ void rxvt_menubar_clear(rxvt_t *r) { bar_t *CurrentBar = r->h->CurrentBar; if (CurrentBar != NULL) { menu_t *menu = CurrentBar->tail; while (menu != NULL) { menu_t *prev = menu->prev; rxvt_menu_delete(r, menu); menu = prev; } CurrentBar->head = CurrentBar->tail = NULL; if (CurrentBar->title) { free(CurrentBar->title); CurrentBar->title = NULL; } rxvt_menuarrow_free(r, 0); /* remove all arrow functions */ } r->h->ActiveMenu = NULL; } #if (MENUBAR_MAX > 1) /* find if menu already exists */ /* INTPROTO */ bar_t * rxvt_menubar_find(rxvt_t *r, const char *name) { bar_t *bar = r->h->CurrentBar; #ifdef DEBUG_MENUBAR_STACKING fprintf(stderr, "looking for [menu:%s] ...", name ? name : "(nil)"); #endif if (bar == NULL || name == NULL) return NULL; if (STRLEN(name) && STRCMP(name, "*")) { do { if (!STRCMP(bar->name, name)) { #ifdef DEBUG_MENUBAR_STACKING fprintf(stderr, " found!\n"); #endif return bar; } bar = bar->next; } while (bar != r->h->CurrentBar); bar = NULL; } #ifdef DEBUG_MENUBAR_STACKING fprintf(stderr, "%s found!\n", (bar ? "" : " NOT")); #endif return bar; } /* INTPROTO */ int rxvt_menubar_push(rxvt_t *r, const char *name) { int ret = 1; bar_t *bar; if (r->h->CurrentBar == NULL) { /* allocate first one */ bar = (bar_t *) rxvt_malloc(sizeof(bar_t)); MEMSET(bar, 0, sizeof(bar_t)); /* circular linked-list */ bar->next = bar->prev = bar; bar->head = bar->tail = NULL; bar->title = NULL; r->h->CurrentBar = bar; r->h->Nbars++; rxvt_menubar_clear(r); } else { /* find if menu already exists */ bar = rxvt_menubar_find(r, name); if (bar != NULL) { /* found it, use it */ r->h->CurrentBar = bar; } else { /* create if needed, or reuse the existing empty menubar */ if (r->h->CurrentBar->head != NULL) { /* need to malloc another one */ if (r->h->Nbars < MENUBAR_MAX) bar = (bar_t *) rxvt_malloc(sizeof(bar_t)); else bar = NULL; /* malloc failed or too many menubars, reuse another */ if (bar == NULL) { bar = r->h->CurrentBar->next; ret = -1; } else { bar->head = bar->tail = NULL; bar->title = NULL; bar->next = r->h->CurrentBar->next; r->h->CurrentBar->next = bar; bar->prev = r->h->CurrentBar; bar->next->prev = bar; r->h->Nbars++; } r->h->CurrentBar = bar; } rxvt_menubar_clear(r); } } /* give menubar this name */ STRNCPY(r->h->CurrentBar->name, name, MAXNAME); r->h->CurrentBar->name[MAXNAME - 1] = '\0'; return ret; } /* switch to a menu called NAME and remove it */ /* INTPROTO */ void rxvt_menubar_remove(rxvt_t *r, const char *name) { bar_t *bar; if ((bar = rxvt_menubar_find(r, name)) == NULL) return; r->h->CurrentBar = bar; do { rxvt_menubar_clear(r); /* * pop a menubar, clean it up first */ if (r->h->CurrentBar != NULL) { bar_t *prev = r->h->CurrentBar->prev; bar_t *next = r->h->CurrentBar->next; if (prev == next && prev == r->h->CurrentBar) { /* only 1 left */ prev = NULL; r->h->Nbars = 0; /* safety */ } else { next->prev = prev; prev->next = next; r->h->Nbars--; } free(r->h->CurrentBar); r->h->CurrentBar = prev; } } while (r->h->CurrentBar && !STRCMP(name, "*")); } /* INTPROTO */ void rxvt_action_decode(FILE *fp, action_t *act) { unsigned char *str; short len; if (act == NULL || (len = act->len) == 0 || (str = act->str) == NULL) return; if (act->type == MenuTerminalAction) { fprintf(fp, "^@"); /* can strip trailing ^G from XTerm sequence */ if (str[0] == C0_ESC && str[1] == ']' && str[len - 1] == C0_BEL) len--; } else if (str[0] == C0_ESC) { switch (str[1]) { case '[': case ']': break; case 'x': /* can strip trailing '\r' from M-x sequence */ if (str[len - 1] == '\r') len--; /* FALLTHROUGH */ default: fprintf(fp, "M-"); /* meta prefix */ str++; len--; break; } } /* * control character form is preferred, since backslash-escaping * can be really ugly looking when the backslashes themselves also * have to be escaped to avoid Shell (or whatever scripting * language) interpretation */ while (len > 0) { unsigned char ch = *str++; switch (ch) { case C0_ESC: fprintf(fp, "\\E"); break; /* escape */ case '\r': fprintf(fp, "\\r"); break; /* carriage-return */ case '\\': fprintf(fp, "\\\\"); break; /* backslash */ case '^': fprintf(fp, "\\^"); break; /* caret */ case 127: fprintf(fp, "^?"); default: if (ch <= 31) fprintf(fp, "^%c", ('@' + ch)); else if (ch > 127) fprintf(fp, "\\%o", ch); else fprintf(fp, "%c", ch); break; } len--; } fprintf(fp, "\n"); } /* INTPROTO */ void rxvt_menu_dump(FILE *fp, menu_t *menu) { menuitem_t *item; /* create a new menu and clear it */ fprintf(fp, (menu->parent ? "./%s/*\n" : "/%s/*\n"), menu->name); for (item = menu->head; item != NULL; item = item->next) { switch (item->entry.type) { case MenuSubMenu: if (item->entry.submenu.menu == NULL) fprintf(fp, "> %s == NULL\n", item->name); else rxvt_menu_dump(fp, item->entry.submenu.menu); break; case MenuLabel: fprintf(fp, "{%s}\n", (STRLEN(item->name) ? item->name : "-")); break; case MenuTerminalAction: case MenuAction: fprintf(fp, "{%s}", item->name); if (item->name2 != NULL && STRLEN(item->name2)) fprintf(fp, "{%s}", item->name2); fprintf(fp, "\t"); rxvt_action_decode(fp, &(item->entry.action)); break; } } fprintf(fp, (menu->parent ? "../\n" : "/\n\n")); } /* INTPROTO */ void rxvt_menubar_dump(rxvt_t *r, FILE *fp) { bar_t *bar = r->h->CurrentBar; time_t t; if (bar == NULL || fp == NULL) return; time(&t); fprintf(fp, "# " APL_SUBCLASS " (%s) Pid: %u\n# Date: %s\n\n", r->h->rs[Rs_name], (unsigned int)getpid(), ctime(&t)); /* dump in reverse order */ bar = r->h->CurrentBar->prev; do { menu_t *menu; int i; fprintf(fp, "[menu:%s]\n", bar->name); if (bar->title != NULL) fprintf(fp, "[title:%s]\n", bar->title); for (i = 0; i < NARROWS; i++) { switch (bar->arrows[i].type) { case MenuTerminalAction: case MenuAction: fprintf(fp, "<%c>", Arrows[i].name); rxvt_action_decode(fp, &(bar->arrows[i])); break; } } fprintf(fp, "\n"); for (menu = bar->head; menu != NULL; menu = menu->next) rxvt_menu_dump(fp, menu); fprintf(fp, "\n[done:%s]\n\n", bar->name); bar = bar->prev; } while (bar != r->h->CurrentBar->prev); } #endif /* (MENUBAR_MAX > 1) */ /* * read in menubar commands from FILENAME * ignore all input before the tag line [menu] or [menu:???] * * Note that since File_find () is used, FILENAME can be semi-colon * delimited such that the second part can refer to a tag * so that a large `database' of menus can be collected together * * FILENAME = "file" * FILENAME = "file;" * read `file' starting with first [menu] or [menu:???] line * * FILENAME = "file;tag" * read `file' starting with [menu:tag] */ /* EXTPROTO */ void rxvt_menubar_read(rxvt_t *r, const char *filename) { /* read in a menu from a file */ FILE *fp; char buffer[256]; char *p, *file, *tag = NULL; file = (char *)rxvt_File_find(filename, ".menu", r->h->rs[Rs_path]); if (file == NULL) return; fp = fopen(file, "rb"); free(file); if (fp == NULL) return; #if (MENUBAR_MAX > 1) /* semi-colon delimited */ if ((tag = STRCHR(filename, ';')) != NULL) { tag++; if (*tag == '\0') tag = NULL; } #endif /* (MENUBAR_MAX > 1) */ #ifdef DEBUG_MENU fprintf(stderr, "[read:%s]\n", p); if (tag) fprintf(stderr, "looking for [menu:%s]\n", tag); #endif while ((p = fgets(buffer, sizeof(buffer), fp)) != NULL) { int n; if ((n = rxvt_Str_match(p, "[menu")) != 0) { if (tag) { /* looking for [menu:tag] */ if (p[n] == ':' && p[n + 1] != ']') { n++; n += rxvt_Str_match(p + n, tag); if (p[n] == ']') { #ifdef DEBUG_MENU fprintf(stderr, "[menu:%s]\n", tag); #endif break; } } } else if (p[n] == ':' || p[n] == ']') break; } } /* found [menu], [menu:???] tag */ while (p != NULL) { int n; #ifdef DEBUG_MENU fprintf(stderr, "read line = %s\n", p); #endif /* looking for [done:tag] or [done:] */ if ((n = rxvt_Str_match(p, "[done")) != 0) { if (p[n] == ']') { r->h->menu_readonly = 1; break; } else if (p[n] == ':') { n++; if (p[n] == ']') { r->h->menu_readonly = 1; break; } else if (tag) { n += rxvt_Str_match(p + n, tag); if (p[n] == ']') { #ifdef DEBUG_MENU fprintf(stderr, "[done:%s]\n", tag); #endif r->h->menu_readonly = 1; break; } } else { /* what? ... skip this line */ p[0] = COMMENT_CHAR; } } } /* * remove leading/trailing space * and strip-off leading/trailing quotes * skip blank or comment lines */ rxvt_Str_trim(p); if (*p && *p != '#') { r->h->menu_readonly = 0; /* if case we read another file */ rxvt_menubar_dispatch(r, p); } /* get another line */ p = fgets(buffer, sizeof(buffer), fp); } fclose(fp); } /* * user interface for building/deleting and otherwise managing menus */ /* EXTPROTO */ void rxvt_menubar_dispatch(rxvt_t *r, char *str) { int n, cmd; char *path, *name, *name2; if (menubar_visible(r) && r->h->ActiveMenu != NULL) rxvt_menubar_expose(r); else r->h->ActiveMenu = NULL; cmd = *str; switch (cmd) { case '.': case '/': /* absolute & relative path */ case MENUITEM_BEG: /* menuitem */ /* add `+' prefix for these cases */ cmd = '+'; break; case '+': case '-': str++; /* skip cmd character */ break; case '<': #if (MENUBAR_MAX > 1) if (r->h->CurrentBar == NULL) break; #endif /* (MENUBAR_MAX > 1) */ if (str[1] && str[2] == '>') /* arrow commands */ rxvt_menuarrow_add(r, str); break; case '[': /* extended command */ while (str[0] == '[') { char *next = (++str); /* skip leading '[' */ if (str[0] == ':') { /* [:command:] */ do { next++; if ((next = STRCHR(next, ':')) == NULL) return; /* parse error */ } while (next[1] != ']'); /* remove and skip ':]' */ *next = '\0'; next += 2; } else { if ((next = STRCHR(next, ']')) == NULL) return; /* parse error */ /* remove and skip ']' */ *next = '\0'; next++; } if (str[0] == ':') { int saved; /* try and dispatch it, regardless of read/write status */ saved = r->h->menu_readonly; r->h->menu_readonly = 0; rxvt_menubar_dispatch(r, str + 1); r->h->menu_readonly = saved; } /* these ones don't require menu stacking */ else if (!STRCMP(str, "clear")) { rxvt_menubar_clear(r); } else if (!STRCMP(str, "done") || rxvt_Str_match(str, "done:")) { r->h->menu_readonly = 1; } else if (!STRCMP(str, "show")) { rxvt_map_menuBar(r, 1); r->h->menu_readonly = 1; } else if (!STRCMP(str, "hide")) { rxvt_map_menuBar(r, 0); r->h->menu_readonly = 1; } else if ((n = rxvt_Str_match(str, "read:")) != 0) { /* read in a menu from a file */ str += n; rxvt_menubar_read(r, str); } else if ((n = rxvt_Str_match(str, "title:")) != 0) { str += n; if (r->h->CurrentBar != NULL && !r->h->menu_readonly) { if (*str) { name = rxvt_realloc(r->h->CurrentBar->title, STRLEN(str) + 1); if (name != NULL) { STRCPY(name, str); r->h->CurrentBar->title = name; } rxvt_menubar_expose(r); } else { free(r->h->CurrentBar->title); r->h->CurrentBar->title = NULL; } } } else if ((n = rxvt_Str_match(str, "pixmap:")) != 0) { str += n; rxvt_xterm_seq(r, XTerm_Pixmap, str, CHAR_ST); } #if (MENUBAR_MAX > 1) else if ((n = rxvt_Str_match(str, "rm")) != 0) { str += n; switch (str[0]) { case ':': str++; /* FALLTHROUGH */ case '\0': /* FALLTHROUGH */ case '*': rxvt_menubar_remove(r, str); break; } r->h->menu_readonly = 1; } else if ((n = rxvt_Str_match(str, "menu")) != 0) { str += n; switch (str[0]) { case ':': str++; /* add/access menuBar */ if (*str != '\0' && *str != '*') rxvt_menubar_push(r, str); break; default: if (r->h->CurrentBar == NULL) { rxvt_menubar_push(r, "default"); } } if (r->h->CurrentBar != NULL) r->h->menu_readonly = 0; /* allow menu build commands */ } else if (!STRCMP(str, "dump")) { /* dump current menubars to a file */ FILE *fp; /* enough space to hold the results */ char buffer[32]; sprintf(buffer, "/tmp/" APL_SUBCLASS "-%u", (unsigned int)getpid()); if ((fp = fopen(buffer, "wb")) != NULL) { rxvt_xterm_seq(r, XTerm_title, buffer, CHAR_ST); rxvt_menubar_dump(r, fp); fclose(fp); } } else if (!STRCMP(str, "next")) { if (r->h->CurrentBar) { r->h->CurrentBar = r->h->CurrentBar->next; r->h->menu_readonly = 1; } } else if (!STRCMP(str, "prev")) { if (r->h->CurrentBar) { r->h->CurrentBar = r->h->CurrentBar->prev; r->h->menu_readonly = 1; } } else if (!STRCMP(str, "swap")) { /* swap the top 2 menus */ if (r->h->CurrentBar) { bar_t *cbprev = r->h->CurrentBar->prev; bar_t *cbnext = r->h->CurrentBar->next; cbprev->next = cbnext; cbnext->prev = cbprev; r->h->CurrentBar->next = cbprev; r->h->CurrentBar->prev = cbprev->prev; cbprev->prev->next = r->h->CurrentBar; cbprev->prev = r->h->CurrentBar; r->h->CurrentBar = cbprev; r->h->menu_readonly = 1; } } #endif /* (MENUBAR_MAX > 1) */ str = next; r->h->BuildMenu = r->h->ActiveMenu = NULL; rxvt_menubar_expose(r); #ifdef DEBUG_MENUBAR_STACKING fprintf(stderr, "menus are read%s\n", r->h->menu_readonly ? "only" : "/write"); #endif } return; break; } #if (MENUBAR_MAX > 1) if (r->h->CurrentBar == NULL) return; if (r->h->menu_readonly) { #ifdef DEBUG_MENUBAR_STACKING fprintf(stderr, "menus are read%s\n", r->h->menu_readonly ? "only" : "/write"); #endif return; } #endif /* (MENUBAR_MAX > 1) */ switch (cmd) { case '+': case '-': path = name = str; name2 = NULL; /* parse STR, allow spaces inside (name) */ if (path[0] != '\0') { name = STRCHR(path, MENUITEM_BEG); str = STRCHR(path, MENUITEM_END); if (name != NULL || str != NULL) { if (name == NULL || str == NULL || str <= (name + 1) || (name > path && name[-1] != '/')) { rxvt_print_error("menu error <%s>\n", path); break; } if (str[1] == MENUITEM_BEG) { name2 = (str + 2); str = STRCHR(name2, MENUITEM_END); if (str == NULL) { rxvt_print_error("menu error <%s>\n", path); break; } name2[-2] = '\0'; /* remove prev MENUITEM_END */ } if (name > path && name[-1] == '/') name[-1] = '\0'; *name++ = '\0'; /* delimit */ *str++ = '\0'; /* delimit */ while (isspace(*str)) str++; /* skip space */ } #ifdef DEBUG_MENU fprintf(stderr, "`%c' path = <%s>, name = <%s>, name2 = <%s>, action = <%s>\n", cmd, (path ? path : "(nil)"), (name ? name : "(nil)"), (name2 ? name2 : "(nil)"), (str ? str : "(nil)") ); #endif } /* process the different commands */ switch (cmd) { case '+': /* add/replace existing menu or menuitem */ if (path[0] != '\0') { int len; path = rxvt_menu_find_base(r, &(r->h->BuildMenu), path); len = STRLEN(path); /* don't allow menus called `*' */ if (path[0] == '*') { rxvt_menu_clear(r, r->h->BuildMenu); break; } else if (len >= 2 && !STRCMP((path + len - 2), "/*")) { path[len - 2] = '\0'; } if (path[0] != '\0') r->h->BuildMenu = rxvt_menu_add(r, r->h->BuildMenu, path); } if (name != NULL && name[0] != '\0') rxvt_menuitem_add(r->h->BuildMenu, (STRCMP(name, SEPARATOR_NAME) ? name : ""), name2, str); break; case '-': /* delete menu entry */ if (!STRCMP(path, "/*") && (name == NULL || name[0] == '\0')) { rxvt_menubar_clear(r); r->h->BuildMenu = NULL; rxvt_menubar_expose(r); break; } else if (path[0] != '\0') { int len; menu_t *menu = r->h->BuildMenu; path = rxvt_menu_find_base(r, &menu, path); len = STRLEN(path); /* submenu called `*' clears all menu items */ if (path[0] == '*') { rxvt_menu_clear(r, menu); break; /* done */ } else if (len >= 2 && !STRCMP(&path[len - 2], "/*")) { /* done */ break; } else if (path[0] != '\0') { r->h->BuildMenu = NULL; break; } else r->h->BuildMenu = menu; } if (r->h->BuildMenu != NULL) { if (name == NULL || name[0] == '\0') r->h->BuildMenu = rxvt_menu_delete(r, r->h->BuildMenu); else { const char *n1; menuitem_t *item; menu_t *BuildMenu = r->h->BuildMenu; n1 = STRCMP(name, SEPARATOR_NAME) ? name : ""; item = rxvt_menuitem_find(BuildMenu, n1); if (item != NULL && item->entry.type != MenuSubMenu) { rxvt_menuitem_free(r, BuildMenu, item); /* fix up the width */ BuildMenu->width = 0; for (item = BuildMenu->head; item != NULL; item = item->next) { short l = item->len + item->len2; MAX_IT(BuildMenu->width, l); } } } rxvt_menubar_expose(r); } break; } break; } } /* INTPROTO */ void rxvt_draw_Arrows(rxvt_t *r, int name, int state) { GC top, bot; int i; #ifdef MENU_SHADOW_IN state = -state; #endif switch (state) { case +1: top = r->h->topShadowGC; bot = r->h->botShadowGC; break; /* SHADOW_OUT */ case -1: top = r->h->botShadowGC; bot = r->h->topShadowGC; break; /* SHADOW_IN */ default: top = bot = r->h->scrollbarGC; break; /* neutral */ } if (!r->h->Arrows_x) return; for (i = 0; i < NARROWS; i++) { const int w = Width2Pixel(1); const int y = (menuBar_TotalHeight() - w) / 2; int x = r->h->Arrows_x + (5 * Width2Pixel(i)) / 4; if (!name || name == Arrows[i].name) rxvt_Draw_Triangle(r->Xdisplay, r->menuBar.win, top, bot, x, y, w, Arrows[i].name); } XFlush(r->Xdisplay); } /* EXTPROTO */ void rxvt_menubar_expose(rxvt_t *r) { menu_t *menu; int x; if (!menubar_visible(r) || r->menuBar.win == 0) return; if (r->h->menubarGC == None) { /* Create the graphics context */ XGCValues gcvalue; gcvalue.font = r->TermWin.font->fid; gcvalue.foreground = (XDEPTH <= 2 ? r->PixColors[Color_fg] : r->PixColors[Color_Black]); r->h->menubarGC = XCreateGC(r->Xdisplay, r->menuBar.win, GCForeground | GCFont, &gcvalue); } /* make sure the font is correct */ XSetFont(r->Xdisplay, r->h->menubarGC, r->TermWin.font->fid); XSetFont(r->Xdisplay, r->h->botShadowGC, r->TermWin.font->fid); XClearWindow(r->Xdisplay, r->menuBar.win); rxvt_menu_hide_all(r); x = 0; if (r->h->CurrentBar != NULL) { for (menu = r->h->CurrentBar->head; menu != NULL; menu = menu->next) { int len = menu->len; x = (menu->x + menu->len + HSPACE); #ifdef DEBUG_MENU_LAYOUT rxvt_print_menu_descendants(menu); #endif if (x >= r->TermWin.ncol) len = (r->TermWin.ncol - (menu->x + HSPACE)); rxvt_drawbox_menubar(r, menu->x, len, +1); #ifdef USE_XIM if (r->TermWin.fontset) XmbDrawString(r->Xdisplay, r->menuBar.win, r->TermWin.fontset, r->h->menubarGC, (Width2Pixel(menu->x) + Width2Pixel(HSPACE) / 2), menuBar_height() - SHADOW, menu->name, len); else #endif XDrawString(r->Xdisplay, r->menuBar.win, r->h->menubarGC, (Width2Pixel(menu->x) + Width2Pixel(HSPACE) / 2), menuBar_height() - SHADOW, menu->name, len); if (x >= r->TermWin.ncol) break; } } rxvt_drawbox_menubar(r, x, r->TermWin.ncol, (r->h->CurrentBar ? +1 : -1)); /* add the menuBar title, if it exists and there's plenty of room */ r->h->Arrows_x = 0; if (x < r->TermWin.ncol) { const char *str; int ncol; unsigned int len; char title[256]; ncol = (int)r->TermWin.ncol; if (x < (ncol - (NARROWS + 1))) { ncol -= (NARROWS + 1); r->h->Arrows_x = Width2Pixel(ncol); } rxvt_draw_Arrows(r, 0, +1); str = (r->h->CurrentBar && r->h->CurrentBar->title) ? r->h->CurrentBar->title : "%n-%v"; for (len = 0; str[0] && len < sizeof(title) - 1; str++) { const char *s = NULL; switch (str[0]) { case '%': str++; switch (str[0]) { case 'n': s = r->h->rs[Rs_name]; break; /* resource name */ case 'v': s = VERSION; break; /* version number */ case '%': s = "%"; break; /* literal '%' */ } if (s != NULL) while (*s && len < sizeof(title) - 1) title[len++] = *s++; break; default: title[len++] = str[0]; break; } } title[len] = '\0'; ncol -= (x + len + HSPACE); if (len > 0 && ncol >= 0) { #ifdef USE_XIM if (r->TermWin.fontset) XmbDrawString(r->Xdisplay, r->menuBar.win, r->TermWin.fontset, r->h->menubarGC, Width2Pixel(x) + Width2Pixel(ncol + HSPACE) / 2, menuBar_height() - SHADOW, title, len); else #endif XDrawString(r->Xdisplay, r->menuBar.win, r->h->menubarGC, Width2Pixel(x) + Width2Pixel(ncol + HSPACE) / 2, menuBar_height() - SHADOW, title, len); } } } /* INTPROTO */ int rxvt_menubar_mapping(rxvt_t *r, int map) { int change = 0; if (map && !menubar_visible(r)) { r->menuBar.state = 1; if (r->menuBar.win == 0) return 0; XMapWindow(r->Xdisplay, r->menuBar.win); change = 1; } else if (!map && menubar_visible(r)) { rxvt_menubar_expose(r); r->menuBar.state = 0; XUnmapWindow(r->Xdisplay, r->menuBar.win); change = 1; } else rxvt_menubar_expose(r); return change; } /* INTPROTO */ int rxvt_menu_select(rxvt_t *r, XButtonEvent *ev) { menuitem_t *thisitem, *item = NULL; int this_y, y; menu_t *ActiveMenu = r->h->ActiveMenu; Window unused_root, unused_child; int unused_root_x, unused_root_y; unsigned int unused_mask; if (ActiveMenu == NULL) return 0; XQueryPointer(r->Xdisplay, ActiveMenu->win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->x), &(ev->y), &unused_mask); if (ActiveMenu->parent != NULL && (ev->x < 0 || ev->y < 0)) { rxvt_menu_hide(r); return 1; } /* determine the menu item corresponding to the Y index */ y = SHADOW; if (ev->x >= 0 && ev->x <= (ActiveMenu->w - SHADOW)) { for (item = ActiveMenu->head; item != NULL; item = item->next) { int h = HEIGHT_TEXT + 2 * SHADOW; if (isSeparator(item->name)) h = HEIGHT_SEPARATOR; else if (ev->y >= y && ev->y < (y + h)) break; y += h; } } if (item == NULL && ev->type == ButtonRelease) { rxvt_menu_hide_all(r); return 0; } thisitem = item; this_y = y - SHADOW; /* erase the last item */ if (ActiveMenu->item != NULL) { if (ActiveMenu->item != thisitem) { for (y = 0, item = ActiveMenu->head; item != NULL; item = item->next) { int h; if (isSeparator(item->name)) h = HEIGHT_SEPARATOR; else if (item == ActiveMenu->item) { /* erase old menuitem */ rxvt_drawbox_menuitem(r, y, 0); /* No Shadow */ if (item->entry.type == MenuSubMenu) rxvt_drawtriangle(r, ActiveMenu->w, y, +1); break; } else h = HEIGHT_TEXT + 2 * SHADOW; y += h; } } else { switch (ev->type) { case ButtonRelease: switch (item->entry.type) { case MenuLabel: case MenuSubMenu: rxvt_menu_hide_all(r); break; case MenuAction: case MenuTerminalAction: rxvt_drawbox_menuitem(r, this_y, -1); { #ifdef HAVE_NANOSLEEP struct timespec rqt; rqt.tv_sec = 0; rqt.tv_nsec = MENU_DELAY_USEC * 1000; nanosleep(&rqt, NULL); #else /* use select for timing */ struct timeval tv; tv.tv_sec = 0; tv.tv_usec = MENU_DELAY_USEC; select(0, NULL, NULL, NULL, &tv); #endif } /* remove menu before sending keys to the application */ rxvt_menu_hide_all(r); #ifndef DEBUG_MENU rxvt_action_dispatch(r, &(item->entry.action)); #else /* DEBUG_MENU */ fprintf(stderr, "%s: %s\n", item->name, item->entry.action.str); #endif /* DEBUG_MENU */ break; } break; default: if (item->entry.type == MenuSubMenu) goto DoMenu; break; } return 0; } } DoMenu: ActiveMenu->item = thisitem; y = this_y; if (thisitem != NULL) { item = ActiveMenu->item; if (item->entry.type != MenuLabel) rxvt_drawbox_menuitem(r, y, +1); if (item->entry.type == MenuSubMenu) { int x; rxvt_drawtriangle(r, ActiveMenu->w, y, -1); x = ev->x + (ActiveMenu->parent ? ActiveMenu->x : Width2Pixel(ActiveMenu->x)); if (x >= item->entry.submenu.menu->x) { r->h->ActiveMenu = item->entry.submenu.menu; rxvt_menu_show(r); return 1; } } } return 0; } /* INTPROTO */ void rxvt_menubar_select(rxvt_t *r, XButtonEvent *ev) { menu_t *menu = NULL; /* determine the pulldown menu corresponding to the X index */ if (ev->y >= 0 && ev->y <= menuBar_height() && r->h->CurrentBar != NULL) { for (menu = r->h->CurrentBar->head; menu != NULL; menu = menu->next) { int x = Width2Pixel(menu->x); int w = Width2Pixel(menu->len + HSPACE); if ((ev->x >= x && ev->x < x + w)) break; } } switch (ev->type) { case ButtonRelease: rxvt_menu_hide_all(r); break; case ButtonPress: if (menu == NULL && r->h->Arrows_x && ev->x >= r->h->Arrows_x) { int i; for (i = 0; i < NARROWS; i++) { if (ev->x >= (r->h->Arrows_x + (Width2Pixel(4 * i + i)) / 4) && ev->x < (r->h->Arrows_x + (Width2Pixel(4 * i + i + 4)) / 4)) { rxvt_draw_Arrows(r, Arrows[i].name, -1); { #ifdef HAVE_NANOSLEEP struct timespec rqt; rqt.tv_sec = 0; rqt.tv_nsec = MENU_DELAY_USEC * 1000; nanosleep(&rqt, NULL); #else /* use select for timing */ struct timeval tv; tv.tv_sec = 0; tv.tv_usec = MENU_DELAY_USEC; select(0, NULL, NULL, NULL, &tv); #endif } rxvt_draw_Arrows(r, Arrows[i].name, +1); #ifdef DEBUG_MENUARROWS fprintf(stderr, "'%c': ", Arrows[i].name); if (r->h->CurrentBar == NULL || (r->h->CurrentBar->arrows[i].type != MenuAction && r->h->CurrentBar->arrows[i].type != MenuTerminalAction)) { if (Arrows[i].str != NULL && Arrows[i].str[0]) fprintf(stderr, "(default) \\033%s\n", &(Arrows[i].str[2])); } else { fprintf(stderr, "%s\n", r->h->CurrentBar->arrows[i].str); } #else /* DEBUG_MENUARROWS */ if (r->h->CurrentBar == NULL || rxvt_action_dispatch(r, &(r->h->CurrentBar->arrows[i])) ) { if (Arrows[i].str != NULL && Arrows[i].str[0] != 0) rxvt_tt_write(r, (Arrows[i].str + 1), Arrows[i].str[0]); } #endif /* DEBUG_MENUARROWS */ return; } } } /* FALLTHROUGH */ default: /* * press menubar or move to a new entry */ if (menu != NULL && menu != r->h->ActiveMenu) { rxvt_menu_hide_all(r); /* pop down old menu */ r->h->ActiveMenu = menu; rxvt_menu_show(r); /* pop up new menu */ } break; } } /* * general dispatch routine, * it would be nice to have `sticky' menus */ /* EXTPROTO */ void rxvt_menubar_control(rxvt_t *r, XButtonEvent *ev) { switch (ev->type) { case ButtonPress: if (ev->button == Button1) rxvt_menubar_select(r, ev); break; case ButtonRelease: if (ev->button == Button1) rxvt_menu_select(r, ev); break; case MotionNotify: while (XCheckTypedWindowEvent(r->Xdisplay, r->TermWin.parent[0], MotionNotify, (XEvent *) ev)) ; if (r->h->ActiveMenu) while (rxvt_menu_select(r, ev)) ; else ev->y = -1; if (ev->y < 0) { Window unused_root, unused_child; int unused_root_x, unused_root_y; unsigned int unused_mask; XQueryPointer(r->Xdisplay, r->menuBar.win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->x), &(ev->y), &unused_mask); rxvt_menubar_select(r, ev); } break; } } /* EXTPROTO */ void rxvt_map_menuBar(rxvt_t *r, int map) { if (rxvt_menubar_mapping(r, map)) rxvt_resize_all_windows(r, 0, 0, 0); } #endif /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/main.c010064400001440000024000001235200755565114100131320ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: main.c *----------------------------------------------------------------------* * $Id: main.c,v 1.172 2002/10/24 01:50:58 gcw Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1992 John Bovey, University of Kent at Canterbury * - original version * Copyright (c) 1994 Robert Nation * - extensive modifications * Copyright (c) 1995 Garrett D'Amore * Copyright (c) 1997 mj olesen * - extensive modifications * Copyright (c) 1997,1998 Oezguer Kesim * Copyright (c) 1998-2001 Geoff Wing * - extensive modifications * * 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 of the License, 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. *---------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "main.intpro" /* PROTOS for internal routines */ #include #ifdef TTY_GID_SUPPORT # include #endif #ifdef HAVE_TERMIOS_H # include #endif /*----------------------------------------------------------------------*/ /* rxvt_init() */ /* LIBPROTO */ rxvt_t * rxvt_init(int argc, const char *const *argv) { const char **cmd_argv; rxvt_t *r; r = (rxvt_t *)rxvt_calloc(1, sizeof(rxvt_t)); rxvt_set_r(r); /* only assignment to _rxvt_vars */ if (rxvt_init_vars(r) < 0) { free(r); return NULL; } /* * Save and then give up any super-user privileges * If we need privileges in any area then we must specifically request it. * We should only need to be root in these cases: * 1. write utmp entries on some systems * 2. chown tty on some systems */ rxvt_privileges(r, SAVE); rxvt_privileges(r, IGNORE); rxvt_init_secondary(r); cmd_argv = rxvt_init_resources(r, argc, argv); #if (MENUBAR_MAX) rxvt_menubar_read(r, r->h->rs[Rs_menu]); #endif #ifdef HAVE_SCROLLBARS if (r->Options & Opt_scrollBar) scrollbar_setIdle(); /* set existence for size calculations */ #endif rxvt_Create_Windows(r, argc, argv); rxvt_init_xlocale(r); rxvt_scr_reset(r); /* initialize screen */ rxvt_Gr_reset(r); /* reset graphics */ #ifdef DEBUG_X XSynchronize(r->Xdisplay, True); XSetErrorHandler((XErrorHandler) abort); #else XSetErrorHandler((XErrorHandler) rxvt_xerror_handler); #endif #ifdef HAVE_SCROLLBARS if (r->Options & Opt_scrollBar) rxvt_Resize_scrollBar(r); /* create and map scrollbar */ #endif #if (MENUBAR_MAX) if (menubar_visible(r)) XMapWindow(r->Xdisplay, r->menuBar.win); #endif #ifdef TRANSPARENT if (r->Options & Opt_transparent) { XSelectInput(r->Xdisplay, Xroot, PropertyChangeMask); rxvt_check_our_parents(r); } #endif XMapWindow(r->Xdisplay, r->TermWin.vt); XMapWindow(r->Xdisplay, r->TermWin.parent[0]); rxvt_init_env(r); rxvt_init_command(r, cmd_argv); return r; } /* ------------------------------------------------------------------------- * * SIGNAL HANDLING & EXIT HANDLER * * ------------------------------------------------------------------------- */ /* * Catch a SIGCHLD signal and exit if the direct child has died */ /* ARGSUSED */ /* EXTPROTO */ RETSIGTYPE rxvt_Child_signal(int sig __attribute__((unused))) { int pid, save_errno = errno; rxvt_t *r; do { errno = 0; } while ((pid = waitpid(-1, NULL, WNOHANG)) == -1 && errno == EINTR); r = rxvt_get_r(); if (pid == r->h->cmd_pid) exit(EXIT_SUCCESS); errno = save_errno; signal(SIGCHLD, rxvt_Child_signal); } /* * Catch a fatal signal and tidy up before quitting */ /* EXTPROTO */ RETSIGTYPE rxvt_Exit_signal(int sig) { signal(sig, SIG_DFL); #ifdef DEBUG_CMD rxvt_print_error("signal %d", sig); #endif rxvt_clean_exit(); kill(getpid(), sig); } /* ARGSUSED */ /* INTPROTO */ int rxvt_xerror_handler(const Display *display __attribute__((unused)), const XErrorEvent *event) { rxvt_t *r = rxvt_get_r(); if (r->h->allowedxerror == -1) { r->h->allowedxerror = event->error_code; return 0; /* ignored anyway */ } rxvt_print_error("XError: Request: %d . %d, Error: %d", event->request_code, event->minor_code, event->error_code); /* XXX: probably should call rxvt_clean_exit() bypassing X routines */ exit(EXIT_FAILURE); /* NOTREACHED */ } /*----------------------------------------------------------------------*/ /* * Exit gracefully, clearing the utmp entry and restoring tty attributes * TODO: if debugging, this should free up any known resources if we can */ /* EXTPROTO */ void rxvt_clean_exit(void) { rxvt_t *r = rxvt_get_r(); #ifdef DEBUG_SCREEN rxvt_scr_release(r); #endif rxvt_privileged_ttydev(r, RESTORE); rxvt_privileged_utmp(r, RESTORE); #ifdef USE_XIM if (r->h->Input_Context != NULL) { XDestroyIC(r->h->Input_Context); r->h->Input_Context = NULL; } #endif } /* ------------------------------------------------------------------------- * * MEMORY ALLOCATION WRAPPERS * * ------------------------------------------------------------------------- */ /* EXTPROTO */ void * rxvt_malloc(size_t size) { void *p; p = malloc(size); if (p) return p; fprintf(stderr, APL_NAME ": memory allocation failure. Aborting"); rxvt_clean_exit(); exit(EXIT_FAILURE); /* NOTREACHED */ } /* EXTPROTO */ void * rxvt_calloc(size_t number, size_t size) { void *p; p = calloc(number, size); if (p) return p; fprintf(stderr, APL_NAME ": memory allocation failure. Aborting"); rxvt_clean_exit(); exit(EXIT_FAILURE); /* NOTREACHED */ } /* EXTPROTO */ void * rxvt_realloc(void *ptr, size_t size) { void *p; if (ptr) p = realloc(ptr, size); else p = malloc(size); if (p) return p; fprintf(stderr, APL_NAME ": memory allocation failure. Aborting"); rxvt_clean_exit(); exit(EXIT_FAILURE); /* NOTREACHED */ } /* ------------------------------------------------------------------------- * * PRIVILEGED OPERATIONS * * ------------------------------------------------------------------------- */ /* take care of suid/sgid super-user (root) privileges */ /* INTPROTO */ void rxvt_privileges(rxvt_t *r, int mode) { #if ! defined(__CYGWIN32__) # if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) /* setreuid() is the poor man's setuid(), seteuid() */ # define seteuid(a) setreuid(-1, (a)) # define setegid(a) setregid(-1, (a)) # define HAVE_SETEUID # endif # ifdef HAVE_SETEUID switch (mode) { case IGNORE: /* * change effective uid/gid - not real uid/gid - so we can switch * back to root later, as required */ seteuid(getuid()); setegid(getgid()); break; case SAVE: r->h->euid = geteuid(); r->h->egid = getegid(); break; case RESTORE: seteuid(r->h->euid); setegid(r->h->egid); break; } # else switch (mode) { case IGNORE: setuid(getuid()); setgid(getgid()); /* FALLTHROUGH */ case SAVE: /* FALLTHROUGH */ case RESTORE: break; } # endif #endif } #ifdef UTMP_SUPPORT /* EXTPROTO */ void rxvt_privileged_utmp(rxvt_t *r, char action) { struct rxvt_hidden *h = r->h; D_MAIN((stderr, "rxvt_privileged_utmp(%c); waiting for: %c (pid: %d)", action, h->next_utmp_action, getpid())); if (h->next_utmp_action != action || (action != SAVE && action != RESTORE) || (r->Options & Opt_utmpInhibit) || h->ttydev == NULL || *h->ttydev == '\0') return; rxvt_privileges(r, RESTORE); if (action == SAVE) { h->next_utmp_action = RESTORE; rxvt_makeutent(r, h->ttydev, h->rs[Rs_display_name]); } else { /* action == RESTORE */ h->next_utmp_action = IGNORE; rxvt_cleanutent(r); } rxvt_privileges(r, IGNORE); } #endif #ifndef NO_SETOWNER_TTYDEV /* EXTPROTO */ void rxvt_privileged_ttydev(rxvt_t *r, char action) { struct rxvt_hidden *h = r->h; D_MAIN((stderr, "rxvt_privileged_ttydev(r, %c); waiting for: %c (pid: %d)", action, h->next_tty_action, getpid())); if (h->next_tty_action != action || (action != SAVE && action != RESTORE) || h->ttydev == NULL || *h->ttydev == '\0') return; rxvt_privileges(r, RESTORE); if (action == SAVE) { h->next_tty_action = RESTORE; # ifndef RESET_TTY_TO_COMMON_DEFAULTS /* store original tty status for restoration rxvt_clean_exit() -- rgg 04/12/95 */ if (lstat(h->ttydev, &h->ttyfd_stat) < 0) /* you lose out */ h->next_tty_action = IGNORE; else # endif { chown(h->ttydev, getuid(), h->ttygid); /* fail silently */ chmod(h->ttydev, h->ttymode); # ifdef HAVE_REVOKE revoke(h->ttydev); # endif } } else { /* action == RESTORE */ h->next_tty_action = IGNORE; # ifndef RESET_TTY_TO_COMMON_DEFAULTS chmod(h->ttydev, h->ttyfd_stat.st_mode); chown(h->ttydev, h->ttyfd_stat.st_uid, h->ttyfd_stat.st_gid); # else chmod(h->ttydev, (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)); chown(h->ttydev, 0, 0); # endif } rxvt_privileges(r, IGNORE); # ifndef RESET_TTY_TO_COMMON_DEFAULTS D_MAIN((stderr, "%s \"%s\": mode %03o, uid %d, gid %d", action == RESTORE ? "Restoring" : (action == SAVE ? "Saving" : "UNKNOWN ERROR for"), h->ttydev, h->ttyfd_stat.st_mode, h->ttyfd_stat.st_uid, h->ttyfd_stat.st_gid)); # endif } #endif /*----------------------------------------------------------------------*/ /* * window size/position calculcations for XSizeHint and other storage. * if width/height are non-zero then override calculated width/height */ /* EXTPROTO */ void rxvt_window_calc(rxvt_t *r, unsigned int width, unsigned int height) { short recalc_x, recalc_y; int x, y, sb_w, mb_h, flags; unsigned int w, h; unsigned int max_width, max_height; r->szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity; r->szHint.win_gravity = NorthWestGravity; /* r->szHint.min_aspect.x = r->szHint.min_aspect.y = 1; */ recalc_x = recalc_y = 0; flags = 0; if (!r->h->parsed_geometry) { r->h->parsed_geometry = 1; if (r->h->rs[Rs_geometry]) flags = XParseGeometry(r->h->rs[Rs_geometry], &x, &y, &w, &h); if (flags & WidthValue) { r->TermWin.ncol = BOUND_POSITIVE_INT16(w); r->szHint.flags |= USSize; } if (flags & HeightValue) { r->TermWin.nrow = BOUND_POSITIVE_INT16(h); r->szHint.flags |= USSize; } if (flags & XValue) { r->szHint.x = x; r->szHint.flags |= USPosition; if (flags & XNegative) { recalc_x = 1; r->szHint.win_gravity = NorthEastGravity; } } if (flags & YValue) { r->szHint.y = y; r->szHint.flags |= USPosition; if (flags & YNegative) { recalc_y = 1; if (r->szHint.win_gravity == NorthEastGravity) r->szHint.win_gravity = SouthEastGravity; else r->szHint.win_gravity = SouthWestGravity; } } } /* TODO: BOUNDS */ r->TermWin.width = r->TermWin.ncol * r->TermWin.fwidth; r->TermWin.height = r->TermWin.nrow * r->TermWin.fheight; max_width = MAX_COLS * r->TermWin.fwidth; max_height = MAX_ROWS * r->TermWin.fheight; r->szHint.base_width = r->szHint.base_height = 2 * r->TermWin.int_bwidth; sb_w = mb_h = 0; r->h->window_vt_x = r->h->window_vt_y = 0; if (scrollbar_visible(r)) { sb_w = scrollbar_TotalWidth(); r->szHint.base_width += sb_w; if (!(r->Options & Opt_scrollBar_right)) r->h->window_vt_x = sb_w; } if (menubar_visible(r)) { mb_h = menuBar_TotalHeight(); r->szHint.base_height += mb_h; r->h->window_vt_y = mb_h; } r->szHint.width_inc = r->TermWin.fwidth; r->szHint.height_inc = r->TermWin.fheight; r->szHint.min_width = r->szHint.base_width + r->szHint.width_inc; r->szHint.min_height = r->szHint.base_height + r->szHint.height_inc; if (width && width - r->szHint.base_width < max_width) { r->szHint.width = width; r->TermWin.width = width - r->szHint.base_width; } else { MIN_IT(r->TermWin.width, max_width); r->szHint.width = r->szHint.base_width + r->TermWin.width; } if (height && height - r->szHint.base_height < max_height) { r->szHint.height = height; r->TermWin.height = height - r->szHint.base_height; } else { MIN_IT(r->TermWin.height, max_height); r->szHint.height = r->szHint.base_height + r->TermWin.height; } if (scrollbar_visible(r) && (r->Options & Opt_scrollBar_right)) r->h->window_sb_x = r->szHint.width - sb_w; if (recalc_x) r->szHint.x += (DisplayWidth(r->Xdisplay, Xscreen) - r->szHint.width - 2 * r->TermWin.ext_bwidth); if (recalc_y) r->szHint.y += (DisplayHeight(r->Xdisplay, Xscreen) - r->szHint.height - 2 * r->TermWin.ext_bwidth); r->TermWin.ncol = r->TermWin.width / r->TermWin.fwidth; r->TermWin.nrow = r->TermWin.height / r->TermWin.fheight; return; } /*----------------------------------------------------------------------*/ /* * Tell the teletype handler what size the window is. * Called after a window size change. */ /* EXTPROTO */ void rxvt_tt_winsize(int fd, unsigned short col, unsigned short row) { struct winsize ws; if (fd < 0) return; ws.ws_col = col; ws.ws_row = row; ws.ws_xpixel = ws.ws_ypixel = 0; ioctl(fd, TIOCSWINSZ, &ws); } /*----------------------------------------------------------------------*/ /* rxvt_change_font() - Switch to a new font */ /* * init = 1 - initialize * * fontname == FONT_UP - switch to bigger font * fontname == FONT_DN - switch to smaller font */ /* EXTPROTO */ void rxvt_change_font(rxvt_t *r, int init, const char *fontname) { const char *msg = "can't load font \"%s\""; int fh, fw, recheckfonts; int pf; int idx = 0; /* index into r->h->rs[Rs_font] */ XFontStruct *xfont; #ifdef MULTICHAR_SET int i; char *c, *enc; char tmpbuf[64]; #endif #define IDX2FNUM(i) ((i) == 0 ? FONT0_IDX : ((i) <= FONT0_IDX ? ((i)-1) : (i))) #define FNUM2IDX(f) ((f) == FONT0_IDX ? 0 : ((f) < FONT0_IDX ? ((f)+1) : (f))) if (!init) { pf = r->h->fnum; switch (fontname[0]) { case '\0': r->h->fnum = FONT0_IDX; fontname = NULL; break; /* special (internal) prefix for font commands */ case FONT_CMD: idx = atoi(fontname + 1); switch (fontname[1]) { case '+': /* corresponds to FONT_UP */ rxvt_font_up_down(r, (idx ? idx : 1), 1); break; case '-': /* corresponds to FONT_DN */ rxvt_font_up_down(r, (idx ? idx : 1), -1); break; default: if (fontname[1] != '\0' && !isdigit(fontname[1])) return; if (idx < 0 || idx >= MAX_NFONTS) return; r->h->fnum = IDX2FNUM(idx); break; } fontname = NULL; break; default: if (fontname == NULL) return; else /* search for existing fontname */ for (idx = 0; idx < MAX_NFONTS; idx++) if (r->h->rs[Rs_font + idx] == NULL) continue; if (!STRCMP(r->h->rs[Rs_font + idx], fontname)) { r->h->fnum = IDX2FNUM(idx); fontname = NULL; break; } break; } /* re-position around the normal font */ idx = FNUM2IDX(r->h->fnum); if (pf == r->h->fnum) return; /* no change */ if (fontname != NULL) { char *name; xfont = XLoadQueryFont(r->Xdisplay, fontname); if (!xfont) return; name = rxvt_malloc(STRLEN(fontname + 1) * sizeof(char)); if (name == NULL) { XFreeFont(r->Xdisplay, xfont); return; } STRCPY(name, fontname); if (r->h->newfont[idx] != NULL) free(r->h->newfont[idx]); r->h->newfont[idx] = name; r->h->rs[Rs_font + idx] = r->h->newfont[idx]; } } if (r->TermWin.font) XFreeFont(r->Xdisplay, r->TermWin.font); /* load font or substitute */ xfont = XLoadQueryFont(r->Xdisplay, r->h->rs[Rs_font + idx]); if (!xfont) { rxvt_print_error(msg, r->h->rs[Rs_font + idx]); r->h->rs[Rs_font + idx] = "fixed"; xfont = XLoadQueryFont(r->Xdisplay, "fixed"); if (!xfont) { rxvt_print_error(msg, "fixed"); goto Abort; } } r->TermWin.font = xfont; #ifndef NO_BOLDFONT /* fail silently */ if (init && r->h->rs[Rs_boldFont] != NULL) r->TermWin.boldFont_loaded = XLoadQueryFont(r->Xdisplay, r->h->rs[Rs_boldFont]); #endif /* alter existing GC */ if (!init) XSetFont(r->Xdisplay, r->TermWin.gc, r->TermWin.font->fid); /* set the sizes */ fw = rxvt_get_fontwidest(r->TermWin.font); fh = r->TermWin.font->ascent + r->TermWin.font->descent + r->TermWin.lineSpace; if (fw == r->TermWin.font->min_bounds.width) r->TermWin.propfont &= ~PROPFONT_NORMAL;/* Mono-spaced font */ else r->TermWin.propfont |= PROPFONT_NORMAL; /* Proportional font */ recheckfonts = !(fw == r->TermWin.fwidth && fh == r->TermWin.fheight); r->TermWin.fwidth = fw; r->TermWin.fheight = fh; /* check that size of boldFont is okay */ #ifndef NO_BOLDFONT if (recheckfonts) { r->TermWin.boldFont = NULL; if (r->TermWin.boldFont_loaded != NULL) { fw = rxvt_get_fontwidest(r->TermWin.boldFont_loaded); fh = r->TermWin.boldFont_loaded->ascent + r->TermWin.boldFont_loaded->descent; if (fw <= r->TermWin.fwidth && fh <= r->TermWin.fheight) r->TermWin.boldFont = r->TermWin.boldFont_loaded; if (fw == r->TermWin.fwidth /* && fh == r->TermWin.fheight */ ) r->TermWin.propfont &= ~PROPFONT_BOLD; else r->TermWin.propfont |= PROPFONT_BOLD; } } #endif /* NO_BOLDFONT */ #ifdef MULTICHAR_SET if (r->TermWin.mfont) XFreeFont(r->Xdisplay, r->TermWin.mfont); xfont = NULL; /* load font or substitute */ if (r->h->rs[Rs_mfont + idx] == NULL || (xfont = XLoadQueryFont(r->Xdisplay, r->h->rs[Rs_mfont + idx])) == NULL) { /* TODO: this is now mainly handled in rxvt_set_defaultfont() */ i = 0; c = enc = ""; switch (r->encoding_method) { case GB: c = "-*-r-*-%.2d-*-gb2312.1980-0"; enc = "GB"; break; case BIG5: c = "-*-r-*-%.2d-*-big5-0"; enc = "BIG5"; break; case EUCJ: case SJIS: c = "-*-%.2d-*-jisx0208*-*"; enc = "EUCJ/SJIS"; break; case EUCKR: c = "-*-%.2d-*-ksc5601*-*"; enc = "KR"; break; default: i = fh; /* jump past next two sections */ break; } for (; i < fh / 2; i++) { sprintf(tmpbuf, c, fh - i); xfont = XLoadQueryFont(r->Xdisplay, tmpbuf); if (xfont) { r->h->rs[Rs_mfont + idx] = rxvt_malloc(STRLEN(tmpbuf) + 1); STRCPY(r->h->rs[Rs_mfont + idx], tmpbuf); break; } } if (xfont == NULL && i != fh) rxvt_print_error("no similar multichar font: encoding %s; size %d", enc, fh); } r->TermWin.mfont = xfont; if (recheckfonts) if (r->TermWin.mfont != NULL) { fw = rxvt_get_fontwidest(r->TermWin.mfont); fh = r->TermWin.mfont->ascent + r->TermWin.mfont->descent; if (fw > (r->TermWin.fwidth * 2) || fh > r->TermWin.fheight) r->TermWin.mfont = NULL; if (fw == (r->TermWin.fwidth * 2) /* && fh==r->TermWin.fheight */ ) r->TermWin.propfont &= ~PROPFONT_MULTI; else r->TermWin.propfont |= PROPFONT_MULTI; } #endif /* MULTICHAR_SET */ /* Fontset setting is only valid when xlocale initialized. Since * rxvt_init_xlocale() is called after here, so we don't set fontset when * initialization, but let it set by rxvt_init_xlocale() */ if (init) rxvt_setTermFontSet(r, -1); else rxvt_setTermFontSet(r, idx); rxvt_set_colorfgbg(r); if (!init) { rxvt_resize_all_windows(r, 0, 0, 0); rxvt_scr_touch(r, True); } return; Abort: rxvt_print_error("aborting"); /* fatal problem */ exit(EXIT_FAILURE); } /* INTPROTO */ void rxvt_font_up_down(rxvt_t *r, int n, int direction) { const char *p; int initial, j; for (j = 0; j < n; j++) { initial = r->h->fnum; for (;;) { r->h->fnum += direction; if (r->h->fnum == MAX_NFONTS || r->h->fnum == -1) { r->h->fnum = initial; return; } p = r->h->rs[Rs_font + FNUM2IDX(r->h->fnum)]; if (p != NULL && STRLEN(p) > 1) break; } } } #undef IDX2FNUM #undef FNUM2IDX #ifdef STRICT_FONT_CHECKING /* INTPROTO */ int rxvt_get_fontwidest(XFontStruct *f) { int i, cw, fw = 0; if (f->min_bounds.width == f->max_bounds.width) return f->min_bounds.width; if (f->per_char == NULL) return f->max_bounds.width; for (i = f->max_char_or_byte2 - f->min_char_or_byte2; --i >= 0;) { cw = f->per_char[i].width; MAX_IT(fw, cw); } return fw; } #endif /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ /* xterm sequences - title, iconName, color (exptl) */ /* EXTPROTO */ void rxvt_set_title(rxvt_t *r, const char *str) { #ifndef SMART_WINDOW_TITLE XStoreName(r->Xdisplay, r->TermWin.parent[0], str); #else char *name; if (XFetchName(r->Xdisplay, r->TermWin.parent[0], &name) == 0) name = NULL; if (name == NULL || STRCMP(name, str)) XStoreName(r->Xdisplay, r->TermWin.parent[0], str); if (name) XFree(name); #endif } /* EXTPROTO */ void rxvt_set_iconName(rxvt_t *r, const char *str) { #ifndef SMART_WINDOW_TITLE XSetIconName(r->Xdisplay, r->TermWin.parent[0], str); #else char *name; if (XGetIconName(r->Xdisplay, r->TermWin.parent[0], &name)) name = NULL; if (name == NULL || STRCMP(name, str)) XSetIconName(r->Xdisplay, r->TermWin.parent[0], str); if (name) XFree(name); #endif } #ifdef XTERM_COLOR_CHANGE /* EXTPROTO */ void rxvt_set_window_color(rxvt_t *r, int idx, const char *color) { XColor xcol; int i; if (color == NULL || *color == '\0') return; /* handle color aliases */ if (isdigit(*color)) { i = atoi(color); if (i >= 8 && i <= 15) { /* bright colors */ i -= 8; # ifndef NO_BRIGHTCOLOR r->PixColors[idx] = r->PixColors[minBrightCOLOR + i]; SET_PIXCOLOR(r->h, idx); goto Done; # endif } if (i >= 0 && i <= 7) { /* normal colors */ r->PixColors[idx] = r->PixColors[minCOLOR + i]; SET_PIXCOLOR(r->h, idx); goto Done; } } if (!rxvt_rXParseAllocColor(r, &xcol, color)) return; /* XStoreColor (r->Xdisplay, XCMAP, XColor*); */ /* * FIXME: should free colors here, but no idea how to do it so instead, * so just keep gobbling up the colormap */ # if 0 for (i = Color_Black; i <= Color_White; i++) if (r->PixColors[idx] == r->PixColors[i]) break; if (i > Color_White) { /* fprintf (stderr, "XFreeColors: r->PixColors [%d] = %lu\n", idx, r->PixColors [idx]); */ XFreeColors(r->Xdisplay, XCMAP, (r->PixColors + idx), 1, DisplayPlanes(r->Xdisplay, Xscreen)); } # endif r->PixColors[idx] = xcol.pixel; SET_PIXCOLOR(r->h, idx); /* XSetWindowAttributes attr; */ /* Cursor cursor; */ Done: if (idx == Color_bg && !(r->Options & Opt_transparent)) XSetWindowBackground(r->Xdisplay, r->TermWin.vt, r->PixColors[Color_bg]); /* handle Color_BD, scrollbar background, etc. */ rxvt_set_colorfgbg(r); rxvt_recolour_cursor(r); /* the only reasonable way to enforce a clean update */ rxvt_scr_touch(r, False); } #else # define rxvt_set_window_color(r, idx,color) ((void)0) #endif /* XTERM_COLOR_CHANGE */ /* EXTPROTO */ void rxvt_recolour_cursor(rxvt_t *r) { XColor xcol[2]; xcol[0].pixel = r->PixColors[Color_pointer]; xcol[1].pixel = r->PixColors[Color_bg]; XQueryColors(r->Xdisplay, XCMAP, xcol, 2); XRecolorCursor(r->Xdisplay, r->TermWin_cursor, &(xcol[0]), &(xcol[1])); } /*----------------------------------------------------------------------*/ /* * find if fg/bg matches any of the normal (low-intensity) colors */ /* INTPROTO */ void rxvt_set_colorfgbg(rxvt_t *r) { unsigned int i; const char *xpmb = "\0"; char fstr[sizeof("default") + 1], bstr[sizeof("default") + 1]; r->h->env_colorfgbg = rxvt_malloc(sizeof("COLORFGBG=default;default;bg") + 1); STRCPY(fstr, "default"); STRCPY(bstr, "default"); for (i = Color_Black; i <= Color_White; i++) if (r->PixColors[Color_fg] == r->PixColors[i]) { sprintf(fstr, "%d", (i - Color_Black)); break; } for (i = Color_Black; i <= Color_White; i++) if (r->PixColors[Color_bg] == r->PixColors[i]) { sprintf(bstr, "%d", (i - Color_Black)); #ifdef XPM_BACKGROUND xpmb = "default;"; #endif break; } sprintf(r->h->env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr); putenv(r->h->env_colorfgbg); #ifndef NO_BRIGHTCOLOR r->h->colorfgbg = DEFAULT_RSTYLE; for (i = minCOLOR; i <= maxCOLOR; i++) { if (r->PixColors[Color_fg] == r->PixColors[i] # ifndef NO_BOLD_UNDERLINE_REVERSE && r->PixColors[Color_fg] == r->PixColors[Color_BD] # endif /* ! NO_BOLD_UNDERLINE_REVERSE */ /* if we wanted boldFont to have precedence */ # if 0 /* ifndef NO_BOLDFONT */ && r->TermWin.boldFont == NULL # endif /* NO_BOLDFONT */ ) r->h->colorfgbg = SET_FGCOLOR(r->h->colorfgbg, i); if (r->PixColors[Color_bg] == r->PixColors[i]) r->h->colorfgbg = SET_BGCOLOR(r->h->colorfgbg, i); } #endif } /*----------------------------------------------------------------------*/ /* * Colour determination for low colour displays, routine from * Hans de Goede */ /* EXTPROTO */ int rxvt_rXParseAllocColor(rxvt_t *r, XColor *screen_in_out, const char *colour) { int res = 0; if (!XParseColor(r->Xdisplay, XCMAP, colour, screen_in_out)) rxvt_print_error("can't determine colour: %s", colour); else res = rxvt_rXAllocColor(r, screen_in_out, colour); return res; } /* EXTPROTO */ int rxvt_rXAllocColor(rxvt_t *r, XColor *screen_in_out, const char *colour) { int res; if ((res = XAllocColor(r->Xdisplay, XCMAP, screen_in_out))) return res; /* try again with closest match */ if (XDEPTH >= 4 && XDEPTH <= 8) { int i, numcol; int best_pixel = 0; unsigned long best_diff, diff; XColor *colors; #define rSQR(x) ((x)*(x)) best_diff = 0; numcol = 0x01 << XDEPTH; if ((colors = rxvt_malloc(numcol * sizeof(XColor)))) { for (i = 0; i < numcol; i++) colors[i].pixel = i; XQueryColors(r->Xdisplay, XCMAP, colors, numcol); for (i = 0; i < numcol; i++) { diff = rSQR(screen_in_out->red - colors[i].red) + rSQR(screen_in_out->green - colors[i].green) + rSQR(screen_in_out->blue - colors[i].blue); if (i == 0 || diff < best_diff) { best_pixel = colors[i].pixel; best_diff = diff; } } *screen_in_out = colors[best_pixel]; free(colors); res = XAllocColor(r->Xdisplay, XCMAP, screen_in_out); } } if (res == 0) rxvt_print_error("can't allocate colour: %s", colour); return res; } /* -------------------------------------------------------------------- * * - WINDOW RESIZING - * * -------------------------------------------------------------------- */ /* EXTPROTO */ void rxvt_resize_all_windows(rxvt_t *r, unsigned int width, unsigned int height, int ignoreparent) { int fix_screen; #ifdef SMART_RESIZE int old_width = r->szHint.width, old_height = r->szHint.height; #endif rxvt_window_calc(r, width, height); XSetWMNormalHints(r->Xdisplay, r->TermWin.parent[0], &r->szHint); if (!ignoreparent) { #ifdef SMART_RESIZE /* * resize by Marius Gedminas * reposition window on resize depending on placement on screen */ int x, y, x1, y1; int dx, dy; unsigned int unused_w1, unused_h1, unused_b1, unused_d1; Window unused_cr; XTranslateCoordinates(r->Xdisplay, r->TermWin.parent[0], Xroot, 0, 0, &x, &y, &unused_cr); XGetGeometry(r->Xdisplay, r->TermWin.parent[0], &unused_cr, &x1, &y1, &unused_w1, &unused_h1, &unused_b1, &unused_d1); /* * if Xroot isn't the parent window, a WM will probably have offset * our position for handles and decorations. Counter it */ if (x1 != x || y1 != y) { x -= x1; y -= y1; } x1 = (DisplayWidth(r->Xdisplay, Xscreen) - old_width) / 2; y1 = (DisplayHeight(r->Xdisplay, Xscreen) - old_height) / 2; dx = old_width - r->szHint.width; dy = old_height - r->szHint.height; /* Check position of the center of the window */ if (x < x1) /* left half */ dx = 0; else if (x == x1) /* exact center */ dx /= 2; if (y < y1) /* top half */ dy = 0; else if (y == y1) /* exact center */ dy /= 2; XMoveResizeWindow(r->Xdisplay, r->TermWin.parent[0], x + dx, y + dy, r->szHint.width, r->szHint.height); #else XResizeWindow(r->Xdisplay, r->TermWin.parent[0], r->szHint.width, r->szHint.height); #endif } fix_screen = (r->TermWin.ncol != r->h->prev_ncol || r->TermWin.nrow != r->h->prev_nrow); if (fix_screen || width != r->h->old_width || height != r->h->old_height) { if (scrollbar_visible(r)) { XMoveResizeWindow(r->Xdisplay, r->scrollBar.win, r->h->window_sb_x, 0, scrollbar_TotalWidth(), r->szHint.height); rxvt_Resize_scrollBar(r); } if (menubar_visible(r)) XMoveResizeWindow(r->Xdisplay, r->menuBar.win, r->h->window_vt_x, 0, TermWin_TotalWidth(), menuBar_TotalHeight()); XMoveResizeWindow(r->Xdisplay, r->TermWin.vt, r->h->window_vt_x, r->h->window_vt_y, TermWin_TotalWidth(), TermWin_TotalHeight()); #ifdef RXVT_GRAPHICS if (r->h->old_height) rxvt_Gr_Resize(r, r->h->old_width - r->szHint.base_width, r->h->old_height - r->szHint.base_height); #endif rxvt_scr_clear(r); rxvt_resize_pixmap(r); } if (fix_screen || r->h->old_height == 0) { int curr_screen = -1; u_int16_t old_ncol = r->h->prev_ncol; /* scr_reset only works on the primary screen */ if (r->h->old_height) /* this is not the first time through */ curr_screen = rxvt_scr_change_screen(r, PRIMARY); rxvt_scr_reset(r); if (curr_screen >= 0) { /* this is not the first time through */ rxvt_scr_change_screen(r, curr_screen); rxvt_selection_check(r, (old_ncol != r->TermWin.ncol ? 4 : 0)); } } r->h->old_width = r->szHint.width; r->h->old_height = r->szHint.height; #ifdef USE_XIM rxvt_IMSetStatusPosition(r); #endif } /* * Set the width/height of the vt window in characters. Units are pixels. * good for toggling 80/132 columns */ /* EXTPROTO */ void rxvt_set_widthheight(rxvt_t *r, unsigned int width, unsigned int height) { XWindowAttributes wattr; if (width == 0 || height == 0) { XGetWindowAttributes(r->Xdisplay, Xroot, &wattr); if (width == 0) width = wattr.width - r->szHint.base_width; if (height == 0) height = wattr.height - r->szHint.base_height; } if (width != r->TermWin.width || height != r->TermWin.height) { width += r->szHint.base_width; height += r->szHint.base_height; rxvt_resize_all_windows(r, width, height, 0); } } /* -------------------------------------------------------------------- * * - X INPUT METHOD ROUTINES - * * -------------------------------------------------------------------- */ #ifdef USE_XIM /* INTPROTO */ void rxvt_setSize(rxvt_t *r, XRectangle *size) { size->x = r->TermWin.int_bwidth; size->y = r->TermWin.int_bwidth; size->width = Width2Pixel(r->TermWin.ncol); size->height = Height2Pixel(r->TermWin.nrow); } /* INTPROTO */ void rxvt_setColor(rxvt_t *r, unsigned long *fg, unsigned long *bg) { *fg = r->PixColors[Color_fg]; *bg = r->PixColors[Color_bg]; } /* Checking whether input method is running. */ /* INTPROTO */ Bool rxvt_IMisRunning(rxvt_t *r) { char *p; Atom atom; Window win; char server[IMBUFSIZ]; /* get current locale modifier */ if ((p = XSetLocaleModifiers(NULL)) != NULL) { STRCPY(server, "@server="); STRNCAT(server, &(p[4]), IMBUFSIZ - 9); /* skip "@im=" */ if ((p = STRCHR(server + 1, '@')) != NULL) /* first one only */ *p = '\0'; atom = XInternAtom(r->Xdisplay, server, False); win = XGetSelectionOwner(r->Xdisplay, atom); if (win != None) return True; } return False; } /* EXTPROTO */ void rxvt_IMSendSpot(rxvt_t *r) { XPoint spot; XVaNestedList preedit_attr; if (r->h->Input_Context == NULL || !r->TermWin.focus || !(r->h->input_style & XIMPreeditPosition) || !(r->h->event_type == KeyPress || r->h->event_type == Expose || r->h->event_type == NoExpose || r->h->event_type == SelectionNotify || r->h->event_type == ButtonRelease || r->h->event_type == FocusIn) || !rxvt_IMisRunning(r)) return; rxvt_setPosition(r, &spot); preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL); XSetICValues(r->h->Input_Context, XNPreeditAttributes, preedit_attr, NULL); XFree(preedit_attr); } /* EXTPROTO */ void rxvt_setTermFontSet(rxvt_t *r, int idx) { char *string; long length; XFontSet prev_fontset; int success = 0; if (idx < 0 || idx >= MAX_NFONTS) return; D_MAIN((stderr, "rxvt_setTermFontSet()")); prev_fontset = r->TermWin.fontset; r->TermWin.fontset = NULL; length = 0; if (r->h->rs[Rs_font + idx]) length += STRLEN(r->h->rs[Rs_font + idx]) + 1; # ifdef MULTICHAR_SET if (r->h->rs[Rs_mfont + idx]) length += STRLEN(r->h->rs[Rs_mfont + idx]) + 1; # endif if (length == 0 || (string = rxvt_malloc(length + 1)) == NULL) r->TermWin.fontset = NULL; else { int missing_charsetcount; char **missing_charsetlist, *def_string; string[0] = '\0'; if (r->h->rs[Rs_font + idx]) { STRCAT(string, r->h->rs[Rs_font + idx]); STRCAT(string, ","); } # ifdef MULTICHAR_SET if (r->h->rs[Rs_mfont + idx]) { STRCAT(string, r->h->rs[Rs_mfont + idx]); STRCAT(string, ","); } # endif string[STRLEN(string) - 1] = '\0'; r->TermWin.fontset = XCreateFontSet(r->Xdisplay, string, &missing_charsetlist, &missing_charsetcount, &def_string); free(string); if (r->TermWin.fontset != NULL) success = 1; } if (success) { if (prev_fontset != NULL) XFreeFontSet(r->Xdisplay, prev_fontset); } else r->TermWin.fontset = prev_fontset; } /* INTPROTO */ void rxvt_setPreeditArea(rxvt_t *r, XRectangle *preedit_rect, XRectangle *status_rect, XRectangle *needed_rect) { int mbh, vtx = 0; if (scrollbar_visible(r) && !(r->Options & Opt_scrollBar_right)) vtx = scrollbar_TotalWidth(); mbh = menubar_visible(r) ? menuBar_TotalHeight() : 0; mbh -= r->TermWin.lineSpace; preedit_rect->x = needed_rect->width + vtx; preedit_rect->y = Height2Pixel(r->TermWin.nrow - 1) + mbh; preedit_rect->width = Width2Pixel(r->TermWin.ncol + 1) - needed_rect->width + vtx; preedit_rect->height = Height2Pixel(1); status_rect->x = vtx; status_rect->y = Height2Pixel(r->TermWin.nrow - 1) + mbh; status_rect->width = needed_rect->width ? needed_rect->width : Width2Pixel(r->TermWin.ncol + 1); status_rect->height = Height2Pixel(1); } /* ARGSUSED */ /* INTPROTO */ void rxvt_IMDestroyCallback(XIM xim __attribute__((unused)), XPointer client_data __attribute__((unused)), XPointer call_data __attribute__((unused))) { rxvt_t *r = rxvt_get_r(); r->h->Input_Context = NULL; /* To avoid Segmentation Fault in C locale: Solaris only? */ if (STRCMP(r->h->locale, "C")) XRegisterIMInstantiateCallback(r->Xdisplay, NULL, NULL, NULL, rxvt_IMInstantiateCallback, NULL); } /* * X manual pages and include files don't match on some systems: * some think this is an XIDProc and others an XIMProc so we can't * use the first argument - need to update this to be nice for * both types via some sort of configure detection */ /* ARGSUSED */ /* EXTPROTO */ void rxvt_IMInstantiateCallback(Display *unused __attribute__((unused)), XPointer client_data __attribute__((unused)), XPointer call_data __attribute__((unused))) { int i, found, had_im; const char *p; char **s; rxvt_t *r = rxvt_get_r(); char buf[IMBUFSIZ]; D_MAIN((stderr, "rxvt_IMInstantiateCallback()")); if (r->h->Input_Context) return; found = had_im = 0; p = r->h->rs[Rs_inputMethod]; if (p && *p) { had_im = 1; s = rxvt_splitcommastring(p); for (i = 0; s[i]; i++) { if (*s[i]) { STRCPY(buf, "@im="); STRNCAT(buf, s[i], IMBUFSIZ - 5); if ((p = XSetLocaleModifiers(buf)) != NULL && *p && (rxvt_IM_get_IC(r) == True)) { found = 1; break; } } } for (i = 0; s[i]; i++) free(s[i]); free(s); } if (found) return; /* try with XMODIFIERS env. var. */ if ((p = XSetLocaleModifiers("")) != NULL && *p) { rxvt_IM_get_IC(r); return; } /* try with no modifiers base IF the user didn't specify an IM */ if (!had_im && (p = XSetLocaleModifiers("@im=none")) != NULL && *p && rxvt_IM_get_IC(r) == True) return; } /* * Try to open a XIM with the current modifiers, then see if we can * open a suitable preedit type */ /* INTPROTO */ Bool rxvt_IM_get_IC(rxvt_t *r) { int i, j, found; XIM xim; XPoint spot; XRectangle rect, status_rect, needed_rect; unsigned long fg, bg; const char *p; char **s; XIMStyles *xim_styles; XVaNestedList preedit_attr, status_attr; XIMCallback ximcallback; struct rxvt_hidden *h = r->h; D_MAIN((stderr, "rxvt_IM_get_IC()")); xim = XOpenIM(r->Xdisplay, NULL, NULL, NULL); if (xim == NULL) return False; xim_styles = NULL; if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL) || !xim_styles || !xim_styles->count_styles) { XCloseIM(xim); return False; } p = h->rs[Rs_preeditType] ? h->rs[Rs_preeditType] : "OverTheSpot,OffTheSpot,Root"; s = rxvt_splitcommastring(p); for (i = found = 0; !found && s[i]; i++) { if (!STRCMP(s[i], "OverTheSpot")) h->input_style = (XIMPreeditPosition | XIMStatusNothing); else if (!STRCMP(s[i], "OffTheSpot")) h->input_style = (XIMPreeditArea | XIMStatusArea); else if (!STRCMP(s[i], "Root")) h->input_style = (XIMPreeditNothing | XIMStatusNothing); for (j = 0; j < xim_styles->count_styles; j++) if (h->input_style == xim_styles->supported_styles[j]) { found = 1; break; } } for (i = 0; s[i]; i++) free(s[i]); free(s); XFree(xim_styles); if (!found) { XCloseIM(xim); return False; } ximcallback.callback = rxvt_IMDestroyCallback; /* XXX: not sure why we need this (as well as IC one below) */ XSetIMValues(xim, XNDestroyCallback, &ximcallback, NULL); preedit_attr = status_attr = NULL; if (h->input_style & XIMPreeditPosition) { rxvt_setSize(r, &rect); rxvt_setPosition(r, &spot); rxvt_setColor(r, &fg, &bg); preedit_attr = XVaCreateNestedList(0, XNArea, &rect, XNSpotLocation, &spot, XNForeground, fg, XNBackground, bg, XNFontSet, r->TermWin.fontset, NULL); } else if (h->input_style & XIMPreeditArea) { rxvt_setColor(r, &fg, &bg); /* * The necessary width of preedit area is unknown * until create input context. */ needed_rect.width = 0; rxvt_setPreeditArea(r, &rect, &status_rect, &needed_rect); preedit_attr = XVaCreateNestedList(0, XNArea, &rect, XNForeground, fg, XNBackground, bg, XNFontSet, r->TermWin.fontset, NULL); status_attr = XVaCreateNestedList(0, XNArea, &status_rect, XNForeground, fg, XNBackground, bg, XNFontSet, r->TermWin.fontset, NULL); } h->Input_Context = XCreateIC(xim, XNInputStyle, h->input_style, XNClientWindow, r->TermWin.parent[0], XNFocusWindow, r->TermWin.parent[0], XNDestroyCallback, &ximcallback, preedit_attr ? XNPreeditAttributes : NULL, preedit_attr, status_attr ? XNStatusAttributes : NULL, status_attr, NULL); if (preedit_attr) XFree(preedit_attr); if (status_attr) XFree(status_attr); if (h->Input_Context == NULL) { rxvt_print_error("failed to create input context"); XCloseIM(xim); return False; } if (h->input_style & XIMPreeditArea) rxvt_IMSetStatusPosition(r); D_MAIN((stderr, "rxvt_IM_get_IC() - successful connection")); return True; } /* EXTPROTO */ void rxvt_IMSetStatusPosition(rxvt_t *r) { XRectangle preedit_rect, status_rect, *needed_rect; XVaNestedList preedit_attr, status_attr; if (r->h->Input_Context == NULL || !r->TermWin.focus || !(r->h->input_style & XIMPreeditArea) || !rxvt_IMisRunning(r)) return; /* Getting the necessary width of preedit area */ status_attr = XVaCreateNestedList(0, XNAreaNeeded, &needed_rect, NULL); XGetICValues(r->h->Input_Context, XNStatusAttributes, status_attr, NULL); XFree(status_attr); rxvt_setPreeditArea(r, &preedit_rect, &status_rect, needed_rect); preedit_attr = XVaCreateNestedList(0, XNArea, &preedit_rect, NULL); status_attr = XVaCreateNestedList(0, XNArea, &status_rect, NULL); XSetICValues(r->h->Input_Context, XNPreeditAttributes, preedit_attr, XNStatusAttributes, status_attr, NULL); XFree(preedit_attr); XFree(status_attr); } #endif /* USE_XIM */ /*----------------------------------------------------------------------*/ static rxvt_t *_rxvt_vars = NULL; /* EXTPROTO */ rxvt_t * rxvt_get_r(void) { return _rxvt_vars; } /* INTPROTO */ void rxvt_set_r(rxvt_t *r) { _rxvt_vars = r; } /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/logging.c010064400001440000024000000270330757721750000136370ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: logging.c *----------------------------------------------------------------------* * $Id: logging.c,v 1.38 2002/12/16 00:29:30 gcw Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1992 John Bovey * - original version * Copyright (c) 1993 lipka * Copyright (c) 1993 Brian Stempien * Copyright (c) 1995 Raul Garcia Garcia * Copyright (c) 1995 Piet W. Plomp * Copyright (c) 1997 Raul Garcia Garcia * Copyright (c) 1998-2001 Geoff Wing * - extensive modifications * Copyright (c) 1999 D J Hawkey Jr * - lastlog support * * 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 of the License, 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. *----------------------------------------------------------------------*/ /*----------------------------------------------------------------------* * Public: * extern void cleanutent (void); * extern void makeutent (const char * pty, const char * hostname); * * Private: * rxvt_update_wtmp (); *----------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "logging.h" #ifdef UTMP_SUPPORT /* * BSD style utmp entry * ut_line, ut_name, ut_host, ut_time * SYSV style utmp (and utmpx) entry * ut_user, ut_id, ut_line, ut_pid, ut_type, ut_exit, ut_time */ /* ------------------------------------------------------------------------- */ /* * make and write utmp and wtmp entries */ /* EXTPROTO */ void rxvt_makeutent(rxvt_t *r, const char *pty, const char *hostname) { #ifdef HAVE_STRUCT_UTMP struct utmp *ut = &(r->h->ut); #endif #ifdef HAVE_STRUCT_UTMPX struct utmpx *utx = &(r->h->utx); #endif #ifdef HAVE_UTMP_PID int i; #endif char ut_id[5]; struct passwd *pwent = getpwuid(getuid()); if (!STRNCMP(pty, "/dev/", 5)) pty += 5; /* skip /dev/ prefix */ if (!STRNCMP(pty, "pty", 3) || !STRNCMP(pty, "tty", 3)) { STRNCPY(ut_id, (pty + 3), sizeof(ut_id)); } #ifdef HAVE_UTMP_PID else if (sscanf(pty, "pts/%d", &i) == 1) sprintf(ut_id, "vt%02x", (i & 0xff)); /* sysv naming */ #endif else if (STRNCMP(pty, "pty", 3) && STRNCMP(pty, "tty", 3)) { rxvt_print_error("can't parse tty name \"%s\"", pty); return; } #ifdef HAVE_STRUCT_UTMP MEMSET(ut, 0, sizeof(struct utmp)); # ifdef HAVE_UTMP_PID setutent(); STRNCPY(ut->ut_id, ut_id, sizeof(ut->ut_id)); ut->ut_type = DEAD_PROCESS; getutid(ut); /* position to entry in utmp file */ STRNCPY(r->h->ut_id, ut_id, sizeof(r->h->ut_id)); # endif #endif #ifdef HAVE_STRUCT_UTMPX MEMSET(utx, 0, sizeof(struct utmpx)); setutxent(); STRNCPY(utx->ut_id, ut_id, sizeof(utx->ut_id)); utx->ut_type = DEAD_PROCESS; getutxid(utx); /* position to entry in utmp file */ STRNCPY(r->h->ut_id, ut_id, sizeof(r->h->ut_id)); #endif #ifdef HAVE_STRUCT_UTMP STRNCPY(ut->ut_line, pty, sizeof(ut->ut_line)); ut->ut_time = time(NULL); # ifdef HAVE_UTMP_PID STRNCPY(ut->ut_user, (pwent && pwent->pw_name) ? pwent->pw_name : "?", sizeof(ut->ut_user)); STRNCPY(ut->ut_id, ut_id, sizeof(ut->ut_id)); ut->ut_time = time(NULL); ut->ut_pid = r->h->cmd_pid; # ifdef HAVE_UTMP_HOST STRNCPY(ut->ut_host, hostname, sizeof(ut->ut_host)); # endif ut->ut_type = USER_PROCESS; pututline(ut); endutent(); /* close the file */ r->h->utmp_pos = -1; # else STRNCPY(ut->ut_name, (pwent && pwent->pw_name) ? pwent->pw_name : "?", sizeof(ut->ut_name)); # ifdef HAVE_UTMP_HOST STRNCPY(ut->ut_host, hostname, sizeof(ut->ut_host)); # endif # endif #endif #ifdef HAVE_STRUCT_UTMPX STRNCPY(utx->ut_line, pty, sizeof(utx->ut_line)); STRNCPY(utx->ut_user, (pwent && pwent->pw_name) ? pwent->pw_name : "?", sizeof(utx->ut_user)); STRNCPY(utx->ut_id, ut_id, sizeof(utx->ut_id)); utx->ut_session = getsid(0); utx->ut_tv.tv_sec = time(NULL); utx->ut_tv.tv_usec = 0; utx->ut_pid = r->h->cmd_pid; # ifdef HAVE_UTMPX_HOST STRNCPY(utx->ut_host, hostname, sizeof(utx->ut_host)); # if 0 { char *colon; if ((colon = STRRCHR(ut->ut_host, ':')) != NULL) *colon = '\0'; } # endif # endif utx->ut_type = USER_PROCESS; pututxline(utx); endutxent(); /* close the file */ r->h->utmp_pos = -1; #endif #if defined(HAVE_STRUCT_UTMP) && !defined(HAVE_UTMP_PID) { int i; # ifdef HAVE_TTYSLOT i = ttyslot(); if (rxvt_write_bsd_utmp(i, ut)) r->h->utmp_pos = i; # else FILE *fd0; if ((fd0 = fopen(TTYTAB_FILENAME, "r")) != NULL) { char buf[256], name[256]; buf[sizeof(buf) - 1] = '\0'; for (i = 1; (fgets(buf, sizeof(buf) - 1, fd0) != NULL);) { if (*buf == '#' || sscanf(buf, "%s", name) != 1) continue; if (!STRCMP(ut->ut_line, name)) { if (!rxvt_write_bsd_utmp(i, ut)) i = 0; r->h->utmp_pos = i; fclose(fd0); break; } i++; } fclose(fd0); } # endif } #endif #ifdef WTMP_SUPPORT # ifdef WTMP_ONLY_ON_LOGIN if (r->Options & Opt_loginShell) # endif { # ifdef HAVE_STRUCT_UTMP # ifdef HAVE_UPDWTMP updwtmp(RXVT_WTMP_FILE, ut); # else rxvt_update_wtmp(RXVT_WTMP_FILE, ut); # endif # endif # ifdef HAVE_STRUCT_UTMPX updwtmpx(RXVT_WTMPX_FILE, utx); # endif } #endif #if defined(LASTLOG_SUPPORT) && defined(RXVT_LASTLOG_FILE) if (r->Options & Opt_loginShell) rxvt_update_lastlog(RXVT_LASTLOG_FILE, pty, hostname); #endif } /* ------------------------------------------------------------------------- */ /* * remove utmp and wtmp entries */ /* EXTPROTO */ void rxvt_cleanutent(rxvt_t *r) { #ifdef HAVE_STRUCT_UTMP struct utmp *tmput, *ut = &(r->h->ut); #endif #ifdef HAVE_STRUCT_UTMPX struct utmpx *tmputx, *utx = &(r->h->utx); #endif #ifdef HAVE_STRUCT_UTMP # ifdef HAVE_UTMP_PID MEMSET(ut, 0, sizeof(struct utmp)); setutent(); STRNCPY(ut->ut_id, r->h->ut_id, sizeof(ut->ut_id)); ut->ut_type = USER_PROCESS; if ((tmput = getutid(ut))) /* position to entry in utmp file */ ut = tmput; ut->ut_type = DEAD_PROCESS; # else MEMSET(ut->ut_name, 0, sizeof(ut->ut_name)); # ifdef HAVE_UTMP_HOST MEMSET(ut->ut_host, 0, sizeof(ut->ut_host)); # endif # endif ut->ut_time = time(NULL); #endif #ifdef HAVE_STRUCT_UTMPX MEMSET(utx, 0, sizeof(struct utmpx)); setutxent(); STRNCPY(utx->ut_id, r->h->ut_id, sizeof(utx->ut_id)); utx->ut_type = USER_PROCESS; if ((tmputx = getutxid(utx))) /* position to entry in utmp file */ utx = tmputx; utx->ut_type = DEAD_PROCESS; utx->ut_session = getsid(0); utx->ut_tv.tv_sec = time(NULL); utx->ut_tv.tv_usec = 0; #endif /* * Write ending wtmp entry */ #ifdef WTMP_SUPPORT # ifdef WTMP_ONLY_ON_LOGIN if (r->Options & Opt_loginShell) # endif { # ifdef HAVE_STRUCT_UTMP # ifdef HAVE_UPDWTMP updwtmp(RXVT_WTMP_FILE, ut); # else rxvt_update_wtmp(RXVT_WTMP_FILE, ut); # endif # endif # ifdef HAVE_STRUCT_UTMPX updwtmpx(RXVT_WTMPX_FILE, utx); # endif } #endif /* * Write utmp entry */ #ifdef HAVE_STRUCT_UTMP # ifdef HAVE_UTMP_PID if (ut->ut_pid == r->h->cmd_pid) pututline(ut); endutent(); # else if (r->h->utmp_pos > 0) { MEMSET(ut, 0, sizeof(struct utmp)); rxvt_write_bsd_utmp(r->h->utmp_pos, ut); } # endif #endif #ifdef HAVE_STRUCT_UTMPX if (utx->ut_pid == r->h->cmd_pid) pututxline(utx); endutxent(); #endif } /* ------------------------------------------------------------------------- */ /* * Write a BSD style utmp entry */ #ifdef HAVE_UTMP_H /* INTPROTO */ int rxvt_write_bsd_utmp(int utmp_pos, struct utmp *wu) { int fd; if (utmp_pos <= 0 || (fd = open(RXVT_UTMP_FILE, O_WRONLY)) == -1) return 0; if (lseek(fd, (off_t) (utmp_pos * sizeof(struct utmp)), SEEK_SET) != -1) write(fd, wu, sizeof(struct utmp)); close(fd); return 1; } #endif /* ------------------------------------------------------------------------- */ /* * Update a BSD style wtmp entry */ #if defined(WTMP_SUPPORT) && !defined(HAVE_UPDWTMP) /* INTPROTO */ void rxvt_update_wtmp(const char *fname, const struct utmp *putmp) { int fd, gotlock, retry; struct flock lck; /* fcntl locking scheme */ struct stat sbuf; if ((fd = open(fname, O_WRONLY | O_APPEND, 0)) < 0) return; lck.l_whence = SEEK_END; /* start lock at current eof */ lck.l_len = 0; /* end at ``largest possible eof'' */ lck.l_start = 0; lck.l_type = F_WRLCK; /* we want a write lock */ /* attempt lock with F_SETLK; F_SETLKW would cause a deadlock! */ for (retry = 10, gotlock = 0; retry--;) if (fcntl(fd, F_SETLK, &lck) != -1) { gotlock = 1; break; } else if (errno != EAGAIN && errno != EACCES) break; if (!gotlock) { /* give it up */ close(fd); return; } if (fstat(fd, &sbuf) == 0) if (write(fd, putmp, sizeof(struct utmp)) != sizeof(struct utmp)) ftruncate(fd, sbuf.st_size); /* remove bad writes */ lck.l_type = F_UNLCK; /* unlocking the file */ fcntl(fd, F_SETLK, &lck); close(fd); } #endif /* ------------------------------------------------------------------------- */ #ifdef LASTLOG_SUPPORT /* INTPROTO */ void rxvt_update_lastlog(const char *fname, const char *pty, const char *host) { # ifdef HAVE_STRUCT_LASTLOGX struct lastlogx llx; # endif # ifdef HAVE_STRUCT_LASTLOG int fd; struct lastlog ll; # ifdef LASTLOG_IS_DIR char lastlogfile[256]; # endif struct passwd *pwent; # endif # ifdef HAVE_STRUCT_LASTLOGX MEMSET(&llx, 0, sizeof(llx)); llx.ll_tv.tv_sec = time(NULL); llx.ll_tv.tv_usec = 0; STRNCPY(llx.ll_line, pty, sizeof(llx.ll_line)); STRNCPY(llx.ll_host, host, sizeof(llx.ll_host)); updlastlogx(RXVT_LASTLOGX_FILE, getuid(), &llx); # endif # ifdef HAVE_STRUCT_LASTLOG pwent = getpwuid(getuid()); if (!pwent) { rxvt_print_error("no entry in password file"); return; } MEMSET(&ll, 0, sizeof(ll)); ll.ll_time = time(NULL); STRNCPY(ll.ll_line, pty, sizeof(ll.ll_line)); STRNCPY(ll.ll_host, host, sizeof(ll.ll_host)); # ifdef LASTLOG_IS_DIR sprintf(lastlogfile, "%.*s/%.*s", sizeof(lastlogfile) - sizeof(pwent->pw_name) - 2, fname, sizeof(pwent->pw_name), (!pwent->pw_name || pwent->pw_name[0] == '\0') ? "unknown" : pwent->pw_name); if ((fd = open(lastlogfile, O_WRONLY | O_CREAT, 0644)) >= 0) { write(fd, &ll, sizeof(ll)); close(fd); } # else if ((fd = open(fname, O_RDWR)) != -1) { if (lseek(fd, (off_t) ((long)pwent->pw_uid * sizeof(ll)), SEEK_SET) != -1) write(fd, &ll, sizeof(ll)); close(fd); } # endif /* LASTLOG_IS_DIR */ # endif /* HAVE_STRUCT_LASTLOG */ } #endif /* LASTLOG_SUPPORT */ /* ------------------------------------------------------------------------- */ #endif /* UTMP_SUPPORT */ rxvt-2.7.10/src/init.c010064400001440000024000001310660757331034300131510ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: init.c *----------------------------------------------------------------------* * $Id: init.c,v 1.103 2002/12/04 05:21:29 gcw Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1992 John Bovey, University of Kent at Canterbury * - original version * Copyright (c) 1994 Robert Nation * - extensive modifications * Copyright (c) 1998-2001 Geoff Wing * - extensive modifications * Copyright (c) 1999 D J Hawkey Jr * - QNX support * * 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 of the License, 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. *---------------------------------------------------------------------*/ /* * Initialisation routines. */ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "init.h" #include const char *const def_colorName[] = { COLOR_FOREGROUND, COLOR_BACKGROUND, /* low-intensity colors */ "Black", /* 0: black (#000000) */ #ifndef NO_BRIGHTCOLOR "Red3", /* 1: red (#CD0000) */ "Green3", /* 2: green (#00CD00) */ "Yellow3", /* 3: yellow (#CDCD00) */ "Blue3", /* 4: blue (#0000CD) */ "Magenta3", /* 5: magenta (#CD00CD) */ "Cyan3", /* 6: cyan (#00CDCD) */ # ifdef XTERM_COLORS "Grey90", /* 7: white (#E5E5E5) */ # else "AntiqueWhite", /* 7: white (#FAEBD7) */ # endif /* high-intensity colors */ # ifdef XTERM_COLORS "Grey30", /* 8: bright black (#4D4D4D) */ # else "Grey25", /* 8: bright black (#404040) */ # endif #endif /* NO_BRIGHTCOLOR */ "Red", /* 1/9: bright red (#FF0000) */ "Green", /* 2/10: bright green (#00FF00) */ "Yellow", /* 3/11: bright yellow (#FFFF00) */ "Blue", /* 4/12: bright blue (#0000FF) */ "Magenta", /* 5/13: bright magenta (#FF00FF) */ "Cyan", /* 6/14: bright cyan (#00FFFF) */ "White", /* 7/15: bright white (#FFFFFF) */ #ifdef TTY_256COLOR "rgb:00/00/00", /* default 16-255 color table */ "rgb:00/00/2a", "rgb:00/00/55", "rgb:00/00/7f", "rgb:00/00/aa", "rgb:00/00/d4", "rgb:00/2a/00", "rgb:00/2a/2a", "rgb:00/2a/55", "rgb:00/2a/7f", "rgb:00/2a/aa", "rgb:00/2a/d4", "rgb:00/55/00", "rgb:00/55/2a", "rgb:00/55/55", "rgb:00/55/7f", "rgb:00/55/aa", "rgb:00/55/d4", "rgb:00/7f/00", "rgb:00/7f/2a", "rgb:00/7f/55", "rgb:00/7f/7f", "rgb:00/7f/aa", "rgb:00/7f/d4", "rgb:00/aa/00", "rgb:00/aa/2a", "rgb:00/aa/55", "rgb:00/aa/7f", "rgb:00/aa/aa", "rgb:00/aa/d4", "rgb:00/d4/00", "rgb:00/d4/2a", "rgb:00/d4/55", "rgb:00/d4/7f", "rgb:00/d4/aa", "rgb:00/d4/d4", "rgb:2a/00/00", "rgb:2a/00/2a", "rgb:2a/00/55", "rgb:2a/00/7f", "rgb:2a/00/aa", "rgb:2a/00/d4", "rgb:2a/2a/00", "rgb:2a/2a/2a", "rgb:2a/2a/55", "rgb:2a/2a/7f", "rgb:2a/2a/aa", "rgb:2a/2a/d4", "rgb:2a/55/00", "rgb:2a/55/2a", "rgb:2a/55/55", "rgb:2a/55/7f", "rgb:2a/55/aa", "rgb:2a/55/d4", "rgb:2a/7f/00", "rgb:2a/7f/2a", "rgb:2a/7f/55", "rgb:2a/7f/7f", "rgb:2a/7f/aa", "rgb:2a/7f/d4", "rgb:2a/aa/00", "rgb:2a/aa/2a", "rgb:2a/aa/55", "rgb:2a/aa/7f", "rgb:2a/aa/aa", "rgb:2a/aa/d4", "rgb:2a/d4/00", "rgb:2a/d4/2a", "rgb:2a/d4/55", "rgb:2a/d4/7f", "rgb:2a/d4/aa", "rgb:2a/d4/d4", "rgb:55/00/00", "rgb:55/00/2a", "rgb:55/00/55", "rgb:55/00/7f", "rgb:55/00/aa", "rgb:55/00/d4", "rgb:55/2a/00", "rgb:55/2a/2a", "rgb:55/2a/55", "rgb:55/2a/7f", "rgb:55/2a/aa", "rgb:55/2a/d4", "rgb:55/55/00", "rgb:55/55/2a", "rgb:55/55/55", "rgb:55/55/7f", "rgb:55/55/aa", "rgb:55/55/d4", "rgb:55/7f/00", "rgb:55/7f/2a", "rgb:55/7f/55", "rgb:55/7f/7f", "rgb:55/7f/aa", "rgb:55/7f/d4", "rgb:55/aa/00", "rgb:55/aa/2a", "rgb:55/aa/55", "rgb:55/aa/7f", "rgb:55/aa/aa", "rgb:55/aa/d4", "rgb:55/d4/00", "rgb:55/d4/2a", "rgb:55/d4/55", "rgb:55/d4/7f", "rgb:55/d4/aa", "rgb:55/d4/d4", "rgb:7f/00/00", "rgb:7f/00/2a", "rgb:7f/00/55", "rgb:7f/00/7f", "rgb:7f/00/aa", "rgb:7f/00/d4", "rgb:7f/2a/00", "rgb:7f/2a/2a", "rgb:7f/2a/55", "rgb:7f/2a/7f", "rgb:7f/2a/aa", "rgb:7f/2a/d4", "rgb:7f/55/00", "rgb:7f/55/2a", "rgb:7f/55/55", "rgb:7f/55/7f", "rgb:7f/55/aa", "rgb:7f/55/d4", "rgb:7f/7f/00", "rgb:7f/7f/2a", "rgb:7f/7f/55", "rgb:7f/7f/7f", "rgb:7f/7f/aa", "rgb:7f/7f/d4", "rgb:7f/aa/00", "rgb:7f/aa/2a", "rgb:7f/aa/55", "rgb:7f/aa/7f", "rgb:7f/aa/aa", "rgb:7f/aa/d4", "rgb:7f/d4/00", "rgb:7f/d4/2a", "rgb:7f/d4/55", "rgb:7f/d4/7f", "rgb:7f/d4/aa", "rgb:7f/d4/d4", "rgb:aa/00/00", "rgb:aa/00/2a", "rgb:aa/00/55", "rgb:aa/00/7f", "rgb:aa/00/aa", "rgb:aa/00/d4", "rgb:aa/2a/00", "rgb:aa/2a/2a", "rgb:aa/2a/55", "rgb:aa/2a/7f", "rgb:aa/2a/aa", "rgb:aa/2a/d4", "rgb:aa/55/00", "rgb:aa/55/2a", "rgb:aa/55/55", "rgb:aa/55/7f", "rgb:aa/55/aa", "rgb:aa/55/d4", "rgb:aa/7f/00", "rgb:aa/7f/2a", "rgb:aa/7f/55", "rgb:aa/7f/7f", "rgb:aa/7f/aa", "rgb:aa/7f/d4", "rgb:aa/aa/00", "rgb:aa/aa/2a", "rgb:aa/aa/55", "rgb:aa/aa/7f", "rgb:aa/aa/aa", "rgb:aa/aa/d4", "rgb:aa/d4/00", "rgb:aa/d4/2a", "rgb:aa/d4/55", "rgb:aa/d4/7f", "rgb:aa/d4/aa", "rgb:aa/d4/d4", "rgb:d4/00/00", "rgb:d4/00/2a", "rgb:d4/00/55", "rgb:d4/00/7f", "rgb:d4/00/aa", "rgb:d4/00/d4", "rgb:d4/2a/00", "rgb:d4/2a/2a", "rgb:d4/2a/55", "rgb:d4/2a/7f", "rgb:d4/2a/aa", "rgb:d4/2a/d4", "rgb:d4/55/00", "rgb:d4/55/2a", "rgb:d4/55/55", "rgb:d4/55/7f", "rgb:d4/55/aa", "rgb:d4/55/d4", "rgb:d4/7f/00", "rgb:d4/7f/2a", "rgb:d4/7f/55", "rgb:d4/7f/7f", "rgb:d4/7f/aa", "rgb:d4/7f/d4", "rgb:d4/aa/00", "rgb:d4/aa/2a", "rgb:d4/aa/55", "rgb:d4/aa/7f", "rgb:d4/aa/aa", "rgb:d4/aa/d4", "rgb:d4/d4/00", "rgb:d4/d4/2a", "rgb:d4/d4/55", "rgb:d4/d4/7f", "rgb:d4/d4/aa", "rgb:d4/d4/d4", "rgb:08/08/08", "rgb:12/12/12", "rgb:1c/1c/1c", "rgb:26/26/26", "rgb:30/30/30", "rgb:3a/3a/3a", "rgb:44/44/44", "rgb:4e/4e/4e", "rgb:58/58/58", "rgb:62/62/62", "rgb:6c/6c/6c", "rgb:76/76/76", "rgb:80/80/80", "rgb:8a/8a/8a", "rgb:94/94/94", "rgb:9e/9e/9e", "rgb:a8/a8/a8", "rgb:b2/b2/b2", "rgb:bc/bc/bc", "rgb:c6/c6/c6", "rgb:d0/d0/d0", "rgb:da/da/da", "rgb:e4/e4/e4", "rgb:ee/ee/ee", #endif #ifndef NO_CURSORCOLOR COLOR_CURSOR_BACKGROUND, COLOR_CURSOR_FOREGROUND, #endif /* ! NO_CURSORCOLOR */ NULL, /* Color_pointer */ NULL, /* Color_border */ #ifndef NO_BOLD_UNDERLINE_REVERSE NULL, /* Color_BD */ NULL, /* Color_UL */ NULL, /* Color_RV */ #endif /* ! NO_BOLD_UNDERLINE_REVERSE */ #ifdef OPTION_HC NULL, #endif #ifdef KEEP_SCROLLCOLOR COLOR_SCROLLBAR, COLOR_SCROLLTROUGH, #endif /* KEEP_SCROLLCOLOR */ }; const char *const xa_names[NUM_XA] = { "COMPOUND_TEXT", "MULTIPLE", "TARGETS", "TEXT", "TIMESTAMP", "VT_SELECTION", "INCR", "WM_DELETE_WINDOW", #ifdef TRANSPARENT "_XROOTPMAP_ID", #endif #ifdef OFFIX_DND "DndProtocol", "DndSelection", #endif "CLIPBOARD" }; /*----------------------------------------------------------------------*/ /* substitute system functions */ #if defined(__svr4__) && ! defined(_POSIX_VERSION) /* INTPROTO */ int rxvt_getdtablesize(void) { struct rlimit rlim; getrlimit(RLIMIT_NOFILE, &rlim); return rlim.rlim_cur; } #endif /*----------------------------------------------------------------------*/ /* EXTPROTO */ int rxvt_init_vars(rxvt_t *r) { struct rxvt_hidden *h; #ifndef NULLS_ARE_NOT_ZEROS MEMSET(r, 0, sizeof(rxvt_t)); #endif h = r->h = (struct rxvt_hidden *)rxvt_calloc(1, sizeof(struct rxvt_hidden)); r->PixColors = (Pixel *)rxvt_malloc(sizeof(Pixel) * TOTAL_COLORS); if (r->h == NULL || r->PixColors == NULL) return -1; #ifdef NULLS_ARE_NOT_ZEROS r->Xdisplay = NULL; r->TermWin.fontset = NULL; #ifndef NO_BOLDFONT r->TermWin.boldFont_loaded = NULL; #endif r->h->ttydev = NULL; h->xa[XA_COMPOUND_TEXT] = h->xa[XA_MULTIPLE] = h->xa[XA_TARGETS] = h->xa[XA_TEXT] = h->xa[XA_TIMESTAMP] = h->xa[XA_VT_SELECTION] = h->xa[XA_INCR] = NULL; h->locale = NULL; # ifdef MENUBAR h->menubarGC = None; h->BuildMenu = NULL; /* the menu currently being built */ # if (MENUBAR_MAX > 1) h->CurrentBar = NULL; # endif /* (MENUBAR_MAX > 1) */ # endif # ifdef USE_XIM h->Input_Context = NULL; # endif h->v_bufstr = NULL; # ifdef RXVT_GRAPHICS h->gr_root = NULL; h->gr_last_id = None; # endif h->buffer = NULL; h->compose.compose_ptr = NULL; #endif /* NULLS_ARE_NOT_ZEROS */ #if defined(XPM_BACKGROUND) || defined(TRANSPARENT) r->TermWin.pixmap = None; #endif #ifdef UTMP_SUPPORT h->next_utmp_action = SAVE; #endif #ifndef NO_SETOWNER_TTYDEV h->next_tty_action = SAVE; #endif h->MEvent.time = CurrentTime; h->MEvent.button = AnyButton; r->Options = DEFAULT_OPTIONS; h->want_refresh = 1; h->cmd_pid = -1; r->cmd_fd = r->tty_fd = r->Xfd = -1; h->PrivateModes = h->SavedModes = PrivMode_Default; r->TermWin.focus = 1; r->TermWin.ncol = 80; r->TermWin.nrow = 24; r->TermWin.int_bwidth = INTERNALBORDERWIDTH; r->TermWin.ext_bwidth = EXTERNALBORDERWIDTH; r->TermWin.lineSpace = LINESPACE; r->TermWin.saveLines = SAVELINES; r->numPixColors = TOTAL_COLORS; #ifndef NO_NEW_SELECTION r->selection_style = NEW_SELECT; #else r->selection_style = OLD_SELECT; #endif #ifndef NO_BRIGHTCOLOR h->colorfgbg = DEFAULT_RSTYLE; #endif #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) h->ks_bigfont = XK_greater; h->ks_smallfont = XK_less; #endif #ifdef GREEK_SUPPORT h->ks_greekmodeswith = GREEK_KEYBOARD_MODESWITCH; #endif h->refresh_limit = 1; h->refresh_type = SLOW_REFRESH; h->prev_nrow = h->prev_ncol = 0; #ifdef MULTICHAR_SET # ifdef MULTICHAR_ENCODING r->encoding_method = MULTICHAR_ENCODING; # endif h->multichar_decode = rxvt_euc2jis; #endif h->oldcursor.row = h->oldcursor.col = -1; #ifdef XPM_BACKGROUND /* h->bgPixmap.w = h->bgPixmap.h = 0; */ h->bgPixmap.x = h->bgPixmap.y = 50; h->bgPixmap.pixmap = None; #endif h->last_bot = h->last_state = -1; #ifdef MENUBAR h->menu_readonly = 1; # if !(MENUBAR_MAX > 1) h->CurrentBar = &(h->BarList); # endif /* (MENUBAR_MAX > 1) */ #endif return 0; } /* EXTPROTO */ void rxvt_init_secondary(rxvt_t *r) { #ifdef TTY_GID_SUPPORT struct group *gr = getgrnam("tty"); if (gr) { /* change group ownership of tty to "tty" */ r->h->ttymode = S_IRUSR | S_IWUSR | S_IWGRP; r->h->ttygid = gr->gr_gid; } else #endif /* TTY_GID_SUPPORT */ { r->h->ttymode = S_IRUSR | S_IWUSR | S_IWGRP | S_IWOTH; r->h->ttygid = getgid(); } #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) r->h->locale = setlocale(LC_CTYPE, ""); #endif } /*----------------------------------------------------------------------*/ /* EXTPROTO */ const char ** rxvt_init_resources(rxvt_t *r, int argc, const char *const *argv) { int i, r_argc; char *val; const char **cmd_argv, **r_argv; const char **rs; /* * Look for -exec option. Find => split and make cmd_argv[] of command args */ for (r_argc = 0; r_argc < argc; r_argc++) if (!STRCMP(argv[r_argc], "-e") || !STRCMP(argv[r_argc], "-exec")) break; r_argv = (const char **)rxvt_malloc(sizeof(char *) * (r_argc + 1)); for (i = 0; i < r_argc; i++) r_argv[i] = (const char *)argv[i]; r_argv[i] = NULL; if (r_argc == argc) cmd_argv = NULL; else { cmd_argv = (const char **)rxvt_malloc(sizeof(char *) * (argc - r_argc)); for (i = 0; i < argc - r_argc - 1; i++) cmd_argv[i] = (const char *)argv[i + r_argc + 1]; cmd_argv[i] = NULL; } /* clear all resources */ rs = r->h->rs; for (i = 0; i < NUM_RESOURCES;) rs[i++] = NULL; rs[Rs_name] = rxvt_r_basename(argv[0]); /* * Open display, get options/resources and create the window */ if ((rs[Rs_display_name] = getenv("DISPLAY")) == NULL) rs[Rs_display_name] = ":0"; rxvt_get_options(r, r_argc, r_argv); free(r_argv); #ifdef LOCAL_X_IS_UNIX if (rs[Rs_display_name][0] == ':') { val = rxvt_malloc(5 + STRLEN(rs[Rs_display_name])); STRCPY(val, "unix"); STRCAT(val, rs[Rs_display_name]); r->Xdisplay = XOpenDisplay(val); free(val); } #endif if (r->Xdisplay == NULL && (r->Xdisplay = XOpenDisplay(rs[Rs_display_name])) == NULL) { rxvt_print_error("can't open display %s", rs[Rs_display_name]); exit(EXIT_FAILURE); } rxvt_extract_resources(r, r->Xdisplay, rs[Rs_name]); /* * set any defaults not already set */ if (cmd_argv && cmd_argv[0]) { if (!rs[Rs_title]) rs[Rs_title] = rxvt_r_basename(cmd_argv[0]); if (!rs[Rs_iconName]) rs[Rs_iconName] = rs[Rs_title]; } else { if (!rs[Rs_title]) rs[Rs_title] = rs[Rs_name]; if (!rs[Rs_iconName]) rs[Rs_iconName] = rs[Rs_name]; } if (rs[Rs_saveLines] && (i = atoi(rs[Rs_saveLines])) >= 0) r->TermWin.saveLines = BOUND_POSITIVE_INT16(i); #ifndef NO_FRILLS if (rs[Rs_int_bwidth] && (i = atoi(rs[Rs_int_bwidth])) >= 0) r->TermWin.int_bwidth = min(i, 100); /* arbitrary limit */ if (rs[Rs_ext_bwidth] && (i = atoi(rs[Rs_ext_bwidth])) >= 0) r->TermWin.ext_bwidth = min(i, 100); /* arbitrary limit */ #endif #ifndef NO_LINESPACE if (rs[Rs_lineSpace] && (i = atoi(rs[Rs_lineSpace])) >= 0) r->TermWin.lineSpace = min(i, 100); /* arbitrary limit */ #endif /* no point having a scrollbar without having any scrollback! */ if (!r->TermWin.saveLines) r->Options &= ~Opt_scrollBar; #ifdef PRINTPIPE if (!rs[Rs_print_pipe]) rs[Rs_print_pipe] = PRINTPIPE; #endif if (!rs[Rs_cutchars]) rs[Rs_cutchars] = CUTCHARS; #ifndef NO_BACKSPACE_KEY if (!rs[Rs_backspace_key]) # ifdef DEFAULT_BACKSPACE r->h->key_backspace = DEFAULT_BACKSPACE; # else r->h->key_backspace = "DEC"; /* can toggle between \033 or \177 */ # endif else { val = STRDUP(rs[Rs_backspace_key]); rxvt_Str_trim(val); rxvt_Str_escaped(val); r->h->key_backspace = val; } #endif #ifndef NO_DELETE_KEY if (!rs[Rs_delete_key]) # ifdef DEFAULT_DELETE r->h->key_delete = DEFAULT_DELETE; # else r->h->key_delete = "\033[3~"; # endif else { val = STRDUP(rs[Rs_delete_key]); rxvt_Str_trim(val); rxvt_Str_escaped(val); r->h->key_delete = val; } #endif if (rs[Rs_answerbackstring]) { rxvt_Str_trim((char *)rs[Rs_answerbackstring]); rxvt_Str_escaped((char *)rs[Rs_answerbackstring]); } if (rs[Rs_selectstyle]) { if (STRNCASECMP(rs[Rs_selectstyle], "oldword", 7) == 0) r->selection_style = OLD_WORD_SELECT; #ifndef NO_OLD_SELECTION else if (STRNCASECMP(rs[Rs_selectstyle], "old", 3) == 0) r->selection_style = OLD_SELECT; #endif } #ifdef HAVE_SCROLLBARS rxvt_setup_scrollbar(r, rs[Rs_scrollBar_align], rs[Rs_scrollstyle], rs[Rs_scrollBar_thickness]); #endif #if 0 /* #ifndef NO_BOLDFONT */ if (rs[Rs_font] == NULL && rs[Rs_boldFont] != NULL) { rs[Rs_font] = rs[Rs_boldFont]; rs[Rs_boldFont] = NULL; } #endif rxvt_set_defaultfont(r, rs); #ifdef XTERM_REVERSE_VIDEO /* this is how xterm implements reverseVideo */ if (r->Options & Opt_reverseVideo) { if (!rs[Rs_color + Color_fg]) rs[Rs_color + Color_fg] = def_colorName[Color_bg]; if (!rs[Rs_color + Color_bg]) rs[Rs_color + Color_bg] = def_colorName[Color_fg]; } #endif for (i = 0; i < NRS_COLORS; i++) if (!rs[Rs_color + i]) rs[Rs_color + i] = def_colorName[i]; #ifndef XTERM_REVERSE_VIDEO /* this is how we implement reverseVideo */ if (r->Options & Opt_reverseVideo) SWAP_IT(rs[Rs_color + Color_fg], rs[Rs_color + Color_bg], const char *); #endif /* convenient aliases for setting fg/bg to colors */ rxvt_color_aliases(r, Color_fg); rxvt_color_aliases(r, Color_bg); #ifndef NO_CURSORCOLOR rxvt_color_aliases(r, Color_cursor); rxvt_color_aliases(r, Color_cursor2); #endif /* NO_CURSORCOLOR */ rxvt_color_aliases(r, Color_pointer); rxvt_color_aliases(r, Color_border); #ifndef NO_BOLD_UNDERLINE_REVERSE rxvt_color_aliases(r, Color_BD); rxvt_color_aliases(r, Color_UL); rxvt_color_aliases(r, Color_RV); #endif /* ! NO_BOLD_UNDERLINE_REVERSE */ return cmd_argv; } /*----------------------------------------------------------------------*/ /* EXTPROTO */ void rxvt_init_env(rxvt_t *r) { int i; unsigned int u; char *val; #ifdef DISPLAY_IS_IP /* Fixup display_name for export over pty to any interested terminal * clients via "ESC[7n" (e.g. shells). Note we use the pure IP number * (for the first non-loopback interface) that we get from * rxvt_network_display(). This is more "name-resolution-portable", if you * will, and probably allows for faster x-client startup if your name * server is beyond a slow link or overloaded at client startup. Of * course that only helps the shell's child processes, not us. * * Giving out the display_name also affords a potential security hole */ val = rxvt_network_display(r->h->rs[Rs_display_name]); r->h->rs[Rs_display_name] = (const char *)val; if (val == NULL) #endif /* DISPLAY_IS_IP */ val = XDisplayString(r->Xdisplay); if (r->h->rs[Rs_display_name] == NULL) r->h->rs[Rs_display_name] = val; /* use broken `:0' value */ i = STRLEN(val); r->h->env_display = rxvt_malloc((i + 9) * sizeof(char)); sprintf(r->h->env_display, "DISPLAY=%s", val); /* avoiding the math library: * i = (int)(ceil(log10((unsigned int)r->TermWin.parent[0]))) */ for (i = 0, u = (unsigned int)r->TermWin.parent[0]; u; u /= 10, i++) ; MAX_IT(i, 1); r->h->env_windowid = rxvt_malloc((i + 10) * sizeof(char)); sprintf(r->h->env_windowid, "WINDOWID=%u", (unsigned int)r->TermWin.parent[0]); /* add entries to the environment: * @ DISPLAY: in case we started with -display * @ WINDOWID: X window id number of the window * @ COLORTERM: terminal sub-name and also indicates its color * @ TERM: terminal name * @ TERMINFO: path to terminfo directory */ putenv(r->h->env_display); putenv(r->h->env_windowid); #ifdef RXVT_TERMINFO putenv("TERMINFO=" RXVT_TERMINFO); #endif if (XDEPTH <= 2) putenv("COLORTERM=" COLORTERMENV "-mono"); else putenv("COLORTERM=" COLORTERMENVFULL); if (r->h->rs[Rs_term_name] != NULL) { r->h->env_term = rxvt_malloc((STRLEN(r->h->rs[Rs_term_name]) + 6) * sizeof(char)); sprintf(r->h->env_term, "TERM=%s", r->h->rs[Rs_term_name]); putenv(r->h->env_term); } else putenv("TERM=" TERMENV); #ifdef HAVE_UNSETENV /* avoid passing old settings and confusing term size */ unsetenv("LINES"); unsetenv("COLUMNS"); unsetenv("TERMCAP"); /* terminfo should be okay */ #endif /* HAVE_UNSETENV */ } /*----------------------------------------------------------------------*/ /* * This is more or less stolen straight from XFree86 xterm. * This should support all European type languages. */ /* EXTPROTO */ void rxvt_init_xlocale(rxvt_t *r) { #ifdef USE_XIM if (r->h->locale == NULL) rxvt_print_error("Setting locale failed."); else { Atom wmlocale; wmlocale = XInternAtom(r->Xdisplay, "WM_LOCALE_NAME", False); XChangeProperty(r->Xdisplay, r->TermWin.parent[0], wmlocale, XA_STRING, 8, PropModeReplace, (unsigned char *)r->h->locale, STRLEN(r->h->locale)); if (XSupportsLocale() != True) { rxvt_print_error("The locale is not supported by Xlib"); return; } rxvt_setTermFontSet(r, 0); /* see if we can connect yet */ rxvt_IMInstantiateCallback(r->Xdisplay, NULL, NULL); /* To avoid Segmentation Fault in C locale: Solaris only? */ if (STRCMP(r->h->locale, "C")) XRegisterIMInstantiateCallback(r->Xdisplay, NULL, NULL, NULL, rxvt_IMInstantiateCallback, NULL); } #endif } /*----------------------------------------------------------------------*/ /* EXTPROTO */ void rxvt_init_command(rxvt_t *r, const char *const *argv) { /* * Initialize the command connection. * This should be called after the X server connection is established. */ int i; for (i = 0; i < NUM_XA; i++) r->h->xa[i] = XInternAtom(r->Xdisplay, xa_names[i], False); /* Enable delete window protocol */ XSetWMProtocols(r->Xdisplay, r->TermWin.parent[0], &(r->h->xa[XA_WMDELETEWINDOW]), 1); #ifdef USING_W11LIB /* enable W11 callbacks */ W11AddEventHandler(r->Xdisplay, rxvt_W11_process_x_event); #endif /* get number of available file descriptors */ #if defined(_POSIX_VERSION) || ! defined(__svr4__) r->num_fds = (int)sysconf(_SC_OPEN_MAX); #else r->num_fds = rxvt_getdtablesize(); #endif #ifdef META8_OPTION r->h->meta_char = (r->Options & Opt_meta8 ? 0x80 : C0_ESC); #endif rxvt_get_ourmods(r); if (!(r->Options & Opt_scrollTtyOutput)) r->h->PrivateModes |= PrivMode_TtyOutputInh; if (r->Options & Opt_scrollTtyKeypress) r->h->PrivateModes |= PrivMode_Keypress; if (!(r->Options & Opt_jumpScroll)) r->h->PrivateModes |= PrivMode_smoothScroll; #ifndef NO_BACKSPACE_KEY if (STRCMP(r->h->key_backspace, "DEC") == 0) r->h->PrivateModes |= PrivMode_HaveBackSpace; #endif /* add value for scrollBar */ if (scrollbar_visible(r)) { r->h->PrivateModes |= PrivMode_scrollBar; r->h->SavedModes |= PrivMode_scrollBar; } if (menubar_visible(r)) { r->h->PrivateModes |= PrivMode_menuBar; r->h->SavedModes |= PrivMode_menuBar; } greek_init(); r->Xfd = XConnectionNumber(r->Xdisplay); if ((r->cmd_fd = rxvt_run_command(r, argv)) < 0) { rxvt_print_error("aborting"); exit(EXIT_FAILURE); } } /*----------------------------------------------------------------------*/ /* INTPROTO */ void rxvt_Get_Colours(rxvt_t *r) { int i; for (i = 0; i < (XDEPTH <= 2 ? 2 : NRS_COLORS); i++) { XColor xcol; if (!r->h->rs[Rs_color + i]) continue; if (!rxvt_rXParseAllocColor(r, &xcol, r->h->rs[Rs_color + i])) { #ifndef XTERM_REVERSE_VIDEO if (i < 2 && (r->Options & Opt_reverseVideo)) { r->h->rs[Rs_color + i] = def_colorName[!i]; } else #endif r->h->rs[Rs_color + i] = def_colorName[i]; if (!r->h->rs[Rs_color + i]) continue; if (!rxvt_rXParseAllocColor(r, &xcol, r->h->rs[Rs_color + i])) { switch (i) { case Color_fg: case Color_bg: /* fatal: need bg/fg color */ rxvt_print_error("aborting"); exit(EXIT_FAILURE); /* NOTREACHED */ break; #ifndef NO_CURSORCOLOR case Color_cursor2: xcol.pixel = r->PixColors[Color_fg]; break; #endif /* ! NO_CURSORCOLOR */ case Color_pointer: xcol.pixel = r->PixColors[Color_fg]; break; default: xcol.pixel = r->PixColors[Color_bg]; /* None */ break; } } } r->PixColors[i] = xcol.pixel; SET_PIXCOLOR(r->h, i); } if (XDEPTH <= 2 || !r->h->rs[Rs_color + Color_pointer]) r->PixColors[Color_pointer] = r->PixColors[Color_fg]; if (XDEPTH <= 2 || !r->h->rs[Rs_color + Color_border]) r->PixColors[Color_border] = r->PixColors[Color_fg]; /* * get scrollBar/menuBar shadow colors * * The calculations of topShadow/bottomShadow values are adapted * from the fvwm window manager. */ #ifdef KEEP_SCROLLCOLOR if (XDEPTH <= 2) { /* Monochrome */ r->PixColors[Color_scroll] = r->PixColors[Color_fg]; r->PixColors[Color_topShadow] = r->PixColors[Color_bg]; r->PixColors[Color_bottomShadow] = r->PixColors[Color_bg]; } else { XColor xcol[3]; /* xcol[0] == white * xcol[1] == top shadow * xcol[2] == bot shadow */ xcol[1].pixel = r->PixColors[Color_scroll]; # ifdef PREFER_24BIT xcol[0].red = xcol[0].green = xcol[0].blue = (unsigned short)~0; rxvt_rXAllocColor(r, &(xcol[0]), "White"); /* XFreeColors(r->Xdisplay, XCMAP, &(xcol[0].pixel), 1, ~0); */ XQueryColors(r->Xdisplay, XCMAP, &(xcol[1]), 1); # else xcol[0].pixel = WhitePixel(r->Xdisplay, Xscreen); XQueryColors(r->Xdisplay, XCMAP, xcol, 2); # endif /* bottomShadowColor */ xcol[2].red = xcol[1].red / 2; xcol[2].green = xcol[1].green / 2; xcol[2].blue = xcol[1].blue / 2; if (!rxvt_rXAllocColor(r, &(xcol[2]), "Color_bottomShadow")) xcol[2].pixel = r->PixColors[Color_Black]; r->PixColors[Color_bottomShadow] = xcol[2].pixel; /* topShadowColor */ xcol[1].red = max((xcol[0].red / 5), xcol[1].red); xcol[1].green = max((xcol[0].green / 5), xcol[1].green); xcol[1].blue = max((xcol[0].blue / 5), xcol[1].blue); xcol[1].red = min(xcol[0].red, (xcol[1].red * 7) / 5); xcol[1].green = min(xcol[0].green, (xcol[1].green * 7) / 5); xcol[1].blue = min(xcol[0].blue, (xcol[1].blue * 7) / 5); if (!rxvt_rXAllocColor(r, &(xcol[1]), "Color_topShadow")) xcol[1].pixel = r->PixColors[Color_White]; r->PixColors[Color_topShadow] = xcol[1].pixel; } #endif /* KEEP_SCROLLCOLOR */ } /*----------------------------------------------------------------------*/ /* color aliases, fg/bg bright-bold */ /* INTPROTO */ void rxvt_color_aliases(rxvt_t *r, int idx) { if (r->h->rs[Rs_color + idx] && isdigit(*(r->h->rs[Rs_color + idx]))) { int i = atoi(r->h->rs[Rs_color + idx]); if (i >= 8 && i <= 15) { /* bright colors */ i -= 8; #ifndef NO_BRIGHTCOLOR r->h->rs[Rs_color + idx] = r->h->rs[Rs_color + minBrightCOLOR + i]; return; #endif } if (i >= 0 && i <= 7) /* normal colors */ r->h->rs[Rs_color + idx] = r->h->rs[Rs_color + minCOLOR + i]; } } /*----------------------------------------------------------------------*/ /* * Probe the modifier keymap to get the Meta (Alt) and Num_Lock settings * Use resource ``modifier'' to override the Meta modifier */ /* INTPROTO */ void rxvt_get_ourmods(rxvt_t *r) { int i, j, k; int requestedmeta, realmeta, realalt; const char *cm, *rsmod; XModifierKeymap *map; KeyCode *kc; const unsigned int modmasks[] = { Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask }; requestedmeta = realmeta = realalt = 0; rsmod = r->h->rs[Rs_modifier]; if (rsmod && STRCASECMP(rsmod, "mod1") >= 0 && STRCASECMP(rsmod, "mod5") <= 0) requestedmeta = rsmod[3] - '0'; map = XGetModifierMapping(r->Xdisplay); kc = map->modifiermap; for (i = 1; i < 6; i++) { k = (i + 2) * map->max_keypermod; /* skip shift/lock/control */ for (j = map->max_keypermod; j--; k++) { if (kc[k] == 0) break; switch (XKeycodeToKeysym(r->Xdisplay, kc[k], 0)) { case XK_Num_Lock: r->h->ModNumLockMask = modmasks[i - 1]; /* FALLTHROUGH */ default: continue; /* for(;;) */ case XK_Meta_L: case XK_Meta_R: cm = "meta"; realmeta = i; break; case XK_Alt_L: case XK_Alt_R: cm = "alt"; realalt = i; break; case XK_Super_L: case XK_Super_R: cm = "super"; break; case XK_Hyper_L: case XK_Hyper_R: cm = "hyper"; break; } if (rsmod && STRNCASECMP(rsmod, cm, STRLEN(cm)) == 0) requestedmeta = i; } } XFreeModifiermap(map); i = (requestedmeta ? requestedmeta : (realmeta ? realmeta : (realalt ? realalt : 0))); if (i) r->h->ModMetaMask = modmasks[i - 1]; } /*----------------------------------------------------------------------*/ /* rxvt_Create_Windows() - Open and map the window */ /* EXTPROTO */ void rxvt_Create_Windows(rxvt_t *r, int argc, const char *const *argv) { XClassHint classHint; XWMHints wmHint; XGCValues gcvalue; #ifdef PREFER_24BIT XSetWindowAttributes attributes; XWindowAttributes gattr; XCMAP = DefaultColormap(r->Xdisplay, Xscreen); XVISUAL = DefaultVisual(r->Xdisplay, Xscreen); if (r->Options & Opt_transparent) { XGetWindowAttributes(r->Xdisplay, RootWindow(r->Xdisplay, Xscreen), &gattr); XDEPTH = gattr.depth; } else { XDEPTH = DefaultDepth(r->Xdisplay, Xscreen); /* * If depth is not 24, look for a 24bit visual. */ if (XDEPTH != 24) { XVisualInfo vinfo; if (XMatchVisualInfo(r->Xdisplay, Xscreen, 24, TrueColor, &vinfo)) { XDEPTH = 24; XVISUAL = vinfo.visual; XCMAP = XCreateColormap(r->Xdisplay, RootWindow(r->Xdisplay, Xscreen), XVISUAL, AllocNone); } } } #endif /* grab colors before netscape does */ rxvt_Get_Colours(r); rxvt_change_font(r, 1, NULL); rxvt_window_calc(r, 0, 0); r->h->old_width = r->szHint.width; r->h->old_height = r->szHint.height; /* parent window - reverse video so we can see placement errors * sub-window placement & size in rxvt_resize_subwindows() */ #ifdef PREFER_24BIT attributes.background_pixel = r->PixColors[Color_fg]; attributes.border_pixel = r->PixColors[Color_border]; attributes.colormap = XCMAP; r->TermWin.parent[0] = XCreateWindow(r->Xdisplay, Xroot, r->szHint.x, r->szHint.y, r->szHint.width, r->szHint.height, r->TermWin.ext_bwidth, XDEPTH, InputOutput, XVISUAL, CWBackPixel | CWBorderPixel | CWColormap, &attributes); #else r->TermWin.parent[0] = XCreateSimpleWindow(r->Xdisplay, Xroot, r->szHint.x, r->szHint.y, r->szHint.width, r->szHint.height, r->TermWin.ext_bwidth, r->PixColors[Color_border], r->PixColors[Color_fg]); #endif rxvt_xterm_seq(r, XTerm_title, r->h->rs[Rs_title], CHAR_ST); rxvt_xterm_seq(r, XTerm_iconName, r->h->rs[Rs_iconName], CHAR_ST); classHint.res_name = (char *)r->h->rs[Rs_name]; classHint.res_class = (char *)APL_CLASS; wmHint.flags = (InputHint | StateHint | WindowGroupHint); wmHint.input = True; wmHint.initial_state = (r->Options & Opt_iconic ? IconicState : NormalState); wmHint.window_group = r->TermWin.parent[0]; XSetWMProperties(r->Xdisplay, r->TermWin.parent[0], NULL, NULL, (char **)argv, argc, &r->szHint, &wmHint, &classHint); XSelectInput(r->Xdisplay, r->TermWin.parent[0], (KeyPressMask #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) | KeyReleaseMask #endif | FocusChangeMask | VisibilityChangeMask | StructureNotifyMask)); /* vt cursor: Black-on-White is standard, but this is more popular */ r->TermWin_cursor = XCreateFontCursor(r->Xdisplay, XC_xterm); rxvt_recolour_cursor(r); #if defined(HAVE_SCROLLBARS) || defined(MENUBAR) /* cursor (menuBar/scrollBar): Black-on-White */ r->h->cursor_leftptr = XCreateFontCursor(r->Xdisplay, XC_left_ptr); #endif /* the vt window */ r->TermWin.vt = XCreateSimpleWindow(r->Xdisplay, r->TermWin.parent[0], r->h->window_vt_x, r->h->window_vt_y, TermWin_TotalWidth(), TermWin_TotalHeight(), 0, r->PixColors[Color_fg], r->PixColors[Color_bg]); #ifdef DEBUG_X XStoreName(r->Xdisplay, r->TermWin.vt, "vt window"); #endif XDefineCursor(r->Xdisplay, r->TermWin.vt, r->TermWin_cursor); XSelectInput(r->Xdisplay, r->TermWin.vt, (ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask | Button1MotionMask | Button3MotionMask)); #if defined(MENUBAR) && (MENUBAR_MAX > 1) if (menuBar_height()) { r->menuBar.win = XCreateSimpleWindow(r->Xdisplay, r->TermWin.parent[0], r->h->window_vt_x, 0, TermWin_TotalWidth(), menuBar_TotalHeight(), 0, r->PixColors[Color_fg], r->PixColors[Color_scroll]); #ifdef DEBUG_X XStoreName(r->Xdisplay, r->menuBar.win, "menubar"); #endif XDefineCursor(r->Xdisplay, r->menuBar.win, r->h->cursor_leftptr); XSelectInput(r->Xdisplay, r->menuBar.win, (ExposureMask | ButtonPressMask | ButtonReleaseMask | Button1MotionMask)); } #endif #ifdef XPM_BACKGROUND if (r->h->rs[Rs_backgroundPixmap] != NULL && !(r->Options & Opt_transparent)) { const char *p = r->h->rs[Rs_backgroundPixmap]; if ((p = STRCHR(p, ';')) != NULL) { p++; rxvt_scale_pixmap(r, p); } rxvt_set_bgPixmap(r, r->h->rs[Rs_backgroundPixmap]); rxvt_scr_touch(r, True); } #endif /* graphics context for the vt window */ gcvalue.font = r->TermWin.font->fid; gcvalue.foreground = r->PixColors[Color_fg]; gcvalue.background = r->PixColors[Color_bg]; gcvalue.graphics_exposures = 1; r->TermWin.gc = XCreateGC(r->Xdisplay, r->TermWin.vt, GCForeground | GCBackground | GCFont | GCGraphicsExposures, &gcvalue); #if defined(MENUBAR) || defined(RXVT_SCROLLBAR) gcvalue.foreground = r->PixColors[Color_topShadow]; r->h->topShadowGC = XCreateGC(r->Xdisplay, r->TermWin.vt, GCForeground, &gcvalue); gcvalue.foreground = r->PixColors[Color_bottomShadow]; r->h->botShadowGC = XCreateGC(r->Xdisplay, r->TermWin.vt, GCForeground, &gcvalue); gcvalue.foreground = r->PixColors[(XDEPTH <= 2 ? Color_fg : Color_scroll)]; r->h->scrollbarGC = XCreateGC(r->Xdisplay, r->TermWin.vt, GCForeground, &gcvalue); #endif } /*----------------------------------------------------------------------*/ /* * Run the command in a subprocess and return a file descriptor for the * master end of the pseudo-teletype pair with the command talking to * the slave. */ /* INTPROTO */ int rxvt_run_command(rxvt_t *r, const char *const *argv) { int i, cfd; /* * Close all unused file descriptors * We don't want them, we don't need them. */ if ((i = open("/dev/null", O_RDONLY)) < 0) { /* TODO: BOO HISS */ dup2(STDERR_FILENO, STDIN_FILENO); } else if (i > STDIN_FILENO) { dup2(i, STDIN_FILENO); close(i); } dup2(STDERR_FILENO, STDOUT_FILENO); for (i = STDERR_FILENO + 1; i < r->num_fds; i++) { if ( #ifdef __sgi /* Alex Coventry says we need 4 & 7 too */ i == 4 || i == 7 || #endif i == r->Xfd) continue; close(i); } if ((r->Xfd < STDERR_FILENO + 1 #ifdef FD_SETSIZE || r->Xfd > FD_SETSIZE #endif ) && dup2(r->Xfd, STDERR_FILENO + 1) != -1) { close(r->Xfd); r->Xfd = STDERR_FILENO + 1; } /* get master (pty) */ if ((cfd = rxvt_get_pty(&(r->tty_fd), &(r->h->ttydev))) < 0) { rxvt_print_error("can't open pseudo-tty"); return -1; } #ifdef FD_SETSIZE if (r->Xfd > FD_SETSIZE || cfd > FD_SETSIZE) { rxvt_print_error("fd too high: %d max", FD_SETSIZE); rxvt_clean_exit(); exit(EXIT_FAILURE); } #endif fcntl(cfd, F_SETFL, O_NDELAY); /* get slave (tty) */ if (r->tty_fd < 0) { rxvt_privileged_ttydev(r, SAVE); if ((r->tty_fd = rxvt_get_tty(r->h->ttydev)) < 0) { close(cfd); rxvt_print_error("can't open slave tty %s", r->h->ttydev); return -1; } } rxvt_get_ttymode(&(r->h->tio)); /* install exit handler for cleanup */ #ifdef HAVE_ATEXIT atexit(rxvt_clean_exit); #else # ifdef HAVE_ON_EXIT on_exit(rxvt_clean_exit, NULL); /* non-ANSI exit handler */ # endif #endif signal(SIGHUP, rxvt_Exit_signal); #ifndef __svr4__ signal(SIGINT, rxvt_Exit_signal); #endif signal(SIGQUIT, rxvt_Exit_signal); signal(SIGTERM, rxvt_Exit_signal); signal(SIGCHLD, rxvt_Child_signal); /* need to trap SIGURG for SVR4 (Unixware) rlogin */ /* signal (SIGURG, SIG_DFL); */ #ifndef __QNX__ /* spin off the command interpreter */ switch (r->h->cmd_pid = fork()) { case -1: rxvt_print_error("can't fork"); return -1; case 0: close(cfd); /* only keep r->tty_fd and STDERR open */ close(r->Xfd); #ifdef __QNX__ rxvt_run_child(r, argv); #else if (rxvt_control_tty(r->tty_fd, r->h->ttydev) < 0) rxvt_print_error("could not obtain control of tty"); else { /* Reopen stdin, stdout and stderr over the tty file descriptor */ dup2(r->tty_fd, STDIN_FILENO); dup2(r->tty_fd, STDOUT_FILENO); dup2(r->tty_fd, STDERR_FILENO); if (r->tty_fd > 2) close(r->tty_fd); rxvt_run_child(r, argv); } #endif exit(EXIT_FAILURE); /* NOTREACHED */ default: close(r->tty_fd); /* keep STDERR_FILENO, r->cmd_fd, r->Xfd open */ break; } #else /* __QNX__ uses qnxspawn() */ fchmod(r->tty_fd, 0622); fcntl(r->tty_fd, F_SETFD, FD_CLOEXEC); fcntl(cfd, F_SETFD, FD_CLOEXEC); if (rxvt_run_child(r, argv) == -1) exit(EXIT_FAILURE); #endif /* * Reduce r->num_fds to what we use, so select() is more efficient */ r->num_fds = max(STDERR_FILENO, cfd); MAX_IT(r->num_fds, r->Xfd); #ifdef __sgi /* Alex Coventry says we need 4 & 7 too */ MAX_IT(r->num_fds, 7); #endif r->num_fds++; /* counts from 0 */ rxvt_privileged_utmp(r, SAVE); return cfd; } /* ------------------------------------------------------------------------- * * CHILD PROCESS OPERATIONS * * ------------------------------------------------------------------------- */ /* * The only open file descriptor is the slave tty - so no error messages. * returns are fatal */ /* INTPROTO */ int rxvt_run_child(rxvt_t *r, const char *const *argv) { char *login; SET_TTYMODE(STDIN_FILENO, &(r->h->tio)); /* init terminal attributes */ if (r->Options & Opt_console) { /* be virtual console, fail silently */ #ifdef TIOCCONS unsigned int on = 1; ioctl(STDIN_FILENO, TIOCCONS, &on); #elif defined (SRIOCSREDIR) int fd; fd = open(CONSOLE, O_WRONLY, 0); if (fd >= 0) { if (ioctl(fd, SRIOCSREDIR, NULL) < 0) close(fd); } #endif /* SRIOCSREDIR */ } /* set window size */ rxvt_tt_winsize(STDIN_FILENO, r->TermWin.ncol, r->TermWin.nrow); /* reset signals and spin off the command interpreter */ signal(SIGINT, SIG_DFL); signal(SIGQUIT, SIG_DFL); signal(SIGCHLD, SIG_DFL); /* * mimick login's behavior by disabling the job control signals * a shell that wants them can turn them back on */ #ifdef SIGTSTP signal(SIGTSTP, SIG_IGN); signal(SIGTTIN, SIG_IGN); signal(SIGTTOU, SIG_IGN); #endif /* SIGTSTP */ #ifndef __QNX__ /* command interpreter path */ if (argv != NULL) { # ifdef DEBUG_CMD int i; for (i = 0; argv[i]; i++) fprintf(stderr, "argv [%d] = \"%s\"\n", i, argv[i]); # endif execvp(argv[0], (char *const *)argv); /* no error message: STDERR is closed! */ } else { const char *argv0, *shell; if ((shell = getenv("SHELL")) == NULL || *shell == '\0') shell = "/bin/sh"; argv0 = (const char *)rxvt_r_basename(shell); if (r->Options & Opt_loginShell) { login = rxvt_malloc((STRLEN(argv0) + 2) * sizeof(char)); login[0] = '-'; STRCPY(&login[1], argv0); argv0 = login; } execlp(shell, argv0, NULL); /* no error message: STDERR is closed! */ } #else /* __QNX__ uses qnxspawn() */ { char iov_a[10] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; char *command = NULL, fullcommand[_MAX_PATH]; char **arg_v, *arg_a[2] = { NULL, NULL }; if (argv != NULL) { if (access(argv[0], X_OK) == -1) { if (STRCHR(argv[0], '/') == NULL) { searchenv(argv[0], "PATH", fullcommand); if (fullcommand[0] != '\0') command = fullcommand; } if (access(command, X_OK) == -1) return -1; } else command = argv[0]; arg_v = argv; } else { if ((command = getenv("SHELL")) == NULL || *command == '\0') command = "/bin/sh"; arg_a[0] = my_basename(command); if (r->Options & Opt_loginShell) { login = rxvt_malloc((STRLEN(arg_a[0]) + 2) * sizeof(char)); login[0] = '-'; STRCPY(&login[1], arg_a[0]); arg_a[0] = login; } arg_v = arg_a; } iov_a[0] = iov_a[1] = iov_a[2] = r->tty_fd; r->h->cmd_pid = qnx_spawn(0, 0, 0, -1, -1, _SPAWN_SETSID | _SPAWN_TCSETPGRP, command, arg_v, environ, iov_a, 0); if (login) free(login); close(r->tty_fd); return r->cmd_fd; } #endif return -1; } /* ------------------------------------------------------------------------- * * GET TTY CURRENT STATE * * ------------------------------------------------------------------------- */ /* rxvt_get_ttymode() */ /* INTPROTO */ void rxvt_get_ttymode(ttymode_t *tio) { #ifdef HAVE_TERMIOS_H /* * standard System V termios interface */ if (GET_TERMIOS(STDIN_FILENO, tio) < 0) { /* return error - use system defaults */ tio->c_cc[VINTR] = CINTR; tio->c_cc[VQUIT] = CQUIT; tio->c_cc[VERASE] = CERASE; tio->c_cc[VKILL] = CKILL; tio->c_cc[VSTART] = CSTART; tio->c_cc[VSTOP] = CSTOP; tio->c_cc[VSUSP] = CSUSP; # ifdef VDSUSP tio->c_cc[VDSUSP] = CDSUSP; # endif # ifdef VREPRINT tio->c_cc[VREPRINT] = CRPRNT; # endif # ifdef VDISCRD tio->c_cc[VDISCRD] = CFLUSH; # endif # ifdef VWERSE tio->c_cc[VWERSE] = CWERASE; # endif # ifdef VLNEXT tio->c_cc[VLNEXT] = CLNEXT; # endif } tio->c_cc[VEOF] = CEOF; tio->c_cc[VEOL] = VDISABLE; # ifdef VEOL2 tio->c_cc[VEOL2] = VDISABLE; # endif # ifdef VSWTC tio->c_cc[VSWTC] = VDISABLE; # endif # ifdef VSWTCH tio->c_cc[VSWTCH] = VDISABLE; # endif # if VMIN != VEOF tio->c_cc[VMIN] = 1; # endif # if VTIME != VEOL tio->c_cc[VTIME] = 0; # endif /* input modes */ tio->c_iflag = (BRKINT | IGNPAR | ICRNL # ifdef IMAXBEL | IMAXBEL # endif | IXON); /* output modes */ tio->c_oflag = (OPOST | ONLCR); /* control modes */ tio->c_cflag = (CS8 | CREAD); /* line discipline modes */ tio->c_lflag = (ISIG | ICANON | IEXTEN | ECHO # if defined (ECHOCTL) && defined (ECHOKE) | ECHOCTL | ECHOKE # endif | ECHOE | ECHOK); # else /* HAVE_TERMIOS_H */ /* * sgtty interface */ /* get parameters -- gtty */ if (ioctl(STDIN_FILENO, TIOCGETP, &(tio->sg)) < 0) { tio->sg.sg_erase = CERASE; /* ^H */ tio->sg.sg_kill = CKILL; /* ^U */ } tio->sg.sg_flags = (CRMOD | ECHO | EVENP | ODDP); /* get special characters */ if (ioctl(STDIN_FILENO, TIOCGETC, &(tio->tc)) < 0) { tio->tc.t_intrc = CINTR; /* ^C */ tio->tc.t_quitc = CQUIT; /* ^\ */ tio->tc.t_startc = CSTART; /* ^Q */ tio->tc.t_stopc = CSTOP; /* ^S */ tio->tc.t_eofc = CEOF; /* ^D */ tio->tc.t_brkc = -1; } /* get local special chars */ if (ioctl(STDIN_FILENO, TIOCGLTC, &(tio->lc)) < 0) { tio->lc.t_suspc = CSUSP; /* ^Z */ tio->lc.t_dsuspc = CDSUSP; /* ^Y */ tio->lc.t_rprntc = CRPRNT; /* ^R */ tio->lc.t_flushc = CFLUSH; /* ^O */ tio->lc.t_werasc = CWERASE; /* ^W */ tio->lc.t_lnextc = CLNEXT; /* ^V */ } /* get line discipline */ ioctl(STDIN_FILENO, TIOCGETD, &(tio->line)); # ifdef NTTYDISC tio->line = NTTYDISC; # endif /* NTTYDISC */ tio->local = (LCRTBS | LCRTERA | LCTLECH | LPASS8 | LCRTKIL); #endif /* HAVE_TERMIOS_H */ /* * Debugging */ #ifdef DEBUG_TTYMODE #ifdef HAVE_TERMIOS_H /* c_iflag bits */ fprintf(stderr, "Input flags\n"); /* cpp token stringize doesn't work on all machines */ # define FOO(flag,name) \ if ((tio->c_iflag) & flag) \ fprintf (stderr, "%s ", name) /* c_iflag bits */ FOO(IGNBRK, "IGNBRK"); FOO(BRKINT, "BRKINT"); FOO(IGNPAR, "IGNPAR"); FOO(PARMRK, "PARMRK"); FOO(INPCK, "INPCK"); FOO(ISTRIP, "ISTRIP"); FOO(INLCR, "INLCR"); FOO(IGNCR, "IGNCR"); FOO(ICRNL, "ICRNL"); FOO(IXON, "IXON"); FOO(IXOFF, "IXOFF"); # ifdef IUCLC FOO(IUCLC, "IUCLC"); # endif # ifdef IXANY FOO(IXANY, "IXANY"); # endif # ifdef IMAXBEL FOO(IMAXBEL, "IMAXBEL"); # endif fprintf(stderr, "\n"); # undef FOO # define FOO(entry, name) \ fprintf(stderr, "%-8s = %#04o\n", name, tio->c_cc [entry]) FOO(VINTR, "VINTR"); FOO(VQUIT, "VQUIT"); FOO(VERASE, "VERASE"); FOO(VKILL, "VKILL"); FOO(VEOF, "VEOF"); FOO(VEOL, "VEOL"); # ifdef VEOL2 FOO(VEOL2, "VEOL2"); # endif # ifdef VSWTC FOO(VSWTC, "VSWTC"); # endif # ifdef VSWTCH FOO(VSWTCH, "VSWTCH"); # endif FOO(VSTART, "VSTART"); FOO(VSTOP, "VSTOP"); FOO(VSUSP, "VSUSP"); # ifdef VDSUSP FOO(VDSUSP, "VDSUSP"); # endif # ifdef VREPRINT FOO(VREPRINT, "VREPRINT"); # endif # ifdef VDISCRD FOO(VDISCRD, "VDISCRD"); # endif # ifdef VWERSE FOO(VWERSE, "VWERSE"); # endif # ifdef VLNEXT FOO(VLNEXT, "VLNEXT"); # endif fprintf(stderr, "\n"); # undef FOO # endif /* HAVE_TERMIOS_H */ #endif /* DEBUG_TTYMODE */ } /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/grkelot.c010064400001440000024000000324540733020615500136520ustar gcwstaff/*---------------------------------*C*--------------------------------------* * File: grkelot.c *--------------------------------------------------------------------------* * $Id: grkelot.c,v 1.12 2001/07/27 06:38:37 gcw Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1994,1995 Angelo Haritsis. All rights reserved. * - original version * Copyright (c) 1997,1998 Oezger Kesim * * 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 of the License, 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. *--------------------------------------------------------------------------* * Synopsis: string -> greek ELOT928 or IBM437 string; * 4-state FSM implementation. * * System: Any (ANSI C) * * This is code derived from a more generic key remapper written by the same * author and used in other environments. It was not written only * for greek kbd bindings. An extension to other languages is easy * (well don't know how the FSM lends itself to Far East languages). * * The FSM can have MAX_STATES states (change it for more). * Each state contains: * 1. many tranlsation tables (registered via kstate_add_xlat()) * 2. many switch codes for transition to other states (registered via * kstate_add_switcher()) : limit is static now: MAX_SWITCHER * 3. life: the number of xlations allowed in a state (0 = unlimited) * * Format of tranlation strings: * -:n1,n2,n3,... * Format of switcher string: * A: * (other switchers apart from A=ascii can be supported; not in this context) * Format of life string: * L (N=0,1,...) *-------------------------------------------------------------------------* * Written by Angelo Haritis. * * Redistribution and use in source and binary forms are permitted provided * that the above copyright notice and this paragraph are duplicated in all * such forms and that any documentation, advertising materials, and other * materials related to such distribution and use acknowledge that the * software was developed by Angelo Haritsis. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * NB: DO NOT ALTER! THIS CODE IS USED IN MANY PLATFORMS!!! * * TODO: make it more dynamic (linked lists is an idea but slower) */ #define RXVT /* define for use by rxvt */ #ifdef RXVT #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "grkelot.intpro" /* PROTOS for internal routines */ #endif /* RXVT */ #ifdef GREEK_SUPPORT #include "grkelot.h" #include #include /* --- Macros, Types --------- */ #define MAX_STATES 4 /* max # states for the FSM */ #define MAX_SWITCHER 2U /* per state */ #define MAX_VAL 256 /* for temp allocation */ typedef unsigned char u_char; typedef unsigned int u_int; typedef unsigned long u_long; typedef struct s_xlat { u_int first, last; u_int *pval; /* array of translated values */ } K_XLAT; typedef struct s_switch { u_char type; /* Ascii, Virtual, Scan */ u_int code; u_char nextstate; u_char on; /* current state of key: 0 = off */ } K_SWITCH; typedef struct s_state { u_int num_xlat; /* number of translations */ K_XLAT *xlat; /* State translations ((dynamic - realloc'ed) */ u_int num_switcher; /* number of switcher keys */ K_SWITCH switcher[MAX_SWITCHER]; /* switcher keys to other states */ u_char life; /* 0 = until switched by key */ u_char prev_state; /* filled when jumped to a new state */ } K_STATE; /* type for each one of the different greek standards (xlat types) */ typedef struct s_xlat_type { char *plain; char *accent; char *accent_xtra; char *umlaut; char *acc_uml; } XLAT_TYPE; /* --- Local Data ------------ */ static K_STATE State[MAX_STATES]; /* Current State */ static u_char nStateNow = 0; static K_STATE *pStateNow = &State[0]; static int GreekMode = GREEK_ELOT928; /* * The following are hard-coded for now. The idea is that such strings would * be read from a config file making it possible to change language/encodings * more flexibly. */ /* elot 928 xlations */ static char elot_xlat_plain[] = "65-122:193,194,216,196,197,214,195,199,201,206,202,203,204,205,207,208,81,209,211,212,200,217,87,215,213,198,91,92,93,94,95,96,225,226,248,228,229,246,227,231,233,238,234,235,236,237,239,240,113,241,243,244,232,249,242,247,245,230"; /* c and s give copyright and section sign */ static char elot_xlat_acc[] = "65-122:182,194,216,196,184,214,195,185,186,206,202,203,204,205,188,208,81,209,211,212,200,191,87,215,190,198,91,92,93,94,95,96,220,226," /*248 */ "169,228,221,246,227,222,223,238,234,235,236,237,252,240,113,241," /*243 */ "167,244,232,254,242,247,253,230"; static char elot_xlat_acc_xtra[] = "46-62:183,47,48,49,50,51,52,53,54,55,56,57,58,59,171,61,187"; /* anw teleia, quotes */ static char elot_xlat_uml[] = "65-122:193,194,216,196,197,214,195,199,218,206,202,203,204,205,207,208,81,209,211,212,200,217,87,215,219,198,91,92,93,94,95,96,225,226,248,228,229,246,227,231,250,238,234,235,236,237,239,240,113,241,243,244,232,249,242,247,251,230"; static char elot_xlat_umacc[] = "65-122:193,194,216,196,197,214,195,199,201,206,202,203,204,205,207,208,81,209,211,212,200,217,87,215,213,198,91,92,93,94,95,96,225,226,248,228,229,246,227,231,192,238,234,235,236,237,239,240,113,241,243,244,232,249,242,247,224,230"; /* ibm 437 xlations */ static char i437_xlat_plain[] = "65-122:128,129,150,131,132,148,130,134,136,141,137,138,139,140,142,143,81,144,145,146,135,151,87,149,147,133,91,92,93,94,95,96,152,153,175,155,156,173,154,158,160,165,161,162,163,164,166,167,113,168,169,171,159,224,170,174,172,157"; static char i437_xlat_acc[] = "65-122:234,129,150,131,235,148,130,236,237,141,137,138,139,140,238,143,81,144,145,146,135,240,87,149,239,133,91,92,93,94,95,96,225,153,175,155,226,173,154,227,229,165,161,162,163,164,230,167,113,168,169,171,159,233,170,174,231,157"; static char i437_xlat_acc_xtra[] = "46-46:250"; /* anw teleia */ static char i437_xlat_uml[] = "65-122:128,129,150,131,132,148,130,134,136,141,137,138,139,140,142,143,81,144,145,146,135,151,87,149,147,133,91,92,93,94,95,96,152,153,175,155,156,173,154,158,228,165,161,162,163,164,166,167,113,168,169,171,159,224,170,174,232,157"; static char i437_xlat_umacc[] = "65-122:128,129,150,131,132,148,130,134,136,141,137,138,139,140,142,143,81,144,145,146,135,151,87,149,147,133,91,92,93,94,95,96,152,153,175,155,156,173,154,158,42,165,161,162,163,164,166,167,113,168,169,171,159,224,170,174,42,157"; /* * currently ELOT928 and IBM437 are supported; easy to include others * (not recommended: stick to just these 2 if not only the ELOT one) */ static XLAT_TYPE xlat_type[] = { {elot_xlat_plain, elot_xlat_acc, elot_xlat_acc_xtra, elot_xlat_uml, elot_xlat_umacc}, {i437_xlat_plain, i437_xlat_acc, i437_xlat_acc_xtra, i437_xlat_uml, i437_xlat_umacc}, }; /* the current trasnaltion type */ static XLAT_TYPE *xlat_now = &xlat_type[GREEK_ELOT928]; #define NUM_XLAT_TYPES (sizeof(xlat_type) / sizeof(xlat_type[0])) static void kstate_add_xlat(char *str); static void kstate_add_switcher(char *str); static void kstate_set_life(char *str); /* --- Functions ------------- */ /* INTPROTO */ void kstate_setcurr(int stateno) { u_char prev_state; if ((u_int) stateno > (u_int) MAX_STATES) return; if (pStateNow->life == 1) prev_state = pStateNow->prev_state; else prev_state = nStateNow; pStateNow = &State[nStateNow = stateno]; pStateNow->prev_state = prev_state; } /* INTPROTO */ void kstate_init(void) { pStateNow->num_xlat = pStateNow->num_switcher = pStateNow->life = pStateNow->prev_state = 0; pStateNow->xlat = NULL; } /* INTPROTO */ void kstate_end(void) { int i; for (i = 0; i < pStateNow->num_xlat; i++) free(pStateNow->xlat[i].pval); if (pStateNow->num_xlat > 0) free(pStateNow->xlat); } /* * Hard coded ELOT-928 translations. Could read these from an rc-type file * to support other remappers. */ /* INTPROTO */ void kstate_init_all(int greek_mode) { /* the translation tables for the 4 FSM states for ELOT-928 mappings */ int i; for (i = 0; i < MAX_STATES; i++) { kstate_setcurr(i); kstate_init(); } if (greek_mode < 0 || greek_mode >= NUM_XLAT_TYPES) /* avoid death */ greek_mode = GREEK_ELOT928; xlat_now = &xlat_type[greek_mode]; kstate_setcurr(0); kstate_add_xlat(xlat_now->plain); kstate_add_switcher("A;:1"); kstate_add_switcher("A::2"); kstate_set_life("L0"); kstate_setcurr(1); kstate_add_xlat(xlat_now->accent); kstate_add_xlat(xlat_now->accent_xtra); kstate_add_switcher("A::3"); kstate_set_life("L1"); kstate_setcurr(2); kstate_add_xlat(xlat_now->umlaut); kstate_add_switcher("A;:3"); kstate_set_life("L1"); kstate_setcurr(3); kstate_add_xlat(xlat_now->acc_uml); kstate_set_life("L1"); } /* INTPROTO */ void kstate_end_all(void) { int i; for (i = 0; i < MAX_STATES; i++) { kstate_setcurr(i); kstate_end(); } kstate_setcurr(0); } /* * reset FSM */ /* INTPROTO */ void kstate_reset(void) { kstate_setcurr(0); } /* INTPROTO */ void kstate_add_xlat(char *str) { K_XLAT *xlat; u_int *pval_tmp; char *sval; int i; if (str == NULL) return; /* add a new xlat table in state */ if (pStateNow->num_xlat == 0) { pStateNow->xlat = malloc(sizeof(K_XLAT)); } else /* prefer contiguous data, realloc */ pStateNow->xlat = realloc(pStateNow->xlat, (pStateNow->num_xlat + 1) * sizeof(K_XLAT)); xlat = &pStateNow->xlat[pStateNow->num_xlat]; /* parse str and derive first, last, values */ xlat->first = (u_int) atoi(strtok(str, "-")); xlat->last = (u_int) atoi(strtok(NULL, ":")); i = 0; pval_tmp = calloc(MAX_VAL, sizeof(K_XLAT)); while ((sval = strtok(NULL, ",")) != NULL) pval_tmp[i++] = (u_int) (atoi(sval)); xlat->pval = calloc(i, sizeof(K_XLAT)); if (xlat->pval != NULL) memcpy(xlat->pval, pval_tmp, i * sizeof(u_int)); free(pval_tmp); pStateNow->num_xlat++; } /* * Ascii only for this implementation */ /* INTPROTO */ void kstate_add_switcher(char *str) { K_SWITCH *switcher; if (str == NULL) return; if (pStateNow->num_switcher >= MAX_SWITCHER) return; switcher = &pStateNow->switcher[pStateNow->num_switcher]; switch (switcher->type = str[0]) { case 'A': /* ascii eg: A;:2 */ switcher->code = str[1]; switcher->nextstate = atoi(&str[3]); break; } switcher->on = 0; pStateNow->num_switcher++; } /* L1 or L0 */ /* INTPROTO */ void kstate_set_life(char *str) { pStateNow->life = atoi(&str[1]); } /* INTPROTO */ unsigned int kstate_cxlat(unsigned int c) { int i; /* check for ascii switcher */ for (i = 0; i < pStateNow->num_switcher; i++) if (pStateNow->switcher[i].type == 'A' && /* only ascii here */ c == pStateNow->switcher[i].code) { kstate_setcurr(pStateNow->switcher[i].nextstate); pStateNow->switcher[i].on = 1; return ((unsigned int)-1); } /* do translation */ for (i = 0; i < pStateNow->num_xlat; i++) if (c >= pStateNow->xlat[i].first && c <= pStateNow->xlat[i].last) { c = pStateNow->xlat[i].pval[c - pStateNow->xlat[i].first]; break; } /* switch back to previous state if life of current is 1 */ if (pStateNow->life == 1) kstate_setcurr(pStateNow->prev_state); return (c); } #ifdef RXVT /* EXTPROTO */ void greek_init(void) { kstate_init_all(GreekMode); } /* EXTPROTO */ void greek_end(void) { kstate_end_all(); } /* EXTPROTO */ void greek_reset(void) { kstate_reset(); } /* EXTPROTO */ void greek_setmode(int greek_mode) { GreekMode = greek_mode; } /* EXTPROTO */ int greek_getmode(void) { return (GreekMode); } /* * xlate a given string in-place - return new string length */ /* EXTPROTO */ int greek_xlat(char *s, int num_chars) { int i, count; unsigned int c; for (i = 0, count = 0; i < num_chars; i++) { c = kstate_cxlat((unsigned int)s[i]); if (c != -1) s[count++] = (char)c; } s[count] = '\0'; return (count); } #ifdef TEST int main(void) { /*char text[] = "abcdef;aGDZXC"; */ char text[] = "abcdef;a:ibgdezhuiklmnjoprstyfxcv"; kstate_init_all(GREEK_ELOT928); printf("text: %s\n", text); greek_xlat(text, strlen(text)); printf("xlat'ed text: %s\n", text); kstate_end_all(); return 0; } #endif #endif /* RXVT */ #endif /* GREEK_SUPPORT */ rxvt-2.7.10/src/graphics.c010064400001440000024000000332370733020615500140030ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: graphics.c *----------------------------------------------------------------------* * $Id: graphics.c,v 1.39 2001/07/27 06:38:37 gcw Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1994 Rob Nation * - original version * Copyright (c) 1997 Raul Garcia Garcia * Copyright (c) 1997,1998 mj olesen * * 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 of the License, 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. *----------------------------------------------------------------------*/ #include "../config.h" /* NECESSARY */ #ifdef RXVT_GRAPHICS #include "rxvt.h" /* NECESSARY */ #include "rxvtgrx.h" typedef struct grcmd_t { char cmd; short color; short ncoords; int *coords; unsigned char *text; struct grcmd_t *next; } grcmd_t; typedef struct grwin_t { Window win; int x, y; unsigned int w, h; short screen; grcmd_t *graphics; struct grwin_t *prev, *next; } grwin_t; #include "graphics.intpro" /* PROTOS for internal routines */ #include /* commands: * 'C' = Clear * 'F' = Fill * 'G' = Geometry * 'L' = Line * 'P' = Points * 'T' = Text * 'W' = Window */ #ifndef GRX_SCALE # define GRX_SCALE 10000 #endif /*----------------------------------------------------------------------* * local functions */ /* ARGSUSED */ /* INTPROTO */ void rxvt_Gr_NewWindow(rxvt_t *r, int nargs, int args[]) { int x, y; unsigned int w, h; Window win; grwin_t *grwin; Cursor cursor; if (nargs != 4) { rxvt_print_error("NewWindow: 4 args needed, got %d\n", nargs); return; } x = args[0] * TermWin_TotalWidth() / GRX_SCALE; y = args[1] * TermWin_TotalHeight() / GRX_SCALE; w = args[2] * TermWin_TotalWidth() / GRX_SCALE; h = args[3] * TermWin_TotalHeight() / GRX_SCALE; win = XCreateSimpleWindow(r->Xdisplay, r->TermWin.vt, x, y, w, h, 0, r->PixColors[Color_fg], r->PixColors[Color_bg]); cursor = XCreateFontCursor(r->Xdisplay, XC_crosshair); XDefineCursor(r->Xdisplay, win, cursor); XMapWindow(r->Xdisplay, win); XSelectInput(r->Xdisplay, win, ExposureMask); grwin = (grwin_t *) rxvt_malloc(sizeof(grwin_t)); grwin->win = win; grwin->x = x; grwin->y = y; grwin->w = w; grwin->h = h; grwin->screen = 0; grwin->prev = NULL; grwin->next = r->h->gr_root; if (grwin->next) grwin->next->prev = grwin; r->h->gr_root = grwin; grwin->graphics = NULL; r->h->graphics_up++; rxvt_tt_printf(r, "\033W%ld\n", (long)grwin->win); } /* ARGSUSED */ /* INTPROTO */ void rxvt_Gr_ClearWindow(rxvt_t *r, grwin_t *grwin) { grcmd_t *cmd, *next; for (cmd = grwin->graphics; cmd != NULL; cmd = next) { next = cmd->next; free(cmd->coords); if (cmd->text != NULL) free(cmd->text); free(cmd); } grwin->graphics = NULL; XClearWindow(r->Xdisplay, grwin->win); } /* * arg [0] = x * arg [1] = y * arg [2] = alignment * arg [3] = strlen (text) */ /* ARGSUSED */ /* INTPROTO */ void rxvt_Gr_Text(rxvt_t *r, grwin_t *grwin, grcmd_t *data) { int x, y, align; if (data->ncoords < 4 || data->text == NULL || *(data->text) == '\0') return; x = data->coords[0] * grwin->w / GRX_SCALE; y = data->coords[1] * grwin->h / GRX_SCALE; align = data->coords[2]; if ((align & HORIZONTAL_ALIGNMENT) == RIGHT_TEXT) x -= XTextWidth(r->TermWin.font, data->text, data->coords[3]); else if ((align & HORIZONTAL_ALIGNMENT) == HCENTER_TEXT) x -= (XTextWidth(r->TermWin.font, data->text, data->coords[3]) >> 1); if ((align & VERTICAL_ALIGNMENT) == TOP_TEXT) y += r->TermWin.font->ascent; else if ((align & VERTICAL_ALIGNMENT) == BOTTOM_TEXT) y -= r->TermWin.font->descent; if ((align & VERTICAL_ALIGNMENT) == VCENTER_TEXT) y -= r->TermWin.font->descent + ((r->TermWin.font->ascent + r->TermWin.font->descent) >> 1); if ((align & VERTICAL_ALIGNMENT) == VCAPS_CENTER_TEXT) y += (r->TermWin.font->ascent >> 1); XPMClearArea(r->Xdisplay, grwin->win, x, y - r->TermWin.font->ascent, Width2Pixel(data->coords[3]), Height2Pixel(1), 0); XDrawString(r->Xdisplay, grwin->win, r->TermWin.gc, x, y, data->text, data->coords[3]); } /* ARGSUSED */ /* INTPROTO */ void rxvt_Gr_Geometry(rxvt_t *r, grwin_t *grwin, grcmd_t *data __attribute__((unused))) { if (grwin) rxvt_tt_printf(r, "\033G%ld %d %d %u %u %d %d %ld %ld %d\n", (long)grwin->win, grwin->x, grwin->y, grwin->w, grwin->h, r->TermWin.fwidth, r->TermWin.fheight, (long)GRX_SCALE * r->TermWin.fwidth / grwin->w, (long)GRX_SCALE * r->TermWin.fheight / grwin->h, XDEPTH); else /* rxvt terminal window size */ rxvt_tt_printf(r, "\033G0 0 0 %d %d %d %d %ld %ld %d\n", TermWin_TotalWidth(), TermWin_TotalHeight(), r->TermWin.fwidth, r->TermWin.fheight, (long)GRX_SCALE * r->TermWin.fwidth / r->TermWin.width, (long)GRX_SCALE * r->TermWin.fheight / r->TermWin.height, XDEPTH); } /* ARGSUSED */ /* INTPROTO */ void rxvt_Gr_DestroyWindow(rxvt_t *r, grwin_t *grwin) { grcmd_t *cmd, *next; if (grwin == NULL) return; for (cmd = grwin->graphics; cmd; cmd = next) { next = cmd->next; free(cmd->coords); if (cmd->text != NULL) free(cmd->text); free(cmd); } XDestroyWindow(r->Xdisplay, grwin->win); if (grwin->next != NULL) grwin->next->prev = grwin->prev; if (grwin->prev != NULL) grwin->prev->next = grwin->next; else r->h->gr_root = grwin->next; free(grwin); r->h->graphics_up--; } /* ARGSUSED */ /* INTPROTO */ void rxvt_Gr_Dispatch(rxvt_t *r, grwin_t *grwin, grcmd_t *data) { int i, n; union { XPoint pt[NGRX_PTS / 2]; XRectangle rect[NGRX_PTS / 4]; } xdata; if (data->color != Color_fg) { XGCValues gcv; gcv.foreground = r->PixColors[data->color]; XChangeGC(r->Xdisplay, r->TermWin.gc, GCForeground, &gcv); } if (grwin) switch (data->cmd) { case 'L': if (data->ncoords > 3) { for (n = i = 0; i < data->ncoords; i += 2, n++) { xdata.pt[n].x = data->coords[i] * grwin->w / GRX_SCALE; xdata.pt[n].y = data->coords[i + 1] * grwin->h / GRX_SCALE; } XDrawLines(r->Xdisplay, grwin->win, r->TermWin.gc, xdata.pt, n, CoordModeOrigin); } break; case 'P': if (data->ncoords > 3) { for (n = i = 0; i < data->ncoords; i += 2, n++) { xdata.pt[n].x = data->coords[i] * grwin->w / GRX_SCALE; xdata.pt[n].y = data->coords[i + 1] * grwin->h / GRX_SCALE; } XDrawPoints(r->Xdisplay, grwin->win, r->TermWin.gc, xdata.pt, n, CoordModeOrigin); } break; case 'F': if (data->ncoords > 0) { for (n = i = 0; i < data->ncoords; i += 4, n++) { xdata.rect[n].x = data->coords[i] * grwin->w / GRX_SCALE; xdata.rect[n].y = data->coords[i + 1] * grwin->h / GRX_SCALE; xdata.rect[n].width = ((data->coords[i + 2] - data->coords[i] + 1) * grwin->w / GRX_SCALE); xdata.rect[n].height = ((data->coords[i + 3] - data->coords[i + 1] + 1) * grwin->h / GRX_SCALE); XPMClearArea(r->Xdisplay, grwin->win, xdata.rect[n].x, xdata.rect[n].y, xdata.rect[n].width, xdata.rect[n].height, 0); } XFillRectangles(r->Xdisplay, grwin->win, r->TermWin.gc, xdata.rect, n); } break; case 'T': rxvt_Gr_Text(r, grwin, data); break; case 'C': rxvt_Gr_ClearWindow(r, grwin); break; } if (data->color != Color_fg) { XGCValues gcv; gcv.foreground = r->PixColors[Color_fg]; XChangeGC(r->Xdisplay, r->TermWin.gc, GCForeground, &gcv); } } /* ARGSUSED */ /* INTPROTO */ void rxvt_Gr_Redraw(rxvt_t *r, grwin_t *grwin) { grcmd_t *cmd; for (cmd = grwin->graphics; cmd != NULL; cmd = cmd->next) rxvt_Gr_Dispatch(r, grwin, cmd); } /*----------------------------------------------------------------------* * end of static functions */ /* ARGSUSED */ /* EXTPROTO */ void rxvt_Gr_ButtonReport(rxvt_t *r, int but, int x, int y) { grwin_t *grwin; for (grwin = r->h->gr_root; grwin != NULL; grwin = grwin->next) if ((x > grwin->x) && (y > grwin->y) && ((unsigned int)x < grwin->x + grwin->w) && ((unsigned int)y < grwin->y + grwin->h)) break; if (grwin == NULL) return; x = GRX_SCALE * (x - grwin->x) / grwin->w; y = GRX_SCALE * (y - grwin->y) / grwin->h; rxvt_tt_printf(r, "\033%c%ld;%d;%d;\n", but, (long)grwin->win, x, y); } /* ARGSUSED */ /* EXTPROTO */ void rxvt_Gr_do_graphics(rxvt_t *r, int cmd, unsigned int nargs, int args[], unsigned char *text) { int i; Window win_id; grwin_t *grwin; grcmd_t *newcmd, *oldcmd; if (cmd == 'W') { rxvt_Gr_NewWindow(r, nargs, args); return; } win_id = (nargs > 0) ? (Window) args[0] : None; if ((cmd == 'G') && (win_id == None)) { rxvt_Gr_Geometry(r, NULL, NULL); return; } if ((win_id == None) && (r->h->gr_last_id != None)) win_id = r->h->gr_last_id; if (win_id == None) return; grwin = r->h->gr_root; while ((grwin != NULL) && (grwin->win != win_id)) grwin = grwin->next; if (grwin == NULL) return; if (cmd == 'G') { rxvt_Gr_Geometry(r, grwin, NULL); return; } nargs--; args++; /* skip over window id */ /* record this new command */ newcmd = (grcmd_t *) rxvt_malloc(sizeof(grcmd_t)); newcmd->ncoords = nargs; newcmd->coords = (int *)rxvt_malloc((newcmd->ncoords * sizeof(int))); newcmd->next = NULL; newcmd->cmd = cmd; newcmd->color = rxvt_scr_get_fgcolor(r); newcmd->text = text; for (i = 0; i < newcmd->ncoords; i++) newcmd->coords[i] = args[i]; /* * If newcmd == fill, and rectangle is full window, drop all prior * commands. */ if ((newcmd->cmd == 'F') && (grwin) && (grwin->graphics)) { for (i = 0; i < newcmd->ncoords; i += 4) { if ((newcmd->coords[i] == 0) && (newcmd->coords[i + 1] == 0) && (newcmd->coords[i + 2] == GRX_SCALE) && (newcmd->coords[i + 3] == GRX_SCALE)) { /* drop previous commands */ oldcmd = grwin->graphics; while (oldcmd->next != NULL) { grcmd_t *tmp = oldcmd; oldcmd = oldcmd->next; free(tmp); } grwin->graphics = NULL; } } } /* insert new command into command list */ oldcmd = grwin->graphics; if (oldcmd == NULL) grwin->graphics = newcmd; else { while (oldcmd->next != NULL) oldcmd = oldcmd->next; oldcmd->next = newcmd; } rxvt_Gr_Dispatch(r, grwin, newcmd); } /* ARGSUSED */ /* EXTPROTO */ void rxvt_Gr_scroll(rxvt_t *r, int count) { grwin_t *grwin, *next; if ((count == 0) && (r->h->gr_prev_start == r->TermWin.view_start)) return; r->h->gr_prev_start = r->TermWin.view_start; for (grwin = r->h->gr_root; grwin != NULL; grwin = next) { next = grwin->next; grwin->y -= (count * r->TermWin.fheight); if ((long)(grwin->y + grwin->h) < -(long)(r->TermWin.saveLines * r->TermWin.fheight)) rxvt_Gr_DestroyWindow(r, grwin); else XMoveWindow(r->Xdisplay, grwin->win, grwin->x, grwin->y + (r->TermWin.view_start * r->TermWin.fheight)); } } /* EXTPROTO */ void rxvt_Gr_ClearScreen(rxvt_t *r) { grwin_t *grwin, *next; for (grwin = r->h->gr_root; grwin != NULL; grwin = next) { next = grwin->next; if ((grwin->screen == 0) && (grwin->y + grwin->h > 0)) { if (grwin->y >= 0) rxvt_Gr_DestroyWindow(r, grwin); else XResizeWindow(r->Xdisplay, grwin->win, grwin->w, -grwin->y); } } } /* EXTPROTO */ void rxvt_Gr_ChangeScreen(rxvt_t *r) { grwin_t *grwin, *next; for (grwin = r->h->gr_root; grwin != NULL; grwin = next) { next = grwin->next; if (grwin->y + grwin->h > 0) { if (grwin->screen == 1) { XMapWindow(r->Xdisplay, grwin->win); grwin->screen = 0; } else { XUnmapWindow(r->Xdisplay, grwin->win); grwin->screen = 1; } } } } /* ARGSUSED */ /* EXTPROTO */ void rxvt_Gr_expose(rxvt_t *r, Window win) { grwin_t *grwin; for (grwin = r->h->gr_root; grwin != NULL; grwin = grwin->next) { if (grwin->win == win) { rxvt_Gr_Redraw(r, grwin); break; } } } /* ARGSUSED */ /* EXTPROTO */ void rxvt_Gr_Resize(rxvt_t *r, int w __attribute__((unused)), int h) { grwin_t *grwin; for (grwin = r->h->gr_root; grwin != NULL; grwin = grwin->next) { if (r->TermWin.height != h) { grwin->y += (r->TermWin.height - h); XMoveWindow(r->Xdisplay, grwin->win, grwin->x, grwin->y + (r->TermWin.view_start * r->TermWin.fheight)); } rxvt_Gr_Redraw(r, grwin); } } /* EXTPROTO */ void rxvt_Gr_reset(rxvt_t *r) { grwin_t *grwin, *next; for (grwin = r->h->gr_root; grwin != NULL; grwin = next) { next = grwin->next; rxvt_Gr_DestroyWindow(r, grwin); } r->h->graphics_up = 0; } /* EXTPROTO */ int rxvt_Gr_Displayed(rxvt_t *r) { return r->h->graphics_up; } #endif /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/defaultfont.c010064400001440000024000000226140733020576300145170ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: defaultfont.c *----------------------------------------------------------------------* * Copyright (c) 2001 Tomohiro KUBOTA * - original version * * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *---------------------------------------------------------------------*/ /* * Setting default font and encoding according to user's locale (LC_CTYPE). */ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "defaultfont.h" #define ENCODINGBUFLEN 100 /* * Table to convert from encoding names to enc_label. * This table is useful to normalize encoding names * and support various return value from nl_langinfo(3). * * The encoding names here are "truncated" names, * where all alphabets are uppercase and all '-' and * '_' are eliminated. */ const struct name2encoding n2e[] = { #ifdef MULTICHAR_SET { "EUCJP", ENC_EUCJ }, { "UJIS", ENC_EUCJ }, { "SHIFTJIS", ENC_SJIS }, { "SJIS", ENC_SJIS }, { "EUCKR", ENC_EUCKR }, { "EUCCN", ENC_GB }, { "GB2312", ENC_GB }, { "GB", ENC_GB }, { "BIG5", ENC_BIG5 }, { "BIGFIVE", ENC_BIG5 }, { "BIG5HKSCS", ENC_BIG5 }, #endif /* MULTICHAR_SET */ { "KOI8R", ENC_KOI8R }, { "KOI8U", ENC_KOI8U }, { "ISO88591", ENC_ISO8859_1 }, { "ISO88592", ENC_ISO8859_2 }, { "ISO88593", ENC_ISO8859_3 }, { "ISO88594", ENC_ISO8859_4 }, { "ISO88595", ENC_ISO8859_5 }, { "ISO88596", ENC_ISO8859_6 }, { "ISO88597", ENC_ISO8859_7 }, { "ISO88598", ENC_ISO8859_8 }, { "ISO88599", ENC_ISO8859_9 }, { "ISO885910", ENC_ISO8859_10 }, { "ISO885911", ENC_ISO8859_11 }, { "ISO885912", ENC_ISO8859_12 }, { "ISO885913", ENC_ISO8859_13 }, { "ISO885914", ENC_ISO8859_14 }, { "ISO885915", ENC_ISO8859_15 }, { NULL, ENC_DUMMY } }; /* * This table converts from locale names to enc_label. * * This table is used to know which encoding is used * as the default in the current user environment * (LC_CTYPE locale), since it is the standard way * for users to specify encoding by LANG/LC_CTYPE/LC_ALL * variables (i.e., LC_CTYPE locale). Consult locale(7). * * This table is used when nl_langinfo(3) is not available * or it fails. * * locale names whose "encoding" part are listed in n2e[] * can be omitted here, because "encoding" part is checked * separately before l2e[] check. * * Note that longer locale names must be written earlier * than shorter locale names in this table, because * strncmp(3) is used for seek for this table. */ const struct name2encoding l2e[] = { #ifdef MULTICHAR_SET { "ja_JP.EUC", ENC_EUCJ }, { "ja_JP", ENC_EUCJ }, { "ko_KR.EUC", ENC_EUCKR }, { "ko_KR", ENC_EUCKR }, { "zh_CN.EUC", ENC_GB }, { "zh_CN", ENC_GB }, { "zh_TW", ENC_BIG5 }, #endif /* MULTICHAR_SET */ { "da", ENC_ISO8859_1 }, { "de", ENC_ISO8859_1 }, { "en", ENC_ISO8859_1 }, { "fi", ENC_ISO8859_1 }, { "fr", ENC_ISO8859_1 }, { "is", ENC_ISO8859_1 }, { "it", ENC_ISO8859_1 }, { "la", ENC_ISO8859_1 }, { "lt", ENC_ISO8859_1 }, { "nl", ENC_ISO8859_1 }, { "no", ENC_ISO8859_1 }, { "pt", ENC_ISO8859_1 }, { "sv", ENC_ISO8859_1 }, { "cs", ENC_ISO8859_2 }, { "hr", ENC_ISO8859_2 }, { "hu", ENC_ISO8859_2 }, { "la", ENC_ISO8859_2 }, { "lt", ENC_ISO8859_2 }, { "pl", ENC_ISO8859_2 }, { "sl", ENC_ISO8859_2 }, { "ru", ENC_KOI8R }, /* ISO8859-5 ? */ { "uk", ENC_KOI8U }, #if 0 { "vi", ENC_VISCII }, { "th", ENC_TIS620 }, #endif { NULL, ENC_DUMMY } }; /* * Default font name for each language. * I'd like these names edited by native speakers. * * enc_label --> ENCODING_METHOD and font informations * which as needed for Rxvt to work. */ const struct defaultfont defaultfont[] = { #ifdef MULTICHAR_SET { ENC_EUCJ, "eucj", {NFONT_LIST_EUCJ}, {MFONT_LIST_EUCJ} }, { ENC_SJIS, "sjis", {NFONT_LIST_EUCJ}, {MFONT_LIST_EUCJ} }, { ENC_GB, "gb", {NFONT_LIST_GB}, {MFONT_LIST_GB} }, { ENC_BIG5, "big5", {NFONT_LIST_BIG5}, {MFONT_LIST_BIG5} }, { ENC_EUCKR, "kr", {NFONT_LIST_EUCKR}, {MFONT_LIST_EUCKR} }, #endif /* MULTICHAR_SET */ #if 0 /* sample for font specification when common rule for ISO-8859-x * is not satisfying */ { ENC_ISO8859_1, "noenc",{NFONT_LIST_1}, {MFONT_LIST_NULL} }, #endif { ENC_KOI8R, "noenc",{NFONT_LIST_KOI8R}, {MFONT_LIST_NULL} }, { ENC_KOI8U, "noenc",{NFONT_LIST_KOI8U}, {MFONT_LIST_NULL} }, { ENC_DUMMY, "noenc",{MFONT_LIST_NULL}, {MFONT_LIST_NULL} } }; /* special common rule for ISO-8859-x */ const char *const defaultfont_8859[] = { NFONT_LIST_ISO8859X }; /* fallback defaults */ const char *const def_fontName[] = { NFONT_LIST }; #ifdef MULTICHAR_SET const char *const def_mfontName[] = { MFONT_LIST }; #endif /*----------------------------------------------------------------------*/ /* EXTPROTO */ void rxvt_set_defaultfont(rxvt_t *r, const char *rs[]) { char *locale = r->h->locale; char *encoding_str = NULL; char encoding_buf[ENCODINGBUFLEN]; char *p, *p2; enum enc_label encoding = ENC_DUMMY; int j, k; r->h->fnum = FONT0_IDX; #ifdef MULTICHAR_SET /* * Check if encoding is determined manually by -km option or * multichar_encoding resource. If yes, rxvt_set_defaultfont * must not override it. However, default font setting is needed. */ if (r->h->rs[Rs_multichar_encoding] != NULL) { for (j = 0; j < MAX_NFONTS; j++) { if (rs[Rs_font + j] == NULL) rs[Rs_font + j] = def_fontName[j]; if (rs[Rs_mfont + j] == NULL) rs[Rs_mfont + j] = def_mfontName[j]; } return; } #endif #ifdef HAVE_NL_LANGINFO # if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) /* if locale is not valid, nl_langinfo() returns ASCII. */ if (locale == NULL) encoding_str = NULL; else # endif encoding_str = nl_langinfo(CODESET); #endif /* HAVE_NL_LANGINFO */ /* * emulate LC_CTYPE locale behavior when setlocale fails or * is not available; AFTER check of nl_langinfo() because * nl_langinfo() is useful only when setlocale(LC_CTYPE) works. */ if (locale == NULL) { if ((locale = getenv("LC_ALL")) == NULL) if ((locale = getenv("LC_CTYPE")) == NULL) if ((locale = getenv("LANG")) == NULL) locale = "C"; /* failsafe */ r->h->locale = locale; } /* * Check nl_langinfo() first. If nl_langinfo() is not available, * encoding part of LC_CTYPE locale is used. */ if (encoding_str && *encoding_str) STRNCPY(encoding_buf, encoding_str, ENCODINGBUFLEN); else { p = STRCHR(locale, '.'); if (p) { STRNCPY(encoding_buf, p + 1, ENCODINGBUFLEN); p = STRCHR(encoding_buf, '@'); if (p) *p = 0; } else STRNCPY(encoding_buf, locale, ENCODINGBUFLEN); } encoding_buf[ENCODINGBUFLEN - 1] = 0; for (p = p2 = encoding_buf; 1; p++, p2++) { while (*p2 == '_' || *p2 == '-') p2++; if (!*p2) break; *p = toupper(*p2); } *p = 0; for (j = 0; n2e[j].name; j++) if (!STRCMP(encoding_buf, n2e[j].name)) { encoding = n2e[j].encoding; break; } /* Next, check "language"/"country" part of locale name. */ if (encoding == ENC_DUMMY) for (j = 0; l2e[j].name; j++) { if (!STRNCMP(locale, l2e[j].name, strlen(l2e[j].name))) { encoding = l2e[j].encoding; break; } } /* * Build rs[Rs_font], rs[Rs_mfont], r->encoding_method, * and r->h->multichar_decode */ for (j = 0; defaultfont[j].enc_label != ENC_DUMMY; j++) { if (encoding == defaultfont[j].enc_label) { #ifdef MULTICHAR_SET rxvt_set_multichar_encoding(r, defaultfont[j].encoding_method); #endif for (k = 0; k < MAX_NFONTS; k++) { if (rs[Rs_font + k] == NULL) rs[Rs_font + k] = defaultfont[j].font[k]; #ifdef MULTICHAR_SET if (rs[Rs_mfont + k] == NULL) rs[Rs_mfont + k] = defaultfont[j].mfont[k]; #endif } return; } } /* * fallback for unknown encodings. ISO-8559-* gets special treatment */ #ifdef MULTICHAR_SET rxvt_set_multichar_encoding(r, "noenc"); #endif if (encoding >= ENC_ISO8859_1 && encoding <= ENC_ISO8859_LAST) { /* fallback for ISO-8859-* encodings */ k = encoding - ENC_ISO8859_1 + 1; MIN_IT(k, 99999); } else /* fallback for "C", "POSIX", and invalid locales */ k = 0; for (j = 0; j < MAX_NFONTS; j++) { if (rs[Rs_font + j] == NULL) { if (k == 0) rs[Rs_font + j] = def_fontName[j]; else { /* couple of wasted bytes each but lots of future expansion */ rs[Rs_font + j] = rxvt_malloc(STRLEN(defaultfont_8859[j]) + 4); sprintf((char *)rs[Rs_font + j], defaultfont_8859[j], k); } } #ifdef MULTICHAR_SET if (rs[Rs_mfont + j] == NULL) rs[Rs_mfont + j] = def_mfontName[j]; #endif } } rxvt-2.7.10/src/command.c010064400001440000024000002472010764024106300136200ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: command.c *----------------------------------------------------------------------* * $Id: command.c,v 1.264 2003/03/26 05:59:49 gcw Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1992 John Bovey, University of Kent at Canterbury * - original version * Copyright (c) 1994 Robert Nation * - extensive modifications * Copyright (c) 1995 Garrett D'Amore * - vt100 printing * Copyright (c) 1995 Steven Hirsch * - X11 mouse report mode and support for * DEC "private mode" save/restore functions. * Copyright (c) 1995 Jakub Jelinek * - key-related changes to handle Shift+function * keys properly. * Copyright (c) 1997 MJ Olesen * - extensive modifications * Copyright (c) 1997 Raul Garcia Garcia * - modification and cleanups for Solaris 2.x * and Linux 1.2.x * Copyright (c) 1997,1998 Oezguer Kesim * Copyright (c) 1998-2001 Geoff Wing * - extensive modifications * Copyright (c) 1998 Alfredo K. Kojima * Copyright (c) 2001 Marius Gedminas * - Ctrl/Mod4+Tab works like Meta+Tab (options) * * 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 of the License, 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. *----------------------------------------------------------------------*/ /*{{{ includes: */ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "version.h" #include "command.h" /*----------------------------------------------------------------------*/ /*{{{ Convert the keypress event into a string */ /* INTPROTO */ void rxvt_lookup_key(rxvt_t *r, XKeyEvent *ev) { int ctrl, meta, shft, len; unsigned int newlen; KeySym keysym; #ifdef DEBUG_CMD static int debug_key = 1; /* accessible by a debugger only */ #endif #ifdef USE_XIM int valid_keysym; #endif unsigned char *kbuf = r->h->kbuf; /* * use Num_Lock to toggle Keypad on/off. If Num_Lock is off, allow an * escape sequence to toggle the Keypad. * * Always permit `shift' to override the current setting */ shft = (ev->state & ShiftMask); ctrl = (ev->state & ControlMask); meta = (ev->state & r->h->ModMetaMask); if (r->numlock_state || (ev->state & r->h->ModNumLockMask)) { r->numlock_state = (ev->state & r->h->ModNumLockMask); PrivMode((!r->numlock_state), PrivMode_aplKP); } #ifdef USE_XIM if (r->h->Input_Context != NULL) { Status status_return; kbuf[0] = '\0'; len = XmbLookupString(r->h->Input_Context, ev, (char *)kbuf, KBUFSZ, &keysym, &status_return); valid_keysym = ((status_return == XLookupKeySym) || (status_return == XLookupBoth)); } else { len = XLookupString(ev, (char *)kbuf, KBUFSZ, &keysym, &r->h->compose); valid_keysym = 1; } #else /* USE_XIM */ len = XLookupString(ev, (char *)kbuf, KBUFSZ, &keysym, &r->h->compose); /* * map unmapped Latin[2-4]/Katakana/Arabic/Cyrillic/Greek entries -> Latin1 * good for installations with correct fonts, but without XLOCALE */ if (!len) { if ((keysym >= 0x0100) && (keysym < 0x0800)) { kbuf[0] = (keysym & 0xFF); kbuf[1] = '\0'; len = 1; } else kbuf[0] = '\0'; } #endif /* USE_XIM */ #ifdef USE_XIM if (valid_keysym) #endif { /* for some backwards compatibility */ #if defined(HOTKEY_CTRL) || defined(HOTKEY_META) # ifdef HOTKEY_CTRL if (ctrl) { # else if (meta) { # endif if (keysym == r->h->ks_bigfont) { rxvt_change_font(r, 0, FONT_UP); return; } else if (keysym == r->h->ks_smallfont) { rxvt_change_font(r, 0, FONT_DN); return; } } #endif if (r->TermWin.saveLines) { #ifdef UNSHIFTED_SCROLLKEYS if (!ctrl && !meta) { #else if (IS_SCROLL_MOD) { #endif int lnsppg; #ifdef PAGING_CONTEXT_LINES lnsppg = r->TermWin.nrow - PAGING_CONTEXT_LINES; #else lnsppg = r->TermWin.nrow * 4 / 5; #endif if (keysym == XK_Prior) { rxvt_scr_page(r, UP, lnsppg); return; } else if (keysym == XK_Next) { rxvt_scr_page(r, DN, lnsppg); return; } } #ifdef SCROLL_ON_UPDOWN_KEYS if (IS_SCROLL_MOD) { if (keysym == XK_Up) { rxvt_scr_page(r, UP, 1); return; } else if (keysym == XK_Down) { rxvt_scr_page(r, DN, 1); return; } } #endif #ifdef SCROLL_ON_HOMEEND_KEYS if (IS_SCROLL_MOD) { if (keysym == XK_Home) { rxvt_scr_move_to(r, 0, 1); return; } else if (keysym == XK_End) { rxvt_scr_move_to(r, 1, 0); return; } } #endif } if (shft) { /* Shift + F1 - F10 generates F11 - F20 */ if (keysym >= XK_F1 && keysym <= XK_F10) { keysym += (XK_F11 - XK_F1); shft = 0; /* turn off Shift */ } else if (!ctrl && !meta && (r->h->PrivateModes & PrivMode_ShiftKeys)) { switch (keysym) { /* normal XTerm key bindings */ case XK_Insert: /* Shift+Insert = paste mouse selection */ rxvt_selection_request(r, ev->time, 0, 0); return; /* rxvt extras */ case XK_KP_Add: /* Shift+KP_Add = bigger font */ rxvt_change_font(r, 0, FONT_UP); return; case XK_KP_Subtract: /* Shift+KP_Subtract = smaller font */ rxvt_change_font(r, 0, FONT_DN); return; } } } #ifdef PRINTPIPE if (keysym == XK_Print) { rxvt_scr_printscreen(r, ctrl | shft); return; } #endif #ifdef GREEK_SUPPORT if (keysym == r->h->ks_greekmodeswith) { r->h->greek_mode = !r->h->greek_mode; if (r->h->greek_mode) { rxvt_xterm_seq(r, XTerm_title, (greek_getmode() == GREEK_ELOT928 ? "[Greek: iso]" : "[Greek: ibm]"), CHAR_ST); greek_reset(); } else rxvt_xterm_seq(r, XTerm_title, APL_NAME "-" VERSION, CHAR_ST); return; } #endif if (keysym >= 0xFF00 && keysym <= 0xFFFF) { #ifdef KEYSYM_RESOURCE if (!(shft | ctrl) && r->h->Keysym_map[keysym & 0xFF] != NULL) { unsigned int l; const unsigned char *kbuf0; const unsigned char ch = C0_ESC; kbuf0 = (r->h->Keysym_map[keysym & 0xFF]); l = (unsigned int)*kbuf0++; /* escape prefix */ if (meta) # ifdef META8_OPTION if (r->h->meta_char == C0_ESC) # endif rxvt_tt_write(r, &ch, 1); rxvt_tt_write(r, kbuf0, l); return; } else #endif { newlen = 1; switch (keysym) { #ifndef NO_BACKSPACE_KEY case XK_BackSpace: if (r->h->PrivateModes & PrivMode_HaveBackSpace) { kbuf[0] = (!!(r->h->PrivateModes & PrivMode_BackSpace) ^ !!ctrl) ? '\b' : '\177'; kbuf[1] = '\0'; } else STRCPY(kbuf, r->h->key_backspace); # ifdef MULTICHAR_SET if ((r->Options & Opt_mc_hack) && r->screen.cur.col > 0) { int col, row; newlen = STRLEN(kbuf); col = r->screen.cur.col - 1; row = r->screen.cur.row + r->TermWin.saveLines; if (IS_MULTI2(r->screen.rend[row][col])) MEMMOVE(kbuf + newlen, kbuf, newlen + 1); } # endif break; #endif #ifndef NO_DELETE_KEY case XK_Delete: STRCPY(kbuf, r->h->key_delete); # ifdef MULTICHAR_SET if (r->Options & Opt_mc_hack) { int col, row; newlen = STRLEN(kbuf); col = r->screen.cur.col; row = r->screen.cur.row + r->TermWin.saveLines; if (IS_MULTI1(r->screen.rend[row][col])) MEMMOVE(kbuf + newlen, kbuf, newlen + 1); } # endif break; #endif case XK_Tab: if (shft) STRCPY(kbuf, "\033[Z"); else { #ifdef CTRL_TAB_MAKES_META if (ctrl) meta = 1; #endif #ifdef MOD4_TAB_MAKES_META if (ev->state & Mod4Mask) meta = 1; #endif newlen = 0; } break; #ifdef XK_KP_Left case XK_KP_Up: /* \033Ox or standard */ case XK_KP_Down: /* \033Or or standard */ case XK_KP_Right: /* \033Ov or standard */ case XK_KP_Left: /* \033Ot or standard */ if ((r->h->PrivateModes & PrivMode_aplKP) ? !shft : shft) { STRCPY(kbuf, "\033OZ"); kbuf[2] = ("txvr"[keysym - XK_KP_Left]); break; } else /* translate to std. cursor key */ keysym = XK_Left + (keysym - XK_KP_Left); /* FALLTHROUGH */ #endif case XK_Up: /* "\033[A" */ case XK_Down: /* "\033[B" */ case XK_Right: /* "\033[C" */ case XK_Left: /* "\033[D" */ STRCPY(kbuf, "\033[Z"); kbuf[2] = ("DACB"[keysym - XK_Left]); /* do Shift first */ if (shft) kbuf[2] = ("dacb"[keysym - XK_Left]); else if (ctrl) { kbuf[1] = 'O'; kbuf[2] = ("dacb"[keysym - XK_Left]); } else if (r->h->PrivateModes & PrivMode_aplCUR) kbuf[1] = 'O'; #ifdef MULTICHAR_SET if (r->Options & Opt_mc_hack) { int col, row, m; col = r->screen.cur.col; row = r->screen.cur.row + r->TermWin.saveLines; m = 0; if (keysym == XK_Right && IS_MULTI1(r->screen.rend[row][col])) m = 1; else if (keysym == XK_Left) { if (col > 0) { if (IS_MULTI2(r->screen.rend[row][col - 1])) m = 1; } else if (r->screen.cur.row > 0) { col = r->screen.tlen[--row]; if (col == -1) col = r->TermWin.ncol - 1; else col--; if (col > 0 && IS_MULTI2(r->screen.rend[row][col])) m = 1; } } if (m) MEMMOVE(kbuf + 3, kbuf, 3 + 1); } #endif break; #ifndef UNSHIFTED_SCROLLKEYS # ifdef XK_KP_Prior case XK_KP_Prior: /* allow shift to override */ if ((r->h->PrivateModes & PrivMode_aplKP) ? !shft : shft) { STRCPY(kbuf, "\033Oy"); break; } /* FALLTHROUGH */ # endif case XK_Prior: STRCPY(kbuf, "\033[5~"); break; # ifdef XK_KP_Next case XK_KP_Next: /* allow shift to override */ if ((r->h->PrivateModes & PrivMode_aplKP) ? !shft : shft) { STRCPY(kbuf, "\033Os"); break; } /* FALLTHROUGH */ # endif case XK_Next: STRCPY(kbuf, "\033[6~"); break; #endif case XK_KP_Enter: /* allow shift to override */ if ((r->h->PrivateModes & PrivMode_aplKP) ? !shft : shft) { STRCPY(kbuf, "\033OM"); } else { kbuf[0] = '\r'; kbuf[1] = '\0'; } break; #ifdef XK_KP_Begin case XK_KP_Begin: STRCPY(kbuf, "\033Ou"); break; case XK_KP_Insert: STRCPY(kbuf, "\033Op"); break; case XK_KP_Delete: STRCPY(kbuf, "\033On"); break; #endif case XK_KP_F1: /* "\033OP" */ case XK_KP_F2: /* "\033OQ" */ case XK_KP_F3: /* "\033OR" */ case XK_KP_F4: /* "\033OS" */ STRCPY(kbuf, "\033OP"); kbuf[2] += (keysym - XK_KP_F1); break; case XK_KP_Multiply: /* "\033Oj" : "*" */ case XK_KP_Add: /* "\033Ok" : "+" */ case XK_KP_Separator: /* "\033Ol" : "," */ case XK_KP_Subtract: /* "\033Om" : "-" */ case XK_KP_Decimal: /* "\033On" : "." */ case XK_KP_Divide: /* "\033Oo" : "/" */ case XK_KP_0: /* "\033Op" : "0" */ case XK_KP_1: /* "\033Oq" : "1" */ case XK_KP_2: /* "\033Or" : "2" */ case XK_KP_3: /* "\033Os" : "3" */ case XK_KP_4: /* "\033Ot" : "4" */ case XK_KP_5: /* "\033Ou" : "5" */ case XK_KP_6: /* "\033Ov" : "6" */ case XK_KP_7: /* "\033Ow" : "7" */ case XK_KP_8: /* "\033Ox" : "8" */ case XK_KP_9: /* "\033Oy" : "9" */ /* allow shift to override */ if ((r->h->PrivateModes & PrivMode_aplKP) ? !shft : shft) { STRCPY(kbuf, "\033Oj"); kbuf[2] += (keysym - XK_KP_Multiply); } else { kbuf[0] = ('*' + (keysym - XK_KP_Multiply)); kbuf[1] = '\0'; } break; case XK_Find: STRCPY(kbuf, "\033[1~"); break; case XK_Insert: STRCPY(kbuf, "\033[2~"); break; #ifdef DXK_Remove /* support for DEC remove like key */ case DXK_Remove: /* FALLTHROUGH */ #endif case XK_Execute: STRCPY(kbuf, "\033[3~"); break; case XK_Select: STRCPY(kbuf, "\033[4~"); break; #ifdef XK_KP_End case XK_KP_End: /* allow shift to override */ if ((r->h->PrivateModes & PrivMode_aplKP) ? !shft : shft) { STRCPY(kbuf, "\033Oq"); break; } /* FALLTHROUGH */ #endif case XK_End: STRCPY(kbuf, KS_END); break; #ifdef XK_KP_Home case XK_KP_Home: /* allow shift to override */ if ((r->h->PrivateModes & PrivMode_aplKP) ? !shft : shft) { STRCPY(kbuf, "\033Ow"); break; } /* FALLTHROUGH */ #endif case XK_Home: STRCPY(kbuf, KS_HOME); break; #define FKEY(n, fkey) \ sprintf((char *)kbuf,"\033[%2d~", (int)((n) + (keysym - fkey))) case XK_F1: /* "\033[11~" */ case XK_F2: /* "\033[12~" */ case XK_F3: /* "\033[13~" */ case XK_F4: /* "\033[14~" */ case XK_F5: /* "\033[15~" */ FKEY(11, XK_F1); break; case XK_F6: /* "\033[17~" */ case XK_F7: /* "\033[18~" */ case XK_F8: /* "\033[19~" */ case XK_F9: /* "\033[20~" */ case XK_F10: /* "\033[21~" */ FKEY(17, XK_F6); break; case XK_F11: /* "\033[23~" */ case XK_F12: /* "\033[24~" */ case XK_F13: /* "\033[25~" */ case XK_F14: /* "\033[26~" */ FKEY(23, XK_F11); break; case XK_F15: /* "\033[28~" */ case XK_F16: /* "\033[29~" */ FKEY(28, XK_F15); break; case XK_Help: /* "\033[28~" */ FKEY(28, XK_Help); break; case XK_Menu: /* "\033[29~" */ FKEY(29, XK_Menu); break; case XK_F17: /* "\033[31~" */ case XK_F18: /* "\033[32~" */ case XK_F19: /* "\033[33~" */ case XK_F20: /* "\033[34~" */ case XK_F21: /* "\033[35~" */ case XK_F22: /* "\033[36~" */ case XK_F23: /* "\033[37~" */ case XK_F24: /* "\033[38~" */ case XK_F25: /* "\033[39~" */ case XK_F26: /* "\033[40~" */ case XK_F27: /* "\033[41~" */ case XK_F28: /* "\033[42~" */ case XK_F29: /* "\033[43~" */ case XK_F30: /* "\033[44~" */ case XK_F31: /* "\033[45~" */ case XK_F32: /* "\033[46~" */ case XK_F33: /* "\033[47~" */ case XK_F34: /* "\033[48~" */ case XK_F35: /* "\033[49~" */ FKEY(31, XK_F17); break; #undef FKEY default: newlen = 0; break; } if (newlen) len = STRLEN(kbuf); } /* * Pass meta for all function keys, if 'meta' option set */ #ifdef META8_OPTION if (meta && (r->h->meta_char == 0x80) && len > 0) kbuf[len - 1] |= 0x80; #endif } else if (ctrl && keysym == XK_minus) { len = 1; kbuf[0] = '\037'; /* Ctrl-Minus generates ^_ (31) */ } else { #ifdef META8_OPTION /* set 8-bit on */ if (meta && (r->h->meta_char == 0x80)) { unsigned char *ch; for (ch = kbuf; ch < kbuf + len; ch++) *ch |= 0x80; meta = 0; } #endif #ifdef GREEK_SUPPORT if (r->h->greek_mode) len = greek_xlat(kbuf, len); #endif /* nil */ ; } } if (len <= 0) return; /* not mapped */ if (r->Options & Opt_scrollTtyKeypress) if (r->TermWin.view_start) { r->TermWin.view_start = 0; r->h->want_refresh = 1; } /* * these modifications only affect the static keybuffer * pass Shift/Control indicators for function keys ending with `~' * * eg, * Prior = "ESC[5~" * Shift+Prior = "ESC[5$" * Ctrl+Prior = "ESC[5^" * Ctrl+Shift+Prior = "ESC[5@" * Meta adds an Escape prefix (with META8_OPTION, if meta == ). */ if (kbuf[0] == C0_ESC && kbuf[1] == '[' && kbuf[len - 1] == '~') kbuf[len - 1] = (shft ? (ctrl ? '@' : '$') : (ctrl ? '^' : '~')); /* escape prefix */ if (meta #ifdef META8_OPTION && (r->h->meta_char == C0_ESC) #endif ) { const unsigned char ch = C0_ESC; rxvt_tt_write(r, &ch, 1); } #ifdef DEBUG_CMD if (debug_key) { /* Display keyboard buffer contents */ char *p; int i; fprintf(stderr, "key 0x%04X [%d]: `", (unsigned int)keysym, len); for (i = 0, p = kbuf; i < len; i++, p++) fprintf(stderr, (*p >= ' ' && *p < '\177' ? "%c" : "\\%03o"), *p); fprintf(stderr, "'\n"); } #endif /* DEBUG_CMD */ rxvt_tt_write(r, kbuf, (unsigned int)len); } /*}}} */ #if (MENUBAR_MAX) /*{{{ rxvt_cmd_write(), rxvt_cmd_getc() */ /* attempt to `write' count to the input buffer */ /* EXTPROTO */ unsigned int rxvt_cmd_write(rxvt_t *r, const unsigned char *str, unsigned int count) { unsigned int n, s; unsigned char *cmdbuf_base = r->h->cmdbuf_base, *cmdbuf_endp = r->h->cmdbuf_endp, *cmdbuf_ptr = r->h->cmdbuf_ptr; n = cmdbuf_ptr - cmdbuf_base; s = cmdbuf_base + BUFSIZ - 1 - cmdbuf_endp; if (n > 0 && s < count) { MEMMOVE(cmdbuf_base, cmdbuf_ptr, (unsigned int)(cmdbuf_endp - cmdbuf_ptr)); cmdbuf_ptr = cmdbuf_base; cmdbuf_endp -= n; s += n; } if (count > s) { rxvt_print_error("data loss: cmd_write too large"); count = s; } for (; count--;) *cmdbuf_endp++ = *str++; r->h->cmdbuf_ptr = cmdbuf_ptr; r->h->cmdbuf_endp = cmdbuf_endp; return 0; } #endif /* MENUBAR_MAX */ /* rxvt_cmd_getc() - Return next input character */ /* * Return the next input character after first passing any keyboard input * to the command. */ /* INTPROTO */ unsigned char rxvt_cmd_getc(rxvt_t *r) { #define TIMEOUT_USEC 5000 fd_set readfds; int quick_timeout, select_res; struct timeval value; struct rxvt_hidden *h = r->h; if (h->cmdbuf_ptr < h->cmdbuf_endp) /* characters already read in */ return *h->cmdbuf_ptr++; for (;;) { /* loop until we can return something */ if (h->v_bufstr < h->v_bufptr) /* output any pending chars */ rxvt_tt_write(r, NULL, 0); while (XPending(r->Xdisplay)) { /* process pending X events */ XEvent xev; XNextEvent(r->Xdisplay, &xev); #ifdef USE_XIM if (!XFilterEvent(&xev, xev.xany.window)) rxvt_process_x_event(r, &xev); h->event_type = xev.type; #else rxvt_process_x_event(r, &xev); #endif /* in case button actions pushed chars to cmdbuf */ if (h->cmdbuf_ptr < h->cmdbuf_endp) return *h->cmdbuf_ptr++; } /* * the command input buffer is empty and we have no pending X events */ quick_timeout = 0; #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) if (h->mouse_slip_wheel_speed) { quick_timeout = 1; if (!h->mouse_slip_wheel_delay-- && rxvt_scr_page(r, h->mouse_slip_wheel_speed > 0 ? UP : DN, abs(h->mouse_slip_wheel_speed))) { h->mouse_slip_wheel_delay = SCROLLBAR_CONTINUOUS_DELAY; h->refresh_type |= SMOOTH_REFRESH; h->want_refresh = 1; } } #endif /* MOUSE_WHEEL && MOUSE_SLIP_WHEELING */ #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING if (scrollbar_isUp() || scrollbar_isDn()) { quick_timeout = 1; if (!h->scroll_arrow_delay-- && rxvt_scr_page(r, scrollbar_isUp() ? UP : DN, 1)) { h->scroll_arrow_delay = SCROLLBAR_CONTINUOUS_DELAY; h->refresh_type |= SMOOTH_REFRESH; h->want_refresh = 1; } } #endif /* NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING */ FD_ZERO(&readfds); FD_SET(r->cmd_fd, &readfds); FD_SET(r->Xfd, &readfds); value.tv_usec = TIMEOUT_USEC; value.tv_sec = 0; if (!r->TermWin.mapped) quick_timeout = 0; else { quick_timeout |= h->want_refresh; #ifdef TRANSPARENT quick_timeout |= h->want_full_refresh; #endif } if ((select_res = select(r->num_fds, &readfds, NULL, NULL, (quick_timeout ? &value : NULL))) == 0) { /* select statement timed out - we're not hard and fast scrolling */ h->refresh_limit = 1; } /* See if we can read new data from the application */ if (select_res > 0 && FD_ISSET(r->cmd_fd, &readfds)) { int n; unsigned int count; h->cmdbuf_ptr = h->cmdbuf_endp = h->cmdbuf_base; for (count = BUFSIZ; count; count -= n, h->cmdbuf_endp += n) if ((n = read(r->cmd_fd, h->cmdbuf_endp, count)) > 0) continue; else if (n == 0 || (n < 0 && errno == EAGAIN)) break; else { rxvt_clean_exit(); exit(EXIT_FAILURE); /* bad order of events? */ } if (count != BUFSIZ) /* some characters read in */ return *h->cmdbuf_ptr++; } #ifdef TRANSPARENT if (h->want_full_refresh) { h->want_full_refresh = 0; rxvt_scr_clear(r); rxvt_scr_touch(r, False); h->want_refresh = 1; } #endif if (h->want_refresh) { rxvt_scr_refresh(r, h->refresh_type); rxvt_scrollbar_show(r, 1); #ifdef USE_XIM rxvt_IMSendSpot(r); #endif } } /* NOTREACHED */ } /*}}} */ /* INTPROTO */ void rxvt_mouse_report(rxvt_t *r, const XButtonEvent *ev) { int button_number, key_state = 0; int x, y; x = ev->x; y = ev->y; rxvt_pixel_position(r, &x, &y); if (r->h->MEvent.button == AnyButton) { button_number = 3; } else { button_number = r->h->MEvent.button - Button1; /* add 0x3D for wheel events, like xterm does */ if (button_number >= 3) button_number += (64 - 3); } if (r->h->PrivateModes & PrivMode_MouseX10) { /* * do not report ButtonRelease * no state info allowed */ key_state = 0; if (button_number == 3) return; } else { /* XTerm mouse reporting needs these values: * 4 = Shift * 8 = Meta * 16 = Control * plus will add in our own Double-Click reporting * 32 = Double Click */ key_state = ((r->h->MEvent.state & ShiftMask) ? 4 : 0) + ((r->h->MEvent.state & r->h->ModMetaMask) ? 8 : 0) + ((r->h->MEvent.state & ControlMask) ? 16 : 0); #ifdef MOUSE_REPORT_DOUBLECLICK key_state += ((r->h->MEvent.clicks > 1) ? 32 : 0); #endif } #ifdef DEBUG_MOUSEREPORT fprintf(stderr, "Mouse ["); if (key_state & 16) fputc('C', stderr); if (key_state & 4) fputc('S', stderr); if (key_state & 8) fputc('A', stderr); if (key_state & 32) fputc('2', stderr); fprintf(stderr, "]: <%d>, %d/%d\n", button_number, x + 1, y + 1); #else rxvt_tt_printf(r, "\033[M%c%c%c", (32 + button_number + key_state), (32 + x + 1), (32 + y + 1)); #endif } #ifdef USING_W11LIB /* EXTPROTO */ void rxvt_W11_process_x_event(XEvent *ev) { rxvt_t *r = rxvt_get_r(); rxvt_process_x_event(r, ev); } #endif /*{{{ process an X event */ /* INTPROTO */ void rxvt_process_x_event(rxvt_t *r, XEvent *ev) { int i, want_time = 0; Window unused_root, unused_child; int unused_root_x, unused_root_y; unsigned int unused_mask; struct timeval tp; struct rxvt_hidden *h = r->h; #ifdef DEBUG_X const char *const eventnames[] = { /* mason - this matches my system */ "", "", "KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease", "MotionNotify", "EnterNotify", "LeaveNotify", "FocusIn", "FocusOut", "KeymapNotify", "Expose", "GraphicsExpose", "NoExpose", "VisibilityNotify", "CreateNotify", "DestroyNotify", "UnmapNotify", "MapNotify", "MapRequest", "ReparentNotify", "ConfigureNotify", "ConfigureRequest", "GravityNotify", "ResizeRequest", "CirculateNotify", "CirculateRequest", "PropertyNotify", "SelectionClear", "SelectionRequest", "SelectionNotify", "ColormapNotify", "ClientMessage", "MappingNotify" }; struct tm *ltt; #endif #ifdef DEBUG_X want_time = 1; #else /* * check if we need to get the time for any timeouts */ for (i = NUM_TIMEOUTS; i--; ) if (h->timeout[i].tv_sec) { want_time = 1; break; } #endif if (want_time) (void)gettimeofday(&tp, NULL); #ifdef DEBUG_X ltt = localtime(&(tp.tv_sec)); D_X((stderr, "Event: %-16s %-7s %08lx (%4d-%02d-%02d %02d:%02d:%02d.%.6ld) %s %lu", eventnames[ev->type], (ev->xany.window == r->TermWin.parent[0] ? "parent" : (ev->xany.window == r->TermWin.vt ? "vt" : (ev->xany.window == r->scrollBar.win ? "scroll" : (ev->xany.window == r->menuBar.win ? "menubar" : "UNKNOWN")))), (ev->xany.window == r->TermWin.parent[0] ? r->TermWin.parent[0] : (ev->xany.window == r->TermWin.vt ? r->TermWin.vt : (ev->xany.window == r->scrollBar.win ? r->scrollBar.win : (ev->xany.window == r->menuBar.win ? r->menuBar.win : 0)))), ltt->tm_year + 1900, ltt->tm_mon + 1, ltt->tm_mday, ltt->tm_hour, ltt->tm_min, ltt->tm_sec, tp.tv_usec, ev->xany.send_event ? "S" : " ", ev->xany.serial)); #endif /* X event timeouts */ if (want_time) for (i = NUM_TIMEOUTS; i--; ) { if (h->timeout[i].tv_sec == 0) continue; if ((tp.tv_sec < h->timeout[i].tv_sec) || (tp.tv_sec == h->timeout[i].tv_sec && tp.tv_usec < h->timeout[i].tv_usec)) continue; h->timeout[i].tv_sec = 0; switch(i) { case TIMEOUT_INCR: rxvt_print_error("data loss: timeout on INCR selection paste"); h->selection_wait = Sel_none; break; default: break; } } switch (ev->type) { case KeyPress: rxvt_lookup_key(r, (XKeyEvent *)ev); break; #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) case KeyRelease: { if (!(ev->xkey.state & ControlMask)) h->mouse_slip_wheel_speed = 0; else { KeySym ks; ks = XKeycodeToKeysym(r->Xdisplay, ev->xkey.keycode, 0); if (ks == XK_Control_L || ks == XK_Control_R) h->mouse_slip_wheel_speed = 0; } break; } #endif case ButtonPress: rxvt_button_press(r, (XButtonEvent *)ev); break; case ButtonRelease: rxvt_button_release(r, (XButtonEvent *)ev); break; case ClientMessage: if (ev->xclient.format == 32 && (Atom)ev->xclient.data.l[0] == h->xa[XA_WMDELETEWINDOW]) exit(EXIT_SUCCESS); #ifdef OFFIX_DND /* OffiX Dnd (drag 'n' drop) protocol */ if (ev->xclient.message_type == h->xa[XA_DNDPROTOCOL] && (ev->xclient.data.l[0] == DndFile || ev->xclient.data.l[0] == DndDir || ev->xclient.data.l[0] == DndLink)) { /* Get Dnd data */ Atom ActualType; int ActualFormat; unsigned char *data; unsigned long Size, RemainingBytes; XGetWindowProperty(r->Xdisplay, Xroot, r->h->xa[XA_DNDSELECTION], 0L, 1000000L, False, AnyPropertyType, &ActualType, &ActualFormat, &Size, &RemainingBytes, &data); XChangeProperty(r->Xdisplay, Xroot, XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace, data, STRLEN(data)); rxvt_selection_paste(r, Xroot, XA_CUT_BUFFER0, True); XSetInputFocus(r->Xdisplay, Xroot, RevertToNone, CurrentTime); } #endif /* OFFIX_DND */ break; case MappingNotify: XRefreshKeyboardMapping(&(ev->xmapping)); break; /* * XXX: this is not the _current_ arrangement * Here's my conclusion: * If the window is completely unobscured, use bitblt's * to scroll. Even then, they're only used when doing partial * screen scrolling. When partially obscured, we have to fill * in the GraphicsExpose parts, which means that after each refresh, * we need to wait for the graphics expose or Noexpose events, * which ought to make things real slow! */ case VisibilityNotify: switch (ev->xvisibility.state) { case VisibilityUnobscured: h->refresh_type = FAST_REFRESH; break; case VisibilityPartiallyObscured: h->refresh_type = SLOW_REFRESH; break; default: h->refresh_type = NO_REFRESH; break; } break; case FocusIn: if (!r->TermWin.focus) { r->TermWin.focus = 1; h->want_refresh = 1; #ifdef USE_XIM if (h->Input_Context != NULL) XSetICFocus(h->Input_Context); #endif } break; case FocusOut: if (r->TermWin.focus) { r->TermWin.focus = 0; h->want_refresh = 1; #ifdef USE_XIM if (h->Input_Context != NULL) XUnsetICFocus(h->Input_Context); #endif } break; case ConfigureNotify: if (ev->xconfigure.window == r->TermWin.parent[0]) { int height, width; do { /* Wrap lots of configures into one */ width = ev->xconfigure.width; height = ev->xconfigure.height; } while (XCheckTypedWindowEvent(r->Xdisplay, ev->xconfigure.window, ConfigureNotify, ev)); if (r->szHint.width != width || r->szHint.height != height) rxvt_resize_all_windows(r, (unsigned int)width, (unsigned int)height, 1); #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ if (r->Options & Opt_transparent) { rxvt_check_our_parents(r); if (h->am_transparent) h->want_full_refresh = 1; } #endif } break; case SelectionClear: rxvt_selection_clear(r); break; case SelectionNotify: if (h->selection_wait == Sel_normal) rxvt_selection_paste(r, ev->xselection.requestor, ev->xselection.property, True); break; case SelectionRequest: rxvt_selection_send(r, &(ev->xselectionrequest)); break; case UnmapNotify: r->TermWin.mapped = 0; break; case MapNotify: r->TermWin.mapped = 1; break; case PropertyNotify: if (ev->xproperty.atom == h->xa[XA_VT_SELECTION]) { if (ev->xproperty.state == PropertyNewValue) rxvt_selection_property(r, ev->xproperty.window, ev->xproperty.atom); break; } #ifdef TRANSPARENT /* * if user used some Esetroot compatible prog to set the root bg, * use the property to determine the pixmap. We use it later on. */ if (h->xa[XA_XROOTPMAPID] == 0) h->xa[XA_XROOTPMAPID] = XInternAtom(r->Xdisplay, "_XROOTPMAP_ID", False); if (ev->xproperty.atom != h->xa[XA_XROOTPMAPID]) break; /* FALLTHROUGH */ case ReparentNotify: if ((r->Options & Opt_transparent) && rxvt_check_our_parents(r)) { if (h->am_transparent) h->want_full_refresh = 1; } #endif /* TRANSPARENT */ break; case GraphicsExpose: case Expose: if (ev->xany.window == r->TermWin.vt) { #ifdef NO_SLOW_LINK_SUPPORT rxvt_scr_expose(r, ev->xexpose.x, ev->xexpose.y, ev->xexpose.width, ev->xexpose.height, False); #else rxvt_scr_expose(r, ev->xexpose.x, 0, ev->xexpose.width, r->TermWin.height, False); #endif h->want_refresh = 1; } else { XEvent unused_xevent; while (XCheckTypedWindowEvent(r->Xdisplay, ev->xany.window, Expose, &unused_xevent)) ; while (XCheckTypedWindowEvent(r->Xdisplay, ev->xany.window, GraphicsExpose, &unused_xevent)) ; if (isScrollbarWindow(ev->xany.window)) { scrollbar_setIdle(); rxvt_scrollbar_show(r, 0); } if (menubar_visible(r) && isMenuBarWindow(ev->xany.window)) rxvt_menubar_expose(r); rxvt_Gr_expose(r, ev->xany.window); } break; case MotionNotify: if (isMenuBarWindow(ev->xany.window)) { rxvt_menubar_control(r, &(ev->xbutton)); break; } if ((h->PrivateModes & PrivMode_mouse_report) && !(h->bypass_keystate)) break; if (ev->xany.window == r->TermWin.vt) { if ((ev->xbutton.state & (Button1Mask | Button3Mask))) { while (XCheckTypedWindowEvent(r->Xdisplay, r->TermWin.vt, MotionNotify, ev)) ; XQueryPointer(r->Xdisplay, r->TermWin.vt, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->xbutton.x), &(ev->xbutton.y), &unused_mask); #ifdef MOUSE_THRESHOLD /* deal with a `jumpy' mouse */ if ((ev->xmotion.time - h->MEvent.time) > MOUSE_THRESHOLD) #endif rxvt_selection_extend(r, (ev->xbutton.x), (ev->xbutton.y), (ev->xbutton.state & Button3Mask) ? 2 : 0); } } else if (isScrollbarWindow(ev->xany.window) && scrollbar_isMotion()) { while (XCheckTypedWindowEvent(r->Xdisplay, r->scrollBar.win, MotionNotify, ev)) ; XQueryPointer(r->Xdisplay, r->scrollBar.win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->xbutton.x), &(ev->xbutton.y), &unused_mask); rxvt_scr_move_to(r, scrollbar_position(ev->xbutton.y) - h->csrO, scrollbar_size()); rxvt_scr_refresh(r, h->refresh_type); h->refresh_limit = 0; rxvt_scrollbar_show(r, 1); } break; } } /* INTPROTO */ void rxvt_button_press(rxvt_t *r, XButtonEvent *ev) { int reportmode = 0, clickintime; struct rxvt_hidden *h = r->h; h->bypass_keystate = ev->state & (h->ModMetaMask | ShiftMask); if (!h->bypass_keystate) reportmode = !!(h->PrivateModes & PrivMode_mouse_report); /* * VT window processing of button press */ if (ev->window == r->TermWin.vt) { if (ev->subwindow != None) rxvt_Gr_ButtonPress(ev->x, ev->y); else { clickintime = ev->time - h->MEvent.time < MULTICLICK_TIME; if (reportmode) { /* mouse report from vt window */ /* save the xbutton state (for ButtonRelease) */ h->MEvent.state = ev->state; #ifdef MOUSE_REPORT_DOUBLECLICK if (ev->button == h->MEvent.button && clickintime) { /* same button, within alloted time */ h->MEvent.clicks++; if (h->MEvent.clicks > 1) { /* only report double clicks */ h->MEvent.clicks = 2; rxvt_mouse_report(r, ev); /* don't report the release */ h->MEvent.clicks = 0; h->MEvent.button = AnyButton; } } else { /* different button, or time expired */ h->MEvent.clicks = 1; h->MEvent.button = ev->button; rxvt_mouse_report(r, ev); } #else h->MEvent.button = ev->button; rxvt_mouse_report(r, ev); #endif /* MOUSE_REPORT_DOUBLECLICK */ } else { if (ev->button != h->MEvent.button) h->MEvent.clicks = 0; switch (ev->button) { case Button1: if (h->MEvent.button == Button1 && clickintime) h->MEvent.clicks++; else h->MEvent.clicks = 1; rxvt_selection_click(r, h->MEvent.clicks, ev->x, ev->y); h->MEvent.button = Button1; break; case Button3: if (h->MEvent.button == Button3 && clickintime) rxvt_selection_rotate(r, ev->x, ev->y); else rxvt_selection_extend(r, ev->x, ev->y, 1); h->MEvent.button = Button3; break; } } h->MEvent.time = ev->time; return; } } /* * Scrollbar window processing of button press */ if (isScrollbarWindow(ev->window)) { scrollbar_setIdle(); /* * Rxvt-style scrollbar: * move up if mouse is above slider * move dn if mouse is below slider * * XTerm-style scrollbar: * Move display proportional to pointer location * pointer near top -> scroll one line * pointer near bot -> scroll full page */ #ifndef NO_SCROLLBAR_REPORT if (reportmode) { /* * Mouse report disabled scrollbar: * arrow buttons - send up/down * click on scrollbar - send pageup/down */ if ((r->scrollBar.style == R_SB_NEXT && scrollbarnext_upButton(ev->y)) || (r->scrollBar.style == R_SB_RXVT && scrollbarrxvt_upButton(ev->y))) rxvt_tt_printf(r, "\033[A"); else if ((r->scrollBar.style == R_SB_NEXT && scrollbarnext_dnButton(ev->y)) || (r->scrollBar.style == R_SB_RXVT && scrollbarrxvt_dnButton(ev->y))) rxvt_tt_printf(r, "\033[B"); else switch (ev->button) { case Button2: rxvt_tt_printf(r, "\014"); break; case Button1: rxvt_tt_printf(r, "\033[6~"); break; case Button3: rxvt_tt_printf(r, "\033[5~"); break; } } else #endif /* NO_SCROLLBAR_REPORT */ { char upordown = 0; if (r->scrollBar.style == R_SB_NEXT) { if (scrollbarnext_upButton(ev->y)) upordown = -1; /* up */ else if (scrollbarnext_dnButton(ev->y)) upordown = 1; /* down */ } else if (r->scrollBar.style == R_SB_RXVT) { if (scrollbarrxvt_upButton(ev->y)) upordown = -1; /* up */ else if (scrollbarrxvt_dnButton(ev->y)) upordown = 1; /* down */ } if (upordown) { #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING h->scroll_arrow_delay = SCROLLBAR_INITIAL_DELAY; #endif if (rxvt_scr_page(r, upordown < 0 ? UP : DN, 1)) { if (upordown < 0) scrollbar_setUp(); else scrollbar_setDn(); } } else switch (ev->button) { case Button2: switch (h->scrollbar_align) { case R_SB_ALIGN_TOP: h->csrO = 0; break; case R_SB_ALIGN_CENTRE: h->csrO = (r->scrollBar.bot - r->scrollBar.top) / 2; break; case R_SB_ALIGN_BOTTOM: h->csrO = r->scrollBar.bot - r->scrollBar.top; break; } if (r->scrollBar.style == R_SB_XTERM || scrollbar_above_slider(ev->y) || scrollbar_below_slider(ev->y)) rxvt_scr_move_to(r, scrollbar_position(ev->y) - h->csrO, scrollbar_size()); scrollbar_setMotion(); break; case Button1: if (h->scrollbar_align == R_SB_ALIGN_CENTRE) h->csrO = ev->y - r->scrollBar.top; /* FALLTHROUGH */ case Button3: if (r->scrollBar.style != R_SB_XTERM) { if (scrollbar_above_slider(ev->y)) # ifdef RXVT_SCROLL_FULL rxvt_scr_page(r, UP, r->TermWin.nrow - 1); # else rxvt_scr_page(r, UP, r->TermWin.nrow / 4); # endif else if (scrollbar_below_slider(ev->y)) # ifdef RXVT_SCROLL_FULL rxvt_scr_page(r, DN, r->TermWin.nrow - 1); # else rxvt_scr_page(r, DN, r->TermWin.nrow / 4); # endif else scrollbar_setMotion(); } else { rxvt_scr_page(r, (ev->button == Button1 ? DN : UP), (r->TermWin.nrow * scrollbar_position(ev->y) / scrollbar_size())); } break; } } return; } /* * Menubar window processing of button press */ if (isMenuBarWindow(ev->window)) rxvt_menubar_control(r, ev); } /* INTPROTO */ void rxvt_button_release(rxvt_t *r, XButtonEvent *ev) { int reportmode = 0; r->h->csrO = 0; /* reset csr Offset */ if (!r->h->bypass_keystate) reportmode = !!(r->h->PrivateModes & PrivMode_mouse_report); if (scrollbar_isUpDn()) { scrollbar_setIdle(); rxvt_scrollbar_show(r, 0); #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING r->h->refresh_type &= ~SMOOTH_REFRESH; #endif } if (ev->window == r->TermWin.vt) { if (ev->subwindow != None) rxvt_Gr_ButtonRelease(ev->x, ev->y); else { if (reportmode) { /* mouse report from vt window */ /* don't report release of wheel "buttons" */ if (ev->button >= 4) return; #ifdef MOUSE_REPORT_DOUBLECLICK /* only report the release of 'slow' single clicks */ if (r->h->MEvent.button != AnyButton && (ev->button != r->h->MEvent.button || (ev->time - r->h->MEvent.time > MULTICLICK_TIME / 2))) { r->h->MEvent.clicks = 0; r->h->MEvent.button = AnyButton; rxvt_mouse_report(r, ev); } #else /* MOUSE_REPORT_DOUBLECLICK */ r->h->MEvent.button = AnyButton; rxvt_mouse_report(r, ev); #endif /* MOUSE_REPORT_DOUBLECLICK */ return; } /* * dumb hack to compensate for the failure of click-and-drag * when overriding mouse reporting */ if (r->h->PrivateModes & PrivMode_mouse_report && r->h->bypass_keystate && ev->button == Button1 && r->h->MEvent.clicks <= 1) rxvt_selection_extend(r, ev->x, ev->y, 0); switch (ev->button) { case Button1: case Button3: rxvt_selection_make(r, ev->time); break; case Button2: rxvt_selection_request(r, ev->time, ev->x, ev->y); break; #ifdef MOUSE_WHEEL case Button4: case Button5: { int i, v; v = (ev->button == Button4) ? UP : DN; if (ev->state & ShiftMask) i = 1; else if ((r->Options & Opt_mouseWheelScrollPage)) i = r->TermWin.nrow - 1; else i = 5; # ifdef MOUSE_SLIP_WHEELING if (ev->state & ControlMask) { r->h->mouse_slip_wheel_speed += (v ? -1 : 1); r->h->mouse_slip_wheel_delay = SCROLLBAR_CONTINUOUS_DELAY; } # endif # ifdef JUMP_MOUSE_WHEEL rxvt_scr_page(r, v, i); rxvt_scr_refresh(r, SMOOTH_REFRESH); rxvt_scrollbar_show(r, 1); # else for (; i--;) { rxvt_scr_page(r, v, 1); rxvt_scr_refresh(r, SMOOTH_REFRESH); rxvt_scrollbar_show(r, 1); } # endif } break; #endif } } } else if (isMenuBarWindow(ev->window)) rxvt_menubar_control(r, ev); } #ifdef TRANSPARENT /* * Check our parents are still who we think they are. * Do transparency updates if required */ /* EXTPROTO */ int rxvt_check_our_parents(rxvt_t *r) { int i, pchanged, aformat, have_pixmap, rootdepth; unsigned long nitems, bytes_after; Atom atype; unsigned char *prop = NULL; Window root, oldp, *list; Pixmap rootpixmap = None; XWindowAttributes wattr, wrootattr; pchanged = 0; if (!(r->Options & Opt_transparent)) return pchanged; /* Don't try any more */ XGetWindowAttributes(r->Xdisplay, Xroot, &wrootattr); rootdepth = wrootattr.depth; XGetWindowAttributes(r->Xdisplay, r->TermWin.parent[0], &wattr); if (rootdepth != wattr.depth) { if (r->h->am_transparent) { pchanged = 1; XSetWindowBackground(r->Xdisplay, r->TermWin.vt, r->PixColors[Color_bg]); r->h->am_transparent = r->h->am_pixmap_trans = 0; } return pchanged; /* Don't try any more */ } /* Get all X ops out of the queue so that our information is up-to-date. */ XSync(r->Xdisplay, False); /* * Make the frame window set by the window manager have * the root background. Some window managers put multiple nested frame * windows for each client, so we have to take care about that. */ i = (r->h->xa[XA_XROOTPMAPID] != 0 && (XGetWindowProperty(r->Xdisplay, Xroot, r->h->xa[XA_XROOTPMAPID], 0L, 1L, False, XA_PIXMAP, &atype, &aformat, &nitems, &bytes_after, &prop) == Success)); if (!i || prop == NULL) have_pixmap = 0; else { have_pixmap = 1; rootpixmap = *((Pixmap *)prop); XFree(prop); } if (have_pixmap) { /* * Copy Xroot pixmap transparency */ int sx, sy, nx, ny; unsigned int nw, nh; Window cr; XImage *image; GC gc; XGCValues gcvalue; XTranslateCoordinates(r->Xdisplay, r->TermWin.parent[0], Xroot, 0, 0, &sx, &sy, &cr); nw = (unsigned int)r->szHint.width; nh = (unsigned int)r->szHint.height; nx = ny = 0; if (sx < 0) { nw += sx; nx = -sx; sx = 0; } if (sy < 0) { nh += sy; ny = -sy; sy = 0; } MIN_IT(nw, (unsigned int)(wrootattr.width - sx)); MIN_IT(nh, (unsigned int)(wrootattr.height - sy)); r->h->allowedxerror = -1; image = XGetImage(r->Xdisplay, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); /* XXX: handle BadMatch - usually because we're outside the pixmap */ /* XXX: may need a delay here? */ r->h->allowedxerror = 0; if (image == NULL) { if (r->h->am_transparent && r->h->am_pixmap_trans) { pchanged = 1; if (r->TermWin.pixmap != None) { XFreePixmap(r->Xdisplay, r->TermWin.pixmap); r->TermWin.pixmap = None; } } r->h->am_pixmap_trans = 0; } else { if (r->TermWin.pixmap != None) XFreePixmap(r->Xdisplay, r->TermWin.pixmap); r->TermWin.pixmap = XCreatePixmap(r->Xdisplay, r->TermWin.vt, (unsigned int)r->szHint.width, (unsigned int)r->szHint.height, (unsigned int)image->depth); gc = XCreateGC(r->Xdisplay, r->TermWin.vt, 0UL, &gcvalue); XPutImage(r->Xdisplay, r->TermWin.pixmap, gc, image, 0, 0, nx, ny, (unsigned int)image->width, (unsigned int)image->height); XFreeGC(r->Xdisplay, gc); XDestroyImage(image); XSetWindowBackgroundPixmap(r->Xdisplay, r->TermWin.vt, r->TermWin.pixmap); if (!r->h->am_transparent || !r->h->am_pixmap_trans) pchanged = 1; r->h->am_transparent = r->h->am_pixmap_trans = 1; } } if (!r->h->am_pixmap_trans) { unsigned int n; /* * InheritPixmap transparency */ D_X((stderr, "InheritPixmap Seeking to %08lx", Xroot)); for (i = 1; i < (int)(sizeof(r->TermWin.parent) / sizeof(Window)); i++) { oldp = r->TermWin.parent[i]; XQueryTree(r->Xdisplay, r->TermWin.parent[i - 1], &root, &r->TermWin.parent[i], &list, &n); XFree(list); D_X((stderr, "InheritPixmap Parent[%d] = %08lx", i, r->TermWin.parent[i])); if (r->TermWin.parent[i] == Xroot) { if (oldp != None) pchanged = 1; break; } if (oldp != r->TermWin.parent[i]) pchanged = 1; } n = 0; if (pchanged) { for (; n < (unsigned int)i; n++) { XGetWindowAttributes(r->Xdisplay, r->TermWin.parent[n], &wattr); D_X((stderr, "InheritPixmap Checking Parent[%d]: %s", n, (wattr.depth == rootdepth && wattr.class != InputOnly) ? "OK" : "FAIL")); if (wattr.depth != rootdepth || wattr.class == InputOnly) { n = (int)(sizeof(r->TermWin.parent) / sizeof(Window)) + 1; break; } } } if (n > (int)(sizeof(r->TermWin.parent) / sizeof(r->TermWin.parent[0]))) { D_X((stderr, "InheritPixmap Turning off")); XSetWindowBackground(r->Xdisplay, r->TermWin.parent[0], r->PixColors[Color_fg]); XSetWindowBackground(r->Xdisplay, r->TermWin.vt, r->PixColors[Color_bg]); r->h->am_transparent = 0; /* XXX: also turn off Opt_transparent? */ } else { /* wait (an arbitrary period) for the WM to do its thing * needed for fvwm2.2.2 (and before?) */ # ifdef HAVE_NANOSLEEP struct timespec rqt; rqt.tv_sec = 1; rqt.tv_nsec = 0; nanosleep(&rqt, NULL); # else sleep(1); # endif D_X((stderr, "InheritPixmap Turning on (%d parents)", i - 1)); for (n = 0; n < (unsigned int)i; n++) XSetWindowBackgroundPixmap(r->Xdisplay, r->TermWin.parent[n], ParentRelative); XSetWindowBackgroundPixmap(r->Xdisplay, r->TermWin.vt, ParentRelative); r->h->am_transparent = 1; } for (; i < (int)(sizeof(r->TermWin.parent) / sizeof(Window)); i++) r->TermWin.parent[i] = None; } return pchanged; } #endif /*}}} */ /*{{{ print pipe */ /*----------------------------------------------------------------------*/ #ifdef PRINTPIPE /* EXTPROTO */ FILE * rxvt_popen_printer(rxvt_t *r) { FILE *stream = popen(r->h->rs[Rs_print_pipe], "w"); if (stream == NULL) rxvt_print_error("can't open printer pipe"); return stream; } /* EXTPROTO */ int rxvt_pclose_printer(FILE *stream) { fflush(stream); /* pclose() reported not to work on SunOS 4.1.3 */ # if defined (__sun__) /* TODO: RESOLVE THIS */ /* pclose works provided SIGCHLD handler uses waitpid */ return pclose(stream); /* return fclose (stream); */ # else return pclose(stream); # endif } /* * simulate attached vt100 printer */ /* INTPROTO */ void rxvt_process_print_pipe(rxvt_t *r) { int done; FILE *fd; if ((fd = rxvt_popen_printer(r)) == NULL) return; /* * Send all input to the printer until either ESC[4i or ESC[?4i * is received. */ for (done = 0; !done;) { unsigned char buf[8]; unsigned char ch; unsigned int i, len; if ((ch = rxvt_cmd_getc(r)) != C0_ESC) { if (putc(ch, fd) == EOF) break; /* done = 1 */ } else { len = 0; buf[len++] = ch; if ((buf[len++] = rxvt_cmd_getc(r)) == '[') { if ((ch = rxvt_cmd_getc(r)) == '?') { buf[len++] = '?'; ch = rxvt_cmd_getc(r); } if ((buf[len++] = ch) == '4') { if ((buf[len++] = rxvt_cmd_getc(r)) == 'i') break; /* done = 1 */ } } for (i = 0; i < len; i++) if (putc(buf[i], fd) == EOF) { done = 1; break; } } } rxvt_pclose_printer(fd); } #endif /* PRINTPIPE */ /*}}} */ /* *INDENT-OFF* */ enum { C1_40 = 0x40, C1_41 , C1_BPH, C1_NBH, C1_44 , C1_NEL, C1_SSA, C1_ESA, C1_HTS, C1_HTJ, C1_VTS, C1_PLD, C1_PLU, C1_RI , C1_SS2, C1_SS3, C1_DCS, C1_PU1, C1_PU2, C1_STS, C1_CCH, C1_MW , C1_SPA, C1_EPA, C1_SOS, C1_59 , C1_SCI, C1_CSI, CS_ST , C1_OSC, C1_PM , C1_APC }; /* *INDENT-ON* */ /*{{{ process non-printing single characters */ /* INTPROTO */ void rxvt_process_nonprinting(rxvt_t *r, unsigned char ch) { switch (ch) { case C0_ENQ: /* terminal Status */ if (r->h->rs[Rs_answerbackstring]) rxvt_tt_write(r, (const unsigned char *)r->h->rs[Rs_answerbackstring], (unsigned int)STRLEN(r->h->rs[Rs_answerbackstring])); else rxvt_tt_write(r, (unsigned char *)VT100_ANS, (unsigned int)STRLEN(VT100_ANS)); break; case C0_BEL: /* bell */ rxvt_scr_bell(r); break; case C0_BS: /* backspace */ rxvt_scr_backspace(r); break; case C0_HT: /* tab */ rxvt_scr_tab(r, 1); break; case C0_CR: /* carriage return */ rxvt_scr_gotorc(r, 0, 0, R_RELATIVE); break; case C0_VT: /* vertical tab, form feed */ case C0_FF: case C0_LF: /* line feed */ rxvt_scr_index(r, UP); break; case C0_SO: /* shift out - acs */ rxvt_scr_charset_choose(r, 1); break; case C0_SI: /* shift in - acs */ rxvt_scr_charset_choose(r, 0); break; } } /*}}} */ /*{{{ process VT52 escape sequences */ /* INTPROTO */ void rxvt_process_escape_vt52(rxvt_t *r, unsigned char ch) { int row, col; switch (ch) { case 'A': /* cursor up */ rxvt_scr_gotorc(r, -1, 0, R_RELATIVE | C_RELATIVE); break; case 'B': /* cursor down */ rxvt_scr_gotorc(r, 1, 0, R_RELATIVE | C_RELATIVE); break; case 'C': /* cursor right */ rxvt_scr_gotorc(r, 0, 1, R_RELATIVE | C_RELATIVE); break; case 'D': /* cursor left */ rxvt_scr_gotorc(r, 0, -1, R_RELATIVE | C_RELATIVE); break; case 'H': /* cursor home */ rxvt_scr_gotorc(r, 0, 0, 0); break; case 'I': /* cursor up and scroll down if needed */ rxvt_scr_index(r, DN); break; case 'J': /* erase to end of screen */ rxvt_scr_erase_screen(r, 0); break; case 'K': /* erase to end of line */ rxvt_scr_erase_line(r, 0); break; case 'Y': /* move to specified row and col */ /* full command is 'ESC Y row col' where row and col * are encoded by adding 32 and sending the ascii * character. eg. SPACE = 0, '+' = 13, '0' = 18, * etc. */ row = rxvt_cmd_getc(r) - ' '; col = rxvt_cmd_getc(r) - ' '; rxvt_scr_gotorc(r, row, col, 0); break; case 'Z': /* identify the terminal type */ rxvt_tt_printf(r, "\033/Z"); /* I am a VT100 emulating a VT52 */ break; case '<': /* turn off VT52 mode */ PrivMode(0, PrivMode_vt52); break; case 'F': /* use special graphics character set */ case 'G': /* use regular character set */ /* unimplemented */ break; case '=': /* use alternate keypad mode */ case '>': /* use regular keypad mode */ /* unimplemented */ break; } } /*}}} */ /*{{{ process escape sequences */ /* INTPROTO */ void rxvt_process_escape_seq(rxvt_t *r) { unsigned char ch = rxvt_cmd_getc(r); if (r->h->PrivateModes & PrivMode_vt52) { rxvt_process_escape_vt52(r, ch); return; } switch (ch) { /* case 1: do_tek_mode (); break; */ case '#': if (rxvt_cmd_getc(r) == '8') rxvt_scr_E(r); break; case '(': rxvt_scr_charset_set(r, 0, (unsigned int)rxvt_cmd_getc(r)); break; case ')': rxvt_scr_charset_set(r, 1, (unsigned int)rxvt_cmd_getc(r)); break; case '*': rxvt_scr_charset_set(r, 2, (unsigned int)rxvt_cmd_getc(r)); break; case '+': rxvt_scr_charset_set(r, 3, (unsigned int)rxvt_cmd_getc(r)); break; #ifdef MULTICHAR_SET case '$': rxvt_scr_charset_set(r, -2, (unsigned int)rxvt_cmd_getc(r)); break; #endif #ifndef NO_FRILLS case '6': rxvt_scr_backindex(r); break; #endif case '7': rxvt_scr_cursor(r, SAVE); break; case '8': rxvt_scr_cursor(r, RESTORE); break; #ifndef NO_FRILLS case '9': rxvt_scr_forwardindex(r); break; #endif case '=': case '>': PrivMode((ch == '='), PrivMode_aplKP); break; case C1_40: rxvt_cmd_getc(r); break; case C1_44: rxvt_scr_index(r, UP); break; /* 8.3.87: NEXT LINE */ case C1_NEL: /* ESC E */ rxvt_scr_add_lines(r, (const unsigned char *)"\n\r", 1, 2); break; /* kidnapped escape sequence: Should be 8.3.48 */ case C1_ESA: /* ESC G */ rxvt_process_graphics(r); break; /* 8.3.63: CHARACTER TABULATION SET */ case C1_HTS: /* ESC H */ rxvt_scr_set_tab(r, 1); break; /* 8.3.105: REVERSE LINE FEED */ case C1_RI: /* ESC M */ rxvt_scr_index(r, DN); break; /* 8.3.142: SINGLE-SHIFT TWO */ /*case C1_SS2: scr_single_shift (2); break; */ /* 8.3.143: SINGLE-SHIFT THREE */ /*case C1_SS3: scr_single_shift (3); break; */ /* 8.3.27: DEVICE CONTROL STRING */ case C1_DCS: /* ESC P */ rxvt_process_dcs_seq(r); break; /* 8.3.110: SINGLE CHARACTER INTRODUCER */ case C1_SCI: /* ESC Z */ rxvt_tt_write(r, (const unsigned char *)ESCZ_ANSWER, (unsigned int)(sizeof(ESCZ_ANSWER) - 1)); break; /* steal obsolete ESC [ c */ /* 8.3.16: CONTROL SEQUENCE INTRODUCER */ case C1_CSI: /* ESC [ */ rxvt_process_csi_seq(r); break; /* 8.3.90: OPERATING SYSTEM COMMAND */ case C1_OSC: /* ESC ] */ rxvt_process_osc_seq(r); break; /* 8.3.106: RESET TO INITIAL STATE */ case 'c': rxvt_scr_poweron(r); rxvt_scrollbar_show(r, 1); break; /* 8.3.79: LOCKING-SHIFT TWO (see ISO2022) */ case 'n': rxvt_scr_charset_choose(r, 2); break; /* 8.3.81: LOCKING-SHIFT THREE (see ISO2022) */ case 'o': rxvt_scr_charset_choose(r, 3); break; } } /*}}} */ /*{{{ process CONTROL SEQUENCE INTRODUCER (CSI) sequences `ESC[' */ /* *INDENT-OFF* */ enum { CSI_ICH = 0x40, CSI_CUU, CSI_CUD, CSI_CUF, CSI_CUB, CSI_CNL, CSI_CPL, CSI_CHA, CSI_CUP, CSI_CHT, CSI_ED , CSI_EL , CSI_IL , CSI_DL , CSI_EF , CSI_EA , CSI_DCH, CSI_SEE, CSI_CPR, CSI_SU , CSI_SD , CSI_NP , CSI_PP , CSI_CTC, CSI_ECH, CSI_CVT, CSI_CBT, CSI_SRS, CSI_PTX, CSI_SDS, CSI_SIMD, CSI_5F, CSI_HPA, CSI_HPR, CSI_REP, CSI_DA , CSI_VPA, CSI_VPR, CSI_HVP, CSI_TBC, CSI_SM , CSI_MC , CSI_HPB, CSI_VPB, CSI_RM , CSI_SGR, CSI_DSR, CSI_DAQ, CSI_70 , CSI_71 , CSI_72 , CSI_73 , CSI_74 , CSI_75 , CSI_76 , CSI_77 , CSI_78 , CSI_79 , CSI_7A , CSI_7B , CSI_7C , CSI_7D , CSI_7E , CSI_7F }; #define make_byte(b7,b6,b5,b4,b3,b2,b1,b0) \ (((b7) << 7) | ((b6) << 6) | ((b5) << 5) | ((b4) << 4) \ | ((b3) << 3) | ((b2) << 2) | ((b1) << 1) | (b0)) #define get_byte_array_bit(array, bit) \ (!!((array)[(bit) / 8] & (128 >> ((bit) & 7)))) const unsigned char csi_defaults[] = { make_byte(1,1,1,1,1,1,1,1), /* @, A, B, C, D, E, F, G, */ make_byte(1,1,0,0,1,1,0,0), /* H, I, J, K, L, M, N, O, */ make_byte(1,0,1,1,1,1,1,0), /* P, Q, R, S, T, U, V, W, */ make_byte(1,1,1,0,0,0,1,0), /* X, Y, Z, [, \, ], ^, _, */ make_byte(1,1,1,0,1,1,1,0), /* `, a, b, c, d, e, f, g, */ make_byte(0,0,1,1,0,0,0,0), /* h, i, j, k, l, m, n, o, */ make_byte(0,0,0,0,0,0,0,0), /* p, q, r, s, t, u, v, w, */ make_byte(0,0,0,0,0,0,0,0) /* x, y, z, {, |, }, ~, */ }; /* *INDENT-ON* */ /* INTPROTO */ void rxvt_process_csi_seq(rxvt_t *r) { unsigned char ch, priv, i; unsigned int nargs, p; int n, ndef; int arg[ESC_ARGS]; for (nargs = ESC_ARGS; nargs > 0;) arg[--nargs] = 0; priv = 0; ch = rxvt_cmd_getc(r); if (ch >= '<' && ch <= '?') { /* '<' '=' '>' '?' */ priv = ch; ch = rxvt_cmd_getc(r); } /* read any numerical arguments */ for (n = -1; ch < CSI_ICH; ) { if (isdigit(ch)) { if (n < 0) n = ch - '0'; else n = n * 10 + ch - '0'; } else if (ch == ';') { if (nargs < ESC_ARGS) arg[nargs++] = n; n = -1; } else if (ch == '\b') { rxvt_scr_backspace(r); } else if (ch == C0_ESC) { rxvt_process_escape_seq(r); return; } else if (ch < ' ') { rxvt_process_nonprinting(r, ch); } ch = rxvt_cmd_getc(r); } if (ch > CSI_7F) return; if (nargs < ESC_ARGS) arg[nargs++] = n; i = ch - CSI_ICH; ndef = get_byte_array_bit(csi_defaults, i); for (p = 0; p < nargs; p++) if (arg[p] == -1) arg[p] = ndef; #ifdef DEBUG_CMD fprintf(stderr, "CSI "); for (p = 0; p < nargs; p++) fprintf(stderr, "%d%s", arg[p], p < nargs - 1 ? ";" : ""); fprintf(stderr, "%c\n", ch); #endif /* * private mode handling */ if (priv) { switch (priv) { case '>': if (ch == CSI_DA) /* secondary device attributes */ rxvt_tt_printf(r, "\033[>%d;%-.8s;0c", 'R', VSTRING); break; case '?': if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') rxvt_process_terminal_mode(r, ch, priv, nargs, arg); break; } return; } switch (ch) { /* * ISO/IEC 6429:1992(E) CSI sequences (defaults in parentheses) */ #ifdef PRINTPIPE case CSI_MC: /* 8.3.83: (0) MEDIA COPY */ switch (arg[0]) { case 0: /* initiate transfer to primary aux device */ rxvt_scr_printscreen(r, 0); break; case 5: /* start relay to primary aux device */ rxvt_process_print_pipe(r); break; } break; #endif case CSI_CUU: /* 8.3.22: (1) CURSOR UP */ case CSI_VPR: /* 8.3.161: (1) LINE POSITION FORWARD */ arg[0] = -arg[0]; /* FALLTHROUGH */ case CSI_CUD: /* 8.3.19: (1) CURSOR DOWN */ case CSI_VPB: /* 8.3.160: (1) LINE POSITION BACKWARD */ rxvt_scr_gotorc(r, arg[0], 0, RELATIVE); break; case CSI_CUB: /* 8.3.18: (1) CURSOR LEFT */ case CSI_HPB: /* 8.3.59: (1) CHARACTER POSITION BACKWARD */ #ifdef ISO6429 arg[0] = -arg[0]; #else /* emulate common DEC VTs */ arg[0] = arg[0] ? -arg[0] : -1; #endif /* FALLTHROUGH */ case CSI_CUF: /* 8.3.20: (1) CURSOR RIGHT */ case CSI_HPR: /* 8.3.60: (1) CHARACTER POSITION FORWARD */ #ifdef ISO6429 rxvt_scr_gotorc(r, 0, arg[0], RELATIVE); #else /* emulate common DEC VTs */ rxvt_scr_gotorc(r, 0, arg[0] ? arg[0] : 1, RELATIVE); #endif break; case CSI_CPL: /* 8.3.13: (1) CURSOR PRECEDING LINE */ arg[0] = -arg[0]; /* FALLTHROUGH */ case CSI_CNL: /* 8.3.12: (1) CURSOR NEXT LINE */ rxvt_scr_gotorc(r, arg[0], 0, R_RELATIVE); break; case CSI_CHA: /* 8.3.9: (1) CURSOR CHARACTER ABSOLUTE */ case CSI_HPA: /* 8.3.58: (1) CURSOR POSITION ABSOLUTE */ rxvt_scr_gotorc(r, 0, arg[0] - 1, R_RELATIVE); break; case CSI_VPA: /* 8.3.159: (1) LINE POSITION ABSOLUTE */ rxvt_scr_gotorc(r, arg[0] - 1, 0, C_RELATIVE); break; case CSI_CUP: /* 8.3.21: (1,1) CURSOR POSITION */ case CSI_HVP: /* 8.3.64: (1,1) CHARACTER AND LINE POSITION */ rxvt_scr_gotorc(r, arg[0] - 1, nargs < 2 ? 0 : (arg[1] - 1), 0); break; case CSI_CBT: /* 8.3.7: (1) CURSOR BACKWARD TABULATION */ arg[0] = -arg[0]; /* FALLTHROUGH */ case CSI_CHT: /* 8.3.10: (1) CURSOR FORWARD TABULATION */ rxvt_scr_tab(r, arg[0]); break; case CSI_ED: /* 8.3.40: (0) ERASE IN PAGE */ rxvt_scr_erase_screen(r, arg[0]); break; case CSI_EL: /* 8.3.42: (0) ERASE IN LINE */ rxvt_scr_erase_line(r, arg[0]); break; case CSI_ICH: /* 8.3.65: (1) INSERT CHARACTER */ rxvt_scr_insdel_chars(r, arg[0], INSERT); break; case CSI_IL: /* 8.3.68: (1) INSERT LINE */ rxvt_scr_insdel_lines(r, arg[0], INSERT); break; case CSI_DL: /* 8.3.33: (1) DELETE LINE */ rxvt_scr_insdel_lines(r, arg[0], DELETE); break; case CSI_ECH: /* 8.3.39: (1) ERASE CHARACTER */ rxvt_scr_insdel_chars(r, arg[0], ERASE); break; case CSI_DCH: /* 8.3.26: (1) DELETE CHARACTER */ rxvt_scr_insdel_chars(r, arg[0], DELETE); break; case CSI_SD: /* 8.3.114: (1) SCROLL DOWN */ arg[0] = -arg[0]; /* FALLTHROUGH */ case CSI_SU: /* 8.3.148: (1) SCROLL UP */ rxvt_scroll_text(r, r->screen.tscroll, r->screen.bscroll, arg[0], 0); break; case CSI_DA: /* 8.3.24: (0) DEVICE ATTRIBUTES */ rxvt_tt_write(r, (const unsigned char *)VT100_ANS, (unsigned int)(sizeof(VT100_ANS) - 1)); break; case CSI_SGR: /* 8.3.118: (0) SELECT GRAPHIC RENDITION */ rxvt_process_sgr_mode(r, nargs, arg); break; case CSI_DSR: /* 8.3.36: (0) DEVICE STATUS REPORT */ switch (arg[0]) { case 5: /* DSR requested */ rxvt_tt_printf(r, "\033[0n"); break; case 6: /* CPR requested */ rxvt_scr_report_position(r); break; #if defined (ENABLE_DISPLAY_ANSWER) case 7: /* unofficial extension */ rxvt_tt_printf(r, "%-.250s\n", r->h->rs[Rs_display_name]); break; #endif case 8: /* unofficial extension */ rxvt_xterm_seq(r, XTerm_title, APL_NAME "-" VERSION, CHAR_ST); break; } break; case CSI_TBC: /* 8.3.155: (0) TABULATION CLEAR */ switch (arg[0]) { case 0: /* char tab stop cleared at active position */ rxvt_scr_set_tab(r, 0); break; /* case 1: */ /* line tab stop cleared in active line */ /* case 2: */ /* char tab stops cleared in active line */ case 3: /* all char tab stops are cleared */ /* case 4: */ /* all line tab stops are cleared */ case 5: /* all tab stops are cleared */ rxvt_scr_set_tab(r, -1); break; } break; case CSI_CTC: /* 8.3.17: (0) CURSOR TABULATION CONTROL */ switch (arg[0]) { case 0: /* char tab stop set at active position */ rxvt_scr_set_tab(r, 1); break; /* = ESC H */ /* case 1: */ /* line tab stop set at active line */ case 2: /* char tab stop cleared at active position */ rxvt_scr_set_tab(r, 0); break; /* = ESC [ 0 g */ /* case 3: */ /* line tab stop cleared at active line */ /* case 4: */ /* char tab stops cleared at active line */ case 5: /* all char tab stops are cleared */ rxvt_scr_set_tab(r, -1); break; /* = ESC [ 3 g */ /* case 6: */ /* all line tab stops are cleared */ } break; case CSI_RM: /* 8.3.107: RESET MODE */ if (arg[0] == 4) rxvt_scr_insert_mode(r, 0); break; case CSI_SM: /* 8.3.126: SET MODE */ if (arg[0] == 4) rxvt_scr_insert_mode(r, 1); break; /* * PRIVATE USE beyond this point. All CSI_7? seqeunces here */ case CSI_72: /* DECSTBM: set top and bottom margins */ if (nargs == 1) rxvt_scr_scroll_region(r, arg[0] - 1, MAX_ROWS - 1); else if (nargs == 0 || arg[0] >= arg[1]) rxvt_scr_scroll_region(r, 0, MAX_ROWS - 1); else rxvt_scr_scroll_region(r, arg[0] - 1, arg[1] - 1); break; case CSI_73: rxvt_scr_cursor(r, SAVE); break; case CSI_75: rxvt_scr_cursor(r, RESTORE); break; #ifndef NO_FRILLS case CSI_74: rxvt_process_window_ops(r, arg, nargs); break; #endif case CSI_78: /* DECREQTPARM */ if (arg[0] == 0 || arg[0] == 1) rxvt_tt_printf(r, "\033[%d;1;1;112;112;1;0x", arg[0] + 2); /* FALLTHROUGH */ default: break; } } /*}}} */ #ifndef NO_FRILLS /* ARGSUSED */ /* INTPROTO */ void rxvt_process_window_ops(rxvt_t *r, const int *args, unsigned int nargs) { int x, y; char *s; XWindowAttributes wattr; Window wdummy; if (nargs == 0) return; switch (args[0]) { /* * commands */ case 1: /* deiconify window */ XMapWindow(r->Xdisplay, r->TermWin.parent[0]); break; case 2: /* iconify window */ XIconifyWindow(r->Xdisplay, r->TermWin.parent[0], DefaultScreen(r->Xdisplay)); break; case 3: /* set position (pixels) */ XMoveWindow(r->Xdisplay, r->TermWin.parent[0], args[1], args[2]); break; case 4: /* set size (pixels) */ rxvt_set_widthheight(r, (unsigned int)args[2], (unsigned int)args[1]); break; case 5: /* raise window */ XRaiseWindow(r->Xdisplay, r->TermWin.parent[0]); break; case 6: /* lower window */ XLowerWindow(r->Xdisplay, r->TermWin.parent[0]); break; case 7: /* refresh window */ rxvt_scr_touch(r, True); break; case 8: /* set size (chars) */ rxvt_set_widthheight(r, (unsigned int)(args[2] * r->TermWin.fwidth), (unsigned int)(args[1] * r->TermWin.fheight)); break; default: if (args[0] >= 24) /* set height (chars) */ rxvt_set_widthheight(r, (unsigned int)r->TermWin.width, (unsigned int)(args[1] * r->TermWin.fheight)); break; /* * reports - some output format copied from XTerm */ case 11: /* report window state */ XGetWindowAttributes(r->Xdisplay, r->TermWin.parent[0], &wattr); rxvt_tt_printf(r, "\033[%dt", wattr.map_state == IsViewable ? 1 : 2); break; case 13: /* report window position */ XGetWindowAttributes(r->Xdisplay, r->TermWin.parent[0], &wattr); XTranslateCoordinates(r->Xdisplay, r->TermWin.parent[0], wattr.root, -wattr.border_width, -wattr.border_width, &x, &y, &wdummy); rxvt_tt_printf(r, "\033[3;%d;%dt", x, y); break; case 14: /* report window size (pixels) */ XGetWindowAttributes(r->Xdisplay, r->TermWin.parent[0], &wattr); rxvt_tt_printf(r, "\033[4;%d;%dt", wattr.height, wattr.width); break; case 18: /* report window size (chars) */ rxvt_tt_printf(r, "\033[8;%d;%dt", r->TermWin.nrow, r->TermWin.ncol); break; #if 0 /* XXX: currently disabled due to security concerns */ case 20: /* report icon label */ XGetIconName(r->Xdisplay, r->TermWin.parent[0], &s); rxvt_tt_printf(r, "\033]L%-.200s\234", s ? s : ""); /* 8bit ST */ break; case 21: /* report window title */ XFetchName(r->Xdisplay, r->TermWin.parent[0], &s); rxvt_tt_printf(r, "\033]l%-.200s\234", s ? s : ""); /* 8bit ST */ break; #endif } } #endif /*----------------------------------------------------------------------*/ /* * get input up until STRING TERMINATOR (or BEL) * ends_how is terminator used. returned input must be free()d */ /* INTPROTO */ unsigned char * rxvt_get_to_st(rxvt_t *r, unsigned char *ends_how) { int seen_esc = 0; /* seen escape? */ unsigned int n = 0; unsigned char *s; unsigned char ch, string[STRING_MAX]; for (; (ch = rxvt_cmd_getc(r));) { if (ch == C0_BEL || ch == CHAR_ST || (ch == 0x5c && seen_esc)) /* 7bit ST */ break; if (ch == C0_ESC) { seen_esc = 1; continue; } else if (ch == '\t') ch = ' '; /* translate '\t' to space */ else if (ch < 0x08 || (ch > 0x0d && ch < 0x20)) return NULL; /* other control character - exit */ if (n < sizeof(string) - 1) string[n++] = ch; seen_esc = 0; } string[n++] = '\0'; if ((s = (unsigned char *)rxvt_malloc(n)) == NULL) return NULL; *ends_how = (ch == 0x5c ? C0_ESC : ch); STRNCPY(s, string, n); return s; } /*----------------------------------------------------------------------*/ /* * process DEVICE CONTROL STRING `ESC P ... (ST|BEL)' or `0x90 ... (ST|BEL)' */ /* INTPROTO */ void rxvt_process_dcs_seq(rxvt_t *r) { unsigned char eh, *s; /* * Not handled yet */ s = rxvt_get_to_st(r, &eh); if (s) free(s); return; } /*----------------------------------------------------------------------*/ /* * process OPERATING SYSTEM COMMAND sequence `ESC ] Ps ; Pt (ST|BEL)' */ /* INTPROTO */ void rxvt_process_osc_seq(rxvt_t *r) { unsigned char ch, eh, *s; int arg; ch = rxvt_cmd_getc(r); for (arg = 0; isdigit(ch); ch = rxvt_cmd_getc(r)) arg = arg * 10 + (ch - '0'); if (ch == ';') { s = rxvt_get_to_st(r, &eh); if (s) { /* * rxvt_menubar_dispatch() violates the constness of the string, * so do it here */ if (arg == XTerm_Menu) #if 0 /* XXX: currently disabled due to security concerns */ rxvt_menubar_dispatch(r, (char *)s); #else 0; #endif else rxvt_xterm_seq(r, arg, (char *)s, eh); free(s); } } } /* * XTerm escape sequences: ESC ] Ps;Pt (ST|BEL) * 0 = change iconName/title * 1 = change iconName * 2 = change title * 4 = change color * 12 = change text color * 13 = change mouse foreground color * 17 = change highlight character colour * 18 = change bold character color * 19 = change underlined character color * 46 = change logfile (not implemented) * 50 = change font * * rxvt extensions: * 10 = menu (may change in future) * 20 = bg pixmap * 39 = change default fg color * 49 = change default bg color * 55 = dump scrollback buffer and all of screen */ /* EXTPROTO */ void rxvt_xterm_seq(rxvt_t *r, int op, const char *str, unsigned char resp __attribute__((unused))) { int changed = 0; int fd; int color; char *buf, *name; assert(str != NULL); switch (op) { case XTerm_name: rxvt_set_title(r, str); /* FALLTHROUGH */ case XTerm_iconName: rxvt_set_iconName(r, str); break; case XTerm_title: rxvt_set_title(r, str); break; case XTerm_Color: for (buf = (char *)str; buf && *buf;) { if ((name = STRCHR(buf, ';')) == NULL) break; *name++ = '\0'; color = atoi(buf); if (color < 0 || color >= TOTAL_COLORS) break; if ((buf = STRCHR(name, ';')) != NULL) *buf++ = '\0'; rxvt_set_window_color(r, color + minCOLOR, name); } break; #ifndef NO_CURSORCOLOR case XTerm_Color_cursor: rxvt_set_window_color(r, Color_cursor, str); break; #endif case XTerm_Color_pointer: rxvt_set_window_color(r, Color_pointer, str); break; #ifndef NO_BOLD_UNDERLINE_REVERSE case XTerm_Color_BD: rxvt_set_window_color(r, Color_BD, str); break; case XTerm_Color_UL: rxvt_set_window_color(r, Color_UL, str); break; case XTerm_Color_RV: rxvt_set_window_color(r, Color_RV, str); break; #endif case XTerm_Menu: /* * rxvt_menubar_dispatch() violates the constness of the string, * so DON'T do it here */ break; case XTerm_Pixmap: if (*str != ';') { rxvt_scale_pixmap(r, ""); /* reset to default scaling */ rxvt_set_bgPixmap(r, str); /* change pixmap */ rxvt_scr_touch(r, True); } while ((str = STRCHR(str, ';')) != NULL) { str++; changed += rxvt_scale_pixmap(r, str); } if (changed) { rxvt_resize_pixmap(r); rxvt_scr_touch(r, True); } break; case XTerm_restoreFG: rxvt_set_window_color(r, Color_fg, str); break; case XTerm_restoreBG: rxvt_set_window_color(r, Color_bg, str); break; case XTerm_logfile: break; case XTerm_font: rxvt_change_font(r, 0, str); break; #if 0 case XTerm_dumpscreen: /* no error notices */ if ((fd = open(str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) { rxvt_scr_dump(r, fd); close(fd); } break; #endif } } /*----------------------------------------------------------------------*/ /*{{{ process DEC private mode sequences `ESC [ ? Ps mode' */ /* * mode can only have the following values: * 'l' = low * 'h' = high * 's' = save * 'r' = restore * 't' = toggle * so no need for fancy checking */ /* INTPROTO */ int rxvt_privcases(rxvt_t *r, int mode, unsigned long bit) { int state; if (mode == 's') { r->h->SavedModes |= (r->h->PrivateModes & bit); return -1; } else { if (mode == 'r') state = (r->h->SavedModes & bit) ? 1 : 0; /* no overlapping */ else state = (mode == 't') ? !(r->h->PrivateModes & bit) : mode; PrivMode(state, bit); } return state; } /* we're not using priv _yet_ */ /* INTPROTO */ void rxvt_process_terminal_mode(rxvt_t *r, int mode, int priv __attribute__((unused)), unsigned int nargs, const int *arg) { unsigned int i, j; int state; static const struct { const int argval; const unsigned long bit; } argtopriv[] = { { 1, PrivMode_aplCUR }, { 2, PrivMode_vt52 }, { 3, PrivMode_132 }, { 4, PrivMode_smoothScroll }, { 5, PrivMode_rVideo }, { 6, PrivMode_relOrigin }, { 7, PrivMode_Autowrap }, { 9, PrivMode_MouseX10 }, #ifdef menuBar_esc { menuBar_esc, PrivMode_menuBar }, #endif #ifdef scrollBar_esc { scrollBar_esc, PrivMode_scrollBar }, #endif { 25, PrivMode_VisibleCursor }, { 35, PrivMode_ShiftKeys }, { 40, PrivMode_132OK }, { 47, PrivMode_Screen }, { 66, PrivMode_aplKP }, #ifndef NO_BACKSPACE_KEY { 67, PrivMode_BackSpace }, #endif { 1000, PrivMode_MouseX11 }, { 1010, PrivMode_TtyOutputInh }, { 1011, PrivMode_Keypress }, { 1047, PrivMode_Screen }, }; if (nargs == 0) return; /* make lo/hi boolean */ if (mode == 'l') mode = 0; /* reset */ else if (mode == 'h') mode = 1; /* set */ for (i = 0; i < nargs; i++) { state = -1; /* basic handling */ for (j = 0; j < (sizeof(argtopriv)/sizeof(argtopriv[0])); j++) if (argtopriv[j].argval == arg[i]) { state = rxvt_privcases(r, mode, argtopriv[j].bit); break; } /* extra handling for values with state unkept */ if (state == -1) switch (arg[i]) { case 1048: /* alternative cursor save */ if (mode == 0) rxvt_scr_cursor(r, RESTORE); else if (mode == 1) rxvt_scr_cursor(r, SAVE); /* FALLTHROUGH */ default: continue; /* for(;i;) */ } /* extra handling for values with valid 0 or 1 state */ switch (arg[i]) { /* case 1: - application cursor keys */ case 2: /* VT52 mode */ /* oddball mode. should be set regardless of set/reset * parameter. Return from VT52 mode with an ESC < from * within VT52 mode */ PrivMode(1, PrivMode_vt52); break; case 3: /* 80/132 */ if (r->h->PrivateModes & PrivMode_132OK) rxvt_set_widthheight(r, (unsigned int)((state ? 132 : 80) * r->TermWin.fwidth), (unsigned int)r->TermWin.height); break; case 4: /* smooth scrolling */ if (state) r->Options &= ~Opt_jumpScroll; else r->Options |= Opt_jumpScroll; break; case 5: /* reverse video */ rxvt_scr_rvideo_mode(r, state); break; case 6: /* relative/absolute origins */ rxvt_scr_relative_origin(r, state); break; case 7: /* autowrap */ rxvt_scr_autowrap(r, state); break; /* case 8: - auto repeat, can't do on a per window basis */ case 9: /* X10 mouse reporting */ if (state) /* orthogonal */ r->h->PrivateModes &= ~(PrivMode_MouseX11); break; #ifdef menuBar_esc case menuBar_esc: rxvt_map_menuBar(r, state); break; #endif #ifdef scrollBar_esc case scrollBar_esc: if (rxvt_scrollbar_mapping(r, state)) { rxvt_resize_all_windows(r, 0, 0, 0); rxvt_scr_touch(r, True); } break; #endif case 25: /* visible/invisible cursor */ rxvt_scr_cursor_visible(r, state); break; /* case 35: - shift keys */ /* case 40: - 80 <--> 132 mode */ case 47: /* secondary screen */ rxvt_scr_change_screen(r, state); break; /* case 66: - application key pad */ /* case 67: - backspace key */ case 1000: /* X11 mouse reporting */ if (state) /* orthogonal */ r->h->PrivateModes &= ~(PrivMode_MouseX10); break; #if 0 case 1001: break; /* X11 mouse highlighting */ #endif case 1010: /* scroll to bottom on TTY output inhibit */ if (state) r->Options &= ~Opt_scrollTtyOutput; else r->Options |= Opt_scrollTtyOutput; break; case 1011: /* scroll to bottom on key press */ if (state) r->Options |= Opt_scrollTtyKeypress; else r->Options &= ~Opt_scrollTtyKeypress; break; case 1047: /* secondary screen w/ clearing */ if (r->h->current_screen != PRIMARY) rxvt_scr_erase_screen(r, 2); rxvt_scr_change_screen(r, state); /* FALLTHROUGH */ default: break; } } } /*}}} */ /*{{{ process sgr sequences */ /* INTPROTO */ void rxvt_process_sgr_mode(rxvt_t *r, unsigned int nargs, const int *arg) { unsigned int i; short rendset; int rendstyle; if (nargs == 0) { rxvt_scr_rendition(r, 0, ~RS_None); return; } for (i = 0; i < nargs; i++) { rendset = -1; switch (arg[i]) { case 0: rendset = 0, rendstyle = ~RS_None; break; case 1: rendset = 1, rendstyle = RS_Bold; break; case 4: rendset = 1, rendstyle = RS_Uline; break; case 5: rendset = 1, rendstyle = RS_Blink; break; case 7: rendset = 1, rendstyle = RS_RVid; break; case 22: rendset = 0, rendstyle = RS_Bold; break; case 24: rendset = 0, rendstyle = RS_Uline; break; case 25: rendset = 0, rendstyle = RS_Blink; break; case 27: rendset = 0, rendstyle = RS_RVid; break; } if (rendset != -1) { rxvt_scr_rendition(r, rendset, rendstyle); continue; /* for(;i;) */ } switch (arg[i]) { case 30: case 31: /* set fg color */ case 32: case 33: case 34: case 35: case 36: case 37: rxvt_scr_color(r, (unsigned int)(minCOLOR + (arg[i] - 30)), Color_fg); break; #ifdef TTY_256COLOR case 38: if (nargs > i + 2 && arg[i + 1] == 5) { rxvt_scr_color(r, (unsigned int)(minCOLOR + arg[i + 2]), Color_fg); i += 2; } break; #endif case 39: /* default fg */ rxvt_scr_color(r, Color_fg, Color_fg); break; case 40: case 41: /* set bg color */ case 42: case 43: case 44: case 45: case 46: case 47: rxvt_scr_color(r, (unsigned int)(minCOLOR + (arg[i] - 40)), Color_bg); break; #ifdef TTY_256COLOR case 48: if (nargs > i + 2 && arg[i + 1] == 5) { rxvt_scr_color(r, (unsigned int)(minCOLOR + arg[i + 2]), Color_bg); i += 2; } break; #endif case 49: /* default bg */ rxvt_scr_color(r, Color_bg, Color_bg); break; #ifndef NO_BRIGHTCOLOR case 90: case 91: /* set bright fg color */ case 92: case 93: case 94: case 95: case 96: case 97: rxvt_scr_color(r, (unsigned int)(minBrightCOLOR + (arg[i] - 90)), Color_fg); break; case 100: case 101: /* set bright bg color */ case 102: case 103: case 104: case 105: case 106: case 107: rxvt_scr_color(r, (unsigned int)(minBrightCOLOR + (arg[i] - 100)), Color_bg); break; #endif } } } /*}}} */ /*{{{ process Rob Nation's own graphics mode sequences */ /* INTPROTO */ void rxvt_process_graphics(rxvt_t *r) { unsigned char ch, cmd = rxvt_cmd_getc(r); #ifndef RXVT_GRAPHICS if (cmd == 'Q') { /* query graphics */ rxvt_tt_printf(r, "\033G0\n"); /* no graphics */ return; } /* swallow other graphics sequences until terminating ':' */ do ch = rxvt_cmd_getc(r); while (ch != ':'); #else unsigned int nargs; int args[NGRX_PTS]; unsigned char *text = NULL; if (cmd == 'Q') { /* query graphics */ rxvt_tt_printf(r, "\033G1\n"); /* yes, graphics (color) */ return; } for (nargs = 0; nargs < (sizeof(args) / sizeof(args[0])) - 1;) { int neg; ch = rxvt_cmd_getc(r); neg = (ch == '-'); if (neg || ch == '+') ch = rxvt_cmd_getc(r); for (args[nargs] = 0; isdigit(ch); ch = rxvt_cmd_getc(r)) args[nargs] = args[nargs] * 10 + (ch - '0'); if (neg) args[nargs] = -args[nargs]; nargs++; args[nargs] = 0; if (ch != ';') break; } if ((cmd == 'T') && (nargs >= 5)) { int i, len = args[4]; text = rxvt_malloc((len + 1) * sizeof(char)); if (text != NULL) { for (i = 0; i < len; i++) text[i] = rxvt_cmd_getc(r); text[len] = '\0'; } } rxvt_Gr_do_graphics(r, cmd, nargs, args, text); #endif } /*}}} */ /* ------------------------------------------------------------------------- */ /*{{{ Read and process output from the application */ /* LIBPROTO */ void rxvt_main_loop(rxvt_t *r) { unsigned char ch, *str; int nlines, refreshnow; struct rxvt_hidden *h = r->h; h->cmdbuf_ptr = h->cmdbuf_endp = h->cmdbuf_base; #if defined(__CYGWIN32__) /* once we know the shell is running, send the screen size. Again! */ (void)rxvt_cmd_getc(r); /* wait for something */ h->cmdbuf_ptr--; /* unget it - reprocess it below */ rxvt_tt_winsize(r->cmd_fd, r->TermWin.ncol, r->TermWin.nrow); #endif refreshnow = 0; for (;;) { ch = rxvt_cmd_getc(r); /* wait for something */ if (ch >= ' ' || ch == '\t' || ch == '\n' || ch == '\r') { /* Read a text string from the input buffer */ /* * point `str' to the start of the string, * decrement first since it was post incremented in rxvt_cmd_getc() */ for (str = --h->cmdbuf_ptr, nlines = 0; h->cmdbuf_ptr < h->cmdbuf_endp; ) { ch = *h->cmdbuf_ptr++; if (ch == '\n') { nlines++; h->refresh_count++; if (!(r->Options & Opt_jumpScroll) || (h->refresh_count >= (h->refresh_limit * (r->TermWin.nrow - 1)))) { refreshnow = 1; break; } } else if (ch < ' ' && ch != '\t' && ch != '\r') { /* unprintable */ h->cmdbuf_ptr--; break; } } rxvt_scr_add_lines(r, str, nlines, (h->cmdbuf_ptr - str)); /* * If there have been a lot of new lines, then update the screen * What the heck I'll cheat and only refresh less than every page-full. * the number of pages between refreshes is h->refresh_limit, which * is incremented here because we must be doing flat-out scrolling. * * refreshing should be correct for small scrolls, because of the * time-out */ if (refreshnow) { refreshnow = 0; if ((r->Options & Opt_jumpScroll) && h->refresh_limit < REFRESH_PERIOD) h->refresh_limit++; rxvt_scr_refresh(r, h->refresh_type); } } else switch (ch) { default: rxvt_process_nonprinting(r, ch); break; case C0_ESC: /* escape char */ rxvt_process_escape_seq(r); break; /* case 0x9b: */ /* CSI */ /* rxvt_process_csi_seq(r); */ } } /* NOTREACHED */ } /* * Send printf() formatted output to the command. * Only use for small amounts of data. */ /* EXTPROTO */ void rxvt_tt_printf(rxvt_t *r, const char *fmt,...) { va_list arg_ptr; unsigned char buf[256]; va_start(arg_ptr, fmt); vsprintf((char *)buf, fmt, arg_ptr); va_end(arg_ptr); rxvt_tt_write(r, buf, (unsigned int)STRLEN(buf)); } /* ---------------------------------------------------------------------- */ /* Addresses pasting large amounts of data and rxvt hang * code pinched from xterm (v_write()) and applied originally to * rxvt-2.18 - Hops * Write data to the pty as typed by the user, pasted with the mouse, * or generated by us in response to a query ESC sequence. */ /* EXTPROTO */ void rxvt_tt_write(rxvt_t *r, const unsigned char *d, unsigned int len) { #define MAX_PTY_WRITE 128 /* 1/2 POSIX minimum MAX_INPUT */ int riten; unsigned int p; unsigned char *v_buffer, /* start of physical buffer */ *v_bufstr, /* start of current buffer pending */ *v_bufptr, /* end of current buffer pending */ *v_bufend; /* end of physical buffer */ if (r->h->v_bufstr == NULL && len > 0) { p = (len / MAX_PTY_WRITE + 1) * MAX_PTY_WRITE; v_buffer = v_bufstr = v_bufptr = rxvt_malloc(p); v_bufend = v_buffer + p; } else { v_buffer = r->h->v_buffer; v_bufstr = r->h->v_bufstr; v_bufptr = r->h->v_bufptr; v_bufend = r->h->v_bufend; } /* * Append to the block we already have. Always doing this simplifies the * code, and isn't too bad, either. If this is a short block, it isn't * too expensive, and if this is a long block, we won't be able to write * it all anyway. */ if (len > 0) { if (v_bufend < v_bufptr + len) { /* run out of room */ if (v_bufstr != v_buffer) { /* there is unused space, move everything down */ MEMMOVE(v_buffer, v_bufstr, (unsigned int)(v_bufptr - v_bufstr)); v_bufptr -= v_bufstr - v_buffer; v_bufstr = v_buffer; } if (v_bufend < v_bufptr + len) { /* still won't fit: get more space */ /* use most basic realloc because an error is not fatal. */ unsigned int size = v_bufptr - v_buffer; unsigned int reallocto; reallocto = ((size + len) / MAX_PTY_WRITE + 1) * MAX_PTY_WRITE; v_buffer = realloc(v_buffer, reallocto); /* save across realloc */ if (v_buffer) { v_bufstr = v_buffer; v_bufptr = v_buffer + size; v_bufend = v_buffer + reallocto; } else { /* no memory: ignore entire write request */ rxvt_print_error("data loss: cannot allocate buffer space"); v_buffer = v_bufstr; /* restore clobbered pointer */ } } } if (v_bufend >= v_bufptr + len) { /* new stuff will fit */ MEMCPY(v_bufptr, d, len); v_bufptr += len; } } /* * Write out as much of the buffer as we can. * Be careful not to overflow the pty's input silo. * We are conservative here and only write a small amount at a time. * * If we can't push all the data into the pty yet, we expect write * to return a non-negative number less than the length requested * (if some data written) or -1 and set errno to EAGAIN, * EWOULDBLOCK, or EINTR (if no data written). * * (Not all systems do this, sigh, so the code is actually * a little more forgiving.) */ if ((p = v_bufptr - v_bufstr) > 0) { riten = write(r->cmd_fd, v_bufstr, min(p, MAX_PTY_WRITE)); if (riten < 0) riten = 0; v_bufstr += riten; if (v_bufstr >= v_bufptr) /* we wrote it all */ v_bufstr = v_bufptr = v_buffer; } /* * If we have lots of unused memory allocated, return it */ if (v_bufend - v_bufptr > MAX_PTY_WRITE * 8) { /* arbitrary hysteresis */ /* save pointers across realloc */ unsigned int start = v_bufstr - v_buffer; unsigned int size = v_bufptr - v_buffer; unsigned int reallocto; reallocto = (size / MAX_PTY_WRITE + 1) * MAX_PTY_WRITE; v_buffer = realloc(v_buffer, reallocto); if (v_buffer) { v_bufstr = v_buffer + start; v_bufptr = v_buffer + size; v_bufend = v_buffer + reallocto; } else { /* should we print a warning if couldn't return memory? */ v_buffer = v_bufstr - start; /* restore clobbered pointer */ } } r->h->v_buffer = v_buffer; r->h->v_bufstr = v_bufstr; r->h->v_bufptr = v_bufptr; r->h->v_bufend = v_bufend; } /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/src/rxvt.c010064400001440000024000000005530733020561700132030ustar gcwstaff#include "rxvtlib.h" /*----------------------------------------------------------------------*/ /* main() */ /* INTPROTO */ int main(int argc, const char *const *argv) { rxvt_t *rxvt_vars; if ((rxvt_vars = rxvt_init(argc, argv)) == NULL) return EXIT_FAILURE; rxvt_main_loop(rxvt_vars); /* main processing loop */ return EXIT_SUCCESS; } rxvt-2.7.10/src/version.h010064400001440000024000000002030764024212000136540ustar gcwstaff#define VERSION "2.7.10" #define VSTRING "20710" #define DATE "26 MARCH 2003" #define LSMDATE "26MAR03" #define LIBVERSION "1:0:0" rxvt-2.7.10/src/rxvtgrx.h010064400001440000024000000030060733020561700137250ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * File: rxvtgrx.h * $Id: rxvtgrx.h,v 1.5 2000/07/27 06:30:42 gcw Exp $ * * Stuff for text alignment for rxvt special graphics mode * * alignment * Top: * text is placed so that the specified point is at the top of the * capital letters * Center: * text is placed so that the specified point is equidistant from the * bottom of descenders and the top of the capital letters * Bottom: * text is placed so that the bottom of descenders is on the specified * point * Base: * text is placed so that the bottom of the characters with no descenders * is on the specified point * Caps_Center: * text is placed so that the specified point is equidistant from the * bottom and tops of capital letters *----------------------------------------------------------------------*/ #ifndef _RXVTGRX_H_ #define _RXVTGRX_H_ #define GRX_SCALE 10000 #define RIGHT_TEXT 0x10 #define HCENTER_TEXT 0x20 #define LEFT_TEXT 0x30 #define HORIZONTAL_ALIGNMENT 0x70 #define TOP_TEXT 0x01 #define VCENTER_TEXT 0x02 #define BOTTOM_TEXT 0x03 #define BASE_TEXT 0x04 #define VCAPS_CENTER_TEXT 0x05 #define VERTICAL_ALIGNMENT 0x0F #if 0 /* this would be nicer */ # define TXT_RIGHT 'r' # define TXT_CENTER 'c' # define TXT_LEFT 'l' # define TXT_TOP 't' # define TXT_VCENTER 'v' # define TXT_BOTTOM 'b' # define TXT_BASE '_' # define TXT_VCAPS_CENTER 'C' #endif #endif /* _RXVTGRX_H_ */ /*----------------------- end-of-file (C header) -----------------------*/ rxvt-2.7.10/src/rxvt.h010064400001440000024000001027100763177143600132210ustar gcwstaff/* * $Id: rxvt.h,v 1.163 2003/03/07 01:00:32 gcw Exp $ */ #ifndef _RXVT_H_ /* include once only */ #define _RXVT_H_ #include "rxvtlib.h" #include "feature.h" #include #include #include #include /* ***************************************************************************** * SYSTEM HACKS ***************************************************************************** */ /* Consistent defines - please report on the necessity * @ Unixware: defines (__svr4__) */ #if defined (SVR4) && !defined (__svr4__) # define __svr4__ #endif #if defined (sun) && !defined (__sun__) # define __sun__ #endif #ifndef HAVE_XPOINTER typedef char *XPointer; #endif #ifdef HAVE_TERMIOS_H # include typedef struct termios ttymode_t; #else # include typedef struct { struct sgttyb sg; struct tchars tc; struct ltchars lc; int line; int local; } ttymode_t; #endif #ifdef GREEK_SUPPORT # include "grkelot.h" #endif #ifdef XPM_BACKGROUND # ifdef XPM_INC_X11 # include # else # include # endif #endif #ifndef STDIN_FILENO # define STDIN_FILENO 0 # define STDOUT_FILENO 1 # define STDERR_FILENO 2 #endif #if defined(HAVE_GRANTPT) && defined(HAVE_UNLOCKPT) # if defined(PTYS_ARE_GETPT) || defined(PTYS_ARE_PTMX) # define NO_SETOWNER_TTYDEV # endif #endif #if defined(__CYGWIN32__) || defined(PTYS_ARE_OPENPTY) # define NO_SETOWNER_TTYDEV #endif /* ***************************************************************************** * STRUCTURES AND TYPEDEFS ***************************************************************************** */ struct rxvt_vars; /* Later REDEFINED and typedef'd to rxvt_t */ struct rxvt_hidden; struct grwin_t; /* Sanitize menubar info */ #ifndef MENUBAR # undef MENUBAR_MAX #endif #ifndef MENUBAR_MAX # define MENUBAR_MAX 0 #endif /* If we're using either the rxvt scrollbar or menu bars, keep the * scrollColor resource. */ #if defined(RXVT_SCROLLBAR) || defined(MENUBAR) # define KEEP_SCROLLCOLOR 1 #else # undef KEEP_SCROLLCOLOR #endif #ifdef XPM_BACKGROUND typedef struct { short w, h, x, y; Pixmap pixmap; } bgPixmap_t; #endif /* * the 'essential' information for reporting Mouse Events * pared down from XButtonEvent */ struct mouse_event { int clicks; Time time; /* milliseconds */ unsigned int state; /* key or button mask */ unsigned int button; /* detail */ }; #ifndef min # define min(a,b) (((a) < (b)) ? (a) : (b)) # define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #define MAX_IT(current, other) if ((other) > (current)) (current) = (other) #define MIN_IT(current, other) if ((other) < (current)) (current) = (other) #define SWAP_IT(one, two, typeof) \ do { \ typeof swapittmp; \ (swapittmp) = (one); (one) = (two); (two) = (swapittmp); \ } while (/* CONSTCOND */ 0) #define BOUND_POSITIVE_INT16(val) \ (int16_t)((val) <= 0 \ ? 0 \ : min((val), (((u_int16_t)-1)>>1))) /* ***************************************************************************** * NORMAL DEFINES ***************************************************************************** */ #if defined (NO_OLD_SELECTION) && defined(NO_NEW_SELECTION) # error if you disable both selection styles, how can you select, silly? #endif #define APL_CLASS "XTerm" /* class name */ #define APL_SUBCLASS "Rxvt" /* also check resources under this name */ #define APL_NAME "rxvt" /* normal name */ /* COLORTERM, TERM environment variables */ #define COLORTERMENV "rxvt" #ifdef XPM_BACKGROUND # define COLORTERMENVFULL COLORTERMENV "-xpm" #else # define COLORTERMENVFULL COLORTERMENV #endif #ifndef TERMENV # define TERMENV "xterm" #endif #if defined (NO_MOUSE_REPORT) && !defined (NO_MOUSE_REPORT_SCROLLBAR) # define NO_MOUSE_REPORT_SCROLLBAR #endif #ifdef NO_RESOURCES # undef USE_XGETDEFAULT #endif /* now look for other badly set stuff */ #if !defined (EACCESS) && defined(EAGAIN) # define EACCESS EAGAIN #endif #ifndef EXIT_SUCCESS /* missing from */ # define EXIT_SUCCESS 0 /* exit function success */ # define EXIT_FAILURE 1 /* exit function failure */ #endif #define menuBar_esc 10 #define scrollBar_esc 30 #define menuBar_margin 2 /* margin below text */ #if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) # define HAVE_SCROLLBARS #endif /* width of scrollBar, menuBar shadow, must be 1 or 2 */ #ifdef HALFSHADOW # define SHADOW 1 #else # define SHADOW 2 #endif #define R_SB_ALIGN_CENTRE 0 #define R_SB_ALIGN_TOP 1 #define R_SB_ALIGN_BOTTOM 2 #define R_SB_RXVT 0 #define R_SB_NEXT 1 #define R_SB_XTERM 2 #define SB_WIDTH_NEXT 19 #define SB_WIDTH_XTERM 15 #ifndef SB_WIDTH_RXVT # define SB_WIDTH_RXVT 10 #endif /* * NeXT scrollbar defines */ #define SB_PADDING 1 #define SB_BORDER_WIDTH 1 #define SB_BEVEL_WIDTH_UPPER_LEFT 1 #define SB_BEVEL_WIDTH_LOWER_RIGHT 2 #define SB_LEFT_PADDING (SB_PADDING + SB_BORDER_WIDTH) #define SB_MARGIN_SPACE (SB_PADDING * 2) #define SB_BUTTON_WIDTH (SB_WIDTH_NEXT - SB_MARGIN_SPACE - SB_BORDER_WIDTH) #define SB_BUTTON_HEIGHT (SB_BUTTON_WIDTH) #define SB_BUTTON_SINGLE_HEIGHT (SB_BUTTON_HEIGHT + SB_PADDING) #define SB_BUTTON_BOTH_HEIGHT (SB_BUTTON_SINGLE_HEIGHT * 2) #define SB_BUTTON_TOTAL_HEIGHT (SB_BUTTON_BOTH_HEIGHT + SB_PADDING) #define SB_BUTTON_BEVEL_X (SB_LEFT_PADDING) #define SB_BUTTON_FACE_X (SB_BUTTON_BEVEL_X + SB_BEVEL_WIDTH_UPPER_LEFT) #define SB_THUMB_MIN_HEIGHT (SB_BUTTON_WIDTH - (SB_PADDING * 2)) /* * +-------------+ * | | <---< SB_PADDING * | ::::::::::: | * | ::::::::::: | * ''''''''''''''''' * ,,,,,,,,,,,,,,,,, * | ::::::::::: | * | ::::::::::: | * | +---------------< SB_BEVEL_WIDTH_UPPER_LEFT * | | :::::::: | * | V :::: vv-------< SB_BEVEL_WIDTH_LOWER_RIGHT * | +---------+ | * | | ......%%| | * | | ......%%| | * | | ..()..%%| | * | | ......%%| | * | | %%%%%%%%| | * | +---------+ | <......................... * | | <---< SB_PADDING : * | +---------+ | <-+.......... :---< SB_BUTTON_TOTAL_HEIGHT * | | ......%%| | | : : * | | ../\..%%| | |---< SB_BUTTON_HEIGHT : * | | %%%%%%%%| | | : : * | +---------+ | <-+ : : * | | : : * | +---------+ | <-+ :---< SB_BUTTON_BOTH_HEIGHT * | | ......%%| | | : : * | | ..\/..%%| | | : : * | | %%%%%%%%| | |---< SB_BUTTON_SINGLE_HEIGHT * | +---------+ | | : : * | | | : : * +-------------+ <-+.........:............: * ^^|_________| : * || | : * || +---< SB_BUTTON_WIDTH * || : * |+------< SB_PADDING * |: : * +----< SB_BORDER_WIDTH * : : * :............: * | * +---< SB_WIDTH_NEXT */ #define NO_REFRESH 0 /* Window not visible at all! */ #define FAST_REFRESH (1<<0) /* Fully exposed window */ #define SLOW_REFRESH (1<<1) /* Partially exposed window */ #define SMOOTH_REFRESH (1<<2) /* Do sync'ing to make it smooth */ #define REFRESH_BOUNDS (1<<3) #ifdef NO_SECONDARY_SCREEN # define NSCREENS 0 #else # define NSCREENS 1 #endif #define IGNORE 0 #define SAVE 's' #define RESTORE 'r' /* special (internal) prefix for font commands */ #define FONT_CMD '#' #define FONT_DN "#-" #define FONT_UP "#+" /* flags for rxvt_scr_gotorc() */ #define C_RELATIVE 1 /* col movement is relative */ #define R_RELATIVE 2 /* row movement is relative */ #define RELATIVE (R_RELATIVE|C_RELATIVE) /* modes for rxvt_scr_insdel_chars(), rxvt_scr_insdel_lines() */ #define INSERT -1 /* don't change these values */ #define DELETE +1 #define ERASE +2 /* modes for rxvt_scr_page() - scroll page. used by scrollbar window */ enum page_dirn { UP, DN, NO_DIR }; /* arguments for rxvt_scr_change_screen() */ enum { PRIMARY = 0, SECONDARY }; enum { SBYTE = 0, WBYTE }; #define RS_None 0 /* Normal */ #if defined(TTY_256COLOR) /* have at least 32 bits to use */ # define RS_fgMask 0x000001FFu /* 512 colors */ # define RS_bgMask 0x0003FE00u /* 512 colors */ # define RS_Bold 0x00040000u /* bold */ # define RS_Blink 0x00080000u /* blink */ # define RS_RVid 0x00100000u /* reverse video */ # define RS_Uline 0x00200000u /* underline */ # define RS_acsFont 0x00400000u /* ACS graphics char set */ # define RS_ukFont 0x00800000u /* UK character set */ #else /* may only have 16 bits to use so squash them in */ # define RS_fgMask 0x0000001Fu /* 32 colors */ # define RS_bgMask 0x000003E0u /* 32 colors */ # define RS_Bold 0x00000400u /* bold */ # define RS_Blink 0x00000800u /* blink */ # define RS_RVid 0x00001000u /* reverse video */ # define RS_Uline 0x00002000u /* underline */ # define RS_acsFont 0x00004000u /* ACS graphics char set */ # define RS_ukFont 0x00008000u /* UK character set */ #endif #ifdef MULTICHAR_SET # define RS_multi0 0x10000000u /* only multibyte characters */ # define RS_multi1 0x20000000u /* multibyte 1st byte */ # define RS_multi2 (RS_multi0|RS_multi1) /* multibyte 2nd byte */ # define RS_multiMask (RS_multi0|RS_multi1) /* multibyte mask */ # define IS_MULTI1(r) (((r) & RS_multiMask) == RS_multi1) # define IS_MULTI2(r) (((r) & RS_multiMask) == RS_multi2) #else # define RS_multiMask 0 # define IS_MULTI1(r) (0) # define IS_MULTI2(r) (0) #endif #define RS_fontMask (RS_acsFont|RS_ukFont) #define RS_baseattrMask (RS_Bold|RS_Blink|RS_RVid|RS_Uline) #define RS_attrMask (RS_baseattrMask|RS_fontMask|RS_multiMask) #define Sel_none 0 /* Not waiting */ #define Sel_normal 0x01 /* normal selection */ #define Sel_incr 0x02 /* incremental selection */ #define Sel_direct 0x00 #define Sel_Primary 0x01 #define Sel_Secondary 0x02 #define Sel_Clipboard 0x03 #define Sel_whereMask 0x0f #define Sel_CompoundText 0x10 /* last request was Compound */ enum { C0_NUL = 0x00, C0_SOH, C0_STX, C0_ETX, C0_EOT, C0_ENQ, C0_ACK, C0_BEL, C0_BS , C0_HT , C0_LF , C0_VT , C0_FF , C0_CR , C0_SO , C0_SI , C0_DLE, C0_DC1, C0_DC2, D0_DC3, C0_DC4, C0_NAK, C0_SYN, C0_ETB, C0_CAN, C0_EM , C0_SUB, C0_ESC, C0_IS4, C0_IS3, C0_IS2, C0_IS1 }; #define CHAR_ST 0x9c /* 0234 */ /* * XTerm Operating System Commands: ESC ] Ps;Pt (ST|BEL) * colour extensions by Christian W. Zuckschwerdt */ #define XTerm_name 0 #define XTerm_iconName 1 #define XTerm_title 2 #define XTerm_Color 4 /* change colors */ #define XTerm_Color_cursor 12 /* change actual 'Cursor' color */ #define XTerm_Color_pointer 13 /* change actual 'Pointer' color */ #define XTerm_Color_RV 17 /* change actual 'Highlight' color */ #define XTerm_Color_BD 18 /* change actual 'Bold' color */ #define XTerm_Color_UL 19 /* change actual 'Underline' color */ #define XTerm_logfile 46 /* not implemented */ #define XTerm_font 50 /* * rxvt extensions of XTerm OSCs: ESC ] Ps;Pt (ST|BEL) */ #define XTerm_Menu 10 /* set menu item */ #define XTerm_Pixmap 20 /* new bg pixmap */ #define XTerm_restoreFG 39 /* change default fg color */ #define XTerm_restoreBG 49 /* change default bg color */ #define XTerm_dumpscreen 55 /* dump scrollback and all of screen */ /* Words starting with `Color_' are colours. Others are counts */ /* * The following comment is mostly obsolete since pixcolor_set was expanded: * We're currently upto 29 colours. Only 3 more available. The * PixColor and rendition colour usage should probably be decoupled * on the unnecessary items, e.g. Color_pointer, but won't bother * until we need to. Also, be aware of usage in pixcolor_set */ enum colour_list { Color_fg = 0, Color_bg, minCOLOR, /* 2 */ Color_Black = minCOLOR, Color_Red3, Color_Green3, Color_Yellow3, Color_Blue3, Color_Magenta3, Color_Cyan3, maxCOLOR, /* minCOLOR + 7 */ #ifndef NO_BRIGHTCOLOR Color_AntiqueWhite = maxCOLOR, minBrightCOLOR, /* maxCOLOR + 1 */ Color_Grey25 = minBrightCOLOR, Color_Red, Color_Green, Color_Yellow, Color_Blue, Color_Magenta, Color_Cyan, maxBrightCOLOR, /* minBrightCOLOR + 7 */ Color_White = maxBrightCOLOR, #else Color_White = maxCOLOR, #endif #ifdef TTY_256COLOR min256COLOR = Color_White + 1, max256COLOR = minCOLOR + 255, #endif #ifndef NO_CURSORCOLOR Color_cursor, Color_cursor2, #endif Color_pointer, Color_border, #ifndef NO_BOLD_UNDERLINE_REVERSE Color_BD, Color_UL, Color_RV, #endif #ifdef OPTION_HC Color_HC, #endif #ifdef KEEP_SCROLLCOLOR Color_scroll, Color_trough, #endif NRS_COLORS, /* */ #ifdef KEEP_SCROLLCOLOR Color_topShadow = NRS_COLORS, Color_bottomShadow, TOTAL_COLORS /* upto 30 */ #else TOTAL_COLORS = NRS_COLORS /* */ #endif }; #ifdef TTY_256COLOR # define Color_Bits 9 # define NPIXCLR_SETS 9 /* (256 + 14) bits / 32 bits */ #else # define Color_Bits 5 # define NPIXCLR_SETS 1 /* (16 + 14) bits / 32 bits */ #endif #define NPIXCLR_BITS 32 #define DEFAULT_RSTYLE (RS_None | (Color_fg) | (Color_bg<h->PrivateModes |= (bit); \ else \ r->h->PrivateModes &= ~(bit) #ifdef ALLOW_132_MODE # define PrivMode_Default \ (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) #else # define PrivMode_Default \ (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor) #endif #ifdef PREFER_24BIT # define XDEPTH r->Xdepth # define XCMAP r->Xcmap # define XVISUAL r->h->Xvisual #else # ifdef DEBUG_DEPTH # define XDEPTH DEBUG_DEPTH # else # define XDEPTH DefaultDepth(r->Xdisplay,Xscreen) # define XCMAP DefaultColormap(r->Xdisplay,Xscreen) # define XVISUAL DefaultVisual(r->Xdisplay,Xscreen) # endif #endif #define IMBUFSIZ 128 /* input modifier buffer sizes */ #ifndef BUFSIZ # define BUFSIZ 4096 #endif #define KBUFSZ 512 /* size of keyboard mapping buffer */ /* ***************************************************************************** * MACRO DEFINES ***************************************************************************** */ #define MEMSET(x, y, z) memset((x), (y), (size_t)(z)) #define MEMCPY(x, y, z) memcpy((void *)(x), (const void *)(y), (z)) #define MEMMOVE(x, y, z) memmove((void *)(x), (const void *)(y), (z)) #define STRCASECMP(x, y) strcasecmp((x), (y)) #define STRNCASECMP(x, y, z) strncasecmp((x), (y), (z)) #define STRCPY(x, y) strcpy((char *)(x), (const char *)(y)) #define STRNCPY(x, y, z) strncpy((char *)(x), (const char *)(y), (z)) #define STRCMP(x, y) strcmp((const char *)(x), (const char *)(y)) #define STRNCMP(x, y, z) strncmp((const char *)(x), (const char *)(y), (z)) #define STRCAT(x, y) strcat((char *)(x), (const char *)(y)) #define STRNCAT(x, y, z) strncat((char *)(x), (const char *)(y), (z)) #define STRDUP(x) strdup((const char *)(x)) #define STRLEN(x) strlen((const char *)(x)) #define STRCHR(x, y) strchr((const char *)(x), (int)(y)) #define STRRCHR(x, y) strrchr((const char *)(x), (int)(y)) /* convert pixel dimensions to row/column values. Everything as int32_t */ #define Pixel2Col(x) Pixel2Width((int32_t)(x) - (int32_t)r->TermWin.int_bwidth) #define Pixel2Row(y) Pixel2Height((int32_t)(y) - (int32_t)r->TermWin.int_bwidth) #define Pixel2Width(x) ((int32_t)(x) / (int32_t)r->TermWin.fwidth) #define Pixel2Height(y) ((int32_t)(y) / (int32_t)r->TermWin.fheight) #define Col2Pixel(col) ((int32_t)Width2Pixel(col) + (int32_t)r->TermWin.int_bwidth) #define Row2Pixel(row) ((int32_t)Height2Pixel(row) + (int32_t)r->TermWin.int_bwidth) #define Width2Pixel(n) ((int32_t)(n) * (int32_t)r->TermWin.fwidth) #define Height2Pixel(n) ((int32_t)(n) * (int32_t)r->TermWin.fheight) #define TermWin_TotalWidth() ((int32_t)r->TermWin.width + 2 * (int32_t)r->TermWin.int_bwidth) #define TermWin_TotalHeight() ((int32_t)r->TermWin.height + 2 * (int32_t)r->TermWin.int_bwidth) #define Xscreen DefaultScreen(r->Xdisplay) #define Xroot DefaultRootWindow(r->Xdisplay) /* how to build & extract colors and attributes */ #define GET_BASEFG(x) (((x) & RS_fgMask)) #define GET_BASEBG(x) (((x) & RS_bgMask)>>Color_Bits) #ifndef NO_BRIGHTCOLOR # define GET_FGCOLOR(x) \ ((((x) & RS_Bold) == 0 \ || GET_BASEFG(x) < minCOLOR \ || GET_BASEFG(x) >= minBrightCOLOR) \ ? GET_BASEFG(x) \ : (GET_BASEFG(x) + (minBrightCOLOR - minCOLOR))) # define GET_BGCOLOR(x) \ ((((x) & RS_Blink) == 0 \ || GET_BASEBG(x) < minCOLOR \ || GET_BASEBG(x) >= minBrightCOLOR) \ ? GET_BASEBG(x) \ : (GET_BASEBG(x) + (minBrightCOLOR - minCOLOR))) #else # define GET_FGCOLOR(x) GET_BASEFG(x) # define GET_BGCOLOR(x) GET_BASEBG(x) #endif #define GET_ATTR(x) (((x) & RS_attrMask)) #define GET_BGATTR(x) \ (((x) & RS_RVid) ? (((x) & (RS_attrMask & ~RS_RVid)) \ | (((x) & RS_fgMask)<pixcolor_set[(x) / NPIXCLR_BITS] |= (1 << ((x) % NPIXCLR_BITS))) #define ISSET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] & (1 << ((x) % NPIXCLR_BITS))) #ifdef HAVE_SCROLLBARS # define scrollbar_TotalWidth() (r->scrollBar.width + r->sb_shadow * 2) #else # define scrollbar_TotalWidth() (0) #endif #define scrollbar_isMotion() (r->scrollBar.state == 'm') #define scrollbar_isUp() (r->scrollBar.state == 'U') #define scrollbar_isDn() (r->scrollBar.state == 'D') #define scrollbar_isUpDn() isupper (r->scrollBar.state) #define isScrollbarWindow(w) (r->scrollBar.state && (w) == r->scrollBar.win) #define scrollbar_setIdle() r->scrollBar.state = 1 #define scrollbar_setMotion() r->scrollBar.state = 'm' #define scrollbar_setUp() r->scrollBar.state = 'U' #define scrollbar_setDn() r->scrollBar.state = 'D' #define scrollbarnext_dnval() (r->scrollBar.end + (r->scrollBar.width + 1)) #define scrollbarnext_upButton(y) ((y) > r->scrollBar.end \ && (y) <= scrollbarnext_dnval()) #define scrollbarnext_dnButton(y) ((y) > scrollbarnext_dnval()) #define SCROLLNEXT_MINHEIGHT SB_THUMB_MIN_HEIGHT #define scrollbarrxvt_upButton(y) ((y) < r->scrollBar.beg) #define scrollbarrxvt_dnButton(y) ((y) > r->scrollBar.end) #define SCROLLRXVT_MINHEIGHT 10 #define SCROLLXTERM_MINHEIGHT 10 #define scrollbar_minheight() (r->scrollBar.style == R_SB_NEXT \ ? SCROLLNEXT_MINHEIGHT \ : SCROLLRXVT_MINHEIGHT) #define scrollbar_above_slider(y) ((y) < r->scrollBar.top) #define scrollbar_below_slider(y) ((y) > r->scrollBar.bot) #define scrollbar_position(y) ((y) - r->scrollBar.beg) #define scrollbar_size() (r->scrollBar.end - r->scrollBar.beg \ - scrollbar_minheight()) #if (MENUBAR_MAX > 1) /* rendition style flags */ # define menuBar_height() (r->TermWin.fheight + SHADOW) # define menuBar_TotalHeight() (menuBar_height() + SHADOW + menuBar_margin) # define isMenuBarWindow(w) ((w) == r->menuBar.win) #else # define menuBar_height() (0) # define menuBar_TotalHeight() (0) # define isMenuBarWindow(w) (0) #endif #ifdef XPM_BACKGROUND # define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g)) #else # define XPMClearArea(a, b, c, d, e, f, g) #endif #ifndef STRICT_FONT_CHECKING # define rxvt_get_fontwidest(font) ((font)->max_bounds.width) #endif #define rxvt_Gr_ButtonPress(x,y) rxvt_Gr_ButtonReport (r, 'P',(x),(y)) #define rxvt_Gr_ButtonRelease(x,y) rxvt_Gr_ButtonReport (r, 'R',(x),(y)) #ifdef UTMP_SUPPORT # if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) # undef HAVE_UTMPX_H # undef HAVE_STRUCT_UTMPX # endif # if !defined(RXVT_UTMP_FILE) || !defined(HAVE_STRUCT_UTMP) # undef HAVE_UTMP_H # undef HAVE_STRUCT_UTMP # endif # ifdef HAVE_UTMPX_H # include # endif # ifdef HAVE_UTMP_H # include # endif #endif #ifdef DEBUG_CMD # define D_CMD(x) fprintf x ; fputc('\n', stderr) #else # define D_CMD(x) #endif #ifdef DEBUG_INIT # define D_INIT(x) fprintf x ; fputc('\n', stderr) #else # define D_INIT(x) #endif #ifdef DEBUG_MAIN # define D_MAIN(x) fprintf x ; fputc('\n', stderr) #else # define D_MAIN(x) #endif #ifdef DEBUG_SCREEN # define D_SCREEN(x) fprintf x ; fputc('\n', stderr) #else # define D_SCREEN(x) #endif #ifdef DEBUG_SELECT # define D_SELECT(x) fprintf x ; fputc('\n', stderr) #else # define D_SELECT(x) #endif #ifdef DEBUG_X # define D_X(x) fprintf x ; fputc('\n', stderr) #else # define D_X(x) #endif /* ***************************************************************************** * VARIABLES ***************************************************************************** */ #ifdef MENUBAR # include "menubar.h" #endif struct rxvt_hidden { #ifdef __GNUC__ unsigned char want_refresh:1, want_full_refresh:1, am_transparent:1, am_pixmap_trans:1, current_screen:1, hate_those_clicks:1, num_scr_allow:1, bypass_keystate:1; unsigned char chstat:1, lost_multi:1, multi_byte:1, parsed_geometry:1; #else unsigned char want_refresh, # ifdef TRANSPARENT want_full_refresh, /* awaiting full screen refresh */ # endif # if defined(XPM_BACKGROUND) || defined(TRANSPARENT) am_transparent, /* is a transparent term */ am_pixmap_trans, /* transparency w/known root pixmap */ # endif current_screen, /* primary or secondary */ hate_those_clicks, /* a.k.a. keep mark position */ num_scr_allow, bypass_keystate, # ifdef MULTICHAR_SET chstat, lost_multi, /* set ==> we only got half a glyph */ multi_byte, /* set ==> currently using 2 bytes per glyph */ # endif parsed_geometry; #endif /* !__GNUC__ */ unsigned char refresh_type, #ifdef UTMP_SUPPORT next_utmp_action, #endif #ifndef NO_SETOWNER_TTYDEV next_tty_action, #endif #ifdef META8_OPTION meta_char, /* Alt-key prefix */ #endif scrollbar_align, selection_wait, selection_type; /* ---------- */ #ifdef GREEK_SUPPORT short greek_mode; /* greek keyboard mode */ #endif short rvideo; int16_t num_scr; /* screen: number lines scrolled */ u_int16_t prev_ncol, /* screen: previous number of columns */ prev_nrow; /* screen: previous number of rows */ #ifdef RXVT_GRAPHICS u_int16_t gr_prev_start; #endif /* ---------- */ rend_t rstyle; /* ---------- */ u_int32_t pixcolor_set[NPIXCLR_SETS]; /* ---------- */ int csrO, /* Hops - csr offset in thumb/slider to */ /* give proper Scroll behaviour */ #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING scroll_arrow_delay, #endif #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) mouse_slip_wheel_delay, mouse_slip_wheel_speed, #endif refresh_count, refresh_limit, fnum, /* logical font number */ last_bot, /* scrollbar last bottom position */ last_top, /* scrollbar last top position */ last_state, /* scrollbar last state */ scrollbar_len, currmaxcol, #ifdef MENUBAR menu_readonly, /* okay to alter menu? */ Arrows_x, #endif #if (MENUBAR_MAX > 1) Nbars, #endif window_vt_x, window_vt_y, window_sb_x, allowedxerror; /* ---------- */ unsigned int ModMetaMask, ModNumLockMask, old_width, /* last used width in screen resize */ old_height, /* last used height in screen resize */ #ifndef NO_BRIGHTCOLOR colorfgbg, #endif ttymode; unsigned long PrivateModes, SavedModes; /* ---------- */ #ifdef PREFER_24BIT Visual *Xvisual; #endif /* ---------- */ Atom xa[NUM_XA]; /* ---------- */ #ifdef MENUBAR GC menubarGC; #endif #if defined(MENUBAR) || defined(RXVT_SCROLLBAR) GC scrollbarGC, topShadowGC, botShadowGC; #endif #ifdef XTERM_SCROLLBAR GC xscrollbarGC, ShadowGC; #endif #ifdef NEXT_SCROLLBAR GC blackGC, whiteGC, grayGC, darkGC, stippleGC; Pixmap dimple, upArrow, downArrow, upArrowHi, downArrowHi; #endif /* ---------- */ Time selection_time; Time selection_request_time; pid_t cmd_pid; /* process id of child */ gid_t ttygid; #if (defined(HAVE_SETEUID) || defined(HAVE_SETREUID)) && !defined(__CYGWIN32__) uid_t euid; gid_t egid; #endif /* ---------- */ Cursor cursor_leftptr; /* ---------- */ const char *ttydev; /* pty/tty name */ #ifndef NO_BACKSPACE_KEY const char *key_backspace; #endif #ifndef NO_DELETE_KEY const char *key_delete; #endif #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) KeySym ks_bigfont, ks_smallfont; #endif #ifdef GREEK_SUPPORT KeySym ks_greekmodeswith; #endif #ifdef USE_XIM XIC Input_Context; XIMStyle input_style; int event_type; #endif struct mouse_event MEvent; XComposeStatus compose; #ifdef RXVT_GRAPHICS int graphics_up; struct grwin_t *gr_root; #endif ttymode_t tio; #ifdef UTMP_SUPPORT # ifdef HAVE_STRUCT_UTMP struct utmp ut; # endif # ifdef HAVE_STRUCT_UTMPX struct utmpx utx; # endif # if (defined(HAVE_STRUCT_UTMP) && defined(HAVE_UTMP_PID)) || defined(HAVE_STRUCT_UTMPX) char ut_id[5]; # endif int utmp_pos; #endif row_col_t oldcursor; #ifdef XPM_BACKGROUND bgPixmap_t bgPixmap; XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */ #endif #ifdef MULTICHAR_SET int oldcursormulti; void (*multichar_decode)(unsigned char *str, int len); #endif #ifndef RESET_TTY_TO_COMMON_DEFAULTS struct stat ttyfd_stat; /* original status of our tty */ #endif #ifdef MENUBAR menu_t *ActiveMenu, /* currently active menu */ *BuildMenu; /* the menu currently being built */ bar_t *CurrentBar; # if !(MENUBAR_MAX > 1) bar_t BarList; # endif /* (MENUBAR_MAX > 1) */ #endif #ifdef RXVT_GRAPHICS Window gr_last_id; #endif struct timeval timeout[NUM_TIMEOUTS]; /* these three don't need to be kept but do so to placate some mem checkers */ char *env_windowid; /* environmental variable WINDOWID */ char *env_display; /* environmental variable DISPLAY */ char *env_term; /* environmental variable TERM */ char *env_colorfgbg; char *buffer; char *locale; char charsets[4]; unsigned char *v_buffer; /* pointer to physical buffer */ unsigned char *v_bufstr; /* beginning of area to write */ unsigned char *v_bufptr; /* end of area to write */ unsigned char *v_bufend; /* end of physical buffer */ char *newfont[MAX_NFONTS]; #ifdef KEYSYM_RESOURCE const unsigned char *Keysym_map[256]; #endif const char *rs[NUM_RESOURCES]; /* command input buffering */ unsigned char *cmdbuf_ptr, *cmdbuf_endp; unsigned char cmdbuf_base[BUFSIZ]; unsigned char kbuf[KBUFSZ]; }; #ifndef __attribute__ # ifdef __GNUC__ # if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2) # define __attribute__(x) # endif # endif # define __attribute__(x) #endif /* ***************************************************************************** * PROTOTYPES ***************************************************************************** */ #ifdef PROTOTYPES # define __PROTO(p) p #else # define __PROTO(p) () #endif #include "protos.h" #ifndef RXVT_GRAPHICS /* sync functions with graphics.extpro */ # define rxvt_Gr_ButtonReport(r, but, x, y) # define rxvt_Gr_do_graphics(r, cmd, nargs, args, text) # define rxvt_Gr_scroll(r, count) # define rxvt_Gr_ClearScreen(r) # define rxvt_Gr_ChangeScreen(r) # define rxvt_Gr_expose(r, win) # define rxvt_Gr_Resize(r, w, h) # define rxvt_Gr_reset(r) # define rxvt_Gr_Displayed(r) (0) #endif #ifndef MENUBAR /* sync functions with menubar.extpro */ # define rxvt_menubar_read(r, filename) # define rxvt_menubar_dispatch(r, str) # define rxvt_menubar_expose(r) # define rxvt_menubar_mapping(r, map) (0) # define rxvt_menubar_control(r, ev) # define rxvt_map_menuBar(r, map) # define rxvt_create_menuBar(r, cursor) # define rxvt_Resize_menuBar(r, x, y, width, height) #endif #ifndef XPM_BACKGROUND /* sync functions with xpm.extpro */ # define rxvt_scale_pixmap(r, geom) (0) # define rxvt_resize_pixmap(r) # define rxvt_set_bgPixmap(r, file) (0) #endif #ifndef GREEK_SUPPORT /* sync functions with grkelot.extpro */ # define greek_init() # define greek_end() # define greek_reset() # define greek_setmode(greek_mode) # define greek_getmode() (0) # define greek_xlat(s, num_chars) (0) #endif #ifndef USE_XIM # define rxvt_setTermFontSet(r, idx) (0) #endif #ifndef UTMP_SUPPORT # define rxvt_privileged_utmp(r, action) (0) #endif #ifdef NO_SETOWNER_TTYDEV # define rxvt_privileged_ttydev(r, action) (0) #endif #ifndef XTERM_COLOR_CHANGE # define rxvt_set_window_color(r, idx, color) (0) #endif #ifdef __CYGWIN32__ # define rxvt_privileged_ttydev(r, action) (0) #endif #ifdef DEBUG_malloc # include "dmalloc.h" /* This comes last */ #endif #endif /* _RXVT_H_ */ rxvt-2.7.10/src/protos.h010064400001440000024000000016570733020561700135410ustar gcwstaff/* Include prototypes for all files */ /* * $Id: protos.h,v 1.14 2001/04/02 07:32:35 gcw Exp $ */ #include "command.extpro" #include "defaultfont.extpro" #ifdef RXVT_GRAPHICS # include "graphics.extpro" #endif #ifdef GREEK_SUPPORT # include "grkelot.extpro" #endif #include "init.extpro" #ifdef UTMP_SUPPORT # include "logging.extpro" #endif #include "main.extpro" #ifdef MENUBAR # include "menubar.extpro" #endif #include "misc.extpro" #ifdef DISPLAY_IS_IP # include "netdisp.extpro" #endif #include "ptytty.extpro" #if !defined(NO_STRINGS) && !defined(HAVE_STRING_H) # include "strings.extpro" #endif #include "screen.extpro" #include "scrollbar.extpro" #ifdef RXVT_SCROLLBAR # include "scrollbar-rxvt.extpro" #endif #ifdef NEXT_SCROLLBAR # include "scrollbar-next.extpro" #endif #ifdef XTERM_SCROLLBAR # include "scrollbar-xterm.extpro" #endif #include "xdefaults.extpro" #ifdef XPM_BACKGROUND # include "xpm.extpro" #endif rxvt-2.7.10/src/netdisp.h010064400001440000024000000006520733020561700136530ustar gcwstaff/* On Solaris link with -lsocket and -lnsl */ #include #include /* these next two are probably only on Sun (not Solaris) */ #ifdef HAVE_SYS_SOCKIO_H #include #endif #ifdef HAVE_SYS_BYTEORDER_H #include #endif #include #include #include #include #include "netdisp.intpro" /* PROTOS for internal routines */ rxvt-2.7.10/src/menubar.h010064400001440000024000000051050733020561500136320ustar gcwstaff/* * $Id: menubar.h,v 1.5 2000/07/23 13:46:59 gcw Exp $ */ #ifndef _MENUBAR_H_ #define _MENUBAR_H_ typedef struct { short type; /* must not be changed; first element */ short len; /* strlen (str) */ unsigned char *str; /* action to take */ } action_t; typedef struct { short type; /* must not be changed; first element */ struct menu_t *menu; /* sub-menu */ } submenu_t; typedef struct menuitem_t { struct menuitem_t *prev; /* prev menu-item */ struct menuitem_t *next; /* next menu-item */ char *name; /* character string displayed */ char *name2; /* character string displayed (right) */ short len; /* strlen (name) */ short len2; /* strlen (name) */ union { short type; /* must not be changed; first element */ action_t action; submenu_t submenu; } entry; } menuitem_t; enum menuitem_t_action { MenuLabel, MenuAction, MenuTerminalAction, MenuSubMenu }; typedef struct menu_t { struct menu_t *parent; /* parent menu */ struct menu_t *prev; /* prev menu */ struct menu_t *next; /* next menu */ menuitem_t *head; /* double-linked list */ menuitem_t *tail; /* double-linked list */ menuitem_t *item; /* current item */ char *name; /* menu name */ short len; /* strlen (name) */ short width; /* maximum menu width [chars] */ Window win; /* window of the menu */ short x; /* x location [pixels] (chars if parent == NULL) */ short y; /* y location [pixels] */ short w, h; /* window width, height [pixels] */ } menu_t; typedef struct bar_t { menu_t *head, *tail; /* double-linked list of menus */ char *title; /* title to put in the empty menuBar */ #if (MENUBAR_MAX > 1) # define MAXNAME 16 char name[MAXNAME]; /* name to use to refer to menubar */ struct bar_t *next, *prev; /* circular linked-list */ #endif /* (MENUBAR_MAX > 1) */ #define NARROWS 4 action_t arrows[NARROWS]; } bar_t; /* #define DEBUG_MENU */ /* #define DEBUG_MENU_LAYOUT */ /* #define DEBUG_MENUBAR_STACKING */ #define HSPACE 1 /* one space */ #define isSeparator(name) ((name)[0] == '\0') #define HEIGHT_SEPARATOR (SHADOW + 1) #define HEIGHT_TEXT (Height2Pixel(1) + 2) #define MENU_DELAY_USEC 250000 /* 1/4 sec */ #define SEPARATOR_NAME "-" #define MENUITEM_BEG '{' #define MENUITEM_END '}' #define COMMENT_CHAR '#' #define DOT "." #define DOTS ".." #endif /* _MENUBAR_H_ */ rxvt-2.7.10/src/logging.h010064400001440000024000000012320754622265300136360ustar gcwstaff/* * $Id: logging.h,v 1.10 2002/10/01 04:32:40 gcw Exp $ */ #ifndef _LOGGING_H_ #define _LOGGING_H_ #ifdef UTMP_SUPPORT # if ! defined(HAVE_STRUCT_UTMPX) && ! defined(HAVE_STRUCT_UTMP) # error cannot build with utmp support - no utmp or utmpx struct found # endif # ifdef HAVE_LASTLOG_H # include # endif # include # ifdef RXVT_UTMP_SYSV # ifndef USER_PROCESS # define USER_PROCESS 7 # endif # ifndef DEAD_PROCESS # define DEAD_PROCESS 8 # endif # endif # ifdef __QNX__ # include # define ut_name ut_user # endif #include "logging.intpro" /* PROTOS for internal routines */ #endif #endif /* _LOGGING_H_ */ rxvt-2.7.10/src/init.h010064400001440000024000000062740733020561400131530ustar gcwstaff/* * $Id: init.h,v 1.6 2001/04/02 12:11:26 gcw Exp $ */ #ifndef _INIT_H_ #define _INIT_H_ #ifdef HAVE_XSETLOCALE # define X_LOCALE # include #else # ifdef HAVE_SETLOCALE # include # endif #endif /* HAVE_XLOCALE */ #if defined(PTYS_ARE_PTMX) && !defined(__CYGWIN32__) # include /* for struct rlimit */ # define _NEW_TTY_CTRL /* to get proper defines in */ #endif #ifdef __QNX__ /* autoconf someday */ # include #endif #ifdef TTY_GID_SUPPORT # include #endif /* ways to deal with getting/setting termios structure */ #ifdef HAVE_TERMIOS_H /* termios interface */ # ifdef TCSANOW /* POSIX */ # define GET_TERMIOS(fd,tios) tcgetattr (fd, tios) # define SET_TERMIOS(fd,tios) \ cfsetospeed (tios, BAUDRATE), \ cfsetispeed (tios, BAUDRATE), \ tcsetattr (fd, TCSANOW, tios) # else # ifdef TIOCSETA # define GET_TERMIOS(fd,tios) ioctl (fd, TIOCGETA, tios) # define SET_TERMIOS(fd,tios) \ tios->c_cflag |= BAUDRATE, \ ioctl (fd, TIOCSETA, tios) # else # define GET_TERMIOS(fd,tios) ioctl (fd, TCGETS, tios) # define SET_TERMIOS(fd,tios) \ tios->c_cflag |= BAUDRATE, \ ioctl (fd, TCSETS, tios) # endif # endif # define SET_TTYMODE(fd,tios) SET_TERMIOS (fd, tios) #else /* sgtty interface */ # define SET_TTYMODE(fd,tt) \ tt->sg.sg_ispeed = tt->sg.sg_ospeed = BAUDRATE, \ ioctl (fd, TIOCSETP, &(tt->sg)), \ ioctl (fd, TIOCSETC, &(tt->tc)), \ ioctl (fd, TIOCSLTC, &(tt->lc)), \ ioctl (fd, TIOCSETD, &(tt->line)), \ ioctl (fd, TIOCLSET, &(tt->local)) #endif /* HAVE_TERMIOS_H */ /* use the fastest baud-rate */ #ifdef B38400 # define BAUDRATE B38400 #else # ifdef B19200 # define BAUDRATE B19200 # else # define BAUDRATE B9600 # endif #endif /* Disable special character functions */ #ifdef _POSIX_VDISABLE # define VDISABLE _POSIX_VDISABLE #else # define VDISABLE 255 #endif /*----------------------------------------------------------------------* * system default characters if defined and reasonable */ #ifndef CINTR # define CINTR '\003' /* ^C */ #endif #ifndef CQUIT # define CQUIT '\034' /* ^\ */ #endif #ifndef CERASE # ifdef linux # define CERASE '\177' /* ^? */ # else # define CERASE '\010' /* ^H */ # endif #endif #ifndef CKILL # define CKILL '\025' /* ^U */ #endif #ifndef CEOF # define CEOF '\004' /* ^D */ #endif #ifndef CSTART # define CSTART '\021' /* ^Q */ #endif #ifndef CSTOP # define CSTOP '\023' /* ^S */ #endif #ifndef CSUSP # define CSUSP '\032' /* ^Z */ #endif #ifndef CDSUSP # define CDSUSP '\031' /* ^Y */ #endif #ifndef CRPRNT # define CRPRNT '\022' /* ^R */ #endif #ifndef CFLUSH # define CFLUSH '\017' /* ^O */ #endif #ifndef CWERASE # define CWERASE '\027' /* ^W */ #endif #ifndef CLNEXT # define CLNEXT '\026' /* ^V */ #endif #ifndef VDISCRD # ifdef VDISCARD # define VDISCRD VDISCARD # endif #endif #ifndef VWERSE # ifdef VWERASE # define VWERSE VWERASE # endif #endif #ifndef O_NOCTTY # define O_NOCTTY 0 #endif #ifndef O_NDELAY # define O_NDELAY O_NONBLOCK /* QNX, at least */ #endif #ifndef ONLCR # define ONLCR 0 /* QNX, at least */ #endif #define CONSOLE "/dev/console" /* console device */ #include "init.intpro" /* PROTOS for internal routines */ #endif /* _INIT_H_ */ rxvt-2.7.10/src/grkelot.h010064400001440000024000000025530733020615500136540ustar gcwstaff/* * File: grkelot.h * $Id: grkelot.h,v 1.5 2001/07/27 06:38:37 gcw Exp $ * * Synopsis: string -> greek ELOT928 string; 4-state FSM. * * Copyright (c) 1994 Angelo Haritsis. All rights reserved. * Copyright (c) 1997,1998 Oezguer Kesim * * 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 of the License, 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 _GRKELOT_H #define _GRKELOT_H #define GREEK_ELOT928 0 #define GREEK_IBM437 1 #ifdef __cplusplus extern "C" { #endif extern void greek_init (void); extern void greek_end (void); extern void greek_reset (void); extern void greek_setmode(int greek_mode); extern int greek_getmode(void); extern int greek_xlat (char *s, int num_chars); #ifdef __cplusplus } #endif #endif /* _GRKELOT_H */ rxvt-2.7.10/src/feature.h010064400001440000024000000273670745443524200136620ustar gcwstaff/* * File: feature.h * $Id: feature.h,v 1.69 2002/04/09 00:49:22 gcw Exp $ * * Compile-time configuration. *----------------------------------------------------------------------- * Copyright (c) 1997,1998 Oezguer Kesim * * 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 of the License, 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 _FEATURE_H #define _FEATURE_H #ifndef X11USRLIBDIR # define X11USRLIBDIR "/usr/X11R6/lib" #endif #ifndef X11LIBDIR # define X11LIBDIR X11USRLIBDIR "/X11" #endif #ifndef XAPPLOADDIR # define XAPPLOADDIR X11LIBDIR "/app-defaults" # define XAPPLOADDIRLOCALE X11LIBDIR "/%-.*s/app-defaults" #endif /*-----------------------SCREEN OPTIONS AND COLOURS---------------------*/ /* * Define the name of the environment variable to be used in * addition to the "PATH" environment and the `path' resource. * Usually it should point to where you keep your background pixmaps and/or * your menu files */ #define PATH_ENV "RXVTPATH" /* * Avoid enabling the colour cursor (-cr, cursorColor, cursorColor2) */ /* #define NO_CURSORCOLOR */ /* * Suppress use of BOLD and BLINK attributes for setting bright foreground * and background, respectively. Simulate BOLD using colorBD, boldFont or * overstrike characters. */ /* #define NO_BRIGHTCOLOR */ /* * Make colours match xterm colours instead of `traditional' rxvt colours */ #define XTERM_COLORS /* * Disable separate colours for bold, underline and reverse video */ /* #define NO_BOLD_UNDERLINE_REVERSE */ /* * Disable using simulated bold using overstrike. You can also turn off * overstrike just for multi char fonts * Note: NO_BOLDOVERSTRIKE implies NO_BOLDOVERSTRIKE_MULTI */ /* #define NO_BOLDOVERSTRIKE */ /* #define NO_BOLDOVERSTRIKE_MULTI */ /* * Don't bother cleaning up pixel droppings. If you don't use bold * overstrike then you don't usually need this */ /* #define NO_PIXEL_DROPPING_AVOIDANCE */ /* * Also use bold font or overstrike even if we use colour for bold */ #define VERYBOLD /* * Compile without support for real bold fonts */ /* #define NO_BOLDFONT */ /* * Add support for '-hc colour' for background highlight of selection */ /* #define OPTION_HC */ /* * Define maximum possible columns and rows */ #define MAX_COLS 1000 #define MAX_ROWS 1000 /* * Define default colours for certain items. If you have a low colour * display, then consider using colours which are already pre-allocated: * Black (#000000) * Red3 (#CD0000) + these * Green3 (#00CD00) + colours * Yellow3 (#CDCD00) + are * Blue3 (#0000CD) + not * Magenta3 (#CD00CD) + pre-allocated * Cyan3 (#00CDCD) + if * AntiqueWhite (#FAEBD7) + NO_BRIGHTCOLOR * Grey25 (#404040) + defined * Red (#FF0000) * Green (#00FF00) * Yellow (#FFFF00) * Blue (#0000FF) * Magenta (#FF00FF) * Cyan (#00FFFF) * White (#FFFFFF) */ /* These colours MUST be defined */ #define COLOR_FOREGROUND "Black" #define COLOR_BACKGROUND "White" #define COLOR_SCROLLBAR "#B2B2B2" /* scrollColor match Netscape */ #define COLOR_SCROLLTROUGH "#969696" /* * The cursor colours are special. Be very careful about setting these: * foreground/background colours may be modified by command line or resources * prior to this allocation. Also, they are not valid if NO_CURSORCOLOR is * defined */ #define COLOR_CURSOR_FOREGROUND NULL /* if NULL, use background colour */ #define COLOR_CURSOR_BACKGROUND NULL /* if NULL, use foreground colour */ /* * Define to remove support for XCopyArea() support. XCopyArea() is useful * for scrolling on non-local X displays */ /* #define NO_SLOW_LINK_SUPPORT */ /* * Printer pipe which will be used for emulation of attached vt100 printer */ #define PRINTPIPE "lpr" /* * Allow 80/132 mode switching on startup */ /* #define ALLOW_132_MODE */ /*------------------------------RESOURCES-------------------------------*/ /* * Define to find installed application defaults for rxvt * Only if USE_XGETDEFAULT is not defined. */ /* #define USE_XAPPLOADDIR */ /* * Add support for the Offix DND (Drag 'n' Drop) protocol */ /* #define OFFIX_DND */ /*---------------------------------KEYS---------------------------------*/ /* * Define defaults for backspace and delete keys - unless they have been * configured out with --disable-backspace-key / --disable-delete-key */ /* #define DEFAULT_BACKSPACE "DEC" */ /* SPECIAL */ /* #define DEFAULT_BACKSPACE "\177" */ /* #define DEFAULT_DELETE "\033[3~" */ /* * Choose one of these values to be the `hotkey' for changing font. * This has been superceded and is only for you older users */ /* #define HOTKEY_CTRL */ /* #define HOTKEY_META */ /* * To use * Home = "\E[1~", End = "\E[4~" * instead of * Home = "\E[7~", End = "\E[8~" [default] */ /* #define LINUX_KEYS */ /* * Enable the keysym resource which allows you to define strings associated * with various KeySyms (0xFF00 - 0xFFFF). * Only works with the default hand-rolled resources. */ #ifndef NO_RESOURCES # define KEYSYM_RESOURCE #endif /* * Modifier/s to use to allow up/down arrows and Priot/Next keys * to scroll single or page-fulls */ #define SCROLL_ON_SHIFT /* #define SCROLL_ON_CTRL */ /* #define SCROLL_ON_META */ /* * Allow scrolling with modifier+Up/Down keys, in addition * to modifier+Prior/Next? (modifier is controlled with * SCROLL_ON_* defines above.). * Also for modifier+Home/End keys to move to top/bottom */ /* #define SCROLL_ON_UPDOWN_KEYS */ /* #define SCROLL_ON_HOMEEND_KEYS */ /* * Allow unshifted Next/Prior keys to scroll forward/back * (in addition to shift+Next/shift+Prior) --pjh */ /* #define UNSHIFTED_SCROLLKEYS */ /* (Hops) Set to choose a number of lines of context between pages * (rather than a proportion (1/5) of savedlines buffer) * when paging the savedlines with SHIFT-{Prior,Next} keys. */ #define PAGING_CONTEXT_LINES 1 /* */ /* * Have either Ctrl+Tab or Mod4+Tab emit \e\t * Useful when window manager grabs Alt+Tab -- mg */ /* #define CTRL_TAB_MAKES_META */ /* #define MOD4_TAB_MAKES_META */ /* * default mode switch when greek keyboard is enabled (i.e. GREEK_SUPPORT) */ #ifndef GREEK_KEYBOARD_MODESWITCH # define GREEK_KEYBOARD_MODESWITCH XK_Mode_switch #endif /*--------------------------------MOUSE---------------------------------*/ /* * Disable sending escape sequences (up, down, page up/down) * from the scrollbar when XTerm mouse reporting is enabled */ /* #define NO_SCROLLBAR_REPORT */ /* * Default separating chars for multiple-click selection * Space and tab are separate separating characters and are not settable */ #define CUTCHARS "\"&'()*,;<=>?@[\\]^`{|}~" /* * Add run-time support for changing the cutchars for double click selection */ #define CUTCHAR_RESOURCE /* * Have mouse reporting include double-click info for button1 */ /* #define MOUSE_REPORT_DOUBLECLICK */ /* * Set delay between multiple click events [default: 500 milliseconds] */ /* #define MULTICLICK_TIME 500 */ /* * Time factor to slow down a `jumpy' mouse. Motion isn't recognised until * this long after the last mouse click [default: 50 milliseconds] */ #define MOUSE_THRESHOLD 50 /* * If mouse wheel is defined, then scrolling is by 5 lines (or 1 line * if the shift key is down). Scrolling can be smooth or jump scrolling */ /* #define JUMP_MOUSE_WHEEL */ /* * Set delay periods for continuous scrolling with scrollbar buttons */ /* #define SCROLLBAR_INITIAL_DELAY 40 */ /* #define SCROLLBAR_CONTINUOUS_DELAY 2 */ /*--------------------------------MISC----------------------------------*/ /* * Disable to reset tty device to pre-incovation state */ #define RESET_TTY_TO_COMMON_DEFAULTS /* * Only log in wtmp file when we're a login shell (-ls option) */ #define WTMP_ONLY_ON_LOGIN /*--------------------------------BELL----------------------------------*/ /* * Disable all bell indications */ /* #define NO_BELL */ /* * Disable automatic de-iconify when a bell is received */ /* #define NO_MAPALERT */ /* * Have mapAlert behaviour selectable with mapAlert resource */ #define MAPALERT_OPTION /*-----------------------------SCROLL BAR-------------------------------*/ /* * Choose the rxvt style scrollbar width * - should be an even number [default: 10] */ /* #define SB_WIDTH_RXVT 10 */ /* * Minimum and maximum widths of the scrollbar (all styles) */ #define SB_WIDTH_MINIMUM 5 #define SB_WIDTH_MAXIMUM 100 /* * When using Rxvt scrollbar, clicking above or below the slider will move * 1/4 of the screen height, if possible. Setting RXVT_SCROLL_FULL will move * it one screen height less one line, if possible */ #define RXVT_SCROLL_FULL 1 /* * (Hops) draw an internal border line on inside edge of the scrollbar */ /* #define SB_BORDER */ /*------------------------------MENU BAR--------------------------------*/ /* * Choose how many of (experimental) menuBars you want to be able to stack at * one time. * A value of 1 disables menuBar stacking. * A value of 0 disables menuBar all together. * Note that the amount of memory overhead is the same for any value >= 2. */ #define MENUBAR_MAX 8 /* * Change the default shadow style */ /* #define MENUBAR_SHADOW_IN */ /* * Change the default shadow style */ #define MENU_SHADOW_IN /*---------------------------MULTILINGUAL-------------------------------*/ /* * Allow run-time selection of Meta (Alt) to set the 8th bit on */ #define META8_OPTION /*---------------------------DISPLAY OPTIONS----------------------------*/ /* * Force local connection to be socket (or other local) communication */ /* #define LOCAL_X_IS_UNIX */ /* * Have DISPLAY environment variable & "\E[7n" transmit display with IP number */ /* #define DISPLAY_IS_IP */ /* * Have "\E[7n" transmit the display name. * This has been cited as a potential security hole. */ /* #define ENABLE_DISPLAY_ANSWER */ /* * Change what ESC Z transmits instead of the default "\E[?1;2c" */ /* #define ESCZ_ANSWER "\033[?1;2C" */ /* * Check the current value of the window-time/icon-name and avoid * re-setting it to the same value -- avoids unnecessary window refreshes */ #define SMART_WINDOW_TITLE /* * Allow foreground/background colour to be changed with an * xterm escape sequence "\E]39;colour^G" -- still experimental */ #define XTERM_COLOR_CHANGE /* * Remove secondary screen's independent cursor position, a la xterm */ /* #define NO_SECONDARY_SCREEN_CURSOR */ /* * If no secondary screen is available (NO_SECONDARY_SCREEN in config.h), * then scroll the text up on a window change request */ /* #define SCROLL_ON_NO_SECONDARY */ /* * Width of the term internal border */ #define INTERNALBORDERWIDTH 2 /* * Width of the term external border */ #define EXTERNALBORDERWIDTH 0 /* * Default number of extra dots between lines */ #define LINESPACE 0 /* * Default number of lines in the scrollback buffer */ #define SAVELINES 64 /* * Provide termcap/terminfo bw support */ /* #define TERMCAP_HAS_BW */ /* * MAX_NFONTS is the maximum allowed number of fonts in the list * FONT0_IDX is the default font in the list (starting at 0) * Sizes between multi-char fonts sets (MFONT_LIST) and single-char font * sets (NFONT_LIST) have been matched up */ #define MAX_NFONTS 7 #define FONT0_IDX 2 #endif rxvt-2.7.10/src/defaultfont.h010064400001440000024000000152450733020561300145200ustar gcwstaff/* * $Id: defaultfont.h,v 1.5 2001/06/01 15:12:04 gcw Exp $ */ #ifndef _DEFAULTFONT_H_ #define _DEFAULTFONT_H_ #ifdef HAVE_XSETLOCALE # define X_LOCALE # include #else # ifdef HAVE_SETLOCALE # include # endif #endif /* HAVE_XLOCALE */ #ifdef HAVE_NL_LANGINFO # include #endif #include "feature.h" #include "defaultfont.intpro" /* PROTOS for internal routines */ /* * List of encoding labels. * Note "encoding" is not "character set" nor "encoding method". * * In Rxvt, "encoding" is implemented as a pair of "encoding method" * (implemented as ENC_METHOD in screen.h) and font specification, * i.e., defaultfont[] in this file. * * This type is used only in this file. */ enum enc_label { ENC_SJIS, ENC_EUCJ, ENC_GB, ENC_BIG5, ENC_EUCKR, ENC_ISO8859_1, ENC_ISO8859_2, ENC_ISO8859_3, ENC_ISO8859_4, ENC_ISO8859_5, ENC_ISO8859_6, ENC_ISO8859_7, ENC_ISO8859_8, ENC_ISO8859_9, ENC_ISO8859_10, ENC_ISO8859_11, ENC_ISO8859_12, ENC_ISO8859_13, ENC_ISO8859_14, ENC_ISO8859_15, ENC_KOI8R, ENC_KOI8U, /* ENC_VISCII, ENC_VSCII, ENC_TIS620, ENC_UTF8, */ ENC_DUMMY }; #define ENC_ISO8859_LAST ENC_ISO8859_15 /* * Used for tables of locale/encoding names -> encodng labels. */ struct name2encoding { const char *name; const enum enc_label encoding; }; /* * Used for tables of encoding labels -> Rxvt internal informations. * */ struct defaultfont { const enum enc_label enc_label; const char *encoding_method; const char *font[MAX_NFONTS]; const char *mfont[MAX_NFONTS]; }; /* ***************************************************************************** * FONT DEFINITIONS ***************************************************************************** */ /* * Default fonts when encoding is not valid or not specified. */ #define NFONT_LIST \ "7x14", "6x10", "6x13", "8x13", "8x16", "10x20", "12x24" #ifdef MULTICHAR_SET /* multichar glyph language support */ # define MFONT_LIST NULL, NULL, NULL, NULL, NULL, NULL, NULL #endif /* * ASCII font definitions (only used in this file) */ #define A_12 "-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-1" #define A_14 "-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1" #define A_16 "-etl-fixed-medium-r-normal--16-160-72-72-c-80-iso8859-1" #define A_18 "-misc-fixed-medium-r-normal--18-170-75-75-c-90-iso8859-1" #define A_20 "-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1" #define A_24 "-etl-fixed-medium-r-normal--24-240-72-72-c-120-iso8859-1" #define MFONT_LIST_NULL NULL, NULL, NULL, NULL, NULL, NULL, NULL /* * Font definitions for supported encodings * * Font Usage Policy (suggested): * 1. Use fonts available from XFree86 as much as possible. * 2. Use popular fonts in the language community as much as possible. * 3. Use "OpenSource" (by Open Source Definition, * http://www.opensource.org/) fonts as much as possible. * * Comments are the source of these fonts. * xf XFree86 distribution * pd public domain fonts from ftp://ftp.gnu.org/pub/gnu/ * ak public domain "a12k12" fonts * na "naga10" from http://gondow-www.cs.titech.ac.jp/~snagao/fonts/ * cr "Xcyr" fonts from http://sawsoft.newmail.ru/LS/ * ba "baekmuk" fonts from ftp://ftp.mizi.co.kr/pub/baekmuk * * These definitions should be brushed up by native speakers. */ #define NFONT_LIST_EUCJ \ A_14, \ "-misc-fixed-medium-r-normal--10-90-75-75-c-50-iso8859-1",/*na*/\ A_12, A_16, A_18, A_24, NULL #define MFONT_LIST_EUCJ \ "-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-0",/*xf*/\ "-misc-fixed-medium-r-normal--10-90-75-75-c-100-jisx0208.1983-0",/*na*/\ "-misc-fixed-medium-r-normal--12-110-75-75-c-120-jisx0208.1983-0",/*ak*/\ "-jis-fixed-medium-r-normal--16-150-75-75-c-160-jisx0208.1983-0",/*xf*/\ "-jis-gothic-medium-r-normal--18-170-75-75-c-180-jisx0208.1983-0",/*pd*/\ "-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-0",/*xf*/\ NULL #define NFONT_LIST_GB A_16, NULL, NULL, A_24, NULL, NULL, NULL #define MFONT_LIST_GB \ "-isas-song ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0",/*xf*/\ NULL, NULL, \ "-isas-song ti-medium-r-normal--24-240-72-72-c-240-gb2312.1980-0",/*xf*/\ NULL, NULL, NULL #define NFONT_LIST_BIG5 A_16, NULL, NULL, A_24, NULL, NULL, NULL #define MFONT_LIST_BIG5 \ "-eten-fixed-medium-r-normal--16-150-75-75-c-160-big5-0",/*pd*/\ NULL, NULL, \ "-eten-fixed-medium-r-normal--24-230-75-75-c-240-big5-0",/*pd*/\ NULL, NULL, NULL #define NFONT_LIST_EUCKR A_16, A_12, A_14, A_18, A_20, A_24, NULL #define MFONT_LIST_EUCKR \ "-daewoo-mincho-medium-r-normal--16-120-100-100-c-160-ksc5601.1987-0",/*xf*/\ "-baekmuk-batang-medium-r-normal--12-120-75-75-m-120-ksc5601.1987-0",/*ba*/\ "-baekmuk-batang-medium-r-normal--14-140-75-75-m-140-ksc5601.1987-0",/*ba*/\ "-baekmuk-batang-medium-r-normal--18-180-75-75-m-180-ksc5601.1987-0",/*ba*/\ "-baekmuk-batang-medium-r-normal--20-200-75-75-m-200-ksc5601.1987-0",/*ba*/\ "-daewoo-mincho-medium-r-normal--24-170-100-100-c-240-ksc5601.1987-0",/*xf*/\ NULL #define NFONT_LIST_KOI8R \ "-misc-fixed-medium-r-normal--14-130-75-75-c-70-koi8-r",/*xf*/\ "-misc-fixed-medium-r-normal--10-100-75-75-c-60-koi8-r",/*xf*/\ "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-koi8-r",/*xf*/\ "-misc-fixed-medium-r-normal--13-120-75-75-c-80-koi8-r",/*xf*/\ "-misc-fixed-medium-r-normal--15-140-75-75-c-90-koi8-r",/*xf*/\ "-misc-fixed-medium-r-normal--18-120-100-100-c-90-koi8-r",/*xf*/\ "-misc-fixed-medium-r-normal--20-200-75-75-c-100-koi8-r" /*xf*/ #define NFONT_LIST_KOI8U \ "-cronyx-fixed-medium-r-normal--14-130-75-75-c-70-koi8-u",/*cr*/\ "-cronyx-fixed-medium-r-normal--10-100-75-75-c-60-koi8-u",/*cr*/\ "-cronyx-fixed-medium-r-semicondensed--13-120-75-75-c-60-koi8-u",/*cr*/\ "-cronyx-fixed-medium-r-normal--13-120-75-75-c-80-koi8-u",/*cr*/\ "-cronyx-fixed-medium-r-normal--15-140-75-75-c-90-koi8-u",/*cr*/\ "-cronyx-fixed-medium-r-normal--18-120-100-100-c-90-koi8-u",/*cr*/\ "-cronyx-fixed-medium-r-normal--20-200-75-75-c-100-koi8-u" /*cr*/ /* special common rule for ISO-8859-* */ #define NFONT_LIST_ISO8859X \ "-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-%d", /*xf*/ \ "-misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-%d", /*xf*/ \ "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-%d",/*xf*/ \ "-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-%d", /*xf*/ \ "-misc-fixed-medium-r-normal--16-120-100-100-c-80-iso8859-%d", /*xf*/ \ "-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-%d", /*xf*/ \ "-misc-fixed-medium-r-normal--24-170-100-100-c-120-iso8859-%d" /*xf*/ #endif /* _DEFAULTFONT_H_ */ rxvt-2.7.10/src/.protos010064400001440000024000000000350764024231400133550ustar gcwstaffWed Mar 26 17:12:28 EST 2003 rxvt-2.7.10/doc004075500001440000024000000000000764024425100117345ustar gcwstaffrxvt-2.7.10/doc/etc004075500001440000024000000000000764024425100125075ustar gcwstaffrxvt-2.7.10/doc/etc/XTerm.ad010064400001440000024000000035160651657463300141500ustar gcwstaff! Put this into ~/.Xdefaults, or to app-defaults/XTerm or wherever ! xrm will loaded it. ! ! This will match the key sequences for a regular xterm to those used ! by rxvt and the enclosed termcap and terminfo files. ! ! As usual, the most annoying xterm keys are Home/End and the ubiquitous ! BackSpace/Delete confusion. XTerm*vt100.translations: #override \ BackSpace: string("\010") \n\ ShiftTab: string("\033[Z") \n\ Ctrlminus: string("\037") \n\ Home: string("\033[1~") \n\ End: string("\033[4~") \n\ Delete: string("\033[3~") \n\ ShiftDelete: string("\177") \n\ CtrlDelete: string("\010") \n\ AltReturn: string("\033\015") \n\ Altspace: string("\033\040") \n\ Alta: string("\033a") \n\ Altb: string("\033b") \n\ Altc: string("\033c") \n\ Altd: string("\033d") \n\ Alte: string("\033e") \n\ Altf: string("\033f") \n\ Altg: string("\033g") \n\ Alth: string("\033h") \n\ Alti: string("\033i") \n\ Altj: string("\033j") \n\ Altk: string("\033k") \n\ Altl: string("\033l") \n\ Altm: string("\033m") \n\ Altn: string("\033n") \n\ Alto: string("\033o") \n\ Altp: string("\033p") \n\ Altq: string("\033q") \n\ Altr: string("\033r") \n\ Alts: string("\033s") \n\ Altt: string("\033t") \n\ Altu: string("\033u") \n\ Altv: string("\033v") \n\ Altw: string("\033w") \n\ Altx: string("\033x") \n\ Alty: string("\033y") \n\ Altz: string("\033z") \n\ CtrlUp: string("\033Oa") \n\ CtrlDown: string("\033Ob") \n\ CtrlRight: string("\033Oc") \n\ CtrlLeft: string("\033Od") \n\ ShiftUp: string("\033[a") \n\ ShiftDown: string("\033[b") \n\ ShiftRight: string("\033[c") \n\ ShiftLeft: string("\033[d") \n !EOF rxvt-2.7.10/doc/etc/rxvt.terminfo010064400001440000024000000051310725403111100153210ustar gcwstaff# From: Thomas Dickey 04 Oct 1997 # Updated: Özgür Kesim 02 Nov 1997 # Notes: # rxvt 2.21b uses # smacs=\E(B\E)U^N, rmacs=\E(B\E)0^O, # but some applications don't work with that. # It also has an AIX extension # box2=lqkxjmwuvtn, # and # ech=\E[%p1%dX, # but the latter does not work correctly. # # rxvt is normally configured to look for "xterm" or "xterm-color" as $TERM. # Since rxvt is not really compatible with xterm, it should be configured as # "rxvt-basic" (monochrom) and "rxvt" rxvt-basic|rxvt terminal base (X Window System), am, bce, eo, km, msgr, xenl, xon, cols#80, it#8, lines#24, acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, cvvis=\E[?25h, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E(B\E)0, flash=\E[?5h\E[?5l, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, is1=\E[?47l\E=\E[?1l, is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l, kDC=\E[3$, kEND=\E[8$, kHOM=\E[7$, kLFT=\E[d, kNXT=\E[6$, kPRV=\E[5$, kRIT=\E[c, ka1=\EOw, ka3=\EOy, kb2=\EOu, kbs=^H, kc1=\EOq, kc3=\EOs, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, kel=\E[8\^, kend=\E[8~, kent=\EOM, kf0=\E[21~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, kfnd=\E[1~, khome=\E[7~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, kslt=\E[4~, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[?47l\E8, rmkx=\E>, rmso=\E[27m, rmul=\E[24m, rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H, rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E>, s0ds=\E(B, s1ds=\E(0, sc=\E7, sgr0=\E[m\017, smacs=^N, smcup=\E7\E[?47h, smkx=\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g, vpa=\E[%i%p1%dd, rxvt|rxvt terminal emulator (X Window System), colors#8, pairs#64, op=\E[39;49m, setab=\E[%p1%{40}%+%dm, setaf=\E[%p1%{30}%+%dm, use=rxvt-basic, rxvt-2.7.10/doc/etc/rxvt.termcap010064400001440000024000000017760726430321700151560ustar gcwstaffrxvt|rxvt terminal emulator (X Window System):\ :am:eo:km:ms:ut:xn:xo:\ :co#80:it#8:li#24:Co#8:pa#64:\ :AB=\E[4%dm:AF=\E[3%dm:AL=\E[%dL:\ :DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\ :K1=\EOw:K2=\EOu:K3=\EOy:K4=\EOq:K5=\EOs:LE=\E[%dD:\ :RI=\E[%dC:UP=\E[%dA:\ :ae=^O:al=\E[L:as=^N:bl=^G:cd=\E[J:\ :ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:\ :cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:\ :ho=\E[H:i1=\E[?47l\E=\E[?1l:ic=\E[@:\ :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\ :k0=\E[21~:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:\ :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\ :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:kd=\E[B:ke=\E>:\ :kl=\E[D:kr=\E[C:ks=\E=:ku=\E[A:le=^H:mb=\E[5m:\ :md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:op=\E[m:rc=\E8:sc=\E7:\ :se=\E[27m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:\ :te=\E[?47l\E8:ti=\E7\E[?47h:ue=\E[24m:up=\E[A:us=\E[4m:\ :vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:vs=\E[?25h:\ :@7=\E[8~:kh=\E[7~: # When compiled with LINUX_KEYS the last line becomes # :@7=\E[4~:kh=\E[1~: rxvt-2.7.10/doc/menu004075500001440000024000000000000764024425100127005ustar gcwstaffrxvt-2.7.10/doc/menu/jedmenu.sl010064400001440000024000000056700651657463600147710ustar gcwstaff%--------------------------------*-SLang-*-------------------------------- % An example of using the rxvt menuBar for the JED editor #if$TERM xterm* %!% provide a hook to imitated the S-Lang> prompt %!% use ESC[m to shadow the ESC[M used by mouse reporting define menuFn () { variable ch, cmd; cmd = Null_String; forever { ch = getkey (); if (ch == '\r') break; cmd = strcat (cmd, char (ch)); } eval (cmd); } local_setkey ("menuFn", "\e[m"); % menu %!% allow the user to bind their owm commands define menucmd (str) { tt_send (Sprintf ("\e]10;%s\a", str, 1)); } %------------------------------------------------------------------------- % integrate these with any existing suspend/resume/exit hooks % the suspend hook works best if there was already a menu defined % before invoking JED define suspend_hook () { menucmd ("[prev]"); } define resume_hook () { menucmd ("[next]"); } define exit_hook () { menucmd ("[rm]"); exit_jed (); } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% menucmd ("[read:jedmenu.sl]"); % read this file % format _jed_version xyyzz into x.yy-zz menucmd (Sprintf ("[:[title:Jed%d.%d-%d (%%n-%%v)]:]", (_jed_version/10000), ((_jed_version mod 10000)/100), (_jed_version mod 100), 3)); % get rid off pixmap stuff if (strcmp (getenv ("COLORTERM"), "rxvt-xpm")) { menucmd ("[menu][:-/Terminal/Pixmap:][show]"); } #endif % xterm* %%%%%%%%%%%%%%%%%%%%%%%%%%% end-of-file (SLang) %%%%%%%%%%%%%%%%%%%%%%%%%% % rxvt menu database #iffalse % An example of using the rxvt menuBar for the JED editor % possibly useful things for the JED editor -- assuming Emacs bindings [menu:jed] [title:Jed menu (%n-%v)] % some convenient arrows \E[mbskip_wordbackward_paragraphforward_paragraphskip_word\r /File/* {Open}{^X^F} {Save}{^X^W} {Save Buffers}{^Xs} {Insert File}{^Xi} {-} {Shell Cmd}{M-!} {-} {Exit}{^X^C} /Edit/* {Undo}{^_} {-} {Cut}{^W} {Copy}{M-W} {Paste}{^Y} /Search/* {Forward}{^S} {Backward}{^R} {Replace}{M-%} {-} ./Regexp/* {Forward}{M-^S} {Backward}{M-^R} {Replace} \E[mquery_replace_match\r /Buffers/* {Kill}{^Xk} {List}{^X^B} {Switch}{^Xb} {-} ./Modes/* {C} \E[mc_mode\r {SLang} \E[mslang_mode\r {None} \E[mno_mode\r {LaTeX} \E[mlatex_mode\r {Text} \E[mtext_mode\r {Fortran} \E[mfortran_mode\r /Window/* {Delete}{^X0} {One}{^X1} {Split}{^X2} {Other}{^Xo} {-} {Recenter}{^L} {-} ./Color Schemes/* {White-on-Black} \E[mset_color_scheme("15;0")\r {Black-on-White} \E[mset_color_scheme("0;15")\r {White-on-default-Black}\E[mset_color_scheme("15;default;0")\r {Black-on-default-White}\E[mset_color_scheme("0;default;15")\r /Utils/* {Bufed} \E[mbufed\r {Dired} \E[mdired\r {Mail} \E[mmail\r {Rmail} \E[mrmail\r {-} {EvalBuffer} \E[mevalbuffer\r {Trim-Buffer} \E[mtrim_buffer\r [read:terminal] /?/* {Info}{^X?i} {Man}{^X?m} {-} {Apropos}{^X?a} {Show Key}{^X?k} {Where Is}{^X?w} [show] [done] #endif %%%%%%%%%%%%%%%%%%%%%%%%%%% end-of-file (SLang) %%%%%%%%%%%%%%%%%%%%%%%%%% rxvt-2.7.10/doc/menu/terminal.menu010075500001440000024000000023330651657464000154720ustar gcwstaff# standard settings for a `terminal' control menu # only attach to an existing menubar [menu] /Terminal/* ./Font/* {Normal} ^@\E]50;# {Larger} ^@\E]50;#+ {Smaller} ^@\E]50;#- {-} {Font 1} ^@\E]50;#1 {Font 2} ^@\E]50;#2 {Font 3} ^@\E]50;#3 {Font 4} ^@\E]50;#4 ../Screen/* {ReverseVideo} ^@\E[?5t {Toggle Width} ^@\E[?3t {Cursor} ^@\E[?25t {Switch} ^@\E[?47t {-} {menuBar} ^@\E[?10t {refresh menu} ^@\E[?10h {scrollBar} ^@\E[?30t {-} {Toggle scroll-on-TTY} ^@\E[?1010t {Toggle scroll-on-Key} ^@\E[?1011t ../Keys/* {XTerm} ^@\E[?35t {Backspace} ^@\E[?67t {Cursor} ^@\E[?1t {KeyPad} ^@\E[?66t ../ {-} ./Pixmap/* {None} ^@\E[m\E]20;\a {-} # load .xpm files (assuming Rxvt*path: has been properly set) # notice there are 2 ways to do this task {background5} ^@\E]20;background5 {Mona} ^@\E]10;[pixmap:monalisa;100] {-} ./Attrib/* {Full} ^@\E]20;;100x100+50+50;? {Tiled} ^@\E]20;;0 {Centre} ^@\E]20;;=+50+50;? {-} # set `quick arrow' keys {Zoom}{200/50%} ^@\E]10;[:\^@\\E]20;;200x050x00x2000x50;?:] {Pos}{5%} ^@\E]10;[:\^@\\E]20;;+5+0-5+0+0-5+0+5;?:] ../ ../ {-} {Version} ^@\E[8n / # make sure the change gets updated [show] [done] #--------------------------------------------------------------------- eof rxvt-2.7.10/doc/menu/rxvt.zh-menu010064400001440000024000000067360703453135000152740ustar gcwstaff#------------------------------------------------------------------------- [menu:big5] #[menu:machine2] [clear] # [pixmap:machine2.xpm] /¿ï³æ/* {½s¿è} ${EDITOR:-vi}\r {¦C¥X¥Ø¿ý} ls -la|${PAGER:-more}\r #{Dir-Time} ls -lat|${PAGER:-more}\r {ºÏºÐªÅ¶¡} df\r {-} {Ãö³¬ Ctrl-D} exit\r /¤u§@/* {Top} top\r {Ps u} ps aux|egrep $USER|${PAGER:-more}\r {Ps aux} ps aux|egrep -v "(root|ps)"|${PAGER:-more}\r # who's REALLY logged on (even with utmp logging turned off) {Who} w\r {-} {­I´º} ^Z bg\r {²×µ²} ^C\r # standard settings for a `terminal' control menu # only attach to an existing menubar /²×ºÝ¾÷/* ./¦r«¬ /* {¥¿±`} ^@\E]50;# {¸û¤j} ^@\E]50;#+ {¸û¤p} ^@\E]50;#- {-} {¦r«¬ 1} ^@\E]50;#1 {¦r«¬ 2} ^@\E]50;#2 {¦r«¬ 3} ^@\E]50;#3 {¦r«¬ 4} ^@\E]50;#4 {¦r«¬ 5} ^@\E]50;#5 {¦r«¬ 6} ^@\E]50;#6 ../¿Ã¹õ/* {­I´º¤ÏÂà} ^@\E[?5t #{Toggle Width} ^@\E[?3t {´å¼Ð} ^@\E[?25t {¤Á´«} ^@\E[?47t {-} {ÁôÂÃ¿ï³æ} ^@\E[?10t {§ó·s¿ï³æ} ^@\E[?10h {¤Á´«±²¶b} ^@\E[?30t #{-} #{Toggle scroll-on-TTY} ^@\E[?1010t #{Toggle scroll-on-Key} ^@\E[?1011t ../Áä½L /* {XTerm} ^@\E[?35t {Backspace} ^@\E[?67t {Cursor} ^@\E[?1t {KeyPad} ^@\E[?66t ../ {-} ./­I´º /* {µL} ^@\E[m\E]20;\a {-} # load .xpm files (assuming Rxvt*path: has been properly set) # notice there are 2 ways to do this task {background5} ^@\E]20;background5 {Mona} ^@\E]10;[pixmap:monalisa;100] {-} ./ÄÝ©Ê /* {©ñ¤j} ^@\E]20;;100x100+50+50;? {¨Ã¦C} ^@\E]20;;0 {¤¤¥¡} ^@\E]20;;=+50+50;? {-} # set `quick arrow' keys {¦ùÁY}{200/50%} ^@\E]10;[:\^@\\E]20;;200x050x00x2000x50;?:] #{Pos}{5%} ^@\E]10;[:\^@\\E]20;;+5+0-5+0+0-5+0+5;?:] ../ ../ {-} {ª©¥»} ^@\E[8n / [show] #[done:machine2] [done:big5] #--------------------------------------------------------------------- eof #------------------------------------------------------------------------- [menu:gb] #[menu:machine2] [clear] # [pixmap:machine2.xpm] /Ñ¡µ¥/* {±à¼­} ${EDITOR:-vi}\r {ÁгöĿ¼} ls -la|${PAGER:-more}\r #{Dir-Time} ls -lat|${PAGER:-more}\r {´Åµú¿Õ¼ä} df\r {-} {¹Ø±Õ Ctrl-D} exit\r /¹¤×÷/* {Top} top\r {Ps u} ps aux|egrep $USER|${PAGER:-more}\r {Ps aux} ps aux|egrep -v "(root|ps)"|${PAGER:-more}\r # who's REALLY logged on (even with utmp logging turned off) {Who} w\r {-} {±³¾°} ^Z bg\r {ÖÕ½á} ^C\r # standard settings for a `terminal' control menu # only attach to an existing menubar /ÖÕ¶Ë»ú/* ./×ÖÐÍ /* {Õý³£} ^@\E]50;# {½Ï´ó} ^@\E]50;#+ {½ÏС} ^@\E]50;#- {-} {×ÖÐÍ 1} ^@\E]50;#1 {×ÖÐÍ 2} ^@\E]50;#2 {×ÖÐÍ 3} ^@\E]50;#3 {×ÖÐÍ 4} ^@\E]50;#4 {×ÖÐÍ 5} ^@\E]50;#5 {×ÖÐÍ 6} ^@\E]50;#6 ../Ó©Ä»/* {±³¾°·´×ª} ^@\E[?5t #{Toggle Width} ^@\E[?3t {Óαê} ^@\E[?25t {Çл»} ^@\E[?47t {-} {Òþ²ØÑ¡µ¥} ^@\E[?10t {¸üÐÂÑ¡µ¥} ^@\E[?10h {Çл»¾íÖá} ^@\E[?30t #{-} #{Toggle scroll-on-TTY} ^@\E[?1010t #{Toggle scroll-on-Key} ^@\E[?1011t ../¼üÅÌ /* {XTerm} ^@\E[?35t {Backspace} ^@\E[?67t {Cursor} ^@\E[?1t {KeyPad} ^@\E[?66t ../ {-} ./±³¾° /* {ÎÞ} ^@\E[m\E]20;\a {-} # load .xpm files (assuming Rxvt*path: has been properly set) # notice there are 2 ways to do this task {background5} ^@\E]20;background5 {Mona} ^@\E]10;[pixmap:monalisa;100] {-} ./ÊôÐÔ /* {·Å´ó} ^@\E]20;;100x100+50+50;? {²¢ÁÐ} ^@\E]20;;0 {ÖÐÑë} ^@\E]20;;=+50+50;? {-} # set `quick arrow' keys {ÉìËõ}{200/50%} ^@\E]10;[:\^@\\E]20;;200x050x00x2000x50;?:] #{Pos}{5%} ^@\E]10;[:\^@\\E]20;;+5+0-5+0+0-5+0+5;?:] ../ ../ {-} {°æ±¾} ^@\E[8n / [show] #[done:machine2] [done:gb] #--------------------------------------------------------------------- eof rxvt-2.7.10/doc/menu/rxvt.menu010075500001440000024000000044710651657464000146670ustar gcwstaff#!/bin/sh -- # an example of having different menus (even different pixmaps) # show up depending on the machine you are rlogin/telnet connecting to menu="$0" # or any convenient database exe="../../src/rxvt" # default program to execute # exe="/usr/local/bin/rxvt-2.21" # default program to execute if test $# -gt 0; then # if first argument contains "rxvt" use that instead case $1 in *rxvt*) exe="$1" shift;; esac fi while [ $# -gt 0 ] do case $1 in -h) # give usage echo " Usage: `basename $0` [rxvt-prgm] [options] start rxvt and load a menu corresponding to \"machine\" if the option -e {rlogin|telnet|tn3270} Machine.Domain ... was used" exit ;; # don't bother if we've already set it -menu) break;; # don't bother if we've already set it -e) if test $# -ge 3; then case $2 in # try to find menu for these cases *rlogin | *telnet | *tn3270) # strip domain & convert case mach=`echo $3 | sed -e 's/\..*$//' | tr [A-Z] [a-z]` if test ! -z "$mach"; then found=`egrep "^\[menu:$mach\]" $menu` if test ! -z "$found"; then mach="$menu;$mach" exe="$exe -menu $mach" fi fi ;; esac fi break ;; *) exe="$exe $1" ;; esac shift done # echo "$exe $@" $exe $@ & exit # stop shell here! #------------------------------------------------------------------------- [menu:weber] #[menu:machine1] [clear] # [pixmap:machine1.xpm] /Programs/* {Edit} ${EDITOR:-vi}\r {Mail} Mail\r {News} News\r {-} {Exit} exit\r /Jobs/* {Top} top\r {Ps u} ps aux|egrep ^$USER {Ps aux} ps aux|egrep -v "(root|ps)" # who's REALLY logged on (even with utmp logging turned off) {Who} ps aux|egrep "\-bash"|egrep -v "grep" {-} {Background} ^Z bg\r {Kill} ^C\r /Misc/* {Dir} ls -la|${PAGER:-more}\r {Dir-Time} ls -lat|${PAGER:-more}\r {Space Left} df\r [read:terminal] [show] #[done:machine1] [done:weber] #------------------------------------------------------------------------- [menu:conn] #[menu:machine2] [clear] # [pixmap:machine2.xpm] /Programs/* {Edit} ${EDITOR:-vi}\r {Checkmail} checkmail\r {Dir} ls -la|${PAGER:-more}\r {Dir-Time} ls -lat|${PAGER:-more}\r {Space Left} df\r {-} {Exit} exit\r /Jobs/* {Background} ^Z bg\r {Kill} ^C\r [read:terminal] [show] #[done:machine2] [done:conn] #--------------------------------------------------------------------- eof rxvt-2.7.10/doc/menu/example.menu010075500001440000024000000031030651657463500153120ustar gcwstaffThis example illustrates how several menus could be combined together command = "[read:example]" read the file starting at "[menu]" or "[menu:???]" and continue until it "[done]" command = "[read:example;pico]" or "[read:example;shell]" read the file starting at "[menu:pico]" or "[menu:shell]", respectively and continue until "[done:pico]" or [done:shell]", respectively. #------------------------------------------------------------------------- [menu:pico] [clear] [title:Pico (%n-%v)] # a menu for the pico editor # mostly a demonstration, I don't know why anyone would need it # Prior/Next & Home/End are messed up ^A^E^Y^V /File/* {Insert File}{^R} {Save As}{^O} {-} {Suspend}{^Z} {Exit}{^X} /Edit/* {Find}{^W} {-} {Del Char}{^D} {Mark}{^^} {Kill Line}{^K} {Paste}{^U} /Basics/* {Forward}{^F} {Backward}{^B} {-} {Prev}{^P} {Next}{^N} {-} {Beg-of-Line}{^A} {End-of-Line}{^E} {-} {Prev Page}{^Y} {Next Page}{^V} /Buffer/* {Reformat}{^J} {Position}{^C} {Refresh}{^L} {Spell}{^T} [read:terminal] /?/* {Help}{^G} [show] [done:pico] #------------------------------------------------------------------------- [menu:shell] [clear] [title:shell] # [pixmap:name] # not necessarily useful, but an example of using the rxvt menuBar # assuming we have ksh with Emacs bindings ^P^N^F^B /Programs/* {Edit} ${EDITOR:-vi}\r {Mail} Mail\r {News} slrn\r {Rxvt-News} rxvt -e slrn& {Commander} mc\r /Shell/{finger} finger\r {.name} invisible label! / [read:terminal] [show] [done:shell] #--------------------------------------------------------------------- eof rxvt-2.7.10/doc/menu/menu010075500001440000024000000032040651657463700136640ustar gcwstaff#!/bin/sh -- # shell wrapper to avoid typing Menu escape sequences if test $# -eq 0; then echo "\ usage: `basename $0` cmd where the most common commands are [menu] [menu:name] [read:file] [read:file;name] [title:string] +/path/menu +/path/menu/* +/menu/path/{-} +/menu/path/{item}{rtext} action -/* -/path/menu -/path/menu/* -/path/{-} -/path/{item} BeginRightLeftUpDownEnd [done] [rm] [rm:] [rm*] [rm:*] [rm:name] [swap] [prev] [next] [clear] [show] [hide] [pixmap:file] [dump] NB: commands may need to be quoted to avoid shell expansion " exit fi Echo="echo -n" # some systems/shells don't like `echo -n' case `/bin/uname` in SunOS) Echo="echo";; esac while [ $# -gt 0 ] do case $1 in +* | -* | '<'* | '['*) # send raw commands $Echo "]10;$1" ;; *) # read in menu files if test $1 = "default"; then $Echo "]10;[read:$0]" else $Echo "]10;[read:$1]" fi if test "$COLORTERM" != "rxvt-xpm"; # remove pixmap stuff then $Echo "]10;[menu][:-/Terminal/Pixmap:][show]" fi ;; esac shift done exit # stop shell here! #------------------------------------------------------------------------- # since everything before a [menu] tag is ignored, we can put a default # menu here #------------------------------------------------------------------------- [menu:default] /Programs/* {Edit} ${EDITOR:-vi}\r {Top} top\r {Dir} ls -la|${PAGER:-more}\r {Dir-Time} ls -lat|${PAGER:-more}\r {Space Left} df\r {-} {Exit} exit\r /Shell/* {check mail} checkmail\r {Background} ^Z bg\r {Kill} ^C\r [show] [done] #--------------------------------------------------------------------- eof rxvt-2.7.10/doc/yodl004075500001440000024000000000000764024425100127035ustar gcwstaffrxvt-2.7.10/doc/yodl/masonyodl.yo010064400001440000024000000100750651657404400153470ustar gcwstaffCOMMENT(-- $Id: masonyodl.yo,v 1.2 1998/04/20 07:24:20 mason Exp $ --) COMMENT(----------------------------------------------------------------------- -- We want more functionality and some better layout -- proto changes: -- starttable(nColumns)(Alignment)(borderwidth) ------------------------------------------------------------------------------) NEWCOUNTER(RRindentlevel) NEWCOUNTER(RRnl) SETCOUNTER(RRindentlevel)(0) \ DEFINEMACRO(nltxt)(0)(\ IFZERO(RRnl)()( ADDTOCOUNTER(RRnl)(-1)nltxt())) \ UNDEFINEMACRO(XXnl) DEFINEMACRO(XXnl)(0)(\ NOTRANS( )\ whentxt(SETCOUNTER(RRnl)(RRindentlevel)nltxt())) \ DEFINEMACRO(P)(0)(\ SETCOUNTER(RRnl)(0)\ whenhtml(SETCOUNTER(RRnl)(1)htmlcommand(

))\ IFZERO(RRnl)(nl())()) \ UNDEFINEMACRO(starttable) DEFINEMACRO(starttable)(3)(\ SETCOUNTER(XXtablewidth)(ARG1)\ whenhtml(IFZERO(ARG3)(htmlcommand())\ (htmlcommand(
))XXnl())\ whenlatex(latexcommand(\begin{tabular}{)ARG2+latexcommand(}))\ whenman(roffcmd(.TS)()()())\ whenman(IFZERO(ARG3)(roffcmd(tab(`);)()()())\ (roffcmd(allbox,tab(`);)()()()))\ whenman(ARG2 NOTRANS(. ))\ whenms(roffcmd(.TS)()()())\ whenms(IFZERO(ARG3)(roffcmd(tab(`);)()()())\ (roffcmd(allbox,tab(`);)()()()))\ whenms(ARG2+mscommand(.))\ SETCOUNTER(XXtablewidth)(ARG1)\ SETCOUNTER(XXparcounter)(0)) COMMENT( For HTML, we'll need
, for LaTeX we'll need \begin{tabular}{alignment}. Also, we don't want paragraph delimiters.) \ UNDEFINEMACRO(cell) DEFINEMACRO(cell)(1)(\ ADDTOCOUNTER(XXtableline)(1)\ whenhtml(htmlcommand() XXnl())\ whenlatex(ARG1 \ IFZERO(XXcellcounter)\ ()(latexcommand( & )))\ whentxt( ARG1 )\ whenms( ARG1 )\ IFZERO(XXcellcounter)\ ()\ (mscommand(`\))\ whenman( ARG1 )\ IFZERO(XXcellcounter)\ ()\ (mancommand(`\))\ ADDTOCOUNTER(XXcellcounter)(-1)) COMMENT(For HTML we need: , so that's fairly easy. If we're already at the last cell, we need . For LaTeX: we need text followed by &, unless we're already at the last cell 'cuz in that case we need only text. Also we need to decrement the cell counter..) \ UNDEFINEMACRO(cells) DEFINEMACRO(cells)(2)(\ ADDTOCOUNTER(XXtableline)(ARG1)\ ADDTOCOUNTER(XXcellcounter)(-ARG1)\ ADDTOCOUNTER(XXcellcounter)(1)\ whenhtml(htmlcommand() XXnl())\ whenlatex(\ latexcommand(\multicolumn{)ARG1+latexcommand(}{c}{)ARG2+latexcommand(})\ IFZERO(XXcellcounter)\ ()(latexcommand( & )))\ whentxt( ARG1 )\ whenms( ARG1 )\ IFZERO(XXcellcounter)\ ()\ (mscommand(`\))\ whenman( ARG1 )\ IFZERO(XXcellcounter)\ ()\ (mancommand(`\))\ ADDTOCOUNTER(XXcellcounter)(-1)) \ DEFINEMACRO(indent)(1)(\ whenhtml(htmlcommand(
    )ARG1+htmlcommand(
))\ whentxt(ADDTOCOUNTER(RRindentlevel)(4)ARG1+ADDTOCOUNTER(RRindentlevel)(-4))\ whenman(roffcmd(.RS)()()()roffcmd(.IP)()()()ARG1+roffcmd(.RE)()()())\ whenms()) \ DEFINEMACRO(startdl)(0)(\ whenhtml(htmlcommand(
))\ whentxt(ADDTOCOUNTER(RRindentlevel)(4))\ whenman(startdit())) \ DEFINEMACRO(enddl)(0)(\ whenhtml(htmlcommand(
))\ whentxt(ADDTOCOUNTER(RRindentlevel)(-4))\ whenman(enddit())) \ DEFINEMACRO(dl)(2)(\ whenhtml(htmlcommand(
)ARG1+htmlcommand(
)\ ARG2+htmlcommand(
))\ whentxt(ADDTOCOUNTER(RRindentlevel)(2)dit(ARG1)\ ADDTOCOUNTER(RRindentlevel)(2)nl()\ ARG2+ADDTOCOUNTER(RRindentlevel)(-4))\ whenman(dit(ARG1)ARG2)) \ DEFINEMACRO(manpageauthors)(0)(\ manpagesection(AUTHORS)\ DEFINESYMBOL(XXmanpageAuthor)) rxvt-2.7.10/doc/yodl/rxvtRef-xterm.yo010064400001440000024000000053260715735701600161420ustar gcwstaffCOMMENT(-- $Id: rxvtRef-xterm.yo,v 1.5 2000/09/12 07:38:28 gcw Exp $ --) COMMENT(OSC: Operating System Commands) label(XTerm) nsect(XTerm Operating System Commands) startdl() dl(bf(tt(ESC ] Ps;Pt ST))) (Set XTerm Parameters nl()\ 8-bit ST: 0x9c, nl()\ 7-bit ST sequence: ESC \ (0x1b, 0x5c), nl()\ backwards compatible terminator BEL (0x07) is also accepted. nl()\ starttable(2)(l l)(0)\ row(cell(bf(tt(Ps = 0)))\ cell(Change Icon Name and Window Title to bf(tt(Pt))))\ row(cell(bf(tt(Ps = 1)))\ cell(Change Icon Name to bf(tt(Pt))))\ row(cell(bf(tt(Ps = 2)))\ cell(Change Window Title to bf(tt(Pt))))\ row(cell(bf(tt(Ps = 4)))\ cell(bf(tt(Pt)) is a semi-colon separated sequence of one \ or more semi-colon separated bf(number)/bf(name) pairs, \ where bf(number) is an index to a colour and bf(name) is \ the name of a colour. Each pair causes the bf(number)ed \ colour to be changed to bf(name). nl()\ Numbers 0-7 corresponds to low-intensity (normal) colours \ and 8-15 corresponds to high-intensity colours. \ 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, \ 6=cyan, 7=white))\ row(cell(bf(tt(Ps = 10)) bf((NB: may change in future)))\ cell(link(menuBar)(menuBar) command bf(tt(Pt)) \ em(rxvt compile-time option)))\ row(cell(bf(tt(Ps = 12)))\ cell(Change colour of text cursor foreground to bf(tt(Pt))))\ row(cell(bf(tt(Ps = 13)))\ cell(Change colour of mouse foreground to bf(tt(Pt))))\ row(cell(bf(tt(Ps = 17)))\ cell(Change colour of highlight characters to bf(tt(Pt))))\ row(cell(bf(tt(Ps = 18)))\ cell(Change colour of bold characters to bf(tt(Pt))))\ row(cell(bf(tt(Ps = 19)))\ cell(Change colour of underlined characters to bf(tt(Pt))))\ row(cell(bf(tt(Ps = 20)))\ cell(Change default background link(pixmap)(XPM) to \ bf(tt(Pt))))\ row(cell(bf(tt(Ps = 39)))\ cell(Change default foreground colour to bf(tt(Pt)) \ em(rxvt compile-time option)))\ row(cell(bf(tt(Ps = 46)))\ cell(Change Log File to bf(tt(Pt)) \ em(unimplemented)))\ row(cell(bf(tt(Ps = 49)))\ cell(Change default background colour to bf(tt(Pt)) \ em(rxvt compile-time option)))\ row(cell(bf(tt(Ps = 50)))\ cell(Set Font to bf(tt(Pt)), with the following special \ values of \ bf(tt(Pt)) (bf(rxvt)) nl()\ bf(tt(#+n)) change up bf(tt(n)) font(s) nl()\ bf(tt(#-n)) change down bf(tt(n)) font(s) nl()\ if bf(tt(n)) is missing of 0, a value of 1 is used nl()\ em(empty) change to font0 nl()\ bf(tt(n)) change to font bf(tt(n))))\ row(cell(bf(tt(Ps = 55)))\ cell(Log all scrollback buffer and all of screen to \ bf(tt(Pt))))\ endtable()) enddl() rxvt-2.7.10/doc/yodl/rxvtRef-xpm.yo010064400001440000024000000022670713056745400156100ustar gcwstaffCOMMENT(-- $Id: rxvtRef-xpm.yo,v 1.7 2000/07/05 08:17:48 gcw Exp $ --) label(XPM) nsect(XPM) For the XPM XTerm escape sequence bf(tt(ESC ] 20 ; Pt ST)) then value of bf(tt(Pt)) can be the name of the background pixmap followed by a sequence of scaling/positioning commands separated by semi-colons. The scaling/positioning commands are as follows: startdl() dl(query scale/position) (bf(?)) P()\ dl(change scale and position) (bf(WxH+X+Y)nl()\ bf(WxH+X) (== bf(WxH+X+X))nl()\ bf(WxH) (same as bf(WxH+50+50))nl()\ bf(W+X+Y) (same as bf(WxW+X+Y))nl()\ bf(W+X) (same as bf(WxW+X+X))nl()\ bf(W) (same as bf(WxW+50+50))) P()\ dl(change position (absolute)) (bf(=+X+Y)nl()\ bf(=+X) (same as bf(=+X+Y))) P()\ dl(change position (relative)) (bf(+X+Y)nl()\ bf(+X) (same as bf(+X+Y))) P()\ dl(rescale (relative)) (bf(Wx0) -> bf(W *= (W/100))nl()\ bf(0xH) -> bf(H *= (H/100))) enddl() For example: startdl() dl(bf(\E]20;funky\a)) (load bf(funky.xpm) as a tiled image) P()\ dl(bf(\E]20;mona;100\a)) (load bf(mona.xpm) with a scaling of 100%) P()\ dl(bf(\E]20;;200;?\a)) (rescale the current pixmap to 200% and display the image geometry in \ the title) enddl() rxvt-2.7.10/doc/yodl/rxvtRef-values.yo010064400001440000024000000017010651657405200162720ustar gcwstaffCOMMENT(-- $Id: rxvtRef-values.yo,v 1.2 1998/04/20 07:24:26 mason Exp $ --) label(Values) nsect(Values) startdl() dl(bf(tt(ENQ))) (Enquiry (Ctrl-E) = Send Device Attributes (DA) nl()\ request attributes from terminal == link(ESC[Psc)(ESCOBPsc)) P()\ dl(bf(tt(BEL))) (Bell (Ctrl-G)) P()\ dl(bf(tt(BS))) (Backspace (Ctrl-H)) P()\ dl(bf(tt(TAB))) (Horizontal Tab (HT) (Ctrl-I)) P()\ dl(bf(tt(LF))) (Line Feed or New Line (NL) (Ctrl-J)) P()\ dl(bf(tt(VT))) (Vertical Tab (Ctrl-K) same as bf(tt(LF))) P()\ dl(bf(tt(FF))) (Form Feed or New Page (NP) (Ctrl-L) same as bf(tt(LF))) P()\ dl(bf(tt(CR))) (Carriage Return (Ctrl-M)) P()\ dl(bf(tt(SO))) (Shift Out (Ctrl-N), invokes the G1 character set. nl()\ Switch to Alternate Character Set) P()\ dl(bf(tt(SI))) (Shift In (Ctrl-O), invokes the G0 character set (the default) nl()\ Switch to Standard Character Set) P()\ dl(bf(tt(SPC))) (Space Character) enddl() rxvt-2.7.10/doc/yodl/rxvtRef-sequences.yo010064400001440000024000000044430651657405100167730ustar gcwstaffCOMMENT(-- $Id: rxvtRef-sequences.yo,v 1.2 1998/04/20 07:24:25 mason Exp $ --) label(Sequences) nsect(Escape Sequences) startdl() dl(bf(tt(ESC # 8))) (DEC Screen Alignment Test (DECALN)) P()\ dl(bf(tt(ESC 7)nl()tt(ESC 8))) (Save Cursor (SC)nl()Restore Cursor)\ P()\ label(ESCequals) dl(bf(tt(ESC =)nl()tt(ESC >))) (Application Keypad (SMKX) == link(tt(ESC[?66h))(Priv66)nl()\ Normal Keypad (RMKX) == link(tt(ESC[?66l))(Priv66))nl()\ bf(Note:) If the numeric keypad is activated, eg, bf(Num_Lock) has been pressed, numbers or control functions are generated by the numeric keypad (see link(Key Codes)(KeyCodes)) P()\ dl(bf(tt(ESC D))) (Index (IND)) P()\ dl(bf(tt(ESC E))) (Next Line (NEL)) P()\ dl(bf(tt(ESC H))) (Tab Set (HTS)) P()\ dl(bf(tt(ESC M))) (Reverse Index (RI)) P()\ dl(bf(tt(ESC N))) (Single Shift Select of G2 Character Set (SS2): affects next character only em(unimplemented)) P()\ dl(bf(tt(ESC O))) (Single Shift Select of G3 Character Set (SS3): affects next character only em(unimplemented)) P()\ dl(bf(tt(ESC Z))) (Obsolete form of link(tt(ESC[c))(ESCOBPsc) nl()\ returns: bf(tt(ESC[?1;2C)) em(rxvt compile-time option)) P()\ dl(bf(tt(ESC c))) (Full reset (RIS)) P()\ dl(bf(tt(ESC n))) (Invoke the G2 Character Set (LS2)) P()\ dl(bf(tt(ESC o))) (Invoke the G3 Character Set (LS3)) P()\ dl(bf(tt(ESC )CHAR(40)tt( C)nl()tt(ESC )CHAR(41)tt( C)nl()tt(ESC * C)nl()\ tt(ESC + C)nl()tt(ESC $ C))) (Designate G0 Character Set (ISO 2022)nl()\ Designate G1 Character Set (ISO 2022)nl()\ Designate G2 Character Set (ISO 2022)nl()\ Designate G3 Character Set (ISO 2022)nl()\ Designate Kanji Character Set nl()\ em(where) bf(tt(C)) is nl()\ starttable(2)(l l)(0)\ row(cell(bf(tt(C = 0)))\ cell(DEC Special Character and Line Drawing Set))\ row(cell(bf(tt(C = A)))\ cell(United Kingdom (UK)))\ row(cell(bf(tt(C = B)))\ cell(United States (USASCII)))\ row(cell(bf(tt(C = <)))\ cell(Multinational character set em(unimplemented)))\ row(cell(bf(tt(C = 5)))\ cell(Finnish character set em(unimplemented)))\ row(cell(bf(tt(C = C)))\ cell(Finnish character set em(unimplemented)))\ row(cell(bf(tt(C = K)))\ cell(German character set em(unimplemented)))\ endtable()) enddl() rxvt-2.7.10/doc/yodl/rxvtRef-privatemodes.yo010064400001440000024000000154510763177143400175060ustar gcwstaffCOMMENT(-- $Id: rxvtRef-privatemodes.yo,v 1.5 2003/03/07 01:09:30 gcw Exp $ --) label(PrivateModes) nsect(DEC Private Modes) startdl() dl(bf(tt(ESC [ ? Pm h))) (DEC Private Mode Set (DECSET)) P()\ dl(bf(tt(ESC [ ? Pm l))) (DEC Private Mode Reset (DECRST)) P()\ dl(bf(tt(ESC [ ? Pm r))) (Restore previously saved DEC Private Mode Values.) P()\ dl(bf(tt(ESC [ ? Pm s))) (Save DEC Private Mode Values.) P()\ dl(bf(tt(ESC [ ? Pm t))) (Toggle DEC Private Mode Values (rxvt extension).) em(where) nl()\ startdl() dl(bf(tt(Ps = 1)) (DECCKM)) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Application Cursor Keys))\ row(cell(bf(tt(l)))cell(Normal Cursor Keys))\ endtable()) dl(bf(tt(Ps = 2)) (ANSI/VT52 mode)) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Enter VT52 mode))\ row(cell(bf(tt(l)))cell(Enter VT52 mode))\ endtable()) dl(bf(tt(Ps = 3))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(132 Column Mode (DECCOLM)))\ row(cell(bf(tt(l)))cell(80 Column Mode (DECCOLM)))\ endtable()) dl(bf(tt(Ps = 4))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Smooth (Slow) Scroll (DECSCLM)))\ row(cell(bf(tt(l)))cell(Jump (Fast) Scroll (DECSCLM)))\ endtable()) dl(bf(tt(Ps = 5))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Reverse Video (DECSCNM)))\ row(cell(bf(tt(l)))cell(Normal Video (DECSCNM)))\ endtable()) dl(bf(tt(Ps = 6))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Origin Mode (DECOM)))\ row(cell(bf(tt(l)))cell(Normal Cursor Mode (DECOM)))\ endtable()) dl(bf(tt(Ps = 7))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Wraparound Mode (DECAWM)))\ row(cell(bf(tt(l)))cell(No Wraparound Mode (DECAWM)))\ endtable()) dl(bf(tt(Ps = 8)) em(unimplemented)) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Auto-repeat Keys (DECARM)))\ row(cell(bf(tt(l)))cell(No Auto-repeat Keys (DECARM)))\ endtable()) dl(bf(tt(Ps = 9)) X10 XTerm link(mouse reporting)(Mouse)) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Send Mouse X & Y on button press.))\ row(cell(bf(tt(l)))cell(No mouse reporting.))\ endtable())\ label(Priv10) dl(bf(tt(Ps = 10)) (bf(rxvt))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(link(menuBar)(menuBar) visible))\ row(cell(bf(tt(l)))cell(link(menuBar)(menuBar) invisible))\ endtable()) dl(bf(tt(Ps = 25))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Visible cursor {cnorm/cvvis}))\ row(cell(bf(tt(l)))cell(Invisible cursor {civis}))\ endtable()) dl(bf(tt(Ps = 30))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(scrollBar visisble))\ row(cell(bf(tt(l)))cell(scrollBar invisisble))\ endtable()) dl(bf(tt(Ps = 35)) (bf(rxvt))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Allow XTerm Shift+key sequences))\ row(cell(bf(tt(l)))cell(Disallow XTerm Shift+key sequences))\ endtable()) dl(bf(tt(Ps = 38)) em(unimplemented)) (Enter Tektronix Mode (DECTEK)) dl(bf(tt(Ps = 40))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Allow 80/132 Mode))\ row(cell(bf(tt(l)))cell(Disallow 80/132 Mode))\ endtable()) dl(bf(tt(Ps = 44)) em(unimplemented)) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Turn On Margin Bell))\ row(cell(bf(tt(l)))cell(Turn Off Margin Bell))\ endtable()) dl(bf(tt(Ps = 45)) em(unimplemented)) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Reverse-wraparound Mode))\ row(cell(bf(tt(l)))cell(No Reverse-wraparound Mode))\ endtable()) dl(bf(tt(Ps = 46)) em(unimplemented)) () P()\ dl(bf(tt(Ps = 47))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Use Alternate Screen Buffer))\ row(cell(bf(tt(l)))cell(Use Normal Screen Buffer))\ endtable()) label(Priv66) dl(bf(tt(Ps = 66))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Application Keypad (DECPAM) == \ link(tt(ESC =))(ESCequals)))\ row(cell(bf(tt(l)))cell(Normal Keypad (DECPNM) == \ link(tt(ESC >))(ESCequals)))\ endtable()) dl(bf(tt(Ps = 67))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Backspace key sends bf(tt(BS) \ (DECBKM))))\ row(cell(bf(tt(l)))cell(Backspace key sends bf(tt(DEL))))\ endtable()) dl(bf(tt(Ps = 1000)) (X11 XTerm link(mouse reporting)(Mouse))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Send Mouse X & Y on button press and \ release.))\ row(cell(bf(tt(l)))cell(No mouse reporting.))\ endtable()) dl(bf(tt(Ps = 1001)) (X11 XTerm link(mouse tracking)(Mouse)) \ em(unimplemented)) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Use Hilite Mouse Tracking.))\ row(cell(bf(tt(l)))cell(No mouse reporting.))\ endtable()) dl(bf(tt(Ps = 1010))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Don't scroll to bottom on TTY output))\ row(cell(bf(tt(l)))cell(Scroll to bottom on TTY output))\ endtable()) dl(bf(tt(Ps = 1011))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Scroll to bottom when a key is \ pressed))\ row(cell(bf(tt(l)))cell(Don't scroll to bottom when a key is \ pressed))\ endtable()) dl(bf(tt(Ps = 1047))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Use Alternate Screen Buffer))\ row(cell(bf(tt(l)))cell(Use Normal Screen Buffer - clear \ Alternate Screen Buffer if returning from it))\ endtable()) dl(bf(tt(Ps = 1048))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Save cursor position))\ row(cell(bf(tt(l)))cell(Restore cursor position))\ endtable()) enddl() enddl() rxvt-2.7.10/doc/yodl/rxvtRef-mouse.yo010064400001440000024000000014240651657405100161240ustar gcwstaffCOMMENT(-- $Id: rxvtRef-mouse.yo,v 1.2 1998/04/20 07:24:25 mason Exp $ --) label(Mouse) nsect(Mouse Reporting) startdl() dl(bf(tt(ESC [ M ))) (report mouse position) enddl() The lower 2 bits of bf(tt()) indicate the button: startdl() dl(Button = bf(tt(( - SPACE) & 3))) (0 = Button1 pressed nl()\ 1 = Button2 pressed nl()\ 2 = Button3 pressed nl()\ 3 = button released (X11 mouse report)) enddl() The upper bits of bf(tt()) indicate the modifiers when the button was pressed and are added together (X11 mouse report only): startdl() dl(State = bf(tt(( - SPACE) & 60))) (4 = Shift nl()\ 8 = Meta nl()\ 16 = Control nl()\ 32 = Double Click em((Rxvt extension)) nl()\ Col = bf(tt( - SPACE)) nl()\ Row = bf(tt( - SPACE))) enddl() rxvt-2.7.10/doc/yodl/rxvtRef-menubar.yo010064400001440000024000000227770713056745400164450ustar gcwstaffCOMMENT(-- $Id: rxvtRef-menubar.yo,v 1.4 2000/07/05 08:17:48 gcw Exp $ --) label(menuBar) nsect(menuBar) bf(The exact syntax used is em(almost) solidified.) nl()\ In the menus, bf(DON'T) try to use menuBar commands that add or remove a menuBar. Note that in all of the commands, the bf(em(/path/)) em(cannot) be omitted: use bf(./) to specify a menu relative to the current menu. nsubsect(Overview of menuBar operation) For the menuBar XTerm escape sequence tt(ESC ] 10 ; Pt ST), the syntax of tt(Pt) can be used for a variety of tasks: startit() it()link(Commands)(menuBarCommands) it()link(Adding and accessing menus)(menuBarAdd) it()link(Removing menus)(menuBarRemove) it()link(Quick Arrows)(menuBarArrows) it()link(Command Summary)(menuBarSummary) endit() At the top level is the current menuBar which is a member of a circular linked-list of other such menuBars. The menuBar acts as a parent for the various drop-down menus, which in turn, may have labels, separator lines, menuItems and subMenus. The menuItems are the useful bits: you can use them to mimic keyboard input or even to send text or escape sequences back to rxvt. The menuBar syntax is intended to provide a simple yet robust method of constructing and manipulating menus and navigating through the menuBars. The first step is to use the tag bf([menu:em(name)]) which creates the menuBar called em(name) and allows access. You may now link(add)(menuBarAdd) or link(remove)(menuBarRemove) menus, subMenus, and menuItems. Finally, use the tag bf([done]) to set the menuBar access as bf(readonly) to prevent accidental corruption of the menus. To re-access the current menuBar for alterations, use the tag bf([menu]), make the alterations and then use bf([done]) label(menuBarCommands) nsubsect(Commands) startdl() dl(bf([menu:+em(name)])) (access the named menuBar for creation or alteration. If a new menuBar is created, it is called em(name) (max of 15 chars) and the current menuBar is pushed onto the stack) P()\ dl(bf([menu])) (access the current menuBar for alteration) P()\ dl(bf([title:+em(string)])) (set the current menuBar's title to em(string), which may contain the following format specifiers: nl()\ bf(%%) : literal bf(%) character nl()\ bf(%n) : rxvt name (as per the bf(-name) command-line option) nl()\ bf(%v) : rxvt version) P()\ dl(bf([done])) (set menuBar access as bf(readonly). nl()\ End-of-file tag for bf([read:+em(file)]) operations.) P()\ dl(bf([read:+em(file)])) (read menu commands directly from em(file) (extension ".menu" will be appended if required.) Start reading at a line with bf([menu]) or bf([menu:+em(name)) and continuing until bf([done]) is encountered. Blank and comment lines (starting with bf(#)) are ignored. Actually, since any invalid menu commands are also ignored, almost anything could be construed as a comment line, but this may be tightened up in the future ... so don't count on it!.) P()\ dl(bf([read:+em(file);+em(name)])) (The same as bf([read:+em(file)]), but start reading at a line with bf([menu:+em(name)]) and continuing until bf([done:+em(name)]) or bf([done]) is encountered.) P()\ dl(bf([dump])) (dump all menuBars to the file bf(/tmp/rxvt-PID) in a format suitable for later rereading.) P()\ dl(bf([rm:name]nl()[rm] [rm:]nl()[rm*] [rm:*])) (remove the named menuBar nl()\ remove the current menuBar nl()\ remove all menuBars) P()\ dl(bf([swap])) (swap the top two menuBars) P()\ dl(bf([prev]nl()[next])) (access the previous or next menuBar) P()\ dl(bf([show]nl()[hide])) (control display of the menuBar ... just like link(ESC[?10 h/l)(Priv10)) P()\ dl(bf([pixmap:+em(name)]nl()[pixmap:+em(name);em(scaling)])) (set the background pixmap globally ... just like link(ESC ] 20 ; Pt ST)(XPM) bf(A Future implementation em(may) make this local to the menubar)) P()\ dl(bf([:+em(command):])) (ignore the menu readonly status and issue a em(command) to link(Add/Modify)(menuBarAdd) or link(Remove)(menuBarRemove) a menu or menuitem or change the link(Quick Arrows)(menuBarArrows); a useful shortcut for setting the quick arrows from a menuBar.) enddl() label(menuBarAdd) nsubsect(Adding and accessing menus) The following commands may also be bf(+) prefixed. startdl() dl(bf(/+nl()./+nl()../+nl()../../)) (access menuBar top level nl()\ access current menu level nl()\ access parent menu (1 level up) nl()\ access parent menu (multiple levels up)) dl(bf(em(/path/)menu)) (add/access menu) dl(bf(em(/path/)menu/*)) (add/access menu and clear it if it exists) dl(bf(em(/path/){-})) (add separator) dl(bf(em(/path/){item})) (add bf(item) as a label) dl(bf(em(/path/){item} action)) (add/alter em(menuitem) with an associated em(action)) dl(bf(em(/path/){item}{right-text})) (add/alter em(menuitem) with bf(right-text) as the right-justified text and as the associated em(action)) dl(bf(em(/path/){item}{rtext} action)) (add/alter em(menuitem) with an associated em(action) and with bf(rtext) as the right-justified text.) enddl() startdl() dl(Special characters in em(action) must be backslash-escaped:) (bf(\a \b \E \e \n \r \t \octal)) dl(or in control-character notation:) (bf(^@, ^A .. ^Z .. ^_, ^?)) enddl() To send a string starting with a bf(NUL) (bf(^@)) character to the program, start em(action) with a pair of bf(NUL) characters (bf(^@^@)), the first of which will be stripped off and the balance directed to the program. Otherwise if em(action) begins with bf(NUL) followed by non-+bf(NUL) characters, the leading bf(NUL) is stripped off and the balance is sent back to rxvt. As a convenience for the many Emacs-type editors, em(action) may start with bf(M-) (eg, bf(M-$) is equivalent to bf(\E$)) and a bf(CR) will be appended if missed from bf(M-x) commands. As a convenience for issuing XTerm bf(ESC]) sequences from a menubar (or quick arrow), a bf(BEL) (bf(^G)) will be appended if needed. startdl() dl(For example,) (bf(M-xapropos) is equivalent to bf(\Exapropos\r)) dl(and) (bf(\E]10;mona;100) is equivalent to bf(\E]10;mona;100\a)) enddl() The option bf({em(right-rtext)}) will be right-justified. In the absence of a specified action, this text will be used as the em(action) as well. startdl() dl(For example,) (bf(/File/{Open}{^X^F}) is equivalent to bf(/File/{Open}{^X^F} ^X^F)) enddl() The left label em(is) necessary, since it's used for matching, but implicitly hiding the left label (by using same name for both left and right labels), or explicitly hiding the left label (by preceeding it with a dot), makes it possible to have right-justified text only. startdl() dl(For example,) (bf(/File/{Open}{Open} Open-File-Action)) dl(or hiding it) (bf(/File/{.anylabel}{Open} Open-File-Action)) enddl() label(menuBarRemove) nsubsect(Removing menus) startdl() dl(bf(-/*+nl()-+em(/path)menu+nl()-+em(/path){item}+nl()-+em(/path){-})) (remove all menus from the menuBar, the same as bf([clear])nl()\ remove menu nl()\ remove item nl()\ remove separator) dl(bf(-/path/menu/*)) (remove all items, separators and submenus from menu) enddl() label(menuBarArrows) nsubsect(Quick Arrows) The menus also provide a hook for em(quick arrows) to provide easier user access. If nothing has been explicitly set, the default is to emulate the curror keys. The syntax permits each arrow to be altered individually or all four at once without re-entering their common beginning/end text. For example, to explicitly associate cursor actions with the arrows, any of the following forms could be used: startdl() dl(bf(+em(Right)nl()+em(Left)nl()+em(Up)nl()+em(Down))) (Define actions for the respective arrow buttons) dl(bf(+em(Begin)nl()+em(End))) (Define common beginning/end parts for em(quick arrows) which used in conjunction with the above constructs) enddl() startdl() dl(For example, define arrows individually,) (bf(\E[A nl()\ \E[B nl()\ \E[C nl()\ \E[D)) dl(or all at once) (bf(\E[A\E[B\E[C\E[D)) dl(or more compactly (factoring out common parts)) (bf(\E[ABCD)) enddl() label(menuBarSummary) nsubsect(Command Summary) A short summary of the most em(common) commands: startdl() dl([menu:name]) (use an existing named menuBar or start a new one) dl([menu]) (use the current menuBar) dl([title:string]) (set menuBar title) dl([done]) (set menu access to readonly and, if reading from a file, signal EOF) dl([done:name]) (if reading from a file using [read:file;name] signal EOF) dl([rm:name]+nl()[rm] [rm:]+nl()[rm*] [rm:*]) (remove named, current, or all menuBar(s)) dl([swap]) (swap top two menuBars) dl([prev]+nl()[next]) (access the previous/next menuBar) dl([show]+nl()[hide]) (map/unmap menuBar) dl([pixmap;file]+nl()[pixmap;file;scaling]) (set a background pixmap) dl([read:file]+nl()[read:file;name]) (read in a menu from a file) dl([dump]) (dump out all menuBars to /tmp/rxvt-PID) dl(/) (access menuBar top level) dl(./+nl()../+nl()../../) (access current or parent menu level) dl(/path/menu) (add/access menu) dl(/path/{-}) (add separator) dl(/path/{item}{rtext} action) (add/alter menu item+nl()({rtext} and/or action, may be omitted)) dl(-/*) (remove all menus from the menuBar) dl(-/path/menu) (remove menu items, separators and submenus from menu) dl(-/path/menu) (remove menu) dl(-/path/{item}) (remove item) dl(-/path/{-}) (remove separator) dl(BeginRightLeftUpDownEnd) (menu quick arrows) enddl() rxvt-2.7.10/doc/yodl/rxvtRef-keycodes.yo010064400001440000024000000141720651657405000166050ustar gcwstaffCOMMENT(-- $Id: rxvtRef-keycodes.yo,v 1.2 1998/04/20 07:24:24 mason Exp $ --) label(KeyCodes) nsect(Key Codes) Note: bf(Shift) + bf(F1)-bf(F10) generates bf(F11)-bf(F20) For the keypad, use bf(Shift) to temporarily override Application-Keypad setting use bf(Num_Lock) to toggle Application-Keypad setting if bf(Num_Lock) is off, link(escape sequences)(ESCequals) toggle Application-Keypad setting. Also note that values of bf(Home), bf(End), bf(Delete) may have been compiled differently on your system. COMMENT(-- Edited in a wide window --) starttable(5)(l l l l l)(1)\ row(cell( )cell(bf(Normal) )cell(bf(Shift) )cell(bf(Control) )cell(bf(Ctrl+Shift)))\ row(cell(Tab )cell(^I )cell(ESC [ Z )cell(^I )cell(ESC [ Z))\ row(cell(BackSpace )cell(^H )cell(^? )cell(^? )cell(^?))\ row(cell(Find )cell(ESC [ 1 ~ )cell(ESC [ 1 $ )cell(ESC [ 1 ^ )cell(ESC [ 1 @))\ row(cell(Insert )cell(ESC [ 2 ~ )cell(em(paste) )cell(ESC [ 2 ^ )cell(ESC [ 2 @))\ row(cell(Execute )cell(ESC [ 3 ~ )cell(ESC [ 3 $ )cell(ESC [ 3 ^ )cell(ESC [ 3 @))\ row(cell(Select )cell(ESC [ 4 ~ )cell(ESC [ 4 $ )cell(ESC [ 4 ^ )cell(ESC [ 4 @))\ row(cell(Prior )cell(ESC [ 5 ~ )cell(em(scroll-up) )cell(ESC [ 5 ^ )cell(ESC [ 5 @))\ row(cell(Next )cell(ESC [ 6 ~ )cell(em(scroll-down))cell(ESC [ 6 ^ )cell(ESC [ 6 @))\ row(cell(Home )cell(ESC [ 7 ~ )cell(ESC [ 7 $ )cell(ESC [ 7 ^ )cell(ESC [ 7 @))\ row(cell(End )cell(ESC [ 8 ~ )cell(ESC [ 8 $ )cell(ESC [ 8 ^ )cell(ESC [ 8 @))\ row(cell(Delete )cell(ESC [ 3 ~ )cell(ESC [ 3 $ )cell(ESC [ 3 ^ )cell(ESC [ 3 @))\ row(cell(F1 )cell(ESC [ 11 ~ )cell(ESC [ 23 ~ )cell(ESC [ 11 ^ )cell(ESC [ 23 ^))\ row(cell(F2 )cell(ESC [ 12 ~ )cell(ESC [ 24 ~ )cell(ESC [ 12 ^ )cell(ESC [ 24 ^))\ row(cell(F3 )cell(ESC [ 13 ~ )cell(ESC [ 25 ~ )cell(ESC [ 13 ^ )cell(ESC [ 25 ^))\ row(cell(F4 )cell(ESC [ 14 ~ )cell(ESC [ 26 ~ )cell(ESC [ 14 ^ )cell(ESC [ 26 ^))\ row(cell(F5 )cell(ESC [ 15 ~ )cell(ESC [ 28 ~ )cell(ESC [ 15 ^ )cell(ESC [ 28 ^))\ row(cell(F6 )cell(ESC [ 17 ~ )cell(ESC [ 29 ~ )cell(ESC [ 17 ^ )cell(ESC [ 29 ^))\ row(cell(F7 )cell(ESC [ 18 ~ )cell(ESC [ 31 ~ )cell(ESC [ 18 ^ )cell(ESC [ 31 ^))\ row(cell(F8 )cell(ESC [ 19 ~ )cell(ESC [ 32 ~ )cell(ESC [ 19 ^ )cell(ESC [ 32 ^))\ row(cell(F9 )cell(ESC [ 20 ~ )cell(ESC [ 33 ~ )cell(ESC [ 20 ^ )cell(ESC [ 33 ^))\ row(cell(F10 )cell(ESC [ 21 ~ )cell(ESC [ 34 ~ )cell(ESC [ 21 ^ )cell(ESC [ 34 ^))\ row(cell(F11 )cell(ESC [ 23 ~ )cell(ESC [ 23 $ )cell(ESC [ 23 ^ )cell(ESC [ 23 @))\ row(cell(F12 )cell(ESC [ 24 ~ )cell(ESC [ 24 $ )cell(ESC [ 24 ^ )cell(ESC [ 24 @))\ row(cell(F13 )cell(ESC [ 25 ~ )cell(ESC [ 25 $ )cell(ESC [ 25 ^ )cell(ESC [ 25 @))\ row(cell(F14 )cell(ESC [ 26 ~ )cell(ESC [ 26 $ )cell(ESC [ 26 ^ )cell(ESC [ 26 @))\ row(cell(F15 (Help) )cell(ESC [ 28 ~ )cell(ESC [ 28 $ )cell(ESC [ 28 ^ )cell(ESC [ 28 @))\ row(cell(F16 (Menu) )cell(ESC [ 29 ~ )cell(ESC [ 29 $ )cell(ESC [ 29 ^ )cell(ESC [ 29 @))\ row(cell(F17 )cell(ESC [ 31 ~ )cell(ESC [ 31 $ )cell(ESC [ 31 ^ )cell(ESC [ 31 @))\ row(cell(F18 )cell(ESC [ 32 ~ )cell(ESC [ 32 $ )cell(ESC [ 32 ^ )cell(ESC [ 32 @))\ row(cell(F19 )cell(ESC [ 33 ~ )cell(ESC [ 33 $ )cell(ESC [ 33 ^ )cell(ESC [ 33 @))\ row(cell(F20 )cell(ESC [ 34 ~ )cell(ESC [ 34 $ )cell(ESC [ 34 ^ )cell(ESC [ 34 @))\ row(cell( )cell( )cell( )cell( )cell(bf(Application)))\ row(cell(Up )cell(ESC [ A )cell(ESC [ a )cell(ESC O a )cell(ESC O A))\ row(cell(Down )cell(ESC [ B )cell(ESC [ b )cell(ESC O b )cell(ESC O B))\ row(cell(Right )cell(ESC [ C )cell(ESC [ c )cell(ESC O c )cell(ESC O C))\ row(cell(Left )cell(ESC [ D )cell(ESC [ d )cell(ESC O d )cell(ESC O D))\ row(cell(KP_Enter )cell(^M )cell( )cell( )cell(ESC O M))\ row(cell(KP_F1 )cell(ESC O P )cell( )cell( )cell(ESC O P))\ row(cell(KP_F2 )cell(ESC O Q )cell( )cell( )cell(ESC O Q))\ row(cell(KP_F3 )cell(ESC O R )cell( )cell( )cell(ESC O R))\ row(cell(KP_F4 )cell(ESC O S )cell( )cell( )cell(ESC O S))\ row(cell(XK_KP_Multiply )cell(* )cell( )cell( )cell(ESC O j))\ row(cell(XK_KP_Add )cell(+ )cell( )cell( )cell(ESC O k))\ row(cell(XK_KP_Separator)cell(, )cell( )cell( )cell(ESC O l))\ row(cell(XK_KP_Subtract )cell(- )cell( )cell( )cell(ESC O m))\ row(cell(XK_KP_Decimal )cell(. )cell( )cell( )cell(ESC O n))\ row(cell(XK_KP_Divide )cell(/ )cell( )cell( )cell(ESC O o))\ row(cell(XK_KP_0 )cell(0 )cell( )cell( )cell(ESC O p))\ row(cell(XK_KP_1 )cell(1 )cell( )cell( )cell(ESC O q))\ row(cell(XK_KP_2 )cell(2 )cell( )cell( )cell(ESC O r))\ row(cell(XK_KP_3 )cell(3 )cell( )cell( )cell(ESC O s))\ row(cell(XK_KP_4 )cell(4 )cell( )cell( )cell(ESC O t))\ row(cell(XK_KP_5 )cell(5 )cell( )cell( )cell(ESC O u))\ row(cell(XK_KP_6 )cell(6 )cell( )cell( )cell(ESC O v))\ row(cell(XK_KP_7 )cell(7 )cell( )cell( )cell(ESC O w))\ row(cell(XK_KP_8 )cell(8 )cell( )cell( )cell(ESC O x))\ row(cell(XK_KP_9 )cell(9 )cell( )cell( )cell(ESC O y))\ endtable() rxvt-2.7.10/doc/yodl/rxvtRef-graphics.yo010064400001440000024000000015510651657405000165740ustar gcwstaffCOMMENT(-- $Id: rxvtRef-graphics.yo,v 1.2 1998/04/20 07:24:24 mason Exp $ --) label(Graphics) nsect(Special Graphics Mode) Add more documentation here, em(if anyone actually cares.) startdl() dl(bf(tt(ESC G Q))) (query if graphics are available nl()\ returns: bf(tt(ESC G 0)) no graphics available nl()\ returns: bf(tt(ESC G 1)) graphics available (colour only)) P()\ dl(bf(tt(ESC G W <;x>;;;:))) (create window) P()\ dl(bf(tt(ESC G C ))) (clear window) P()\ dl(bf(tt(ESC G G :))) (query window nl()\ returns: bf(tt(ESC G ))) P()\ dl(bf(tt(ESC G L )nl()tt(ESC G P )nl()tt(ESC G F ))) (start point nl()\ start line nl()\ start fill) P()\ dl(bf(tt(;;))) (extend point/line/fill) P()\ dl(bf(tt(ESC G T ;;;;:))) (place text) enddl() rxvt-2.7.10/doc/yodl/rxvtRef-definitions.yo010064400001440000024000000010650651657405000173070ustar gcwstaffCOMMENT(-- $Id: rxvtRef-definitions.yo,v 1.2 1998/04/20 07:24:24 mason Exp $ --) label(Definitions) nsect(Definitions) startdl() dl(bf(tt(c))) (The literal character c.) P()\ dl(bf(tt(C))) (A single (required) character.) P()\ dl(bf(tt(Ps))) (A single (usually optional) numeric parameter, composed of one or more digits.) P()\ dl(bf(tt(Pm))) (A multiple numeric parameter composed of any number of single numeric parameters, separated by ; character(s).) P()\ dl(bf(tt(Pt))) (A text parameter composed of printable characters.) enddl() rxvt-2.7.10/doc/yodl/rxvtRef-csi.yo010064400001440000024000000130170732251400600155410ustar gcwstaffCOMMENT(-- $Id: rxvtRef-csi.yo,v 1.3 2001/07/10 00:03:38 gcw Exp $ --) label(CSI) nsect(CSI (Code Sequence Introducer) Sequences) startdl() dl(bf(tt(ESC [ Ps @))) (Insert bf(tt(Ps)) (Blank) Character(s) [default: 1] (ICH))\ P()\ label(ESCOBPsA) dl(bf(tt(ESC [ Ps A))) (Cursor Up bf(tt(Ps)) Times [default: 1] (CUU)) P()\ dl(bf(tt(ESC [ Ps B))) (Cursor Down bf(tt(Ps)) Times [default: 1] (CUD))\ label(ESCOBPsC) dl(bf(tt(ESC [ Ps C))) (Cursor Forward bf(tt(Ps)) Times [default: 1] (CUF)) P()\ dl(bf(tt(ESC [ Ps D))) (Cursor Backward bf(tt(Ps)) Times [default: 1] (CUB)) P()\ dl(bf(tt(ESC [ Ps E))) (Cursor Down bf(tt(Ps)) Times [default: 1] and to first column) P()\ dl(bf(tt(ESC [ Ps F))) (Cursor Up bf(tt(Ps)) Times [default: 1] and to first column)\ P()\ label(ESCOBPsG) dl(bf(tt(ESC [ Ps G))) (Cursor to Column bf(tt(Ps)) (HPA)) P()\ dl(bf(tt(ESC [ Ps;Ps H))) (Cursor Position [row;column] [default: 1;1] (CUP)) P()\ dl(bf(tt(ESC [ Ps I))) (Move forward bf(tt(Ps)) tab stops [default: 1]) P()\ dl(bf(tt(ESC [ Ps J))) (Erase in Display (ED) nl()\ starttable(2)(l l)(0)\ row(cell(bf(tt(Ps = 0)))cell(Clear Below (default)))\ row(cell(bf(tt(Ps = 1)))cell(Clear Above))\ row(cell(bf(tt(Ps = 2)))cell(Clear All))\ endtable()) dl(bf(tt(ESC [ Ps K))) (Erase in Line (EL) nl()\ starttable(2)(l l)(0)\ row(cell(bf(tt(Ps = 0)))cell(Clear to Right (default)))\ row(cell(bf(tt(Ps = 1)))cell(Clear to Left))\ row(cell(bf(tt(Ps = 2)))cell(Clear All))\ endtable()) dl(bf(tt(ESC [ Ps L))) (Insert bf(tt(Ps)) Line(s) [default: 1] (IL)) P()\ dl(bf(tt(ESC [ Ps M))) (Delete bf(tt(Ps)) Line(s) [default: 1] (DL)) P()\ dl(bf(tt(ESC [ Ps P))) (Delete bf(tt(Ps)) Character(s) [default: 1] (DCH)) P()\ dl(bf(tt(ESC [ Ps;Ps;Ps;Ps;Ps T))) (Initiate link(hilite mouse tracking)(Mouse). em(unimplemented) Parameters are [func;startx;starty;firstrow;lastrow].) P()\ dl(bf(tt(ESC [ Ps W))) (Tabulator functions nl()\ starttable(2)(l l)(0)\ row(cell(bf(tt(Ps = 0)))cell(Tab Set (HTS)))\ row(cell(bf(tt(Ps = 2)))cell(Tab Clear (TBC), Clear Current \ Column (default)))\ row(cell(bf(tt(Ps = 5)))cell(Tab Clear (TBC), Clear All))\ endtable()) dl(bf(tt(ESC [ Ps X))) (Erase bf(tt(Ps)) Character(s) [default: 1] (ECH)) P()\ dl(bf(tt(ESC [ Ps Z))) (Move backward bf(tt(Ps)) [default: 1] tab stops) P()\ dl(bf(tt(ESC [ Ps '))) (== link(tt(ESC [ Ps G))(ESCOBPsG)) P()\ dl(bf(tt(ESC [ Ps a))) (== link(tt(ESC [ Ps C))(ESCOBPsC))\ P()\ label(ESCOBPsc) dl(bf(tt(ESC [ Ps c))) (Send Device Attributes (DA)nl()\ bf(tt(Ps = 0)) (or omitted) : request attributes from terminal nl()\ returns: bf(tt(ESC[?1;2c)) (``I am a VT100 with Advanced Video Option'')) P()\ dl(bf(tt(ESC [ Ps d))) (Cursor to Line bf(tt(Ps)) (VPA)) P()\ dl(bf(tt(ESC [ Ps e))) (== link(ESC [ Ps A)(ESCOBPsA)) P()\ dl(bf(tt(ESC [ Ps;Ps f))) (Horizontal and Vertical Position [row;column] (HVP) [default: 1;1]) P()\ dl(bf(tt(ESC [ Ps g))) (Tab Clear (TBC) nl()\ starttable(2)(l l)(0)\ row(cell(bf(tt(Ps = 0)))cell(Clear Current Column (default)))\ row(cell(bf(tt(Ps = 3)))cell(Clear All (TBC)))\ endtable()) dl(bf(tt(ESC [ Ps i))) (Printing nl()\ starttable(2)(l l)(0)\ row(cell(bf(tt(Ps = 4)))cell(disable transparent print mode (MC4)))\ row(cell(bf(tt(Ps = 5)))cell(enable transparent print mode (MC5) \ em(unimplemented)))\ endtable()) dl(bf(tt(ESC [ Pm h)nl()tt(ESC [ Pm l))) (Set Mode (SM) nl()Reset Mode (RM)\ startdl() dl(bf(tt(Ps = 4))) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Insert Mode (SMIR)))\ row(cell(bf(tt(l)))cell(Replace Mode (RMIR)))\ endtable()) dl(bf(tt(Ps = 20)) em(unimplemented)) (starttable(2)(l l)(0)\ row(cell(bf(tt(h)))cell(Automatic Newline (LNM)))\ row(cell(bf(tt(h)))cell(Normal Linefeed (LNM)))\ endtable()) enddl()) dl(bf(tt(ESC [ Pm m))) (Character Attributes (SGR) nl()\ starttable(2)(l l)(0)\ row(cell(bf(tt(Ps = 0)))cell(Normal (default)))\ row(cell(bf(tt(Ps = 1 / 22)))cell(On / Off Bold (bright fg)))\ row(cell(bf(tt(Ps = 4 / 24)))cell(On / Off Underline))\ row(cell(bf(tt(Ps = 5 / 25)))cell(On / Off Blink (bright bg)))\ row(cell(bf(tt(Ps = 7 / 27)))cell(On / Off Inverse))\ row(cell(bf(tt(Ps = 30 / 40)))cell(fg/bg Black))\ row(cell(bf(tt(Ps = 31 / 41)))cell(fg/bg Red))\ row(cell(bf(tt(Ps = 32 / 42)))cell(fg/bg Green))\ row(cell(bf(tt(Ps = 33 / 43)))cell(fg/bg Yellow))\ row(cell(bf(tt(Ps = 34 / 44)))cell(fg/bg Blue))\ row(cell(bf(tt(Ps = 35 / 45)))cell(fg/bg Magenta))\ row(cell(bf(tt(Ps = 36 / 46)))cell(fg/bg Cyan))\ row(cell(bf(tt(Ps = 37 / 47)))cell(fg/bg White))\ row(cell(bf(tt(Ps = 39 / 49)))cell(fg/bg Default))\ endtable()) dl(bf(tt(ESC [ Ps n))) (Device Status Report (DSR) nl()\ starttable(2)(l l)(0)\ row(cell(bf(tt(Ps = 5)))cell(Status Report bf(tt(ESC [ 0 n)) \ (``OK'')))\ row(cell(bf(tt(Ps = 6)))cell(Report Cursor Position (CPR) \ [row;column] as bf(tt(ESC [ r ; c R))))\ row(cell(bf(tt(Ps = 7)))cell(Request Display Name))\ row(cell(bf(tt(Ps = 8)))cell(Request Version Number (place in \ window title)))\ endtable()) dl(bf(tt(ESC [ Ps;Ps r))) (Set Scrolling Region [top;bottom] nl()\ [default: full size of window] (CSR)) P()\ dl(bf(tt(ESC [ s))) (Save Cursor (SC)) P()\ dl(bf(tt(ESC [ Ps x))) (Request Terminal Parameters (DECREQTPARM)) P()\ dl(bf(tt(ESC [ u))) (Restore Cursor) enddl() rxvt-2.7.10/doc/yodl/rxvt.yo010064400001440000024000000076230726130007100143330ustar gcwstaffCOMMENT(-- $Id: rxvt.yo,v 1.6 2001/03/31 06:18:10 gcw Exp $ --) includefile(versioninfo.yo) includefile(masonyodl.yo) mailto(gcw@pobox.com) DEFINEMACRO(HOTKEY)(0)(Alt) DEFINEMACRO(BIGFONT)(0)(>) DEFINEMACRO(SMALLFONT)(0)(<) COMMENT(----------------------------------------------------------------------- -- We want the following macro's to be pre-defined -- RXVTDATE() -- RXVTVERSION() -- RXVTMAINT() -- RXVTMAINTEMAIL() -- RXVTWEBPAGE() -- RXVTWEBMAINT() -- RXVTWEBMAINTEMAIL() -- RXVTFTPSITE() ------------------------------------------------------------------------------) COMMENT(----------------------------------------------------------------------) manpage(RXVT)(1)(RXVTDATE())(X Version 11)(X Tools) manpagename(rxvt (ouR XVT))(a VT102 emulator for the X window system) COMMENT(----------------------------------------------------------------------) manpagesynopsis() bf(rxvt) [options] [-e command [ args ]] COMMENT(----------------------------------------------------------------------) manpagedescription() bf(rxvt), version bf(RXVTVERSION()), is a colour vt102 terminal emulator intended as an em(xterm)(1) replacement for users who do not require features such as Tektronix 4014 emulation and toolkit-style configurability. As a result, bf(rxvt) uses much less swap space -- a significant advantage on a machine serving many X sessions. COMMENT(----------------------------------------------------------------------) includefile(rxvt-options.yo) includefile(rxvt-resources.yo) includefile(rxvt-scrollbar.yo) includefile(rxvt-mousereporting.yo) includefile(rxvt-textselection.yo) includefile(rxvt-fonts.yo) includefile(rxvt-login.yo) includefile(rxvt-colours.yo) includefile(rxvt-environment.yo) includefile(rxvt-files.yo) COMMENT(----------------------------------------------------------------------) manpageseealso() em(xterm)(1), em(sh)(1), em(resize)(1), em(X)(1), em(pty)(4), em(tty)(4), em(utmp)(5) See rxvtRef.html rxvtRef.txt for detailed information on recognized escape sequences and menuBar syntax, etc. COMMENT(----------------------------------------------------------------------) manpagebugs() Check the BUGS file for an up-to-date list. Cursor change support is not yet implemented. Click-and-drag doesn't work with X11 mouse report overriding. Graphics support is fairly crude. COMMENT(----------------------------------------------------------------------) manpagesection(FTP LOCATION) rxvt-+RXVTVERSION().tar.gz can be found at the following ftp sites url(RXVTFTPSITE())(RXVTFTPSITE()) COMMENT(----------------------------------------------------------------------) manpagesection(CURRENT PROJECT COORDINATOR) startdit() dit(Project Coordinator) RXVTMAINT() email(RXVTMAINTEMAIL())nl()\ dit(Web page maintainter) RXVTWEBMAINT() email(RXVTWEBMAINTEMAIL())nl()\ url(RXVTWEBPAGE())(RXVTWEBPAGE())nl()\ dit(Mailing list) The Rxvt Workers email() mailing list has also been established for rxvt development, to subscribe, email to email(). There is also a mailing list for announcements of new releases of rxvt. To subscribe, email to email(). enddit() COMMENT(----------------------------------------------------------------------) manpageauthors() startdit() dit(John Bovey) University of Kent, 1992, wrote the original Xvt. dit(Rob Nation email()) very heavily modified Xvt and came up with Rxvt dit(Angelo Haritsis email()) wrote the Greek Keyboard Input dit(mj olesen email()) Wrote the menu system. nl()\ Project Coordinator (changes.txt 2.11 to 2.21) dit(Oezguer Kesim email()) Project Coordinator (changes.txt 2.21a to 2.4.5) dit(Geoff Wing email()) Rewrote screen display and text selection routines. nl()\ Project Coordinator (changes.txt 2.4.6 - ) enddit() rxvt-2.7.10/doc/yodl/rxvt-textselection.yo010064400001440000024000000013640651657404700172410ustar gcwstaffCOMMENT(-- $Id: rxvt-textselection.yo,v 1.2 1998/04/20 07:24:23 mason Exp $ --) COMMENT(----------------------------------------------------------------------) manpagesection(TEXT SELECTION AND INSERTION) The behaviour of text selection and insertion mechanism is similar to em(xterm)(1). startdit() dit(bf(Selection):) Left click at the beginning of the region, drag to the end of the region and release; Right click to extend the marked region; Left double-click to select a word; Left triple-click to select the entire line. dit(bf(Insertion):) Pressing and releasing the Middle mouse button (or bf(Shift-Insert)) in an bf(rxvt) window causes the current text selection to be inserted as if it had been typed on the keyboard. enddit() rxvt-2.7.10/doc/yodl/rxvt-scrollbar.yo010064400001440000024000000012500651657404700163240ustar gcwstaffCOMMENT(-- $Id: rxvt-scrollbar.yo,v 1.2 1998/04/20 07:24:23 mason Exp $ --) COMMENT(----------------------------------------------------------------------) manpagesection(THE SCROLLBAR) Lines of text that scroll off the top of the bf(rxvt) window (resource: bf(saveLines)) and can be scrolled back using the scrollbar or by keystrokes. The normal bf(rxvt) scrollbar has arrows and its behaviour is fairly intuitive. The bf(xterm-scrollbar) is without arrows and its behaviour mimics that of em(xterm) Scroll down with bf(Button1) (bf(xterm-scrollbar)) or bf(Shift-Next). Scroll up with bf(Button3) (bf(xterm-scrollbar)) or bf(Shift-Prior). Continuous scroll with bf(Button2). rxvt-2.7.10/doc/yodl/rxvt-resources.yo010064400001440000024000000313340762753251600163600ustar gcwstaffCOMMENT(-- $Id: rxvt-resources.yo,v 1.30 2003/02/28 00:58:46 gcw Exp $ --) COMMENT(----------------------------------------------------------------------) manpagesection(RESOURCES (available also as long-options)) Note: `rxvt --help' gives a list of all resources (long options) compiled into your version. If compiled with internal Xresources support (i.e. bf(rxvt -h) lists bf(.Xdefaults)) then bf(rxvt) accepts application defaults set in XAPPLOADDIR/Rxvt (compile-time defined: usually bf(/usr/lib/X11/app-defaults/Rxvt)) and resources set in bf(~/.Xdefaults), or bf(~/.Xresources) if bf(~/.Xdefaults) does not exist. Note that when reading X resources, bf(rxvt) recognizes two class names: bf(XTerm) and bf(Rxvt). The class name bf(XTerm) allows resources common to both bf(rxvt) and em(xterm) to be easily configured, while the class name bf(Rxvt) allows resources unique to bf(rxvt), notably colours and key-handling, to be shared between different bf(rxvt) configurations. If no resources are specified, suitable defaults will be used. Command-line arguments can be used to override resource settings. The following resources are allowed: startdit() dit(bf(geometry:) em(geom)) Create the window with the specified X window geometry [default 80x24]; option bf(-geometry). dit(bf(background:) em(colour)) Use the specified colour as the window's background colour [default White]; option bf(-bg). dit(bf(foreground:) em(colour)) Use the specified colour as the window's foreground colour [default Black]; option bf(-fg). dit(bf(color)em(n)bf(:) em(colour)) Use the specified colour for the colour value em(n), where 0-7 corresponds to low-intensity (normal) colours and 8-15 corresponds to high-intensity (bold = bright foreground, blink = bright background) colours. The canonical names are as follows: 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=white, but the actual colour names used are listed in the bf(COLORS AND GRAPHICS) section. dit(bf(colorBD:) em(colour)) Use the specified colour to display bold characters when the foreground colour is the default. dit(bf(colorUL:) em(colour)) Use the specified colour to display underlined characters when the foreground colour is the default. dit(bf(colorRV:) em(colour)) Use the specified colour as the background for reverse video characters. dit(bf(cursorColor:) em(colour)) Use the specified colour for the cursor. The default is to use the foreground colour; option bf(-cr). dit(bf(cursorColor2:) em(colour)) Use the specified colour for the colour of the cursor text. For this to take effect, bf(cursorColor) must also be specified. The default is to use the background colour. dit(bf(reverseVideo:) em(boolean)) bf(True): simulate reverse video by foreground and background colours; option bf(-rv). bf(False): regular screen colours [default]; option bf(+rv). See note in bf(COLORS AND GRAPHICS) section. dit(bf(jumpScroll:) em(boolean)) bf(True): specify that jump scrolling should be used. When scrolling quickly, fewer screen updates are performed [default]; option bf(-j). bf(False): specify that smooth scrolling should be used; option bf(+j). dit(bf(inheritPixmap:) em(boolean)) bf(True): make the background inherit the parent windows' pixmap, giving artificial transparency. bf(False): do not inherit the parent windows' pixmap. dit(bf(scrollColor:) em(colour)) Use the specified colour for the scrollbar [default #B2B2B2]. dit(bf(troughColor:) em(colour)) Use the specified colour for the scrollbar's trough area [default #969696]. Only relevant for normal (non XTerm/NeXT) scrollbar. dit(bf(backgroundPixmap:) em(file[;geom])) Use the specified XPM file (note the `.xpm' extension is optional) for the background and also optionally specify its scaling with a geometry string bf(WxH+X+Y), in which bf("W" / "H") specify the horizontal/vertical scale (percent) and bf("X" / "Y") locate the image centre (percent). A scale of 0 displays the image with tiling. A scale of 1 displays the image without any scaling. A scale of 2 to 9 specifies an integer number of images in that direction. No image will be magnified beyond 10 times its original size. The maximum permitted scale is 1000. [default 0x0+50+50] dit(bf(menu:) em(file[;tag])) Read in the specified menu file (note the `.menu' extension is optional) and also optionally specify a starting tag to find. See the reference documentation for details on the syntax for the menuBar. dit(bf(path:) em(path)) Specify the colon-delimited search path for finding files (XPM and menus), in addition to the paths specified by the bf(RXVTPATH) and bf(PATH) environment variables. dit(bf(font:) em(fontname)) Select the main text font used [default 7x14]; option bf(-fn). dit(bf(font)em(n)bf(:) em(fontname)) Specify the alternative font em(n). The default font values: nl()\ indent(\ starttable(2)(l l)(0)\ row(cell(bf(font):)cell(7x14))\ row(cell(bf(font1):)cell(6x10))\ row(cell(bf(font2):)cell(6x13))\ row(cell(bf(font3):)cell(8x13))\ row(cell(bf(font4):)cell(9x15))\ endtable()) dit(bf(boldFont:) em(fontname)) Specify the name of the bold font to use if bf(colorBD) has not been specified and it is not possible to map the default foreground colour to colour 8-15 [default NONE]. This font must be the same height and width as the normal font; option bf(-fb). dit(bf(mfont:) em(fontname)) Select the main multiple-character text font used [default k14]; option bf(-fk). dit(bf(mfont)em(n)bf(:) em(fontname)) Specify the alternative multiple-character font em(n). If compiled for multiple-character fonts, the Roman and multiple-character font sizes should match. dit(bf(multichar_encoding:) em(mode)) Set the encoding mode to be used when multicharacter encoding is received; bf(eucj): EUC Japanese encoding [default for Kanji]. bf(sjis): Shift JIS encoding. bf(big5): BIG5 encoding. bf(gb): GB encoding. bf(kr): EUC Korean encoding. bf(noenc): no encoding; option bf(-km). dit(bf(greek_keyboard:) em(mode)) Set the Greek keyboard translation mode to be used; bf(iso): ISO-8859 mapping (elot-928) [default]. bf(ibm): IBM-437 mapping (DOS codepage 737); option bf(-grk). dit(bf(greektoggle_key:) em(keysym)) Set the key to toggle keyboard input between no translation and Greek translation [default bf(Mode_switch)]. For more details, see the distributed file bf(README.greek). dit(bf(selectstyle:) em(mode)) Set mouse selection style to bf(old) which is 2.20, bf(oldword) which is xterm style with 2.20 old word selection, or anything else which gives xterm style selection. dit(bf(scrollstyle:) em(mode)) Set scrollbar style to bf(rxvt), bf(next) or bf(xterm) dit(bf(title:) em(string)) Set window title string, the default title is the command-line specified after the bf(-e) option, if any, otherwise the application name; option bf(-title). dit(bf(iconName:) em(string)) Set the name used to label the window's icon or displayed in an icon manager window, it also sets the window's title unless it is explicitly set; option bf(-n). dit(bf(mapAlert:) em(boolean)) bf(True): de-iconify (map) on receipt of a bell character. bf(False): no de-iconify (map) on receipt of a bell character [default]. dit(bf(visualBell:) em(boolean)) bf(True): use visual bell on receipt of a bell character; option bf(-vb). bf(False): no visual bell [default]; option bf(+vb). dit(bf(loginShell:) em(boolean)) bf(True): start as a login shell by prepending a `-' to bf(argv[0]) of the shell; option bf(-ls). bf(False): start as a normal sub-shell [default]; option bf(+ls). dit(bf(utmpInhibit:) em(boolean)) bf(True): inhibit writing record into the system log file bf(utmp); option bf(-ut). bf(False): write record into the system log file bf(utmp) [default]; option bf(+ut). dit(bf(print-pipe:) em(string)) Specify a command pipe for vt100 printer [default em(lpr(1))]. Use bf(Print) to initiate a screen dump to the printer and bf(Ctrl-Print) or bf(Shift-Print) to include the scrollback as well. dit(bf(scrollBar:) em(boolean)) bf(True): enable the scrollbar [default]; option bf(-sb). bf(False): disable the scrollbar; option bf(+sb). dit(bf(scrollBar_right:) em(boolean)) bf(True): place the scrollbar on the right of the window; option bf(-sr). bf(False): place the scrollbar on the left of the window; option bf(+sr). dit(bf(scrollBar_floating:) em(boolean)) bf(True): display an rxvt scrollbar without a trough; option bf(-st). bf(False): display an rxvt scrollbar with a trough; option bf(+st). dit(bf(scrollBar_align:) em(mode)) Align the bf(top), bf(bottom) or bf(centre) [default] of the scrollbar thumb with the pointer on middle button press/drag. dit(bf(scrollTtyOutput:) em(boolean)) bf(True): scroll to bottom when tty receives output; option(+si). bf(False): do not scroll to bottom when tty receives output; option(-si). dit(bf(scrollWithBuffer:) em(boolean)) bf(True): scroll with scrollback buffer when tty recieves new lines (and bf(scrollTtyOutput) is False); option(+sw). bf(False): do not scroll with scrollback buffer when tty recieves new lines; option(-sw). dit(bf(scrollTtyKeypress:) em(boolean)) bf(True): scroll to bottom when a non-special key is pressed. Special keys are those which are intercepted by rxvt for special handling and are not passed onto the shell; option(-sk). bf(False): do not scroll to bottom when a non-special key is pressed; option(+sk). dit(bf(smallfont_key:) em(keysym)) If enabled, use bf(HOTKEY()-)em(keysym) to toggle to a smaller font [default bf(HOTKEY()-SMALLFONT())] dit(bf(bigfont_key:) em(keysym)) If enabled, use bf(HOTKEY()-)em(keysym) to toggle to a bigger font [default bf(HOTKEY()-BIGFONT())] dit(bf(saveLines:) em(number)) Save em(number) lines in the scrollback buffer [default 64]. This resource is limited on most machines to 65535; option bf(-sl). dit(bf(internalBorder:) em(number)) Internal border of em(number) pixels. This resource is limited to 100; option bf(-b). dit(bf(externalBorder:) em(number)) External border of em(number) pixels. This resource is limited to 100; option bf(-w), bf(-bw), bf(-borderwidth). dit(bf(termName:) em(termname)) Specifies the terminal type name to be set in the bf(TERM) environment variable; option bf(-tn). dit(bf(linespace:) em(number)) Specifies number of lines (pixel height) to insert between each row of the display [default 0]; option bf(-lsp). dit(bf(meta8:) em(boolean)) bf(True): handle Meta (Alt) + keypress to set the 8th bit. bf(False): handle Meta (Alt) + keypress as an escape prefix [default]. dit(bf(mouseWheelScrollPage:) em(boolean)) bf(True): the mouse wheel scrolls a page full. bf(False): the mouse wheel scrolls five lines [default]. dit(bf(multibyte_cursor:) em(boolean)) bf(True): consider multibyte glyphs as single character for backspace, delete and cursor movement keys; option bf(-mcc). bf(False): move through all components of all glyphs; option bf(+mcc). dit(bf(backspacekey:) em(string)) The string to send when the backspace key is pressed. If set to bf(DEC) or unset it will send bf(Delete) (code 127) or, if shifted, bf(Backspace) (code 8) - which can be reversed with the appropriate DEC private mode escape sequence. dit(bf(deletekey:) em(string)) The string to send when the delete key (not the keypad delete key) is pressed. If unset it will send the sequence traditionally associated with the bf(Execute) key. dit(bf(cutchars:) em(string)) The characters used as delimiters for double-click word selection. The built-in default: nl()\ bf(BACKSLASH `"'&()*,;<=>?@[]{|}) dit(bf(preeditType:) em(style)) bf(OverTheSpot), bf(OffTheSpot), bf(Root); option bf(-pt). dit(bf(inputMethod:) em(name)) em(name) of inputMethod to use; option bf(-im). dit(bf(modifier:) em(modifier)) Set the key to be interpreted as the Meta key to: bf(alt), bf(meta), bf(hyper), bf(super), bf(mod1), bf(mod2), bf(mod3), bf(mod4), bf(mod5); option bf(-mod). dit(bf(answerbackString:) em(string)) Specify the reply rxvt sends to the shell when an ENQ (control-E) character is passed through. It may contain escape values as described in the entry on bf(keysym) following. dit(bf(keysym.)em(sym): em(string)) Associate em(string) with keysym em(sym) (bf(0xFF00 - 0xFFFF)). It may contain escape values (\a: bell, \b: backspace, \e, \E: escape, \n: newline, \r: return, \t: tab, \000: octal number) or control characters (^?: delete, ^@: null, ^A ...) and may enclosed with double quotes so that it can start or end with whitespace. The intervening resource name bf(keysym.) cannot be omitted. This resource is only available when compiled with KEYSYM_RESOURCE. enddit() rxvt-2.7.10/doc/yodl/rxvt-options.yo010064400001440000024000000166130740133424300160270ustar gcwstaffCOMMENT(-- $Id: rxvt-options.yo,v 1.19 2001/11/29 02:02:07 gcw Exp $ --) COMMENT(----------------------------------------------------------------------) manpageoptions() The bf(rxvt) options (mostly a subset of em(xterm)'s) are listed below. In keeping with the smaller-is-better philosophy, options may be eliminated or default values chosen at compile-time, so options and defaults listed may not accurately reflect the version installed on your system. `rxvt -h' gives a list of major compile-time options on the em(Options) line. Option descriptions may be prefixed with which compile option each is dependent upon. e.g. `Compile em(XIM):' requires em(XIM) on the em(Options) line. Note: `rxvt -help' gives a list of all command-line options compiled into your version. Note that bf(rxvt) permits the resource name to be used as a long-option (--/++ option) so the potential command-line options are far greater than those listed. For example: `rxvt --loginShell --color1 Orange'. Also note that if you do not explictly specify a font (bf(-fn) and bf(-fm)) or a multichar encoding method (bf(-km)), rxvt will select a font for the preferable encoding according to your locale. Supported encodings are: bf(ISO-8859-)n (n=bf(1)...bf(15)), bf(KOI8-R), bf(KOI8-U), bf(EUC-JP), bf(Shift_JIS), bf(EUC-KR), bf(EUC-CN) (aka bf(GB)), and bf(Big5). The following options are available: startdit() dit(bf(-help), bf(--help)) Print out a message describing available options. dit(bf(-display) em(displayname)) Attempt to open a window on the named X display (bf(-d) still respected). In the absence of this option, the display specified by the bf(DISPLAY) environment variable is used. dit(bf(-geometry) em(geom)) Window geometry (bf(-g) still respected); resource bf(geometry). dit(bf(-rv)|bf(+rv)) Turn on/off simulated reverse video; resource bf(reverseVideo). dit(bf(-j)|bf(+j)) Turn on/off jump scrolling; resource bf(jumpScroll). dit(bf(-ip)|bf(+ip)) Turn on/off inheriting parent window's pixmap. Alternative form is bf(-tr); resource bf(inheritPixmap). dit(bf(-bg) em(colour)) Window background colour; resource bf(background). dit(bf(-fg) em(colour)) Window foreground colour; resource bf(foreground). dit(bf(-pixmap:) em(file[;geom])) Compile em(XPM): Specify XPM file for the background and also optionally specify its scaling with a geometry string. Note you may need to add quotes to avoid special shell interpretation of the `;' in the command-line; resource bf(backgroundPixmap). dit(bf(-cr) em(colour)) The cursor colour; resource bf(cursorColor). dit(bf(-pr) em(colour)) The mouse pointer colour; resource bf(pointerColor). dit(bf(-bd) em(colour)) The colour of the border between the xterm scrollbar and the text; resource bf(borderColor). dit(bf(-fn) em(fontname)) Main normal text font; resource bf(font). dit(bf(-fb) em(fontname)) Main bold text font; resource bf(boldFont). dit(bf(-fm) em(fontname)) Main multicharacter font; resource bf(mfont). dit(bf(-km) em(mode)) Compile em(multichar_languages): Multiple-character font-set encoding mode; bf(eucj): EUC Japanese encoding. bf(sjis): Shift JIS encoding. bf(big5): BIG5 encoding. bf(gb): GB encoding. bf(kr): EUC Korean encoding. bf(noenc): no encoding; resource bf(multichar_encoding). dit(bf(-grk) em(mode)) Compile em(Greek): Greek keyboard translation; bf(iso): ISO-8859 mapping. bf(ibm): IBM-437 mapping; resource bf(greek_keyboard). dit(bf(-name) em(name)) Specify the application name under which resources are to be obtained, rather than the default executable file name. Name should not contain `.' or `*' characters. Also sets the icon and title name. dit(bf(-ls)|bf(+ls)) Start as a login-shell/sub-shell; resource bf(loginShell). dit(bf(-ut)|bf(+ut)) Compile em(utmp): Inhibit/enable writing a utmp entry; resource bf(utmpInhibit). dit(bf(-vb)|bf(+vb)) Turn on/off visual bell on receipt of a bell character; resource bf(visualBell). dit(bf(-sb)|bf(+sb)) Turn on/off scrollbar; resource bf(scrollBar). dit(bf(-si)|bf(+si)) Turn on/off scroll-to-bottom on TTY output inhibit; resource bf(scrollTtyOutput) has opposite effect. dit(bf(-sk)|bf(+sk)) Turn on/off scroll-to-bottom on keypress; resource bf(scrollTtyKeypress). dit(bf(-sw)|bf(+sw)) Turn on/off scrolling with the scrollback buffer as new lines appear. This only takes effect if bf(-si) is also given; resource bf(scrollWithBuffer). dit(bf(-sr)|bf(+sr)) Put scrollbar on right/left; resource bf(scrollBar_right). dit(bf(-st)|bf(+st)) Display normal (non XTerm/NeXT) scrollbar without/with a trough; resource bf(scrollBar_floating). dit(bf(-mcc)|bf(+mcc)) Compile em(multichar_languages): treat multibyte glyphs as single character for backspace, delete and cursor movement keys; resource bf(multibyte_cursor). dit(bf(-iconic)) Start iconified, if the window manager supports that option. Alternative form is bf(-ic). dit(bf(-sl) em(number)) Save em(number) lines in the scrollback buffer. See resource entry for limits; resource bf(saveLines). dit(bf(-b) em(number)) Compile em(frills): Internal border of em(number) pixels. See resource entry for limits; resource bf(internalBorder). dit(bf(-w) em(number)) Compile em(frills): External border of em(number) pixels. Also, bf(-bw) and bf(-borderwidth). See resource entry for limits; resource bf(externalBorder). dit(bf(-lsp) em(number)) Compile em(linespace): Lines (pixel height) to insert between each row of the display; resource bf(linespace). dit(bf(-tn) em(termname)) This option specifies the name of the terminal type to be set in the bf(TERM) environment variable. This terminal type must exist in the em(termcap(5)) database and should have em(li#) and em(co#) entries; resource bf(termName). dit(bf(-e) em(command [arguments])) Run the command with its command-line arguments in the bf(rxvt) window; also sets the window title and icon name to be the basename of the program being executed if neither em(-title) (em(-T)) nor em(-n) are given on the command line. If this option is used, it must be the last on the command-line. If there is no bf(-e) option then the default is to run the program specified by the bf(SHELL) environment variable or, failing that, em(sh(1)). dit(bf(-title) em(text)) Window title (bf(-T) still respected); the default title is the basename of the program specified after the bf(-e) option, if any, otherwise the application name; resource bf(title). dit(bf(-n) em(text)) Icon name; the default name is the basename of the program specified after the bf(-e) option, if any, otherwise the application name; resource bf(iconName). dit(bf(-C)) Capture system console messages. dit(bf(-pt) em(style)) Compile em(XIM): input style for input method; bf(OverTheSpot), bf(OffTheSpot), bf(Root); resource bf(preeditType). dit(bf(-im) em(text)) Compile em(XIM): input method name. resource bf(inputMethod). dit(bf(-mod) em(modifier)) Override detection of Meta modifier with specified key: bf(alt), bf(meta), bf(hyper), bf(super), bf(mod1), bf(mod2), bf(mod3), bf(mod4), bf(mod5); resource em(modifier). dit(bf(-xrm) em(resourcestring)) No effect on rxvt. Simply passes through an argument to be made available in the instance's argument list. Appears in em(WM_COMMAND) in some window managers. enddit() rxvt-2.7.10/doc/yodl/rxvt-login.yo010064400001440000024000000006140651657404600154530ustar gcwstaffCOMMENT(-- $Id: rxvt-login.yo,v 1.2 1998/04/20 07:24:22 mason Exp $ --) COMMENT(----------------------------------------------------------------------) manpagesection(LOGIN STAMP) bf(rxvt) tries to write an entry into the em(utmp)(5) file so that it can be seen via the em(who(1)) command, and can accept messages. To allow this feature, bf(rxvt) must be installed setuid root on some systems. rxvt-2.7.10/doc/yodl/rxvt-mousereporting.yo010064400001440000024000000013350651657404600174260ustar gcwstaffCOMMENT(-- $Id: rxvt-mousereporting.yo,v 1.2 1998/04/20 07:24:22 mason Exp $ --) COMMENT(----------------------------------------------------------------------) manpagesection(MOUSE REPORTING) To temporarily override mouse reporting, for either the scrollbar or the normal text selection/insertion, hold either the Shift or the Meta (Alt) key while performing the desired mouse action. If mouse reporting mode is active, the normal scrollbar actions are disabled -- on the assumption that we are using a fullscreen application. Instead, pressing Button1 and Button3 sends bf(ESC[6~) (Next) and bf(ESC[5~) (Prior), respectively. Similarly, clicking on the up and down arrows sends bf(ESC[A) (Up) and bf(ESC[B) (Down), respectively. rxvt-2.7.10/doc/yodl/rxvt-fonts.yo010064400001440000024000000010140651657404500154660ustar gcwstaffCOMMENT(-- $Id: rxvt-fonts.yo,v 1.2 1998/04/20 07:24:21 mason Exp $ --) COMMENT(----------------------------------------------------------------------) manpagesection(CHANGING FONTS) You can change fonts on-the-fly, which is to say cycle through the default font and others of various sizes, by using bf(Shift-KP_Add) and bf(Shift-KP_Subtract). Or, alternatively (if enabled) with bf(HOTKEY()-BIGFONT()) and bf(HOTKEY()-SMALLFONT()), where the actual key can be selected using resources bf(smallfont_key)/bf(bigfont_key). rxvt-2.7.10/doc/yodl/rxvt-files.yo010064400001440000024000000004500651657404500154420ustar gcwstaffCOMMENT(-- $Id: rxvt-files.yo,v 1.2 1998/04/20 07:24:21 mason Exp $ --) COMMENT(----------------------------------------------------------------------) manpagesection(FILES) startdit() dit(bf(/etc/utmp)) System file for login records. dit(bf(/usr/lib/X11/rgb.txt)) Color names. enddit() rxvt-2.7.10/doc/yodl/rxvt-environment.yo010064400001440000024000000010540651657404500167050ustar gcwstaffCOMMENT(-- $Id: rxvt-environment.yo,v 1.2 1998/04/20 07:24:21 mason Exp $ --) COMMENT(----------------------------------------------------------------------) manpagesection(ENVIRONMENT) bf(rxvt) sets the environment variables bf(TERM), bf(COLORTERM) and bf(COLORFGBG). The environment variable bf(WINDOWID) is set to the X window id number of the bf(rxvt) window and it also uses and sets the environment variable bf(DISPLAY) to specify which display terminal to use. bf(rxvt) uses the environment variables bf(RXVTPATH) and bf(PATH) to find XPM files. rxvt-2.7.10/doc/yodl/rxvt-colours.yo010064400001440000024000000044350651657404500160350ustar gcwstaffCOMMENT(-- $Id: rxvt-colours.yo,v 1.2 1998/04/20 07:24:21 mason Exp $ --) COMMENT(----------------------------------------------------------------------) manpagesection(COLORS AND GRAPHICS) If graphics support was enabled at compile-time, bf(rxvt) can be queried with ANSI escape sequences and can address individual pixels instead of text characters. Note the graphics support is still considered beta code. In addition to the default foreground and background colours, bf(rxvt) can display up to 16 colours (8 ANSI colours plus high-intensity bold/blink versions of the same). Here is a list of the colours with their bf(rgb.txt) names. starttable(3)(l l l)(0)\ row(cell(bf(color0))cell((black))cell(= Black))\ row(cell(bf(color1))cell((red))cell(= Red3))\ row(cell(bf(color2))cell((green))cell(= Green3))\ row(cell(bf(color3))cell((yellow))cell(= Yellow3))\ row(cell(bf(color4))cell((blue))cell(= Blue3))\ row(cell(bf(color5))cell((magenta))cell(= Magenta3))\ row(cell(bf(color6))cell((cyan))cell(= Cyan3))\ row(cell(bf(color7))cell((white))cell(= AntiqueWhite))\ row(cell(bf(color8))cell((bright black))cell(= Grey25))\ row(cell(bf(color9))cell((bright red))cell(= Red))\ row(cell(bf(color10))cell((bright green))cell(= Green))\ row(cell(bf(color11))cell((bright yellow))cell(= Yellow))\ row(cell(bf(color12))cell((bright blue))cell(= Blue))\ row(cell(bf(color13))cell((bright magenta))cell(= Magenta))\ row(cell(bf(color14))cell((bright cyan))cell(= Cyan))\ row(cell(bf(color15))cell((bright white))cell(= White))\ row(cell(bf(foreground))cell()cell(= Black))\ row(cell(bf(background))cell()cell(= White))\ endtable() It is also possible to specify the colour values of bf(foreground), bf(background), bf(cursorColor), bf(cursorColor2), bf(colorBD), bf(colorUL) as a number 0-15, as a convenient shorthand to reference the colour name of color0-color15. Note that bf(-rv) (bf("reverseVideo: True")) simulates reverse video by always swapping the foreground/background colours. This is in contrast to em(xterm)(1) where the colours are only swapped if they have not otherwise been specified. For example, startdit() dit(bf(rxvt -fg Black -bg White -rv)) would yield White on Black, while on em(xterm)(1) it would yield Black on White. enddit() rxvt-2.7.10/doc/yodl/versioninfo.yo.in010064400001440000024000000007410651657405300163070ustar gcwstaffCOMMENT(-- $Id: versioninfo.yo.in,v 1.2 1998/04/20 07:24:27 mason Exp $ --) DEFINEMACRO(RXVTDATE)(0) (@RXVT_DATE@) DEFINEMACRO(RXVTVERSION)(0) (@RXVT_VERSION@) DEFINEMACRO(RXVTMAINT)(0) (@RXVT_MAINT@) DEFINEMACRO(RXVTMAINTEMAIL)(0) (@RXVT_MAINTEMAIL@) DEFINEMACRO(RXVTWEBMAINT)(0) (@RXVT_WEBMAINT@) DEFINEMACRO(RXVTWEBMAINTEMAIL)(0) (@RXVT_WEBMAINTEMAIL@) DEFINEMACRO(RXVTWEBPAGE)(0) (@RXVT_WEBPAGE@) DEFINEMACRO(RXVTFTPSITE)(0) (ftp://@RXVT_FTPSITENAME@@RXVT_FTPSITEDIR@) rxvt-2.7.10/doc/yodl/versioninfo.yo010064400001440000024000000007100764024231500156660ustar gcwstaffCOMMENT(-- $Id: versioninfo.yo.in,v 1.2 1998/04/20 07:24:27 mason Exp $ --) DEFINEMACRO(RXVTDATE)(0) (26 MARCH 2003) DEFINEMACRO(RXVTVERSION)(0) (2.7.10) DEFINEMACRO(RXVTMAINT)(0) (Geoff Wing) DEFINEMACRO(RXVTMAINTEMAIL)(0) () DEFINEMACRO(RXVTWEBMAINT)(0) (Oezguer Kesim) DEFINEMACRO(RXVTWEBMAINTEMAIL)(0) () DEFINEMACRO(RXVTWEBPAGE)(0) () DEFINEMACRO(RXVTFTPSITE)(0) (ftp://ftp.rxvt.org/pub/rxvt) rxvt-2.7.10/doc/yodl/rxvtRef.yo010064400001440000024000000035060715735701600150030ustar gcwstaffCOMMENT(-- $Id: rxvtRef.yo,v 1.6 2000/09/12 07:38:28 gcw Exp $ --) mailto(gcw@pobox.com) htmlbodyopt(BGCOLOR)(#FFFFFF) notableofcontents() article(Rxvt Technical Reference) (Geoff Wing (gcw@pobox.com)) (18 April 1998) label(toc) COMMENT(----------------------------------------------------------------------- -- Originally written: Mark Olesen, Fri Feb 14 14:16:00 1997 -- Converted to yodl: Geoff Wing ------------------------------------------------------------------------------) COMMENT(--- ---) includefile(masonyodl.yo) startit() it()link(Definitions)(Definitions) it()link(Values)(Values) it()link(Escape Sequences)(Sequences) it()link(CSI (Code Sequence Introducer) Sequences)(CSI) it()link(DEC Private Modes)(PrivateModes) it()link(XTerm Operating System Commands)(XTerm) it()link(menuBar)(menuBar) it()link(XPM)(XPM) it()link(Mouse Reporting)(Mouse) it()link(Special Graphics Mode)(Graphics) it()link(Key Codes)(KeyCodes) endit() Reworked from XTerm documentation and other sources includefile(rxvtRef-definitions.yo) link(Top)(toc) clearpage() includefile(rxvtRef-values.yo) link(Top)(toc) clearpage() includefile(rxvtRef-sequences.yo) link(Top)(toc) clearpage() includefile(rxvtRef-csi.yo) link(Top)(toc) clearpage() includefile(rxvtRef-privatemodes.yo) link(Top)(toc) clearpage() includefile(rxvtRef-xterm.yo) link(Top)(toc) clearpage() includefile(rxvtRef-menubar.yo) link(Top)(toc) clearpage() includefile(rxvtRef-xpm.yo) link(Top)(toc) clearpage() includefile(rxvtRef-mouse.yo) link(Top)(toc) clearpage() includefile(rxvtRef-graphics.yo) link(Top)(toc) clearpage() includefile(rxvtRef-keycodes.yo) link(Top)(toc) rxvt-2.7.10/doc/Makefile.in010064400001440000024000000074020710374476600140720ustar gcwstaff# doc/Makefile.in -*- Makefile -*- # $Id: Makefile.in,v 1.20 2000/05/03 06:40:54 gcw Exp $ @MCOMMON@ srcdir = @srcdir@ VPATH = @srcdir@ .PATH: @srcdir@ basedir = .. thisdir = doc first_rule: all dummy: # # Distribution variables # YODL_RXVT = yodl/rxvt-colours.yo yodl/rxvt-environment.yo\ yodl/rxvt-files.yo yodl/rxvt-fonts.yo yodl/rxvt-login.yo\ yodl/rxvt-mousereporting.yo yodl/rxvt-options.yo\ yodl/rxvt-resources.yo yodl/rxvt-scrollbar.yo\ yodl/rxvt-textselection.yo YODL_RREF = yodl/rxvtRef-csi.yo yodl/rxvtRef-definitions.yo\ yodl/rxvtRef-graphics.yo yodl/rxvtRef-keycodes.yo\ yodl/rxvtRef-menubar.yo yodl/rxvtRef-mouse.yo\ yodl/rxvtRef-privatemodes.yo yodl/rxvtRef-sequences.yo\ yodl/rxvtRef-values.yo yodl/rxvtRef-xpm.yo yodl/rxvtRef-xterm.yo DIST_ETC = etc/rxvt.termcap etc/rxvt.terminfo etc/XTerm.ad DIST_YODL = yodl/masonyodl.yo yodl/versioninfo.yo yodl/versioninfo.yo.in\ $(YODL_RXVT) yodl/rxvt.yo $(YODL_RREF) yodl/rxvtRef.yo DIST_MENU = menu/menu menu/example.menu menu/rxvt.menu menu/rxvt.zh-menu\ menu/terminal.menu menu/jedmenu.sl DIST = Makefile.in README.greek README.menu README.xvt BUGS FAQ TODO\ changes.txt xterm.seq LSM.in rxvt.1 rxvt.tbl rxvtRef.txt\ rxvtRef.html rxvtRef-frame.html rxvtRef-toc.html rxvt.html #------------------------------------------------------------------------- all: rxvt.1 rxvt.1: rxvt.tbl Makefile @if test x$(TBL) = x; then : ; else echo "$(TBL) $(srcdir)/rxvt.tbl | grep -v '^.lf' > rxvt.1"; $(TBL) $(srcdir)/rxvt.tbl | grep -v '^.lf' > rxvt.1 ; fi SEDREPLACE = -e 's%@RXVT_VERSION@%$(VERSION)%g;'\ -e 's%@RXVT_LSMDATE@%$(LSMDATE)%g;'\ -e 's%@RXVT_DATE@%$(DATE)%g;'\ -e 's%@RXVT_MAINTEMAIL@%$(MAINTEMAIL)%g;'\ -e 's%@RXVT_MAINT@%$(MAINT)%g;'\ -e 's%@RXVT_WEBPAGE@%$(WEBPAGE)%g;'\ -e 's%@RXVT_WEBMAINTEMAIL@%$(WEBMAINTEMAIL)%g;'\ -e 's%@RXVT_WEBMAINT@%$(WEBMAINT)%g;'\ -e 's%@RXVT_FTPSITENAME@%$(FTPSITENAME)%g;'\ -e 's%@RXVT_FTPSITEDIR@%$(FTPSITEDIR)%g;' tags allbin: alldoc: $(basedir)/$(VERNAME).lsm yodl/versioninfo.yo rxvt.1 rxvt.html rxvtRef.html rxvtRef.txt yodl/versioninfo.yo: yodl/versioninfo.yo.in ../src/version.h $(SED) $(SEDREPLACE) < $(srcdir)/yodl/versioninfo.yo.in > $@ $(basedir)/$(VERNAME).lsm: LSM.in $(srcdir)/../autoconf/Make.common.in $(srcdir)/../src/version.h $(SED) $(SEDREPLACE) < $(srcdir)/LSM.in > $@ rxvt.tbl: yodl/rxvt.yo $(YODL_RXVT) yodl/masonyodl.yo (cd $(srcdir)/yodl; yodl2man -o../rxvt.tbl rxvt.yo) rxvt.html: yodl/rxvt.yo $(YODL_RXVT) yodl/masonyodl.yo (cd $(srcdir)/yodl; yodl2html -o../rxvt.html rxvt.yo) rxvtRef.html: $(YODL_RREF) yodl/rxvtRef.yo yodl/masonyodl.yo (cd $(srcdir)/yodl; yodl2html -o../rxvtRef.html rxvtRef.yo) rxvtRef.txt: $(YODL_RREF) yodl/rxvtRef.yo yodl/masonyodl.yo (cd $(srcdir)/yodl; yodl2txt -o../rxvtRef.txt rxvtRef.yo) clean: $(RMF) rxvt.man *~ yodl/*~ realclean: clean $(RMF) tags rxvt.1 rxvt.html rxvtRef.html rxvtRef.txt cleandir: realclean distclean: install: $(INSTALL_DATA) rxvt.1 $(DESTDIR)$(mandir)/$(RXVTNAME).$(manext) uninstall: -(cd $(mandir); $(RMF) $(RXVTNAME).$(manext) ) distdirs: mkdir $(basedir)/../$(VERNAME)/$(thisdir) mkdir $(basedir)/../$(VERNAME)/$(thisdir)/etc mkdir $(basedir)/../$(VERNAME)/$(thisdir)/menu mkdir $(basedir)/../$(VERNAME)/$(thisdir)/yodl distcopy: realclean distdepend $(CP) -p $(basedir)/$(VERNAME).lsm $(basedir)/../$(VERNAME); $(CP) -p $(DIST) $(basedir)/../$(VERNAME)/$(thisdir) $(CP) -p $(DIST_ETC) $(basedir)/../$(VERNAME)/$(thisdir)/etc $(CP) -p $(DIST_MENU) $(basedir)/../$(VERNAME)/$(thisdir)/menu $(CP) -p $(DIST_YODL) $(basedir)/../$(VERNAME)/$(thisdir)/yodl distdepend: alldoc # ------------------------------------------------------------------------ # DO NOT DELETE: ugly dependency list follows rxvt-2.7.10/doc/rxvtRef-toc.html010064400001440000024000000015630711145446000151240ustar gcwstaff rxvtRef TOC rxvt-2.7.10/doc/rxvtRef-frame.html010064400001440000024000000003710651657463000154370ustar gcwstaff Rxvt Technical Reference Your browser needs frames rxvt-2.7.10/doc/rxvtRef.html010064400001440000024000001461350764024424600143540ustar gcwstaff Rxvt Technical Reference

Rxvt Technical Reference

Geoff Wing (gcw@pobox.com)

18 April 1998

  • Definitions
  • Values
  • Escape Sequences
  • CSI (Code Sequence Introducer) Sequences
  • DEC Private Modes
  • XTerm Operating System Commands
  • menuBar
  • XPM
  • Mouse Reporting
  • Special Graphics Mode
  • Key Codes
  • Reworked from XTerm documentation and other sources

    Definitions

    c
    The literal character c.

    C
    A single (required) character.

    Ps
    A single (usually optional) numeric parameter, composed of one or more digits.

    Pm
    A multiple numeric parameter composed of any number of single numeric parameters, separated by ; character(s).

    Pt
    A text parameter composed of printable characters.
    Top



    Values

    ENQ
    Enquiry (Ctrl-E) = Send Device Attributes (DA)
    request attributes from terminal == ESC[Psc

    BEL
    Bell (Ctrl-G)

    BS
    Backspace (Ctrl-H)

    TAB
    Horizontal Tab (HT) (Ctrl-I)

    LF
    Line Feed or New Line (NL) (Ctrl-J)

    VT
    Vertical Tab (Ctrl-K) same as LF

    FF
    Form Feed or New Page (NP) (Ctrl-L) same as LF

    CR
    Carriage Return (Ctrl-M)

    SO
    Shift Out (Ctrl-N), invokes the G1 character set.
    Switch to Alternate Character Set

    SI
    Shift In (Ctrl-O), invokes the G0 character set (the default)
    Switch to Standard Character Set

    SPC
    Space Character
    Top



    Escape Sequences

    ESC # 8
    DEC Screen Alignment Test (DECALN)

    ESC 7
    ESC 8
    Save Cursor (SC)
    Restore Cursor

    ESC =
    ESC >
    Application Keypad (SMKX) == ESC[?66h
    Normal Keypad (RMKX) == ESC[?66l

    Note: If the numeric keypad is activated, eg, Num_Lock has been pressed, numbers or control functions are generated by the numeric keypad (see Key Codes)

    ESC D
    Index (IND)

    ESC E
    Next Line (NEL)

    ESC H
    Tab Set (HTS)

    ESC M
    Reverse Index (RI)

    ESC N
    Single Shift Select of G2 Character Set (SS2): affects next character only unimplemented

    ESC O
    Single Shift Select of G3 Character Set (SS3): affects next character only unimplemented

    ESC Z
    Obsolete form of ESC[c
    returns: ESC[?1;2C rxvt compile-time option

    ESC c
    Full reset (RIS)

    ESC n
    Invoke the G2 Character Set (LS2)

    ESC o
    Invoke the G3 Character Set (LS3)

    ESC ( C
    ESC ) C
    ESC * C
    ESC + C
    ESC $ C
    Designate G0 Character Set (ISO 2022)
    Designate G1 Character Set (ISO 2022)
    Designate G2 Character Set (ISO 2022)
    Designate G3 Character Set (ISO 2022)
    Designate Kanji Character Set
    where C is

    Man Page

    Reference
    Definitions
    Values
    Escape
    CSI
    DEC
    XTerm
    menuBar
    XPM
    Mouse
    Graphics
    KeyCodes

    Rxvt Home
    Screenshots

    ) ARG1 \ IFZERO(XXcellcounter)\ (htmlcommand(
    ))\ ()\ htmlcommand(
    text text
    ) ARG2 \ IFZERO(XXcellcounter)\ (htmlcommand(
    ))\ ()\ htmlcommand(
    C = 0 DEC Special Character and Line Drawing Set
    C = A United Kingdom (UK)
    C = B United States (USASCII)
    C = < Multinational character set unimplemented
    C = 5 Finnish character set unimplemented
    C = C Finnish character set unimplemented
    C = K German character set unimplemented
    Top



    CSI (Code Sequence Introducer) Sequences

    ESC [ Ps @
    Insert Ps (Blank) Character(s) [default: 1] (ICH)

    ESC [ Ps A
    Cursor Up Ps Times [default: 1] (CUU)

    ESC [ Ps B
    Cursor Down Ps Times [default: 1] (CUD)
    ESC [ Ps C
    Cursor Forward Ps Times [default: 1] (CUF)

    ESC [ Ps D
    Cursor Backward Ps Times [default: 1] (CUB)

    ESC [ Ps E
    Cursor Down Ps Times [default: 1] and to first column

    ESC [ Ps F
    Cursor Up Ps Times [default: 1] and to first column

    ESC [ Ps G
    Cursor to Column Ps (HPA)

    ESC [ Ps;Ps H
    Cursor Position [row;column] [default: 1;1] (CUP)

    ESC [ Ps I
    Move forward Ps tab stops [default: 1]

    ESC [ Ps J
    Erase in Display (ED)
    Ps = 0 Clear Below (default)
    Ps = 1 Clear Above
    Ps = 2 Clear All
    ESC [ Ps K
    Erase in Line (EL)
    Ps = 0 Clear to Right (default)
    Ps = 1 Clear to Left
    Ps = 2 Clear All
    ESC [ Ps L
    Insert Ps Line(s) [default: 1] (IL)

    ESC [ Ps M
    Delete Ps Line(s) [default: 1] (DL)

    ESC [ Ps P
    Delete Ps Character(s) [default: 1] (DCH)

    ESC [ Ps;Ps;Ps;Ps;Ps T
    Initiate hilite mouse tracking. unimplemented Parameters are [func;startx;starty;firstrow;lastrow].

    ESC [ Ps W
    Tabulator functions
    Ps = 0 Tab Set (HTS)
    Ps = 2 Tab Clear (TBC), Clear Current Column (default)
    Ps = 5 Tab Clear (TBC), Clear All
    ESC [ Ps X
    Erase Ps Character(s) [default: 1] (ECH)

    ESC [ Ps Z
    Move backward Ps [default: 1] tab stops

    ESC [ Ps '
    == ESC [ Ps G

    ESC [ Ps a
    == ESC [ Ps C

    ESC [ Ps c
    Send Device Attributes (DA)
    Ps = 0 (or omitted) : request attributes from terminal
    returns: ESC[?1;2c (``I am a VT100 with Advanced Video Option'')

    ESC [ Ps d
    Cursor to Line Ps (VPA)

    ESC [ Ps e
    == ESC [ Ps A

    ESC [ Ps;Ps f
    Horizontal and Vertical Position [row;column] (HVP) [default: 1;1]

    ESC [ Ps g
    Tab Clear (TBC)
    Ps = 0 Clear Current Column (default)
    Ps = 3 Clear All (TBC)
    ESC [ Ps i
    Printing
    Ps = 4 disable transparent print mode (MC4)
    Ps = 5 enable transparent print mode (MC5) unimplemented
    ESC [ Pm h
    ESC [ Pm l
    Set Mode (SM)
    Reset Mode (RM)
    Ps = 4
    h Insert Mode (SMIR)
    l Replace Mode (RMIR)
    Ps = 20 unimplemented
    h Automatic Newline (LNM)
    h Normal Linefeed (LNM)
    ESC [ Pm m
    Character Attributes (SGR)
    Ps = 0 Normal (default)
    Ps = 1 / 22 On / Off Bold (bright fg)
    Ps = 4 / 24 On / Off Underline
    Ps = 5 / 25 On / Off Blink (bright bg)
    Ps = 7 / 27 On / Off Inverse
    Ps = 30 / 40 fg/bg Black
    Ps = 31 / 41 fg/bg Red
    Ps = 32 / 42 fg/bg Green
    Ps = 33 / 43 fg/bg Yellow
    Ps = 34 / 44 fg/bg Blue
    Ps = 35 / 45 fg/bg Magenta
    Ps = 36 / 46 fg/bg Cyan
    Ps = 37 / 47 fg/bg White
    Ps = 39 / 49 fg/bg Default
    ESC [ Ps n
    Device Status Report (DSR)
    Ps = 5 Status Report ESC [ 0 n (``OK'')
    Ps = 6 Report Cursor Position (CPR) [row;column] as ESC [ r ; c R
    Ps = 7 Request Display Name
    Ps = 8 Request Version Number (place in window title)
    ESC [ Ps;Ps r
    Set Scrolling Region [top;bottom]
    [default: full size of window] (CSR)

    ESC [ s
    Save Cursor (SC)

    ESC [ Ps x
    Request Terminal Parameters (DECREQTPARM)

    ESC [ u
    Restore Cursor
    Top



    DEC Private Modes

    ESC [ ? Pm h
    DEC Private Mode Set (DECSET)

    ESC [ ? Pm l
    DEC Private Mode Reset (DECRST)

    ESC [ ? Pm r
    Restore previously saved DEC Private Mode Values.

    ESC [ ? Pm s
    Save DEC Private Mode Values.

    ESC [ ? Pm t
    Toggle DEC Private Mode Values (rxvt extension).
    where
    Ps = 1 (DECCKM)
    h Application Cursor Keys
    l Normal Cursor Keys
    Ps = 2 (ANSI/VT52 mode)
    h Enter VT52 mode
    l Enter VT52 mode
    Ps = 3
    h 132 Column Mode (DECCOLM)
    l 80 Column Mode (DECCOLM)
    Ps = 4
    h Smooth (Slow) Scroll (DECSCLM)
    l Jump (Fast) Scroll (DECSCLM)
    Ps = 5
    h Reverse Video (DECSCNM)
    l Normal Video (DECSCNM)
    Ps = 6
    h Origin Mode (DECOM)
    l Normal Cursor Mode (DECOM)
    Ps = 7
    h Wraparound Mode (DECAWM)
    l No Wraparound Mode (DECAWM)
    Ps = 8 unimplemented
    h Auto-repeat Keys (DECARM)
    l No Auto-repeat Keys (DECARM)
    Ps = 9 X10 XTerm mouse reporting
    h Send Mouse X & Y on button press.
    l No mouse reporting.
    Ps = 10 (rxvt)
    h menuBar visible
    l menuBar invisible
    Ps = 25
    h Visible cursor {cnorm/cvvis}
    l Invisible cursor {civis}
    Ps = 30
    h scrollBar visisble
    l scrollBar invisisble
    Ps = 35 (rxvt)
    h Allow XTerm Shift+key sequences
    l Disallow XTerm Shift+key sequences
    Ps = 38 unimplemented
    Enter Tektronix Mode (DECTEK)
    Ps = 40
    h Allow 80/132 Mode
    l Disallow 80/132 Mode
    Ps = 44 unimplemented
    h Turn On Margin Bell
    l Turn Off Margin Bell
    Ps = 45 unimplemented
    h Reverse-wraparound Mode
    l No Reverse-wraparound Mode
    Ps = 46 unimplemented

    Ps = 47
    h Use Alternate Screen Buffer
    l Use Normal Screen Buffer
    Ps = 66
    h Application Keypad (DECPAM) == ESC =
    l Normal Keypad (DECPNM) == ESC >
    Ps = 67
    h Backspace key sends BS (DECBKM)
    l Backspace key sends DEL
    Ps = 1000 (X11 XTerm mouse reporting)
    h Send Mouse X & Y on button press and release.
    l No mouse reporting.
    Ps = 1001 (X11 XTerm mouse tracking) unimplemented
    h Use Hilite Mouse Tracking.
    l No mouse reporting.
    Ps = 1010
    h Don't scroll to bottom on TTY output
    l Scroll to bottom on TTY output
    Ps = 1011
    h Scroll to bottom when a key is pressed
    l Don't scroll to bottom when a key is pressed
    Ps = 1047
    h Use Alternate Screen Buffer
    l Use Normal Screen Buffer - clear Alternate Screen Buffer if returning from it
    Ps = 1048
    h Save cursor position
    l Restore cursor position

    Top



    XTerm Operating System Commands

    ESC ] Ps;Pt ST
    Set XTerm Parameters
    8-bit ST: 0x9c,
    7-bit ST sequence: ESC \ (0x1b, 0x5c),
    backwards compatible terminator BEL (0x07) is also accepted.
    Ps = 0 Change Icon Name and Window Title to Pt
    Ps = 1 Change Icon Name to Pt
    Ps = 2 Change Window Title to Pt
    Ps = 4 Pt is a semi-colon separated sequence of one or more semi-colon separated number/name pairs, where number is an index to a colour and name is the name of a colour. Each pair causes the numbered colour to be changed to name.
    Numbers 0-7 corresponds to low-intensity (normal) colours and 8-15 corresponds to high-intensity colours. 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=white
    Ps = 10 (NB: may change in future) menuBar command Pt rxvt compile-time option
    Ps = 12 Change colour of text cursor foreground to Pt
    Ps = 13 Change colour of mouse foreground to Pt
    Ps = 17 Change colour of highlight characters to Pt
    Ps = 18 Change colour of bold characters to Pt
    Ps = 19 Change colour of underlined characters to Pt
    Ps = 20 Change default background pixmap to Pt
    Ps = 39 Change default foreground colour to Pt rxvt compile-time option
    Ps = 46 Change Log File to Pt unimplemented
    Ps = 49 Change default background colour to Pt rxvt compile-time option
    Ps = 50 Set Font to Pt, with the following special values of Pt (rxvt)
    #+n change up n font(s)
    #-n change down n font(s)
    if n is missing of 0, a value of 1 is used
    empty change to font0
    n change to font n
    Ps = 55 Log all scrollback buffer and all of screen to Pt
    Top



    menuBar

    The exact syntax used is almost solidified.
    In the menus, DON'T try to use menuBar commands that add or remove a menuBar.

    Note that in all of the commands, the /path/ cannot be omitted: use ./ to specify a menu relative to the current menu.

    Overview of menuBar operation

    For the menuBar XTerm escape sequence ESC ] 10 ; Pt ST, the syntax of Pt can be used for a variety of tasks:

  • Commands
  • Adding and accessing menus
  • Removing menus
  • Quick Arrows
  • Command Summary
  • At the top level is the current menuBar which is a member of a circular linked-list of other such menuBars.

    The menuBar acts as a parent for the various drop-down menus, which in turn, may have labels, separator lines, menuItems and subMenus.

    The menuItems are the useful bits: you can use them to mimic keyboard input or even to send text or escape sequences back to rxvt.

    The menuBar syntax is intended to provide a simple yet robust method of constructing and manipulating menus and navigating through the menuBars.

    The first step is to use the tag [menu:name] which creates the menuBar called name and allows access. You may now add or remove menus, subMenus, and menuItems. Finally, use the tag [done] to set the menuBar access as readonly to prevent accidental corruption of the menus. To re-access the current menuBar for alterations, use the tag [menu], make the alterations and then use [done]

    Commands

    [menu:name]
    access the named menuBar for creation or alteration. If a new menuBar is created, it is called name (max of 15 chars) and the current menuBar is pushed onto the stack

    [menu]
    access the current menuBar for alteration

    [title:string]
    set the current menuBar's title to string, which may contain the following format specifiers:
    %% : literal % character
    %n : rxvt name (as per the -name command-line option)
    %v : rxvt version

    [done]
    set menuBar access as readonly.
    End-of-file tag for [read:file] operations.

    [read:file]
    read menu commands directly from file (extension ".menu" will be appended if required.) Start reading at a line with [menu] or [menu:name and continuing until [done] is encountered.

    Blank and comment lines (starting with #) are ignored. Actually, since any invalid menu commands are also ignored, almost anything could be construed as a comment line, but this may be tightened up in the future ... so don't count on it!.

    [read:file;name]
    The same as [read:file], but start reading at a line with [menu:name] and continuing until [done:name] or [done] is encountered.

    [dump]
    dump all menuBars to the file /tmp/rxvt-PID in a format suitable for later rereading.

    [rm:name]
    [rm] [rm:]
    [rm*] [rm:*]
    remove the named menuBar
    remove the current menuBar
    remove all menuBars

    [swap]
    swap the top two menuBars

    [prev]
    [next]
    access the previous or next menuBar

    [show]
    [hide]
    control display of the menuBar ... just like ESC[?10 h/l

    [pixmap:name]
    [pixmap:name;scaling]
    set the background pixmap globally ... just like ESC ] 20 ; Pt ST

    A Future implementation may make this local to the menubar

    [:command:]
    ignore the menu readonly status and issue a command to Add/Modify or Remove a menu or menuitem or change the Quick Arrows; a useful shortcut for setting the quick arrows from a menuBar.

    Adding and accessing menus

    The following commands may also be + prefixed.

    /
    ./
    ../
    ../../
    access menuBar top level
    access current menu level
    access parent menu (1 level up)
    access parent menu (multiple levels up)
    /path/menu
    add/access menu
    /path/menu/*
    add/access menu and clear it if it exists
    /path/{-}
    add separator
    /path/{item}
    add item as a label
    /path/{item} action
    add/alter menuitem with an associated action
    /path/{item}{right-text}
    add/alter menuitem with right-text as the right-justified text and as the associated action
    /path/{item}{rtext} action
    add/alter menuitem with an associated action and with rtext as the right-justified text.
    Special characters in action must be backslash-escaped:
    \a \b \E \e \n \r \t \octal
    or in control-character notation:
    ^@, ^A .. ^Z .. ^_, ^?

    To send a string starting with a NUL (^@) character to the program, start action with a pair of NUL characters (^@^@), the first of which will be stripped off and the balance directed to the program. Otherwise if action begins with NUL followed by non-NUL characters, the leading NUL is stripped off and the balance is sent back to rxvt.

    As a convenience for the many Emacs-type editors, action may start with M- (eg, M-$ is equivalent to \E$) and a CR will be appended if missed from M-x commands.

    As a convenience for issuing XTerm ESC] sequences from a menubar (or quick arrow), a BEL (^G) will be appended if needed.

    For example,
    M-xapropos is equivalent to \Exapropos\r
    and
    \E]10;mona;100 is equivalent to \E]10;mona;100\a

    The option {right-rtext} will be right-justified. In the absence of a specified action, this text will be used as the action as well.

    For example,
    /File/{Open}{^X^F} is equivalent to /File/{Open}{^X^F} ^X^F

    The left label is necessary, since it's used for matching, but implicitly hiding the left label (by using same name for both left and right labels), or explicitly hiding the left label (by preceeding it with a dot), makes it possible to have right-justified text only.

    For example,
    /File/{Open}{Open} Open-File-Action
    or hiding it
    /File/{.anylabel}{Open} Open-File-Action

    Removing menus

    -/*
    -/pathmenu
    -/path{item}
    -/path{-}
    remove all menus from the menuBar, the same as [clear]
    remove menu
    remove item
    remove separator
    -/path/menu/*
    remove all items, separators and submenus from menu

    Quick Arrows

    The menus also provide a hook for quick arrows to provide easier user access. If nothing has been explicitly set, the default is to emulate the curror keys. The syntax permits each arrow to be altered individually or all four at once without re-entering their common beginning/end text. For example, to explicitly associate cursor actions with the arrows, any of the following forms could be used:

    <r>Right
    <l>Left
    <u>Up
    <d>Down
    Define actions for the respective arrow buttons
    <b>Begin
    <e>End
    Define common beginning/end parts for quick arrows which used in conjunction with the above <r> <l> <u> <d> constructs

    For example, define arrows individually,
    <u>\E[A
    <d>\E[B
    <r>\E[C
    <l>\E[D
    or all at once
    <u>\E[A<d>\E[B<r>\E[C<l>\E[D
    or more compactly (factoring out common parts)
    <b>\E[<u>A<d>B<r>C<l>D

    Command Summary

    A short summary of the most common commands:

    [menu:name]
    use an existing named menuBar or start a new one
    [menu]
    use the current menuBar
    [title:string]
    set menuBar title
    [done]
    set menu access to readonly and, if reading from a file, signal EOF
    [done:name]
    if reading from a file using [read:file;name] signal EOF
    [rm:name]
    [rm] [rm:]
    [rm*] [rm:*]
    remove named, current, or all menuBar(s)
    [swap]
    swap top two menuBars
    [prev]
    [next]
    access the previous/next menuBar
    [show]
    [hide]
    map/unmap menuBar
    [pixmap;file]
    [pixmap;file;scaling]
    set a background pixmap
    [read:file]
    [read:file;name]
    read in a menu from a file
    [dump]
    dump out all menuBars to /tmp/rxvt-PID
    /
    access menuBar top level
    ./
    ../
    ../../
    access current or parent menu level
    /path/menu
    add/access menu
    /path/{-}
    add separator
    /path/{item}{rtext} action
    add/alter menu item
    ({rtext} and/or action, may be omitted)
    -/*
    remove all menus from the menuBar
    -/path/menu
    remove menu items, separators and submenus from menu
    -/path/menu
    remove menu
    -/path/{item}
    remove item
    -/path/{-}
    remove separator
    <b>Begin<r>Right<l>Left<u>Up<d>Down<e>End
    menu quick arrows
    Top



    XPM

    For the XPM XTerm escape sequence ESC ] 20 ; Pt ST then value of Pt can be the name of the background pixmap followed by a sequence of scaling/positioning commands separated by semi-colons. The scaling/positioning commands are as follows:

    query scale/position
    ?

    change scale and position
    WxH+X+Y
    WxH+X (== WxH+X+X)
    WxH (same as WxH+50+50)
    W+X+Y (same as WxW+X+Y)
    W+X (same as WxW+X+X)
    W (same as WxW+50+50)

    change position (absolute)
    =+X+Y
    =+X (same as =+X+Y)

    change position (relative)
    +X+Y
    +X (same as +X+Y)

    rescale (relative)
    Wx0 -> W *= (W/100)
    0xH -> H *= (H/100)

    For example:

    \E]20;funky\a
    load funky.xpm as a tiled image

    \E]20;mona;100\a
    load mona.xpm with a scaling of 100%

    \E]20;;200;?\a
    rescale the current pixmap to 200% and display the image geometry in the title
    Top



    Mouse Reporting

    ESC [ M <b> <x> <y>
    report mouse position
    The lower 2 bits of <b> indicate the button:
    Button = (<b> - SPACE) & 3
    0 = Button1 pressed
    1 = Button2 pressed
    2 = Button3 pressed
    3 = button released (X11 mouse report)

    The upper bits of <b> indicate the modifiers when the button was pressed and are added together (X11 mouse report only):

    State = (<b> - SPACE) & 60
    4 = Shift
    8 = Meta
    16 = Control
    32 = Double Click (Rxvt extension)
    Col = <x> - SPACE
    Row = <y> - SPACE
    Top



    Special Graphics Mode

    Add more documentation here, if anyone actually cares.

    ESC G Q
    query if graphics are available
    returns: ESC G 0 no graphics available
    returns: ESC G 1 graphics available (colour only)

    ESC G W <;x>;<y>;<w>;<h>:
    create window

    ESC G C <id>
    clear window

    ESC G G <it>:
    query window
    returns: ESC G <id> <x> <y> <w> <h> <fw> <fh> <nw> <nh>

    ESC G L <id>
    ESC G P <id>
    ESC G F <id>
    start point
    start line
    start fill

    ;<x>;<y>
    extend point/line/fill

    ESC G T <id>;<x>;<y>;<mode>;<len>:<text>
    place text
    Top



    Key Codes

    Note: Shift + F1-F10 generates F11-F20

    For the keypad, use Shift to temporarily override Application-Keypad setting use Num_Lock to toggle Application-Keypad setting if Num_Lock is off, escape sequences toggle Application-Keypad setting. Also note that values of Home, End, Delete may have been compiled differently on your system.

    Normal Shift Control Ctrl+Shift
    Tab ^I ESC [ Z ^I ESC [ Z
    BackSpace ^H ^? ^? ^?
    Find ESC [ 1 ~ ESC [ 1 $ ESC [ 1 ^ ESC [ 1 @
    Insert ESC [ 2 ~ paste ESC [ 2 ^ ESC [ 2 @
    Execute ESC [ 3 ~ ESC [ 3 $ ESC [ 3 ^ ESC [ 3 @
    Select ESC [ 4 ~ ESC [ 4 $ ESC [ 4 ^ ESC [ 4 @
    Prior ESC [ 5 ~ scroll-up ESC [ 5 ^ ESC [ 5 @
    Next ESC [ 6 ~ scroll-down ESC [ 6 ^ ESC [ 6 @
    Home ESC [ 7 ~ ESC [ 7 $ ESC [ 7 ^ ESC [ 7 @
    End ESC [ 8 ~ ESC [ 8 $ ESC [ 8 ^ ESC [ 8 @
    Delete ESC [ 3 ~ ESC [ 3 $ ESC [ 3 ^ ESC [ 3 @
    F1 ESC [ 11 ~ ESC [ 23 ~ ESC [ 11 ^ ESC [ 23 ^
    F2 ESC [ 12 ~ ESC [ 24 ~ ESC [ 12 ^ ESC [ 24 ^
    F3 ESC [ 13 ~ ESC [ 25 ~ ESC [ 13 ^ ESC [ 25 ^
    F4 ESC [ 14 ~ ESC [ 26 ~ ESC [ 14 ^ ESC [ 26 ^
    F5 ESC [ 15 ~ ESC [ 28 ~ ESC [ 15 ^ ESC [ 28 ^
    F6 ESC [ 17 ~ ESC [ 29 ~ ESC [ 17 ^ ESC [ 29 ^
    F7 ESC [ 18 ~ ESC [ 31 ~ ESC [ 18 ^ ESC [ 31 ^
    F8 ESC [ 19 ~ ESC [ 32 ~ ESC [ 19 ^ ESC [ 32 ^
    F9 ESC [ 20 ~ ESC [ 33 ~ ESC [ 20 ^ ESC [ 33 ^
    F10 ESC [ 21 ~ ESC [ 34 ~ ESC [ 21 ^ ESC [ 34 ^
    F11 ESC [ 23 ~ ESC [ 23 $ ESC [ 23 ^ ESC [ 23 @
    F12 ESC [ 24 ~ ESC [ 24 $ ESC [ 24 ^ ESC [ 24 @
    F13 ESC [ 25 ~ ESC [ 25 $ ESC [ 25 ^ ESC [ 25 @
    F14 ESC [ 26 ~ ESC [ 26 $ ESC [ 26 ^ ESC [ 26 @
    F15 (Help) ESC [ 28 ~ ESC [ 28 $ ESC [ 28 ^ ESC [ 28 @
    F16 (Menu) ESC [ 29 ~ ESC [ 29 $ ESC [ 29 ^ ESC [ 29 @
    F17 ESC [ 31 ~ ESC [ 31 $ ESC [ 31 ^ ESC [ 31 @
    F18 ESC [ 32 ~ ESC [ 32 $ ESC [ 32 ^ ESC [ 32 @
    F19 ESC [ 33 ~ ESC [ 33 $ ESC [ 33 ^ ESC [ 33 @
    F20 ESC [ 34 ~ ESC [ 34 $ ESC [ 34 ^ ESC [ 34 @
    Application
    Up ESC [ A ESC [ a ESC O a ESC O A
    Down ESC [ B ESC [ b ESC O b ESC O B
    Right ESC [ C ESC [ c ESC O c ESC O C
    Left ESC [ D ESC [ d ESC O d ESC O D
    KP_Enter ^M ESC O M
    KP_F1 ESC O P ESC O P
    KP_F2 ESC O Q ESC O Q
    KP_F3 ESC O R ESC O R
    KP_F4 ESC O S ESC O S
    XK_KP_Multiply * ESC O j
    XK_KP_Add + ESC O k
    XK_KP_Separator , ESC O l
    XK_KP_Subtract - ESC O m
    XK_KP_Decimal . ESC O n
    XK_KP_Divide / ESC O o
    XK_KP_0 0 ESC O p
    XK_KP_1 1 ESC O q
    XK_KP_2 2 ESC O r
    XK_KP_3 3 ESC O s
    XK_KP_4 4 ESC O t
    XK_KP_5 5 ESC O u
    XK_KP_6 6 ESC O v
    XK_KP_7 7 ESC O w
    XK_KP_8 8 ESC O x
    XK_KP_9 9 ESC O y
    Top rxvt-2.7.10/doc/rxvtRef.txt010064400001440000024000000655110764024425100142210ustar gcwstaff TITLE INFORMATION: Rxvt Technical Reference AUTHOR INFORMATION: Geoff Wing (gcw@pobox.com) DATE INFORMATION: 18 April 1998 o Definitions o Values o Escape Sequences o CSI (Code Sequence Introducer) Sequences o DEC Private Modes o XTerm Operating System Commands o menuBar o XPM o Mouse Reporting o Special Graphics Mode o Key Codes Reworked from XTerm documentation and other sources Definitions o c The literal character c. o C A single (required) character. o Ps A single (usually optional) numeric parameter, composed of one or more digits. o Pm A multiple numeric parameter composed of any number of single numeric parameters, separated by ; character(s). o Pt A text parameter composed of printable characters. Top Values o ENQ Enquiry (Ctrl-E) = Send Device Attributes (DA) request attributes from terminal == ESC[Psc o BEL Bell (Ctrl-G) o BS Backspace (Ctrl-H) o TAB Horizontal Tab (HT) (Ctrl-I) o LF Line Feed or New Line (NL) (Ctrl-J) o VT Vertical Tab (Ctrl-K) same as LF o FF Form Feed or New Page (NP) (Ctrl-L) same as LF o CR Carriage Return (Ctrl-M) o SO Shift Out (Ctrl-N), invokes the G1 character set. Switch to Alternate Character Set o SI Shift In (Ctrl-O), invokes the G0 character set (the default) Switch to Standard Character Set o SPC Space Character Top Escape Sequences o ESC # 8 DEC Screen Alignment Test (DECALN) o ESC 7 ESC 8 Save Cursor (SC) Restore Cursor o ESC = ESC > Application Keypad (SMKX) == ESC[?66h Normal Keypad (RMKX) == ESC[?66l Note: If the numeric keypad is activated, eg, Num_Lock has been pressed, numbers or control functions are generated by the numeric keypad (see Key Codes) o ESC D Index (IND) o ESC E Next Line (NEL) o ESC H Tab Set (HTS) o ESC M Reverse Index (RI) o ESC N Single Shift Select of G2 Character Set (SS2): affects next character only unimplemented o ESC O Single Shift Select of G3 Character Set (SS3): affects next character only unimplemented o ESC Z Obsolete form of ESC[c returns: ESC[?1;2C rxvt compile-time option o ESC c Full reset (RIS) o ESC n Invoke the G2 Character Set (LS2) o ESC o Invoke the G3 Character Set (LS3) o ESC ( C ESC ) C ESC * C ESC + C ESC $ C Designate G0 Character Set (ISO 2022) Designate G1 Character Set (ISO 2022) Designate G2 Character Set (ISO 2022) Designate G3 Character Set (ISO 2022) Designate Kanji Character Set where C is C = 0 DEC Special Character and Line Drawing Set C = A United Kingdom (UK) C = B United States (USASCII) C = < Multinational character set unimplemented C = 5 Finnish character set unimplemented C = C Finnish character set unimplemented C = K German character set unimplemented Top CSI (Code Sequence Introducer) Sequences o ESC [ Ps @ Insert Ps (Blank) Character(s) [default: 1] (ICH) o ESC [ Ps A Cursor Up Ps Times [default: 1] (CUU) o ESC [ Ps B Cursor Down Ps Times [default: 1] (CUD) o ESC [ Ps C Cursor Forward Ps Times [default: 1] (CUF) o ESC [ Ps D Cursor Backward Ps Times [default: 1] (CUB) o ESC [ Ps E Cursor Down Ps Times [default: 1] and to first column o ESC [ Ps F Cursor Up Ps Times [default: 1] and to first column o ESC [ Ps G Cursor to Column Ps (HPA) o ESC [ Ps;Ps H Cursor Position [row;column] [default: 1;1] (CUP) o ESC [ Ps I Move forward Ps tab stops [default: 1] o ESC [ Ps J Erase in Display (ED) Ps = 0 Clear Below (default) Ps = 1 Clear Above Ps = 2 Clear All o ESC [ Ps K Erase in Line (EL) Ps = 0 Clear to Right (default) Ps = 1 Clear to Left Ps = 2 Clear All o ESC [ Ps L Insert Ps Line(s) [default: 1] (IL) o ESC [ Ps M Delete Ps Line(s) [default: 1] (DL) o ESC [ Ps P Delete Ps Character(s) [default: 1] (DCH) o ESC [ Ps;Ps;Ps;Ps;Ps T Initiate hilite mouse tracking. unimplemented Parameters are [func;startx;starty;firstrow;lastrow]. o ESC [ Ps W Tabulator functions Ps = 0 Tab Set (HTS) Ps = 2 Tab Clear (TBC), Clear Current Column (default) Ps = 5 Tab Clear (TBC), Clear All o ESC [ Ps X Erase Ps Character(s) [default: 1] (ECH) o ESC [ Ps Z Move backward Ps [default: 1] tab stops o ESC [ Ps ' == ESC [ Ps G o ESC [ Ps a == ESC [ Ps C o ESC [ Ps c Send Device Attributes (DA) Ps = 0 (or omitted) : request attributes from terminal returns: ESC[?1;2c (``I am a VT100 with Advanced Video Option'') o ESC [ Ps d Cursor to Line Ps (VPA) o ESC [ Ps e == ESC [ Ps A o ESC [ Ps;Ps f Horizontal and Vertical Position [row;column] (HVP) [default: 1;1] o ESC [ Ps g Tab Clear (TBC) Ps = 0 Clear Current Column (default) Ps = 3 Clear All (TBC) o ESC [ Ps i Printing Ps = 4 disable transparent print mode (MC4) Ps = 5 enable transparent print mode (MC5) unimplemented o ESC [ Pm h ESC [ Pm l Set Mode (SM) Reset Mode (RM) o Ps = 4 h Insert Mode (SMIR) l Replace Mode (RMIR) o Ps = 20 unimplemented h Automatic Newline (LNM) h Normal Linefeed (LNM) o ESC [ Pm m Character Attributes (SGR) Ps = 0 Normal (default) Ps = 1 / 22 On / Off Bold (bright fg) Ps = 4 / 24 On / Off Underline Ps = 5 / 25 On / Off Blink (bright bg) Ps = 7 / 27 On / Off Inverse Ps = 30 / 40 fg/bg Black Ps = 31 / 41 fg/bg Red Ps = 32 / 42 fg/bg Green Ps = 33 / 43 fg/bg Yellow Ps = 34 / 44 fg/bg Blue Ps = 35 / 45 fg/bg Magenta Ps = 36 / 46 fg/bg Cyan Ps = 37 / 47 fg/bg White Ps = 39 / 49 fg/bg Default o ESC [ Ps n Device Status Report (DSR) Ps = 5 Status Report ESC [ 0 n (``OK'') Ps = 6 Report Cursor Position (CPR) [row;column] as ESC [ r ; c R Ps = 7 Request Display Name Ps = 8 Request Version Number (place in window title) o ESC [ Ps;Ps r Set Scrolling Region [top;bottom] [default: full size of window] (CSR) o ESC [ s Save Cursor (SC) o ESC [ Ps x Request Terminal Parameters (DECREQTPARM) o ESC [ u Restore Cursor Top DEC Private Modes o ESC [ ? Pm h DEC Private Mode Set (DECSET) o ESC [ ? Pm l DEC Private Mode Reset (DECRST) o ESC [ ? Pm r Restore previously saved DEC Private Mode Values. o ESC [ ? Pm s Save DEC Private Mode Values. o ESC [ ? Pm t Toggle DEC Private Mode Values (rxvt extension). where o Ps = 1 (DECCKM) h Application Cursor Keys l Normal Cursor Keys o Ps = 2 (ANSI/VT52 mode) h Enter VT52 mode l Enter VT52 mode o Ps = 3 h 132 Column Mode (DECCOLM) l 80 Column Mode (DECCOLM) o Ps = 4 h Smooth (Slow) Scroll (DECSCLM) l Jump (Fast) Scroll (DECSCLM) o Ps = 5 h Reverse Video (DECSCNM) l Normal Video (DECSCNM) o Ps = 6 h Origin Mode (DECOM) l Normal Cursor Mode (DECOM) o Ps = 7 h Wraparound Mode (DECAWM) l No Wraparound Mode (DECAWM) o Ps = 8 unimplemented h Auto-repeat Keys (DECARM) l No Auto-repeat Keys (DECARM) o Ps = 9 X10 XTerm mouse reporting h Send Mouse X & Y on button press. l No mouse reporting. o Ps = 10 (rxvt) h menuBar visible l menuBar invisible o Ps = 25 h Visible cursor {cnorm/cvvis} l Invisible cursor {civis} o Ps = 30 h scrollBar visisble l scrollBar invisisble o Ps = 35 (rxvt) h Allow XTerm Shift+key sequences l Disallow XTerm Shift+key sequences o Ps = 38 unimplemented Enter Tektronix Mode (DECTEK) o Ps = 40 h Allow 80/132 Mode l Disallow 80/132 Mode o Ps = 44 unimplemented h Turn On Margin Bell l Turn Off Margin Bell o Ps = 45 unimplemented h Reverse-wraparound Mode l No Reverse-wraparound Mode o Ps = 46 unimplemented o Ps = 47 h Use Alternate Screen Buffer l Use Normal Screen Buffer o Ps = 66 h Application Keypad (DECPAM) == ESC = l Normal Keypad (DECPNM) == ESC > o Ps = 67 h Backspace key sends BS (DECBKM) l Backspace key sends DEL o Ps = 1000 (X11 XTerm mouse reporting) h Send Mouse X & Y on button press and release. l No mouse reporting. o Ps = 1001 (X11 XTerm mouse tracking) unimplemented h Use Hilite Mouse Tracking. l No mouse reporting. o Ps = 1010 h Don't scroll to bottom on TTY output l Scroll to bottom on TTY output o Ps = 1011 h Scroll to bottom when a key is pressed l Don't scroll to bottom when a key is pressed o Ps = 1047 h Use Alternate Screen Buffer l Use Normal Screen Buffer - clear Alternate Screen Buffer if returning from it o Ps = 1048 h Save cursor position l Restore cursor position Top XTerm Operating System Commands o ESC ] Ps;Pt ST Set XTerm Parameters 8-bit ST: 0x9c, 7-bit ST sequence: ESC \ (0x1b, 0x5c), backwards compatible terminator BEL (0x07) is also accepted. Ps = 0 Change Icon Name and Window Title to Pt Ps = 1 Change Icon Name to Pt Ps = 2 Change Window Title to Pt Ps = 4 Pt is a semi-colon separated sequence of one or more semi-colon separated number/name pairs, where number is an index to a colour and name is the name of a colour. Each pair causes the numbered colour to be changed to name. Numbers 0-7 corresponds to low-intensity (normal) colours and 8-15 corresponds to high-intensity colours. 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=white Ps = 10 (NB: may change in future) menuBar command Pt rxvt compile-time option Ps = 12 Change colour of text cursor foreground to Pt Ps = 13 Change colour of mouse foreground to Pt Ps = 17 Change colour of highlight characters to Pt Ps = 18 Change colour of bold characters to Pt Ps = 19 Change colour of underlined characters to Pt Ps = 20 Change default background pixmap to Pt Ps = 39 Change default foreground colour to Pt rxvt compile-time option Ps = 46 Change Log File to Pt unimplemented Ps = 49 Change default background colour to Pt rxvt compile-time option Ps = 50 Set Font to Pt, with the following special values of Pt (rxvt) #+n change up n font(s) #-n change down n font(s) if n is missing of 0, a value of 1 is used empty change to font0 n change to font n Ps = 55 Log all scrollback buffer and all of screen to Pt Top menuBar The exact syntax used is almost solidified. In the menus, DON'T try to use menuBar commands that add or remove a menuBar. Note that in all of the commands, the /path/ cannot be omitted: use ./ to specify a menu relative to the current menu. Overview of menuBar operation For the menuBar XTerm escape sequence ESC ] 10 ; Pt ST, the syntax of Pt can be used for a variety of tasks: o Commands o Adding and accessing menus o Removing menus o Quick Arrows o Command Summary At the top level is the current menuBar which is a member of a circular linked-list of other such menuBars. The menuBar acts as a parent for the various drop-down menus, which in turn, may have labels, separator lines, menuItems and subMenus. The menuItems are the useful bits: you can use them to mimic keyboard input or even to send text or escape sequences back to rxvt. The menuBar syntax is intended to provide a simple yet robust method of constructing and manipulating menus and navigating through the menuBars. The first step is to use the tag [menu:name] which creates the menuBar called name and allows access. You may now add or remove menus, subMenus, and menuItems. Finally, use the tag [done] to set the menuBar access as readonly to prevent accidental corruption of the menus. To re-access the current menuBar for alterations, use the tag [menu], make the alterations and then use [done] Commands o [menu:name] access the named menuBar for creation or alteration. If a new menuBar is created, it is called name (max of 15 chars) and the current menuBar is pushed onto the stack o [menu] access the current menuBar for alteration o [title:string] set the current menuBar's title to string, which may contain the following format specifiers: %% : literal % character %n : rxvt name (as per the -name command-line option) %v : rxvt version o [done] set menuBar access as readonly. End-of-file tag for [read:file] operations. o [read:file] read menu commands directly from file (extension ".menu" will be appended if required.) Start reading at a line with [menu] or [menu:name and continuing until [done] is encountered. Blank and comment lines (starting with #) are ignored. Actually, since any invalid menu commands are also ignored, almost anything could be construed as a comment line, but this may be tightened up in the future ... so don't count on it!. o [read:file;name] The same as [read:file], but start reading at a line with [menu:name] and continuing until [done:name] or [done] is encountered. o [dump] dump all menuBars to the file /tmp/rxvt-PID in a format suitable for later rereading. o [rm:name] [rm] [rm:] [rm*] [rm:*] remove the named menuBar remove the current menuBar remove all menuBars o [swap] swap the top two menuBars o [prev] [next] access the previous or next menuBar o [show] [hide] control display of the menuBar ... just like ESC[?10 h/l o [pixmap:name] [pixmap:name;scaling] set the background pixmap globally ... just like ESC ] 20 ; Pt ST A Future implementation may make this local to the menubar o [:command:] ignore the menu readonly status and issue a command to Add/Modify or Remove a menu or menuitem or change the Quick Arrows; a useful shortcut for setting the quick arrows from a menuBar. Adding and accessing menus The following commands may also be + prefixed. o / ./ ../ ../../ access menuBar top level access current menu level access parent menu (1 level up) access parent menu (multiple levels up) o /path/menu add/access menu o /path/menu/* add/access menu and clear it if it exists o /path/{-} add separator o /path/{item} add item as a label o /path/{item} action add/alter menuitem with an associated action o /path/{item}{right-text} add/alter menuitem with right-text as the right-justified text and as the associated action o /path/{item}{rtext} action add/alter menuitem with an associated action and with rtext as the right-justified text. o Special characters in action must be backslash-escaped: \a \b \E \e \n \r \t \octal o or in control-character notation: ^@, ^A .. ^Z .. ^_, ^? To send a string starting with a NUL (^@) character to the program, start action with a pair of NUL characters (^@^@), the first of which will be stripped off and the balance directed to the program. Otherwise if action begins with NUL followed by non-NUL characters, the leading NUL is stripped off and the balance is sent back to rxvt. As a convenience for the many Emacs-type editors, action may start with M- (eg, M-$ is equivalent to \E$) and a CR will be appended if missed from M-x commands. As a convenience for issuing XTerm ESC] sequences from a menubar (or quick arrow), a BEL (^G) will be appended if needed. o For example, M-xapropos is equivalent to \Exapropos\r o and \E]10;mona;100 is equivalent to \E]10;mona;100\a The option {right-rtext} will be right-justified. In the absence of a specified action, this text will be used as the action as well. o For example, /File/{Open}{^X^F} is equivalent to /File/{Open}{^X^F} ^X^F The left label is necessary, since it's used for matching, but implicitly hiding the left label (by using same name for both left and right labels), or explicitly hiding the left label (by preceeding it with a dot), makes it possible to have right-justified text only. o For example, /File/{Open}{Open} Open-File-Action o or hiding it /File/{.anylabel}{Open} Open-File-Action Removing menus o -/* -/pathmenu -/path{item} -/path{-} remove all menus from the menuBar, the same as [clear] remove menu remove item remove separator o -/path/menu/* remove all items, separators and submenus from menu Quick Arrows The menus also provide a hook for quick arrows to provide easier user access. If nothing has been explicitly set, the default is to emulate the curror keys. The syntax permits each arrow to be altered individually or all four at once without re-entering their common beginning/end text. For example, to explicitly associate cursor actions with the arrows, any of the following forms could be used: o Right Left Up Down Define actions for the respective arrow buttons o Begin End Define common beginning/end parts for quick arrows which used in conjunction with the above constructs o For example, define arrows individually, \E[A \E[B \E[C \E[D o or all at once \E[A\E[B\E[C\E[D o or more compactly (factoring out common parts) \E[ABCD Command Summary A short summary of the most common commands: o [menu:name] use an existing named menuBar or start a new one o [menu] use the current menuBar o [title:string] set menuBar title o [done] set menu access to readonly and, if reading from a file, signal EOF o [done:name] if reading from a file using [read:file;name] signal EOF o [rm:name] [rm] [rm:] [rm*] [rm:*] remove named, current, or all menuBar(s) o [swap] swap top two menuBars o [prev] [next] access the previous/next menuBar o [show] [hide] map/unmap menuBar o [pixmap;file] [pixmap;file;scaling] set a background pixmap o [read:file] [read:file;name] read in a menu from a file o [dump] dump out all menuBars to /tmp/rxvt-PID o / access menuBar top level o ./ ../ ../../ access current or parent menu level o /path/menu add/access menu o /path/{-} add separator o /path/{item}{rtext} action add/alter menu item ({rtext} and/or action, may be omitted) o -/* remove all menus from the menuBar o -/path/menu remove menu items, separators and submenus from menu o -/path/menu remove menu o -/path/{item} remove item o -/path/{-} remove separator o BeginRightLeftUpDownEnd menu quick arrows Top XPM For the XPM XTerm escape sequence ESC ] 20 ; Pt ST then value of Pt can be the name of the background pixmap followed by a sequence of scaling/positioning commands separated by semi-colons. The scaling/positioning commands are as follows: o query scale/position ? o change scale and position WxH+X+Y WxH+X (== WxH+X+X) WxH (same as WxH+50+50) W+X+Y (same as WxW+X+Y) W+X (same as WxW+X+X) W (same as WxW+50+50) o change position (absolute) =+X+Y =+X (same as =+X+Y) o change position (relative) +X+Y +X (same as +X+Y) o rescale (relative) Wx0 -> W *= (W/100) 0xH -> H *= (H/100) For example: o \E]20;funky\a load funky.xpm as a tiled image o \E]20;mona;100\a load mona.xpm with a scaling of 100% o \E]20;;200;?\a rescale the current pixmap to 200% and display the image geometry in the title Top Mouse Reporting o ESC [ M report mouse position The lower 2 bits of indicate the button: o Button = ( - SPACE) & 3 0 = Button1 pressed 1 = Button2 pressed 2 = Button3 pressed 3 = button released (X11 mouse report) The upper bits of indicate the modifiers when the button was pressed and are added together (X11 mouse report only): o State = ( - SPACE) & 60 4 = Shift 8 = Meta 16 = Control 32 = Double Click (Rxvt extension) Col = - SPACE Row = - SPACE Top Special Graphics Mode Add more documentation here, if anyone actually cares. o ESC G Q query if graphics are available returns: ESC G 0 no graphics available returns: ESC G 1 graphics available (colour only) o ESC G W <;x>;;;: create window o ESC G C clear window o ESC G G : query window returns: ESC G o ESC G L ESC G P ESC G F start point start line start fill o ;; extend point/line/fill o ESC G T ;;;;: place text Top Key Codes Note: Shift + F1-F10 generates F11-F20 For the keypad, use Shift to temporarily override Application-Keypad setting use Num_Lock to toggle Application-Keypad setting if Num_Lock is off, escape sequences toggle Application-Keypad setting. Also note that values of Home, End, Delete may have been compiled differently on your system. Normal Shift Control Ctrl+Shift Tab ^I ESC [ Z ^I ESC [ Z BackSpace ^H ^? ^? ^? Find ESC [ 1 ~ ESC [ 1 $ ESC [ 1 ^ ESC [ 1 @ Insert ESC [ 2 ~ paste ESC [ 2 ^ ESC [ 2 @ Execute ESC [ 3 ~ ESC [ 3 $ ESC [ 3 ^ ESC [ 3 @ Select ESC [ 4 ~ ESC [ 4 $ ESC [ 4 ^ ESC [ 4 @ Prior ESC [ 5 ~ scroll-up ESC [ 5 ^ ESC [ 5 @ Next ESC [ 6 ~ scroll-down ESC [ 6 ^ ESC [ 6 @ Home ESC [ 7 ~ ESC [ 7 $ ESC [ 7 ^ ESC [ 7 @ End ESC [ 8 ~ ESC [ 8 $ ESC [ 8 ^ ESC [ 8 @ Delete ESC [ 3 ~ ESC [ 3 $ ESC [ 3 ^ ESC [ 3 @ F1 ESC [ 11 ~ ESC [ 23 ~ ESC [ 11 ^ ESC [ 23 ^ F2 ESC [ 12 ~ ESC [ 24 ~ ESC [ 12 ^ ESC [ 24 ^ F3 ESC [ 13 ~ ESC [ 25 ~ ESC [ 13 ^ ESC [ 25 ^ F4 ESC [ 14 ~ ESC [ 26 ~ ESC [ 14 ^ ESC [ 26 ^ F5 ESC [ 15 ~ ESC [ 28 ~ ESC [ 15 ^ ESC [ 28 ^ F6 ESC [ 17 ~ ESC [ 29 ~ ESC [ 17 ^ ESC [ 29 ^ F7 ESC [ 18 ~ ESC [ 31 ~ ESC [ 18 ^ ESC [ 31 ^ F8 ESC [ 19 ~ ESC [ 32 ~ ESC [ 19 ^ ESC [ 32 ^ F9 ESC [ 20 ~ ESC [ 33 ~ ESC [ 20 ^ ESC [ 33 ^ F10 ESC [ 21 ~ ESC [ 34 ~ ESC [ 21 ^ ESC [ 34 ^ F11 ESC [ 23 ~ ESC [ 23 $ ESC [ 23 ^ ESC [ 23 @ F12 ESC [ 24 ~ ESC [ 24 $ ESC [ 24 ^ ESC [ 24 @ F13 ESC [ 25 ~ ESC [ 25 $ ESC [ 25 ^ ESC [ 25 @ F14 ESC [ 26 ~ ESC [ 26 $ ESC [ 26 ^ ESC [ 26 @ F15 (Help) ESC [ 28 ~ ESC [ 28 $ ESC [ 28 ^ ESC [ 28 @ F16 (Menu) ESC [ 29 ~ ESC [ 29 $ ESC [ 29 ^ ESC [ 29 @ F17 ESC [ 31 ~ ESC [ 31 $ ESC [ 31 ^ ESC [ 31 @ F18 ESC [ 32 ~ ESC [ 32 $ ESC [ 32 ^ ESC [ 32 @ F19 ESC [ 33 ~ ESC [ 33 $ ESC [ 33 ^ ESC [ 33 @ F20 ESC [ 34 ~ ESC [ 34 $ ESC [ 34 ^ ESC [ 34 @ Application Up ESC [ A ESC [ a ESC O a ESC O A Down ESC [ B ESC [ b ESC O b ESC O B Right ESC [ C ESC [ c ESC O c ESC O C Left ESC [ D ESC [ d ESC O d ESC O D KP_Enter ^M ESC O M KP_F1 ESC O P ESC O P KP_F2 ESC O Q ESC O Q KP_F3 ESC O R ESC O R KP_F4 ESC O S ESC O S XK_KP_Multiply * ESC O j XK_KP_Add + ESC O k XK_KP_Separator , ESC O l XK_KP_Subtract - ESC O m XK_KP_Decimal . ESC O n XK_KP_Divide / ESC O o XK_KP_0 0 ESC O p XK_KP_1 1 ESC O q XK_KP_2 2 ESC O r XK_KP_3 3 ESC O s XK_KP_4 4 ESC O t XK_KP_5 5 ESC O u XK_KP_6 6 ESC O v XK_KP_7 7 ESC O w XK_KP_8 8 ESC O x XK_KP_9 9 ESC O y Top rxvt-2.7.10/doc/rxvt.tbl010064400001440000024000000667510764024231700135360ustar gcwstaff.TH "RXVT" "1" "26 MARCH 2003" "X Version 11" "X Tools" .SH "NAME" rxvt (ouR XVT) \- a VT102 emulator for the X window system .PP .SH "SYNOPSIS" .PP \fBrxvt\fP [options] [-e command [ args ]] .PP .SH "DESCRIPTION" .PP \fBrxvt\fP, version \fB2\&.7\&.10\fP, is a colour vt102 terminal emulator intended as an \fIxterm\fP(1) replacement for users who do not require features such as Tektronix 4014 emulation and toolkit-style configurability\&. As a result, \fBrxvt\fP uses much less swap space -- a significant advantage on a machine serving many X sessions\&. .PP .PP .SH "OPTIONS" .PP The \fBrxvt\fP options (mostly a subset of \fIxterm\fP\'s) are listed below\&. In keeping with the smaller-is-better philosophy, options may be eliminated or default values chosen at compile-time, so options and defaults listed may not accurately reflect the version installed on your system\&. `rxvt -h\' gives a list of major compile-time options on the \fIOptions\fP line\&. Option descriptions may be prefixed with which compile option each is dependent upon\&. e\&.g\&. `Compile \fIXIM\fP:\' requires \fIXIM\fP on the \fIOptions\fP line\&. Note: `rxvt -help\' gives a list of all command-line options compiled into your version\&. .PP Note that \fBrxvt\fP permits the resource name to be used as a long-option (--/++ option) so the potential command-line options are far greater than those listed\&. For example: `rxvt --loginShell --color1 Orange\'\&. .PP Also note that if you do not explictly specify a font (\fB-fn\fP and \fB-fm\fP) or a multichar encoding method (\fB-km\fP), rxvt will select a font for the preferable encoding according to your locale\&. Supported encodings are: \fBISO-8859-\fPn (n=\fB1\fP\&.\&.\&.\fB15\fP), \fBKOI8-R\fP, \fBKOI8-U\fP, \fBEUC-JP\fP, \fBShift_JIS\fP, \fBEUC-KR\fP, \fBEUC-CN\fP (aka \fBGB\fP), and \fBBig5\fP\&. .PP The following options are available: .PP .IP "\fB-help\fP, \fB--help\fP" Print out a message describing available options\&. .IP "\fB-display\fP \fIdisplayname\fP" Attempt to open a window on the named X display (\fB-d\fP still respected)\&. In the absence of this option, the display specified by the \fBDISPLAY\fP environment variable is used\&. .IP "\fB-geometry\fP \fIgeom\fP" Window geometry (\fB-g\fP still respected); resource \fBgeometry\fP\&. .IP "\fB-rv\fP|\fB+rv\fP" Turn on/off simulated reverse video; resource \fBreverseVideo\fP\&. .IP "\fB-j\fP|\fB+j\fP" Turn on/off jump scrolling; resource \fBjumpScroll\fP\&. .IP "\fB-ip\fP|\fB+ip\fP" Turn on/off inheriting parent window\'s pixmap\&. Alternative form is \fB-tr\fP; resource \fBinheritPixmap\fP\&. .IP "\fB-bg\fP \fIcolour\fP" Window background colour; resource \fBbackground\fP\&. .IP "\fB-fg\fP \fIcolour\fP" Window foreground colour; resource \fBforeground\fP\&. .IP "\fB-pixmap:\fP \fIfile[;geom]\fP" Compile \fIXPM\fP: Specify XPM file for the background and also optionally specify its scaling with a geometry string\&. Note you may need to add quotes to avoid special shell interpretation of the `;\' in the command-line; resource \fBbackgroundPixmap\fP\&. .IP "\fB-cr\fP \fIcolour\fP" The cursor colour; resource \fBcursorColor\fP\&. .IP "\fB-pr\fP \fIcolour\fP" The mouse pointer colour; resource \fBpointerColor\fP\&. .IP "\fB-bd\fP \fIcolour\fP" The colour of the border between the xterm scrollbar and the text; resource \fBborderColor\fP\&. .IP "\fB-fn\fP \fIfontname\fP" Main normal text font; resource \fBfont\fP\&. .IP "\fB-fb\fP \fIfontname\fP" Main bold text font; resource \fBboldFont\fP\&. .IP "\fB-fm\fP \fIfontname\fP" Main multicharacter font; resource \fBmfont\fP\&. .IP "\fB-km\fP \fImode\fP" Compile \fImultichar_languages\fP: Multiple-character font-set encoding mode; \fBeucj\fP: EUC Japanese encoding\&. \fBsjis\fP: Shift JIS encoding\&. \fBbig5\fP: BIG5 encoding\&. \fBgb\fP: GB encoding\&. \fBkr\fP: EUC Korean encoding\&. \fBnoenc\fP: no encoding; resource \fBmultichar_encoding\fP\&. .IP "\fB-grk\fP \fImode\fP" Compile \fIGreek\fP: Greek keyboard translation; \fBiso\fP: ISO-8859 mapping\&. \fBibm\fP: IBM-437 mapping; resource \fBgreek_keyboard\fP\&. .IP "\fB-name\fP \fIname\fP" Specify the application name under which resources are to be obtained, rather than the default executable file name\&. Name should not contain `\&.\' or `*\' characters\&. Also sets the icon and title name\&. .IP "\fB-ls\fP|\fB+ls\fP" Start as a login-shell/sub-shell; resource \fBloginShell\fP\&. .IP "\fB-ut\fP|\fB+ut\fP" Compile \fIutmp\fP: Inhibit/enable writing a utmp entry; resource \fButmpInhibit\fP\&. .IP "\fB-vb\fP|\fB+vb\fP" Turn on/off visual bell on receipt of a bell character; resource \fBvisualBell\fP\&. .IP "\fB-sb\fP|\fB+sb\fP" Turn on/off scrollbar; resource \fBscrollBar\fP\&. .IP "\fB-si\fP|\fB+si\fP" Turn on/off scroll-to-bottom on TTY output inhibit; resource \fBscrollTtyOutput\fP has opposite effect\&. .IP "\fB-sk\fP|\fB+sk\fP" Turn on/off scroll-to-bottom on keypress; resource \fBscrollTtyKeypress\fP\&. .IP "\fB-sw\fP|\fB+sw\fP" Turn on/off scrolling with the scrollback buffer as new lines appear\&. This only takes effect if \fB-si\fP is also given; resource \fBscrollWithBuffer\fP\&. .IP "\fB-sr\fP|\fB+sr\fP" Put scrollbar on right/left; resource \fBscrollBar_right\fP\&. .IP "\fB-st\fP|\fB+st\fP" Display normal (non XTerm/NeXT) scrollbar without/with a trough; resource \fBscrollBar_floating\fP\&. .IP "\fB-mcc\fP|\fB+mcc\fP" Compile \fImultichar_languages\fP: treat multibyte glyphs as single character for backspace, delete and cursor movement keys; resource \fBmultibyte_cursor\fP\&. .IP "\fB-iconic\fP" Start iconified, if the window manager supports that option\&. Alternative form is \fB-ic\fP\&. .IP "\fB-sl\fP \fInumber\fP" Save \fInumber\fP lines in the scrollback buffer\&. See resource entry for limits; resource \fBsaveLines\fP\&. .IP "\fB-b\fP \fInumber\fP" Compile \fIfrills\fP: Internal border of \fInumber\fP pixels\&. See resource entry for limits; resource \fBinternalBorder\fP\&. .IP "\fB-w\fP \fInumber\fP" Compile \fIfrills\fP: External border of \fInumber\fP pixels\&. Also, \fB-bw\fP and \fB-borderwidth\fP\&. See resource entry for limits; resource \fBexternalBorder\fP\&. .IP "\fB-lsp\fP \fInumber\fP" Compile \fIlinespace\fP: Lines (pixel height) to insert between each row of the display; resource \fBlinespace\fP\&. .IP "\fB-tn\fP \fItermname\fP" This option specifies the name of the terminal type to be set in the \fBTERM\fP environment variable\&. This terminal type must exist in the \fItermcap(5)\fP database and should have \fIli#\fP and \fIco#\fP entries; resource \fBtermName\fP\&. .IP "\fB-e\fP \fIcommand [arguments]\fP" Run the command with its command-line arguments in the \fBrxvt\fP window; also sets the window title and icon name to be the basename of the program being executed if neither \fI-title\fP (\fI-T\fP) nor \fI-n\fP are given on the command line\&. If this option is used, it must be the last on the command-line\&. If there is no \fB-e\fP option then the default is to run the program specified by the \fBSHELL\fP environment variable or, failing that, \fIsh(1)\fP\&. .IP "\fB-title\fP \fItext\fP" Window title (\fB-T\fP still respected); the default title is the basename of the program specified after the \fB-e\fP option, if any, otherwise the application name; resource \fBtitle\fP\&. .IP "\fB-n\fP \fItext\fP" Icon name; the default name is the basename of the program specified after the \fB-e\fP option, if any, otherwise the application name; resource \fBiconName\fP\&. .IP "\fB-C\fP" Capture system console messages\&. .IP "\fB-pt\fP \fIstyle\fP" Compile \fIXIM\fP: input style for input method; \fBOverTheSpot\fP, \fBOffTheSpot\fP, \fBRoot\fP; resource \fBpreeditType\fP\&. .IP "\fB-im\fP \fItext\fP" Compile \fIXIM\fP: input method name\&. resource \fBinputMethod\fP\&. .IP "\fB-mod\fP \fImodifier\fP" Override detection of Meta modifier with specified key: \fBalt\fP, \fBmeta\fP, \fBhyper\fP, \fBsuper\fP, \fBmod1\fP, \fBmod2\fP, \fBmod3\fP, \fBmod4\fP, \fBmod5\fP; resource \fImodifier\fP\&. .IP "\fB-xrm\fP \fIresourcestring\fP" No effect on rxvt\&. Simply passes through an argument to be made available in the instance\'s argument list\&. Appears in \fIWM_COMMAND\fP in some window managers\&. .SH "RESOURCES (available also as long-options)" .PP Note: `rxvt --help\' gives a list of all resources (long options) compiled into your version\&. If compiled with internal Xresources support (i\&.e\&. \fBrxvt -h\fP lists \fB\&.Xdefaults\fP) then \fBrxvt\fP accepts application defaults set in XAPPLOADDIR/Rxvt (compile-time defined: usually \fB/usr/lib/X11/app-defaults/Rxvt\fP) and resources set in \fB~/\&.Xdefaults\fP, or \fB~/\&.Xresources\fP if \fB~/\&.Xdefaults\fP does not exist\&. Note that when reading X resources, \fBrxvt\fP recognizes two class names: \fBXTerm\fP and \fBRxvt\fP\&. The class name \fBXTerm\fP allows resources common to both \fBrxvt\fP and \fIxterm\fP to be easily configured, while the class name \fBRxvt\fP allows resources unique to \fBrxvt\fP, notably colours and key-handling, to be shared between different \fBrxvt\fP configurations\&. If no resources are specified, suitable defaults will be used\&. Command-line arguments can be used to override resource settings\&. The following resources are allowed: .PP .IP "\fBgeometry:\fP \fIgeom\fP" Create the window with the specified X window geometry [default 80x24]; option \fB-geometry\fP\&. .IP "\fBbackground:\fP \fIcolour\fP" Use the specified colour as the window\'s background colour [default White]; option \fB-bg\fP\&. .IP "\fBforeground:\fP \fIcolour\fP" Use the specified colour as the window\'s foreground colour [default Black]; option \fB-fg\fP\&. .IP "\fBcolor\fP\fIn\fP\fB:\fP \fIcolour\fP" Use the specified colour for the colour value \fIn\fP, where 0-7 corresponds to low-intensity (normal) colours and 8-15 corresponds to high-intensity (bold = bright foreground, blink = bright background) colours\&. The canonical names are as follows: 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=white, but the actual colour names used are listed in the \fBCOLORS AND GRAPHICS\fP section\&. .IP "\fBcolorBD:\fP \fIcolour\fP" Use the specified colour to display bold characters when the foreground colour is the default\&. .IP "\fBcolorUL:\fP \fIcolour\fP" Use the specified colour to display underlined characters when the foreground colour is the default\&. .IP "\fBcolorRV:\fP \fIcolour\fP" Use the specified colour as the background for reverse video characters\&. .IP "\fBcursorColor:\fP \fIcolour\fP" Use the specified colour for the cursor\&. The default is to use the foreground colour; option \fB-cr\fP\&. .IP "\fBcursorColor2:\fP \fIcolour\fP" Use the specified colour for the colour of the cursor text\&. For this to take effect, \fBcursorColor\fP must also be specified\&. The default is to use the background colour\&. .IP "\fBreverseVideo:\fP \fIboolean\fP" \fBTrue\fP: simulate reverse video by foreground and background colours; option \fB-rv\fP\&. \fBFalse\fP: regular screen colours [default]; option \fB+rv\fP\&. See note in \fBCOLORS AND GRAPHICS\fP section\&. .IP "\fBjumpScroll:\fP \fIboolean\fP" \fBTrue\fP: specify that jump scrolling should be used\&. When scrolling quickly, fewer screen updates are performed [default]; option \fB-j\fP\&. \fBFalse\fP: specify that smooth scrolling should be used; option \fB+j\fP\&. .IP "\fBinheritPixmap:\fP \fIboolean\fP" \fBTrue\fP: make the background inherit the parent windows\' pixmap, giving artificial transparency\&. \fBFalse\fP: do not inherit the parent windows\' pixmap\&. .IP "\fBscrollColor:\fP \fIcolour\fP" Use the specified colour for the scrollbar [default #B2B2B2]\&. .IP "\fBtroughColor:\fP \fIcolour\fP" Use the specified colour for the scrollbar\'s trough area [default #969696]\&. Only relevant for normal (non XTerm/NeXT) scrollbar\&. .IP "\fBbackgroundPixmap:\fP \fIfile[;geom]\fP" Use the specified XPM file (note the `\&.xpm\' extension is optional) for the background and also optionally specify its scaling with a geometry string \fBWxH+X+Y\fP, in which \fB"W" / "H"\fP specify the horizontal/vertical scale (percent) and \fB"X" / "Y"\fP locate the image centre (percent)\&. A scale of 0 displays the image with tiling\&. A scale of 1 displays the image without any scaling\&. A scale of 2 to 9 specifies an integer number of images in that direction\&. No image will be magnified beyond 10 times its original size\&. The maximum permitted scale is 1000\&. [default 0x0+50+50] .IP "\fBmenu:\fP \fIfile[;tag]\fP" Read in the specified menu file (note the `\&.menu\' extension is optional) and also optionally specify a starting tag to find\&. See the reference documentation for details on the syntax for the menuBar\&. .IP "\fBpath:\fP \fIpath\fP" Specify the colon-delimited search path for finding files (XPM and menus), in addition to the paths specified by the \fBRXVTPATH\fP and \fBPATH\fP environment variables\&. .IP "\fBfont:\fP \fIfontname\fP" Select the main text font used [default 7x14]; option \fB-fn\fP\&. .IP "\fBfont\fP\fIn\fP\fB:\fP \fIfontname\fP" Specify the alternative font \fIn\fP\&. The default font values: .br .RS .IP .TS tab(`); l l . \fBfont\fP: `\ 7x14 \fBfont1\fP: `\ 6x10 \fBfont2\fP: `\ 6x13 \fBfont3\fP: `\ 8x13 \fBfont4\fP: `\ 9x15 .TE .RE .IP .IP "\fBboldFont:\fP \fIfontname\fP" Specify the name of the bold font to use if \fBcolorBD\fP has not been specified and it is not possible to map the default foreground colour to colour 8-15 [default NONE]\&. This font must be the same height and width as the normal font; option \fB-fb\fP\&. .IP "\fBmfont:\fP \fIfontname\fP" Select the main multiple-character text font used [default k14]; option \fB-fk\fP\&. .IP "\fBmfont\fP\fIn\fP\fB:\fP \fIfontname\fP" Specify the alternative multiple-character font \fIn\fP\&. If compiled for multiple-character fonts, the Roman and multiple-character font sizes should match\&. .IP "\fBmultichar_encoding:\fP \fImode\fP" Set the encoding mode to be used when multicharacter encoding is received; \fBeucj\fP: EUC Japanese encoding [default for Kanji]\&. \fBsjis\fP: Shift JIS encoding\&. \fBbig5\fP: BIG5 encoding\&. \fBgb\fP: GB encoding\&. \fBkr\fP: EUC Korean encoding\&. \fBnoenc\fP: no encoding; option \fB-km\fP\&. .IP "\fBgreek_keyboard:\fP \fImode\fP" Set the Greek keyboard translation mode to be used; \fBiso\fP: ISO-8859 mapping (elot-928) [default]\&. \fBibm\fP: IBM-437 mapping (DOS codepage 737); option \fB-grk\fP\&. .IP "\fBgreektoggle_key:\fP \fIkeysym\fP" Set the key to toggle keyboard input between no translation and Greek translation [default \fBMode_switch\fP]\&. For more details, see the distributed file \fBREADME\&.greek\fP\&. .IP "\fBselectstyle:\fP \fImode\fP" Set mouse selection style to \fBold\fP which is 2\&.20, \fBoldword\fP which is xterm style with 2\&.20 old word selection, or anything else which gives xterm style selection\&. .IP "\fBscrollstyle:\fP \fImode\fP" Set scrollbar style to \fBrxvt\fP, \fBnext\fP or \fBxterm\fP .IP "\fBtitle:\fP \fIstring\fP" Set window title string, the default title is the command-line specified after the \fB-e\fP option, if any, otherwise the application name; option \fB-title\fP\&. .IP "\fBiconName:\fP \fIstring\fP" Set the name used to label the window\'s icon or displayed in an icon manager window, it also sets the window\'s title unless it is explicitly set; option \fB-n\fP\&. .IP "\fBmapAlert:\fP \fIboolean\fP" \fBTrue\fP: de-iconify (map) on receipt of a bell character\&. \fBFalse\fP: no de-iconify (map) on receipt of a bell character [default]\&. .IP "\fBvisualBell:\fP \fIboolean\fP" \fBTrue\fP: use visual bell on receipt of a bell character; option \fB-vb\fP\&. \fBFalse\fP: no visual bell [default]; option \fB+vb\fP\&. .IP "\fBloginShell:\fP \fIboolean\fP" \fBTrue\fP: start as a login shell by prepending a `-\' to \fBargv[0]\fP of the shell; option \fB-ls\fP\&. \fBFalse\fP: start as a normal sub-shell [default]; option \fB+ls\fP\&. .IP "\fButmpInhibit:\fP \fIboolean\fP" \fBTrue\fP: inhibit writing record into the system log file \fButmp\fP; option \fB-ut\fP\&. \fBFalse\fP: write record into the system log file \fButmp\fP [default]; option \fB+ut\fP\&. .IP "\fBprint-pipe:\fP \fIstring\fP" Specify a command pipe for vt100 printer [default \fIlpr(1)\fP]\&. Use \fBPrint\fP to initiate a screen dump to the printer and \fBCtrl-Print\fP or \fBShift-Print\fP to include the scrollback as well\&. .IP "\fBscrollBar:\fP \fIboolean\fP" \fBTrue\fP: enable the scrollbar [default]; option \fB-sb\fP\&. \fBFalse\fP: disable the scrollbar; option \fB+sb\fP\&. .IP "\fBscrollBar_right:\fP \fIboolean\fP" \fBTrue\fP: place the scrollbar on the right of the window; option \fB-sr\fP\&. \fBFalse\fP: place the scrollbar on the left of the window; option \fB+sr\fP\&. .IP "\fBscrollBar_floating:\fP \fIboolean\fP" \fBTrue\fP: display an rxvt scrollbar without a trough; option \fB-st\fP\&. \fBFalse\fP: display an rxvt scrollbar with a trough; option \fB+st\fP\&. .IP "\fBscrollBar_align:\fP \fImode\fP" Align the \fBtop\fP, \fBbottom\fP or \fBcentre\fP [default] of the scrollbar thumb with the pointer on middle button press/drag\&. .IP "\fBscrollTtyOutput:\fP \fIboolean\fP" \fBTrue\fP: scroll to bottom when tty receives output; option(+si)\&. \fBFalse\fP: do not scroll to bottom when tty receives output; option(-si)\&. .IP "\fBscrollWithBuffer:\fP \fIboolean\fP" \fBTrue\fP: scroll with scrollback buffer when tty recieves new lines (and \fBscrollTtyOutput\fP is False); option(+sw)\&. \fBFalse\fP: do not scroll with scrollback buffer when tty recieves new lines; option(-sw)\&. .IP "\fBscrollTtyKeypress:\fP \fIboolean\fP" \fBTrue\fP: scroll to bottom when a non-special key is pressed\&. Special keys are those which are intercepted by rxvt for special handling and are not passed onto the shell; option(-sk)\&. \fBFalse\fP: do not scroll to bottom when a non-special key is pressed; option(+sk)\&. .IP "\fBsmallfont_key:\fP \fIkeysym\fP" If enabled, use \fBAlt-\fP\fIkeysym\fP to toggle to a smaller font [default \fBAlt-<\fP] .IP "\fBbigfont_key:\fP \fIkeysym\fP" If enabled, use \fBAlt-\fP\fIkeysym\fP to toggle to a bigger font [default \fBAlt->\fP] .IP "\fBsaveLines:\fP \fInumber\fP" Save \fInumber\fP lines in the scrollback buffer [default 64]\&. This resource is limited on most machines to 65535; option \fB-sl\fP\&. .IP "\fBinternalBorder:\fP \fInumber\fP" Internal border of \fInumber\fP pixels\&. This resource is limited to 100; option \fB-b\fP\&. .IP "\fBexternalBorder:\fP \fInumber\fP" External border of \fInumber\fP pixels\&. This resource is limited to 100; option \fB-w\fP, \fB-bw\fP, \fB-borderwidth\fP\&. .IP "\fBtermName:\fP \fItermname\fP" Specifies the terminal type name to be set in the \fBTERM\fP environment variable; option \fB-tn\fP\&. .IP "\fBlinespace:\fP \fInumber\fP" Specifies number of lines (pixel height) to insert between each row of the display [default 0]; option \fB-lsp\fP\&. .IP "\fBmeta8:\fP \fIboolean\fP" \fBTrue\fP: handle Meta (Alt) + keypress to set the 8th bit\&. \fBFalse\fP: handle Meta (Alt) + keypress as an escape prefix [default]\&. .IP "\fBmouseWheelScrollPage:\fP \fIboolean\fP" \fBTrue\fP: the mouse wheel scrolls a page full\&. \fBFalse\fP: the mouse wheel scrolls five lines [default]\&. .IP "\fBmultibyte_cursor:\fP \fIboolean\fP" \fBTrue\fP: consider multibyte glyphs as single character for backspace, delete and cursor movement keys; option \fB-mcc\fP\&. \fBFalse\fP: move through all components of all glyphs; option \fB+mcc\fP\&. .IP "\fBbackspacekey:\fP \fIstring\fP" The string to send when the backspace key is pressed\&. If set to \fBDEC\fP or unset it will send \fBDelete\fP (code 127) or, if shifted, \fBBackspace\fP (code 8) - which can be reversed with the appropriate DEC private mode escape sequence\&. .IP "\fBdeletekey:\fP \fIstring\fP" The string to send when the delete key (not the keypad delete key) is pressed\&. If unset it will send the sequence traditionally associated with the \fBExecute\fP key\&. .IP "\fBcutchars:\fP \fIstring\fP" The characters used as delimiters for double-click word selection\&. The built-in default: .br \fBBACKSLASH `"\'&()*,;<=>?@[]{|}\fP .IP "\fBpreeditType:\fP \fIstyle\fP" \fBOverTheSpot\fP, \fBOffTheSpot\fP, \fBRoot\fP; option \fB-pt\fP\&. .IP "\fBinputMethod:\fP \fIname\fP" \fIname\fP of inputMethod to use; option \fB-im\fP\&. .IP "\fBmodifier:\fP \fImodifier\fP" Set the key to be interpreted as the Meta key to: \fBalt\fP, \fBmeta\fP, \fBhyper\fP, \fBsuper\fP, \fBmod1\fP, \fBmod2\fP, \fBmod3\fP, \fBmod4\fP, \fBmod5\fP; option \fB-mod\fP\&. .IP "\fBanswerbackString:\fP \fIstring\fP" Specify the reply rxvt sends to the shell when an ENQ (control-E) character is passed through\&. It may contain escape values as described in the entry on \fBkeysym\fP following\&. .IP "\fBkeysym\&.\fP\fIsym\fP: \fIstring\fP" Associate \fIstring\fP with keysym \fIsym\fP (\fB0xFF00 - 0xFFFF\fP)\&. It may contain escape values (\ea: bell, \eb: backspace, \ee, \eE: escape, \en: newline, \er: return, \et: tab, \e000: octal number) or control characters (^?: delete, ^@: null, ^A \&.\&.\&.) and may enclosed with double quotes so that it can start or end with whitespace\&. The intervening resource name \fBkeysym\&.\fP cannot be omitted\&. This resource is only available when compiled with KEYSYM_RESOURCE\&. .SH "THE SCROLLBAR" .PP Lines of text that scroll off the top of the \fBrxvt\fP window (resource: \fBsaveLines\fP) and can be scrolled back using the scrollbar or by keystrokes\&. The normal \fBrxvt\fP scrollbar has arrows and its behaviour is fairly intuitive\&. The \fBxterm-scrollbar\fP is without arrows and its behaviour mimics that of \fIxterm\fP .PP Scroll down with \fBButton1\fP (\fBxterm-scrollbar\fP) or \fBShift-Next\fP\&. Scroll up with \fBButton3\fP (\fBxterm-scrollbar\fP) or \fBShift-Prior\fP\&. Continuous scroll with \fBButton2\fP\&. .SH "MOUSE REPORTING" .PP To temporarily override mouse reporting, for either the scrollbar or the normal text selection/insertion, hold either the Shift or the Meta (Alt) key while performing the desired mouse action\&. .PP If mouse reporting mode is active, the normal scrollbar actions are disabled -- on the assumption that we are using a fullscreen application\&. Instead, pressing Button1 and Button3 sends \fBESC[6~\fP (Next) and \fBESC[5~\fP (Prior), respectively\&. Similarly, clicking on the up and down arrows sends \fBESC[A\fP (Up) and \fBESC[B\fP (Down), respectively\&. .SH "TEXT SELECTION AND INSERTION" .PP The behaviour of text selection and insertion mechanism is similar to \fIxterm\fP(1)\&. .PP .IP "\fBSelection\fP:" Left click at the beginning of the region, drag to the end of the region and release; Right click to extend the marked region; Left double-click to select a word; Left triple-click to select the entire line\&. .IP .IP "\fBInsertion\fP:" Pressing and releasing the Middle mouse button (or \fBShift-Insert\fP) in an \fBrxvt\fP window causes the current text selection to be inserted as if it had been typed on the keyboard\&. .SH "CHANGING FONTS" .PP You can change fonts on-the-fly, which is to say cycle through the default font and others of various sizes, by using \fBShift-KP_Add\fP and \fBShift-KP_Subtract\fP\&. Or, alternatively (if enabled) with \fBAlt->\fP and \fBAlt-<\fP, where the actual key can be selected using resources \fBsmallfont_key\fP/\fBbigfont_key\fP\&. .SH "LOGIN STAMP" .PP \fBrxvt\fP tries to write an entry into the \fIutmp\fP(5) file so that it can be seen via the \fIwho(1)\fP command, and can accept messages\&. To allow this feature, \fBrxvt\fP must be installed setuid root on some systems\&. .SH "COLORS AND GRAPHICS" .PP If graphics support was enabled at compile-time, \fBrxvt\fP can be queried with ANSI escape sequences and can address individual pixels instead of text characters\&. Note the graphics support is still considered beta code\&. .PP In addition to the default foreground and background colours, \fBrxvt\fP can display up to 16 colours (8 ANSI colours plus high-intensity bold/blink versions of the same)\&. Here is a list of the colours with their \fBrgb\&.txt\fP names\&. .PP .TS tab(`); l l l . \fBcolor0\fP `\ (black) `\ = Black \fBcolor1\fP `\ (red) `\ = Red3 \fBcolor2\fP `\ (green) `\ = Green3 \fBcolor3\fP `\ (yellow) `\ = Yellow3 \fBcolor4\fP `\ (blue) `\ = Blue3 \fBcolor5\fP `\ (magenta) `\ = Magenta3 \fBcolor6\fP `\ (cyan) `\ = Cyan3 \fBcolor7\fP `\ (white) `\ = AntiqueWhite \fBcolor8\fP `\ (bright black) `\ = Grey25 \fBcolor9\fP `\ (bright red) `\ = Red \fBcolor10\fP `\ (bright green) `\ = Green \fBcolor11\fP `\ (bright yellow) `\ = Yellow \fBcolor12\fP `\ (bright blue) `\ = Blue \fBcolor13\fP `\ (bright magenta) `\ = Magenta \fBcolor14\fP `\ (bright cyan) `\ = Cyan \fBcolor15\fP `\ (bright white) `\ = White \fBforeground\fP `\ `\ = Black \fBbackground\fP `\ `\ = White .TE .PP It is also possible to specify the colour values of \fBforeground\fP, \fBbackground\fP, \fBcursorColor\fP, \fBcursorColor2\fP, \fBcolorBD\fP, \fBcolorUL\fP as a number 0-15, as a convenient shorthand to reference the colour name of color0-color15\&. .PP Note that \fB-rv\fP (\fB"reverseVideo: True"\fP) simulates reverse video by always swapping the foreground/background colours\&. This is in contrast to \fIxterm\fP(1) where the colours are only swapped if they have not otherwise been specified\&. For example, .PP .IP "\fBrxvt -fg Black -bg White -rv\fP" would yield White on Black, while on \fIxterm\fP(1) it would yield Black on White\&. .SH "ENVIRONMENT" .PP \fBrxvt\fP sets the environment variables \fBTERM\fP, \fBCOLORTERM\fP and \fBCOLORFGBG\fP\&. The environment variable \fBWINDOWID\fP is set to the X window id number of the \fBrxvt\fP window and it also uses and sets the environment variable \fBDISPLAY\fP to specify which display terminal to use\&. \fBrxvt\fP uses the environment variables \fBRXVTPATH\fP and \fBPATH\fP to find XPM files\&. .SH "FILES" .PP .IP "\fB/etc/utmp\fP" System file for login records\&. .IP "\fB/usr/lib/X11/rgb\&.txt\fP" Color names\&. .PP .SH "SEE ALSO" .PP \fIxterm\fP(1), \fIsh\fP(1), \fIresize\fP(1), \fIX\fP(1), \fIpty\fP(4), \fItty\fP(4), \fIutmp\fP(5) .PP See rxvtRef\&.html rxvtRef\&.txt for detailed information on recognized escape sequences and menuBar syntax, etc\&. .PP .SH "BUGS" .PP Check the BUGS file for an up-to-date list\&. .PP Cursor change support is not yet implemented\&. .PP Click-and-drag doesn\'t work with X11 mouse report overriding\&. .PP Graphics support is fairly crude\&. .PP .SH "FTP LOCATION" .PP rxvt-2\&.7\&.10\&.tar\&.gz can be found at the following ftp sites ftp://ftp\&.rxvt\&.org/pub/rxvt .PP .SH "CURRENT PROJECT COORDINATOR" .PP .IP "Project Coordinator" Geoff Wing .br .IP "Web page maintainter" Oezguer Kesim .br .br .IP "Mailing list" The Rxvt Workers mailing list has also been established for rxvt development, to subscribe, email to \&. There is also a mailing list for announcements of new releases of rxvt\&. To subscribe, email to \&. .PP .SH "AUTHORS" .PP .IP "John Bovey" University of Kent, 1992, wrote the original Xvt\&. .IP "Rob Nation " very heavily modified Xvt and came up with Rxvt .IP "Angelo Haritsis " wrote the Greek Keyboard Input .IP "mj olesen " Wrote the menu system\&. .br Project Coordinator (changes\&.txt 2\&.11 to 2\&.21) .IP "Oezguer Kesim " Project Coordinator (changes\&.txt 2\&.21a to 2\&.4\&.5) .IP "Geoff Wing " Rewrote screen display and text selection routines\&. .br Project Coordinator (changes\&.txt 2\&.4\&.6 - ) rxvt-2.7.10/doc/rxvt.1010064400001440000024000001174550764024424100131110ustar gcwstaff.if !\n(.g .ab GNU tbl requires GNU troff. .if !dTS .ds TS .if !dTE .ds TE .TH "RXVT" "1" "26 MARCH 2003" "X Version 11" "X Tools" .SH "NAME" rxvt (ouR XVT) \- a VT102 emulator for the X window system .PP .SH "SYNOPSIS" .PP \fBrxvt\fP [options] [-e command [ args ]] .PP .SH "DESCRIPTION" .PP \fBrxvt\fP, version \fB2\&.7\&.10\fP, is a colour vt102 terminal emulator intended as an \fIxterm\fP(1) replacement for users who do not require features such as Tektronix 4014 emulation and toolkit-style configurability\&. As a result, \fBrxvt\fP uses much less swap space -- a significant advantage on a machine serving many X sessions\&. .PP .PP .SH "OPTIONS" .PP The \fBrxvt\fP options (mostly a subset of \fIxterm\fP\'s) are listed below\&. In keeping with the smaller-is-better philosophy, options may be eliminated or default values chosen at compile-time, so options and defaults listed may not accurately reflect the version installed on your system\&. `rxvt -h\' gives a list of major compile-time options on the \fIOptions\fP line\&. Option descriptions may be prefixed with which compile option each is dependent upon\&. e\&.g\&. `Compile \fIXIM\fP:\' requires \fIXIM\fP on the \fIOptions\fP line\&. Note: `rxvt -help\' gives a list of all command-line options compiled into your version\&. .PP Note that \fBrxvt\fP permits the resource name to be used as a long-option (--/++ option) so the potential command-line options are far greater than those listed\&. For example: `rxvt --loginShell --color1 Orange\'\&. .PP Also note that if you do not explictly specify a font (\fB-fn\fP and \fB-fm\fP) or a multichar encoding method (\fB-km\fP), rxvt will select a font for the preferable encoding according to your locale\&. Supported encodings are: \fBISO-8859-\fPn (n=\fB1\fP\&.\&.\&.\fB15\fP), \fBKOI8-R\fP, \fBKOI8-U\fP, \fBEUC-JP\fP, \fBShift_JIS\fP, \fBEUC-KR\fP, \fBEUC-CN\fP (aka \fBGB\fP), and \fBBig5\fP\&. .PP The following options are available: .PP .IP "\fB-help\fP, \fB--help\fP" Print out a message describing available options\&. .IP "\fB-display\fP \fIdisplayname\fP" Attempt to open a window on the named X display (\fB-d\fP still respected)\&. In the absence of this option, the display specified by the \fBDISPLAY\fP environment variable is used\&. .IP "\fB-geometry\fP \fIgeom\fP" Window geometry (\fB-g\fP still respected); resource \fBgeometry\fP\&. .IP "\fB-rv\fP|\fB+rv\fP" Turn on/off simulated reverse video; resource \fBreverseVideo\fP\&. .IP "\fB-j\fP|\fB+j\fP" Turn on/off jump scrolling; resource \fBjumpScroll\fP\&. .IP "\fB-ip\fP|\fB+ip\fP" Turn on/off inheriting parent window\'s pixmap\&. Alternative form is \fB-tr\fP; resource \fBinheritPixmap\fP\&. .IP "\fB-bg\fP \fIcolour\fP" Window background colour; resource \fBbackground\fP\&. .IP "\fB-fg\fP \fIcolour\fP" Window foreground colour; resource \fBforeground\fP\&. .IP "\fB-pixmap:\fP \fIfile[;geom]\fP" Compile \fIXPM\fP: Specify XPM file for the background and also optionally specify its scaling with a geometry string\&. Note you may need to add quotes to avoid special shell interpretation of the `;\' in the command-line; resource \fBbackgroundPixmap\fP\&. .IP "\fB-cr\fP \fIcolour\fP" The cursor colour; resource \fBcursorColor\fP\&. .IP "\fB-pr\fP \fIcolour\fP" The mouse pointer colour; resource \fBpointerColor\fP\&. .IP "\fB-bd\fP \fIcolour\fP" The colour of the border between the xterm scrollbar and the text; resource \fBborderColor\fP\&. .IP "\fB-fn\fP \fIfontname\fP" Main normal text font; resource \fBfont\fP\&. .IP "\fB-fb\fP \fIfontname\fP" Main bold text font; resource \fBboldFont\fP\&. .IP "\fB-fm\fP \fIfontname\fP" Main multicharacter font; resource \fBmfont\fP\&. .IP "\fB-km\fP \fImode\fP" Compile \fImultichar_languages\fP: Multiple-character font-set encoding mode; \fBeucj\fP: EUC Japanese encoding\&. \fBsjis\fP: Shift JIS encoding\&. \fBbig5\fP: BIG5 encoding\&. \fBgb\fP: GB encoding\&. \fBkr\fP: EUC Korean encoding\&. \fBnoenc\fP: no encoding; resource \fBmultichar_encoding\fP\&. .IP "\fB-grk\fP \fImode\fP" Compile \fIGreek\fP: Greek keyboard translation; \fBiso\fP: ISO-8859 mapping\&. \fBibm\fP: IBM-437 mapping; resource \fBgreek_keyboard\fP\&. .IP "\fB-name\fP \fIname\fP" Specify the application name under which resources are to be obtained, rather than the default executable file name\&. Name should not contain `\&.\' or `*\' characters\&. Also sets the icon and title name\&. .IP "\fB-ls\fP|\fB+ls\fP" Start as a login-shell/sub-shell; resource \fBloginShell\fP\&. .IP "\fB-ut\fP|\fB+ut\fP" Compile \fIutmp\fP: Inhibit/enable writing a utmp entry; resource \fButmpInhibit\fP\&. .IP "\fB-vb\fP|\fB+vb\fP" Turn on/off visual bell on receipt of a bell character; resource \fBvisualBell\fP\&. .IP "\fB-sb\fP|\fB+sb\fP" Turn on/off scrollbar; resource \fBscrollBar\fP\&. .IP "\fB-si\fP|\fB+si\fP" Turn on/off scroll-to-bottom on TTY output inhibit; resource \fBscrollTtyOutput\fP has opposite effect\&. .IP "\fB-sk\fP|\fB+sk\fP" Turn on/off scroll-to-bottom on keypress; resource \fBscrollTtyKeypress\fP\&. .IP "\fB-sw\fP|\fB+sw\fP" Turn on/off scrolling with the scrollback buffer as new lines appear\&. This only takes effect if \fB-si\fP is also given; resource \fBscrollWithBuffer\fP\&. .IP "\fB-sr\fP|\fB+sr\fP" Put scrollbar on right/left; resource \fBscrollBar_right\fP\&. .IP "\fB-st\fP|\fB+st\fP" Display normal (non XTerm/NeXT) scrollbar without/with a trough; resource \fBscrollBar_floating\fP\&. .IP "\fB-mcc\fP|\fB+mcc\fP" Compile \fImultichar_languages\fP: treat multibyte glyphs as single character for backspace, delete and cursor movement keys; resource \fBmultibyte_cursor\fP\&. .IP "\fB-iconic\fP" Start iconified, if the window manager supports that option\&. Alternative form is \fB-ic\fP\&. .IP "\fB-sl\fP \fInumber\fP" Save \fInumber\fP lines in the scrollback buffer\&. See resource entry for limits; resource \fBsaveLines\fP\&. .IP "\fB-b\fP \fInumber\fP" Compile \fIfrills\fP: Internal border of \fInumber\fP pixels\&. See resource entry for limits; resource \fBinternalBorder\fP\&. .IP "\fB-w\fP \fInumber\fP" Compile \fIfrills\fP: External border of \fInumber\fP pixels\&. Also, \fB-bw\fP and \fB-borderwidth\fP\&. See resource entry for limits; resource \fBexternalBorder\fP\&. .IP "\fB-lsp\fP \fInumber\fP" Compile \fIlinespace\fP: Lines (pixel height) to insert between each row of the display; resource \fBlinespace\fP\&. .IP "\fB-tn\fP \fItermname\fP" This option specifies the name of the terminal type to be set in the \fBTERM\fP environment variable\&. This terminal type must exist in the \fItermcap(5)\fP database and should have \fIli#\fP and \fIco#\fP entries; resource \fBtermName\fP\&. .IP "\fB-e\fP \fIcommand [arguments]\fP" Run the command with its command-line arguments in the \fBrxvt\fP window; also sets the window title and icon name to be the basename of the program being executed if neither \fI-title\fP (\fI-T\fP) nor \fI-n\fP are given on the command line\&. If this option is used, it must be the last on the command-line\&. If there is no \fB-e\fP option then the default is to run the program specified by the \fBSHELL\fP environment variable or, failing that, \fIsh(1)\fP\&. .IP "\fB-title\fP \fItext\fP" Window title (\fB-T\fP still respected); the default title is the basename of the program specified after the \fB-e\fP option, if any, otherwise the application name; resource \fBtitle\fP\&. .IP "\fB-n\fP \fItext\fP" Icon name; the default name is the basename of the program specified after the \fB-e\fP option, if any, otherwise the application name; resource \fBiconName\fP\&. .IP "\fB-C\fP" Capture system console messages\&. .IP "\fB-pt\fP \fIstyle\fP" Compile \fIXIM\fP: input style for input method; \fBOverTheSpot\fP, \fBOffTheSpot\fP, \fBRoot\fP; resource \fBpreeditType\fP\&. .IP "\fB-im\fP \fItext\fP" Compile \fIXIM\fP: input method name\&. resource \fBinputMethod\fP\&. .IP "\fB-mod\fP \fImodifier\fP" Override detection of Meta modifier with specified key: \fBalt\fP, \fBmeta\fP, \fBhyper\fP, \fBsuper\fP, \fBmod1\fP, \fBmod2\fP, \fBmod3\fP, \fBmod4\fP, \fBmod5\fP; resource \fImodifier\fP\&. .IP "\fB-xrm\fP \fIresourcestring\fP" No effect on rxvt\&. Simply passes through an argument to be made available in the instance\'s argument list\&. Appears in \fIWM_COMMAND\fP in some window managers\&. .SH "RESOURCES (available also as long-options)" .PP Note: `rxvt --help\' gives a list of all resources (long options) compiled into your version\&. If compiled with internal Xresources support (i\&.e\&. \fBrxvt -h\fP lists \fB\&.Xdefaults\fP) then \fBrxvt\fP accepts application defaults set in XAPPLOADDIR/Rxvt (compile-time defined: usually \fB/usr/lib/X11/app-defaults/Rxvt\fP) and resources set in \fB~/\&.Xdefaults\fP, or \fB~/\&.Xresources\fP if \fB~/\&.Xdefaults\fP does not exist\&. Note that when reading X resources, \fBrxvt\fP recognizes two class names: \fBXTerm\fP and \fBRxvt\fP\&. The class name \fBXTerm\fP allows resources common to both \fBrxvt\fP and \fIxterm\fP to be easily configured, while the class name \fBRxvt\fP allows resources unique to \fBrxvt\fP, notably colours and key-handling, to be shared between different \fBrxvt\fP configurations\&. If no resources are specified, suitable defaults will be used\&. Command-line arguments can be used to override resource settings\&. The following resources are allowed: .PP .IP "\fBgeometry:\fP \fIgeom\fP" Create the window with the specified X window geometry [default 80x24]; option \fB-geometry\fP\&. .IP "\fBbackground:\fP \fIcolour\fP" Use the specified colour as the window\'s background colour [default White]; option \fB-bg\fP\&. .IP "\fBforeground:\fP \fIcolour\fP" Use the specified colour as the window\'s foreground colour [default Black]; option \fB-fg\fP\&. .IP "\fBcolor\fP\fIn\fP\fB:\fP \fIcolour\fP" Use the specified colour for the colour value \fIn\fP, where 0-7 corresponds to low-intensity (normal) colours and 8-15 corresponds to high-intensity (bold = bright foreground, blink = bright background) colours\&. The canonical names are as follows: 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=white, but the actual colour names used are listed in the \fBCOLORS AND GRAPHICS\fP section\&. .IP "\fBcolorBD:\fP \fIcolour\fP" Use the specified colour to display bold characters when the foreground colour is the default\&. .IP "\fBcolorUL:\fP \fIcolour\fP" Use the specified colour to display underlined characters when the foreground colour is the default\&. .IP "\fBcolorRV:\fP \fIcolour\fP" Use the specified colour as the background for reverse video characters\&. .IP "\fBcursorColor:\fP \fIcolour\fP" Use the specified colour for the cursor\&. The default is to use the foreground colour; option \fB-cr\fP\&. .IP "\fBcursorColor2:\fP \fIcolour\fP" Use the specified colour for the colour of the cursor text\&. For this to take effect, \fBcursorColor\fP must also be specified\&. The default is to use the background colour\&. .IP "\fBreverseVideo:\fP \fIboolean\fP" \fBTrue\fP: simulate reverse video by foreground and background colours; option \fB-rv\fP\&. \fBFalse\fP: regular screen colours [default]; option \fB+rv\fP\&. See note in \fBCOLORS AND GRAPHICS\fP section\&. .IP "\fBjumpScroll:\fP \fIboolean\fP" \fBTrue\fP: specify that jump scrolling should be used\&. When scrolling quickly, fewer screen updates are performed [default]; option \fB-j\fP\&. \fBFalse\fP: specify that smooth scrolling should be used; option \fB+j\fP\&. .IP "\fBinheritPixmap:\fP \fIboolean\fP" \fBTrue\fP: make the background inherit the parent windows\' pixmap, giving artificial transparency\&. \fBFalse\fP: do not inherit the parent windows\' pixmap\&. .IP "\fBscrollColor:\fP \fIcolour\fP" Use the specified colour for the scrollbar [default #B2B2B2]\&. .IP "\fBtroughColor:\fP \fIcolour\fP" Use the specified colour for the scrollbar\'s trough area [default #969696]\&. Only relevant for normal (non XTerm/NeXT) scrollbar\&. .IP "\fBbackgroundPixmap:\fP \fIfile[;geom]\fP" Use the specified XPM file (note the `\&.xpm\' extension is optional) for the background and also optionally specify its scaling with a geometry string \fBWxH+X+Y\fP, in which \fB"W" / "H"\fP specify the horizontal/vertical scale (percent) and \fB"X" / "Y"\fP locate the image centre (percent)\&. A scale of 0 displays the image with tiling\&. A scale of 1 displays the image without any scaling\&. A scale of 2 to 9 specifies an integer number of images in that direction\&. No image will be magnified beyond 10 times its original size\&. The maximum permitted scale is 1000\&. [default 0x0+50+50] .IP "\fBmenu:\fP \fIfile[;tag]\fP" Read in the specified menu file (note the `\&.menu\' extension is optional) and also optionally specify a starting tag to find\&. See the reference documentation for details on the syntax for the menuBar\&. .IP "\fBpath:\fP \fIpath\fP" Specify the colon-delimited search path for finding files (XPM and menus), in addition to the paths specified by the \fBRXVTPATH\fP and \fBPATH\fP environment variables\&. .IP "\fBfont:\fP \fIfontname\fP" Select the main text font used [default 7x14]; option \fB-fn\fP\&. .IP "\fBfont\fP\fIn\fP\fB:\fP \fIfontname\fP" Specify the alternative font \fIn\fP\&. The default font values: .br .RS .IP .TS .if '\*(.T'html' \X(table-start( .nr 3c \n(.C .cp 0 .nr 3lps \n[.s] .nr 3cent \n[.ce] .de 3init .ft \n[.f] .ps \n[.s] .vs \n[.v]u .in \n[.i]u .ll \n[.l]u .ls \n[.L] .ad \n[.j] .ie \n[.u] .fi .el .nf .ce \n[.ce] .. .nr 3ind \n[.i] .nr 3fnt \n[.f] .nr 3sz \n[.s] .nr 3fll \n[.u] .nr T. 0 .nr 3crow 0-1 .nr 3passed 0-1 .nr 3sflag 0 .ds 3trans .ds 3quote .nr 3brule 1 .nr 3supbot 0 .eo .de 3rmk .mk \$1 .if !'\n(.z'' \!.3rmk "\$1" .. .de 3rvpt .vpt \$1 .if !'\n(.z'' \!.3rvpt "\$1" .. .de 3keep .if '\n[.z]'' \{.ds 3quote \\ .ds 3trans \! .di 3section .nr 3sflag 1 .in 0 .\} .. .de 3release .if \n[3sflag] \{.di .in \n[3ind]u .nr 3dn \n[dn] .ds 3quote .ds 3trans .nr 3sflag 0 .if \n[.t]<=\n[dn] \{.nr T. 1 .T# .nr 3supbot 1 .sp \n[.t]u .nr 3supbot 0 .mk #T .\} .if \n[.t]<=\n[3dn] .tm warning: page \n%: table text block will not fit on one page .nf .ls 1 .3section .ls .rm 3section .\} .. .nr 3tflag 0 .de 3tkeep .if '\n[.z]'' \{.di 3table .nr 3tflag 1 .\} .. .de 3trelease .if \n[3tflag] \{.br .di .nr 3dn \n[dn] .ne \n[dn]u+\n[.V]u .ie \n[.t]<=\n[3dn] .tm error: page \n%: table will not fit on one page; use .TS H/.TH with a supporting macro package .el \{.in 0 .ls 1 .nf .3table .\} .rm 3table .\} .. .ec .ce 0 .nf .nr 3sep 1n .nr 3w0 \n(.H .nr 3aw0 0 .nr 3lnw0 0 .nr 3rnw0 0 .nr 3w1 \n(.H .nr 3aw1 0 .nr 3lnw1 0 .nr 3rnw1 0 .nr 3w0 \n[3w0]>?\w\[tbl]\fBfont\fP: \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ 7x14 \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBfont1\fP: \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ 6x10 \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBfont2\fP: \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ 6x13 \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBfont3\fP: \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ 8x13 \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBfont4\fP: \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ 9x15 \[tbl] .nr 3w0 \n[3w0]>?(\n[3lnw0]+\n[3rnw0]) .if \n[3aw0] .nr 3w0 \n[3w0]>?(\n[3aw0]+2n) .nr 3w1 \n[3w1]>?(\n[3lnw1]+\n[3rnw1]) .if \n[3aw1] .nr 3w1 \n[3w1]>?(\n[3aw1]+2n) .nr 3cd0 0 .nr 3cl0 0*\n[3sep] .nr 3ce0 \n[3cl0]+\n[3w0] .nr 3cl1 \n[3ce0]+(3*\n[3sep]) .nr 3cd1 \n[3ce0]+\n[3cl1]/2 .nr 3ce1 \n[3cl1]+\n[3w1] .nr 3cd2 \n[3ce1]+(0*\n[3sep]) .nr TW \n[3cd2] .if \n[3cent] \{.in +(u;\n[.l]-\n[.i]-\n[TW]/2) .nr 3ind \n[.i] .\} .eo .de T# .if !\n[3supbot] \{.3rvpt 0 .mk 3vert .ls 1 .ls .nr 3passed \n[3crow] .sp |\n[3vert]u .3rvpt 1 .\} .. .ec .fc  .3keep .3rmk 3rt0 \*[3trans].nr 3crow 0 .3keep .mk 3rs0 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \&\h'|\n[3cl0]u'\fBfont\fP: \h'|\n[3cl1]u'\ 7x14 .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs0]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt1 \*[3trans].nr 3crow 1 .3keep .mk 3rs1 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \&\h'|\n[3cl0]u'\fBfont1\fP: \h'|\n[3cl1]u'\ 6x10 .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs1]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt2 \*[3trans].nr 3crow 2 .3keep .mk 3rs2 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \&\h'|\n[3cl0]u'\fBfont2\fP: \h'|\n[3cl1]u'\ 6x13 .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs2]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt3 \*[3trans].nr 3crow 3 .3keep .mk 3rs3 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \&\h'|\n[3cl0]u'\fBfont3\fP: \h'|\n[3cl1]u'\ 8x13 .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs3]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt4 \*[3trans].nr 3crow 4 .3keep .mk 3rs4 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \&\h'|\n[3cl0]u'\fBfont4\fP: \h'|\n[3cl1]u'\ 9x15 .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs4]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .mk 3rt5 .nr 3brule 1 .nr T. 1 .T# .3init .fc .cp \n(3c .if '\*(.T'html' \X(table-end( .TE .RE .IP .IP "\fBboldFont:\fP \fIfontname\fP" Specify the name of the bold font to use if \fBcolorBD\fP has not been specified and it is not possible to map the default foreground colour to colour 8-15 [default NONE]\&. This font must be the same height and width as the normal font; option \fB-fb\fP\&. .IP "\fBmfont:\fP \fIfontname\fP" Select the main multiple-character text font used [default k14]; option \fB-fk\fP\&. .IP "\fBmfont\fP\fIn\fP\fB:\fP \fIfontname\fP" Specify the alternative multiple-character font \fIn\fP\&. If compiled for multiple-character fonts, the Roman and multiple-character font sizes should match\&. .IP "\fBmultichar_encoding:\fP \fImode\fP" Set the encoding mode to be used when multicharacter encoding is received; \fBeucj\fP: EUC Japanese encoding [default for Kanji]\&. \fBsjis\fP: Shift JIS encoding\&. \fBbig5\fP: BIG5 encoding\&. \fBgb\fP: GB encoding\&. \fBkr\fP: EUC Korean encoding\&. \fBnoenc\fP: no encoding; option \fB-km\fP\&. .IP "\fBgreek_keyboard:\fP \fImode\fP" Set the Greek keyboard translation mode to be used; \fBiso\fP: ISO-8859 mapping (elot-928) [default]\&. \fBibm\fP: IBM-437 mapping (DOS codepage 737); option \fB-grk\fP\&. .IP "\fBgreektoggle_key:\fP \fIkeysym\fP" Set the key to toggle keyboard input between no translation and Greek translation [default \fBMode_switch\fP]\&. For more details, see the distributed file \fBREADME\&.greek\fP\&. .IP "\fBselectstyle:\fP \fImode\fP" Set mouse selection style to \fBold\fP which is 2\&.20, \fBoldword\fP which is xterm style with 2\&.20 old word selection, or anything else which gives xterm style selection\&. .IP "\fBscrollstyle:\fP \fImode\fP" Set scrollbar style to \fBrxvt\fP, \fBnext\fP or \fBxterm\fP .IP "\fBtitle:\fP \fIstring\fP" Set window title string, the default title is the command-line specified after the \fB-e\fP option, if any, otherwise the application name; option \fB-title\fP\&. .IP "\fBiconName:\fP \fIstring\fP" Set the name used to label the window\'s icon or displayed in an icon manager window, it also sets the window\'s title unless it is explicitly set; option \fB-n\fP\&. .IP "\fBmapAlert:\fP \fIboolean\fP" \fBTrue\fP: de-iconify (map) on receipt of a bell character\&. \fBFalse\fP: no de-iconify (map) on receipt of a bell character [default]\&. .IP "\fBvisualBell:\fP \fIboolean\fP" \fBTrue\fP: use visual bell on receipt of a bell character; option \fB-vb\fP\&. \fBFalse\fP: no visual bell [default]; option \fB+vb\fP\&. .IP "\fBloginShell:\fP \fIboolean\fP" \fBTrue\fP: start as a login shell by prepending a `-\' to \fBargv[0]\fP of the shell; option \fB-ls\fP\&. \fBFalse\fP: start as a normal sub-shell [default]; option \fB+ls\fP\&. .IP "\fButmpInhibit:\fP \fIboolean\fP" \fBTrue\fP: inhibit writing record into the system log file \fButmp\fP; option \fB-ut\fP\&. \fBFalse\fP: write record into the system log file \fButmp\fP [default]; option \fB+ut\fP\&. .IP "\fBprint-pipe:\fP \fIstring\fP" Specify a command pipe for vt100 printer [default \fIlpr(1)\fP]\&. Use \fBPrint\fP to initiate a screen dump to the printer and \fBCtrl-Print\fP or \fBShift-Print\fP to include the scrollback as well\&. .IP "\fBscrollBar:\fP \fIboolean\fP" \fBTrue\fP: enable the scrollbar [default]; option \fB-sb\fP\&. \fBFalse\fP: disable the scrollbar; option \fB+sb\fP\&. .IP "\fBscrollBar_right:\fP \fIboolean\fP" \fBTrue\fP: place the scrollbar on the right of the window; option \fB-sr\fP\&. \fBFalse\fP: place the scrollbar on the left of the window; option \fB+sr\fP\&. .IP "\fBscrollBar_floating:\fP \fIboolean\fP" \fBTrue\fP: display an rxvt scrollbar without a trough; option \fB-st\fP\&. \fBFalse\fP: display an rxvt scrollbar with a trough; option \fB+st\fP\&. .IP "\fBscrollBar_align:\fP \fImode\fP" Align the \fBtop\fP, \fBbottom\fP or \fBcentre\fP [default] of the scrollbar thumb with the pointer on middle button press/drag\&. .IP "\fBscrollTtyOutput:\fP \fIboolean\fP" \fBTrue\fP: scroll to bottom when tty receives output; option(+si)\&. \fBFalse\fP: do not scroll to bottom when tty receives output; option(-si)\&. .IP "\fBscrollWithBuffer:\fP \fIboolean\fP" \fBTrue\fP: scroll with scrollback buffer when tty recieves new lines (and \fBscrollTtyOutput\fP is False); option(+sw)\&. \fBFalse\fP: do not scroll with scrollback buffer when tty recieves new lines; option(-sw)\&. .IP "\fBscrollTtyKeypress:\fP \fIboolean\fP" \fBTrue\fP: scroll to bottom when a non-special key is pressed\&. Special keys are those which are intercepted by rxvt for special handling and are not passed onto the shell; option(-sk)\&. \fBFalse\fP: do not scroll to bottom when a non-special key is pressed; option(+sk)\&. .IP "\fBsmallfont_key:\fP \fIkeysym\fP" If enabled, use \fBAlt-\fP\fIkeysym\fP to toggle to a smaller font [default \fBAlt-<\fP] .IP "\fBbigfont_key:\fP \fIkeysym\fP" If enabled, use \fBAlt-\fP\fIkeysym\fP to toggle to a bigger font [default \fBAlt->\fP] .IP "\fBsaveLines:\fP \fInumber\fP" Save \fInumber\fP lines in the scrollback buffer [default 64]\&. This resource is limited on most machines to 65535; option \fB-sl\fP\&. .IP "\fBinternalBorder:\fP \fInumber\fP" Internal border of \fInumber\fP pixels\&. This resource is limited to 100; option \fB-b\fP\&. .IP "\fBexternalBorder:\fP \fInumber\fP" External border of \fInumber\fP pixels\&. This resource is limited to 100; option \fB-w\fP, \fB-bw\fP, \fB-borderwidth\fP\&. .IP "\fBtermName:\fP \fItermname\fP" Specifies the terminal type name to be set in the \fBTERM\fP environment variable; option \fB-tn\fP\&. .IP "\fBlinespace:\fP \fInumber\fP" Specifies number of lines (pixel height) to insert between each row of the display [default 0]; option \fB-lsp\fP\&. .IP "\fBmeta8:\fP \fIboolean\fP" \fBTrue\fP: handle Meta (Alt) + keypress to set the 8th bit\&. \fBFalse\fP: handle Meta (Alt) + keypress as an escape prefix [default]\&. .IP "\fBmouseWheelScrollPage:\fP \fIboolean\fP" \fBTrue\fP: the mouse wheel scrolls a page full\&. \fBFalse\fP: the mouse wheel scrolls five lines [default]\&. .IP "\fBmultibyte_cursor:\fP \fIboolean\fP" \fBTrue\fP: consider multibyte glyphs as single character for backspace, delete and cursor movement keys; option \fB-mcc\fP\&. \fBFalse\fP: move through all components of all glyphs; option \fB+mcc\fP\&. .IP "\fBbackspacekey:\fP \fIstring\fP" The string to send when the backspace key is pressed\&. If set to \fBDEC\fP or unset it will send \fBDelete\fP (code 127) or, if shifted, \fBBackspace\fP (code 8) - which can be reversed with the appropriate DEC private mode escape sequence\&. .IP "\fBdeletekey:\fP \fIstring\fP" The string to send when the delete key (not the keypad delete key) is pressed\&. If unset it will send the sequence traditionally associated with the \fBExecute\fP key\&. .IP "\fBcutchars:\fP \fIstring\fP" The characters used as delimiters for double-click word selection\&. The built-in default: .br \fBBACKSLASH `"\'&()*,;<=>?@[]{|}\fP .IP "\fBpreeditType:\fP \fIstyle\fP" \fBOverTheSpot\fP, \fBOffTheSpot\fP, \fBRoot\fP; option \fB-pt\fP\&. .IP "\fBinputMethod:\fP \fIname\fP" \fIname\fP of inputMethod to use; option \fB-im\fP\&. .IP "\fBmodifier:\fP \fImodifier\fP" Set the key to be interpreted as the Meta key to: \fBalt\fP, \fBmeta\fP, \fBhyper\fP, \fBsuper\fP, \fBmod1\fP, \fBmod2\fP, \fBmod3\fP, \fBmod4\fP, \fBmod5\fP; option \fB-mod\fP\&. .IP "\fBanswerbackString:\fP \fIstring\fP" Specify the reply rxvt sends to the shell when an ENQ (control-E) character is passed through\&. It may contain escape values as described in the entry on \fBkeysym\fP following\&. .IP "\fBkeysym\&.\fP\fIsym\fP: \fIstring\fP" Associate \fIstring\fP with keysym \fIsym\fP (\fB0xFF00 - 0xFFFF\fP)\&. It may contain escape values (\ea: bell, \eb: backspace, \ee, \eE: escape, \en: newline, \er: return, \et: tab, \e000: octal number) or control characters (^?: delete, ^@: null, ^A \&.\&.\&.) and may enclosed with double quotes so that it can start or end with whitespace\&. The intervening resource name \fBkeysym\&.\fP cannot be omitted\&. This resource is only available when compiled with KEYSYM_RESOURCE\&. .SH "THE SCROLLBAR" .PP Lines of text that scroll off the top of the \fBrxvt\fP window (resource: \fBsaveLines\fP) and can be scrolled back using the scrollbar or by keystrokes\&. The normal \fBrxvt\fP scrollbar has arrows and its behaviour is fairly intuitive\&. The \fBxterm-scrollbar\fP is without arrows and its behaviour mimics that of \fIxterm\fP .PP Scroll down with \fBButton1\fP (\fBxterm-scrollbar\fP) or \fBShift-Next\fP\&. Scroll up with \fBButton3\fP (\fBxterm-scrollbar\fP) or \fBShift-Prior\fP\&. Continuous scroll with \fBButton2\fP\&. .SH "MOUSE REPORTING" .PP To temporarily override mouse reporting, for either the scrollbar or the normal text selection/insertion, hold either the Shift or the Meta (Alt) key while performing the desired mouse action\&. .PP If mouse reporting mode is active, the normal scrollbar actions are disabled -- on the assumption that we are using a fullscreen application\&. Instead, pressing Button1 and Button3 sends \fBESC[6~\fP (Next) and \fBESC[5~\fP (Prior), respectively\&. Similarly, clicking on the up and down arrows sends \fBESC[A\fP (Up) and \fBESC[B\fP (Down), respectively\&. .SH "TEXT SELECTION AND INSERTION" .PP The behaviour of text selection and insertion mechanism is similar to \fIxterm\fP(1)\&. .PP .IP "\fBSelection\fP:" Left click at the beginning of the region, drag to the end of the region and release; Right click to extend the marked region; Left double-click to select a word; Left triple-click to select the entire line\&. .IP .IP "\fBInsertion\fP:" Pressing and releasing the Middle mouse button (or \fBShift-Insert\fP) in an \fBrxvt\fP window causes the current text selection to be inserted as if it had been typed on the keyboard\&. .SH "CHANGING FONTS" .PP You can change fonts on-the-fly, which is to say cycle through the default font and others of various sizes, by using \fBShift-KP_Add\fP and \fBShift-KP_Subtract\fP\&. Or, alternatively (if enabled) with \fBAlt->\fP and \fBAlt-<\fP, where the actual key can be selected using resources \fBsmallfont_key\fP/\fBbigfont_key\fP\&. .SH "LOGIN STAMP" .PP \fBrxvt\fP tries to write an entry into the \fIutmp\fP(5) file so that it can be seen via the \fIwho(1)\fP command, and can accept messages\&. To allow this feature, \fBrxvt\fP must be installed setuid root on some systems\&. .SH "COLORS AND GRAPHICS" .PP If graphics support was enabled at compile-time, \fBrxvt\fP can be queried with ANSI escape sequences and can address individual pixels instead of text characters\&. Note the graphics support is still considered beta code\&. .PP In addition to the default foreground and background colours, \fBrxvt\fP can display up to 16 colours (8 ANSI colours plus high-intensity bold/blink versions of the same)\&. Here is a list of the colours with their \fBrgb\&.txt\fP names\&. .PP .TS .if '\*(.T'html' \X(table-start( .nr 3c \n(.C .cp 0 .nr 3lps \n[.s] .nr 3cent \n[.ce] .de 3init .ft \n[.f] .ps \n[.s] .vs \n[.v]u .in \n[.i]u .ll \n[.l]u .ls \n[.L] .ad \n[.j] .ie \n[.u] .fi .el .nf .ce \n[.ce] .. .nr 3ind \n[.i] .nr 3fnt \n[.f] .nr 3sz \n[.s] .nr 3fll \n[.u] .nr T. 0 .nr 3crow 0-1 .nr 3passed 0-1 .nr 3sflag 0 .ds 3trans .ds 3quote .nr 3brule 1 .nr 3supbot 0 .eo .de 3rmk .mk \$1 .if !'\n(.z'' \!.3rmk "\$1" .. .de 3rvpt .vpt \$1 .if !'\n(.z'' \!.3rvpt "\$1" .. .de 3keep .if '\n[.z]'' \{.ds 3quote \\ .ds 3trans \! .di 3section .nr 3sflag 1 .in 0 .\} .. .de 3release .if \n[3sflag] \{.di .in \n[3ind]u .nr 3dn \n[dn] .ds 3quote .ds 3trans .nr 3sflag 0 .if \n[.t]<=\n[dn] \{.nr T. 1 .T# .nr 3supbot 1 .sp \n[.t]u .nr 3supbot 0 .mk #T .\} .if \n[.t]<=\n[3dn] .tm warning: page \n%: table text block will not fit on one page .nf .ls 1 .3section .ls .rm 3section .\} .. .nr 3tflag 0 .de 3tkeep .if '\n[.z]'' \{.di 3table .nr 3tflag 1 .\} .. .de 3trelease .if \n[3tflag] \{.br .di .nr 3dn \n[dn] .ne \n[dn]u+\n[.V]u .ie \n[.t]<=\n[3dn] .tm error: page \n%: table will not fit on one page; use .TS H/.TH with a supporting macro package .el \{.in 0 .ls 1 .nf .3table .\} .rm 3table .\} .. .ec .ce 0 .nf .nr 3sep 1n .nr 3w0 \n(.H .nr 3aw0 0 .nr 3lnw0 0 .nr 3rnw0 0 .nr 3w1 \n(.H .nr 3aw1 0 .nr 3lnw1 0 .nr 3rnw1 0 .nr 3w2 \n(.H .nr 3aw2 0 .nr 3lnw2 0 .nr 3rnw2 0 .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor0\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (black) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Black \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor1\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (red) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Red3 \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor2\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (green) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Green3 \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor3\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (yellow) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Yellow3 \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor4\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (blue) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Blue3 \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor5\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (magenta) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Magenta3 \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor6\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (cyan) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Cyan3 \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor7\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (white) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = AntiqueWhite \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor8\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (bright black) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Grey25 \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor9\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (bright red) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Red \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor10\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (bright green) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Green \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor11\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (bright yellow) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Yellow \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor12\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (bright blue) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Blue \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor13\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (bright magenta) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Magenta \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor14\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (bright cyan) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Cyan \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBcolor15\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ (bright white) \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = White \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBforeground\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = Black \[tbl] .nr 3w0 \n[3w0]>?\w\[tbl]\fBbackground\fP \[tbl] .nr 3w1 \n[3w1]>?\w\[tbl]\ \[tbl] .nr 3w2 \n[3w2]>?\w\[tbl]\ = White \[tbl] .nr 3w0 \n[3w0]>?(\n[3lnw0]+\n[3rnw0]) .if \n[3aw0] .nr 3w0 \n[3w0]>?(\n[3aw0]+2n) .nr 3w1 \n[3w1]>?(\n[3lnw1]+\n[3rnw1]) .if \n[3aw1] .nr 3w1 \n[3w1]>?(\n[3aw1]+2n) .nr 3w2 \n[3w2]>?(\n[3lnw2]+\n[3rnw2]) .if \n[3aw2] .nr 3w2 \n[3w2]>?(\n[3aw2]+2n) .nr 3cd0 0 .nr 3cl0 0*\n[3sep] .nr 3ce0 \n[3cl0]+\n[3w0] .nr 3cl1 \n[3ce0]+(3*\n[3sep]) .nr 3cd1 \n[3ce0]+\n[3cl1]/2 .nr 3ce1 \n[3cl1]+\n[3w1] .nr 3cl2 \n[3ce1]+(3*\n[3sep]) .nr 3cd2 \n[3ce1]+\n[3cl2]/2 .nr 3ce2 \n[3cl2]+\n[3w2] .nr 3cd3 \n[3ce2]+(0*\n[3sep]) .nr TW \n[3cd3] .if \n[3cent] \{.in +(u;\n[.l]-\n[.i]-\n[TW]/2) .nr 3ind \n[.i] .\} .eo .de T# .if !\n[3supbot] \{.3rvpt 0 .mk 3vert .ls 1 .ls .nr 3passed \n[3crow] .sp |\n[3vert]u .3rvpt 1 .\} .. .ec .fc  .3keep .3rmk 3rt0 \*[3trans].nr 3crow 0 .3keep .mk 3rs0 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor0\fP \h'|\n[3cl1]u'\ (black) \h'|\n[3cl2]u'\ = Black .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs0]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt1 \*[3trans].nr 3crow 1 .3keep .mk 3rs1 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor1\fP \h'|\n[3cl1]u'\ (red) \h'|\n[3cl2]u'\ = Red3 .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs1]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt2 \*[3trans].nr 3crow 2 .3keep .mk 3rs2 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor2\fP \h'|\n[3cl1]u'\ (green) \h'|\n[3cl2]u'\ = Green3 .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs2]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt3 \*[3trans].nr 3crow 3 .3keep .mk 3rs3 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor3\fP \h'|\n[3cl1]u'\ (yellow) \h'|\n[3cl2]u'\ = Yellow3 .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs3]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt4 \*[3trans].nr 3crow 4 .3keep .mk 3rs4 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor4\fP \h'|\n[3cl1]u'\ (blue) \h'|\n[3cl2]u'\ = Blue3 .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs4]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt5 \*[3trans].nr 3crow 5 .3keep .mk 3rs5 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor5\fP \h'|\n[3cl1]u'\ (magenta) \h'|\n[3cl2]u'\ = Magenta3 .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs5]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt6 \*[3trans].nr 3crow 6 .3keep .mk 3rs6 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor6\fP \h'|\n[3cl1]u'\ (cyan) \h'|\n[3cl2]u'\ = Cyan3 .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs6]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt7 \*[3trans].nr 3crow 7 .3keep .mk 3rs7 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor7\fP \h'|\n[3cl1]u'\ (white) \h'|\n[3cl2]u'\ = AntiqueWhite .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs7]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt8 \*[3trans].nr 3crow 8 .3keep .mk 3rs8 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor8\fP \h'|\n[3cl1]u'\ (bright black) \h'|\n[3cl2]u'\ = Grey25 .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs8]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt9 \*[3trans].nr 3crow 9 .3keep .mk 3rs9 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor9\fP \h'|\n[3cl1]u'\ (bright red) \h'|\n[3cl2]u'\ = Red .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs9]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt10 \*[3trans].nr 3crow 10 .3keep .mk 3rs10 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor10\fP \h'|\n[3cl1]u'\ (bright green) \h'|\n[3cl2]u'\ = Green .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs10]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt11 \*[3trans].nr 3crow 11 .3keep .mk 3rs11 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor11\fP \h'|\n[3cl1]u'\ (bright yellow) \h'|\n[3cl2]u'\ = Yellow .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs11]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt12 \*[3trans].nr 3crow 12 .3keep .mk 3rs12 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor12\fP \h'|\n[3cl1]u'\ (bright blue) \h'|\n[3cl2]u'\ = Blue .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs12]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt13 \*[3trans].nr 3crow 13 .3keep .mk 3rs13 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor13\fP \h'|\n[3cl1]u'\ (bright magenta) \h'|\n[3cl2]u'\ = Magenta .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs13]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt14 \*[3trans].nr 3crow 14 .3keep .mk 3rs14 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor14\fP \h'|\n[3cl1]u'\ (bright cyan) \h'|\n[3cl2]u'\ = Cyan .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs14]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt15 \*[3trans].nr 3crow 15 .3keep .mk 3rs15 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBcolor15\fP \h'|\n[3cl1]u'\ (bright white) \h'|\n[3cl2]u'\ = White .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs15]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt16 \*[3trans].nr 3crow 16 .3keep .mk 3rs16 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBforeground\fP \h'|\n[3cl1]u'\ \h'|\n[3cl2]u'\ = Black .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs16]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .3keep .3rmk 3rt17 \*[3trans].nr 3crow 17 .3keep .mk 3rs17 .mk 3bot .3rvpt 0 .ta \n[3ce0]u \n[3ce1]u \n[3ce2]u \&\h'|\n[3cl0]u'\fBbackground\fP \h'|\n[3cl1]u'\ \h'|\n[3cl2]u'\ = White .nr 3bot \n[3bot]>?\n[.d] .sp |\n[3rs17]u .3rvpt 1 .sp |\n[3bot]u \*[3trans].nr 3brule 1 .3release .mk 3rt18 .nr 3brule 1 .nr T. 1 .T# .3init .fc .cp \n(3c .if '\*(.T'html' \X(table-end( .TE .PP It is also possible to specify the colour values of \fBforeground\fP, \fBbackground\fP, \fBcursorColor\fP, \fBcursorColor2\fP, \fBcolorBD\fP, \fBcolorUL\fP as a number 0-15, as a convenient shorthand to reference the colour name of color0-color15\&. .PP Note that \fB-rv\fP (\fB"reverseVideo: True"\fP) simulates reverse video by always swapping the foreground/background colours\&. This is in contrast to \fIxterm\fP(1) where the colours are only swapped if they have not otherwise been specified\&. For example, .PP .IP "\fBrxvt -fg Black -bg White -rv\fP" would yield White on Black, while on \fIxterm\fP(1) it would yield Black on White\&. .SH "ENVIRONMENT" .PP \fBrxvt\fP sets the environment variables \fBTERM\fP, \fBCOLORTERM\fP and \fBCOLORFGBG\fP\&. The environment variable \fBWINDOWID\fP is set to the X window id number of the \fBrxvt\fP window and it also uses and sets the environment variable \fBDISPLAY\fP to specify which display terminal to use\&. \fBrxvt\fP uses the environment variables \fBRXVTPATH\fP and \fBPATH\fP to find XPM files\&. .SH "FILES" .PP .IP "\fB/etc/utmp\fP" System file for login records\&. .IP "\fB/usr/lib/X11/rgb\&.txt\fP" Color names\&. .PP .SH "SEE ALSO" .PP \fIxterm\fP(1), \fIsh\fP(1), \fIresize\fP(1), \fIX\fP(1), \fIpty\fP(4), \fItty\fP(4), \fIutmp\fP(5) .PP See rxvtRef\&.html rxvtRef\&.txt for detailed information on recognized escape sequences and menuBar syntax, etc\&. .PP .SH "BUGS" .PP Check the BUGS file for an up-to-date list\&. .PP Cursor change support is not yet implemented\&. .PP Click-and-drag doesn\'t work with X11 mouse report overriding\&. .PP Graphics support is fairly crude\&. .PP .SH "FTP LOCATION" .PP rxvt-2\&.7\&.10\&.tar\&.gz can be found at the following ftp sites ftp://ftp\&.rxvt\&.org/pub/rxvt .PP .SH "CURRENT PROJECT COORDINATOR" .PP .IP "Project Coordinator" Geoff Wing .br .IP "Web page maintainter" Oezguer Kesim .br .br .IP "Mailing list" The Rxvt Workers mailing list has also been established for rxvt development, to subscribe, email to \&. There is also a mailing list for announcements of new releases of rxvt\&. To subscribe, email to \&. .PP .SH "AUTHORS" .PP .IP "John Bovey" University of Kent, 1992, wrote the original Xvt\&. .IP "Rob Nation " very heavily modified Xvt and came up with Rxvt .IP "Angelo Haritsis " wrote the Greek Keyboard Input .IP "mj olesen " Wrote the menu system\&. .br Project Coordinator (changes\&.txt 2\&.11 to 2\&.21) .IP "Oezguer Kesim " Project Coordinator (changes\&.txt 2\&.21a to 2\&.4\&.5) .IP "Geoff Wing " Rewrote screen display and text selection routines\&. .br Project Coordinator (changes\&.txt 2\&.4\&.6 - ) rxvt-2.7.10/doc/LSM.in010064400001440000024000000032270764024250700130010ustar gcwstaffBegin3 Title: rxvt Version: @RXVT_VERSION@ Entered-date: @RXVT_LSMDATE@ Description: @RXVT_WEBPAGE@ Rxvt is an 8-bit clean, colour xterm replacement that uses significantly less memory than a conventional xterm, mostly since it doesn't support toolkit configurability or Tek graphics, but also since features can be removed at compile-time to reflect your needs. Some rxvt features (compilation dependent): ANSI-color, bold/blink attributes modify foreground/background colours, scrollbars with arrow buttons, kanji and greek support, printer-pipe, XPM backgrounds with on-the-fly scaling, user-definable menus. The distribution also includes rclock, the smaller/better xclock replacement with appointment scheduling and xbiff functionality. Keywords: rxvt colour color kanji xterm X11 vt100 terminal-emulator rclock xbiff xpm menu Author: * John Bovey [Univ. Kent at Canterbury] was the creator of the original xvt. * Rob Nation [Lockheed] re-wrote most of xvt to make a substantiallly enhanced version called rxvt (Rob's xvt) and also wrote rclock (Rob's clock). * Mark Olesen [Queen's Univ. at Kingston] made various improvements and cleanups. Coordinated development, versions 2.11 - 2.21 * Oezguer Kesim [FU Berlin] Coordinated development, versions 2.21a - 2.4.5 * Geoff Wing rewrote much of the screen refreshing routines and mouse selection. Coordinated development, versions 2.4.6 - Maintained-by: @RXVT_MAINT@ @RXVT_MAINTEMAIL@ Project Coordinator Original-site: @RXVT_FTPSITENAME@ @RXVT_FTPSITEDIR@ 582k rxvt-@RXVT_VERSION@.tar.gz Platforms: requires X11 installed Copying-policy: GPL End rxvt-2.7.10/doc/xterm.seq010064400001440000024000000372630651657463100137050ustar gcwstaff Xterm Control Sequences Edward Moy University of California, Berkeley Revised by Stephen Gildea X Consortium Definitions c The literal character c. C A single (required) character. Ps A single (usually optional) numeric parameter, composed of one of more digits. Pm A multiple numeric parameter composed of any number of single numeric parameters, separated by ; character(s). Pt A text parameter composed of printable characters. VT100 Mode Most of these control sequences are standard VT102 control sequences, but there are some sequences here from later DEC VT terminals, too. VT102 features not supported are smooth scrolling, double size characters, blink- ing characters, and VT52 mode. There are additional control sequences to provide xterm-dependent functions, like the scrollbar or window size. Where the function is specified by DEC or ISO 6429, the code assigned to it is given in parentheses. The escape codes to designate and invoke character sets are specified by ISO 2022; see that document for a discussion of char- acter sets. BEL Bell (Ctrl-G) BS Backspace (Ctrl-H) TAB Horizontal Tab (HT) (Ctrl-I) LF Line Feed or New Line (NL) (Ctrl-J) VT Vertical Tab (Ctrl-K) same as LF FF Form Feed or New Page (NP) (Ctrl-L) same as LF CR Carriage Return (Ctrl-M) SO Shift Out (Ctrl-N) -> Switch to Alternate Character Set: invokes the G1 character set. SI Shift In (Ctrl-O) -> Switch to Standard Character Set: invokes the G0 character set (the default). ESC # 8 DEC Screen Alignment Test (DECALN) ESC ( C Designate G0 Character Set (ISO 2022) C = 0 -> DEC Special Character and Line Drawing Set C = A -> United Kingdom (UK) C = B -> United States (USASCII) ESC ) C Designate G1 Character Set (ISO 2022) C = 0 -> DEC Special Character and Line Drawing Set C = A -> United Kingdom (UK) C = B -> United States (USASCII) ESC * C Designate G2 Character Set (ISO 2022) C = 0 -> DEC Special Character and Line Drawing Set C = A -> United Kingdom (UK) C = B -> United States (USASCII) ESC + C Designate G3 Character Set (ISO 2022) C = 0 -> DEC Special Character and Line Drawing Set C = A -> United Kingdom (UK) C = B -> United States (USASCII) ESC 7 Save Cursor (DECSC) ESC 8 Restore Cursor (DECRC) ESC = Application Keypad (DECPAM) ESC > Normal Keypad (DECPNM) ESC D Index (IND) ESC E Next Line (NEL) ESC F Cursor to lower left corner of screen (if enabled by the hpLowerleftBugCompat resource). ESC H Tab Set (HTS) ESC M Reverse Index (RI) ESC N Single Shift Select of G2 Character Set (SS2): affects next character only ESC O Single Shift Select of G3 Character Set (SS3): affects next character only ESC P Pt ESC \ Device Control String (DCS) xterm implements no DCS functions; Pt is ignored. Pt need not be printable characters. ESC Z Return Terminal ID (DECID). Obsolete form of ESC [ c (DA). ESC [ Ps @ Insert Ps (Blank) Character(s) (default = 1) (ICH) ESC [ Ps A Cursor Up Ps Times (default = 1) (CUU) ESC [ Ps B Cursor Down Ps Times (default = 1) (CUD) ESC [ Ps C Cursor Forward Ps Times (default = 1) (CUF) ESC [ Ps D Cursor Backward Ps Times (default = 1) (CUB) ESC [ Ps ; Ps H Cursor Position [row;column] (default = [1,1]) (CUP) ESC [ Ps J Erase in Display (ED) Ps = 0 -> Clear Below (default) Ps = 1 -> Clear Above Ps = 2 -> Clear All ESC [ Ps K Erase in Line (EL) Ps = 0 -> Clear to Right (default) Ps = 1 -> Clear to Left Ps = 2 -> Clear All ESC [ Ps L Insert Ps Line(s) (default = 1) (IL) ESC [ Ps M Delete Ps Line(s) (default = 1) (DL) ESC [ Ps P Delete Ps Character(s) (default = 1) (DCH) ESC [ Ps ; Ps ; Ps ; Ps ; Ps T Initiate hilite mouse tracking. Parameters are [func;startx;starty;firstrow;lastrow]. See the section Mouse Tracking. ESC [ Ps c Send Device Attributes (DA) Ps = 0 or omitted -> request attributes from terminal -> ESC [ ? 1 ; 2 c (``I am a VT100 with Advanced Video Option.'') ESC [ Ps ; Ps f Horizontal and Vertical Position [row;column] (default = [1,1]) (HVP) ESC [ Ps g Tab Clear (TBC) Ps = 0 -> Clear Current Column (default) Ps = 3 -> Clear All ESC [ Pm h Set Mode (SM) Ps = 4 -> Insert Mode (IRM) Ps = 2 0 -> Automatic Newline (LNM) ESC [ Pm l Reset Mode (RM) Ps = 4 -> Replace Mode (IRM) Ps = 2 0 -> Normal Linefeed (LNM) ESC [ Pm m Character Attributes (SGR) Ps = 0 -> Normal (default) Ps = 1 -> Bold Ps = 4 -> Underscore Ps = 5 -> Blink (appears as Bold) Ps = 7 -> Inverse ESC [ Ps n Device Status Report (DSR) Ps = 5 -> Status Report ESC [ 0 n (``OK'') Ps = 6 -> Report Cursor Position (CPR) [row;column] as ESC [ r ; c R ESC [ Ps ; Ps r Set Scrolling Region [top;bottom] (default = full size of window) (DECSTBM) ESC [ Ps x Request Terminal Parameters (DECREQTPARM) ESC [ ? Pm h DEC Private Mode Set (DECSET) Ps = 1 -> Application Cursor Keys (DECCKM) Ps = 2 -> Designate USASCII for character sets G0-G3. (In the VT102, this selects VT52 mode (DECANM), which xterm doesn't support.) Ps = 3 -> 132 Column Mode (DECCOLM) Ps = 4 -> Smooth (Slow) Scroll (DECSCLM) Ps = 5 -> Reverse Video (DECSCNM) Ps = 6 -> Origin Mode (DECOM) Ps = 7 -> Wraparound Mode (DECAWM) Ps = 8 -> Auto-repeat Keys (DECARM) Ps = 9 -> Send Mouse X & Y on button press. See the sec- tion Mouse Tracking. Ps = 3 8 -> Enter Tektronix Mode (DECTEK) Ps = 4 0 -> Allow 80 <--> 132 Mode Ps = 4 1 -> more(1) fix (see curses resource) Ps = 4 4 -> Turn On Margin Bell Ps = 4 5 -> Reverse-wraparound Mode Ps = 4 6 -> Start Logging (normally disabled by a compile-time option) Ps = 4 7 -> Use Alternate Screen Buffer (unless disabled by the titeInhibit resource) Ps = 1 0 0 0 -> Send Mouse X & Y on button press and release. See the section Mouse Tracking. Ps = 1 0 0 1 -> Use Hilite Mouse Tracking. See the sec- tion Mouse Tracking. ESC [ ? Pm l DEC Private Mode Reset (DECRST) Ps = 1 -> Normal Cursor Keys (DECCKM) Ps = 3 -> 80 Column Mode (DECCOLM) Ps = 4 -> Jump (Fast) Scroll (DECSCLM) Ps = 5 -> Normal Video (DECSCNM) Ps = 6 -> Normal Cursor Mode (DECOM) Ps = 7 -> No Wraparound Mode (DECAWM) Ps = 8 -> No Auto-repeat Keys (DECARM) Ps = 9 -> Don't Send Mouse X & Y on button press Ps = 4 0 -> Disallow 80 <--> 132 Mode Ps = 4 1 -> No more(1) fix (see curses resource) Ps = 4 4 -> Turn Off Margin Bell Ps = 4 5 -> No Reverse-wraparound Mode Ps = 4 6 -> Stop Logging (normally disabled by a compile- time option) Ps = 4 7 -> Use Normal Screen Buffer Ps = 1 0 0 0 -> Don't Send Mouse X & Y on button press and release Ps = 1 0 0 1 -> Don't Use Hilite Mouse Tracking ESC [ ? Pm r Restore DEC Private Mode Values. The value of Ps previously saved is restored. Ps values are the same as for DECSET. ESC [ ? Pm s Save DEC Private Mode Values. Ps values are the same as for DECSET. ESC ] Ps ; Pt BEL Set Text Parameters Ps = 0 -> Change Icon Name and Window Title to Pt Ps = 1 -> Change Icon Name to Pt Ps = 2 -> Change Window Title to Pt Ps = 4 6 -> Change Log File to Pt (normally disabled by a compile-time option) Ps = 5 0 -> Set Font to Pt ESC ^ Pt ESC \ Privacy Message (PM) xterm implements no PM functions; Pt is ignored. Pt need not be printable characters. ESC _ Pt ESC \ Application Program Command (APC) xterm implements no APC functions; Pt is ignored. Pt need not be printable characters. ESC c Full Reset (RIS) ESC l Memory Lock (per HP terminals). Locks memory above the cur- sor. ESC m Memory Unlock (per HP terminals) ESC n Invoke the G2 Character Set (LS2) ESC o Invoke the G3 Character Set (LS3) ESC | Invoke the G3 Character Set as GR (LS3R). Has no visible effect in xterm. ESC } Invoke the G2 Character Set as GR (LS2R). Has no visible effect in xterm. ESC ~ Invoke the G1 Character Set as GR (LS1R). Has no visible effect in xterm. Mouse Tracking The VT widget can be set to send the mouse position and other information on button presses. These modes are typically used by editors and other full- screen applications that want to make use of the mouse. There are three mutually exclusive modes, each enabled (or disabled) by a different parameter in the DECSET (or DECRST) escape sequence. Parameters for all mouse tracking escape sequences generated by xterm encode numeric parameters in a single character as value+040. For example, ! is 1. The screen coodinate system is 1-based. X10 compatibility mode sends an escape sequence on button press encoding the location and the mouse button pressed. It is enabled by specifying parame- ter 9 to DECSET. On button press, xterm sends ESC [ M CbCxCy (6 charac- ters). Cb is button-1. Cx and Cy are the x and y coordinates of the mouse when the button was pressed. Normal tracking mode sends an escape sequence on both button press and release. Modifier information is also sent. It is enabled by specifying parameter 1000 to DECSET. On button press or release, xterm sends ESC [ M CbCxCy. The low two bits of Cb encode button information: 0=MB1 pressed, 1=MB2 pressed, 2=MB3 pressed, 3=release. The upper bits encode what modif- iers were down when the button was pressed and are added together. 4=Shift, 8=Meta, 16=Control. Cx and Cy are the x and y coordinates of the mouse event. The upper left corner is (1,1). Mouse hilite tracking notifies a program of a button press, receives a range of lines from the program, highlights the region covered by the mouse within that range until button release, and then sends the program the release coordinates. It is enabled by specifying parameter 1001 to DECSET. Warn- ing: use of this mode requires a cooperating program or it will hang xterm. On button press, the same information as for normal tracking is generated; xterm then waits for the program to send mouse tracking information. All X events are ignored until the proper escape sequence is received from the pty: ESC [ Ps ; Ps ; Ps ; Ps ; Ps T . The parameters are func, startx, starty, firstrow, and lastrow. func is non-zero to initiate hilite tracking and zero to abort. startx and starty give the starting x and y location for the highlighted region. The ending location tracks the mouse, but will never be above row firstrow and will always be above row lastrow. (The top of the screen is row 1.) When the button is released, xterm reports the ending position one of two ways: if the start and end coordinates are valid text locations: ESC [ t CxCy. If either coordinate is past the end of the line: ESC [ T CxCyCxCyCxCy. The parameters are startx, starty, endx, endy, mousex, and mousey. startx, starty, endx, and endy give the starting and ending character positions of the region. mousex and mousey give the loca- tion of the mouse at button up, which may not be over a character. Tektronix 4014 Mode Most of these sequences are standard Tektronix 4014 control sequences. Graph mode supports the 12-bit addressing of the Tektronix 4014. The major features missing are the write-thru and defocused modes. This document does not describe the commands used in the various Tektronix plotting modes but does describe the commands to switch modes. BEL Bell (Ctrl-G) BS Backspace (Ctrl-H) TAB Horizontal Tab (Ctrl-I) LF Line Feed or New Line (Ctrl-J) VT Cursor up (Ctrl-K) FF Form Feed or New Page (Ctrl-L) CR Carriage Return (Ctrl-M) ESC ETX Switch to VT100 Mode (ESC Ctrl-C) ESC ENQ Return Terminal Status (ESC Ctrl-E) ESC FF PAGE (Clear Screen) (ESC Ctrl-L) ESC SO Begin 4015 APL mode (ignored by xterm) (ESC Ctrl-N) ESC SI End 4015 APL mode (ignored by xterm) (ESC Ctrl-O) ESC ETB COPY (Save Tektronix Codes to file COPYyy-mm-dd.hh:mm:ss) (ESC Ctrl-W) ESC CAN Bypass Condition (ESC Ctrl-X) ESC SUB GIN mode (ESC Ctrl-Z) ESC FS Special Point Plot Mode (ESC Ctrl-\) ESC 8 Select Large Character Set ESC 9 Select #2 Character Set ESC : Select #3 Character Set ESC ; Select Small Character Set ESC ] Ps ; Pt BEL Set Text Parameters of VT window Ps = 0 -> Change Icon Name and Window Title to Pt Ps = 1 -> Change Icon Name to Pt Ps = 2 -> Change Window Title to Pt Ps = 4 6 -> Change Log File to Pt (normally disabled by a compile-time option) ESC ` Normal Z Axis and Normal (solid) Vectors ESC a Normal Z Axis and Dotted Line Vectors ESC b Normal Z Axis and Dot-Dashed Vectors ESC c Normal Z Axis and Short-Dashed Vectors ESC d Normal Z Axis and Long-Dashed Vectors ESC h Defocused Z Axis and Normal (solid) Vectors ESC i Defocused Z Axis and Dotted Line Vectors ESC j Defocused Z Axis and Dot-Dashed Vectors ESC k Defocused Z Axis and Short-Dashed Vectors ESC l Defocused Z Axis and Long-Dashed Vectors ESC p Write-Thru Mode and Normal (solid) Vectors ESC q Write-Thru Mode and Dotted Line Vectors ESC r Write-Thru Mode and Dot-Dashed Vectors ESC s Write-Thru Mode and Short-Dashed Vectors ESC t Write-Thru Mode and Long-Dashed Vectors FS Point Plot Mode (Ctrl-\) GS Graph Mode (Ctrl-]) RS Incremental Plot Mode (Ctrl-^) US Alpha Mode (Ctrl-_) rxvt-2.7.10/doc/changes.txt010064400001440000024000002111050764024106000141540ustar gcwstaff2.7.9 to 2.7.10 \----------------------------------- Geoff Wing et al. removed screen dump feature as it can aid as a security hole removed menubar escape sequence access as it can aid a security hole removed reporting of title and icon settings as they can aid a security hole Mikko Leppänen fixed clearing problem when internalBorder is zero Steve O added Cygwin port Rob McMullen fixed handling of control characters inside escape sequences added resource "mouseWheelScrollPage" to allow the mouse wheel scroll a page full added support for VT52 commands 2.7.8 to 2.7.9 \----------------------------------- Geoff Wing et al. added -sbt/--thickness to allow user-supplied scrollbar width (not yet available with NeXT style scrollbars) Matthew W. Roberts fixed rclock -iconic option added rclock day of month on clockface (define DATE_ON_CLOCK_FACE in feature.h) added rclock "-mailspawn cmd" if MAIL_SPAWN is not hard coded in feature.h Kazutoshi Kubota added 256 colour mode (instead of the base 16 colour mode) with configure --enable-256-color 2.7.7 to 2.7.8 \----------------------------------- Geoff Wing et al. fixed determination of NumLock key, noticed by Matthew Gabeler-Lee fixed continual and slipwheel scrolling, noticed by Joshua Swink fixed connecting with IM whenever it is started, partly from Tung-Han Hsieh fixed Ultrix acquiring useful pty/tty pair, noticed by Bert De Knuydt fixed CSI sequence parser overriding a 0 parameter with default value changed -ip to not clear ancestor windows when using inherit pixmap transparency type added -ipf/--inheritPixmapforce to clear ancestor windows when -ip and inherit pixmap transparency is used added "-hc colour" (define OPTION_HC in feature.h) to provide background highlighting of selection, partly from Christian W. Zuckschwerdt added -j/--jumpScroll to provide jump or smooth scrolling, defaults to jump scrolling as per previous behaviour Stephen Isard fixed DECSTBM sequence default when only one parameter is given Rudolf Jaksa added basic support for $XAPPLRESDIR/Rxvt resources T. Alexander Popiel added --scrollBar_align (top|bottom|...) for alignment of scrollbar thumb with middle button. Defaults to centre as per prior state. Supercedes FUNKY_SCROLL_BEHAVIOUR 2.7.6 to 2.7.7 \----------------------------------- Geoff Wing et al. fixed check for GLIBC and STREAMS pty/tty types, noticed by Venkatesh Krishnamurthi fixed check for PTC pty/tty type, noticed by Andreas Bierfert fixed to not automatically clear selection on screen size change, noticed by Dominik Vogt fixed a possible buffer overflow problem, noticed by Samuel Dralet fixed to reallow parallel builds fixed builds for some SYSV utmp/utmpx systems fixed INCR transfers fixed resource "greektoggle_key" as per doc/README.greek, noticed by Martin Husemann fixed STREAMS again, hopefully the last time changed overstrike pixel dropping avoidance to speed/size optimise changed define WTMP_ONLY_ON_LOGIN in feature.h to be the default added CSI s & CSI u as alternative save & restore cursor sequences added pasting-only support for SECONDARY and CLIPBOARD selections, automatically tried if internal selection and PRIMARY selections are not present. CUT_BUFFER0 is tried last Kazutoshi Kubota added "-lsp " option ("--lineSpace ") to give specified spacing between rows with configure --enable-linespace Tomohiro KUBOTA fixed some font default calculations to match previous behaviour Ali Rahimi added slip wheel support providing continual scrolling with the control key depressed and using the mouse wheel as an accelerator. Control key release stops scrolling Mark Schreiber added -sw/--scrollWithBuffer to try to make views into the scrollback buffer stay unmoving upon new lines (needs -si) 2.7.5 to 2.7.6 \----------------------------------- Geoff Wing et al. fixed build with XTERM_COLOR_CHANGE undefined, noticed by John Waggenspack fixed build for Solaris/SunOS (maybe others) using STREAMS fixed default icon name, noticed by Jeremy C. Reed fixed setting of icon name with -e argument, noticed by John Waggenspack fixed problems with selection by changing some types and type casting fixed some parallel build problems fixed text placement in graphics mode fixed some build problems with graphics/qplot fixed reverse video mode to act like the invocation option fixed query of locale ("Setting locale failed.") when locale is set fixed autowrap bug when restoring cursor from last column, noticed by witek@mat.uni.torun.pl fixed build & run when PREFER_24BIT is undefined fixed loading of fonts with noenc multichar encoding, noticed by Mark White fixed an abort on sending some selections, from Xianping Ge fixed tty opening for systems with openpty(), e.g. OSF1 fixed build for utmpx/wtmpx platforms fixed a bug in memmove() if --enable-strings is given, noticed by Larry W. Virden fixed some termcap/terminfo entries fixed some division operations to use the same integer type changed configure detection method for pty/ttys changed handling of ConfigureNotify events for fast event streams changed internal handling of window size calculation changed internal handling of window size and placement manipulation changed define PREFER_24BIT in feature.h to be set via configure --enable-24bit (default is now off) changed screen refresh to optimise X calls more, noticeable with slower machines or over network displays changed pty/tty code to be able to be built separately for testing changed selection sending to send the original raw form if locale conversion fails updated libtool for configure added DEC private modes 1047 / 1048 (no ti/te handling yet) added SCROLL_ON_HOMEEND_KEYS in feature.h a la SCROLL_ON_UPDOWN_KEYS from Marius Gedminas added "tests" target in main directory to build and run basic tests added (frills) -tcw (--tripleclickwords) alternative triple click selection which selects words to the end of possibly-wrapped lines with trailing blanks and blank lines removed Chuan-kai Lin and Brian Mays added -mcc option (--multibyte_cursor) for multibyte cursor movement in legacy programs Maxime Froment fixed placement with OverTheSpot input method fixed characters sent through IM being truncated to 4 bytes fixed encoding method being overridden by default encoding method added loading of locale specific app-defaults from directory /usr/X11R6/lib/X11/$LC_CTYPE/app-defaults/Rxvt (see XAPPLOADDIRLOCALE is feature.h) Tomohiro KUBOTA added method to provide base font sets based on user's locale added more flexible font allocation, specifying a maximum number of fonts in feature.h instead of a set number Marius Gedminas added --enable-smart-resize which may reposition the window on resizing so that we try to stay within the screen boundaries 2.7.3 to 2.7.5 \----------------------------------- Geoff Wing et al. fixed scrollTtyKeypress not active for all keypresses, noticed by Reuben Thomas added -xrm option to accept dummy invocation arguments, from Christian W. Zuckschwerdt & Chris Green fixed documentation for options: -tr, -ic, -pt, -im, -mod, -xrm; and resources: scrollBar_right, scrollBar_floating, scrollTtyOutput, scrollTtyKeypress, preeditType, inputMethod, modifier. fixed OSC sequences to accept 7 and 8 bit ST as well as BEL added MAX_COLS & MAX_ROWS in feature.h to limit columns/rows on resize added copy root pixmap variant of transparency - make this the default with previous method as fallback fixed allocation of new lines to not set base attributes, including underline or reverse video information, noticed by Brian Mays added ability for different scrollbars to be compiled in, determined by --scrollstyle fixed Meta key detection - has priority over Alt, noticed by Paul D. Smith fixed configure check for mawk/gawk/nawk/awk added use of libtool in build procedure added SCROLL_ON_NO_SECONDARY to feature.h to scroll the screen when no swap is compiled in and a change screen request is made removed slightly buggy ConfigureNotify queue/ignore from our resizes fixed use of extended character classes, from Samoylov Olleg fixed timeout in select() call when unmapped, noticed by Tore Bjorkeli changed feature.h NO_BOLDUNDERLINE to NO_BOLD_UNDERLINE_REVERSE added support for XCopyArea() on screen display - good for slower links fixed CSI parameter parsing, including omitted parameters fixed allocation of new lines when in reverse video mode added answerbackString resource which sets the reply to ENQ (CTRL-E) fixed InheritPixmap interaction with fvwm2 by delaying a bit to allow the WM to do its stuff before we meddle with its windows Thomas Woerner added colorRV resource for reverse video colour (dependent on NO_BOLD_UNDERLINE_REVERSE in feature.h) Jun Morimoto fixed argument checking in rclock - ignore bad arguments Matthew W. Roberts added -mailfile option to rclock Christian W. Zuckschwerdt added OSC sequences to change base colours; also cursor, highlight, bold, pointer and underline colours. See rxvtRef Paul Sheer added initial INCR (incremental pasting) support 2.7.2 to 2.7.3 \----------------------------------- Geoff Wing fixed clean up (utmp/wtmp/etc.) on fatal signal, noticed by Jim Diamond added use of configure options --program-prefix, --program-suffix & --program-transform-name, allowing, say, Kanji users to do --program-transform-name='s,rxvt,kxvt,;' for installing changed configure --with-encoding value "euckr" to "kr" to match multichar_encoding option and resource values added configure --with-encoding value "noenc" (and multichar_encoding option and resource values) to disable encoding allowing normal eight bit characters in multichar compile fixed -si/+si option, noticed by Thomas Lofgren fixed detection of struct utmpx, noticed by Paul 'TBBle' Hampson added basic support for openpty() which should help with people on Alpha platform using Tru64/ Jun Morimoto added basic argument checking for rclock to detect missing arguments Tung-Han Hsieh fixed configure notify bypass checking for self window configurations fixed fontset creation to match sizes properly and recreate fontset on size change Chih-Wei Huang added fontset (locale dependent) menubars added example Big5 menu Hans de Goede added colour determination for low colour (4 to 8 bit) displays 2.7.1 to 2.7.2 \----------------------------------- Geoff Wing fixed screen refresh output to handle more cases changed resource storage to a struct rather than a char* arrary, to aid debugging changed how ptys/ttys are opened (again) fixed processing of some resources to strip double-quotes when using XGetDefaults() and also for backspace_key/delete_key fixed large paste problem, noticed by Dominik Vogt fixed utmp removal problem for SYSV style utmps changed BORDERWIDTH in feature.h to EXTERNALBORDERWIDTH to clarify its usage. added (frills) resources "internalBorder" (-b) and "externalBorder" (-w)(-bw)(-borderwidth) added NO_BELL to feature.h to allow disabling all bell indications D J Hawkey Jr added QNX support added logging into lastlog in login shells (-ls option) Oskar Liljeblad added SCROLL_ON_UPDOWN_KEYS to feature.h to allow scrolling via (shift|meta|ctrl) modifier and up/down keys, default off for backward (2.6.x) compatibility 2.7.0 to 2.7.1 \----------------------------------- Geoff Wing cleaned up CSI processing slightly fixed clearing of pixel droppings on right side of cell added clearing of pixel droppings for fonts which exceed the left side of their cells, noticed by J Scott Berg changed --disable-memset to --enable-strings and not enable by default added LOCAL_X_IS_UNIX to feature.h to work-around Irix problem, opens unix:0.0 instead of :0 or :0.0 fixed some configure errors changed how ptys/ttys are opened and which is opened by parent or child added delay to screen refresh when receiving a fast stream of X events Jim Knoble fixed scrollbar slider jitter added named constants for scrollbar calculations MANTANI Nobutaka changed interaction with XIM server to fix several problems 2.6.? to 2.7.0 \----------------------------------- Geoff Wing added OSC escape sequence #55 to dump scrollback/screen to a file SEO Young-Jin fixed XGetDefaults() to use standard files (and then some) 2.6.0 to 2.6.1 \----------------------------------- Geoff Wing fixed setting of tty permission/ownership with grantpt(). ie. don't fixed configuration for some systems changed a timeout to previous setting giving smoother scrolling. fixed reversed --scrollTtyOutput (noticed (this time) by Thomas Lofgren ) fixed offset for writing into BSD utmp file added seperate cursor save/restore information for secondary screen fixed CSI cursor movement fixed typos causing compile failure - reported by various fixed UNSHIFTED_SCROLLKEYS Mike Hopkirk (Hops) fixed SB_BORDER scrollbar delineator 2.6.PRE3 to 2.6.0 \----------------------------------- Geoff Wing et al. fixed configuration for many systems Ha Shao added support for ZH_CN (GB2312) fonts and encoding. 2.6.PRE2 to 2.6.PRE3 \----------------------------------- Geoff Wing fixed several OOB memory accesses and leaks (mostly found by Rob Somerville ) added shift up/down arrows a la shift prior/next added SCROLL_ON_SHIFT, SCROLL_ON_META, SCROLL_ON_CTRL to feature.h Vaughn Cato fixed jerky selection for some people (esp. Linux) Peter H. Chou fixed floating scrollbar (trough) to not affect NeXT scrollbar MANTANI Nobutaka fixed two problems on X Input Method: 1) Can't display preedit area in "OverTheSpot" input style with some input methods. 2) The location of preedit area in "OffTheSpot" input style is wrong. Yasuda Tsutomu <_tom_@sf.airnet.ne.jp> fixed some multichar set (Kanji) selection added better selection request type conversion 2.6.PRE1 to 2.6.PRE2 \----------------------------------- Geoff Wing fixed declaration position for COLORFGBG env var - really fixed this time (noticed by Rob Somerville ) fixed transparent term reparenting/configure issues fixed some documentation (noticed by Richard Browne ) MANTANI Nobutaka added XIM (X Input Method) enhancements added input of multibyte characters with XIM (X Input Method) enhancements via input styles "OverTheSpot", "OffTheSpot" and "Root" added configure option --enable-xim added resources "inputMethod" (-im), "preeditType" (-pt) changed configure to search for libxpg4, needed for FreeBSD's setlocale() 2.4.10 to 2.6.PRE1 \----------------------------------- Geoff Wing fixed scrollbar slider drawing to have a minimum size (noticed by Brian Korver ) fixed backward #ifdef's on JUMP_MOUSE_WHEEL fixed coredump on paste after terminal reset fixed bad marking on selection with old selection (noticed by Paul Slootman ) fixed bad cursor colour setting (noticed by Louis-David Mitterrand ) fixed octal recognition from strings (hopefully no-one noticed) fixed proto generation awk script (noticed by Paul D. Smith ) changed distribution to include protos, for bad systems added configure check for XPointer (needed for SunOS; comments by Moritz Barsnick ) fixed export of COLORFGBG (noticed by Moritz Barsnick ) Alfredo K. Kojima changed NEXT_SCROLLBAR code to produce real NEXTSTEP scrollers added inheritPixmap support - terminal window uses parent pixmap Sasha Vasko fixed handling of background change via property _XROOTPMAP_ID 2.4.9 to 2.4.10 \----------------------------------- Geoff Wing fixed screen refreshing - significant reduction of XDrawString() et al calls in many cases leading to large speed increase, especially for remote X clients fixed source code const stuff fixed DISPLAY_IS_IP feature changed window creation, menubar reading, etc. order and removed one of my earlier hacks changed configure to be less extreme about X libs 2.4.8 to 2.4.9 \----------------------------------- Geoff Wing changed screen allocation to be safer added several xterm style window operations and reports DEC style escape sequences fixed handling of some DEC style escape sequences fixed menubar display fixed outline cursor removal fixed clear selection when writing within a selection added resources to handle backspace and delete changed source code organisation again - also be nicer when making in a different directory added probe of ModifierMapping for Meta/Alt and NumLock keys removed resource to set Meta/Alt key added support to allow compilation of both old and new selection styles changed internals - allocate rs_* as rs[Rs_*] Stanislav Meduna fixed checking of Xsetlocale(), setlocale() in configure 2.4.7 to 2.4.8 \----------------------------------- Geoff Wing fixed XPM handling of position in geometry changed XPM tiling to have the X server tile in the basic case moved several configuration options from feature.h to configure fixed introduced pixel dropping bug when RS_DIRTY was removed added `troughColor' resource - the original patch written by Reid D Rivenburgh (noted below) was lost and never added fixed border pixel colour - if not set, use foreground not background fixed handling of cursorColor/cursorColor/colorBD/colorUL to always use the _current_ fg/bg colours appropriately if unset changed source code organisation - moved some things into screen.h - to allow other add-ons to access screen structures without including all of rxvt.h changed internals - ripped out RS_Cursor/RS_Select to make basic multichar sets (not Kanji/Big5) always enabled - thus handle selection and cursor display differently fixed bug on scroll lines affecting selection changed rmemset to use a type which is the same size as an (int *) - based on comments by Paul Slootman fixed pointer colour change on default fg colour change changed handling of backspace/delete keys - if not disabled during ./configure then settable via resources - defaults similar to previous 2.4.6 to 2.4.7 \----------------------------------- Geoff Wing moved several configuration options from feature.h to configure added configure option to use system memset() added support for no multichar sets to allow 2 byte rendition type changed rmemset for slightly more optimised execution changed source code organisation slightly Guillaume Laurent added Meta modifier selectable via resource ``modifier'' John E. Davis added print mode to accept ESC sequence variation 2.4.5 to 2.4.6 \----------------------------------- Geoff Wing merged support for Big5 & Kanji. changed short option: fk --> fm changed long options: kfont/cfont --> mfont changed long option: kanji_encoding --> multichar_encoding changed font list in feature.h - user define list of fonts fixed configure check for Xlocale() added configure option --enable-dmalloc (Gray Watson's malloc) added configure option --enable-dlmalloc (Doug Lea's malloc) added support for Cygnus Solution's GNU-Win32 extensions (b18 tested) fixed utmp/wtmp handling on machines with updwtmpx() added support for old rxvt style selection - OLD_SELECTION changed define of struct screen_t to rxvt.h changed internal handling of bold overstrike pixel dropping - prescan line changed internal handling of selection mechanism to properly support multiple methods - and optimized changed internal handling of selection sync'ing - and optimized added assert()s via DEBUG_STRICT define to catch some possible bugs fixed scrollbar colour on mono displays changed privilege revocation to before we do anything fixed selection clearing when across the screen boundary and we swap screens fixed resize / screen refresh order when changing scrollbar display fixed font handling when we're given per_char of NULL changed internal handling of row width - maximum line length is now bound by a short - not enforced changed rxvt.1 and refer.html to yodl source Bruce Stephens added support for buttons 4 and 5 (eg. on a mouse with wheel) to scroll screen Frank Chen Hsiung Chan fixed clash of use of BIG5 as define and enum. Also typo fix. John Eikenberry added window_group use to window manager properties added NeXT scrollbar style - group up and down buttons together Denis N. Antonioli fixed setting of application icon name and title Adam Spiers fixed enumeration of *.keysym.* in resources 2.4.4 to 2.4.5 *_Official Release_* \----------------------------------- Geoff Wing changed the approach at the Boldoverstrike-Pixeldroppings front temporarily fixed a bug in the exposure handling added the --enable-ttygid Oezguer Kesim switched rxvt licence to GPL changed copyrights of the modules fixed the terminfo/termcap entries Mark Olesen FINALLY added Double-Click mouse reporting. Uses the upper bits of the Button character for X11 reporting so should cause no compatibility problems. * State = ( - SPACE) & 60 4 = Shift 8 = Meta 16 = Control 32 = Double Click (Rxvt extension) NOTE: no Release is reported after a double-click and the Release for the first click of a double-click is not reported. This also means the Release event of a very fast click/release won't be reported. 2.4.3 to 2.4.4 \----------------------------------- Geoff Wing fixed a bug in the selection mechanism Oezguer Kesim fixed the fontchange-windowresize-racecondition-bug (thanks Geoff!) fixed the broken console-support under solaris added a new terminfo entry for rxvt, based on the one which comes with ncurses (thanks Larry!) some changes on aclocal.m4 and configure removed the XTERM_COLOR_TERM option from feature.h - use --with-term=NAME instead updated the man-page Kikutani Makoto fixed a bug when copy&paste with kanji Paul D. Smith fixed a bug which prevented rxvt to compile when configured with --enable-xterm-scroll 2.4.2 to 2.4.3 \----------------------------------- Geoff Wing fixed a bug in scrolling lots of text more work on avoiding the pixel droppings further cleanups Oezguer Kesim some changes on the configure script Frank Chen Hsiung Chan added experimental big5 support Reid D Rivenburgh added the "troughColor" resource Mike Hopkirk (Hops) added support of SCO OSr5 pty naming (also UW SysVr5) correction of pty hang with large paste buffer (happens on on all tested platforms) fixed Weird default scroll thumb behaviour fixed incorrect setting of WM_COMMAND if specified with -e switch fixed # of lines of context between screen pages (Shift-Prior/Next) Visual delineation of Scrollbar and vt wdw with dark internal border 2.4.1 to 2.4.2 \----------------------------------- Geoff Wing new anti-bold-overstrike-pixel-dropping (plan 3) Oezguer Kesim fixed a bug which caused rxvt to dump core after resizing and selecting 2.4.0 to 2.4.1 \----------------------------------- Geoff Wing added --with-xpm-{include,library} to autoconf/a4local.m4 added VERYBOLD feature fixed some misspelling in autoconf/configure.in added `DEC private modes' 1010 and 1011 for scroll-to-bottom on TTY output inhibit and scroll-to-bottom on keypress together with resources and switches fixed Bold Overstrike Pixel Dropping (Yes Sir!) fixed a bug in scr_E() fixed ^[[*J behaviour - clear to end, clear to beginning, clear whole screen was broken Oezguer Kesim removed DONT_GUESS_BACKSPACE. Instead, you may define either FORCE_BACKSPACE or FORCE_DELETE or leave both undefined in order to get ^H, ^? or the current stty settings for 'erase' fixed positioning of text in the top menubar. fixed some missing #define's fixed conditions for MONO_BOLD in scr_refresh() to make VERYBOLD work. Christoph L. Spiel fixed usage of KEYSYM_RESOURCE only when NO_RESOURCES is *not* defined Paul Slootman added a few XK_KP_* ifdef's in order to get rxvt work with X11R4 Major changes from 2.21b* to 2.4.0 \----------------------------------- Geoff Wing screen.c rewritten with changes including: internal management of screen lines changed rmemset() used as a fast memset() replacement selection now the same as XTerm selection several Kanji display fixes Kanji properly selectable for EUC JP encoding added continuous scrolling with scrollbar buttons fixed colours when using XPM background pixmaps smaller than the window added resources -sr/+sr, -st/+st fixed application Cursor Keys added many configure enhancements added delimiting line between XTerm scrollbars as per XTerm fixed utmp support added minimal support for proportional fonts added integrated use for Gray Watson's dmalloc package added automatic prototype generation via src/makeprotos-sed Grant McDorman added PREFER_24BIT: if the screen is 24 bit, then use 24 bit windows even if default is 8 bit fixed utmpx support added handling for Keypad left/right/up/down, etc. added META8_OPTION for all function keys added RXVT_TERMINFO for setting TERMINFO fixed some bugs in menubar added expanded keysym support Paul D. Smith fixed title setting fixed for building in other directories added pointerColor for changing pointer colour added borderColor for changing border line colour in XTerm scrollbar 2.21a3 to 2.21b* \--------------- 1. From: Conrad Link Fixed a bug in the OffiX Drag and Drop support. rxvt inserted two instances of directories or links when they were dropped onto rxvt. 2. From: Fixed a bug that makes rxvt getting constantly "NoExpose" events which it is not handling. 3. From: Mark Olesen Fixed a bug that caused rxvt to hang indefinitly waiting for a terminating ^G on an XTerm `ESC]' sequence. 4. From: Bernard PERROT Mark Olesen Fixed a bug that prevented to handle DEC VT2xx's ApLineDel correctly 5. From: Mark Olesen Now the Shift/Ctrl cursor key mappings are enabled regardless of App-Cursor settings 6. From: Kai Petzke Fixed a bug with respect to cursor movement. rxvt now handles the 'G' and 'd' sequences correctly 7. From: Geoff Wing Fixed a couple of things in utmp.c 8. From: Denis N. Antonioli Added the "-tn" option and corresponding Xresource variable "termcap". This option specifies the name of the terminal type to be set in the TERM environment variable. 2.20 to 2.21a* \------------- 1. Oops, forgot to include time headers in menubar.c 2. Finally got the correct DEC sequence to toggling the behaviour of the backspace key and removed the other non-standard ones. If anyone has a listing of DEC escape sequences they'd like to donate ... 3. Fixed a bug that prevented an XPM file from being found if it were specified with an absolute path and a geometry string. Made the default scaling zero (tiled) since this is by far the most popular use. 4. The Motif-style scrollbar is back as a compile-time option. 5. Added BUGS file and (thankfully) moved coordination of the project to Oezguer Kesim who also has a mailing list for rxvt development Rxvt Workers To subscribe to the list send email to with the body: subscribe 6. Semi-retirement and finish my thesis ... bye for now - /mark --- Oezguer started working on rxvt 7. Fixed a bug in the new menubar-feature. There were several unchecked strings strcpy'ed which caused rxvt immediately to dump core. 8. From: Robert Bihlmeyer Fixed a bug in rclock.c which prevented it to compile correctly. 9. From: Mark Olesen Overstrike boldfonts and pixmaps now work together without pixel droppings on the screen (at least under Linux). 10. From: Mark Olesen Modified autoconf support: memmove() replacement function supplied for those systems that need it, libXpm should now be correctly found (set in src/Makefile *not* in config.h) 11. From: Mark Olesen Converted doc/rxvt.ref to HTML format. doc/html/refer.html = master copy doc/refer.txt = text version saved using Netscape. All HTML documents are put in here, to ease installation elsewhere. 12. From: Mark Olesen Moved some file search function from main.c and some string functions from xdefaults.c to misc.c. Changed the implementation details so that `keysym' resource is also available as a command-line long option ... even if you have compiled with USE_XGETDEFAULT. 13. From: Mark Olesen When a new pixmap is loaded, revert to the default scaling. 14. From: Mark Olesen Reworked the menubar to permit multiple menubars in a circular linked list (and all the management functions that entains) and new functions including the following: * reading from files * dumping all the menubars * clearing a menu (without removing it) * setting a backgroudPixmap * and many other features. The menu syntax has changed very slightly from the last version, but now provides greater flexibility ... see refer.html for details. Added the `menu' resource/long-option so a startup menu can be specified. eg, rxvt -menu my.menu -e rlogin machine -l user 2.19 to 2.20 \----------- 1. You can now add snazzy looking menus to any plain (non-X) text application. At the moment, the menuing system is simple but functional. The syntax for controlling the menubar is documented in doc/rxvt.doc, but note that an XTerm sequence `ESC ] 10; Pt BEL' is used so menus created for rxvt will be ignored by an ordinary XTerm. It provides sub-menus, click-and-drag, and even some user definable `quick' arrows keys. However menu manipulation could use refinement to permit multiple menus to be defined -- and the menu refreshing could also use some improvement, but it can be extended and refined later as required/desired. The files doc/menu.sh and doc/jedmenu.sl show sample implementations of menus. --> It compiles and runs on my machine (AIX 3.2.5) but THIS IS CONSIDERED BETA (or even ALPHA) CODE! 2. DEC private modes: Bug fix for 's'ave and 'r'estore parameters, added a 't'oggle parameter to DEC private modes. 3. Made Backspace key selectable with DEC private mode ESC [ ? 36 h/l/s/r/t (high/low/save/restore/toggle) 4. Changed the way the scrollBar is realized to permit on-the-fly toggling of the scrollBar display and added a DEC private mode escape sequence for that. Smoother redraw of scrollBar. Better proportions for the arrows allows a slightly narrower scrollBar. 5. Added support for XTerm font changing sequence: `ESC ] 50; Pt BEL', with (as usual) a few extras. See doc/rxvt.ref 6. Adapted experimental XPM buffering from that supplied by Carsten Haitzler . 7. Replaced `wait' with `waitpid' in src/command.c::Child_signal to avoid a race condition and permit use of pclose() on SunOS. Patch provided by , Thanks John! 8. For easier XPM handling, added `path' resource/long-option and substantially enhanced pixmap scaling to provide very exact control over scaling and positioning of the XPM background image. The XPM XTerm escape sequence has been extended to provide a convenient facility for on-the-fly rescaling. Export COLORTERM="rxvt-xpm" instead of COLORTERM="rxvt" 9. Added export COLORFGBG to give hints to color applications. Typically one of these values is exported, in which `fg' and `bg' are numbers 00-15: COLORFGBG="default;default" -fg -bg colors don't match any of color 0-15 COLORFGBG="fg;default" -fg color matches color 0-15, but -bg color doesn't COLORFGBG="default;bg" -bg color matches color 0-15, but -fg color doesn't COLORFGBG="fg;bg" -fg -bg colors match color 0-15 When compiled with XPM support, the last two values are rendered as follows: COLORFGBG="default;default;bg" -bg color matches color 0-15, but -fg color doesn't COLORFGBG="fg;default;bg" -fg -bg colors match color 0-15 10. Disable Shift+Prior/Next and scrollBar if saveLines == 0. Slight change to key-processing so `shift+meta+key' and `shift+ctrl+key' gets processed as `shift+key'. This provides a way to avoid interpretating `Shift+Prior', `Shift+Next', and `Shift+Insert'. Also, added DEC private mode sequence `ESC [ ? 35 h/l/s/r/t' to disable Shift+key interpretation. Provide for Ctrl+Shift+ combinations for function keys. See doc/rxvt.ref 11. Always match long-option names, even when only preceded by a single -/+. 2.18 to 2.19 \----------- 1. Minor alteration to input mode for Kanji processing. 2. rclock: -adjust option, support for exec on startup syntax, date format may now also include the century 3. Made mouse double-click respect autowrap lines. 4. Added marks for folded editing. 5. Added Offix DND (Drag 'n' Drop) protocol. Added support for XA_TARGETS. 6. added Carsten Haitzler XPM patches to load an XPM file for the background of the terminal window. Uses resource `Rxvt.backgroundPixmap' or long-option `--backgroundPixmap' 7. Use these (XTerm) keybindings exclusively and remove the old equivalent bindings: Shift-Prior = scroll up Shift-Next = scroll down Shift-Insert = paste mouse selection Shift-KP_Add = bigger font Shift-KP_Subtract = smaller font 2.17 to 2.18 \----------- 1. Check for NULL pointers in command-line processing (oops) Also fixed processing of `hidden' arguments such as -d, -g, -T 2. Fixed terminfo hpa/vpa: was `\E..' instead of `\E[..' added invisible cursor (ESC[?25h / ESC[?25l) 3. Fixed broken kanji characters (?? and disappeared cursor box ??) thanks to 4. In privileges(), changed setuid/setgid to seteuid/seteguid so that it's possible to switch back to root later. Perhaps fixed svr4 problems (reports no tty, no job control) in get_tty() ... need to detect these SVR4 features in the configure script. 5. Restored scrollColor, topShadowColor, bottomShadowColor resources that somehow got lost between the beta and release versions. For monochrome displays, fixed scrollbar so it will be visible and suppress color changes. 6. Final? iteration on selection. Store selection text with LF line-endings but paste into rxvt with CR endings. Selection now preserves the newline when trailing space is stripped from non-autowrap lines. Compile-time support for using a keystroke to paste from the cut-buffer. 7. Fixed utmp.c to handle both sysv and bsd pty names. More changes in the works to improve documentation and eliminate race conditions ... this, thankfully, is being done by someone else. 8. Added European language support (X11R6) - let me know of problems and fixes since I only have X11R5. 9. Changed names of color10-color17 to color8-color15 to match with those used by color_xterm ... sorry for the inconvenience, but I didn't have an X11R6 xterm manpage until now and long-term compatibility is quite important. Added a real bold font (define USE_BOLDFONT). I still think it's too much work to avoid pixel droppings for overstrike fonts. Added support for specifying colors for bold/underline (colorBD/colorUL) but it's only done when the foreground = the default foreground ... see the manpage. Compile-time selection of TERM="xterm-color". Reduced the number of rarely-used command-line options since they are accessible on the command-line via their resource names as long options. More rigid differentiation between long and short options: long options are --/++ prefixed; short options -/+ prefixed. Added long-option help to give the resource names. Removed run-time selection of right-hand scrollbar and arrows. Removed run-time selection of (pageup_key/pagedown_key/alert_key). 10. Changed Ctrl-Up,Down,Left,Right to emit "\EOa,b,c,d" instead of the previous "\E[^A,^B,^C,^D" to avoid problems associated with having an embedded "^C" in a key-sequence. Disallow 80/132 column switching as the default (same as xterm). 11. Check for seteuid(). Add "ttcompat" module for SVR4. 12. A few people suggested removing the keystroke for toggling MapAlert and so I have. I agree that it was pointless and/or annoying since there was no way of determining the current toggled state anyhow. 13. Fixed missing `ttydev' for _sgi. Fixes for BSD utmp support. Exported WINDOWID before the window was created (oops). 14. Mouse cut&paste of autowrapped lines should be improved, fixed bug in screen.c::scroll_text(). 15. As was pointed by a user -->> in keeping with X conventions, only an application that starts with 'x' should capitalize the first two letters of the resource file, so the rxvt resource file (and class name) should be named Rxvt not RXvt, this is a minor point. 16. rclock: As well as message reminders, rclock can launch programs and (if no message text is given) act as a cron-type of program. Made default font `7x14'. Fixed graphics context when mail is waiting and a reminder is issued - so the message is actually visible! 17. As suggested by a user, changed the bolding algorithm to be slightly more intuitive: 1. colorBD (if specified) 2. color0-7 -> color8-15 (if possible) 3. boldFont (if specified and found) 4. overstrike (last resort) This takes advantage of the color capability and is the most consistent when toggling font sizes on-the-fly. If you never want overstrike (looks ugly and leaves pixel droppings) or boldFont (you like to switch font sizes on-the-fly), you can remove them at compile-time. The other elements are similarly compile-time selectable. 18. Another user suggestion: scrollbar made more distinct by having the `trough' a different color from the slider -- I opted for making it the same as the default background color so that the slider and arrows appear to `float' on the window. Also removed topShadowColor, bottomShadowColor resources as unnecessary. 19. Dropped distribution of vttest since Tom Dickey is working on an improved version. 2.16 to 2.17 \----------- 1. Fixed problem in scr_refesh_region() that was introduced in v2.16 The problem of `pixel droppings' continues when bold is simulated using overstrike. Using XCopyArea() sometimes helps, but the preferred and simplest solution is item 4 below. 2. Removed 7bit mode. Changed definition of meta so that the ESCAPE is the default and using meta to set the 8bit on an option that can be made run-time configurable (assuming people still use this). Added -/+rv command-line option, resource reverseVideo. NB: it works slightly differently from xterm's in that foreground/background are swapped even if they have been explicitly set. Removed NO_COLOR option -- no more monochrome rxvt (one too #ifdef's). Inherit existing stty settings (at least for control characters) and set value of BackSpace appropriately. Added defines DONT_GUESS_BACKSPACE and NO_DELETE_KEY 3. Added 3D style scrollbar and removed all the old bitmapped scrollbars and arrows with the only exception being the xterm lookalike XTERM_SCROLLBAR which is available in a single width. With arrows, scrollbar behaviour somewhat resembles Motif behaviour. Without arrows, it's the standard xterm behaviour. The default scrollbar (defined at compile-time or set by using scrollBar: True) is to have a scrollbar with arrows arranged on the right-hand side. The scrollBar resource is now exclusively a boolean value scrollbar resources: scrollColor topShadowColor bottomShadowColor NB: if topShadowColor/bottomShadowColor are unset, their values are calculated from scrollColor using an algorithm adapted from fvwm so it shouldn't be too hard to find scrollbar colours that look good with your window manager and don't consume an entire colormap. 4. Added smarter handling of bold/blink when applied to the default fg/bg colours: If the pixel value of fg/bg matches the pixel value of colour COLOR0 through COLOR7, then applying bold/blink to the default fg/bg will select the appropriate colour from BOLD0 through BOLD7 instead of using the overstrike bold. This seems to be the best way to handle bold/blink attributes when the foreground/background match and ANSI colour anyhow. For convenience, it is possible to use colour aliases (next item) for the foreground/background colours instead. My preference is a dull Canadian look: RXvt*foreground: 7 RXvt*background: 10 5. Changed colour aliases (item 7 of last change) and dropped the `#' prefix. This avoids confusion with the regular #rrggbb format of specifying colours and is unambiguous since there are no X11 colours starting with a digit. This also avoids the need to quote the `#' to protect against shell interpretation. 6. Added colour cursor support. -cr (cursorColor), as per XTerm -> the (rectangle) cursor colour -cr2 (cursorColor2), only RXvt -> the text colour. The cursorColor2 maintains contrast in a colour environment and is optional. Thanks Raul Garcia Garcia for the idea. Cleaned up scr_refresh (again ) to avoid some unnecessary colour changes and removed the reverse video graphics context and just swap foreground/background colours instead. 7. Typo in command.c: had seteuid() instead of seteguid() Use cfsetospeed()/cfsetispeed() for POSIX termios handling. 8. Ignore the loginShell option/resource for programs that DON'T end with "sh". A hack but it keeps `rxvt -ls -e rlogin machine' from failing and I don't know of (m)any shells that don't end in "sh". 9. Hard-code dependencies in Makefiles to avoid using X11 makedepend. Added check for atexit() to catch the problem that exists on SunOS but not on Solaris. 10. Collected command-line option parsing and X11 resources into a single file (xdefaults.c), and introduced a monolithic structure (with bit-flags for logical options) to eliminate the massive if-else-if parsing and to reduce possible overlaps/oversights Short help provided for an incorrect argument. For more consistency, more flexibility, and fewer switches, made -grk4/-grk9 options obsolete, and replaced with `-grk mode'. Added the resource `greek_keyboard' while I was there. It is also possible to use a `--' or `++' prefix to get so-called `long options' that correspond to the resource name. For example, rxvt +ls -bg Blue rxvt +loginShell -background Blue rxvt ++loginShell --background Blue rxvt ++ls --bg Blue Error! 11. Changed REFRESH_PERIOD to 1 in command.c, the old idea of providing for fast and furious scrolling needs to be reconsidered so that `cat' works. Still needs some investigation. 12. Changed scr_poweron(), which corresponds to `ESC c', to also reset the scrollback buffer. 13. Changed scr_change_screen() (when compiled with NO_SECONDARY_SCREEN) so that switching from the secondary to primary screen will push the old secondary screen into the scrollback buffer. This is fairly useful if your terminfo has have rmcup=\E[?47l\E8, smcup=\E7\E[?47h. It is NOT particularly useful if rmcup includes \E[2J, like some do. Running with NO_SECONDARY_SCREEN provides faster switching than with a real secondary screen and saves memory too. 14. Now that key values have mostly stabilized, moved the compile-time key choices to "feature.h" ("keys.h" now obsolete). 2.15 to 2.16 \----------- 1. Misc cleanup, rxvt once again passes the vttest (and reverse video works again). Kanji support tested and seems to be okay. Finally, an okay set of regular/bold colours. Compile-time option for a right-side scrollbar. 2. Ctrl-minus now (correctly) generates ^_ [0x1F]. Changed termcap/terminfo to use normal cursor keys instead of application cursor keys (rmkx/smkx, ke/ks) -- otherwise subsequent rxvt/xterm starts with the application cursor keys active. 3. Fixed scr_reset() so that resizing is a lot more sensible. Implemented the equivalent SouthWest resizeGravity (xterm X11R5) so the bottom line of text on the screen stays fixed. If the window is made taller, additional saved lines will be scrolled down onto the screen; if the window is made shorter, lines will be scrolled off the top of the screen, and the top saved lines will be dropped. The old resizing code is available with -DOLD_UGLY_RESIZE. 4. Altered code so all man-page documented command-line options will not trigger errors even if the feature wasn't compiled into rxvt. Added old, backward compatibility command-line options, but they're simply ignored. Eventually they can be removed -- perhaps Jan'97? `-8': use `+7' `-fat': use `-sb' `-thin': use `-arrows' `-meta8thbit' use `-meta8' `-metaescape' use `-meta' `-font_list' use `-font1', `-font2', etc. These ones are just too weird to support: `-ls-': use `+ls' `-ma-': use `+ma' 5. Removed secure-keyboard option, too problematic and obscure. 6. First attempt at GNU autoconfig. Still needs some work, but it's mostly okay. 7. Added minor aliases for foreground/background colours. This permits colour specifications like -fg "#13" -bg "#10", which would set the foreground to colour 13 (bright yellow) and the background to colour 10 (bright black). It's not terribly useful yet, but might eventually be a nice way to have bold/blink colour work even on with the standard fg/bg colours. 2.14 to 2.15 \----------- 1. Small bug: initial width incorrect when there was no scrollBar. 2. Close the gaping security hole. Renounce setuid/setgid privileges immediately and only take them up as needed -- chown() or writing into /etc/utmp. 3. Reverted to using `<' and '>' to toggle smaller/bigger fonts. It seems that many didn't like KP_Subtract/XK_KP_Add -- conflicts with some editors, and not all terminals have a Keypad anyhow. 4. Man page reformatted by Piercarlo Grandi so that it "now is done in the most delightful [sic] elegant 'roff style :-)" 5. Started to integrate the Kanji support based on old patches from the Linux-JE (Japanese Extensions) project. Consider it alpha until one of the JE authors gives it a thorough check. 6. Added compile-time selection of a few different scrollbar widths. 7. When reading X resources, rxvt now recognizes two class names: "XTerm" and "RXvt". The reason for two distinct names is that there are many options common between rxvt and xterm -- to which the class name "XTerm" permits easy access and configuration -- but there are also several options, notably colours and key-handling, unique to rxvt but which are useful to share between different rxvt configurations; the class name "RXvt" permits this. NB: The "RXvt" class takes precedence (in the event of a clash) and is the only one ever used for the application defaults file. 8. The initial value used for the Backspace key (^H or ^?) is now determined from the value of CERASE used to set the termios structures. This removes the need for the BACKSPACE_AS_DELETE compile-time option. 2.13 to 2.14 \----------- 1. Default HOTKEY prefix can now be choosen as `meta', `ctrl' or `shift'. Moved font toggle to KP_Add/KP_Subtract to resemble resolution toggling of the XFree86 server (Linux) and so that Alt-< can generate ESC-< for Emacs usage. Man page and usage() reflect the changes. Note that if you choose the hotkey to be `shift', to mimic the Linux console scrollback, you'll probably want different keybindings for mapAlert and Secure. The choice of the HOTKEY (ctrl or meta) prefix and some of the key-strings can be compile-time defined in "rxvtkeys.h", although probably the only changes desired will be in the string value associated with XK_Delete and in the choice of a HOTKEY (ctrl or meta) prefix. Use shift or ctrl to temporarily toggle Backspace from ^H to ^?. Use shift to temporarily toggle the application keypad. 2. Patch so that setting bold or blink works before or after changing the colour (it used to only work before changing the colour). Also added the option of having DOS VGA colours. Thanks Avery Pennarun 3. Extensive reworking of pseudo-tty handling and addition of BSD sgtty terminal handling and new utmpx (Solaris 2.x) support. MANY thanks to Raul Garcia Garcia (rgg@tid.es). POSIX wtmp support added by Piet W. Plomp (piet@icce.rug.nl) Added -/+ut option (resource: utmpInhibit) so you can sometimes be harder to find :) 4. Finally? cleaned-up selection so that it works properly -- clears a previously selected region without causing a core dump -- define NEW_SELECTION. I believe that this should fix a long-standing problem with the selection mechanism -- probably back from when selection of the scrollback was added -- whereby all accounting was done in terms of screen row values [0 .. RxvtWin.rows-1] plus the current offset value. The anchor and end points were scrolled with the screen, but the beginning point wasn't and extending a region that had its anchor scrolled-off would give complete garbage. The new selection scheme has lots of bounds-checking (too much?) to prevent these problems. If PRINT_PIPE is not defined, then you can use PrintScreen to dump some of the current selection state -- this should help debugging. Thanks to John Davis (davis@space.mit.edu) and Piet W. Plomp (piet@icce.rug.nl) for helping to diagnose the problem. 5. Use information request `ESC [ 8 n' to change the window title to the current rxvt version so you can find out what version you have. 6. Added simple code to permit run-time definition of the keysyms 0xFF00 - 0xFFFF if KEYSYM_RESOURCE (for FAKE_RESOURCES only) is defined. It's not as pretty as that used by xterm since it only works with keysym values rather that key names, but the impact on code size is quite minimal. I use it in conjunction with `-name vm' to remap arrow and function keys for tn3270 ... quite handy. At the moment the string length is only limited by the line length (currently 256) used in "resources.c" The syntax (at the moment) is rxvt*keysym.0xFFnn: "a string value" where `nn' is a 2 digit hex value 00 to FF. Of course if there were an easy and small means of converting key names to keysym values, then that would be better. The enclosing quotes are required to start/end with whitespace. Most of the usual escape values can be used: \b - backspace \e - escape \n - newline \r - carriage return \t - tab \000 - octal number Anyhow, here's a brief example of what it looks like in ~/.Xdefaults: ! F11 key - mimic the output of F1 rxvt*keysym.0xFFC8: \e[11~ ! F12 key - whatever rxvt*keysym.0xFFC9: Hello World!\n"\"String\" ends with whitespace " ! Delete key - remap rxvt*keysym.0xFFFF: "Delete :)" !Scroll_Lock as flow-control (^S) rxvt*keysym.0xFF14: \023 7. Oops -- fixed resource name from scrollbar to scrollBar. Fixed cursor colours to black on white (like xterm) for the scrollbar cursors, but I've left the xterm (`I'-bar) cursor as foreground on background because it looks so nice. Allocate all colours when creating the window so that we don't have to worry about it later and so that we can avoid potential hassles with colour-hungry applications like Netscape. 8. Added a way to distinguish an rxvt from an xterm via the obsolete ESC Z sending the vt100 answer string with 'c' -> 'C'. Added support for resolving the actual IP number of the host for remote DISPLAYs. Changed the answer back for ESC[7n to add a trailing newline to support easier input into the shell. When the display is local (i.e. :0), we add support for sending the first non-loopback interface IP number as the DISPLAY instead of just sending the incorrect ":0". This way telnet/rlogin shells can actually get the correct information into DISPLAY for xclients. Courtesy of Chuck Blake [Note: I've not had a chance to thoroughly test this -- mjo] 2.12 to 2.13 \----------- 1. Shift and Control now only work for non-application mode cursor keys and with function keys. 2. Override XTerm mouse reporting with either Mod1 or Shift. X11 mouse reporting now properly includes modifier keys (see rxvt.ref). Although this effectively degenerates to the Control modifier alone since both Shift and Meta are used to temporarily disable mouse reporting -- I don't know an easy way around this but that's what XTerm does, although since it uses Control to pop-up menus, that doesn't get transmitted either. 3. Moved a few more configuration items from Imakefile to configure.h 4. Added XAPPLOADDIR define to the Imakefile to allow use of the application defaults file XAPPLOADDIR/RXvt when rxvt has been compiled with FAKE_RESOURCES. Now, the following files are checked: XAPPLOADDIR/RXvt (compile-time defined) $HOME/.Xdefaults or $HOME/.Xresources suggested by John Gotts 5. Applied patches by Edward D.H. Liu to fix the speed of pasting rxvt's selection to motif, xew or tk. Finally! reasonable pasting speed to these applications. 6. patches by Gregory Margo for xterm-style proportional scrollbar behaviour: If pointer is near top, scroll one line. If pointer is near bottom, scroll full page. refreshPeriod resource and -refresh option ... still wishing for faster screen refreshing. 7. Bug fix for partial matches (FAKE_RESOURCES). In addition to resources for resource name `rxvt', also get resources for class name `XTerm' as well. Remove checking for `command' resource since it's not found in xterm nor was there any code in place to parse the command arguments ... better just to use the command-line -e option. Replace `fontList' with font1, font2, ... etc. for better xterm compatibility and for ease of configuration. Changed processing of string resources and command-line string options to avoid allocating redundant memory. 8. Previously selected region is now properly cleared when Button1 is pressed. Still have problems with click-and-drag when Mod1 or Shift is used to override mouse reporting -- argh! Until someone gets this properly patched, use Button1 followed by Button3 (to extend region) in these instances. 9. Understands ANSI set default fg/bg colour (\E[39m / \E[49m) 10. In the screen accounting used in screen.c, use a '\n' to terminate wrapped lines instead of '\0'. This should avoid mouse selection of wrapped lines from including a bogus newline. No known side-effects, but changes isolated by #define NEW_WRAPTYPE. 2.11 to 2.12 \----------- 1. Extra functionality for XTerm mouse report mode. If mouse reporting is enabled (the application will handle mouse events) the normal scrollbar operation is disabled -- instead rxvt sends UP/DOWN for the arrow buttons and PageUp/PageDown when Button1 or Button3 are clicked on the scrollbar. Use Mod1 (Alt) key to get the normal scrollbar/arrow button actions and also to get the normal selection functions -- so that you can still cut/paste between X applications. 2. New colour possibilities -- 16 colours. Instead of using fatter characters, a bold attribute now uses a brighter foreground colour. Similarly, a blink attribute will use a brighter background colour. It is also possible to choose these colours through the resources (color0 -- color7) permit specification of the ANSI colours (black, red, green, yellow, blue, magenta, cyan, white), the resources (color10 -- color17) are the brighter bold/blink equivalents. Define USE_FAKE_BOLD to disable. 3. Extensive clean-up of source and headers to separate interdependencies, remove unused variables. Introduced static variables wherever possible to limit scoping and reduced the number of external variables. 4. Allow NumLock to toggle on/off the application keypad. Backspace sends '\b', Ctrl-Backspace sends '\177'. Define BACKSPACE_AS_DELETE to reverse these values or use the escape sequence: ESC [ 36 h Backspace key sends BS ESC [ 36 l Backspace key sends DEL XK_End used to send "\033Ow", which is identical to XK_KP_7 and confuses EDT-type editors. Now, Home = "\033[7~" End = "\033[8~" Changed Alert & Secure keys from Alt-i & Alt-s to Alt-I & Alt-S so they aren't so easily toggled. 5. Extra keystroke info. Pass Control and Shift indicators for function keys (similar to the XJed editor) eg, F1 = ESC [11~ C-F1 = ESC [11^ S-F1 = ESC [11$ also, pass indication of shift status for arrow-keys eg, Up, Down, Right, Left = ESC [A, ESC [B, ESC [C, ESC [D S-Up, S-Down, S-Right, S-Left = ESC [a, ESC [b, ESC [c, ESC [d You wouldn't be able to use these keys for termcap/terminfo applications, but the key sequences are available for remapping within an application. 6. Added configure.h which is included by each source file and by the Imakefile. Common compilation defines are now all contained in configure.h with minor system defines remaining in Imakefile -- makes it much easier to configure. Used XCOMM macro in Imakefile so that it actually works. Also added defaults.h for defining user-specific startup defaults. 7. Added rxvt.ref to provide documentation of the various terminal sequences that are processed. Updated man page to reflect changes. 8. Use xterm-style -/+ to turn on/off options, rationalized resource names to more closely resemble xterm. Option Resource -help - -display displayname - -geometry geom geometry: -bg color background: -fg color foreground: -color color color: where = [0-7], 1[0-7] -fn fontname font: -fontList names fontList: ... -name string - -/+ls loginShell: True/False -/+ma mapAlert: True/False -/+vb visualBell: True/False -/+sb scrollbar: True/False -/+arrows scrollbar: Arrows/True/False -ic - -meta8 meta: 8bit -/+meta meta: True/False -sl number saveLines: -grk4 - -grk9 - -print-pipe name pipe-pipe: -e command arg ... command: -T string title: -n string iconName: -C - -/+7 bits: 7/8 -secure keysym secure_key: -pageup keysym pageup_key: -pagedown keysym pagedown_key: -bigfont keysym bigfont_key: -smallfont keysym smallfont_key: -prkey keysym printscreen_key: greektoggle_key: cutchars: 9. Fixed Button actions for XTerm-style scrollbar so that Button1 and Button3 do different things as they are supposed to. Replace -/+fat with -/+sb and -/+arrows for more consistency with XTerm. Decreased width of `fat' scrollbar (make closer to xterm) and increased width of `thin' scrollbar (arrows too small) -- they are now the same width. Also made it possible to remove the scrollbar altogether. Added a visual bell. Added many more defines to further reduce code size for various cases, see "configure.h". It is also possible to alter settings in "defaults.h" for configuration options that will only affect screen.c and xsetup.c, this should help with compile-time customization for those who don't want to use Xdefaults. Added the define REPLACE_SELECTION_NEWLINE to make the substitution of newlines with carriage returns for selection pasting a compile-time option. 10. Fixed the graphics samples so that if you want to it's actually possible to compile them. Added -name command-line option so that it's possible to select different sets of resources. 11. Integrated initial support for X11 mouse reporting and added Shift + Function Keys support. 2.10 to 2.11 1. If NEW_COLOR_MODEL is defined in screen.c, the new model I described in an earlier email is used. (apparantly there are two, slightly differnt models for using color extensions in a vt-compatible terminal. This flag lets you switch. 2. If XTERM_MOUSE_REPORT is defined in command.c, mouse reporting is turned on/off via the appropriate escape sequences. XTerm already provides this support. 3. If .Xdefaults does not exist, .Xresources is searched for. It seems that many here use .Xresources. 2.09 to 2.10 1. Really fixed the color problem (?) Got color-ls, and it works now. 2. Added patch to allow run-time selection of font list. 2.07 to 2.09 1. Fixed some color-usage errors. 2. Added double and triple-click support compliments of ah@doc.ic.ac.uk (Angelo Haritsis) 3. Added Print Screen capability, as in most vt-100's 2.06 to 2.07 1. Fixed problems with rxvt screwing up tty permisssions (?) 2.03 to 2.06 1. Fixed a limit which imposed a maximum width for the terminal window of 255 characters. There is no limit now. 2. Made provision for applications to get mouse-click feedback when user clicks in a graphics window. See graphics_sample 2.02 to 2.03 1. Fixed memory management just a little. 2.0 to 2.02 1. Bug fixes for color and graphics. 1.97 to 2.0 1. Added ANSI color support. Compile with -DCOLOR 2. Added a graphics mode. Compile with -DGRAPHICS 1.96 to 1.97 1. Bug in refresh() which was causing slow refreshes after clear-screens was fixed. Showed up during emacs start-up. 1.95 to 1.96 1. rxvt did bad things if it received mouse - Motion events without a preceeding button-press. Fixed. 1.94 to 1.95 1. Created a substitute for XGetDefaults, which seemed to account for 1/2 to 2/3 of the memory used by rxvt (according to the SIZE field of ps output). My substitute only reads the .Xdefaults file. Compile with -DFAKE_RESOURCES to get my mini- XDefaults handling, -DREAL_RESOURCES to keep XGetDefault. 1.93 to 1.94 1. Fixed some minor long-standing errors in the vt100 emulation. 2. Fixed ALT- handling in command.c 3. Fixed minor bug with start-of-selection location. 4. Added xterm-type "extend selection" feature using mouse button 3. Button 1 always starts a new selection. Button3 tries to extend the current selection if possible. 5. Fixed problem with bold-face fonts overflowing into the next character for some fonts. 1.92 to 1.93 1. ran gprof to find bottle-necks in the code. Halved user time, but had little effect on total time required to update the display. Seems worth keeping for the more efficient user-time, though. At this point, I think that most of the elapsed time is spent waiting for input or waiting for the X buffers to flush. 2. Used to refresh the screen every 2.2 screen-fulls during flat-out scrolling. Really cuts down on scroll-time. Now, refresh every screen-full (or when there's a pause in activity), but when flat-out scrolling starts, decrease the refresh period, so that its every 10th screenful after a little while. This has no noticeable visible effect, since the scrolling text is absolutely unintelligible anyway, but will improve the scroll "feel" when doing just one or two screenfulls, ie in an ls -l. 3. Surrounded the code which uses XCopyArea with #ifdef's I have never seen this help performance, but I think that there may be some video-systems which benefit from this, particularly in a full-screen editor or slow scrolling type of setting. 4. Performance in flat out scrolling, text only, on a sparc-10, displaying rxvt on an HDS x-terminal: nation@snoopy>/usr/bin/time rxvt -e cat k 6.1 real 3.1 user 2.5 sys nation@snoopy>/usr/bin/time xterm -e cat k 40.8 real 4.6 user 3.4 sys 1.91 to 1.92 1. Added greek-keyboard support patches. 1.85 to 1.91 1. assorted minor patches 1.82 to 1.85 1. Fixed ESC c handling. 2. Fixed minor selection handling bug. 1.81 to 1.82 1. Fixed slow refresh during selection process 2. Fixed problem of not correctly clearing selections of 1 character. 1.80 to 1.81 1. Fixed some scrolling problems, problems with partially obscured windows. 2. Added some neat debugging capability in debug.c 3. Patched up rclock. 1.74 to 1.80 1. Fixed core dump from selecting past the bottom of the screen 2. Fixed a few escape sequences, per the vttest program 3. Broke and fixed handling of moved/resize/new-font handling. 4. Still can't change tab stops correctly. 5. Ran vt-100 test suite. Added capability to change tab stops and enter reverse video, and to switch from 80 to 132 columns and back. Fixed a seg-fault in scroll(). 1.70 to 1.74 1. Fixed cursor drawing errors. 2. Improved smoothness of scroll-back operations. 3. Applied some SVR4 patches. 4. Applied HPUX patches, and a few cursor display patches 5. Fixed up font-changing routines a bit. 6. Fixed a scrolling problem for windows taller than the scroll-back buffer. 1.6 to 1.7 1. Fixed the problem with random rendition flags in the scroll back buffer 2. Fiddled with re-drawing on the scroll-bar, and with how often refreshing occurs. 3. Incorporated some AIX patches. 4. Included #ifdef'd changes to support vt100 printer. 5. Fixed send_string routine, so that it doesn't loose data. 6. Complete re-write of screen.c 1.5 to 1.6 1. Removed all use of a seperate bold font. Now uses over-striking exclusively. 2. Added some more optimizations for drawing speed when the window is re-sized or moved. 3. Implemented speed ups in screen.c 1.47 to 1.48 1. Cleaned up re-drawing on expose events, so rxvt only re-draws the newly exposed parts of the screen. 2. Fixed backspace, which must have broken in 1.45. 3. Added command line option of iconic startup. from 1.45 to 1.47 1. Incorporated improved bsd utmp handling from dperry@ringer.cs.utsa.edu (David Perry) 2. Fixed a very minor bug where the solid-cursor can leave a a bit of a ghost when you resize the window. Its stupid, but it always bothered me. from 1.4 to 1.45 1. Fixed scrolling error when switching to larger fonts 2. Fixed utmp-entry removal for SYSV type systems. 3. Icorportated patches for FreeBSD and svr4 rxvt-2.7.10/doc/TODO010064400001440000024000000014770733371421600125130ustar gcwstaff- Convert checks for char/short/int/long to Xmd.h defines? - Improve documentation... - Multichar font (eg. Kanji) bold-overstrike pixel dropping support - Need font-check for multichar fonts (eg. Kanji). - Extend menu language / facility - add commandline option to change FONT0_IDX - i.e. start with a different font from the main font list, e.g. "rxvt -<...> -1" to start as if we had already pressed Shift-KP_Subtract (for some yet unchosen <...> option) In progress: - Rewrite event-queue handling (and fix reintroduced font size change bug) - Add Unicode support (work is being done by Xianping Ge and others) - extend keysym support to allow for modifiers for keysyms (work from David Oriva not yet added) - port graphics/ directory to more platforms (including mine :-) ) rxvt-2.7.10/doc/FAQ010064400001440000024000000235710702765034500123560ustar gcwstaff-------------------------------------------------------------------------- FAQ -------------------------------------------------------------------------- ----- Q: How do I know which rxvt version I'm using? A: The version number is displayed with the usage (-h). For rxvt version 2.14 and later, the escape sequence `ESC[8n' sets the window title to the version number. ----- Q: Mouse cut/paste suddenly no longer works. A: Make sure that mouse reporting is actually turned off since killing some editors prematurely may leave the mouse in mouse report mode. I've heard that tcsh may use mouse reporting unless it otherwise specified. A quick check is to see if cut/paste works when the Alt or Shift keys are depressed. See doc/refer.txt ----- Q: What's with this bold/blink stuff? I can never get blinking text! A: It is not possible, and likely will never be, for rxvt to have actual blinking text. Instead (if rxvt was compiled without NO_BOLDCOLOR), bold/blink attributes are used to set high-intensity foreground/background colors ... like what you'd see on a PC video adapter. There are programs, notably John Davis' SLang-based ones , that use bold/blink attributes to permit 16 colors. color0-7 are the low-intensity colors. color8-15 are the corresponding high-intensity colors. A side issue of this bold/blink stuff is the question of how the normal default foreground/background colors are to be treated. If the default foreground/background match one of the low-intensity colors (color0-7), the bold/blink attribute will invoke the appropriate high-intensity color (color8-15). In the case that the default foreground doesn't match one of the low-intensity colors, the bold attribute will use an `overstrike' to simulate a bold font. But note this leaves pixel-droppings and so, rather than wasting an inordinate amounts of energy to fix it, its use is simply deprecated. In the case that the default background doesn't match one of the low-intensity colors, the blink attribute is simply ignored (rather than representing it as bold as xterm does). ----- Q: I don't like the screen colors. How do I change them? A: You can change the screen colors at run-time using ~/.Xdefaults resources (or as long-options) ... see the man-page. Here are values that are supposed to resemble a VGA screen, including the murky brown that passes for low-intensity yellow: Rxvt*color0: #000000 Rxvt*color1: #A80000 Rxvt*color2: #00A800 Rxvt*color3: #A8A800 Rxvt*color4: #0000A8 Rxvt*color5: #A800A8 Rxvt*color6: #00A8A8 Rxvt*color7: #A8A8A8 Rxvt*color8: #000054 Rxvt*color9: #FF0054 Rxvt*color10: #00FF54 Rxvt*color11: #FFFF54 Rxvt*color12: #0000FF Rxvt*color13: #FF00FF Rxvt*color14: #00FFFF Rxvt*color15: #FFFFFF ----- Q: What's with the strange Backspace/Delete key behaviour? A: Assuming that the physical Backspace key corresponds to the BackSpace keysym (not likely for Linux ... see the following question) there are two standard values that can be used for Backspace: ^H and ^?. Rxvt tries to inherit the current stty settings and uses the value of `erase' to guess the value for backspace. If rxvt wasn't started from a terminal (say, from a menu or by remote shell), then the system value of `erase', which corresponds to CERASE in , will be used (which may not be the same as your stty setting). For starting a new rxvt: use Backspace = ^H $ stty erase ^H $ rxvt use Backspace = ^? $ stty erase ^? $ rxvt NB: generate either value with BackSpace and Ctrl/Shift-BackSpace. Toggle with "ESC[36h" / "ESC[36l" as documented in "doc/refer.txt" For an existing rxvt: use Backspace = ^H $ stty erase ^H $ echo -n "^[[36h" use Backspace = ^? $ stty erase ^? $ echo -n "^[[36l" This helps satisfy some of the Backspace discrepancies that occur, but if you use Backspace = ^?, make sure that the termcap/terminfo value properly reflects that. The Delete key (which one would expect to emit ^?) is a another casualty of the ill-defined Backspace problem. To avoid confusion between the Backspace and Delete keys, the Delete key has been assigned an escape sequence to match the vt100 for Execute (ESC[3~) and is in the supplied termcap/terminfo. Some other Backspace problems: some editors use termcap/terminfo, some editors (vim I'm told) expect Backspace = ^H, GNU Emacs (and Emacs-like editors) use ^H for help. Perhaps someday this will all be resolved in a consistent manner ... and maybe xterm will have Home/End values too! ----- Q: Why doesn't the Backspace key work on my Linux machine? A: The XFree86 server has a notorious problem of mapping the Backspace key as Delete in order to match the Linux console. The correct way to fix this: 0 - Complain to your Linux distributer and the XFree86 team, maybe they'll fix it. 1 - Use xmodmap to correct the Backspace mapping ! ~/.Xmodmap ! a correctly-mapped BackSpace keycode 22 = BackSpace *** Make sure the keycode above matches the physical Backspace key on your machine!! (use xev) *** This will also fix the BackSpace problem with Motif applications, such as ``why doesn't Backspace work for Netscape?'' You now have a Backspace key that functions as described in the previous question. 1a - You may also want to fix the regular xterm if it doesn't generates the desired value for BackSpace xterm*vt100.translations: #override \ BackSpace: string(\010) \n or xterm*vt100.translations: #override \ BackSpace: string(\177) \n while you are at it, you may also want to have consistent values to Home/End/Delete xterm*vt100.translations: #override \ Home: string("\033[7~") \n\ End: string("\033[8~") \n\ Delete: string("\033[3~") \n Finally, you can also remap the rxvt key-binding at run-time (next question) but you'll lose the ability to have Ctrl/Shift-Backspace work differently as well as losing the escape sequence toggling of Backspace. ----- Q: I don't like the key-bindings. How do I change them? A: There are some compile-time selections available via configure. Unless you have run "configure" with the "--disable-resources" option you can use the `keysym' resource to alter the keystrings associated with keysym 0xFF00 - 0xFFFF (function, cursor keys, etc). Here's an example for a tn3270 session started using `rxvt -name tn3270' !# ----- special uses ------: ! tn3270 login, remap function and arrow keys. tn3270*font: *clean-bold-*-*--15-* ! keysym - used by rxvt only ! Delete - ^D tn3270*keysym.0xFFFF: \004 ! Home - ^A tn3270*keysym.0xFF50: \001 ! Left - ^B tn3270*keysym.0xFF51: \002 ! Up - ^P tn3270*keysym.0xFF52: \020 ! Right - ^F tn3270*keysym.0xFF53: \006 ! Down - ^N tn3270*keysym.0xFF54: \016 ! End - ^E tn3270*keysym.0xFF57: \005 ! F1 - F12 tn3270*keysym.0xFFBE: \e1 tn3270*keysym.0xFFBF: \e2 tn3270*keysym.0xFFC0: \e3 tn3270*keysym.0xFFC1: \e4 tn3270*keysym.0xFFC2: \e5 tn3270*keysym.0xFFC3: \e6 tn3270*keysym.0xFFC4: \e7 tn3270*keysym.0xFFC5: \e8 tn3270*keysym.0xFFC6: \e9 tn3270*keysym.0xFFC7: \e0 tn3270*keysym.0xFFC8: \e- tn3270*keysym.0xFFC9: \e= ! map Prior/Next to F7/F8 tn3270*keysym.0xFF55: \e7 tn3270*keysym.0xFF56: \e8 ----- Q: I'm using keyboard model XXX that has extra Prior/Next/Insert keys. How do I make use of them? For example, the Sun Keyboard type 4 has the following mappings that rxvt doesn't recognize. KP_Insert == Insert F22 == Print F27 == Home F29 == Prior F33 == End F35 == Next A: Rather than have rxvt try to accomodate all the various possible keyboard mappings, it is better to use `xmodmap' to remap the keys as required for your particular machine. ----- Q: How do I distinguish if I'm running rxvt or a regular xterm? I need this to decide about setting colors etc. A: rxvt always exports the variable "COLORTERM", so you can check and see if that is set. Note that several programs, JED, slrn, Midnight Commander automatically check this variable to decide whether or not to use color. ----- Q: How do I set the correct, full IP address for the DISPLAY variable? A: If you've compiled rxvt with DISPLAY_IS_IP then it is possible to use the following shell script snippets to correctly set the display. If your version of rxvt wasn't also compiled with ESCZ_ANSWER (as assumed in these snippets) then the COLORTERM variable can be used to distinguish rxvt from a regular xterm. Courtesy of Chuck Blake with the following shell script snippets: # Bourne/Korn/POSIX family of shells: [ ${TERM:-foo} = foo ] && TERM=xterm # assume an xterm if we don't know if [ ${TERM:-foo} = xterm ]; then stty -icanon -echo min 0 time 15 # see if enhanced rxvt or not echo -n '^[Z' read term_id stty icanon echo if [ ""${term_id} = '^[[?1;2C' -a ${DISPLAY:-foo} = foo ]; then echo -n '^[[7n' # query the rxvt we are in for the DISPLAY string read DISPLAY # set it in our local shell fi fi csh/tcsh family of shells: if ( !(${?TERM}) ) then # if term is unset, we are probably in an xterm TERM = xterm endif if ( ${TERM} =~ xterm ) then stty -icanon -echo min 0 time 15 # see if enhanced rxvt or not echo -n '^[Z' set term_id=$< stty icanon echo if ( ""${term_id} == "^[[?1;2C" && ${?DISPLAY} == 0 ) then echo -n '^[[7n' # query the rxvt we're in for the DISPLAY string setenv DISPLAY "$<" # set it in our local shell endif endif ----- Q: How do I compile the manual pages for myself? Where do I obtain yodl from? A: You need to obtain yodl and compile it to make the manual pages from source. The source code for yodl can currently be obtained from http://www.xs4all.nl/~jantien/yodl/index.html -- EOF rxvt-2.7.10/doc/BUGS010064400001440000024000000006140673635370400125050ustar gcwstaff === Rxvt BUGS === Please send all bugs you have conceived and they are not listed here to rxvt-bugs@rxvt.org O v e r v i e w --------------- 1) swap screen selection 1) swap screen selection mason: Sometimes selection fails after or in swap screen use mason: I haven't seen this lately (Nov 98). May have been fixed as part of another fix? rxvt-2.7.10/doc/README.xvt010064400001440000024000000142670651657462700135400ustar gcwstaff------------------------------------------------------------------------- Rxvt is a heavily modified version of xvt, many modifications were made by Rob Nation to make it a little more compact and to add a few simple features. This is the README that came with xvt-2.0. It is included mainly to give the original author credit for his work. README file for xvt 2.0 ----------------------- Xvt is an X terminal-emulator that is designed to be more or less compatible with xterm while using much less swap space. It is mainly intended for use at sites which use large numbers of X terminals but may also be useful on single workstations that are short of memory. On a SPARCstation running SunOS4, an initially invoked xvt uses about 1/3 megabyte of swap while xterm uses about 1.3 megabytes (obtained by running pstat rather than ps which seems to give unreliable size figures on SPARCs). The main way that xvt achieves its small size is by avoiding the use of the X toolkit. The current version of xvt is our default X terminal emulator and has been used for eight months by students, computing support staff and service users and so is fairly well tested. Supported architectures ----------------------- One of the major changes between xvt-1.0 and 2.0 is that xvt-2.0 is much more portable. The released version should build and run on all the architectures I have access to, namely: SunOS4, SunOS5, HP-UX 8.0, HP-UX 9.0, DEC OSF/1 V1.2 and ULTRIX 3.?. In addition, the teletype initialisation code has been completely restructured to make it more portable. Almost all the system dependent code is in the single source file, ttyinit.c. Xterm features not supported ---------------------------- - Tektronix 4014 emulation - Session logging - Pop-up menus. The only one of xterm's popup menu commands that is provided in xvt is displaying and hiding of the scrollbar and this is done simply by pressing any mouse key in the window with the CONTROL key held down. - Toolkit style configurability. In particular, xvt does not allow the user to remap the mouse or keyboard keys. Major xterm features that are supported --------------------------------------- - VT100 emulation. Most of the main escape sequences are supported - certainly all those used by the standard screen based UNIX applications. - Lines that scroll off the top of the window are saved can be scrolled back with a scrollbar. - Text selection and insertion including double and triple click for words and lines. Differences between xvt2.0 and xvt1.0 ------------------------------------- - xvt2.0 is eight bit clean and will generate and display eight bit characters. The META key can be used to generate characters with the eighth bit set (in eight bit mode) or prefix by escape (in seven bit mode). - The teletype setup code has been rewritten to make it much more portable. See the comments at the head of ttyinit.c. - Exposure handling has been made much more efficient so that xvt should now be useable with window managers that provide opaque window movement. - VT100 graphics characters are supported for fonts that include them. - There is now a -ls option to enable the use of a login shell. - Colored text cursors are now supported. - There is support for the -C (console window) option but only on SunOS 4. - Bold characters are generated by overstriking if no bold font is specified. - Function keys generate escape sequences as in xterm. - A number of bugs have been fixed: - Setting the title without a terminating ^G no longer locks up. - Paste followed by a keystroke will always insert in the correct order. - Pasting an uninitialised string will not cause a crash. Other differences between xvt and xterm --------------------------------------- - Xvt has a couple of additional enquiry escape sequences: ESC[7n - causes xvt to respond with the name of its X display in a form that can be used to initialise the DISPLAY environment variable. If this is done in a user's .cshrc file it provides a way to automatically update DISPLAY after an rlogin. Something like the following should work if the initial ^[ in the echo command is an ESC character: if(!($?DISPLAY)) then if($?term) then if($term =~ xterm*) then stty -echo >/dev/tty echo -n '^[[7n' >/dev/tty setenv DISPLAY `line /dev/tty endif endif endif ESC[8n - causes xvt to respond with a hex encoded copy of the server's magic cookie which can be used to update a user's .Xauthority file. We have a program to do this which could be made available if anyone is interested. Known Bugs ---------- - xvt does not know about transferring selections in installments and so making large selections or trying to insert large selections will fail. The maximum selection size supported is server dependent but seems to be a little under 64k on all our servers. - xvt does not look in all the approved places for its X resources. It does, however, work correctly with resources that have been loaded into the server using xrdb Building and installing xvt --------------------------- Xvt does not use imake but does come with a simple Makefile configuration scheme that provides some help with getting the Makefile right. If you want to build xvt on one of the supported architectures then you should uncomment the appropriate definition at the start of the Makefile and then run `make config', which will modify other Makefile comments to bring them into line with the chosen architecture. To install xvt, you should edit the MANDIR and BIN pathnames in the Makefile and then type 'make install' as root. When installed for general use, xvt needs to belong to root and have the setuid flag set so that it can make entries in the /etc/utmp file. Thanks to all the people who have mailed bug reports, patches and local improvements. Some requested additions have gone into V2.0, others perhaps should have, but were left out due to lack of time. Please send bug reports and WIBNIs to: John Bovey Computing Laboratory University of Kent at Canterbury Canterbury Kent UK email: jdb@ukc.ac.uk rxvt-2.7.10/doc/README.menu010064400001440000024000000037400651657462700136550ustar gcwstaffA few examples of constructing menubars for rxvt. Used in conjuction with the reference material (rxvtRef.html/txt), it should be possible to piece together some useful menus without too much time. C-shell users be warned. Some of the menu items contain bsh/ksh constructs like ${EDITOR:-vi}\r which will cause your shell to gag. ---------------------------------------------------------------------- example.menu: simple menus for Pico and the Shell jedmenu.sl: (almost) self-contained SLang code for loading up a menubar for the Jed editor. It doesn't need terminal.menu, but looks a bit better with it. Note for JED users: since rxvt provides an escape sequence to override the normal XTerm interpretation of Shift-Insert/Prev/Next, "wmark.sl" (MS-windows-style shift marking) works really well and is a nice bonus for those forced to switch to/from MS-windows terminal.menu common rxvt terminal functions used by the other menus menu: a small shell script to reduce the pain of typing echo "ESC]10; ... BEL" for every menubar command. It also contains a sample "default" menu at the bottom. rxvt.menu: A nice script that allows a convenient way to have different menubars used for rlogin|telnet to a machine. Of course to get it to work, you'll need to add your own machine names (and remove mine). The script is set up so that "rxvt" will be called if the first argument to the script does not contain "rxvt". So rxvt.menu [options] is the same as rxvt.menu rxvt [options] To always have this script act as the front-end for rxvt: 1) install the rxvt binary somewhere not in your path 2) set the `exe' in menu.script to point to this binary eg, exe="/usr/local/X11/rxvt-2.21/rxvt" # default program to execute 3) have rxvt.menu linked somewhere in your path as `rxvt' 4) add all the various machines/menus combinations to rxvt.menu, or else make a separate database and change the `menu' variable in rxvt.menu to suit. rxvt-2.7.10/doc/README.greek010064400001440000024000000124260651657462700140070ustar gcwstaff ------------------------------- rxvt support for greek keyboard ------------------------------- A. Haritsis rxvt supports both ELOT-928 (ISO-8859-7 standard) and IBM-437 keyboard translations for greek character entry. It is possible to start rxvt windows in any of the two translations, making it possible to use both translations modes simultanesuly on the same screen! No need to convert your files back and forth if you don't want to. When in greek mode, type ; or : twice to emit the respective symbol. No need to switch language mode back and forth! rxvt ISO-8859-7 includes mappings for the following (usually forgotten): anw teleia = ;. << = ;< >> = ;> Also: Copyright = ;c Section = ;s For Greek Elot-928 or IBM-437 keyboard for rxvt & X greek entry support you will need to: 1) compile rxvt with an ANSI C compiler (eg gcc) as follows: Use the --enable-greek option in configure , or edit config.h and define GREEK_SUPPORT Then your rxvt executable with greek support should be created. Install it as you would do for the normal rxvt. There is no need to change its name. It works fully as a normal rxvt but if you press the 'toggle' keysym (see below) it will switch into greek translation mode. The extra memory it takes in less than 4 kBytes. 2) install greek elot & ibm437 fonts(s) for X-windows eg. cp a_greek_font.pcf.Z /usr/lib/X11/misc/ and ammend the fonts.dir and fonts.alias in /usr/lib/X11/misc/. Greek fonts are available as a separate file which you can download from sunsite (/pub/Linux/X11/misc/greek-xfont-pack.tgz). A new release of a FULL set of fixed (and proportional and Type1 for use by netscape etc) can be found in the HCR archive - see at end). I might upload them at sunsite et all as well. 3) include the following in your X resources: rxvt.font: grfixed (or the name of your preferred greek font) rxvt.bits: 8 (default) rxvt.greektoggle_key: Mode_switch (default) where grfixed is an alias for one of the elot-928 font in the pack. Remember that the default keyboard translation is ELOT928. If you need to start rxvt with suppport for IBM437, use the command line of rxvt to set mode & font (command line option -grk4 can do this). Remember to use an Elot font with the Elot translation mode and a 437 font with the IBM437 mode. You can choose any keysym you wish as the "toggler" greek_switch_keysym. Choosing `VoidSymbol' will effectively _disable_ the greek keyboard. The default is keysym `Mode_switch'. For XFree86 this is defined in the /usr/lib/X11/Xmodmap.* files as: keycode 113 = Mode_switch (it is the Right Alt key or ALtGr) You may define it to be something else with a command like: xmodmap -e "keycode ... = Mode_switch" or changing your ~/.Xmodmap file (see xmodmap(1) and X(1) about this). I personally prefer the AltGr key on PC X terminals since it allows fast switching. Of course this might not be liked by left-handed people. You can redefine it to whtever you like under X, but I would NOT recommend keycodes that have other uses. 5) Not all programs are 8-bit clean -- ie, they sometimes strip the top bit of a character which is essential for the greek fonts. Unfortunately bash is one of these programs (at least I couldn't figure out how to make it to work). Use tcsh instead: it is 8-bit clean. You will generally need to include in your ...rc files: For sh/bash: LC_CTYPE=iso_8859_1; export LC_CTYPE LESSCHARSET=latin1; export LESSCHARSET For bash to be 8-bit clean, add the following lines to ~/.inputrc: set meta-flag on set convert-meta off set output-meta on For csh/tcsh: setenv LC_CTYPE iso_8859_1 setenv LESSCHARSET latin1 Still some applications will have problems. Emacs has its own support for greek characters achieved with the .el script written by sarantos@csd.uch.gr (for 19.20 +). It might be possible to have greek support via emacs invocations with the -nw argument (with this version of rxvt) but I have not tried it. Elvis (vi clone) works fine. I highly recommend vim version 3.15 and later. I have added support for making native languge vi'ing very easy (see langmap option). It's by far the most powerful vi (or maybe editor :-) I have ever seen. If some (terminal-based) applications do not work, please direct complaints to their authors stating that you would like them to be 8-bit clean. I will soon release a linux version of an 8-bit clean curses lib and versions of some useful programs that work with it (eg ytalk). Watch the HCR archive. Do not expect programs that are not running within an rxvt window to have greek keyboard support. For this, it will be needed to change the Xlib so that it supports 4-state FSMs (rather than only 2 - I do not count shift keys or caps lock) for keyboard entry (required for greek keyboards). And something amusing and (maybe) useful: some filesystems (including SunOS and Linux filesystems -- haven't checked others) allow names with 8-bit characters; so you can create files or directories with names containing greek characters! Enjoy, Angelo Haritsis For more greek related tools/fonts etc, have a look at the HELLENIC RESOURCES ARCHIVE (HCR) : ftp://dolphin.doc.ic.ac.uk/pub/greek/ maintained by the above author. rxvt-2.7.10/doc/rxvt.html010064400001440000024000001136160764024424300137120ustar gcwstaff RXVT


    RXVT

    X Version 11

    26 MARCH 2003

    NAME

    rxvt (ouR XVT) - a VT102 emulator for the X window system

    SYNOPSIS

    rxvt [options] [-e command [ args ]]

    DESCRIPTION

    rxvt, version 2.7.10, is a colour vt102 terminal emulator intended as an xterm(1) replacement for users who do not require features such as Tektronix 4014 emulation and toolkit-style configurability. As a result, rxvt uses much less swap space -- a significant advantage on a machine serving many X sessions.

    OPTIONS

    The rxvt options (mostly a subset of xterm's) are listed below. In keeping with the smaller-is-better philosophy, options may be eliminated or default values chosen at compile-time, so options and defaults listed may not accurately reflect the version installed on your system. `rxvt -h' gives a list of major compile-time options on the Options line. Option descriptions may be prefixed with which compile option each is dependent upon. e.g. `Compile XIM:' requires XIM on the Options line. Note: `rxvt -help' gives a list of all command-line options compiled into your version.

    Note that rxvt permits the resource name to be used as a long-option (--/++ option) so the potential command-line options are far greater than those listed. For example: `rxvt --loginShell --color1 Orange'.

    Also note that if you do not explictly specify a font (-fn and -fm) or a multichar encoding method (-km), rxvt will select a font for the preferable encoding according to your locale. Supported encodings are: ISO-8859-n (n=1...15), KOI8-R, KOI8-U, EUC-JP, Shift_JIS, EUC-KR, EUC-CN (aka GB), and Big5.

    The following options are available:

    -help, --help
    Print out a message describing available options.

    -display displayname
    Attempt to open a window on the named X display (-d still respected). In the absence of this option, the display specified by the DISPLAY environment variable is used.

    -geometry geom
    Window geometry (-g still respected); resource geometry.

    -rv|+rv
    Turn on/off simulated reverse video; resource reverseVideo.

    -j|+j
    Turn on/off jump scrolling; resource jumpScroll.

    -ip|+ip
    Turn on/off inheriting parent window's pixmap. Alternative form is -tr; resource inheritPixmap.

    -bg colour
    Window background colour; resource background.

    -fg colour
    Window foreground colour; resource foreground.

    -pixmap: file[;geom]
    Compile XPM: Specify XPM file for the background and also optionally specify its scaling with a geometry string. Note you may need to add quotes to avoid special shell interpretation of the `;' in the command-line; resource backgroundPixmap.

    -cr colour
    The cursor colour; resource cursorColor.

    -pr colour
    The mouse pointer colour; resource pointerColor.

    -bd colour
    The colour of the border between the xterm scrollbar and the text; resource borderColor.

    -fn fontname
    Main normal text font; resource font.

    -fb fontname
    Main bold text font; resource boldFont.

    -fm fontname
    Main multicharacter font; resource mfont.

    -km mode
    Compile multichar_languages: Multiple-character font-set encoding mode; eucj: EUC Japanese encoding. sjis: Shift JIS encoding. big5: BIG5 encoding. gb: GB encoding. kr: EUC Korean encoding. noenc: no encoding; resource multichar_encoding.

    -grk mode
    Compile Greek: Greek keyboard translation; iso: ISO-8859 mapping. ibm: IBM-437 mapping; resource greek_keyboard.

    -name name
    Specify the application name under which resources are to be obtained, rather than the default executable file name. Name should not contain `.' or `*' characters. Also sets the icon and title name.

    -ls|+ls
    Start as a login-shell/sub-shell; resource loginShell.

    -ut|+ut
    Compile utmp: Inhibit/enable writing a utmp entry; resource utmpInhibit.

    -vb|+vb
    Turn on/off visual bell on receipt of a bell character; resource visualBell.

    -sb|+sb
    Turn on/off scrollbar; resource scrollBar.

    -si|+si
    Turn on/off scroll-to-bottom on TTY output inhibit; resource scrollTtyOutput has opposite effect.

    -sk|+sk
    Turn on/off scroll-to-bottom on keypress; resource scrollTtyKeypress.

    -sw|+sw
    Turn on/off scrolling with the scrollback buffer as new lines appear. This only takes effect if -si is also given; resource scrollWithBuffer.

    -sr|+sr
    Put scrollbar on right/left; resource scrollBar_right.

    -st|+st
    Display normal (non XTerm/NeXT) scrollbar without/with a trough; resource scrollBar_floating.

    -mcc|+mcc
    Compile multichar_languages: treat multibyte glyphs as single character for backspace, delete and cursor movement keys; resource multibyte_cursor.

    -iconic
    Start iconified, if the window manager supports that option. Alternative form is -ic.

    -sl number
    Save number lines in the scrollback buffer. See resource entry for limits; resource saveLines.

    -b number
    Compile frills: Internal border of number pixels. See resource entry for limits; resource internalBorder.

    -w number
    Compile frills: External border of number pixels. Also, -bw and -borderwidth. See resource entry for limits; resource externalBorder.

    -lsp number
    Compile linespace: Lines (pixel height) to insert between each row of the display; resource linespace.

    -tn termname
    This option specifies the name of the terminal type to be set in the TERM environment variable. This terminal type must exist in the termcap(5) database and should have li# and co# entries; resource termName.

    -e command [arguments]
    Run the command with its command-line arguments in the rxvt window; also sets the window title and icon name to be the basename of the program being executed if neither -title (-T) nor -n are given on the command line. If this option is used, it must be the last on the command-line. If there is no -e option then the default is to run the program specified by the SHELL environment variable or, failing that, sh(1).

    -title text
    Window title (-T still respected); the default title is the basename of the program specified after the -e option, if any, otherwise the application name; resource title.

    -n text
    Icon name; the default name is the basename of the program specified after the -e option, if any, otherwise the application name; resource iconName.

    -C
    Capture system console messages.

    -pt style
    Compile XIM: input style for input method; OverTheSpot, OffTheSpot, Root; resource preeditType.

    -im text
    Compile XIM: input method name. resource inputMethod.

    -mod modifier
    Override detection of Meta modifier with specified key: alt, meta, hyper, super, mod1, mod2, mod3, mod4, mod5; resource modifier.

    -xrm resourcestring
    No effect on rxvt. Simply passes through an argument to be made available in the instance's argument list. Appears in WM_COMMAND in some window managers.

    RESOURCES (available also as long-options)

    Note: `rxvt --help' gives a list of all resources (long options) compiled into your version. If compiled with internal Xresources support (i.e. rxvt -h lists .Xdefaults) then rxvt accepts application defaults set in XAPPLOADDIR/Rxvt (compile-time defined: usually /usr/lib/X11/app-defaults/Rxvt) and resources set in ~/.Xdefaults, or ~/.Xresources if ~/.Xdefaults does not exist. Note that when reading X resources, rxvt recognizes two class names: XTerm and Rxvt. The class name XTerm allows resources common to both rxvt and xterm to be easily configured, while the class name Rxvt allows resources unique to rxvt, notably colours and key-handling, to be shared between different rxvt configurations. If no resources are specified, suitable defaults will be used. Command-line arguments can be used to override resource settings. The following resources are allowed:

    geometry: geom
    Create the window with the specified X window geometry [default 80x24]; option -geometry.

    background: colour
    Use the specified colour as the window's background colour [default White]; option -bg.

    foreground: colour
    Use the specified colour as the window's foreground colour [default Black]; option -fg.

    colorn: colour
    Use the specified colour for the colour value n, where 0-7 corresponds to low-intensity (normal) colours and 8-15 corresponds to high-intensity (bold = bright foreground, blink = bright background) colours. The canonical names are as follows: 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=white, but the actual colour names used are listed in the COLORS AND GRAPHICS section.

    colorBD: colour
    Use the specified colour to display bold characters when the foreground colour is the default.

    colorUL: colour
    Use the specified colour to display underlined characters when the foreground colour is the default.

    colorRV: colour
    Use the specified colour as the background for reverse video characters.

    cursorColor: colour
    Use the specified colour for the cursor. The default is to use the foreground colour; option -cr.

    cursorColor2: colour
    Use the specified colour for the colour of the cursor text. For this to take effect, cursorColor must also be specified. The default is to use the background colour.

    reverseVideo: boolean
    True: simulate reverse video by foreground and background colours; option -rv. False: regular screen colours [default]; option +rv. See note in COLORS AND GRAPHICS section.

    jumpScroll: boolean
    True: specify that jump scrolling should be used. When scrolling quickly, fewer screen updates are performed [default]; option -j. False: specify that smooth scrolling should be used; option +j.

    inheritPixmap: boolean
    True: make the background inherit the parent windows' pixmap, giving artificial transparency. False: do not inherit the parent windows' pixmap.

    scrollColor: colour
    Use the specified colour for the scrollbar [default #B2B2B2].

    troughColor: colour
    Use the specified colour for the scrollbar's trough area [default #969696]. Only relevant for normal (non XTerm/NeXT) scrollbar.

    backgroundPixmap: file[;geom]
    Use the specified XPM file (note the `.xpm' extension is optional) for the background and also optionally specify its scaling with a geometry string WxH+X+Y, in which "W" / "H" specify the horizontal/vertical scale (percent) and "X" / "Y" locate the image centre (percent). A scale of 0 displays the image with tiling. A scale of 1 displays the image without any scaling. A scale of 2 to 9 specifies an integer number of images in that direction. No image will be magnified beyond 10 times its original size. The maximum permitted scale is 1000. [default 0x0+50+50]

    menu: file[;tag]
    Read in the specified menu file (note the `.menu' extension is optional) and also optionally specify a starting tag to find. See the reference documentation for details on the syntax for the menuBar.

    path: path
    Specify the colon-delimited search path for finding files (XPM and menus), in addition to the paths specified by the RXVTPATH and PATH environment variables.

    font: fontname
    Select the main text font used [default 7x14]; option -fn.

    fontn: fontname
    Specify the alternative font n. The default font values:
      font: 7x14
      font1: 6x10
      font2: 6x13
      font3: 8x13
      font4: 9x15

    boldFont: fontname
    Specify the name of the bold font to use if colorBD has not been specified and it is not possible to map the default foreground colour to colour 8-15 [default NONE]. This font must be the same height and width as the normal font; option -fb.

    mfont: fontname
    Select the main multiple-character text font used [default k14]; option -fk.

    mfontn: fontname
    Specify the alternative multiple-character font n. If compiled for multiple-character fonts, the Roman and multiple-character font sizes should match.

    multichar_encoding: mode
    Set the encoding mode to be used when multicharacter encoding is received; eucj: EUC Japanese encoding [default for Kanji]. sjis: Shift JIS encoding. big5: BIG5 encoding. gb: GB encoding. kr: EUC Korean encoding. noenc: no encoding; option -km.

    greek_keyboard: mode
    Set the Greek keyboard translation mode to be used; iso: ISO-8859 mapping (elot-928) [default]. ibm: IBM-437 mapping (DOS codepage 737); option -grk.

    greektoggle_key: keysym
    Set the key to toggle keyboard input between no translation and Greek translation [default Mode_switch]. For more details, see the distributed file README.greek.

    selectstyle: mode
    Set mouse selection style to old which is 2.20, oldword which is xterm style with 2.20 old word selection, or anything else which gives xterm style selection.

    scrollstyle: mode
    Set scrollbar style to rxvt, next or xterm

    title: string
    Set window title string, the default title is the command-line specified after the -e option, if any, otherwise the application name; option -title.

    iconName: string
    Set the name used to label the window's icon or displayed in an icon manager window, it also sets the window's title unless it is explicitly set; option -n.

    mapAlert: boolean
    True: de-iconify (map) on receipt of a bell character. False: no de-iconify (map) on receipt of a bell character [default].

    visualBell: boolean
    True: use visual bell on receipt of a bell character; option -vb. False: no visual bell [default]; option +vb.

    loginShell: boolean
    True: start as a login shell by prepending a `-' to argv[0] of the shell; option -ls. False: start as a normal sub-shell [default]; option +ls.

    utmpInhibit: boolean
    True: inhibit writing record into the system log file utmp; option -ut. False: write record into the system log file utmp [default]; option +ut.

    print-pipe: string
    Specify a command pipe for vt100 printer [default lpr(1)]. Use Print to initiate a screen dump to the printer and Ctrl-Print or Shift-Print to include the scrollback as well.

    scrollBar: boolean
    True: enable the scrollbar [default]; option -sb. False: disable the scrollbar; option +sb.

    scrollBar_right: boolean
    True: place the scrollbar on the right of the window; option -sr. False: place the scrollbar on the left of the window; option +sr.

    scrollBar_floating: boolean
    True: display an rxvt scrollbar without a trough; option -st. False: display an rxvt scrollbar with a trough; option +st.

    scrollBar_align: mode
    Align the top, bottom or centre [default] of the scrollbar thumb with the pointer on middle button press/drag.

    scrollTtyOutput: boolean
    True: scroll to bottom when tty receives output; option(+si). False: do not scroll to bottom when tty receives output; option(-si).

    scrollWithBuffer: boolean
    True: scroll with scrollback buffer when tty recieves new lines (and scrollTtyOutput is False); option(+sw). False: do not scroll with scrollback buffer when tty recieves new lines; option(-sw).

    scrollTtyKeypress: boolean
    True: scroll to bottom when a non-special key is pressed. Special keys are those which are intercepted by rxvt for special handling and are not passed onto the shell; option(-sk). False: do not scroll to bottom when a non-special key is pressed; option(+sk).

    smallfont_key: keysym
    If enabled, use Alt-keysym to toggle to a smaller font [default Alt-<]

    bigfont_key: keysym
    If enabled, use Alt-keysym to toggle to a bigger font [default Alt->]

    saveLines: number
    Save number lines in the scrollback buffer [default 64]. This resource is limited on most machines to 65535; option -sl.

    internalBorder: number
    Internal border of number pixels. This resource is limited to 100; option -b.

    externalBorder: number
    External border of number pixels. This resource is limited to 100; option -w, -bw, -borderwidth.

    termName: termname
    Specifies the terminal type name to be set in the TERM environment variable; option -tn.

    linespace: number
    Specifies number of lines (pixel height) to insert between each row of the display [default 0]; option -lsp.

    meta8: boolean
    True: handle Meta (Alt) + keypress to set the 8th bit. False: handle Meta (Alt) + keypress as an escape prefix [default].

    mouseWheelScrollPage: boolean
    True: the mouse wheel scrolls a page full. False: the mouse wheel scrolls five lines [default].

    multibyte_cursor: boolean
    True: consider multibyte glyphs as single character for backspace, delete and cursor movement keys; option -mcc. False: move through all components of all glyphs; option +mcc.

    backspacekey: string
    The string to send when the backspace key is pressed. If set to DEC or unset it will send Delete (code 127) or, if shifted, Backspace (code 8) - which can be reversed with the appropriate DEC private mode escape sequence.

    deletekey: string
    The string to send when the delete key (not the keypad delete key) is pressed. If unset it will send the sequence traditionally associated with the Execute key.

    cutchars: string
    The characters used as delimiters for double-click word selection. The built-in default:
    BACKSLASH `"'&()*,;<=>?@[]{|}

    preeditType: style
    OverTheSpot, OffTheSpot, Root; option -pt.

    inputMethod: name
    name of inputMethod to use; option -im.

    modifier: modifier
    Set the key to be interpreted as the Meta key to: alt, meta, hyper, super, mod1, mod2, mod3, mod4, mod5; option -mod.

    answerbackString: string
    Specify the reply rxvt sends to the shell when an ENQ (control-E) character is passed through. It may contain escape values as described in the entry on keysym following.

    keysym.sym: string
    Associate string with keysym sym (0xFF00 - 0xFFFF). It may contain escape values (\a: bell, \b: backspace, \e, \E: escape, \n: newline, \r: return, \t: tab, \000: octal number) or control characters (^?: delete, ^@: null, ^A ...) and may enclosed with double quotes so that it can start or end with whitespace. The intervening resource name keysym. cannot be omitted. This resource is only available when compiled with KEYSYM_RESOURCE.

    THE SCROLLBAR

    Lines of text that scroll off the top of the rxvt window (resource: saveLines) and can be scrolled back using the scrollbar or by keystrokes. The normal rxvt scrollbar has arrows and its behaviour is fairly intuitive. The xterm-scrollbar is without arrows and its behaviour mimics that of xterm

    Scroll down with Button1 (xterm-scrollbar) or Shift-Next. Scroll up with Button3 (xterm-scrollbar) or Shift-Prior. Continuous scroll with Button2.

    MOUSE REPORTING

    To temporarily override mouse reporting, for either the scrollbar or the normal text selection/insertion, hold either the Shift or the Meta (Alt) key while performing the desired mouse action.

    If mouse reporting mode is active, the normal scrollbar actions are disabled -- on the assumption that we are using a fullscreen application. Instead, pressing Button1 and Button3 sends ESC[6~ (Next) and ESC[5~ (Prior), respectively. Similarly, clicking on the up and down arrows sends ESC[A (Up) and ESC[B (Down), respectively.

    TEXT SELECTION AND INSERTION

    The behaviour of text selection and insertion mechanism is similar to xterm(1).

    Selection:
    Left click at the beginning of the region, drag to the end of the region and release; Right click to extend the marked region; Left double-click to select a word; Left triple-click to select the entire line.

    Insertion:
    Pressing and releasing the Middle mouse button (or Shift-Insert) in an rxvt window causes the current text selection to be inserted as if it had been typed on the keyboard.

    CHANGING FONTS

    You can change fonts on-the-fly, which is to say cycle through the default font and others of various sizes, by using Shift-KP_Add and Shift-KP_Subtract. Or, alternatively (if enabled) with Alt-> and Alt-<, where the actual key can be selected using resources smallfont_key/bigfont_key.

    LOGIN STAMP

    rxvt tries to write an entry into the utmp(5) file so that it can be seen via the who(1) command, and can accept messages. To allow this feature, rxvt must be installed setuid root on some systems.

    COLORS AND GRAPHICS

    If graphics support was enabled at compile-time, rxvt can be queried with ANSI escape sequences and can address individual pixels instead of text characters. Note the graphics support is still considered beta code.

    In addition to the default foreground and background colours, rxvt can display up to 16 colours (8 ANSI colours plus high-intensity bold/blink versions of the same). Here is a list of the colours with their rgb.txt names.

    color0 (black) = Black
    color1 (red) = Red3
    color2 (green) = Green3
    color3 (yellow) = Yellow3
    color4 (blue) = Blue3
    color5 (magenta) = Magenta3
    color6 (cyan) = Cyan3
    color7 (white) = AntiqueWhite
    color8 (bright black) = Grey25
    color9 (bright red) = Red
    color10 (bright green) = Green
    color11 (bright yellow) = Yellow
    color12 (bright blue) = Blue
    color13 (bright magenta) = Magenta
    color14 (bright cyan) = Cyan
    color15 (bright white) = White
    foreground = Black
    background = White

    It is also possible to specify the colour values of foreground, background, cursorColor, cursorColor2, colorBD, colorUL as a number 0-15, as a convenient shorthand to reference the colour name of color0-color15.

    Note that -rv ("reverseVideo: True") simulates reverse video by always swapping the foreground/background colours. This is in contrast to xterm(1) where the colours are only swapped if they have not otherwise been specified. For example,

    rxvt -fg Black -bg White -rv
    would yield White on Black, while on xterm(1) it would yield Black on White.

    ENVIRONMENT

    rxvt sets the environment variables TERM, COLORTERM and COLORFGBG. The environment variable WINDOWID is set to the X window id number of the rxvt window and it also uses and sets the environment variable DISPLAY to specify which display terminal to use. rxvt uses the environment variables RXVTPATH and PATH to find XPM files.

    FILES

    /etc/utmp
    System file for login records.

    /usr/lib/X11/rgb.txt
    Color names.

    SEE ALSO

    xterm(1), sh(1), resize(1), X(1), pty(4), tty(4), utmp(5)

    See rxvtRef.html rxvtRef.txt for detailed information on recognized escape sequences and menuBar syntax, etc.

    BUGS

    Check the BUGS file for an up-to-date list.

    Cursor change support is not yet implemented.

    Click-and-drag doesn't work with X11 mouse report overriding.

    Graphics support is fairly crude.

    FTP LOCATION

    rxvt-2.7.10.tar.gz can be found at the following ftp sites ftp://ftp.rxvt.org/pub/rxvt

    CURRENT PROJECT COORDINATOR

    Project Coordinator
    Geoff Wing <gcw@rxvt.org>

    Web page maintainter
    Oezguer Kesim <oec@rxvt.org>
    <http://www.rxvt.org/>

    Mailing list
    The Rxvt Workers <rxvt-workers@rxvt.org> mailing list has also been established for rxvt development, to subscribe, email to <rxvt-workers-subscribe@rxvt.org>. There is also a mailing list for announcements of new releases of rxvt. To subscribe, email to <rxvt-announce-subscribe@rxvt.org>.

    AUTHORS

    John Bovey
    University of Kent, 1992, wrote the original Xvt.

    Rob Nation <nation@rocket.sanders.lockheed.com>
    very heavily modified Xvt and came up with Rxvt

    Angelo Haritsis <ah@doc.ic.ac.uk>
    wrote the Greek Keyboard Input

    mj olesen <olesen@me.QueensU.CA>
    Wrote the menu system.
    Project Coordinator (changes.txt 2.11 to 2.21)

    Oezguer Kesim <kesim@math.fu-berlin.de>
    Project Coordinator (changes.txt 2.21a to 2.4.5)

    Geoff Wing <gcw@pobox.com>
    Rewrote screen display and text selection routines.
    Project Coordinator (changes.txt 2.4.6 - )
    rxvt-2.7.10/rclock004075500001440000024000000000000764024425100124445ustar gcwstaffrxvt-2.7.10/rclock/rclock.1.in010064400001440000024000000125430745444116200144740ustar gcwstaff.\" @(#)rclock.1 -*- nroff -*- .TH RCLOCK 1 @RXVT_DATE@ "X Version 11" "X Tools" .UC .SH NAME rclock (ouR CLOCK) \(em clock and appointment reminder for X11 .SH SYNOPSIS .B rclock .RI [ options ] .SH DESCRIPTION .B rclock \(em version .B @RXVT_VERSION@ \(em is an analog clock for X intended as an .IR xclock (1) replacement that conserves memory and has extra features: .B rclock enters reverse video if there is mail waiting; an appointment reminder is also builtin. .SH OPTIONS The options supported by .BR rclock : .TP .BI -display " displayname" Attempt to open a window on the named X display. In the absence of this option, the display specified by the DISPLAY environment variable is used. .TP .BI -geometry " geom" Create the window with the specified X window geometry [default 80x80]. .TP .BI -bg " color" Window background color [default white]. .TP .BI -fg " color" Window foreground color [default black]. .TP .BI -fn " fontname" Select font used for reminders [default 7x14]. .TP .BI -nodate Do not display today's date on the face of the clock. .TP .B -iconic Start iconified, if supported by the window manager. .TP .BI -adjust " ddhhmm" Adjust the clock by +/\- .I ddhhmm .RI ( dd = days, .I hh = hours, .I mm = minutes) to fix an incorrect clock without being root or for working in another time-zone. .TP .BI -update " n" Update clock face every .I n seconds [default 30]. If .IR n "=1," a seconds hand is displayed. .TP .BI -mail " n" Check for new mail every .I n seconds [default 60]. The actual interval is a multiple of the clock update interval. .TP .BI -mailfile " mailfile" Override environmental variable MAIL with .I mailfile as location for mail. .TP .BI -mailspawn " cmd" Execute .I cmd when the face of the clock is clicked by the mouse button. .TP .BI "#" geom Specify the preferred icon window size [default 65x65]. .PP Some of these options may not be available based on how rclock was compiled. Run .B rclock -help to determine which features are available. .SH "X RESOURCES" No X resources are used \(em only command-line options. .SH "TITLES AND ICONS" The window and icon titles are set to the day of the week and the date. The date is also displayed on the lower half of the clock unless the .B -nodate option is specified. The icon window is "active" and will show the time, if supported by the window manager. .SH "REMINDERS" The .B "~/.rclock" file lists the messages to display and/or the programs to run at specified times and dates. At the specified time, .B rclock will pop-up a window in the center of the screen to display the message or will simply run the scheduled program. .B rclock will reads the .B "~/.rclock" file at startup, and every 10 minutes (to look for changes) and after a message window has been dismissed (to find the next appointment). An entry in .B "~/.rclock" may be one of two formats (blank and comment lines will be ignored): .sp .nf .B hh:mm [dd] MM/DD/YY message[; program] or .B [hh:mm [dd] MM/DD/YY [message]]; program .sp .BR hh " \- hour (0-23; * = current)" .BR mm " \- minute (0-59; * = 0)" .BR dd " \- days-of-week (some/all/none of umtwrfs; * = all)" .BR MM " \- month (1-12; * = current)" .BR DD " \- day of month (1-31; * = current)" .BR YY " \- year (0-99 or 1900-????; * = current)" .BR message " \- message to display" .BR program " \- program to execute" .fi .sp The days-of-the-week use the following abbreviations: .BR u =Sunday, .BR m =Monday, .BR t =Tuesday, .BR w =Wednesday, .BR r =Thursday, .BR f =Friday, .BR s =Saturday, .BR * =all. .sp If .B message is empty and .B program has been specified, it is executed without a dialog box. If time/date are also not specified, .B program is executed on start-up. Note .B message may contain escape values (\\n: newline, \\;: semicolon). Here's a silly example file that shows some of the permissible constructs: .nf .sp # ~/.rclock - My appointment file # startup functions ; xsetroot -solid Black & # cron functions 10:00; xsetroot -solid Grey25 & 14:00; xsetroot -solid Grey75 & # daily/weekly reminders 08:15 mtwrf * Good Morning!\\nRead News?; rxvt -e News 12:00 mtwrf * Lunch Time! 17:00 mtwrf * Go Home 23:00 mtwrf * Still Here? Go to bed 08:10 twrf * Did you do your time card yesterday? 15:00 f * Friday, do your time card early! 16:00 mtwr * Do your time card 16:30 mtwrf * Did you do your time card? *:00 us * It's the weekend, why are you here? 8:15 f */13/* Friday the 13th! Careful! 8:15 * 4/1/* fkrkrmfismsmkd...dkdfk 8:16 * 4/1/* April Fools! # birthdays/anniversaries 16:00 05/21/* Pam's Birthday (next week) 16:00 05/24/* Pam's Birthday (in a few days) # once-of appointments 08:30 03/15/94 Dentist appointment 08:30 03/15/1999 Dentist appointment 08:30 03/15/2004 Dentist appointment .sp .fi .SH ENVIRONMENT .B rclock uses the environment variable .B MAIL to determine the location of the user's mail spool file unless the .B -mailfile option is specified. .SH BUGS .B rclock is not very smart about dealing with errors encountered while reading the .B "~/.rclock" file. Each reminder must be a single line not exceeding 255 characters. Reminder windows are sometimes not redrawn (left blank) when raised or uncovered. .SH AUTHOR Rob Nation .LP Modifications by mj olesen .SH "CURRENT MAINTAINER" Same as the current rxvt maintainer. rxvt-2.7.10/rclock/Makefile.in010064400001440000024000000037020710374476600146010ustar gcwstaff# rclock/Makefile.in -*- Makefile -*- @MCOMMON@ srcdir = @srcdir@ VPATH = @srcdir@ .PATH: @srcdir@ basedir = .. thisdir = rclock first_rule: clock dummy: SRCS = rclock.c OBJS = rclock.o HDRS = feature.h # # Distribution variables # DIST = $(HDRS) $(SRCS) Makefile.in rclock.1.in # inference rules .c.o: $(CC) -c $(CPPFLAGS) $(XINC) -I. -I$(basedir) -I$(srcdir) $(DEFS) $(CFLAGS) $< #------------------------------------------------------------------------- all: clock: alldoc allbin rclock: $(OBJS) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(XLIB) rclock.1: $(srcdir)/rclock.1.in cat $(srcdir)/rclock.1.in\ |sed -e 's%@RXVT_VERSION@%$(VERSION)%g;'\ |sed -e 's%@RXVT_DATE@%$(DATE)%g;'\ |sed -e 's%@RXVT_MAINT@%$(MAINT)%g;'\ > $@ rclock.html: rclock.1 rman -f HTML -S -r off rclock.1\ |sed -e 's%<\;file:]*\(.*\)>\;%\1%g;'\ |sed -e 's%<\;\([fht]*tp://\)\([^/]*\)\(.*\)>\;%\2%g;'\ |sed -e 's%<\;\([^ /]*\)>\;%\1%g;'\ > $@ tags: $(SRCS) ctags $(SRCS) allbin: rclock alldoc: rclock.1 clean: $(RMF) rclock rclock.1 core a.out *.o *.bak *~ realclean: clean $(RMF) tags cleandir: realclean distclean: (cd $(srcdir); $(RMF) rclock rclock.1 *~ *.o core a.out) if test $(srcdir) = .; then $(MAKE) realclean; fi (cd $(srcdir); $(RMF) Makefile) install: allbin alldoc $(INSTALL_PROGRAM) rclock $(DESTDIR)$(bindir)/$(binprefix)rclock $(INSTALL_DATA) rclock.1 $(DESTDIR)$(mandir)/$(manprefix)rclock.$(manext) uninstall: cd $(bindir); $(RMF) $(binprefix)rclock cd $(mandir); $(RMF) $(manprefix)rclock.$(manext) distdirs: mkdir $(basedir)/../$(VERNAME)/$(thisdir) distcopy: rclock.1 $(CP) -p $(DIST) $(basedir)/../$(VERNAME)/$(thisdir) if test -f rclock.html; then \ $(CP) -p rclock.html $(basedir)/../$(VERNAME)/$(thisdir); \ fi # ----------------------------------------------------------------------- # DO NOT DELETE: ugly dependency list follows rclock.o: rclock.c feature.h rxvt-2.7.10/rclock/rclock.c010064400001440000024000001066550752433601600141600ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * Copyright 1997 1998 Oezguer Kesim * Copyright 1992, 1993 Robert Nation * * 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 of the License, 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. *----------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #else /* # define STDC_HEADERS */ # define HAVE_UNISTD_H # define TIME_WITH_SYS_TIME # define HAVE_SYS_TIME_H # ifdef _AIX # define HAVE_SYS_SELECT_H # endif #endif #include "../src/version.h" #include "feature.h" #include /* #ifdef STDC_HEADERS */ # include # include # include # include /* #endif */ #ifdef HAVE_UNISTD_H # include #endif #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #if defined (__svr4__) # include /* for struct rlimit */ #endif #ifdef HAVE_SYS_SELECT_H # include #endif #include #ifdef MAIL #include #endif #include /* Xlib, Xutil, Xresource, Xfuncproto */ #define APL_CLASS "Clock" #define APL_NAME "rclock" #define MSG_CLASS "Appointment" #define MSG_NAME "Appointment" #define CONFIG_FILE ".rclock" #ifndef EXIT_SUCCESS /* missed from ? */ # define EXIT_SUCCESS 0 # define EXIT_FAILURE 1 #endif /*----------------------------------------------------------------------*/ static Display* Xdisplay; /* X display */ static int Xfd; /* file descriptor of server connection */ static GC Xgc, Xrvgc; /* normal, reverse video GC */ #define Xscreen DefaultScreen (Xdisplay) #define Xcmap DefaultColormap (Xdisplay, Xscreen) #define Xroot DefaultRootWindow (Xdisplay) /* windows and their sizes */ typedef struct { Window win; int width, height; } mywindow_t; static mywindow_t Clock = {None, 80, 80}; /* parent window */ #define fgColor 0 #define bgColor 1 static const char * rs_color [2] = { FG_COLOR_NAME, BG_COLOR_NAME }; static Pixel PixColors [2]; static const char * rs_geometry = NULL; #ifdef ICONWIN static const char * rs_iconGeometry = NULL; static mywindow_t Icon = {None, 65, 65}; /* icon window */ static int iconic_state = NormalState; /* iconic startup? */ #endif #ifdef REMINDERS static mywindow_t Msg = {0, 0, 0}; /* message window */ static struct { Window # ifndef NO_REMINDER_EXEC Start, # endif Dismiss, Defer; int width, height; } msgButton; static XFontStruct * Xfont; #define FontHeight() (Xfont->ascent + Xfont->descent) static int Msg_Mapped = 0; /* message window mapped? */ static int reminderTime = -1; static char message [256] = ""; #ifndef NO_REMINDER_EXEC static char execPrgm [256] = ""; #endif static const char * reminders_file = NULL; /* name of ~/.rclock file */ #ifdef DATE_ON_CLOCK_FACE static int show_date = 1; /* show date on face of clock */ #endif #endif #ifdef ADJUST_TIME static int adjustTime = 0; #else # define adjustTime 0 #endif #ifdef CENTURY # if (CENTURY < 1900) Error, Cenury incorrectly set. # endif #else # define CENTURY 1900 #endif static int clockUpdate = CLOCKUPDATE; #ifdef MAIL static int mailUpdate = MAILUPDATE; static char * mail_file = NULL; #ifndef MAIL_SPAWN static char * mail_spawn = NULL; #endif static int is_maildir = 0; #endif static XSizeHints szHint = { PMinSize | PResizeInc | PBaseSize | PWinGravity, 0, 0, 80, 80, /* x, y, width and height */ 1, 1, /* Min width and height */ 0, 0, /* Max width and height */ 1, 1, /* Width and height increments */ {1, 1}, /* x, y increments */ {1, 1}, /* Aspect ratio - not used */ 0, 0, /* base size */ NorthWestGravity /* gravity */ }; /* subroutine declarations */ static void geometry2sizehint (mywindow_t * /* win */, const char * /* geom */); static void Create_Windows (int /* argc */, char * /* argv */ []); static void getXevent (void); static void print_error (const char * /* fmt */, ...); static void Draw_Window (mywindow_t * /* this_win */, int /* full_redraw */); static void Reminder (void); static void Next_Reminder (int /* update_only */); /* Arguments for Next_Reminder() */ #define REPLACE 0 #define UPDATE 1 /*----------------------------------------------------------------------*/ static void usage (void) { int i; struct { const char * const opt; const char * const desc; } optList[] = { #define optList_size() (sizeof(optList)/sizeof(optList[0])) { "-display displayname", "X server to contact" }, { "-geometry geom", "size (in pixels) and position" }, { "-bg color", "background color" }, { "-fg color", "foreground color" }, #ifdef REMINDERS { "-fn fontname", "normal font for messages" }, #ifdef DATE_ON_CLOCK_FACE { "-nodate", "do not display date on the clock face" }, #endif #endif #ifdef ICONWIN { "-iconic", "start iconic" }, #endif #ifdef ADJUST_TIME { "-adjust +/-ddhhmm", "adjust clock time" }, #endif { "-update seconds", "clock update interval" }, #ifdef MAIL { "-mail seconds", "check $MAIL interval" }, { "-mailfile file", "file to use for mail checking" }, #ifndef MAIL_SPAWN { "-mailspawn cmd", "execute `cmd` when clock is clicked" }, #endif #endif { "#geom", "icon window geometry" } }; fprintf (stderr, "\nUsage v" VERSION ":\n " APL_NAME " [options]\n\n" "where options include:\n"); for (i = 0; i < optList_size(); i++) fprintf (stderr, " %-29s%s\n", optList[i].opt, optList[i].desc); } /**************** * Check out if we are using a maildir drop (qmail) * Note: this changes mail_dir to hold the "new" diretory */ #ifdef MAIL static void CheckMaildir() { struct stat st; char *buf, *p; if( !*mail_file || stat(mail_file, &st) || !S_ISDIR(st.st_mode) ) return; /* no */ if( !(buf = malloc(strlen(mail_file)+5)) ) { print_error ("malloc error"); exit( EXIT_FAILURE ); } strcpy(buf,mail_file); p = buf+strlen(buf); if( p[-1] != '/' ) *p++ = '/'; strcpy(p, "tmp" ); if( stat(buf, &st) || !S_ISDIR(st.st_mode ) ) goto leave; strcpy(p, "cur" ); if( stat(buf, &st) || !S_ISDIR(st.st_mode ) ) goto leave; strcpy(p, "new" ); if( stat(buf, &st) || !S_ISDIR(st.st_mode ) ) goto leave; mail_file = buf; is_maildir = 1; return; leave: free(buf); } #endif /*----------------------------------------------------------------------* * rclock - Rob's clock * simple X windows clock with appointment reminder *----------------------------------------------------------------------*/ int main (int argc, char * argv []) { int i; char * opt, * val; const char * display_name = NULL; XGCValues gcv; #ifdef REMINDERS const char * rs_font = FONT_NAME; /* find the ~/.rclock file */ if ((val = getenv ("HOME")) != NULL) { char * p = malloc (strlen (CONFIG_FILE) + strlen (val) + 2); if (p == NULL) goto Malloc_Error; strcpy (p, val); strcat (p, "/" CONFIG_FILE); reminders_file = p; } #endif #ifdef MAIL val = getenv ("MAIL"); /* get the mail spool file name */ #ifdef MAIL_SPOOL if (val == NULL) /* csh doesn't set $MAIL */ { const char * spool = MAIL_SPOOL; char * user = getenv ("USER"); /* assume this works */ val = malloc (strlen (spool) + strlen (user) + 1); if (val == NULL) goto Malloc_Error; strcpy (val, spool); strcat (val, user); } #endif mail_file = val; if( mail_file ) CheckMaildir(); #endif if ((display_name = getenv ("DISPLAY")) == NULL) display_name = ":0"; /* parse the command line */ for (i = 1; i < argc; i += 2) { opt = argv [i]; val = argv [i+1]; switch (*opt++) { case '-': break; case '#': #ifdef ICONWIN rs_iconGeometry = opt; /* drop */ #endif default: continue; break; } if (*opt == 'd' && val) display_name = val; /* "d", "display" */ else if (*opt == 'g' && val) rs_geometry = val; /* "g", "geometry" */ #ifdef ICONWIN else if (*opt == 'i') /* "ic", "iconic" */ { iconic_state = IconicState; i--; /* no argument */ } #endif else if (!strcmp (opt, "fg") && val) rs_color [fgColor] = val; else if (!strcmp (opt, "bg") && val) rs_color [bgColor] = val; #ifdef REMINDERS else if (!strcmp (opt, "fn") && val) rs_font = val; #ifdef DATE_ON_CLOCK_FACE else if (!strcmp (opt, "nodate")) { show_date = 0; i--; /* no argument */ } #endif #endif else if (!strcmp (opt, "update") && val) { int x = atoi (val); if (x < 1 || x > 60) print_error ("update: %d sec", clockUpdate); else clockUpdate = x; } #ifdef MAIL else if (!strcmp (opt, "mail") && val) { int x = atoi (val); if (x < 1) print_error ("mail update: %d sec", mailUpdate); else mailUpdate = x; } else if (!strcmp (opt, "mailfile") && val) { /* If the mail environment is not set, then mail_file was created * with a malloc. We need to free it. */ if( getenv ("MAIL") == NULL) free( mail_file); /* assume user knows what he's doing, don't check that file is valid...*/ mail_file = val; } #ifndef MAIL_SPAWN else if (!strcmp (opt, "mailspawn") && val) { mail_spawn = val; } #endif #endif /* MAIL */ #ifdef ADJUST_TIME else if (!strcmp (opt, "adjust") && val) { /* convert ddhhmm to seconds, minimal error checking */ int x = atoi (val); adjustTime = ((((abs (x) / 10000) % 100) * 24 /* days */ + ((abs (x) / 100) % 100)) * 60 /* hours */ + (abs (x) % 100)) * 60; /* minutes */ if (x < 0) adjustTime = -adjustTime; } #endif /* ADJUST_TIME */ else { usage (); goto Abort; } } /* open display */ Xdisplay = XOpenDisplay (display_name); if (!Xdisplay) { print_error ("can't open display %s", display_name); goto Abort; } /* get display info */ Xfd = XConnectionNumber (Xdisplay); { const char * const color_msg = "can't load color \"%s\""; XColor xcol; /* allocate foreground/background colors */ if (!XParseColor (Xdisplay, Xcmap, rs_color [fgColor], &xcol) || !XAllocColor (Xdisplay, Xcmap, &xcol)) { print_error (color_msg, rs_color [fgColor]); goto Abort; } PixColors [fgColor] = xcol.pixel; if (!XParseColor (Xdisplay, Xcmap, rs_color [bgColor], &xcol) || !XAllocColor (Xdisplay, Xcmap, &xcol)) { print_error (color_msg, rs_color [bgColor]); goto Abort; } PixColors [bgColor] = xcol.pixel; } #ifdef REMINDERS /* load the font for messages */ if ((Xfont = XLoadQueryFont (Xdisplay, rs_font)) == NULL) { print_error ("can't load font \"%s\"", rs_font); goto Abort; } gcv.font = Xfont->fid; #endif Create_Windows (argc, argv); /* Create the graphics contexts */ gcv.foreground = PixColors [fgColor]; gcv.background = PixColors [bgColor]; Xgc = XCreateGC (Xdisplay, Clock.win, #ifdef REMINDERS GCFont | #endif GCForeground | GCBackground, &gcv); gcv.foreground = PixColors [bgColor]; gcv.background = PixColors [fgColor]; Xrvgc = XCreateGC (Xdisplay, Clock.win, #ifdef REMINDERS GCFont | #endif GCForeground | GCBackground, &gcv); getXevent (); return EXIT_SUCCESS; Malloc_Error: print_error ("malloc error"); Abort: print_error ("aborting"); return EXIT_FAILURE; } /* * translate geometry string to appropriate sizehint */ static void geometry2sizehint (mywindow_t * win, const char * geom) { int x, y, flags; unsigned int width, height; /* copy in values */ szHint.width = win->width; szHint.height = win->height; if (geom == NULL) return; flags = XParseGeometry (geom, &x, &y, &width, &height); if (flags & WidthValue) { szHint.width = width + szHint.base_width; szHint.flags |= USSize; } if (flags & HeightValue) { szHint.height = height + szHint.base_height; szHint.flags |= USSize; } if (flags & XValue) { if (flags & XNegative) { x += (DisplayWidth (Xdisplay, Xscreen) - szHint.width); szHint.win_gravity = NorthEastGravity; } szHint.x = x; szHint.flags |= USPosition; } if (flags & YValue) { if (flags & YNegative) { y += (DisplayHeight (Xdisplay, Xscreen) - szHint.height); szHint.win_gravity = (szHint.win_gravity == NorthEastGravity ? SouthEastGravity : SouthWestGravity); } szHint.y = y; szHint.flags |= USPosition; } /* copy out values */ win->width = szHint.width; win->height = szHint.height; } /* * Open and map the windows */ static void Create_Windows (int argc, char * argv []) { XClassHint classHint; XWMHints wmHint; geometry2sizehint (&Clock, rs_geometry); Clock.win = XCreateSimpleWindow (Xdisplay, Xroot, szHint.x, szHint.y, Clock.width, Clock.height, 0, PixColors [fgColor], PixColors [bgColor]); #ifdef ICONWIN geometry2sizehint (&Icon, rs_iconGeometry); Icon.win = XCreateSimpleWindow (Xdisplay, Xroot, szHint.x, szHint.y, Icon.width, Icon.height, 0, PixColors [fgColor], PixColors [bgColor]); wmHint.initial_state = iconic_state; wmHint.icon_window = Icon.win; wmHint.flags = InputHint | StateHint | IconWindowHint; #else wmHint.flags = InputHint; #endif wmHint.input = True; /* ignore warning about discarded `const' */ classHint.res_name = APL_NAME; classHint.res_class = APL_CLASS; XSetWMProperties (Xdisplay, Clock.win, NULL, NULL, argv, argc, &szHint, &wmHint, &classHint); XSelectInput (Xdisplay, Clock.win, (ExposureMask|StructureNotifyMask|ButtonPressMask)); #ifdef ICONWIN XSelectInput (Xdisplay, Icon.win, (ExposureMask|ButtonPressMask)); #endif XMapWindow (Xdisplay, Clock.win); /* create, but don't map a window for appointment reminders */ #ifdef REMINDERS Msg.win = XCreateSimpleWindow (Xdisplay, Xroot, szHint.x, szHint.y, szHint.width, szHint.height, 0, PixColors [fgColor], PixColors [bgColor]); szHint.flags |= USPosition; /* ignore warning about discarded `const' */ classHint.res_name = MSG_NAME; classHint.res_class = MSG_CLASS; wmHint.input = True; wmHint.flags = InputHint; XSetWMProperties (Xdisplay, Msg.win, NULL, NULL, argv, argc, &szHint, &wmHint, &classHint); { char * str = MSG_NAME; XStoreName (Xdisplay, Msg.win, str); XSetIconName (Xdisplay, Msg.win, str); } XSelectInput (Xdisplay, Msg.win, (ExposureMask|ButtonPressMask|KeyPressMask)); /* font already loaded */ msgButton.width = 4 + 5 * XTextWidth (Xfont, "M", 1); msgButton.height = 4 + FontHeight (); msgButton.Dismiss = XCreateSimpleWindow (Xdisplay, Msg.win, 0, 0, msgButton.width, msgButton.height, 0, PixColors [bgColor], PixColors [fgColor]); XMapWindow (Xdisplay, msgButton.Dismiss); msgButton.Defer = XCreateSimpleWindow (Xdisplay, Msg.win, 0, 0, msgButton.width, msgButton.height, 0, PixColors [bgColor], PixColors [fgColor]); XMapWindow (Xdisplay, msgButton.Defer); #ifndef NO_REMINDER_EXEC msgButton.Start = XCreateSimpleWindow (Xdisplay, Msg.win, 0, 0, msgButton.width, msgButton.height, 0, PixColors [bgColor], PixColors [fgColor]); XMapWindow (Xdisplay, msgButton.Start); #endif /* NO_REMINDER_EXEC */ #endif } static time_t mk_time (struct tm * tmval) { return (tmval->tm_min + 60 * (tmval->tm_hour + 24 * (tmval->tm_mday + 31 * ((tmval->tm_mon+1) + 12 * tmval->tm_year)))); } #ifdef MAIL static int MailAvailable() { struct stat st; if( is_maildir ) { DIR *dirp; struct dirent *d; if( (dirp=opendir( mail_file )) ) { while( (d=readdir(dirp)) ) { if( *d->d_name == '.' ) continue; if( isdigit(*d->d_name) ) { closedir(dirp); return 1; } } closedir(dirp); } return 0; } else return !stat(mail_file, &st) && (st.st_size > 0) && (st.st_mtime >= st.st_atime); } #endif /*----------------------------------------------------------------------* * Redraw the whole window after an exposure or size change. * After a timeout, only redraw the hands. * Provide reminder if needed. *----------------------------------------------------------------------*/ static void Draw_Window (mywindow_t * W, int full_redraw) { /* pre-computed values for sin() x1000, to avoid using floats */ static const short Sin [60] = { 0, 105, 208, 309, 407, 500, 588, 669, 743, 809, 866, 914, 951, 978, 995, 1000, 995, 978, 951, 914, 866, 809, 743, 669, 588, 500, 407, 309, 208, 105, 0, -105, -208, -309, -407, -500, -588, -669, -743, -809, -866, -914, -951, -978, -995, -1000, -995, -978, -951, -914, -866, -809, -743, -669, -588, -500, -407, -309, -208, -105 }; static int savedDay = -1; time_t currentTime; struct tm * tmval; int ctr_x, ctr_y; typedef struct { int h_x, h_y; /* hour */ int m_x, m_y; /* minute */ int s_x, s_y; /* second */ } hands_t; /* hand positions (x,y) */ hands_t HandsNow, * pHandsOld; GC X_gc, X_rvgc; static hands_t HandsOld = { -1 }; #ifdef ICONWIN static hands_t HandsOld_icon = { -1 }; #endif #ifdef REMINDERS static int lastUpdateTime = -10; #endif #ifdef MAIL static time_t mailTime = 0; static int MailUp = 0, MailUp_rvideo = 0; #ifdef ICONWIN static int MailUp_icon = 0; #endif #endif /* MAIL */ currentTime = time (NULL) + adjustTime; /* get the current time */ tmval = localtime (¤tTime); #ifdef MAIL #ifdef REMINDERS if (W->win != Msg.win) #endif { int * pMailUp = ( #ifdef ICONWIN W->win == Icon.win ? &MailUp_icon : #endif &MailUp); if ((currentTime - mailTime) >= mailUpdate) { struct stat st; if ( #ifdef ICONWIN MailUp != MailUp_icon ? MailUp : #endif ((mail_file != NULL) && MailAvailable() ) ) { if (!*pMailUp) { *pMailUp = 1; full_redraw = 1; XSetWindowBackground (Xdisplay, W->win, PixColors [fgColor]); #ifdef MAIL_BELL XBell (Xdisplay, 0); #endif } } else { if (*pMailUp) { *pMailUp = 0; full_redraw = 1; XSetWindowBackground (Xdisplay, W->win, PixColors [bgColor]); } } #ifdef ICONWIN if (MailUp == MailUp_icon) #endif mailTime = currentTime; MailUp_rvideo = *pMailUp; } } #endif /* MAIL */ /* once every day, update the window and icon name */ if (tmval->tm_yday != savedDay) { char str [20]; savedDay = tmval->tm_yday; strftime (str, sizeof(str), "%a %h %d", tmval); XStoreName (Xdisplay, Clock.win, str); XSetIconName (Xdisplay, Clock.win, str); } if (full_redraw) XClearWindow (Xdisplay, W->win); #ifdef REMINDERS /* for a message window, just re-draw the message */ if (W->win == Msg.win) { char * beg, * next; int lines; for (beg = message, lines = 0; beg; beg = next, lines++) { char * end; if ((end = strstr (beg, "\\n")) == NULL) { end = beg + strlen (beg); next = NULL; } else { next = end + 2; } XDrawString (Xdisplay, Msg.win, Xgc, (Msg.width - XTextWidth (Xfont, beg, (end-beg))) / 2, 10 + Xfont->ascent + FontHeight () * lines, beg, (end-beg)); } XDrawString (Xdisplay, msgButton.Dismiss, Xrvgc, (msgButton.width - XTextWidth (Xfont, "Done", 4)) / 2, Xfont->ascent + 2, "Done", 4); XDrawString (Xdisplay, msgButton.Defer, Xrvgc, (msgButton.width - XTextWidth (Xfont, "Defer", 5)) / 2, Xfont->ascent + 2, "Defer", 5); # ifndef NO_REMINDER_EXEC XDrawString (Xdisplay, msgButton.Start, Xrvgc, (msgButton.width - XTextWidth (Xfont, "Start", 5)) / 2, Xfont->ascent + 2, "Start", 5); if (strlen (execPrgm) > 1) XMapWindow (Xdisplay, msgButton.Start); else XUnmapWindow (Xdisplay, msgButton.Start); # endif /* NO_REMINDER_EXEC */ return; } /* * Convert multi-field time info to a single integer with a resolution * in minutes. */ currentTime = mk_time (tmval); /* is there a reminder pending? */ if (reminderTime >= 0 && currentTime >= reminderTime) Reminder (); /* every 10 minutes, or at start of day, check for revised entries */ if (!Msg_Mapped && (currentTime > lastUpdateTime + REMINDERS_TIME || (currentTime != lastUpdateTime && tmval->tm_hour == 0 && tmval->tm_min == 0))) { Next_Reminder (UPDATE); lastUpdateTime = currentTime; } #endif /* * draw clock */ ctr_x = (W->width / 2); ctr_y = (W->height / 2); #define XPOS(i,val) (ctr_x + (W->width * Sin[i%60] * (val) + 100000) / 200000) #define YPOS(i,val) (ctr_y - (W->height * Sin[(i+15)%60] * (val) + 100000) / 200000) /* * how to draw the clock face */ /* calculate the positions of the hands */ { int angle = (tmval->tm_hour % 12) * 5 + (tmval->tm_min / 12); HandsNow.h_x = XPOS (angle, 60); HandsNow.h_y = YPOS (angle, 60); } { int angle = tmval->tm_min; HandsNow.m_x = XPOS (angle, 80); HandsNow.m_y = YPOS (angle, 80); } if (clockUpdate == 1) { int angle = tmval->tm_sec; HandsNow.s_x = XPOS (angle, 85); HandsNow.s_y = YPOS (angle, 85); } pHandsOld = ( #ifdef ICONWIN W->win == Icon.win ? &HandsOld_icon : #endif &HandsOld); #ifdef MAIL if (MailUp_rvideo) { X_gc = Xrvgc; X_rvgc = Xgc; } else #endif { X_gc = Xgc; X_rvgc = Xrvgc; } /* * Draw the date in the lower half of the clock window. * The code is enclosed in REMINDERS because it uses the same * font as the reminders code. * I believe this should be drawn always so it does not get * "swept away" by the minute hand. */ #ifdef REMINDERS && DATE_ON_CLOCK_FACE if( show_date) { char date[10]; currentTime = time (NULL) + adjustTime; /* get the current time */ tmval = localtime (¤tTime); strftime (date, sizeof(date), "%d", tmval); XDrawString (Xdisplay, W->win, X_gc, ctr_x - XTextWidth(Xfont, date, strlen(date))/2, ctr_y + FontHeight() + (ctr_y - FontHeight())/2, date, strlen(date)); } #endif if (full_redraw) { int angle; /* * draw clock face */ #ifdef SUBTICKS for (angle = 0; angle < 60; angle++) XDrawPoint (Xdisplay, W->win, X_gc, XPOS (angle, 95), YPOS (angle, 95)); #endif for (angle = 0; angle < 60; angle += 5) XDrawLine (Xdisplay, W->win, X_gc, XPOS (angle, 90), YPOS (angle, 90), XPOS (angle, 100), YPOS (angle, 100)); } else if (memcmp (pHandsOld, &HandsNow, sizeof(hands_t))) { int i, j; /* * erase old hands */ for (i = -1; i < 2; i++) for (j = -1; j < 2; j++) { /* hour/minute hands */ XDrawLine (Xdisplay, W->win, X_rvgc, ctr_x + i, ctr_y + j, pHandsOld->h_x, pHandsOld->h_y); XDrawLine (Xdisplay, W->win, X_rvgc, ctr_x + i, ctr_y + j, pHandsOld->m_x, pHandsOld->m_y); } if (clockUpdate == 1) /* seconds hand */ XDrawLine (Xdisplay, W->win, X_rvgc, ctr_x, ctr_y, pHandsOld->s_x, pHandsOld->s_y); } if (full_redraw || memcmp (pHandsOld, &HandsNow, sizeof(hands_t))) { int i, j; /* * draw new hands */ for (i = -1; i < 2; i++) for (j = -1; j < 2; j++) { /* hour/minute hands */ XDrawLine (Xdisplay, W->win, X_gc, ctr_x + i, ctr_y + j, HandsNow.h_x, HandsNow.h_y); XDrawLine (Xdisplay, W->win, X_gc, ctr_x + i, ctr_y + j, HandsNow.m_x, HandsNow.m_y); } if (clockUpdate == 1) /* seconds hand */ XDrawLine (Xdisplay, W->win, X_gc, ctr_x, ctr_y, HandsNow.s_x, HandsNow.s_y); *pHandsOld = HandsNow; } } #ifdef REMINDERS /* * Read a single integer from *pstr, returns default value if it finds "*" * DELIM = trailing delimiter to skip */ static int GetOneNum (char ** pstr, int def) { int num, hit = 0; for (num = 0; isdigit (**pstr); (*pstr)++) { num = num * 10 + (**pstr - '0'); hit = 1; } if (!hit) { num = def; while (**pstr == '*') (*pstr)++; } return num; } /* * find if TODAY is found in PSTR */ static int isToday (char ** pstr, int wday) { const char * dayNames = DAY_NAMES; int rval, today; today = dayNames [wday]; /* no day specified is same as wildcard */ if (!strchr (dayNames, tolower (**pstr))) return 1; for (rval = 0; strchr (dayNames, tolower (**pstr)); (*pstr)++) { if (today == tolower (**pstr) || **pstr == '*') rval = 1; /* found it */ } return rval; } static char * trim_string (char * str) { if (str && *str) { int n; while (*str && isspace (*str)) str++; n = strlen (str) - 1; while (n > 0 && isspace (str [n])) n--; str [n+1] = '\0'; } return str; } # ifndef NO_REMINDER_EXEC static char * extract_program (char * text) { char * prgm = text; while ((prgm = strchr (prgm, ';')) != NULL) { if (*(prgm-1) == '\\') /* backslash escaped */ { /* remove backslash - avoid memmove() */ int i, n = strlen (prgm); for (i = 0; i <= n; i++) prgm [i - 1] = prgm [i]; } else { *prgm++ = '\0'; /* remove leading/trailing space */ prgm = trim_string (prgm); break; } } return prgm; } # endif /* NO_REMINDER_EXEC */ /* * Read the ~/.rclock file and find the next reminder * * update_only = 1 * look for a reminder whose time is greater than the current time, * but less than the currently set reminder time * * update_only = 0 * look for a reminder whose time is greater than the reminder that * just went off */ static void Next_Reminder (int update_only) { struct tm * tmval; char buffer [256]; #ifndef INT_MAX # define INT_MAX 1e8 #endif time_t currentTime; int savedTime = INT_MAX; FILE * fd; if (reminders_file == NULL || (fd = fopen (reminders_file, "r")) == NULL) { reminderTime = -1; /* no config file, no reminders */ return; } currentTime = time (NULL) + adjustTime; /* get the current time */ tmval = localtime (¤tTime); currentTime = mk_time (tmval); /* initial startup*/ if (reminderTime < 0) { /* ignore reminders that have already occurred */ reminderTime = currentTime; # ifndef NO_REMINDER_EXEC /* scan for programs run on start-up */ while (fgets (buffer, sizeof(buffer), fd)) { char * prgm, * text; text = trim_string (buffer); if (*text != ';') continue; prgm = extract_program (text); if (prgm != NULL && strlen (prgm) > 1) system (prgm); } rewind (fd); # endif /* NO_REMINDER_EXEC */ } /* now scan for next reminder */ while (fgets (buffer, sizeof(buffer), fd)) { int testTime, hh, mm, mo, dd, yy; char * text; text = trim_string (buffer); if (*text == '#') continue; /* comment */ if (*text == ';') continue; /* program run on startup */ /* * parse the line, format is hh:mm mo/dd/yr message; program * any of hh, mm, mo, dd, yr could be a wildcard `*' */ hh = GetOneNum (&text, tmval->tm_hour); if (*text == ':') text++; mm = GetOneNum (&text, 0); while (isspace (*text)) text++; if (!isToday (&text, tmval->tm_wday)) continue; while (isspace (*text)) text++; mo = GetOneNum (&text, tmval->tm_mon+1); if (*text == '/') text++; dd = GetOneNum (&text, tmval->tm_mday); if (*text == '/') text++; yy = GetOneNum (&text, tmval->tm_year); /* handle 20th/21st centuries */ if (yy > CENTURY) yy -= 1900; else if (yy < CENTURY) yy += (CENTURY - 1900); while (isspace (*text)) text++; if (!*text) continue; testTime = (mm + 60 * (hh + 24 * (dd + 31 * (mo + 12 * yy)))); if (testTime > (update_only ? currentTime : reminderTime)) { #ifndef NO_REMINDER_EXEC char * prgm = extract_program (text); #endif /* NO_REMINDER_EXEC */ /* trim leading/trailing space */ text = trim_string (text); /* * have a reminder whose time is greater than the last * reminder, now make sure it is the smallest available */ if (testTime < savedTime) { savedTime = testTime; strncpy (message, text, sizeof(message)); #ifndef NO_REMINDER_EXEC strncpy (execPrgm, (prgm ? prgm : ""), sizeof(execPrgm)); #endif } else if (testTime == savedTime) { if (strlen (text)) { int n = (sizeof(message) - strlen (message) - 3); if (n > 0) { /* for co-occurring events */ strcat (message, "\\n"); strncat (message, text, n); } } #ifndef NO_REMINDER_EXEC if (prgm != NULL) { int n = (sizeof(execPrgm) - strlen (execPrgm) - 2); if ((n > 0) && (n >= strlen (prgm))) { /* for co-occurring programs */ strcat (execPrgm, ";"); strncat (execPrgm, prgm, n); } } #endif /* NO_REMINDER_EXEC */ } } } reminderTime = (savedTime < INT_MAX) ? savedTime : -1; fclose (fd); } /* * Provide reminder by mapping the message window */ static void Reminder (void) { char * beg, * next; int lines; if (Msg_Mapped) return; #ifndef NO_REMINDER_EXEC if (strlen (message) == 0) { if (strlen (execPrgm) > 1) { system (execPrgm); Next_Reminder (REPLACE); } return; /* some sort of error */ } #endif /* compute the window size */ #ifdef NO_REMINDER_EXEC Msg.width = 10 * XTextWidth (Xfont, "M", 1); #else Msg.width = 18 * XTextWidth (Xfont, "M", 1); #endif for (beg = message, lines = 1; beg; beg = next, lines++) { int width; char * end; if ((end = strstr (beg, "\\n")) == NULL) { end = beg + strlen (beg); next = NULL; } else { next = end + 2; } width = XTextWidth (Xfont, beg, (end-beg)); if (Msg.width < width) Msg.width = width; } Msg.width += 30; Msg.height = (lines+1) * FontHeight () + 30; /* resize and centre the window */ XMoveResizeWindow (Xdisplay, Msg.win, (DisplayWidth (Xdisplay, Xscreen) - Msg.width ) / 2, (DisplayHeight (Xdisplay, Xscreen) - Msg.height) / 2, Msg.width, Msg.height); #define BUTTON_MARGIN 8 XMoveWindow (Xdisplay, msgButton.Dismiss, BUTTON_MARGIN, (Msg.height - msgButton.height - BUTTON_MARGIN)); XMoveWindow (Xdisplay, msgButton.Defer, (Msg.width - msgButton.width - BUTTON_MARGIN), (Msg.height - msgButton.height - BUTTON_MARGIN)); #ifndef NO_REMINDER_EXEC XMoveWindow (Xdisplay, msgButton.Start, (Msg.width - msgButton.width) / 2, (Msg.height - msgButton.height - BUTTON_MARGIN)); #endif XMapRaised (Xdisplay, Msg.win); XBell (Xdisplay, 0); Msg_Mapped = 1; } #endif /* REMINDERS */ #ifndef _POSIX_VERSION # if defined (__svr4__) static int getdtablesize (void) { struct rlimit rlim; getrlimit (RLIMIT_NOFILE, &rlim); return rlim.rlim_cur; } # endif #endif /* * Loops forever, looking for stuff to do. Sleeps 1 minute if nothing to do */ static void getXevent (void) { XEvent ev; int num_fds; /* number of file descriptors being used */ struct timeval tm; struct tm * tmval; Atom wmDeleteWindow; fd_set in_fdset; /* Enable delete window protocol */ wmDeleteWindow = XInternAtom (Xdisplay, "WM_DELETE_WINDOW", False); XSetWMProtocols (Xdisplay, Clock.win, &wmDeleteWindow, 1); #ifdef ICONWIN XSetWMProtocols (Xdisplay, Icon.win, &wmDeleteWindow, 1); #endif #ifdef REMINDERS XSetWMProtocols (Xdisplay, Msg.win, &wmDeleteWindow, 1); #endif #ifdef _POSIX_VERSION num_fds = sysconf (_SC_OPEN_MAX); #else num_fds = getdtablesize (); #endif #ifdef FD_SETSIZE if (num_fds > FD_SETSIZE) num_fds = FD_SETSIZE; #endif while (1) { /* take care of all pending X events */ while (XPending (Xdisplay)) { XNextEvent (Xdisplay, &ev); switch (ev.type) { case ClientMessage: /* check for delete window requests */ if ((ev.xclient.format == 32) && (ev.xclient.data.l[0] == wmDeleteWindow)) { #ifdef REMINDERS if (ev.xany.window == Msg.win) { XUnmapWindow (Xdisplay, Msg.win); Msg_Mapped = 0; Next_Reminder (REPLACE); } else #endif return; /* delete window is how this terminates */ } break; case Expose: case GraphicsExpose: /* need to re-draw a window */ if (ev.xany.window == Clock.win) Draw_Window (&Clock, 1); #ifdef ICONWIN else if (ev.xany.window == Icon.win) Draw_Window (&Icon, 1); #endif #ifdef REMINDERS else Draw_Window (&Msg, 1); #endif break; case ConfigureNotify: /* window has been re-sized */ if (ev.xany.window == Clock.win) { Clock.width = ev.xconfigure.width; Clock.height = ev.xconfigure.height; } break; #ifdef REMINDERS case KeyPress: /* any key press to dismiss message window */ if (ev.xany.window == Msg.win) { Next_Reminder (REPLACE); Msg_Mapped = 0; XUnmapWindow (Xdisplay, Msg.win); } break; #endif case ButtonPress: #ifdef REMINDERS /* button press to dismiss message window */ if (ev.xany.window == Msg.win) { if (ev.xbutton.subwindow == msgButton.Dismiss) { Next_Reminder (REPLACE); Msg_Mapped = 0; XUnmapWindow (Xdisplay, Msg.win); } else if (ev.xbutton.subwindow == msgButton.Defer) { time_t t = time (NULL) + adjustTime; tmval = localtime (&t); reminderTime = mk_time (tmval) + DEFER_TIME; Msg_Mapped = 0; XUnmapWindow (Xdisplay, Msg.win); } #ifndef NO_REMINDER_EXEC else if (ev.xbutton.subwindow == msgButton.Start) { system (execPrgm); Next_Reminder (REPLACE); Msg_Mapped = 0; XUnmapWindow (Xdisplay, Msg.win); } #endif /* NO_REMINDER_EXEC */ } #endif #ifdef MAIL if (ev.xany.window == Clock.win) { #ifdef MAIL_SPAWN /* left button action - spawn a mail reader */ if (ev.xbutton.button == Button1) system (MAIL_SPAWN); #else if ( (ev.xbutton.button == Button1) && (mail_spawn != NULL) ) system(mail_spawn); #endif /* redraw the window */ Draw_Window (&Clock, 1); } #endif break; } } /* Now wait for time out or new X event */ FD_ZERO (&in_fdset); FD_SET (Xfd, &in_fdset); tm.tv_sec = clockUpdate; tm.tv_usec = 0; select (num_fds, &in_fdset, NULL, NULL, &tm); Draw_Window (&Clock, 0); #ifdef ICONWIN Draw_Window (&Icon, 0); #endif } } /* * Print an error message. */ static void print_error (const char * fmt, ...) { va_list arg_ptr; va_start (arg_ptr, fmt); fprintf (stderr, APL_NAME ": "); vfprintf (stderr, fmt, arg_ptr); fprintf (stderr,"\n"); va_end (arg_ptr); } /*----------------------- end-of-file (C source) -----------------------*/ rxvt-2.7.10/rclock/feature.h010064400001440000024000000105230745444116200143300ustar gcwstaff/*--------------------------------*-C-*---------------------------------* * file: feature.h * * Compile-time configuration. *----------------------------------------------------------------------* * Copyright (C) 1997 1998 mj olesen * * 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 of the License, 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 _FEATURE_H #define _FEATURE_H /*----------------------------------------------------------------------* * #define ICONWIN * to enable fancy (active) icon * * #define REMINDERS * to enable the appointment reminder functions * * #define NO_REMINDER_EXEC * to disable the execution of a program on an appointment * * #define DATE_ON_CLOCK_FACE * to display today's date on the face of the clock * Note: this requires REMINDERS since it uses the same font * * #define MAIL * to enable xbiff-type mail reminders * * #define MAIL_BELL * to enable xbiff-type mail reminders with a beep * * #define MAIL_SPAWN "xmh\ -font\ 7x14\&" * to define a mail program to run * * #define MAIL_SPOOL "/var/spool/mail/" * to define the mail spool when the $MAIL variable isn't set * * program size approximately doubles from no options to all options *----------------------------------------------------------------------*/ #define ICONWIN #define REMINDERS /* #define NO_REMINDER_EXEC */ #define DATE_ON_CLOCK_FACE #define MAIL /* #define MAIL_BELL */ /* #define MAIL_SPAWN "xmh\ -font\ 7x14\&" */ /* #define MAIL_SPOOL "/var/spool/mail/" */ /*----------------------------------------------------------------------* * #define CLOCKUPDATE 30 * to define the frequency (seconds) to update the clock * * #define MAILUPDATE 60 * to define the frequency (seconds) to check for new mail * * #define REMINDERS_TIME 10 * to define the frequency (minutes) to check ~/.rclock * * #define DEFER_TIME 3 * to define the amount (minutes) to defer a message * * #define ADJUST_TIME * to add -adjust command-line option * * #define CENTURY 2000 * to set the base century for 2 digit year short-hand *----------------------------------------------------------------------*/ #define CLOCKUPDATE 30 #define MAILUPDATE 60 #define REMINDERS_TIME 10 #define DEFER_TIME 3 #define ADJUST_TIME /* #define CENTURY 2000 */ /*----------------------------------------------------------------------* * #define FONT_NAME "7x14" * to define the font to be used for appointment reminders * * #define FG_COLOR_NAME "black" * #define BG_COLOR_NAME "white" * to define the foreground/background colors to use *----------------------------------------------------------------------*/ #define FONT_NAME "7x14" #define FG_COLOR_NAME "black" #define BG_COLOR_NAME "white" /*----------------------------------------------------------------------* * #define DAY_NAMES "umtwrfs*" * define this string appropriate for any language. * * It starts with a symbol for Sunday, ends with Saturday, then '*' * NOTE: 8 characters total - 7 days of the week plus '*' *----------------------------------------------------------------------*/ #define DAY_NAMES "umtwrfs*" /*----------------------------------------------------------------------* * #define SUBTICKS * to show additional minute/second markings *----------------------------------------------------------------------*/ #define SUBTICKS /*----------------------------------------------------------------------* * sort out conflicts *----------------------------------------------------------------------*/ #if defined (MAIL_BELL) || defined (MAIL_SPAWN) || defined (MAIL_SPOOL) # ifndef MAIL # define MAIL # endif #endif #endif /* whole file */ /*----------------------- end-of-file (C header) -----------------------*/ rxvt-2.7.10/rclock/rclock.html010064400001440000024000000153130651657467000147020ustar gcwstaff RCLOCK(1) manual page Table of Contents

    NAME

    rclock (ouR CLOCK) clock and appointment reminder for X11

    SYNOPSIS

    rclock

    DESCRIPTION

    rclock version 2.21a3 is an analog clock for X intended as an xclock(1) replacement that conserves memory and has extra features: rclock enters reverse video if there is mail waiting; an appointment reminder is also builtin.

    OPTIONS

    The options supported by rclock:
    -display displayname
    Attempt to open a window on the named X display. In the absence of this option, the display specified by the DISPLAY environment variable is used.
    -geometry geom
    Create the window with the specified X window geometry [default 80x80].
    -bg color
    Window background color [default white].
    -fg color
    Window foreground color [default black].
    -fn fontname
    Select font used for reminders [default 7x14].
    -iconic
    Start iconified, if supported by the window manager.
    -adjust ddhhmm
    Adjust the clock by +/- ddhhmm = days, hh = hours, mm = minutes) to fix an incorrect clock without being root or for working in another time-zone.
    -update n
    Update clock face every n seconds [default 30]. If n=1, a seconds hand is displayed.
    -mail n
    Check for new mail every n seconds [default 60]. The actual interval is a multiple of the clock update interval.
    #geom
    Specify the preferred icon window size [default 65x65].

    X RESOURCES

    No X resources are used only command-line options.

    TITLES AND ICONS

    The window and icon titles are set to the day of the week and the date. The icon window is "active" and will show the time, if supported by the window manager.

    REMINDERS

    The ~/.rclock file lists the messages to display and/or the programs to run at specified times and dates. At the specified time, rclock will pop-up a window in the center of the screen to display the message or will simply run the scheduled program. rclock will reads the ~/.rclock file at startup, and every 10 minutes (to look for changes) and after a message window has been dismissed (to find the next appointment).

    An entry in ~/.rclock may be one of two formats (blank and comment lines will be ignored):

    hh:mm [dd] MM/DD/YY message[; program] or
    [hh:mm [dd] MM/DD/YY [message]]; program
    hh - hour (0-23; * = current) mm - minute (0-59; * = 0) dd - days-of-week (some/all/none of umtwrfs; * = all) MM - month (1-12; * = current) DD - day of month (1-31; * = current) YY - year (0-99 or 1900-????; * = current) message - message to display program - program to execute

    The days-of-the-week use the following abbreviations: u=Sunday, m=Monday, t=Tuesday, w=Wednesday, r=Thursday, f=Friday, s=Saturday, *=all.

    If message is empty and program has been specified, it is executed without a dialog box. If time/date are also not specified, program is executed on start-up. Note message may contain escape values (\n: newline, \;: semicolon).

    Here's a silly example file that shows some of the permissible constructs:
    # ~/.rclock - My appointment file

    # startup functions
    ; xsetroot -solid Black &

    # cron functions

    10:00; xsetroot -solid Grey25 &
    14:00; xsetroot -solid Grey75 &

    # daily/weekly reminders

    08:15 mtwrf * Good Morning!\nRead News?; rxvt -e News
    12:00 mtwrf * Lunch Time!
    17:00 mtwrf * Go Home
    23:00 mtwrf * Still Here? Go to bed
    08:10 twrf * Did you do your time card yesterday?
    15:00 f * Friday, do your time card early!
    16:00 mtwr * Do your time card
    16:30 mtwrf * Did you do your time card?
    *:00 us * It's the weekend, why are you here?
    8:15 f */13/* Friday the 13th! Careful!
    8:15 * 4/1/* fkrkrmfismsmkd...dkdfk
    8:16 * 4/1/* April Fools!

    # birthdays/anniversaries

    16:00 05/21/* Pam's Birthday (next week)
    16:00 05/24/* Pam's Birthday (in a few days)

    # once-of appointments

    08:30 03/15/94 Dentist appointment
    08:30 03/15/1999 Dentist appointment
    08:30 03/15/2004 Dentist appointment

    ENVIRONMENT

    rclock uses the environment variable MAIL to determine the location of the user's mail spool file.

    BUGS

    rclock is not very smart about dealing with errors encountered while reading the ~/.rclock file. Each reminder must be a single line not exceeding 255 characters. Reminder windows are sometimes not redrawn (left blank) when raised or uncovered.

    AUTHOR

    Rob Nation nation@rocket.sanders.lockheed.com

    Modifications by mj olesen olesen@me.QueensU.CA

    CURRENT MAINTAINER

    Same as the current rxvt maintainer.


    Table of Contents

    rxvt-2.7.10/ChangeLog010064400001440000024000005032150764024377700130370ustar gcwstaff2003-03-26 Geoff C. Wing * doc/LSM.in 1.14: See previous LSM.in log message * src/version.h 1.29: Bump version to 2.7.10 * doc/changes.txt 1.132: Update * src/command.c 1.264: Disable reporting of two user-settable strings as they may be a security problem 2003-03-23 Geoff C. Wing * src/screen.c 1.258: if 0 rxvt_scr_dump() fully, not just content * doc/changes.txt 1.131: Update * src/command.c 1.263: Remove escape sequence access to menubar due to possible security problems * doc/changes.txt 1.130: Update * src/screen.c 1.257, src/command.c 1.262: Remove screen dump feature as it's currently too likely to be open to abuse and is thus a security concern 2003-03-07 Geoff C. Wing * autoconf/configure.in 1.126: autoconf changes. Quotes were fixed in AC_ARG_ENABLE * Makefile.in 1.16: Use the prebuild machinery to work around autoconf's backwards incompatibility * doc/yodl/rxvtRef-privatemodes.yo 1.5: Private mode 2 for VT52 mode * doc/changes.txt 1.129: Update * src/rxvt.h 1.163, src/command.c 1.261: fix bug where control characters weren't being processed inside escape sequences and add support for VT52 commands, from Rob McMullen 2003-02-28 Geoff C. Wing * doc/changes.txt 1.128: Update * doc/yodl/rxvt-resources.yo 1.30, src/rxvt.h 1.162, src/rxvtlib.h.in 1.10, src/xdefaults.c 1.108, src/command.c 1.260: Add mouseWheelScrollPage long option, from Rob McMullen 2002-12-24 Geoff C. Wing * W11/wrap/rxvt.rc 1.3, W11/w32/event.c 1.3, W11/w32/xlib.c 1.3: Changes from Steve O: fix the shift-KP+ and shift-KP- fix the NeXT scrollbar oddness bump cygwin revision to 2.7.9-3 2002-12-18 Geoff C. Wing * src/rxvt.h 1.161: Make sure we have h->ut_id when appropriate, noticed by Gabor Z. Papp 2002-12-16 Geoff C. Wing * src/logging.c 1.38: Add missing variable with HAVE_UTMP_PID, noticed by Mark Leisher * src/logging.c 1.37: s/RXVT_UTMP_PID/HAVE_UTMP_PID/ , noticed by Mark Leisher 2002-12-04 Geoff C. Wing * src/logging.c 1.36: Move a brace, noticed by Gabor Z. Papp * doc/changes.txt 1.127: Update * W11/w32/ntdef.h 1.2, W11/w32/ntutil.c 1.2, W11/w32/xlib.c 1.2, W11/wrap/Makefile 1.2, W11/wrap/mkproxy.pl 1.2, W11/wrap/rxtv.ico 1.2, W11/wrap/rxvt.ico 1.2, W11/wrap/rxvt.rc 1.2, W11/wrap/wrap.c 1.2, W11/wrap/wrap.h 1.2, W11/wrap/xwrappers.gen 1.2, autoconf/configure.in 1.125, src/command.c 1.259, src/init.c 1.103, src/screen.c 1.256, Makefile.in 1.15, W11/Makefile.in 1.2, W11/Makefile.xpm 1.2, W11/X11/Intrinsic.h 1.2, W11/X11/Xatom.h 1.2, W11/X11/Xlib.h 1.2, W11/X11/Xlocale.h 1.2, W11/X11/Xmd.h 1.2, W11/X11/Xutil.h 1.2, W11/X11/cursorfont.h 1.2, W11/X11/keysym.h 1.2, W11/X11/keysymdef.h 1.2, W11/w32/Makefile 1.2, W11/w32/event.c 1.2: Pull in cygwin branch * autoconf/xpm.m4 1.4: Hack to try .../X11/Xpm.h even with specified include path. This section needs cleaning up some time 2002-11-29 Geoff C. Wing * src/command.c 1.258: Handle private mode CSI sequence sets separately from other sequences to avoid unintentional behaviour. Noticed by Steve O 2002-11-25 Geoff C. Wing * src/logging.c 1.35: Fix up ifdef's for inclusion for ut_host * src/test/Makefile.in 1.11: Refix. Just spell out targets rather than using $? or similar * src/test/Makefile.in 1.10: Only use the implied source variable 2002-11-13 Geoff C. Wing * src/rxvt.h 1.160: Don't force a 256 colour mask for only MULTICHAR_SET since we don't fix up the macros (depending on Color_Bits) later on, noticed by Yamanobe Kiichiro 2002-11-06 Geoff C. Wing * doc/changes.txt 1.126: Update * src/screen.c 1.255: Fix a clearing error when internal border width is zero, from Mikko Leppänen 2002-10-24 Geoff C. Wing * src/main.c 1.172: Fix check for PROPFONT_MULTI. It was missing multiplier. From Yamanobe Kiichiro 2002-10-15 Geoff C. Wing * .prebuild 1.4: Support non backward compatible autoheader & autoconf 2002-10-10 Geoff C. Wing * src/main.c 1.171: "Promote" Status return type to int 2002-10-08 Geoff C. Wing * W11/Makefile.xpm 1.1: New file. * src/screen.c 1.254: Basic users get basic functionality. Require USE_XIM for Compound Text Encoding responses 2002-10-07 Geoff C. Wing * src/menubar.c 1.56: Only bring in Xmb* routines when we have XIM support * Makefile.in 1.14: acconfig.h is gone * W11/X11/Intrinsic.h 1.1, W11/X11/Xatom.h 1.1, W11/X11/Xlib.h 1.1, W11/X11/Xlocale.h 1.1, W11/X11/Xmd.h 1.1, W11/X11/Xutil.h 1.1, W11/X11/cursorfont.h 1.1, W11/X11/keysym.h 1.1, W11/X11/keysymdef.h 1.1, W11/X11/xpm.h 1.1, W11/w32/Makefile 1.1, W11/w32/event.c 1.1, W11/w32/ntdef.h 1.1, W11/w32/ntutil.c 1.1, W11/w32/xlib.c 1.1, W11/wrap/Makefile 1.1, W11/wrap/mkproxy.pl 1.1, W11/wrap/rxtv.ico 1.1, W11/wrap/rxvt.ico 1.1, W11/wrap/rxvt.rc 1.1, W11/wrap/wrap.c 1.1, W11/wrap/wrap.h 1.1, W11/wrap/xwrappers.gen 1.1, W11/Makefile.in 1.1: New file. 2002-10-05 Geoff C. Wing * autoconf/acconfig.h 1.46, autoconf/configure.in 1.124, autoconf/xpm.m4 1.3: Generate config.h.in completely through autoheader Clean up some of the tests for utmp and friends 2002-10-04 Geoff C. Wing * src/version.h 1.28: Bump version to 2.7.9 2002-10-01 Geoff C. Wing * src/logging.c 1.34: Fix typo on var name * src/logging.c 1.33, autoconf/acconfig.h 1.45, autoconf/configure.in 1.123: Basic support for lastlogx * src/command.c 1.257: Make CONTROL the only override for Backspace, removing SHIFT * Makefile.in 1.13: Remove autom4te.cache with target "clean" * autoconf/config.guess 1.5: Update to version at date 2002-09-03 * autoconf/config.sub 1.5: Update to version at date 2002-09-05 * src/logging.c 1.32, src/logging.h 1.10, src/rxvt.h 1.159, autoconf/configure.in 1.122, autoconf/acconfig.h 1.44: Reimplement support for utmp/utmpx variations to allow multiple types on one system. Tested compile on recent Solaris, FreeBSD and some GNU/Linux systems. QNX support not yet readded. First pass 2002-09-22 Geoff C. Wing * src/command.c 1.256: If in mouse reporting mode, unconditionally avoid button 4 & 5 irrespective of mouse wheel support * src/main.c 1.170: Currently only check the first IM server in the list, from Kuang-che Wu * src/command.c 1.255: Don't report wheel (button) mouse release events to application thus matching xterm's practice, from Pavel Roskin 2002-09-19 Geoff C. Wing * src/ptytty.c 1.6, autoconf/acconfig.h 1.43, autoconf/configure.in 1.121: For pty searching OSs, change the limitation so that the limit on searched devices is as many as the system configured on - may or may not be greater than a hard coded list. Caveat: system configured on should have as many ptys configured as all client systems the compiled binary will be run on. Based on the screen configure.in version, from Kazutoshi Kubota * src/command.c 1.254, src/menubar.c 1.55, autoconf/configure.in 1.120: Use a proper sleep call for sleeping - but only link in one * src/command.c 1.253: Change mouse reporting of button 4/5 events (used by wheel on wheel mice) to be similar to xterm (note: release events for button 4/5 still reported though xterm doesn't), from Pavel Roskin 2002-08-14 Geoff C. Wing * src/init.c 1.102: Try to be safer with file descriptors * src/command.c 1.252: Fix a signed/unsigned type mismatch 2002-08-08 Geoff C. Wing * src/screen.c 1.253: Fix up saved cursor position upon screen size increase, from Malcolm Smith * src/init.c 1.101, src/main.c 1.169, src/rxvt.h 1.158, src/screen.c 1.252: Another slight cleanup from 256 colour changes * doc/changes.txt 1.124: Update * src/rxvt.h 1.157: Small cleanup. define some colour numbers instead of enum * autoconf/acconfig.h 1.42, autoconf/configure.in 1.119, src/command.c 1.251, src/init.c 1.100, src/main.c 1.168, src/rxvt.h 1.156, src/rxvtlib.h.in 1.9, src/screen.c 1.251, src/xdefaults.c 1.107, README.configure 1.18: Add support for 256 colours (instead of 16 colours) with configure --enable-256-color option. From Kazutoshi Kubota 2002-08-04 Geoff C. Wing * src/command.c 1.250: Only check the fd set after a successful select() call, from Christian B. (bloodjerk) * rclock/rclock.c 1.6: Limit fd set size for select, from Christian B. (bloodjerk) 2002-06-27 Geoff C. Wing * src/rxvt.h 1.155: Don't bother with setting TERM to kterm anymore, suggest by Kazutoshi Kubota * src/init.c 1.99: Have the parent provide a /dev/null stdin fd and a stdout fd as a duplicate of stderr. Only when PRINT_PIPE is defined should we be invoking anything else after the original shell 2002-06-11 Geoff C. Wing * src/menubar.c 1.54: Rename shadowing local variables 2002-04-09 Geoff C. Wing * src/scrollbar.c 1.43: Protect some variables within #ifdef * src/init.c 1.98: Only setup scrollbars if we have them * src/command.c 1.249: Exit on abnormal read(cmdfd) failure which may occur upon signal failure from child. Noticed by Marius Gedminas * doc/changes.txt 1.123: Update * rclock/feature.h 1.3, rclock/rclock.1.in 1.4, rclock/rclock.c 1.5: Changes from Matthew W. Roberts : - Fix bug for -iconic option. It didn't work right if -iconic was the last option. - Add some comments regarding -mailfile option - Show today's date on the lower half of the clock (via DATE_ON_CLOCK_FACE define in feature.h) - Add -mailspawn option if MAIL_SPAWN is not defined at compile time (also requires MAIL to be defined) * doc/changes.txt 1.121: Update * src/scrollbar-rxvt.c 1.10, src/scrollbar-xterm.c 1.11, src/scrollbar.c 1.42, src/xdefaults.c 1.106, src/command.c 1.248, src/feature.h 1.69, src/init.c 1.97, src/main.c 1.167, src/rxvt.h 1.154, src/rxvtlib.h.in 1.8, src/screen.c 1.250: Move more scrollbar stuff into scrollbar.c Allow delayed creation of the scrollbar window. If we don't start with one then don't create it unless we receive an escape sequence for it Compact some (rxvt_t) TermWin proportional font flags into one variable Add -sbt/--thickness to allow user-supplied scrollbar width - currently not available for NeXT style scrollbars 2002-04-08 Geoff C. Wing * src/command.c 1.247, src/screen.c 1.249: Clean up some signed/unsigned comparisons 2002-04-01 Geoff C. Wing * src/screen.c 1.248: Stopgap measure as intermediate stage to provide reasonable display for fast link with slow link support enabled. Do line by line updates rather than large (undefined/blank) XCopyArea updates when we're partially obscured 2002-02-02 Geoff C. Wing * src/xdefaults.c 1.105: Jump through some hoops to properly order the resources obtained via XGetDefault(). We use multiple classes to steal defaults from XTerm if none are available in our class. This doesn't really work well with XGetDefault() but it's probably best to stay with that xlib call. Noticed by Josip Rodin (via Brian Mays) 2001-12-13 Geoff C. Wing * src/main.c 1.166: Refix XIM connection when XMODIFIERS env var is providing connection information but the IM isn't available at exec time. Don't bother setting had_im but just short circuit out, from Tung-Han Hsieh 2001-11-30 Geoff C. Wing * src/Makefile.in 1.58: Fix install target. Add install/uninstall with versioning * autoconf/Make.common.in 1.16: Propogate LN * autoconf/configure.in 1.118: Check for ln * autoconf/configure.in 1.117: Let other programs know when we want a shared library 2001-11-29 Geoff C. Wing * src/xdefaults.c 1.104: Fix build when no scrollbars are defined, noticed by Sven Guckes * doc/LSM.in 1.13: See previous LSM.in log message * src/version.h 1.27: Bump version to 2.7.8 * autoconf/config.guess 1.4, autoconf/config.sub 1.4: Update to version at date 2001-10-05 * doc/yodl/rxvt-resources.yo 1.29: Document --scrollBar_align Fix argument types for a couple of other resources * src/xdefaults.c 1.103: Actually, change a couple of options to indicate argument is a specific "mode" rather than an arbitrary "string" * src/xdefaults.c 1.102: scrollBar_align just takes a "string" * src/command.c 1.246: Fix a stupid pasto with up/down buttons * src/xdefaults.c 1.101: Put in a couple of assert()s to catch errors with option list creation, although it should (beneficially) segv after anyway * doc/changes.txt 1.120: Update * src/command.c 1.245, src/feature.h 1.68, src/init.c 1.96, src/rxvt.h 1.153, src/xdefaults.c 1.100: Add --scrollBar_align (top|bottom|...) to provide alignment of scrollbar thumb with middle button. Defaults to centre. This supercedes FUNKY_SCROLL_BEHAVIOUR by Mike Hopkirk (Hops). From T. Alexander Popiel * doc/yodl/rxvt-options.yo 1.19, doc/yodl/rxvt-resources.yo 1.28: Document -j/+j jumpScroll 2001-11-28 Geoff C. Wing * src/screen.c 1.247: Fix stupid typo in last * src/command.c 1.244: Compact process_sgr_mode * src/command.c 1.243: Compact private (terminal) mode sequence handling code 2001-11-27 Geoff C. Wing * src/init.c 1.95: set jump/smooth scroll privmode appropriately * src/command.c 1.242, src/rxvt.h 1.152: Rename private mode variable for jump/smooth scroll since the jump scroll option has reverse sense to private mode smooth scroll. Fix up logic in private mode parsing appropriately * doc/yodl/rxvtRef-privatemodes.yo 1.4: Have implemented smooth/jump scroll sequence * src/init.c 1.94, src/rxvt.h 1.151, src/command.c 1.241: Add in private mode sequence for jumpScroll * doc/changes.txt 1.119: Update * src/command.c 1.240, src/rxvt.h 1.150, src/rxvtlib.h.in 1.7, src/xdefaults.c 1.99: Supercede REFRESH_EVERY_LINE define with option -j/--jumpScroll set by default (as per previous behaviour and xterm default). Do check in main loop rather than through cmd_getc loop * src/screen.c 1.246: Possible optimise * src/command.c 1.239: Provide a define REFRESH_EVERY_LINE to allow slower, smoother refreshing. Maybe nicer on faster machines? * src/command.c 1.238: Consistency nit 2001-11-23 Geoff C. Wing * src/command.c 1.237: Calculate a value before a loop instead of inside it * src/command.c 1.236: Fix CSI defaults (properly) * src/command.c 1.235: Fix defaults for CSI sequence parameters after last set of changes. Override defaults in all parameters with value of default for first parameter (since we don't keep multi default values and we only handle 0 or 1 anyway). i.e. handle as if (Pn...) and (Ps...) defaults 2001-11-22 Geoff C. Wing * src/command.c 1.234: emulate common terminals wrt 0 parameter for CUF/CUB. "fix" handling of "bad" characters within CSI parameter list * src/screen.c 1.245: clean up rxvt_scr_tab() slightly * src/screen.c 1.244: change a debug statement * doc/changes.txt 1.118: Update * src/command.c 1.233: Make sure we don't stomp a 0 parameter in a CSI sequence 2001-11-21 Geoff C. Wing * src/main.c 1.165: Remove a layer of indirection from rxvt_IM_get_IC() 2001-11-20 Geoff C. Wing * src/screen.c 1.243: refresh_type changed from char to unsigned char * src/rxvt.h 1.149: Try using 'unsigned char' bitfields under gcc * src/screen.c 1.242: Boolean-ise h->multi_byte * src/command.c 1.232: Boolean-ise h->want_refresh 2001-11-19 Geoff C. Wing * src/screen.c 1.241: Tidy up comparison * doc/changes.txt 1.117: Update * src/xdefaults.c 1.98: Add in basic support for XAPPLRESDIR, from Rudolf Jaksa * src/screen.c 1.240: increase nits needed for XCopyArea * src/main.c 1.164: If the user didn't specify an IM then we should still try to connect with "im=none" in case a base IM service is used for items like dead keys in single char glyph locales 2001-11-07 Geoff C. Wing * src/screen.c 1.239: Reindent one bit and make another bit clearer * doc/changes.txt 1.116: Update 2001-11-06 Geoff C. Wing * src/xdefaults.c 1.97: group names better: forceinheritPixmap -> inheritPixmapforce * src/rxvt.h 1.148, src/rxvtlib.h.in 1.6, src/screen.c 1.238, src/xdefaults.c 1.96: Be nicer with our parent windows with inheritPixmap transparency. Add -ipf modifier for (-ip|-tr) to forcefully clear them. The default behaviour now is to NOT clear them 2001-10-19 Geoff C. Wing * src/xdefaults.c 1.95: Pull in resources from the app-defaults/APL_SUBCLASS with prefix of our APL_SUBCLASS before empty/all matches 2001-10-11 Geoff C. Wing * doc/changes.txt 1.115: Update * autoconf/configure.in 1.116: Prevent use of setsid() under any Ultrix version, noticed by Bert De Knuydt 2001-10-10 Geoff C. Wing * src/command.c 1.231, src/rxvt.h 1.147, src/screen.c 1.237: Try harder to paste useful text from other applications. Also, prevent a coredump when other applications can't comply with our request * src/xdefaults.c 1.94: Quieten gcc * doc/changes.txt 1.114: Update * src/init.c 1.93, src/main.c 1.163: Fix connection to IM irrespective of when it is started. Pass over all possible IM connections - those passed via "-im" and the XMODIFIERS env var - until we get one with a matching input style. Noticed by, and lots of help from, Tung-Han Hsieh * src/main.c 1.162: Fix last change * src/main.c 1.161: Use rxvt_splitcommastring() instead of rolling out a version for each use * src/misc.c 1.39: Add function rxvt_splitcommastring() to take a comma-separated string and return an array of each item, including empty items. Matching quotes are also removed. Leading and trailing spaces are removed. The caller should free each item and the whole array when done 2001-10-02 Geoff C. Wing * doc/changes.txt 1.113: Update * src/command.c 1.230: Fix DECSTBM default when only one argument is given, from Stephen Isard 2001-09-28 Geoff C. Wing * autoconf/config.guess 1.3, autoconf/config.sub 1.3: Update to version at date 2001-08-23 2001-09-24 Geoff C. Wing * doc/changes.txt 1.112: Update * src/command.c 1.229: Fix continual scrolling and slipwheel, noticed by Joshua Swink 2001-09-10 Geoff C. Wing * doc/changes.txt 1.111: Update * src/feature.h 1.67, src/init.c 1.92, src/rxvt.h 1.146, src/screen.c 1.236, src/xdefaults.c 1.93: Add support for '-hc colour' (via define OPTION_HC in feature.h) to provide background highlight colouring of selection. Colour is not used if it is the same as either foreground or background colour. Partly from Christian W. Zuckschwerdt * src/init.c 1.91: Fix ModNumLockMask assignment, noticed by Matthew Gabeler-Lee 2001-08-09 Geoff C. Wing * src/Makefile.in 1.57: Make sure we actually distribute rxvtlib.h.in * src/version.h 1.26: Bump version to 2.7.7 * doc/LSM.in 1.12: See previous LSM.in log message * INSTALL 1.11: Note "make tests" * src/test/Makefile.in 1.9: Remove $(XLIB) from link stage of tests. We shouldn't need them * doc/changes.txt 1.110: Update * src/ptytty.c 1.5: Fix STREAMS again, noticed (again) by Francis Hartojo Trying to decipher SUN documentation (again): - push the STREAMS modules in the child. We have to do the open in the child (and should be after the new session is created) to get a controlling terminal but don't want to push the modules until after we've closed off our extra fd to the master side, just in case the close causes problems with the STREAMS modules we push. Throw in some comments about this 2001-08-08 Geoff C. Wing * src/test/Makefile.in 1.8: Give debug information for a failed test 2001-08-07 Geoff C. Wing * autoconf/libtool.m4 1.5, autoconf/ltmain.sh 1.5: Revert: wasn't backwards compatible with autoconf-2.13 * autoconf/libtool.m4 1.4, autoconf/ltmain.sh 1.4: Update to more recent libtool version * doc/changes.txt 1.109: Update * src/feature.h 1.66: Turn on WTMP_ONLY_ON_LOGIN by default - this matches xterm * doc/TODO 1.15: Add one * doc/TODO 1.14: Did one * doc/yodl/rxvt-options.yo 1.18, doc/yodl/rxvt-resources.yo 1.27: Note -mcc/--multibyte_cursor and -lsp/--linespace * doc/changes.txt 1.108: Update * doc/yodl/rxvt-options.yo 1.17, doc/yodl/rxvt-resources.yo 1.26, src/rxvt.h 1.145, src/rxvtlib.h.in 1.5, src/screen.c 1.235, src/xdefaults.c 1.92: Add -sw/--scrollWithBuffer from Mark Schreiber * doc/yodl/rxvt-options.yo 1.16, doc/yodl/rxvt-resources.yo 1.25: Fix -grk and --greektoggle_key notes * doc/changes.txt 1.107: Update * src/command.c 1.228, src/init.c 1.90, src/rxvt.h 1.144, src/screen.c 1.234: Provide paste-only support for SECONDARY and CLIPBOARD selections in addition to PRIMARY selection. Order for selection pastes is: 1) internal selection (if available) 2) first to claim ownership for PRIMARY, SECONDARY and CLIPBOARD selections (in that order) 3) CUT_BUFFER0 - if conversion for a selection in "2)" fails even though there is someone claiming ownership, fall back to "3)" 2001-08-06 Geoff C. Wing * doc/changes.txt 1.106: Update * src/command.c 1.227, src/feature.h 1.65, src/init.c 1.89, src/rxvt.h 1.143, src/xdefaults.c 1.91: Readd "greektoggle_key" which was mystically lost between versions 2.16 and 2.20. Defaults to XK_Mode_switch. May be overridden by setting GREEK_KEYBOARD_MODESWITCH to the appropriate keysym in feature.h (or passing through CPPFLAGS to configure) * src/init.c 1.88, src/main.c 1.160: Change all XQueryColor() calls to XQueryColors() obviating one X call from resultant binary 2001-08-04 Geoff C. Wing * src/feature.h 1.64, src/xdefaults.c 1.90: - provide a base X11USRLIBDIR (and X11LIBDIR) which can be overridden from configure stage via CPPFLAGS. Use for XAPPLOADDIR and XAPPLOADDIRLOCALE. Change XAPPLOADDIRLOCALE slightly to provide self limiting bounds. XAPPLOADDIRLOCALE must now include "%-.*s" sequence - reposition NO_PIXEL_DROPPING_AVOIDANCE within feature.h to place it closer to NO_BOLDOVERSTRIKE - bump basic limits on columns/rows to 1000 each * src/command.c 1.226: Provide a kluge for CYGWIN. Once we know the shell is running, resend the screen size. Noticed by Rick Rankin 2001-08-03 Geoff C. Wing * src/command.c 1.225: Fix a stuffup with parentheses in last change 2001-08-02 Geoff C. Wing * src/command.c 1.224, src/rxvt.h 1.142: Partially delint * src/screen.c 1.233: Cleanup after 1.230 * src/command.c 1.223: As for screen.c, so for command.c * src/screen.c 1.232: We know what type of XEvent we're using so refer to it by the full type not as a union member * src/screen.c 1.231: Fix stuff up with using unset gcvalues for single glyph writing: just do an initial set at the start of *scr_refresh() rather than messing about each time, noticed by Kazutoshi Kubota Also clean up some other XChangeGC() calls * src/command.c 1.222, src/init.c 1.87, src/rxvt.h 1.141, src/screen.c 1.230: - add generic timeout system to X event processing system - use timeout system for INCR pasting - this prevents rxvt from stalling although it does allow the possibility of a less desirable order of events - e.g. extra stuff interfering during an INCR paste - tough! Increasing PROP_SIZE in screen.c would also help here - change INCR handling to be closer to (my reading of) ICCCM2.0 description: delete INCR on PropertyNotify event not on SelectionNotify event - slightly change allocation of memory in *tt_write() - do fewer realloc()s by keeping slightly more spare memory - s/memcpy/memmove/ for possibly overlapping memory areas - change how data is sent from paste through *tt_write() - this may be `improved' on later by sending per line including the carriage return (previously, carriage return was sent separately which doesn't necessary interact well through to (line) buffering through termios) - add error messages to users upon known data loss - other small cleanups 2001-08-01 Geoff C. Wing * src/command.c 1.221, src/rxvt.h 1.140: Consistency: s/xrootpmapid/xa_xrootpmapid/ * doc/changes.txt 1.105: Update * src/init.c 1.86: We need to select PropertyChangeMask on vt window so that INCR transfers work 2001-07-28 Geoff C. Wing * doc/changes.txt 1.104: Update * README.configure 1.17, autoconf/acconfig.h 1.41, autoconf/configure.in 1.115, doc/TODO 1.13, src/command.c 1.220, src/init.c 1.85, src/rxvt.h 1.139: Add in integrated form of slipwheeling patch. While the control key is depressed, the mouse wheel acts as an accelerator for scrolling. Scrolling stops when the control key is released. Slip wheel support from Ali Rahimi 2001-07-27 Geoff C. Wing * src/.cvsignore 1.4: Ignore generated .protos * src/command.c 1.219, src/defaultfont.c 1.8, src/feature.h 1.63, src/graphics.c 1.39, src/grkelot.c 1.12, src/grkelot.h 1.5, src/init.c 1.84, src/logging.c 1.31, src/main.c 1.159, src/menubar.c 1.53, src/misc.c 1.38, src/netdisp.c 1.16, src/ptytty.c 1.4, src/screen.c 1.229, src/scrollbar-next.c 1.15, src/scrollbar-rxvt.c 1.9, src/scrollbar-xterm.c 1.10, src/scrollbar.c 1.41, src/strings.c 1.14, src/xdefaults.c 1.89, src/xpm.c 1.49: Cosmetic changes 2001-07-25 Geoff C. Wing * src/main.c 1.158: Don't XFree(NULL) * src/rxvtlib.h.in 1.4: Cosmetic changes * autoconf/configure.in 1.114: Change AC_MSG_WARN messages to be nice to autoconf-2.5* 2001-07-24 Geoff C. Wing * src/xpm.c 1.48: delint a bit * src/rxvt.h 1.138: cosmetic fixup * src/screen.c 1.228: Cast XTextProperty value assignment * src/rxvt.h 1.137: only define __attribute__ if not defined * src/screen.c 1.227: ignore the other gettimeofday() return * doc/changes.txt 1.103: Update * src/Makefile.in 1.56: distribute .protos & depend indirectly upon *.extpro via .protos * src/screen.c 1.226: Delint more. Sanitise some variables 2001-07-22 Geoff C. Wing * src/screen.c 1.225: Delint a bit. Change some variable types 2001-07-20 Geoff C. Wing * src/strings.c 1.13: Don't rely on other rxvt C files (again) * src/test/Makefile.in 1.7: Parent directory protos target became .protos * src/logging.c 1.30: Disable writing an exit value to the SYSV utmp entry when we're initialising. This should only be enabled on specific systems if necessary * src/command.c 1.218: Cast first arg to vsprintf() * src/logging.c 1.29: If we're doing SYSV type utmp entries, don't go anywhere near any entries called ut_name * src/logging.c 1.28: Only write lastlog entries on good seeks 2001-07-19 Geoff C. Wing * src/screen.c 1.224: Small optimisation. Eliminate some common code * src/screen.c 1.223: Make some defines less context/variable dependent * src/logging.c 1.27: Only write BSD utmp's on good seeks * src/logging.c 1.26: Fix a missed conversion for QNX * src/init.c 1.83, src/main.c 1.157: Tidy up slightly 2001-07-17 Geoff C. Wing * autoconf/configure.in 1.113: Rest of previous fix * autoconf/configure.in 1.112: Add detect for /dev/ptc char dev and /dev/pts directory combo 2001-07-12 Geoff C. Wing * src/init.c 1.82, src/main.c 1.156, src/rxvt.h 1.136, src/screen.c 1.222: Clean up some more variable type usages * src/screen.c 1.221: Fix type for third arg of XChangeGC() * src/screen.c 1.220: Rearrange the refresh passes. Move pixel drop avoidance pass closer to main pass. Possible future integration as one pass 2001-07-11 Geoff C. Wing * src/Makefile.in 1.55: Redo proto building and deps so that multiple job builds work 2001-07-10 Geoff C. Wing * src/screen.c 1.219: Remove some indirection in rxvt_scr_insdel_chars() * src/screen.c 1.218: Fix pixel dropping avoidance for NO_BOLDFONT * doc/changes.txt 1.102: Update * src/screen.c 1.217: Combine forward and backward passes for overstrike pixel dropping removal into a single forward pass. Eliminate excessive processing of the same position. Make sure we don't cascade our updates even if it might, in some cases, ensure that bold areas work better at the expense of extra char updating. This optimisation should provide both speed and size improvements * doc/yodl/rxvtRef-csi.yo 1.3: Document additional save/restore cursor sequences 2001-07-09 Geoff C. Wing * doc/changes.txt 1.101: Update * src/command.c 1.217: Add `CSI s' & `CSI u' as extra save/restore cursor sequences. They are Private Use codes and gives compatibility with xterm and some other applications, suggested by Yong Lu * src/screen.c 1.216: Only speed optimise by rewriting the same character if we're not in a situation where we must clear that position; gives a nicer appearance since less flicker is likely * src/command.c 1.216: Remove a layer of indirection in main loop 2001-07-03 Geoff C. Wing * src/screen.c 1.215: Mini optimisations in rxvt_scr_refresh() * src/screen.c 1.214: Clarify rxvt_scr_refresh() argument name 2001-06-29 Geoff C. Wing * src/screen.c 1.213, src/feature.h 1.62, src/init.c 1.81, src/rxvt.h 1.135: Remove INEXPENSIVE_LOCAL_X_CALLS. Optimise it differently * src/command.c 1.215: Clean up some common handling in csi sequence processing Reformat comments a bit * src/command.c 1.214: Squish some debugging information 2001-06-27 Geoff C. Wing * src/main.c 1.155: Reuse const string directly 2001-06-25 Geoff C. Wing * doc/changes.txt 1.100: Update 2001-06-21 Geoff C. Wing * src/command.c 1.213: Work around a possible overflow situation reported by Samuel Dralet 2001-06-11 Geoff C. Wing * src/rxvt.h 1.134, src/rxvtlib.h.in 1.3, src/screen.c 1.212, src/xdefaults.c 1.88, README.configure 1.16, autoconf/acconfig.h 1.40, autoconf/configure.in 1.111, src/feature.h 1.61, src/init.c 1.80, src/main.c 1.154: Add lineSpace resource to provide ability for user specified line spacing between rows, requires --enable-linespace configure option. Invoked as "-lsp " or "--lineSpace ", from Kazutoshi Kubota (with minor XIM fix from Tomohiro KUBOTA ) 2001-06-01 Geoff C. Wing * src/defaultfont.c 1.7, src/defaultfont.h 1.5, src/feature.h 1.60, src/main.c 1.153, src/rxvt.h 1.133: Add (slightly modified) patches from Tomohiro KUBOTA to: - reintroduce a constant FONT0_IDX again to handle user specified encodings (noticed by Maxime Froment) - fix a typo "euckr" -> "kr" in defaultfont.c - allow Expose event for XIM preedit position update 2001-04-25 Geoff C. Wing * src/main.c 1.152, src/rxvt.c 1.4, src/rxvtlib.h.in 1.2: This should have been part of the major lib version bump. Presume that nobody's using it yet and sneak this in 2001-04-24 Geoff C. Wing * .cvsignore 1.3: Add ChangeLog * src/.cvsignore 1.3: Remove rsizes.h . Add rxvtlib.h * autoconf/Make.common.in 1.15, src/Makefile.in 1.54: Make installation directories. Install rxvtlib.h * src/Makefile.in 1.53: Have realclean target remove librxvt.h * src/screen.h 1.18, src/scrollbar.c 1.40, src/version.h 1.25, autoconf/configure.in 1.110, src/Makefile.in 1.52, src/command.c 1.212, src/init.c 1.79, src/main.c 1.151, src/menubar.c 1.52, src/rsizes.h.in 1.3, src/rxvt.c 1.3, src/rxvt.h 1.132, src/rxvtlib.h.in 1.1, src/screen.c 1.211: Startup of shared library build: . autoconf now creates src/rxvtlib.h which is the public header for the shared library. Many detected header files are now pushed into the first section of rxvtlib.h . integrated rsizes.h.in and screen.h into rxvtlib.h . removed rsizes.h.in and screen.h . added two prototypes to rxvtlib.h: rxvt_main_loop() & rxvt_init() . added a test to configure to check for inclusion of both and - usually needed on SunOS systems . shared library build no longer needs to enable everything * src/Makefile.in 1.51: Don't hide libtool actions * Makefile.in 1.12: Change what targets "clean" and "realclean" affect 2001-04-23 Geoff C. Wing * src/defaultfont.c 1.6, src/graphics.c 1.38, src/init.c 1.78, src/main.c 1.150, src/menubar.c 1.51, src/netdisp.c 1.15, src/rxvt.h 1.131, src/screen.c 1.210, src/strings.c 1.12, src/xdefaults.c 1.87, src/xpm.c 1.47, src/command.c 1.211: Provide wrappers for malloc/calloc/realloc. Don't be too nice on failure. Just do minimal cleanup and exit * doc/changes.txt 1.99: Update * src/main.c 1.149, src/screen.c 1.209: Don't necessarily clear selection on screen size change, noticed by Dominik Vogt 2001-04-22 Geoff C. Wing * src/rxvt.h 1.130: Need rxvt_hidden:egid/euid for HAVE_SETREUID too, noticed by Friedmund Lassmann 2001-04-20 Geoff C. Wing * doc/changes.txt 1.98: Update * autoconf/configure.in 1.109: Fix check of configure cache variable names, noticed by Venkatesh Krishnamurthi 2001-04-12 Geoff C. Wing * doc/LSM.in 1.11: See previous LSM.in log message * Makefile.in 1.11: Cleanup libtool too * src/version.h 1.24: Bump version to 2.7.6 (the previous commit of this file was a mistake) * doc/changes.txt 1.97: Update * README.configure 1.15: Note --enable-smart-resize * doc/TODO 1.12: One more for the list * doc/changes.txt 1.96: Update * src/screen.c 1.208: If someone requests our selection but we can't convert it fully to their locale then send it through unconverted rather than the possibly corrupted version - this may be a bit heavy handed (and need to be a define in the future), noticed by Marius Gedminas Also make sure to free the property returned, if appropriate 2001-04-09 Geoff C. Wing * doc/etc/rxvt.termcap 1.6: Clean up slightly. Add note on Home/End keys when LINUX_KEYS is defined in feature.h * src/main.c 1.148: Clean up previous slightly * doc/changes.txt 1.95: Update * src/main.c 1.147: Add a resizing method which may reposition the window depending upon its position about the centre point on the screen. Mostly from Marius Gedminas * autoconf/acconfig.h 1.39, autoconf/configure.in 1.108: Add --enable-smart-resize to provide movement with resizing if appropriate, from Marius Gedminas * doc/changes.txt 1.94: Update * src/rxvt.h 1.129, src/screen.c 1.207, src/xdefaults.c 1.86: Add -tcw (--tripleclickwords) (requiring --enable-frills). An alternative triple click selection system which makes a triple click extend the (double click) word selection to the end of a possibly-wrapped set of lines - with trailing blanks (and blank lines) removed from the selection. Originally suggested by Dominik Vogt 2001-04-07 Geoff C. Wing * src/rxvt.h 1.128: Be really strict in our types in some macros. Dividing a negative int by a short was causing problems on older OSF4.0 Make everything int32_t. Tracked down by James M. Lewis 2001-04-05 Geoff C. Wing * src/rxvt.h 1.127, src/screen.c 1.206, src/screen.h 1.17, src/init.c 1.77: Start a cleanup of variable types * src/command.c 1.210, src/defaultfont.c 1.5, src/graphics.c 1.37, src/init.c 1.76, src/main.c 1.146, src/menubar.c 1.50, src/netdisp.c 1.14, src/rxvt.h 1.126, src/screen.c 1.205, src/strings.c 1.11, src/xdefaults.c 1.85, src/xpm.c 1.46: Remove MALLOC/CALLOC/FREE. Their initial reason for existance - easier integration with Gray Watson's dmalloc package is not really relevant anymore. MALLOC is also defined under Irix6.5 in so we clashed there. Remove them rather than rename them 2001-04-04 Geoff C. Wing * src/feature.h 1.59, src/screen.c 1.204: Now that I've had my rant, change #ifndef SUPPORT_BROKEN_APPS_WHICH_RELY_ON_UNDEFINED_BW_BEHAVIOUR_AS_XTERM to #ifdef TERMCAP_HAS_BW but keep the same behaviour! * doc/changes.txt 1.92: Update * src/main.c 1.145, src/rxvt.h 1.125, src/version.h 1.23, src/xdefaults.c 1.84, src/defaultfont.c 1.4, src/defaultfont.h 1.4, src/feature.h 1.58, src/init.c 1.75: Add patches from Tomohiro KUBOTA for: - define MAX_NFONTS in feature.h instead of NFONTS, used only for determing the maximum allowed nfonts (number of fonts) - replace FONT0_IDX with auto-initialisation (along with nfonts) in rxvt_init_defaultfont(). - struct defaultfont now has additional members of nfonts and font0_idx, which are used to initialise the above * src/test/strings-memmove.c 1.4: Be nicer with what we include * src/command.c 1.209: Change DEBUG_X output 2001-04-03 Geoff C. Wing * src/test/gettty.c 1.5: Actually, we happily use waitpid() elsewhere so just use here * src/test/gettty.c 1.4: Add an extra bit for future - should we check for wait3() 2001-04-02 Geoff C. Wing * src/feature.h 1.57: Add a missing "#" for define * doc/changes.txt 1.91: Update * src/screen.c 1.203: Clean up backindex/forwardindex slightly * src/main.c 1.144, src/ptytty.c 1.3, src/screen.c 1.202, src/scrollbar-next.c 1.14, src/scrollbar-rxvt.c 1.8, src/scrollbar-xterm.c 1.9, src/scrollbar.c 1.39, src/strings.c 1.10, src/xpm.c 1.45, src/command.c 1.208, src/init.c 1.74, src/logging.c 1.25: Update my copyrights on stuff I've changed quite a bit recently * src/xpm.c 1.44: Code size optimisations via less indirection * src/xpm.c 1.43: Fix comments in new routine * src/xpm.c 1.42: Put common calculations for tiling into rxvt_pixmap_incr() * src/test/Makefile.in 1.6: Cleanup for GNU make and add a possible debug line * src/init.c 1.73, src/init.h 1.6, src/ptytty.c 1.2: Fixes to work again with STREAMS, from Paul Slootman * src/init.c 1.72: Mini cleanup * Makefile.in 1.10, src/test/Makefile.in 1.5: Add a test target in the top directory and allow tests without building rxvt * src/test/gettty.c 1.3: Let any argument make us less verbose * src/test/gettty.c 1.2: We shouldn't need to set I/O stuff here. Remove it * autoconf/configure.in 1.107, src/Makefile.in 1.50, src/init.c 1.71, src/protos.h 1.14, src/ptytty.c 1.1, src/rxvt.h 1.124, src/test/Makefile.in 1.4, src/test/gettty.c 1.1: Separate main pty/tty code into a (mainly) stand-alone file. Separate functionality into three parts: rxvt_get_pty(): obtain pty and associated slave device name rxvt_get_tty(): obtain tty (using slave device name) rxvt_control_tty(): associate /dev/tty with our tty On some platforms, rxvt_get_pty() will also handle the functionality of rxvt_get_tty() Add test/gettty (three t's) to check it * src/Makefile.in 1.49: Remove duplicate entry on LIBSRCS line 2001-04-01 Geoff C. Wing * src/init.c 1.70: Fix up opening with STREAMS. After we make sure that /dev/tty is unassociated with anything, reopen the slave to reassociate /dev/tty with us. Noticed by Paul Slootman * autoconf/configure.in 1.106: Fix some pty/tty tests, noticed by Paul Slootman 2001-03-31 Geoff C. Wing * src/menubar.c 1.49: Fix botch in 1.43 with update of ActiveMenu variable, noticed by Tomohiro KUBOTA * doc/yodl/rxvt.yo 1.6: Fix manual page name and section, from Tomohiro KUBOTA 2001-03-24 Geoff C. Wing * doc/yodl/rxvt-options.yo 1.15: Clean up slightly. Add some information about the new font choice method based upon locale. 2001-03-23 Geoff C. Wing * src/defaultfont.c 1.3, src/defaultfont.h 1.3, src/init.c 1.69, src/init.h 1.5, src/xdefaults.c 1.83, autoconf/acconfig.h 1.38, autoconf/configure.in 1.105: Reverse defined names for autodetected features. Define as HAVE_ for being present and working rather than NO_ for being absent or not working 2001-03-22 Geoff C. Wing * doc/changes.txt 1.90: Update * src/defaultfont.c 1.2, src/defaultfont.h 1.2: Add in all of my tinkering. * autoconf/acconfig.h 1.37, autoconf/configure.in 1.104, src/Makefile.in 1.48, src/defaultfont.c 1.1, src/defaultfont.h 1.1, src/feature.h 1.56, src/init.c 1.68, src/main.c 1.143, src/protos.h 1.13: Add a method to determine a default font from the user's locale settings, from Tomohiro KUBOTA 2001-03-21 Geoff C. Wing * src/screen.c 1.201: Clean up rxvt_scr_move_to() & rxvt_scr_page(). Common parts now in rxvt_scr_changeview() * src/feature.h 1.55: Note NO_PIXEL_DROPPING_AVOIDANCE define * src/feature.h 1.54: Add SCROLL_ON_HOMEEND_KEYS as per suggestion from Marius Gedminas * src/command.c 1.207: feature.h 2001-03-20 Geoff C. Wing * doc/changes.txt 1.89: Update 2001-03-19 Geoff C. Wing * src/init.c 1.67: Until we know why, leave fd's 4 & 7 open on Irix * src/screen.c 1.200: Optimise the number of X requests made during screen updates. This can produce a significant speed up in output (both on local and remote displays) and cut down on network traffic for remote displays 2001-03-16 Geoff C. Wing * src/init.c 1.66: Fix reversed comparison for display_is_local 2001-03-15 Geoff C. Wing * doc/etc/rxvt.termcap 1.5, doc/etc/rxvt.terminfo 1.4: Remove enter and exit insert mode codes (which, in conjuction with insert char codes, cause conflicts with really old programs). We don't have delete mode codes but we do have delete char codes so for symmetry keep insert/delete char/s codes. 2001-03-14 Geoff C. Wing * doc/etc/rxvt.termcap 1.4: Add cap for BCE (ut) and add some colour caps 2001-03-09 Geoff C. Wing * src/command.c 1.206: Add more colours via SGR escape sequence, bright colour codes 90-97 (fg) and 100-107 (bg) to match xterm, from Christian W. Zuckschwerdt * src/command.c 1.205, src/rxvt.h 1.123, src/screen.c 1.199: Change how we use bold/blink as bright colour modifiers. Previously the stored colour was changed. Now we never change the stored colour, only interpret differently upon retreival * src/screen.c 1.198: Reformat a couple of assert()s. Add assert() in rxvt_scr_page() since they are internally generated/passed arguments * src/command.c 1.204, src/feature.h 1.53: Allow CTRL (and/or Mod4) to set meta state for tab. Define CTRL_TAB_MAKES_META and/or MOD4_TAB_MAKES_META in feature.h, from Marius Gedminas 2001-03-07 Geoff C. Wing * src/init.c 1.65: Optimise rxvt_get_ourmods() slightly and improve readability 2001-03-06 Geoff C. Wing * src/command.c 1.203, src/init.c 1.64, src/xdefaults.c 1.82: Fix compilation with HOTKEY_CTRL or HOTKEY_META defined, noticed by Marius Gedminas * src/init.c 1.63, src/rxvt.h 1.122, src/screen.c 1.197: Change SWAP_IT() macro so that subroutines don't need to predeclare a temporary variable. Instead allocate a temporary variable limited to the lifetime of each. This is a very minor space/speed optimisation but may also be useful not having to check which #ifdef block each temporary variable belongs to 2001-03-05 Geoff C. Wing * src/screen.c 1.196: rxvt_scr_change_screen() can happen before everything else has caught up with nrow/ncol changes so use the real current allocation values, i.e. prev_nrow, prev_ncol 2001-03-02 Geoff C. Wing * src/xdefaults.c 1.81: Squash help stuff to fit 80 char terms * src/feature.h 1.52, src/xdefaults.c 1.80: We can't presume snprintf() so unless we can provide an alternative we must be stricter on path length of XAPPLOADDIRLOCALE 2001-03-01 Geoff C. Wing * src/protos.h 1.12, src/rxvt.h 1.121, src/screen.c 1.195, src/scrollbar-rxvt.c 1.7, src/scrollbar-xterm.c 1.8, src/xdefaults.c 1.79, src/command.c 1.202, src/graphics.c 1.36, src/main.c 1.142: Allow a build with "gcc -Wall -W -Werror" * Makefile.in 1.9: autoconf/ltconfig is gone 2001-02-27 Geoff C. Wing * src/xdefaults.c 1.78: Add usage option "strings" indicating alternative string functions * src/init.c 1.62: Add WM_LOCALE_NAME property to the window (if using XIM) * doc/changes.txt 1.88: Update * src/feature.h 1.51, src/init.c 1.61, src/rxvt.h 1.120, src/xdefaults.c 1.77: Add in loading of locale specific app-defaults from XAPPLOADDIRLOCALE (template) in feature.h - i.e. by default /usr/X11R6/lib/X11/$LC_CTYPE/app-defaults/Rxvt , from Maxime Froment (slightly modified by me) 2001-02-26 Geoff C. Wing * src/strings.c 1.9: Avoid a problem in memmove() when the length is too small * autoconf/configure.in 1.103: Be consistent in variable presentation * autoconf/configure.in 1.102: Be consistent: s#tty/pty#pty/tty# * src/strings.c 1.8: Missed a couple in last change * doc/changes.txt 1.87: Update * autoconf/ltmain.sh 1.3, autoconf/libtool.m4 1.3, autoconf/ltconfig 1.4: Update to more recent libtool version * doc/changes.txt 1.86: Update * src/strings.c 1.7: Change variable names in memmove() to make a bit clearer * src/strings.c 1.6: Optimise memset() slightly * src/strings.c 1.5: Optimise memmove() a bit more * src/strings.c 1.4: Optimise memmove() slightly * src/test/Makefile.in 1.3: Add dependency * src/strings.c 1.3: Fix up calculation in memmove() for backwards move * doc/changes.txt 1.85: Update * src/main.c 1.141: Fix placement with OverTheSpot input method, from Maxime Froment * doc/changes.txt 1.84: Update * src/logging.h 1.9, src/rxvt.h 1.119: Move some conditional defines from logging.h to rxvt.h so that it exists before we try to use it! * src/Makefile.in 1.47: Fix the arguments for installation of librxvt.la 2001-02-25 Geoff C. Wing * src/main.c 1.140: When performing difference calculations for colours in rxvt_rXAllocColor() we don't need to do a square root and there's no need to be float so be unsigned long instead. Faster and smaller 2001-02-22 Geoff C. Wing * INSTALL 1.10: Format and remove note about long gone RINT* and RUINT* * src/command.c 1.201, src/menubar.c 1.48: Fix a couple of signed/unsigned things * src/main.c 1.139: Initialise variable 2001-02-21 Geoff C. Wing * src/main.c 1.138, src/rxvt.h 1.118, src/xdefaults.c 1.76: Get/set global _rxvt_vars only via rxvt_get_r()/rxvt_set_r() 2001-02-16 Geoff C. Wing * doc/changes.txt 1.83: Update * src/init.c 1.60, src/main.c 1.137, src/rxvt.h 1.117: If we are passed a tty fd then expect the OS/library on that system to handle the chown()/chmod() of the device file and make certain that we don't revoke() it which would invalidate the fd 2001-02-14 Geoff C. Wing * src/Makefile.in 1.46: Add DEBUG_TTY to debug list * src/Makefile.in 1.45: Respect $(DESTDIR) for lib installation, noticed by Joshua Swink (yath@sourceforge) 2001-02-12 Geoff C. Wing * src/command.c 1.200, autoconf/acconfig.h 1.36, autoconf/configure.in 1.101: Fix configure for --enable-mousewheel, s/NO_MOUSE_WHEEL/MOUSE_WHEEL/ noticed by Ali Rahimi 2001-02-09 Geoff C. Wing * src/init.c 1.59: Fix 2nd arg of openpty() call, noticed by Bob McElrath 2001-02-07 Geoff C. Wing * src/command.c 1.199: Use KBUFSZ to pass sizeof kbuf[], from Maxime Froment * src/screen.c 1.194, src/init.c 1.58: Initialise multichar encoding_method properly, from Maxime Froment 2001-02-06 Geoff C. Wing * src/rxvt.h 1.116, src/screen.c 1.193: Fix up internal vt clearing from change in screen.c:129 * doc/changes.txt 1.82: Update * src/command.c 1.198, src/rxvt.h 1.115, src/xdefaults.c 1.75: Add -/+mcc (multi-character cursor hack) to provide double cursor movements for old programs which don't do it themselves. Mainly from Chuan-kai Lin and Brian Mays Modified to partially handle moving back across line boundaries * doc/changes.txt 1.81: Update * autoconf/configure.in 1.100: Be much more lax about pty/tty checks. Hopefully catch more OS's. May have to deal with more false positives. * autoconf/configure.in 1.99: Reorder some checks. libtool stuff seems to want CPP 2001-02-05 Geoff C. Wing * src/feature.h 1.50, src/init.c 1.57: Change our colour set to match the default xterm colour set 2001-01-30 Geoff C. Wing * doc/changes.txt 1.80: Update * doc/yodl/rxvtRef-privatemodes.yo 1.3: We have implemented 47. Document 1047 and 1048 * src/command.c 1.197: Add DEC private modes 1047 & 1048 for compatibility with recent xterm terminfo on debian (suggested by John E. Davis) though without support for ti/te munging code. * src/screen.c 1.192: Fix an error in sending selection which caused an abort, from Xianping Ge * src/xpm.c 1.41: Clean up. bgPixmap.[xy] can't be negative - scale_pixmap() handles that case - so don't handle it later for tiling. Add some type casts. 2001-01-29 Geoff C. Wing * src/command.c 1.196: If we're doing vertical XCopyArea()s then we must refresh the entire column on Expose events - in case multiple XCopyArea()s have occured (and have copied blank areas) before we get the Expose event (which point to the original area) 2000-12-16 Geoff C. Wing * doc/changes.txt 1.79: Add Chih-Wei Huang's name for 2000-12-11 Geoff C. Wing * src/xdefaults.c 1.74: Reformat the usage string. Also include the release date * src/xdefaults.c 1.73: Couple more outputs of compile options in help usage 2000-12-09 Geoff C. Wing * doc/changes.txt 1.78: Update * src/main.c 1.136: Fix a case where we were dying due to bad setting of multichar fonts - especially with 'noenc' encoding, noticed by Mark White 2000-11-19 Geoff C. Wing * doc/changes.txt 1.77: Update * autoconf/acconfig.h 1.35, autoconf/configure.in 1.98, src/feature.h 1.49: Move PREFER_24BIT from feature.h to configure (--enable-24bit) but set off by default * src/graphics.c 1.35, src/init.c 1.56, src/main.c 1.135, src/menubar.c 1.47, src/rxvt.h 1.114, src/screen.c 1.191, src/scrollbar-next.c 1.13, src/xpm.c 1.40: Since we may assign to Xdepth,Xcmap,Xvisual rename as s/Xdepth()/XDEPTH/;s/Xcmap()/XCMAP/;s/Xvisual()/XVISUAL/ 2000-11-18 Geoff C. Wing * doc/changes.txt 1.76: Update * src/xpm.c 1.39, src/init.c 1.55, src/main.c 1.134, src/menubar.c 1.46, src/screen.c 1.190, src/scrollbar-next.c 1.12, src/graphics.c 1.34, src/rxvt.h 1.113: Make sure we still build & run when PREFER_24BIT is not defined 2000-11-17 Geoff C. Wing * src/command.c 1.195: Small cleanup of check_our_parents() * src/command.c 1.194: Cleanup/format the button press routine slightly * src/command.h 1.24, src/feature.h 1.48: Move MOUSE_THRESHOLD define from command.h to feature.h * src/command.c 1.193: Make sure we only pull off ConfigureNotify events on the parent window. For certain systems where xconfigure.event != xconfigure.window even though we do StructureNotify not SubstructureNotify. * doc/changes.txt 1.75: Update * src/screen.c 1.189: If we move the cursor then unset the WrapNext flag, noticed by witek@mat.uni.torun.pl 2000-11-14 Geoff C. Wing * doc/TODO 1.11: Update * autoconf/Make.common.in 1.14: Don't combine strip functinality in INSTALL_PROGRAM, from Tom Bates 2000-11-13 Geoff C. Wing * doc/changes.txt 1.73: Update * src/xdefaults.c 1.72, src/command.c 1.192, src/init.c 1.54, src/main.c 1.133, src/menubar.c 1.45, src/rxvt.h 1.112, src/screen.c 1.188, src/scrollbar.c 1.38: Major reorganisation of window size calculations: the sizes of all windows are now calculated properly in one spot. Calculate sizes of all windows before creation and create at the correct size - don't presume we'll get a ConfigureNotify to clean up for us. Major reorganisation of window size and placement manipulation: all major manipulations go through the one routine. A couple of other minor cleanups and compile fixes. 2000-11-11 Geoff C. Wing * src/screen.c 1.187: Do the check for previous via RS_multi1, even though we don't use RS_multi0 (yet?) * src/screen.c 1.186: Put in the second last-ditch effort to remove corrupt multichars * src/screen.c 1.185: Minor rearrangement and cleanup 2000-11-10 Geoff C. Wing * src/command.c 1.191: Don't presume the event return structure is left alone upon a failed XCheckTypedWindowEvent() call - especially needed for a specific cygwin/win32 setup 2000-11-01 Geoff C. Wing * src/command.c 1.190: Mini optimisation - use select() return value immediately, from Tijs Michels 2000-10-30 Geoff C. Wing * src/init.c 1.53: Reverse 1.50->1.51: it was totally wrong 2000-10-28 Geoff C. Wing * doc/changes.txt 1.72: Update * src/init.c 1.52: Imitate xterm setting of icon/title name with -e argument, noticed by John Waggenspack 2000-10-25 Geoff C. Wing * doc/changes.txt 1.71: Update * src/init.c 1.51: We get the current locale by passing NULL, not an empty string 2000-10-22 Geoff C. Wing * src/logging.c 1.24, src/screen.c 1.184: Don't pass unneeded vars to update_lastlog() and blank_line() * doc/yodl/rxvt-options.yo 1.14, doc/yodl/rxvt-resources.yo 1.24: Add notes about a couple of resource limits * src/command.c 1.189, src/graphics.c 1.33, src/init.c 1.50, src/main.c 1.132, src/menubar.c 1.44, src/rxvt.h 1.111, src/screen.c 1.183, src/xdefaults.c 1.71, src/xpm.c 1.38: Change several types from signed to unsigned. Fix signed/unsigned comparisons and other different sized type comparisons. Bound saveLines to limit of type. Bound internal/external border widths to 100 (arbitrary limit). Fix scrollbar dragging calculation 2000-10-19 Geoff C. Wing * src/scrollbar-next.c 1.11: Fix the last fix 2000-10-18 Geoff C. Wing * src/command.c 1.188: Move large button processing sections out of X handling subroutine into their own subroutines * src/scrollbar-next.c 1.10: Fix conditionals on drawing code * src/screen.c 1.182: Clean up scr_backindex and scr_forwardindex to use existing routines rather than doing stuff manually * src/screen.c 1.181: Rearrange selection_check() 2000-10-17 Geoff C. Wing * doc/changes.txt 1.70: Update * src/screen.c 1.180: Fix up the last change of reverse video integration. Reverse video via an escape sequence should act as if the reverse video option was given at invocation - with one difference being that a terminal reset sequence will also reset the reverse video state * doc/changes.txt 1.69: Update * src/logging.c 1.23: Remove some indirection * doc/changes.txt 1.68: Update * doc/TODO 1.10: Did one * src/screen.c 1.179: Integrate reverse video mode into screen refresh routine * src/graphics/.cvsignore 1.3: Add some more stuff to ignore * src/init.c 1.49: s/strchr/STRCHR/ * src/init.c 1.48, src/misc.c 1.37: s/strdup/STRDUP/ * doc/changes.txt 1.67: Update * src/graphics.c 1.32: Fix size calculations better - window size needed to be adjusted and a couple of other offsets fixed * src/graphics/Makefile.in 1.5: Use the COMPILE variable from Makefile.common so we pull in the proper include directories - especially for X11, and add in the parent directory manually * doc/changes.txt 1.66: Update * src/graphics/qplot.c 1.6: Make some large allocations happen dynamically via malloc rather than relying on initial compiler allocation * src/graphics/grxlib.c 1.5: Include rxvt headers including termios stuff (even though it includes an excess of other stuff) * src/graphics/grxlib.c 1.4, src/graphics/qplot.c 1.5: Pass through indent * doc/changes.txt 1.65: Update * src/graphics.c 1.31: Initial fixes for text placement in graphics mode 2000-10-13 Geoff C. Wing * src/init.c 1.47: The default icon name is the application name, noticed by Jeremy C. Reed 2000-10-12 Geoff C. Wing * src/command.c 1.187: When we've got a really fast stream of ConfigureNotify events, ignore until the last one - this also usually ignores events which get sent back to us from configures which we did ourself 2000-10-08 Geoff C. Wing * src/init.c 1.46: Make sure we don't push STREAMS stuff until after any last close and reopen of the tty. G/C some other stuff so it won't be reactivated 2000-10-04 Geoff C. Wing * src/command.c 1.186: Fix comment, from Tijs Michels * src/screen.c 1.178: Fix some types used. Also make sure we cast some types so that they don't get optimised out (or otherwise ignored). And add a couple of proto declarations. 2000-10-01 Geoff C. Wing * doc/changes.txt 1.64: Update * src/rxvt.h 1.110: Fix build with XTERM_COLOR_CHANGE undefined, noticed by John Waggenspack 2000-09-29 Geoff C. Wing * src/screen.c 1.177: Remove a bogon from debug output 2000-09-28 Geoff C. Wing * src/Makefile.in 1.44: Make sure protos exist with parallel builds 2000-09-27 Geoff C. Wing * src/menubar.c 1.43: Remove some indirection and other cleanup 2000-09-26 Geoff C. Wing * src/screen.c 1.176: Style fix * src/screen.c 1.175: Formatting and style fixes * src/command.c 1.185: Remove some indirection and cleanup * src/command.c 1.184: G/C and remove some indirection * src/command.c 1.183, src/init.c 1.45: Remove some layers of indirection * src/command.c 1.182: Move tt_printf() routine. Remove layers of indirection from tt_write() * src/xdefaults.c 1.70: Make usagestring local to here * src/xdefaults.c 1.69: Clean up usage display 2000-09-19 Geoff C. Wing * doc/LSM.in 1.10: Update tar.gz size * src/version.h 1.22: Bump version to 2.7.5 * src/init.c 1.44, src/main.c 1.131: Try to kluge around some Solaris X implmentations * doc/TODO 1.9: Update things in progress and patches not yet merged in, and let people know they've not been forgotten * doc/changes.txt 1.63: Update * src/Makefile.in 1.43: Clean some proto stuff for clean target * src/command.c 1.181: In InheritPixmap transparency, before we stomp on the WM parent windows, give the WM a bit of time to do its own stuff with them. fvwm2.2.2 seemed to be a bit delayed setting the window backgrounds so give it time to complete (before we go behind its back), noticed by Hubert Feyrer * README.configure 1.14: Add a note about --enable-strings * src/init.c 1.43: s/strlen/STRLEN/ * src/screen.c 1.174: Update comment * doc/changes.txt 1.62: Update * src/screen.c 1.173: Add in initial support for INCR transfers (see ICCCM2.0 section 2.7.2), not yet fully conformant, from Paul Sheer 2000-09-18 Geoff C. Wing * src/feature.h 1.47, src/init.c 1.42: Revert a change from 2.21*: we want GraphicsExpose events even at the cost of NoExpose events (which we happily ignore). Fixes updates on NeXT scrollbars and slow link support - and nearly anything else that does XCopyArea() 2000-09-17 Geoff C. Wing * src/feature.h 1.46: Disable CopyArea until I fix it * src/misc.c 1.36: Fix comment * src/init.c 1.41, src/main.c 1.130, src/scrollbar-next.c 1.9: Clean up colour allocation routine. Don't pass unnecessary stuff * src/logging.c 1.22: Make sure RXVT_LASTLOG_FILE is known before trying to use it 2000-09-16 Geoff C. Wing * doc/yodl/rxvt-resources.yo 1.23: Basic text for answerbackString resource * doc/changes.txt 1.61: Update * src/command.c 1.180, src/init.c 1.40, src/rxvt.h 1.109, src/xdefaults.c 1.68: Add in settable answerbackString reply to ENQ 2000-09-15 Geoff C. Wing * README.configure 1.13: Note about --enable-everything * INSTALL 1.9: Note about CVS versions * doc/TODO 1.8: Note changes in pipeline for reverse video and inverse rendition stuff * src/screen.c 1.172: Make sure reverse video mode reverses everything. 2000-09-14 Geoff C. Wing * src/screen.c 1.171: Make blank_line() and blank_screen_mem() more consistent * src/screen.c 1.170: scr_E() should be smaller rather than faster * src/screen.c 1.169: Nits * src/screen.c 1.168: Combine common loops in scroll_text() 2000-09-13 Geoff C. Wing * autoconf/configure.in 1.97: Fix --enable-old-selection * src/screen.c 1.167: Fix 1.165: proper #ifdef sequence 2000-09-12 Geoff C. Wing * doc/yodl/rxvtRef-xterm.yo 1.5, doc/yodl/rxvtRef.yo 1.6: Add documentation for colour change OSCs added by Christian W. Zuckschwerdt * doc/changes.txt 1.60: Update * src/command.c 1.179, src/main.c 1.129, src/rxvt.h 1.108: Add XTerm OSC colour changing extensions, from Christian W. Zuckschwerdt * src/init.c 1.39, src/main.c 1.128, src/rxvt.h 1.107, src/screen.c 1.166: Keep a record of which PixColors are set in a variable instead of trying to probe the resource in case it has changed and the resource was not set * src/Makefile.in 1.42: Make sure new scrollbar files get distributed * src/screen.c 1.165: Check for #define before using bgPixmap or am_tranparent vars 2000-09-11 Geoff C. Wing * src/screen.c 1.164: Whoops, forgot to turn off CopyArea stuff when we have a pixmap * src/init.c 1.38: Clean up initialisation of variables * src/screen.c 1.163: Fix outline cursor check for CopyArea. 2000-09-08 Geoff C. Wing * src/screen.c 1.162: Add a define to allow an unset cursor colour to be the current rendition colour instead of the default foreground/ background colour * src/screen.c 1.161: Change CopyArea nits logic slightly * autoconf/configure.in 1.96: Set static libraries on since they'll default to on if shared libraries are off. * src/screen.c 1.160: Clean up scr_backspace. Also, make some unconditional effect statements unconditional * src/init.c 1.37: Just calloc() instead of malloc() and zeroing * src/rxvt.h 1.106: Fix comment on colours * src/main.c 1.127, src/rxvt.h 1.105, src/screen.c 1.159: No CopyArea on screen or font size change 2000-09-07 Geoff C. Wing * src/feature.h 1.45: Provide NO_SLOW_LINK_SUPPORT define to allow removal of XCopyArea() stuff in screen updates * src/rxvt.h 1.104: Fix a macro causing scrollbars not to happen if not using rxvt scrollbars * src/command.c 1.178: Remove unused variable * src/main.c 1.126: Formatting nits 2000-09-06 Geoff C. Wing * doc/changes.txt 1.59: Update * src/screen.c 1.158: Don't copy the row with an outline cursor in it. Just avoid it. * doc/changes.txt 1.58: Update * src/screen.c 1.157: If we're in reverse video mode we need to make sure we clear lines with rvid set. * src/command.c 1.177: Handle CSI parameters better, including omitted parameters * src/screen.c 1.156: Optimise by variable type choice * src/screen.c 1.155: Minor optimisations and nits * src/screen.c 1.154: Add comment * src/screen.c 1.153: Fix a glitch using continue in for() * src/screen.c 1.152: In XCopyArea() stuff, make sure we don't copy too many rows. Also copy full width. Still to do: GraphicsExpose stuff. 2000-09-05 Geoff C. Wing * doc/changes.txt 1.57: Update * src/rxvt.h 1.103, src/screen.c 1.151: Add back in basic XCopyArea() support on screen display, useful for slow links. * src/screen.c 1.150: Remove not really necessary variable * src/feature.h 1.44: Reverse two items which slipped in in the last commit. * src/command.c 1.176: Just write out answer strings, don't parse them as ENQ will soon be settable. * src/command.c 1.175: Spello 2000-08-29 Geoff C. Wing * src/command.c 1.174, src/init.c 1.36, src/menubar.c 1.42, src/misc.c 1.35, src/rxvt.h 1.102: Use C0 set terminology. From ISO/IEC 6429:1992(E) * src/command.c 1.173: Fix a couple of errors in CSI defaults. Start of Xref to ISO/IEC 6429:1992(E) entries. 2000-08-25 Geoff C. Wing * src/command.c 1.172: Provide more generic parsing up to ST 2000-08-24 Geoff C. Wing * doc/changes.txt 1.56: Update * src/screen.c 1.149: Don't clear new lines with any base attribute information, noticed by Brian Mays 2000-08-23 Geoff C. Wing * src/screen.c 1.148: Formatting nits * doc/changes.txt 1.55: Update * src/feature.h 1.43, src/init.c 1.35, src/main.c 1.125, src/rxvt.h 1.101, src/screen.c 1.147, src/xdefaults.c 1.67: Merge NO_BOLDUNDERLINE and NO_REVERSE_VIDEO_COLOR into NO_BOLD_UNDERLINE_REVERSE 2000-08-22 Geoff C. Wing * src/screen.c 1.146: Add check back in: don't use RV colour as background when it would be the same as the foreground colour * doc/yodl/rxvt-resources.yo 1.22: Document colorRV * doc/changes.txt 1.54: Update * src/feature.h 1.42, src/init.c 1.34, src/rxvt.h 1.100, src/screen.c 1.145, src/xdefaults.c 1.66: Add ability to set reverse video colour, from Thomas Woerner 2000-08-17 Geoff C. Wing * doc/yodl/rxvt-options.yo 1.13: Note -b is compile dependant 2000-08-15 Geoff C. Wing * src/command.c 1.171, src/init.c 1.33: Fix Offix atom names. Don't presume that atom _XROOTPMAP_ID exists at startup. 2000-08-11 Geoff C. Wing * doc/changes.txt 1.53: Update * rclock/rclock.1.in 1.3, rclock/rclock.c 1.4: Add -mailfile option to override MAIL env. var. as location of mail, from Matthew W. Roberts 2000-08-07 Geoff C. Wing * doc/changes.txt 1.52: Update * src/command.c 1.170: If we're not mapped then don't timeout on the select() - note that want_refresh won't be reset below since scr_refresh() will return early. Noticed by Tore Bjorkeli 2000-08-04 Geoff C. Wing * src/main.c 1.124, src/scrollbar.c 1.37, src/xdefaults.c 1.65: Remove trailing whitespace 2000-07-27 Geoff C. Wing * src/graphics.c 1.30, src/rxvtgrx.h 1.5: Move the graphics structures out of the common header lest it cause problems should other programs include it. * src/graphics/qplot.c 1.4: Don't strcmp() on a NULL, from Torsten Hilgenberg 2000-07-26 Geoff C. Wing * src/init.c 1.32, src/main.c 1.123, src/rxvt.h 1.99: Move items from rxvt_privileges() into big struct * src/graphics.c 1.29, src/init.c 1.31, src/rxvt.h 1.98: Move graphics vars into big struct * doc/changes.txt 1.51: Update * src/init.c 1.30: Fix Meta detection, overriding Alt 2000-07-25 Geoff C. Wing * src/rxvt.h 1.97, src/scrollbar.c 1.36: Fix for no-scrollbar build * autoconf/configure.in 1.95: Pull in in wtmp/x & lastlog checks * autoconf/configure.in 1.94: Find a real awk, noticed by Paul D. Smith 2000-07-24 Geoff C. Wing * autoconf/Make.common.in 1.13, src/Makefile.in 1.41: Fix alternative directory build * src/init.c 1.29, src/rxvt.h 1.96: Fix preproc. #if stuffup, from Paul D. Smith * src/main.c 1.122, src/rxvt.h 1.95: Move two more items to rxvt big struct. Clean up set_colorfgbg() * src/init.c 1.28, src/main.c 1.121, src/scrollbar-next.c 1.8: Accumulate colour parsing and allocation into central location. * src/scrollbar.c 1.35: Small cleanup * src/feature.h 1.41: Add SCROLL_ON_NO_SECONDARY used in screen.c when compiled with --disable-swapscreen 2000-07-23 Geoff C. Wing * src/graphics.c 1.28, src/rxvt.h 1.94, src/rxvtgrx.h 1.4: Move rxvtgrx.h out of rxvt.h. Move graphics structs into rxvtgrx.h * src/graphics.c 1.27, src/rxvt.h 1.93: Start cleaning up rxvt.h and move some stuff back into graphics.c * src/rxvt.h 1.92, src/scrollbar.c 1.34: One central update caller for scrollbar * src/screen.c 1.144: Remove unused variable * src/rxvt.h 1.91: Position. Position. Position * src/menubar.c 1.41: Fix botch in previous * src/init.c 1.27, src/menubar.c 1.40, src/menubar.h 1.5, src/rxvt.h 1.90: Move the rest of menubar stuff into big struct * src/init.c 1.26, src/menubar.c 1.39, src/rxvt.h 1.89, src/scrollbar-next.c 1.7, src/scrollbar-rxvt.c 1.6, src/scrollbar-xterm.c 1.7: Merge some more common code. Initialise scrollbars slightly differently so that in future scrollbar changing (in an instance) may be allowable. * src/init.c 1.25, src/menubar.c 1.38, src/rxvt.h 1.88, src/scrollbar-rxvt.c 1.5: Move some common code into init. Move some stuff from menubar into big struct. 2000-07-20 Geoff C. Wing * src/init.c 1.24, src/rxvt.h 1.87: Make exposed PixColors useful by making size available 2000-07-19 Geoff C. Wing * src/rxvt.h 1.86: Fix up preprocess for scrollbars 2000-07-16 Geoff C. Wing * src/xpm.c 1.37, src/command.c 1.169: Formatting nit * src/screen.c 1.143: Clean up. Add comment * src/screen.c 1.142: Always remove underline in blanking 2000-07-15 Geoff C. Wing * src/screen.c 1.141: Minor optimisations. Add some more debug checks. * src/screen.c 1.140: Only blank line in scroll_text on spec==0 2000-07-14 Geoff C. Wing * src/screen.c 1.139: Cleaning rounds * src/screen.c 1.138: Make sure we update the screen if we extend down to no selection * src/screen.c 1.137, src/command.c 1.168, src/graphics.c 1.26, src/main.c 1.120, src/menubar.c 1.37, src/scrollbar-next.c 1.6: Formatting. Unexpand tabs. * doc/changes.txt 1.47: Update * src/screen.c 1.136: Minor cleanup * src/command.c 1.167, src/rxvt.h 1.85, src/screen.c 1.135: Remove rxvt_t's buf_tlen. Replace rxvt_scr_scroll_lines() invocation with rxvt_scroll_lines(). Blank lines at scroll stage rather than after; all replaced lines are blanked out. * doc/changes.txt 1.46: Update * src/screen.c 1.134: Fix bug where newly allocated lines were keeping to much rendition information, from/via Brian Mays 2000-07-13 Geoff C. Wing * src/scrollbar-rxvt.c 1.4, src/scrollbar-xterm.c 1.6, src/scrollbar.c 1.33: Move common check into scrollbar.c * src/misc.c 1.34: Size optimise by combining loops. * src/scrollbar.c 1.32: Fix rxvt scrollbar height calculation. Formatting nit (again). * src/scrollbar.c 1.31: Formatting nit * src/init.c 1.23: Initialise changed rxvt_t member. Formatting nit. * src/main.c 1.119: Fix X error handler return type * src/rxvt.h 1.84: Don't conditionally build items in rxvt_t, again * src/command.c 1.166: Fix function name * src/rxvt.h 1.83: Don't conditionally build items in rxvt_t * autoconf/configure.in 1.93: Pull in in utmp/x checks * src/init.c 1.22, src/main.c 1.118, src/rxvt.h 1.82, src/screen.c 1.133: Decrease some variable sizes in rxvt_hidden struct. Rearrange rxvt_privileged_ttydev() a bit & move some code into init area. 2000-07-12 Geoff C. Wing * src/init.c 1.21: Use return value for isastream() * src/command.c 1.165: Fix wrong Pixmap initialisation * autoconf/configure.in 1.92, src/init.c 1.20: Add isastream() configure check and use it 2000-07-10 Geoff C. Wing * src/command.c 1.164: Fix comment 2000-07-09 Geoff C. Wing * README.configure 1.12: Update to current configure status. * autoconf/configure.in 1.91: Make scrollbars get properly reported in `module' list. * src/scrollbar.c 1.30: Fix pasto 2000-07-08 Geoff C. Wing * src/command.c 1.163, src/main.c 1.117: allowedxerror: 0 => no allowed errors, -1 => allowed errors, other => already had allowed error, no more allowed * autoconf/configure.in 1.90: Clean up and add a couple of notes w.r.t. --enable-* 2000-07-07 Geoff C. Wing * src/command.c 1.162, src/init.c 1.19, src/main.c 1.116, src/rxvt.h 1.81: Add provision to allow expected X errors for specific calls so we can cleanly continue, instead of aborting. * src/command.c 1.161, src/init.c 1.18, src/main.c 1.115, src/rxvt.h 1.80: Remove CNQueue stuff. It wasn't quite right. Better handled with delayed screen updates and upcoming changes to allocations in screen memory handling. * doc/changes.txt 1.45: Update * src/command.c 1.160, src/init.c 1.17, src/main.c 1.114, src/rxvt.h 1.79, src/screen.c 1.132, src/xpm.c 1.36: Add initial stage of copy root pixmap transparency. Slower and more memory consuming but does not interfere with parent windows which may not be empty. Requires cooperation from programs which set the root pixmap. 2000-07-05 Geoff C. Wing * doc/yodl/rxvtRef-menubar.yo 1.4, doc/yodl/rxvtRef-xpm.yo 1.7, doc/yodl/rxvtRef-xterm.yo 1.4: Note ST as terminator for OSC sequences. List 8-bit & 7-bit ST as well as backward compatible BEL. * doc/yodl/rxvt-options.yo 1.12, doc/yodl/rxvt-resources.yo 1.21: Note help commands * doc/changes.txt 1.44: Update * doc/yodl/rxvt-options.yo 1.11: List arg to -xrm differently * doc/changes.txt 1.42: Update * doc/yodl/rxvt-resources.yo 1.20: Synchronise with current state. Note scrollBar_right, scrollBar_floating, scrollTtyOutput, scrollTtyKeypress, preeditType, inputMethod, modifier. * doc/yodl/rxvt-options.yo 1.10: Synchronise with current state. Note -tr, -ic, -pt, -im, -mod, -xrm. * src/xdefaults.c 1.64: Usage for compile-time frills * src/rxvt.h 1.78, src/xdefaults.c 1.63, src/command.c 1.159, src/init.c 1.16: s/scrollKeypress/scrollTtyKeypress/ to match user keyword * src/command.c 1.158: Make sure we obey scrollTtyKeypress for keys and force a screen update if needed, noticed by Reuben Thomas 2000-06-12 Geoff C. Wing * src/main.c 1.113, src/init.c 1.15, src/rxvt.h 1.77: Move a couple more into big struct * src/scrollbar-next.c 1.5, src/scrollbar-rxvt.c 1.3, src/scrollbar-xterm.c 1.5, src/rxvt.h 1.76: Move variables from scrollbar modules into the big struct. 2000-06-08 Geoff C. Wing * src/xdefaults.c 1.62: Make xrm an INFO * src/xdefaults.c 1.61: Allow -xrm "string" to be silently passed through. Original version by Christian W. Zuckschwerdt , from report by Chris Green 2000-06-04 Geoff C. Wing * src/logging.c 1.21: Make sure we're using the real wtmp file * src/main.c 1.112: Make sure limit is applied * src/feature.h 1.40, src/main.c 1.111: Add some arbitrary limits (defined in feature.h) to geometry size. Limits are in terms of columns and rows, not pixel width and height. 2000-05-30 Geoff C. Wing * src/logging.c 1.20: Fix reference to moved variable 2000-05-20 Oezguer Kesim * doc/rxvtRef-toc.html 1.3, doc/yodl/rxvt.yo 1.5: Fixed old references to babayaga.math.fu-berlin.de in the documentation. 2000-05-19 Geoff C. Wing * src/init.c 1.14, src/main.c 1.110, src/rxvt.h 1.75: Move a couple of vars into the hidden struct * src/init.c 1.13, src/rxvt.h 1.74, src/scrollbar.c 1.29: Deglobify some scrollbar.c variables * src/scrollbar-xterm.c 1.4: constify 2000-05-17 Geoff C. Wing * src/screen.c 1.131: Fix unsigned usage in assert() * src/command.c 1.157: Replace/Insert mode change needs argument == 4 2000-05-04 Geoff C. Wing * src/command.c 1.156: Pedantic/Traditional 2000-05-03 Geoff C. Wing * Makefile.in 1.8, doc/Makefile.in 1.20, rclock/Makefile.in 1.4, src/Makefile.in 1.40, src/graphics/Makefile.in 1.4, src/test/Makefile.in 1.2: Add target cleandir, same as realclean * src/Makefile.in 1.39: Make LINK like COMPILE. General cleanup * autoconf/Make.common.in 1.12: Make LINK like COMPILE * autoconf/configure.in 1.89: Don't make static library by default, either. 2000-05-01 Geoff C. Wing * doc/etc/rxvt.termcap 1.3: Add "ut" (BCE) * src/scrollbar-xterm.c 1.3: Pedantic * src/command.c 1.155, src/init.c 1.12, src/menubar.c 1.36, src/misc.c 1.33, src/rxvt.h 1.73, src/xpm.c 1.35: Make sure OSC can handle ST (7bit and 8bit) terminators. Pass which terminator was used through providing for future OSC which give direct responses. * src/scrollbar-next.c 1.4: Pedantic 2000-04-28 Geoff C. Wing * src/screen.c 1.130: Quiet pedantic warning * src/command.c 1.154: Be a nice type in our CSI defaults array 2000-04-22 Geoff C. Wing * src/screen.c 1.129: Fix up internal vt border handling, possibly temporary fix 2000-04-17 Geoff C. Wing * autoconf/ltconfig 1.3: Add in my NetBSD fix 2000-04-16 Geoff C. Wing * src/Makefile.in 1.38: Expose proto making * src/Makefile.in 1.37: Make sure rxvt.{o,lo} gets rebuilt if needed. Tidy dependency list. * src/command.c 1.153: Make sure our key mapping of certain character classes gets used, from Samoylov Olleg * .prebuild 1.3: Show what .prebuild is doing * autoconf/configure.in 1.88: Check linking -rpath before -R Hack at XPM_LIBS flags as well. * src/Makefile.in 1.36: don't output libtool line since libtool provides its own output * src/rxvt.h 1.72: Make sure we have necessary defines * src/xdefaults.c 1.60: Fix up from merge * src/scrollbar-next.c 1.3: Remove unused variable * src/init.c 1.11: Fix up from merge * src/graphics/.cvsignore 1.2, src/screen.h 1.16, src/scrollbar-next.c 1.2, src/scrollbar-rxvt.c 1.2, src/scrollbar-xterm.c 1.2, src/scrollbar.c 1.28, src/test/.cvsignore 1.2, src/version.h 1.21, src/xdefaults.c 1.59, src/xpm.c 1.34, .cvsignore 1.2, Makefile.in 1.7, autoconf/.cvsignore 1.2, autoconf/Make.common.in 1.11, autoconf/acconfig.h 1.34, autoconf/aclocal.m4 1.3, autoconf/config.guess 1.2, autoconf/config.sub 1.2, autoconf/configure.in 1.87, autoconf/libtool.m4 1.2, autoconf/ltconfig 1.2, autoconf/ltmain.sh 1.2, autoconf/xpm.m4 1.2, doc/.cvsignore 1.2, doc/Makefile.in 1.19, doc/yodl/.cvsignore 1.2, doc/yodl/rxvt-resources.yo 1.19, rclock/.cvsignore 1.2, src/.cvsignore 1.2, src/.indent.pro 1.3, src/Makefile.in 1.35, src/command.c 1.152, src/command.h 1.23, src/feature.h 1.39, src/graphics.c 1.25, src/init.c 1.10, src/init.h 1.4, src/logging.c 1.19, src/logging.h 1.8, src/main.c 1.109, src/makeextprotos-awk 1.7, src/makeintprotos-awk 1.7, src/menubar.c 1.35, src/misc.c 1.32, src/netdisp.c 1.13, src/protos.h 1.11, src/rxvt.c 1.2, src/rxvt.h 1.71, src/screen.c 1.128: Merge branch "librxvt" 2000-04-14 Geoff C. Wing * src/test/.cvsignore 1.1, src/graphics/.cvsignore 1.1, rclock/.cvsignore 1.1, doc/yodl/.cvsignore 1.1, src/.cvsignore 1.1, doc/.cvsignore 1.1: New file. 2000-04-13 Geoff C. Wing * autoconf/.cvsignore 1.1: New file. * .cvsignore 1.1: Merge trunk * src/scrollbar-next.c 1.1, src/scrollbar-rxvt.c 1.1, src/scrollbar-xterm.c 1.1: New file. 2000-04-11 Geoff C. Wing * autoconf/configure.in 1.86: Do previous properly * autoconf/configure.in 1.85: Shortcut CYGWIN detection 2000-04-10 Geoff C. Wing * autoconf/config.h.in 1.42, Makefile 1.22, configure 1.81: Use .prebuild to make configure autoconf/config.h.in Use configure to make Makefile * .prebuild 1.2: Make special generated files for the build process. * doc/changes.txt 1.41: Update * .prebuild 1.1: New file. * src/init.h 1.3: Don't pull in a couple of headers for CYGWIN * src/init.c 1.9: If we're transparent then use the depth of the root window as the depth for our windows, noticed by Tim Phipps 2000-04-01 Geoff C. Wing * src/xdefaults.c 1.58: Spew compile information in one string. 2000-03-27 Geoff C. Wing * src/main.c 1.108: Pull in termios.h, needed on SunOS and SCO for functions moved from command.c * doc/Makefile.in 1.18: Forgot to distribute menu/rxvt.zh-menu * doc/etc/rxvt.terminfo 1.3: Move sgr0 definition from rxvt into rxvt-basic, from Tijs Michels 2000-03-26 Geoff C. Wing * Makefile 1.21: Regenerate * src/version.h 1.20: Bump version to 2.7.3 * doc/changes.txt 1.40: Update * configure 1.80, autoconf/config.h.in 1.41: Regenerate * src/init.c 1.8, autoconf/acconfig.h 1.33, autoconf/configure.in 1.84: Add basic support for openpty(3) which should be used for Alpha platforms. Other platforms which have this in the base libs will also use this by default. Those with it in a separate lib won't (e.g. NetBSD has it in libutil) 2000-03-16 Geoff C. Wing * autoconf/libtool.m4 1.1, autoconf/xpm.m4 1.1, autoconf/ltmain.sh 1.1, autoconf/ltconfig 1.1, autoconf/config.guess 1.1, autoconf/config.sub 1.1, src/rxvt.c 1.1: New file. 2000-03-12 Geoff C. Wing * rclock/rclock.c 1.3: Basic argument checking so we don't dump when required arguments are missing. Currently ignore such arguments rather then output error messages. From Jun Morimoto * doc/Makefile.in 1.17: Get rid of .lf output from tbl to make it work on some systems, noticed by Tung-Han Hsieh 2000-03-11 Geoff C. Wing * src/xdefaults.c 1.57: When USE_XGETDEFAULT is defined, don't automatically pull in .Xdefaults and/or .Xresources - but allow it via a compile define. * doc/changes.txt 1.39: Update * configure 1.79: Regenerate * autoconf/configure.in 1.83: Fix typo, noticed by Paul 'TBBle' Hampson 2000-03-09 Geoff C. Wing * src/xdefaults.c 1.56: Remove redundant flag from previous change. * doc/changes.txt 1.38: Update * src/xdefaults.c 1.55: Fix up -si, noticed by Thomas Lofgren * src/init.c 1.7: Reverse previous. It was wrong. xdefaults checks for previously set options. 2000-03-05 Geoff C. Wing * src/xdefaults.c 1.54: Only include the first of ~/.Xdefaults & ~/.Xresources 2000-02-27 Geoff C. Wing * doc/changes.txt 1.37: Update * src/init.c 1.6: Process X resources before the command line so that the command line overrides the X resources, noticed by Thomas Lofgren * src/main.c 1.107, src/rxvt.h 1.70: Move some dumb dummy defines to rxvt.h now that the routines are called from other files. 2000-02-23 Geoff C. Wing * src/command.h 1.22, src/init.h 1.2: Move CONSOLE define from command.h to init.h * src/screen.c 1.127: Fix core dump when sending selection with NULL selection, noticed by Ben Middleton 2000-02-21 Geoff C. Wing * doc/changes.txt 1.36: Update * configure 1.78: Regenerate * src/screen.c 1.126, src/screen.h 1.15, src/xdefaults.c 1.53, doc/yodl/rxvt-options.yo 1.9, doc/yodl/rxvt-resources.yo 1.18, src/main.c 1.106, autoconf/configure.in 1.82: Change --with-encoding= configure option "euckr" to "kr" to match long option and resource name. Add new encoding method "noenc" which turns off encoding for the rxvt instance allowing normal eight bit characters. 2000-02-19 Geoff C. Wing * configure 1.77: Regenerate * doc/changes.txt 1.35: Update * autoconf/Make.common.in 1.10, autoconf/configure.in 1.81, doc/Makefile.in 1.16, src/Makefile.in 1.34, INSTALL 1.8: Add ability to use extra "standard" configure options: --program-prefix=PREFIX --program-suffix=SUFFIX --program-transform-name=PROGRAM From comments by Christoph von Stuckrad 2000-02-13 Geoff C. Wing * src/rxvt.h 1.69: remove artifact from previous * src/init.c 1.5: Fix setting for debug output. Add another trivial debug string. * src/rxvt.h 1.68: expand define 2000-02-09 Geoff C. Wing * doc/changes.txt 1.34: Update. * src/scrollbar.c 1.27, src/init.c 1.4, src/main.c 1.105: Colour determination for low colour (4 to 8 bit) displays, from Hans de Goede 2000-02-06 Geoff C. Wing * src/main.c 1.104: Do previous commit better: on signal, don't call exit() (possible race?) but just call the clean up routine and make the clean up routine happy with multiple calls. Currently, set default signal before clean up routine. 2000-02-05 Geoff C. Wing * doc/changes.txt 1.33: Update * src/main.c 1.103: On fatal signal make sure we go through clean_exit(), noticed by Jim Diamond 2000-01-26 Geoff C. Wing * src/init.c 1.3: Use -bd (resource: borderColor) properly (even though it's not visible in normal WM'd windows) 2000-01-25 Geoff C. Wing * src/Makefile.in 1.33: Add headers to ctags file 2000-01-20 Geoff C. Wing * configure 1.76: Regenerate * autoconf/configure.in 1.80: --enable-everything also does --enable-frills (as per --help) 2000-01-14 Geoff C. Wing * src/main.c 1.102, src/menubar.c 1.34, src/xdefaults.c 1.52, src/init.c 1.2, src/command.c 1.151: Remove void cast of ignored return values - everywhere or nowhere => nowhere in this case * src/screen.c 1.125: Missed part of reorganisation. Also, change type of TARGETS selection atom to ATOM (as per ICCCM v2.0) and basic support for TIMESTAMP selection atom. * src/feature.h 1.38, src/protos.h 1.10, src/rxvt.h 1.67, src/command.h 1.21, src/main.c 1.101, src/Makefile.in 1.32, src/command.c 1.150: Major reorganisation of routines. Most initialisation routines are now in init.c - this is a late checkin and unfortunately has undocumented bugfixes. * configure 1.75: Regenerate * autoconf/configure.in 1.79: Do specified settings/defines after other checks * src/init.c 1.1, src/init.h 1.1: Initialisation routines. 2000-01-08 Geoff C. Wing * src/command.c 1.149: Fix up KP_Down code: Should be ``ESC O r'' though I had a 102 manual that said ``ESC O w''. Treat it as a typo and go with the flow. Originally reported back in 1998 by Brian Mays 2000-01-07 Geoff C. Wing * src/test/strings-memmove.c 1.3: Clean up * configure 1.74: Regenerate * autoconf/configure.in 1.78: Fix -R check. The test program doesn't need to run any functions, just execute successfully with those functions compiled in. 2000-01-05 Geoff C. Wing * doc/menu/rxvt.zh-menu 1.1: Big5 menu, by cwhuang@linux.org.tw * doc/changes.txt 1.32: Update * src/screen.c 1.124: Remove unused variable from scr_refresh() * src/menubar.c 1.33, src/command.c 1.148, src/main.c 1.100: The fontset was being created but not being used. Calls added to use fontset to display menubars, such that they can be used to display international texts, by cwhuang@linux.org.tw Change fontset creation so that the font size of the fontset will be the same as that of the originary fonts. And re-create fontset when we change the font size, by Tung-Han Hsieh 2000-01-04 Geoff C. Wing * src/command.c 1.147: Add stricter checking in ConfigureNotify bypass routine, from T.H.Hsieh 1999-12-30 Geoff C. Wing * src/rxvtgrx.h 1.3, src/screen.h 1.14, src/logging.h 1.7, src/menubar.h 1.4, src/rxvt.h 1.66, src/command.h 1.20: Update multi-include protection. Add Id strings 1999-12-27 Geoff C. Wing * configure 1.73: Regenerate * autoconf/configure.in 1.77: Shorten help output to 79 characters wide. * configure 1.72: Regenerate * autoconf/configure.in 1.76: Make --disable-foobar work after --enable-everything 1999-12-22 Geoff C. Wing * configure 1.71: Regenerate * autoconf/configure.in 1.75: No default tbl program * configure 1.70: Regenerate * autoconf/configure.in 1.74: Don't rely on special host keyword 'local' 1999-12-21 Geoff C. Wing * Makefile 1.20: Regenerate * Makefile.in 1.6: Add src/test directory * src/version.h 1.19: Bump version to 2.7.2 * doc/FAQ 1.4: Note yodl for documentation 1999-12-19 Geoff C. Wing * doc/LSM.in 1.9: See previous LSM.in log message * configure 1.69: Regenerate * src/test/Makefile.in 1.1: Some basic test routines * src/test/strings-memmove.c 1.2: Visible result on OK * autoconf/configure.in 1.73: Add src/test directory * src/command.c 1.146: Copyright update * src/command.c 1.145: First cut at integrating QNX support, from 2.6.1 support for QNX 4.2[3-5] with Watcom C 10.6 by D. J. Hawkey Jr. * src/test/strings-memmove.c 1.1: Add a basic test for memmove() in strings.c to confirm that everything is hunky dory. Quite verbose. 1999-12-18 Geoff C. Wing * src/screen.c 1.123, src/logging.c 1.18: Update casts * doc/changes.txt 1.31: Update * src/main.c 1.99, src/rxvt.h 1.65: Do borderwidths in int16_t so we don't have problems with types. * doc/yodl/rxvt-options.yo 1.8, doc/yodl/rxvt-resources.yo 1.17: Document internalBorder/externalBorder and short options for them. * doc/changes.txt 1.30: Update * src/rxvt.h 1.64, src/screen.c 1.122, src/xdefaults.c 1.51, src/graphics.c 1.24, src/main.c 1.98, src/command.c 1.144: Add configurable internal and external border widths * src/feature.h 1.37, src/main.c 1.97: Re-add BORDERWIDTH as EXTERNALBORDERWIDTH and use appropriately in geometry positioning. * src/scrollbar.c 1.26, src/main.c 1.96: Move scrollbar resizing code from main.c to scrollbar.c and make sure we size the scrollbar initially instead of waiting for a WM to send us events, otherwise it won't be visible. * src/command.c 1.143: Constify 1999-12-16 Geoff C. Wing * src/main.c 1.95: Fix negative position calculation * src/graphics.c 1.23, src/main.c 1.94, src/rxvt.h 1.63, src/screen.c 1.121, src/command.c 1.142, src/feature.h 1.36: Clarify use of BORDERWIDTH, rename to INTERNALBORDERWIDTH 1999-12-13 Geoff C. Wing * src/logging.c 1.17, src/misc.c 1.31, src/xdefaults.c 1.50, src/xpm.c 1.33: Indenting 1999-12-12 Geoff C. Wing * src/main.c 1.93: Conditionalise variables * src/command.c 1.141, src/feature.h 1.35: Add SCROLL_ON_UPDOWN_KEYS to allow scrollback via (shift|meta|ctrl) modifier and up/down keys, default off for backwards compatibility, from Oskar Liljeblad * src/command.h 1.19, src/command.c 1.140: Clean up IMBUFSIZ buffers and increase them * src/command.c 1.139: Clean up IMisRunning() * src/strings.c 1.2: clean up 1999-12-11 Geoff C. Wing * src/logging.c 1.16: Copyright notice change * doc/changes.txt 1.29: Update * INSTALL 1.7: Short note on configure options * src/logging.c 1.15, src/logging.h 1.6: Add conglomerate patch: add lastlog support, add QNX support, from D J Hawkey Jr Add WTMP_ONLY_ON_LOGIN, log wtmp entries only for login terms (-ls option) * src/feature.h 1.34: Allow for wtmp logging only with login shells, -ls option * configure 1.68: Regenerate * autoconf/acconfig.h 1.32, autoconf/config.h.in 1.40, autoconf/configure.in 1.72: Add --enable-lastlog and associated checks * src/screen.c 1.120: Fix selection_paste() to use the correct variable and thus handle large pastes again, noticed by Dominik Vogt 1999-12-10 Geoff C. Wing * src/misc.c 1.30: Str_escaped() Size optimisation. * src/logging.c 1.14: Fix size of stored ut_id * src/command.h 1.18, src/command.c 1.138: Add some defines for QNX, from D. J. Hawkey Jr. 1999-12-05 Geoff C. Wing * src/command.c 1.136: Remove PrivCases() define from process_terminal_mode() and place in its own routine. Size optimisation. * src/feature.h 1.33, src/xdefaults.c 1.49, src/screen.c 1.119: Add NO_BELL option to disable all bell indications 1999-11-27 Geoff C. Wing * doc/changes.txt 1.28: Update 1999-11-14 Geoff C. Wing * src/feature.h 1.32: Turn off DISPLAY mangling (which Alpha people need/needed) by default. 1999-11-12 Geoff C. Wing * src/screen.c 1.118: If a paste conversion to the proper locale fails, dump it in anyway. Free the return of XmbTextPropertyToTextList() * src/feature.h 1.31: Add define for resetting tty device permissions to pre-invocation state 1999-11-09 Geoff C. Wing * src/main.c 1.92: Set window name if debugging * src/main.c 1.91: Correct the use of XFetchName() return * src/command.c 1.135: More debug output for InheritPixmap * src/screen.c 1.117: Fix up use of enumeration in scr_expose() * src/command.c 1.134: Set variable properly 1999-11-08 Geoff C. Wing * src/command.c 1.133: Add some more debugging outputs 1999-11-07 Geoff C. Wing * src/screen.c 1.116: Handle display permutations properly * src/command.c 1.132: Rearrange pty/tty stuff 1999-11-02 Geoff C. Wing * src/main.c 1.90, src/xdefaults.c 1.48: Make sure we're trimming strings from Xresources, partly from Remi Guyomarch 1999-10-14 Geoff C. Wing * src/Makefile.in 1.31: Improve build rule for parallel builds, from Trent Piepho 1999-10-09 Geoff C. Wing * src/command.c 1.131: Have to update scrollbar immediately after a reset, otherwise it may be delayed indefinitely. 1999-10-08 Geoff C. Wing * configure 1.67: Regenerate * autoconf/config.h.in 1.39, autoconf/configure.in 1.71: Check for setpgrp()/setpgid() 1999-10-06 Geoff C. Wing * doc/yodl/rxvt-options.yo 1.7: Fix resource name scrollTtyKeypress, noticed by Dominik Vogt 1999-10-04 Geoff C. Wing * src/screen.c 1.115: Fix error with reverse multibyte display, noticed by Tung-Han Hsieh * src/screen.c 1.114: Check for NULL before use in pasting, from Kikutani, Makoto 1999-10-03 Geoff C. Wing * src/command.c 1.130: Add DECREQTPARM since we document it * src/screen.c 1.113, src/xdefaults.c 1.47, src/main.c 1.89, src/menubar.c 1.32, src/misc.c 1.29, src/rxvt.h 1.62, src/command.c 1.129: Big resource renaming. Put all the resources into a struct. This may save a few bytes and facilitates debugging. * src/main.c 1.88: Use whole DISPLAY for local X. 1999-09-30 Geoff C. Wing * src/screen.c 1.112: Pasto * src/screen.c 1.111: Mini size optimisation: remove CHECK_SELECTION() 1999-09-29 Geoff C. Wing * src/screen.c 1.110: Fix empty paste coredump w/MULTICHAR_SET and optimise w/o, from Tung-Han Hsieh 1999-09-28 Geoff C. Wing * src/rxvt.h 1.61: Expand tranparency parent base * src/command.c 1.128: Repair SM/RM insert/replace mode code. * src/command.c 1.127, src/main.c 1.87: Do proper transparency check at the start. * doc/changes.txt 1.27: Update * doc/LSM.in 1.8: See previous LSM.in log message * doc/Makefile.in 1.15: Update to not depend on configure generating correct paths. * configure 1.66: Regenerate * autoconf/configure.in 1.70: Don't generate yodl files anymore. * doc/yodl/rxvtRef.yo 1.5: Remove CHDIR()s * doc/yodl/rxvt.yo.in 1.3, doc/yodl/rxvtRef.yo.in 1.3, doc/yodl/rxvt.yo 1.4, doc/yodl/rxvtRef.yo 1.4: Cannot set paths at configure time because configure doesn't work. * Makefile 1.19: Regenerate 1999-09-27 Geoff C. Wing * src/xdefaults.c 1.46: Output XIM as it has major effect upon terminal. * src/screen.c 1.109: Fix my idiotic optimisation from 1.106->1.107 * src/screen.c 1.108: Remove the unused parts of scr_expose() and optimise it. * src/command.c 1.126: Fix up comment formatting * src/menubar.c 1.31: Pad Arrows struct (and allow current debug code to work). * src/screen.c 1.107: Optimise some code. * src/screen.c 1.106: Get rid of variable focus in scr_refresh() * src/screen.c 1.105: Improve checks for pixel dropping avoidance. 1999-09-26 Geoff C. Wing * autoconf/acconfig.h 1.31, autoconf/config.h.in 1.38: Put defines which rely on user specification to configure at the top of config.h and autodetected defines after that. * src/screen.c 1.104: Do a two pass run across each line for pixel dropping avoidance. Do the pass for left pixel droppings then include that information during the pass for right pixel droppings. This integrates the bold overstrike pixel dropping avoidance. Multichar fonts are not handled yet. Negative lbearings with absolute value greater than the font width are not handled. Positive rbearings greater than twice the font width are not handled. * doc/changes.txt 1.26: Update * src/screen.c 1.103: Fix exposures argument of XClearArea(). Fix one calculation * src/screen.c 1.102: Use the macro for calculation 1999-09-25 Geoff C. Wing * src/screen.c 1.101: Expand areas affected by CLEAR_ROWS() and ERASE_ROWS() to include sides * src/graphics.c 1.22, src/main.c 1.86, src/command.c 1.125, src/rxvt.h 1.60, src/feature.h 1.30: Replace TermWin_internalBorder with BORDERWIDTH. Change default of BORDERWIDTH to 2. * src/main.c 1.85: Properly #ifdef some variables * src/command.c 1.124: Improve check for XIM server, from MANTANI Nobutaka * src/command.c 1.123: Name CSI functions. Determine any defaults before individual calls. Add secondary device attribute response ('R';version) with 'R' arbitrarily chosen. * src/version.h 1.18: Add VSTRING (version) for use in secondary device attribute response 1999-09-24 Geoff C. Wing * src/main.c 1.84, src/rxvt.h 1.59: Require strict font checking only upon user request (compiled). 1999-09-23 Geoff C. Wing * src/main.c 1.83, src/screen.c 1.100, src/scrollbar.c 1.25, src/command.c 1.122: Add extra argument to scr_touch()/scr_expose() to specify if immediate refresh is desired. Delay refreshing of transparent windows in some situations. Allow a fast sequence of XConfigureWindow()s to do their job before we refresh. 1999-09-20 Geoff C. Wing * src/scrollbar.c 1.24: Remove extraneous (and now erroneous) definitions 1999-09-07 Geoff C. Wing * src/scrollbar.c 1.23: Adapt part of Jim Knoble's NeXT scrollbar changes to rxvt/xterm scrollbars. 1999-09-06 Geoff C. Wing * src/scrollbar.c 1.22, src/main.c 1.82, src/rxvt.h 1.58: Fix jitter in NeXT scrollbar size calculations. Name some constants used in calculations, from Jim Knoble 1999-08-29 Geoff C. Wing * src/screen.c 1.99: Use mark position appropriately for selection extension. 1999-08-19 Geoff C. Wing * src/command.c 1.121, src/command.h 1.17: Check that the xim server is still running when we try to do stuff, from MANTANI Nobutaka 1999-08-17 Geoff C. Wing * doc/Makefile.in 1.14: Remove dependency in install for the moment * src/feature.h 1.29, src/main.c 1.81: LOCAL_X_IS_UNIX define to workaround a problem with Irix opening a local X display. * configure 1.65: Regenerate * autoconf/configure.in 1.69: Add warning for not found pty type. Move warning for XPM to end. * autoconf/configure.in 1.68: Add extra sgi checks 1999-08-16 Geoff C. Wing * configure 1.64: Regenerate * autoconf/configure.in 1.67: Fix another operator precedence error 1999-08-14 Geoff C. Wing * configure 1.63: Regenerate * autoconf/configure.in 1.66: Add missing changequote for C code, from Chun-Chung Chen 1999-08-12 Geoff C. Wing * src/feature.h 1.28: Not Linux by default: match distributed termcap * src/command.c 1.120: Check focus before sending IM preedit position, from Tung-Han Hsieh 1999-08-10 Geoff C. Wing * src/command.c 1.119: Reorder child operations to fix problems on USG pty machines, aided by Larry W. Virden 1999-08-09 Geoff C. Wing * doc/changes.txt 1.25: Update 1999-08-07 Geoff C. Wing * configure 1.62: Regenerate * autoconf/configure.in 1.65: Fix operator precedence, from Albert Chin * src/logging.c 1.13: Add lost tty determining code when split fully into BSD/SYSV types. 1999-08-06 Geoff C. Wing * configure 1.61: Regenerate * autoconf/configure.in 1.64: Balance parentheses. 1999-08-05 Geoff C. Wing * src/screen.c 1.98: Forgot #ifdef MULTICHAR_ENCODING * doc/Makefile.in 1.13: Depend versioninfo.yo on version.h (instead of file generated from version.h) * Makefile 1.18: Regenerate * src/version.h 1.17: Update date for proper 2.7.0 development release. * src/screen.c 1.97, src/screen.h 1.13: Oops. Set MULTICHAR_ENCODING in the proper place. * src/screen.c 1.96, src/screen.h 1.12: Use MULTICHAR_ENCODING (set with configure) * configure 1.60: Regenerate * autoconf/configure.in 1.63: Use --with-encoding. Set --enable-xim if --enable-languages * src/main.c 1.80, src/screen.c 1.95, src/feature.h 1.27: Get multichar font stuff working again. Handle all languages thus don't define base multichar fonts. People can still define as mfont & mfont[1234567]. If we don't have a multichar font for the current size, spew an error at init/font-change and print blanks instead. * src/screen.c 1.94, src/main.c 1.79, src/rxvt.h 1.57: Add IS_MULTI1() & IS_MULTI2 to check for multichar states. Allow bold fonts and multichar fonts which are smaller than the main font. Bold fonts which are larger are dropped. No proper handling yet for multichar fonts. 1999-08-03 Geoff C. Wing * src/misc.c 1.28: Indenting * src/command.h 1.16: Youch. We really want O_NOCTTY but... * src/command.c 1.118: Add a missing close() * src/command.c 1.117: More efforts to properly get the slave tty. Goes overboard on some systems but tries to be safe. Use D_CMD() for error message printing. 1999-08-02 Geoff C. Wing * configure 1.59: Regenerate * autoconf/configure.in 1.62: Go psycho on ptmx checking 1999-08-01 Geoff C. Wing * src/command.c 1.116: Allow Shift-Insert (paste selection) to work outside the window, just like regular keys, noticed by * configure 1.58: Regenerate * autoconf/configure.in 1.61: find utmpx - if a utmp file exists at the same location and is more than an hour newer, then don't use utmpx. People leave lots of odd files around. * doc/changes.txt 1.23: Update * src/command.c 1.115: Fix CSI cursor movements. 1999-07-31 Geoff C. Wing * src/command.c 1.114, src/main.c 1.78: Major change: move unsetenv()s to parent; move open of slave tty to parent; add use of revoke(); put code which wants setuid privileges into their own routines; all privileged operations done in parent; add use of setreuid() if that's all that's available; move child code except some terminal setup into its own routine; use standard file descriptor names; don't try to write stuff to file descriptors we have closed; add proper check of setsid(). * src/rxvt.h 1.56: Define common file numbers via standard names * configure 1.57: Regenerate * autoconf/config.h.in 1.37, autoconf/configure.in 1.60: Check for revoke(), setreuid(), setsid() * src/xdefaults.c 1.45: Add missing bit of last commit 1999-07-30 Geoff C. Wing * doc/changes.txt 1.22: Update * src/feature.h 1.26, src/xdefaults.c 1.44: Clean up XGetDefaults() - go for everything. Mainly from SEO Young-Jin * src/xdefaults.c 1.43: Fix cut'n'paste error. 1999-07-28 Geoff C. Wing * src/command.c 1.113: Fix UNSHIFTED_SCROLLKEYS * src/xdefaults.c 1.42: Accept more values as TRUE, from Andrew J. Schorr * src/command.c 1.112: Remove error messages printed when the old stderr is gone. 1999-07-27 Geoff C. Wing * src/command.c 1.111: Clean up 1999-07-24 Geoff C. Wing * src/command.c 1.110: make cmd_write() append to the cmd buffer, not prepend. * src/feature.h 1.25, src/screen.c 1.93, src/screen.h 1.11: Make cursor position fully independent on primary and secondary screens, including cursor save & restore. Add define to feature.h to disable this. 1999-07-18 Geoff C. Wing * src/command.c 1.109: Make sure we do the check for InputOnly windows. * src/command.c 1.108: We can only change the backgrounds on InputOutput windows. 1999-07-17 Geoff C. Wing * src/screen.c 1.92: More bounds checking * src/scrollbar.c 1.21: Fix scrollbar line drawing with SB_BORDER feature, from Mike Hopkirk (Hops) * configure 1.56: Regenerate * src/command.c 1.107, src/rxvt.h 1.55, autoconf/configure.in 1.59: SCO fixes: partly from Mike Hopkirk (Hops) 1999-07-14 Geoff C. Wing * src/command.c 1.106: Fix some stupid orderings 1999-07-10 Geoff C. Wing * src/logging.c 1.12: Separate BSD and SYSV stuff slightly. Add wtmp logging for BSD. Fix utmp position calculation for BSD to ignore comment/blank lines. * src/command.c 1.105, src/main.c 1.77, src/misc.c 1.27, src/rxvt.h 1.54: basename() -> r_basename(): Avoid Linux clashes: BSD*: char *basename(char *); SUS2: char *basename(char *); Digital: char *basename(char *); Linux Redhat 5.2: char *basename(const char *) 1999-07-09 Geoff C. Wing * configure 1.55: Regenerate * autoconf/configure.in 1.58: Don't have --enable-everything ==> --enable-strings * src/command.c 1.104, autoconf/config.h.in 1.36, autoconf/configure.in 1.57: Revert last * autoconf/config.h.in 1.35, autoconf/configure.in 1.56: Check for ttyslot() * src/command.c 1.103: Move cmd_fd to 0. Then if we've got ttyslot() everything will be groovy. * src/logging.c 1.11: Handle wtmp write errors a bit more elegantly 1999-07-08 Geoff C. Wing * configure 1.54: Regenerate * autoconf/configure.in 1.55: LIBS line hacking to support -R or -Wl,-R I wonder who's going to have problems with this. 1999-07-07 Geoff C. Wing * src/screen.c 1.91: Bounds check properly after type change 1999-07-06 Geoff C. Wing * src/screen.c 1.90: Comment out now unnecessary checks * src/rxvt.h 1.53: Revert previous. Make TermWin.nscrolled + TermWin.view_start unsigned to avoid overflows. Fixes problem with "rxvt -sl 32767" noticed by, Preston Brown * src/rxvt.h 1.52: Bump row_col_t to 32bit * src/screen.c 1.89: g/c 1999-07-05 Geoff C. Wing * configure 1.53: Regenerate * src/feature.h 1.24, autoconf/acconfig.h 1.30, autoconf/config.h.in 1.34, autoconf/configure.in 1.54: Add --enable-everything to enable standard non-three-or-more-option features. Move feature.h(NO_FRILLS) as --(en|dis)able-frills 1999-07-04 Geoff C. Wing * README.configure 1.11: Note --disable-memset -> --enable-strings * src/screen.c 1.88, src/strings.c 1.1, src/xdefaults.c 1.41, src/xpm.c 1.32, src/misc.c 1.26, src/netdisp.c 1.12, src/protos.h 1.9, src/rmemset.c 1.19, src/rxvt.h 1.51, src/menubar.c 1.30, src/Makefile.in 1.30, src/command.c 1.102, src/logging.c 1.10, src/main.c 1.76, doc/changes.txt 1.21, autoconf/acconfig.h 1.29, autoconf/config.h.in 1.33, autoconf/configure.in 1.53, Makefile 1.17, configure 1.52: 1) remove --disable-rmemset; add --enable-strings remove rmemset.c; add strings.c - in 2.15 Mark Olesen added a strcasecmp() function stating it avoided linking in an extra library. Unstated: what library and what OS. Add some similar functions, but make the default to be disabled because it will probably add text space for most people. Moved rmemset() -> memset(), my_strcasecmp() -> strcasecmp() and wrote several other replacement string functions. Note that external programs will also use these. 2) CALLOC() had weird argument ordering for dmalloc. dmalloc versions haven't defined this for a while so go back to normal ordering - if you use an old dmalloc, you may have problems. 1999-07-03 Geoff C. Wing * configure 1.51: Regenerate * autoconf/configure.in 1.52: Do proper check for XPM includes & libraries. Disable and give warnings if either cannot be found when --enable-xpm-background is specified. Semi-standardise some "if test" lines. * src/main.c 1.75, src/misc.c 1.25, src/screen.c 1.87, src/xpm.c 1.31, src/command.c 1.101, src/logging.c 1.9: Update my copyrights * src/rxvt.h 1.50, src/screen.c 1.86, src/screen.h 1.10, src/xdefaults.c 1.40, src/command.c 1.100, src/feature.h 1.23, src/main.c 1.74: Remove trailing whitespace 1999-07-02 Geoff C. Wing * doc/changes.txt 1.20: Formating. * src/main.c 1.73, src/rxvt.h 1.49, src/screen.c 1.85, doc/yodl/rxvtRef-xterm.yo 1.3: Add another XTerm escape sequence (OSC) #55 : dumps to a file all of the scrollback and current screen. File is either absolute or relative to the term's invocation. NO errors reported. NO file argument parsing. Wrapped lines preserved. * src/main.c 1.72: Need default scrollTtyOutput after change of name. * src/misc.c 1.24: Update comment * src/screen.c 1.84, src/xdefaults.c 1.39, src/main.c 1.71, src/misc.c 1.23, src/command.c 1.99: my_basename() -> r_basename() xdefaults.c:my_strcasecmp() -> misc.c:r_strcasecmp() & use tolower() new r_strncasecmp() * doc/changes.txt 1.19: Note some changes * doc/yodl/rxvt-options.yo 1.6: Note opposite effect of -si and scrollTtyOutput * src/xdefaults.c 1.38: Allow reversed flags/options * src/rxvt.h 1.48: Missing bit of previous * src/command.c 1.98, src/rxvt.h 1.47, src/screen.c 1.83: Opt_scrollTtyOutputInh -> Opt_scrollTtyOutput * src/rxvt.h 1.46: Allow invocation flags to have reverse meaning 1999-06-30 Geoff C. Wing * doc/BUGS 1.8: Update bug email 1999-06-23 Geoff C. Wing * configure 1.50: Regenerate * autoconf/configure.in 1.51: Remove echo -n * src/version.h 1.16: Bump version to 2.7.0 as development * configure 1.49: Regenerate * src/rxvt.h 1.45, src/screen.c 1.82, src/screen.h 1.9, src/xdefaults.c 1.37, autoconf/config.h.in 1.32, autoconf/configure.in 1.50, doc/yodl/rxvt-options.yo 1.5, doc/yodl/rxvt-resources.yo 1.16, src/feature.h 1.22, src/main.c 1.70, autoconf/acconfig.h 1.28: First cut at integration of all multichar glyph languages. Still to do: - proper font selection - configuration default setting - method of changing encodings (and fonts) after invocation - proper handling of size mismatches in fonts 1999-06-22 Geoff C. Wing * src/main.c 1.69: Reversed scrollbar floating logic, noticed by Erik Jacobsen * src/rxvt.h 1.44: always have want_refresh * autoconf/acconfig.h 1.27: Update comment * src/command.c 1.97, src/command.h 1.15: PUSH tty controls on PTMX not svr4 * src/command.c 1.96: Provide better grantpt() handling, and tty ownership now dependent on grantpt() success. * autoconf/config.h.in 1.31: Regenerate * autoconf/configure.in 1.49: Check for unlockpt() 1999-06-11 Geoff C. Wing * autoconf/acconfig.h 1.26: Remove unused define as it defined by default detection * configure 1.48: Regenerate * autoconf/config.h.in 1.30, autoconf/configure.in 1.48: Try other method of IRIX pty detection 1999-06-10 Geoff C. Wing * autoconf/config.h.in 1.29: Regenerate * src/command.c 1.95: grantpt() is supposed to set the tty uid/gid/mode appropriately, from Carlos Carvalho 1999-06-09 Geoff C. Wing * src/command.c 1.94: Revert to old timeout in cmd_getc() * src/command.c 1.93: Remove extra, unbalanced parenthesis, noticed by Fabrice_GONTON@paribas.com 1999-06-03 Geoff C. Wing * src/screen.c 1.81, src/scrollbar.c 1.20, src/xdefaults.c 1.36, src/xpm.c 1.30, src/grkelot.c 1.11, src/logging.c 1.8, src/main.c 1.68, src/menubar.c 1.29, src/misc.c 1.22, src/netdisp.c 1.11, src/rmemset.c 1.18, src/rxvt.h 1.43, src/command.c 1.92, src/graphics.c 1.21: Move include of config.h out of rxvt.h and into individual files * autoconf/acconfig.h 1.25, autoconf/configure.in 1.47, src/command.c 1.91: Also check for grantpt() if we're USG/GLIBC like ttys 1999-05-31 Geoff C. Wing * src/screen.c 1.80: Remove unused variable from selection_paste() 1999-05-27 Geoff C. Wing * src/command.c 1.90: pullup 1.85.2.7 1999-05-22 Geoff C. Wing * src/command.c 1.89, src/graphics.c 1.20, src/menubar.c 1.28, src/netdisp.c 1.10, src/protos.h 1.8, src/rxvt.h 1.42, src/xpm.c 1.29, autoconf/configure.in 1.46, src/Makefile.in 1.29, configure 1.47: Revert to only making what we need; only more so than before 1999-05-21 Geoff C. Wing * src/screen.c 1.79: Fix two multichar set problems: - writing Kanji during insert mode (by ESC [ 4 h). - writing Kanji in middle of two Kanji characters (e.g. when two Kanji are placed on columns 1,2 and 3,4, and new Kanji is put on columns 2,3), noticed by TATEOKA Takamichi * src/screen.c 1.78: pullup 1.76.2.3: Fix compilation error on MULTICHAR_SET pullin 1.76.2.4: Fix processing order of tab, carriage return and line feed when in MULTICHAR_SET, reported by TATEOKA Takamichi 1999-05-20 Geoff C. Wing * src/command.c 1.88: Cleanup mouse wheel scrolling code. 1999-05-19 Geoff C. Wing * src/screen.c 1.77, src/version.h 1.15, src/xdefaults.c 1.35, doc/yodl/rxvt-resources.yo 1.15, src/feature.h 1.21, src/main.c 1.67, src/rxvt.h 1.41, autoconf/acconfig.h 1.24, autoconf/config.h.in 1.28, autoconf/configure.in 1.45, doc/changes.txt 1.18, README.configure 1.10, configure 1.46, src/command.c 1.87: pullup changes from 2-6-0 1999-05-10 Geoff C. Wing * src/command.c 1.86: Try the indirect opening of tty. This whole area needs rewriting. 1999-05-05 Geoff C. Wing * src/misc.c 1.21: Build some routines only upon requirement. * src/screen.c 1.76: Fix some logic in scr_erase_line() for whole line. * src/xdefaults.c 1.34: Was the to_keysym define really worth it? Remove it * configure 1.45: Regenerate * autoconf/configure.in 1.44: Try to avoid another false positive * doc/TODO 1.7: Note in progress items. * src/screen.c 1.75: Move some common code into own routine. Reindent. * src/command.c 1.85, src/command.h 1.14: Back to simple queue for CN requests. Don't want prev information. * src/rmemset.c 1.17: No stub if not defined. * src/command.c 1.84: Fix buffer overrun. 1999-04-27 Geoff C. Wing * configure 1.44: Regenerate * autoconf/configure.in 1.43: Avoid a false positive with EACCES 1999-04-19 Geoff C. Wing * src/screen.c 1.74: Fix Multichar selection problems with old selection style, noticed by Yasuda Tsutomu <_tom_@sf.airnet.ne.jp> * configure 1.43, autoconf/config.h.in 1.27: Regenerate * src/command.c 1.83, autoconf/acconfig.h 1.23, autoconf/configure.in 1.42: Check for GLIBC getpt() extension, partly from Andreas Jaeger * README.configure 1.9: Enhance --enable-xim description. 1999-04-17 Geoff C. Wing * src/command.c 1.82: XRegisterIMInstantiateCallback() in C locale if not MULTICHAR_SET. Different method for XIM: try XSetLocaleModifiers() with given options, if any, then with none (allowing XMODIFIERS env. var. to be used), then with "@im=none". Hopefully this will satisfy everyone's needs. 1999-04-16 Geoff C. Wing * src/graphics.c 1.19: No stubs for internal routines if not defined 1999-04-13 Geoff C. Wing * src/command.c 1.80: Fix stuff up in loop for check of preedit type. * src/command.c 1.79: Fix some of my stuff-ups including do NOT XRegisterIMInstantiateCallback() before we change locale, from MANTANI Nobutaka * src/command.c 1.78: Minor cleanup. * src/command.c 1.77: Clean up loops. Enhance defaults for preedit type. * src/command.c 1.76: Pasto. 1999-04-12 Geoff C. Wing * src/command.h 1.13, src/misc.c 1.20, src/command.c 1.75: strcpy() -> STRCPY(), other small clean ups. 1999-04-11 Geoff C. Wing * src/command.c 1.74: Clean up. Fix typo. XRegisterIMInstantiateCallback() before we change locale. * configure 1.42: Regenerate * autoconf/configure.in 1.41: Fix botch of checking setting for utmp/x and wtmp/x, noticed by Marc Baudoin 1999-04-09 Geoff C. Wing * src/command.c 1.73: Be more generous with mapping unmapped keysyms to Latin1, from Pavel Roskin 1999-04-05 Geoff C. Wing * doc/changes.txt 1.17: _tom_@sf.airnet.ne.jp is Yasuda Tsutomu 1999-04-04 Geoff C. Wing * doc/LSM.in 1.7: See previous LSM.in log message * Makefile 1.16: Regenerate * src/version.h 1.14: Bump version to 2.6.PRE3 * configure 1.41: Regenerate * autoconf/configure.in 1.40: Verbose pty/tty type * README.configure 1.8: Clean up * doc/changes.txt 1.16: Update 1999-04-02 Geoff C. Wing * src/screen.c 1.73: Always do proper selection request conversions. * src/screen.c 1.72: Integrate part of a patch to handle Kanji/multichar stuff better, from Yasuda Tsutomu <_tom_@sf.airnet.ne.jp> 1999-04-01 Geoff C. Wing * src/command.c 1.71: Use determined sb_width, not WIDTH for width adjustments. * src/command.c 1.70: Removed unused variable. * src/command.c 1.69: Fix two problems on X Input Method: 1) Can't display preedit area in "OverTheSpot" input style with some input methods. 2) The location of preedit area in "OffTheSpot" input style is wrong. From MANTANI Nobutaka 1999-03-31 Geoff C. Wing * configure 1.40: Regenerate * src/command.c 1.68, autoconf/acconfig.h 1.22, autoconf/config.h.in 1.26, autoconf/configure.in 1.39: Move pty type to config.h using basic configure check which will probably need enhancing (and testing). 1999-03-29 Geoff C. Wing * Makefile.in 1.5: Add ChangeLog to distribution * src/command.c 1.67, src/xdefaults.c 1.33, src/rxvt.h 1.40: Remake resource `modifier' as override for probe, from Guillaume Laurent 1999-03-28 Geoff C. Wing * src/command.c 1.66, src/command.h 1.12, src/feature.h 1.20: Clean up up/down-arrow & Prior/Next handling. * autoconf/Make.common.in 1.9: Update sites and contact information 1999-03-24 Geoff C. Wing * src/command.c 1.65: Set want_refresh on window focus change. * src/rxvt.h 1.39, src/screen.c 1.71, src/command.c 1.64, src/main.c 1.66: Be less avoiding of screen refreshes in case X events have caused updates, from Vaughn Cato Different strategy to determine screen updates - anything that might have affected the screen now signals via `want_refresh'. If it's unset, then nothing needs updating - or it's handled within the same routine. Items which require want_refresh update: - text added, changed - cursor moved, changed, made {in,}visible - view_start changed - selection changed - window changed * doc/changes.txt 1.15: Update * doc/yodl/rxvt-options.yo 1.4, doc/yodl/rxvt-resources.yo 1.14: Document floating/trough better * src/main.c 1.65: Don't want trough (scrollbar floating) unless normal scrollbar - noticed by Peter H. Chou * configure 1.39: Regenerate * autoconf/configure.in 1.38: Clarify options slightly 1999-03-11 Geoff C. Wing * src/xpm.c 1.28, src/xpm.h 1.5, src/Makefile.in 1.28: Move xpm.h back into xpm.c - avoid possible recursive inclusion. Fixes problem noted by Felix Puetsch 1999-03-08 Geoff C. Wing * src/rxvt.h 1.38, src/scrollbar.c 1.19: Make NeXT scroller minimum height of 15, suggested by Mike Fix up a miscalculation in its height while we're there. * src/command.c 1.63: Fix XIM bug: can't input Japanese character when rxvt is started with "-bg white" option. Tsutomu Yasuda 1999-02-28 Geoff C. Wing * doc/changes.txt 1.14: Update * src/command.c 1.62, src/feature.h 1.19: Allow scrolling of single lines with shift and up/down arrow keys (not keypad arrow keys) in a similar manner to shift prior/next 1999-02-21 Geoff C. Wing * src/screen.c 1.70: Indenting. 1999-02-03 Geoff C. Wing * src/command.h 1.11: Clean up. Check for matching parent depths if we're transparent. * src/command.c 1.61: Clean up. Check for matching parent depths if we're transparent, noticed by Jeremie Petit * src/scrollbar.c 1.18: Constify and clean up. 1999-02-01 Geoff C. Wing * src/main.c 1.64: Free char **r_argv after we're done with it. * src/logging.c 1.7: Don't utmpname() - for one thing, it's based on a configure guess. Use whatever the system has for us to use. Is this dangerous on some systems? Can invoking programs do utmpname() which we inherit? 1999-01-31 Geoff C. Wing * doc/changes.txt 1.13: Update 1999-01-29 Geoff C. Wing * src/screen.c 1.68: Fix weirdo OOB bug * src/screen.c 1.67: Be careful examining font struct - don't go OOB. 1999-01-28 Geoff C. Wing * src/main.c 1.63: Fix change_font/move_window bug better - avoids coredump on resize window! 1999-01-27 Geoff C. Wing * doc/LSM.in 1.6: Keeping LSM which has a tar.gz size within the tar.gz is a real pain. * doc/FAQ 1.3: Note different compilation option method in this day and age. * doc/changes.txt 1.12: Update with latest info. * doc/yodl/rxvt-resources.yo 1.13: Clarify how resources are read in the default case. * Makefile 1.15: Regenerate * src/version.h 1.13: Bump version to 2.6.PRE2 * src/main.c 1.62: Clean up the env var allocation a bit. 1999-01-24 Geoff C. Wing * src/command.c 1.60: Clean up. 1999-01-23 Geoff C. Wing * src/main.c 1.61: Fix resize_font/move_window causes blank term bug - reported by Hannu Liljemark * src/menubar.c 1.27, src/rxvt.h 1.37, src/screen.c 1.66, src/command.c 1.59, src/main.c 1.60: Handle issues with transparent windows dying when the parents are away - we're playing around with windows: 1) we didn't create 2) for which we're not responsible 3) nobody else knows we're playing with so we have to make sure we're on the ball. Keep up to date information about parent windows we care about. * doc/changes.txt 1.11: Update 1999-01-22 Geoff C. Wing * Makefile 1.14, configure 1.38: Regenerate * src/main.c 1.59: Oops, remove conflict * src/screen.c 1.65, src/xdefaults.c 1.32, src/xpm.c 1.27, src/command.c 1.58, src/graphics.c 1.18, src/main.c 1.58, src/menubar.c 1.26, autoconf/acconfig.h 1.21, autoconf/config.h.in 1.25, autoconf/configure.in 1.37, src/command.h 1.10, src/rxvt.h 1.36: Merge rxvt-xim branch - XIM changes from MANTANI Nobutaka 1999-01-21 Geoff C. Wing * src/main.c 1.57: Fix declaration of COLORFGBG env var to make it long lived, Rob Somerville 1999-01-10 Geoff C. Wing * Makefile 1.13: Regenerate * doc/LSM.in 1.5: Update size * README.configure 1.7: Document --enable-transparency * src/version.h 1.12: Bump version to 2.6.PRE1 * doc/changes.txt 1.10: Sync all the latest changes. * doc/BUGS 1.7: Update * src/main.c 1.56: We must still export COLORFGBG even with NO_BRIGHTCOLOR defined. Noticed by Moritz Barsnick * configure 1.37: Regenerate * autoconf/configure.in 1.36: Check for XPointer typedef. Make sure we properly include X directory * src/rxvt.h 1.35: Add check for XPointer typedef. * configure 1.36: Regenerate * autoconf/acconfig.h 1.20, autoconf/config.h.in 1.24: Check for XPointer typedef. * doc/Makefile.in 1.12: Idiot. Fix all: rule * configure 1.35: Regenerate * doc/Makefile.in 1.11: Check for TBL. Premake everything, except maybe rxvt.1, and do not depend all on anything. * autoconf/Make.common.in 1.8, autoconf/configure.in 1.35: Check for ``tbl'' so we can format the manual page on the end system. * doc/yodl/rxvt-options.yo 1.3, doc/yodl/rxvt-resources.yo 1.12: Document ip/inheritPixmap support. 1999-01-09 Geoff C. Wing * src/feature.h 1.18, src/screen.c 1.64: Default to not "bw" (termcap) and use xterm-defined undefined behaviour. 1999-01-08 Geoff C. Wing * src/command.c 1.57: Remove, now unnecessary, __CYGWIN__ avoidance of struct winsize members * src/xdefaults.c 1.31: Options --transparent -> --inheritPixmap, -tr -> -ip, -tr compatibility added. * src/menubar.c 1.25: Remove use of itimerval.it_value when we're only using it_value 1999-01-07 Geoff C. Wing * src/misc.c 1.19: Stupid comparison. Change && to || 1999-01-05 Geoff C. Wing * src/Makefile.in 1.27: No ! in if test - from * configure 1.34: Regenerate * autoconf/configure.in 1.34: Must terminate typedefs, duh! - from Paul D. Smith 1999-01-01 Geoff C. Wing * src/rxvt.h 1.34: In refresh loop, when we're on a space we check w/o FG colour, unless we're inversed then we check w/o BG colour & inverse attribute and move the FG colour into the BG colour position. * src/main.c 1.55: Must check position of TermWin.parent too, if we're transparent. As demonstrated by Shade function in AfterStep. * src/command.c 1.56: Transparency can't take advantage of CNQueue - yet. Needs x,y info * src/screen.c 1.63: Prototype scr_clear() * src/xpm.c 1.26: Fix XSync() arg 1998-12-31 Geoff C. Wing * src/command.c 1.55, src/main.c 1.54: Look for AfterStep background change and handle appropriately. From Sasha Vasko * configure 1.33: Regenerate * src/xpm.c 1.25, src/rxvt.h 1.33, src/screen.c 1.62, src/scrollbar.c 1.17, src/xdefaults.c 1.30, src/command.h 1.9, src/feature.h 1.17, src/main.c 1.53, src/command.c 1.54, autoconf/acconfig.h 1.19, autoconf/config.h.in 1.23, autoconf/configure.in 1.33: Integrate NeXTstep scrollbar and transparency additions from Alfredo K. Kojima 1998-12-30 Geoff C. Wing * src/Makefile.in 1.26: Distribute *.intpro and *.extpro - don't presume people have sane enough systems to be able to build them themselves. 1998-12-18 Geoff C. Wing * src/rxvt.h 1.32: Rs_cutchars is required. 1998-12-09 Geoff C. Wing * src/Makefile.in 1.25: sed -> $(SED) 1998-12-03 Geoff C. Wing * src/scrollbar.c 1.16, src/rxvt.h 1.31: Add minimum scrollbar height. Fixes bug noticed by Brian Korver 1998-11-26 Geoff C. Wing * src/Makefile.in 1.24: Missing $ * src/rsizes.h.in 1.2: Magic move: wrong name: rsizes.h -> rsizes.h.in * src/screen.c 1.61: Cosmetic change. * configure 1.32: Regenerate * autoconf/configure.in 1.32: Make default long not long long. So do checking against long long as well. * configure 1.31: Regenerate * src/graphics/Makefile.in 1.3, doc/Makefile.in 1.10, rclock/Makefile.in 1.3, Makefile.in 1.4: Add .PATH * src/Makefile.in 1.23: Be nicer to more shells * src/makeextprotos-awk 1.6, src/makeintprotos-awk 1.6: Remove old stuff * src/makeextprotos-awk 1.5, src/makeintprotos-awk 1.5: Be nicer to other awks * src/Makefile.in 1.22: Add srcdir for proto generation * autoconf/config.h.in 1.22, autoconf/configure.in 1.31: Go back to using X_PATH_XTRA() but don't pull in X_PRE_LIBS 1998-11-25 Geoff C. Wing * configure 1.30: Regenerate * src/rmemset.c 1.16, src/rsizes.h.in 1.1, src/rxvt.h 1.30, src/screen.c 1.60, src/screen.h 1.8, src/Makefile.in 1.21, src/command.h 1.8, autoconf/acconfig.h 1.18, autoconf/config.h.in 1.21, autoconf/configure.in 1.30: Do a different test for sizes of 16bit (2 byte), 32bit (4 byte), etc. Check if we've already typedef'd int16_t et al. Otherwise, typedef them in src/rsizes.h * Makefile 1.12: Regenerate * src/version.h 1.11: Bump version to 2.4.11 1998-11-23 Geoff C. Wing * src/screen.c 1.59: Fix how hate_those_clicks works on initial click. selection.beg and selection.end are set at 0 at the start so be careful to either set or use the mark position. May need to rethink setting selection.{beg,end} Fixes problem noted by Paul Slootman * src/misc.c 1.18: Cast the octal value from int to char. * src/misc.c 1.17: Better fix octal reading before anyone notices it's broken. * src/command.c 1.53: Remove double comment * doc/BUGS 1.6: Describe problem with menubar autoraising better. 1998-11-22 Geoff C. Wing * doc/BUGS 1.5: Verbose 1998-11-21 Geoff C. Wing * src/command.c 1.52: Close off any file descriptors we don't actually use in rxvt (not the child) and set num_fds to be our maximum (plus one) file descriptor so that select() only passes over those ones. Maybe in future, look at something better that FD_ZERO in cmd_getc() all the time. 1998-11-20 Geoff C. Wing * src/command.c 1.51: Typo is #ifdef . Define variable for loop. * src/screen.c 1.58: Initialise selection.len or we can coredump if paste after ESC-c * src/logging.h 1.5: Protect logging.intpro inclusion by #ifdef UTMP_SUPPORT 1998-11-19 Geoff C. Wing * src/screen.c 1.57: Have to do foreground and background cursor colour settings separately. * src/makeextprotos-awk 1.4, src/makeintprotos-awk 1.4: Got carried away quoting. Remove the incorrect backslashes. * src/makeextprotos-awk 1.3, src/makeintprotos-awk 1.3: Try different escaping method 1998-11-18 Geoff C. Wing * Makefile 1.11: Regenerate * autoconf/Make.common.in 1.6: Remove RCS Id tag * doc/Makefile.in 1.9: Dependences * Makefile 1.10: Regenerate * src/version.h 1.10: can we spell? s/NOVERMBER/NOVEMBER/ * src/version.h 1.9: bump version to 2.4.10 * doc/changes.txt 1.9: note changes * src/xpm.c 1.24: Remove testing stuff which was committed accidentally 1998-11-17 Geoff C. Wing * src/xpm.c 1.23: Merge in branch: fix-bufpixmap * src/screen.c 1.56, src/feature.h 1.16, src/main.c 1.52, src/rxvt.h 1.29: Optimisation for local display * src/screen.c 1.55: Try to do fewer XDrawString() type calls. * src/main.c 1.51: Move scr_touch() out of xpm.c * configure 1.29: Regenerate * autoconf/Make.common.in 1.5, autoconf/config.h.in 1.20, autoconf/configure.in 1.29: Use AC_PATH_X not AC_PATH_XTRA so we don't link in libSM and libICE * src/command.c 1.50: Small cleanups. * src/misc.c 1.16: Clean up. Rewrite part of Str_escaped() 1998-11-16 Geoff C. Wing * src/scrollbar.c 1.15: Optimise button drawing w.r.t. space - combine two similar functions * src/screen.c 1.54: Fix scr_printscreen() * src/command.c 1.49, src/main.c 1.50: Clean up. Trim the fat. * src/screen.c 1.53, src/screen.h 1.7: Move some items from screen.h to screen.c * src/xpm.c 1.22: Make xpmAttr static, thus local. * src/main.c 1.49, src/menubar.c 1.24, src/scrollbar.c 1.14: Fix up geometry calculations and mapping order * src/main.c 1.48: Move routines a bit. Small cleanup. * src/main.c 1.47, src/menubar.c 1.23, src/rxvt.h 1.28, src/scrollbar.c 1.13: Reorganise code for mapping of windows. Remove delay_menu_drawing hack. Still more to do. * src/command.c 1.48, src/command.h 1.7: Remove dynamic allocation of cmdbuf_base[]. Make as BSS * src/xdefaults.c 1.29, src/xpm.c 1.21, src/misc.c 1.15, src/screen.c 1.52, src/graphics.c 1.17, src/main.c 1.46, src/menubar.c 1.22, src/command.c 1.47: Const poisoning. Rearrange main.c a bit. * src/rxvt.h 1.27: Const poisoning. 1998-11-15 Geoff C. Wing * src/command.h 1.6, src/command.c 1.46: Dynamic allocation of cmdbuf_base * src/menubar.c 1.21, src/misc.c 1.14, src/xpm.c 1.20: Dynamic allocation in File_search_path(), thus File_find() now returns a string which needs to be free()d. * src/screen.c 1.51, src/xdefaults.c 1.28, src/command.c 1.45, src/graphics.c 1.16, src/main.c 1.45: Cast formatting. Const poisoning. Small cleanups. * src/feature.h 1.15: Allow PRINT_PIPE by default * src/command.c 1.44: proto format * src/screen.c 1.50: Cleanup blank_screen_mem() and slight macro name change * src/command.c 1.43, src/graphics.c 1.15, src/screen.c 1.49: Cast arg 1 in tt_printf() calls * src/makeintprotos-awk 1.2, src/makeextprotos-awk 1.2: Format returns slightly nicer * src/xpm.c 1.19, src/logging.c 1.6, src/main.c 1.44, src/menubar.c 1.20, src/screen.c 1.48, src/xdefaults.c 1.27, src/command.c 1.42, src/graphics.c 1.14: Const poisoning and small protos cleanup * src/makeextprotos-awk 1.1, src/makeintprotos-awk 1.1: Awk versions of makeextprotos-sed and makeintprotos-sed * src/Makefile.in 1.20: Use awk not sed to generate protos * configure 1.28: Regenerate * autoconf/Make.common.in 1.4, autoconf/configure.in 1.28: Check for AWK as well. 1998-11-13 Geoff C. Wing * src/xdefaults.c 1.26: usage(): output "graphics" if compiled in * src/screen.c 1.47: Remove unused change to rendition pointer. * src/graphics/qplot.c 1.3, src/graphics/grxlib.c 1.3: Remove rcsid[]. Add commented Id strings. * src/main.c 1.43: Missing #ifdef XPM_BACKGROUND and #if (MENUBAR_MAX) 1998-11-12 Geoff C. Wing * src/scrollbar.c 1.12, src/xdefaults.c 1.25, src/xpm.c 1.18, src/grkelot.c 1.10, src/logging.c 1.5, src/main.c 1.42, src/menubar.c 1.19, src/misc.c 1.13, src/netdisp.c 1.9, src/rmemset.c 1.15, src/screen.c 1.46, src/command.c 1.41, src/graphics.c 1.13: Add back Id strings, as comments this time. * src/screen.c 1.45: Invert selection before checking for bold overstrike pixel droppings. * src/feature.h 1.14, src/main.c 1.41: Allow setting of basic colours in feature.h * src/grkelot.h 1.4, src/logging.c 1.4, src/main.c 1.40, src/misc.c 1.12, src/netdisp.c 1.8, src/rmemset.c 1.14, src/screen.c 1.44, src/xdefaults.c 1.24, src/xpm.c 1.17, src/command.c 1.40, src/graphics.c 1.12, src/grkelot.c 1.9: Copyright notice changes. 1998-11-11 Geoff C. Wing * src/command.c 1.39, src/misc.c 1.11: Clean up. Be nicer with assignments. 1998-11-10 Geoff C. Wing * src/xdefaults.c 1.23: Tidy const some more. * src/main.c 1.39: Fix up consts. * src/xdefaults.c 1.22: Rearrange optList[] a bit. Fix up consts. * src/command.c 1.38, src/screen.c 1.43: Swap scroll_text() and scr_scroll_text() so that scr_scroll_text() is now the external call name. 1998-11-09 Geoff C. Wing * src/main.c 1.38, src/netdisp.c 1.7: Fix up DISPLAY_IS_IP - #ifdef in the wrong spot, and fix a couple of assignments * src/main.c 1.37, src/xdefaults.c 1.21: Add some /* NOTREACHED */ 1998-11-02 Geoff C. Wing * doc/LSM.in 1.4: Update size * Makefile 1.9: Regen. * src/version.h 1.8: bump version to 2.4.9 1998-10-29 Geoff C. Wing * src/Makefile.in 1.19, src/main.c 1.36, src/version.h 1.7: No ident strings * doc/changes.txt 1.8: Update * Makefile 1.8: Regen * src/main.c 1.35: Remove identstring[] * src/version.h 1.6: Bump to 2.4.8b * src/Makefile.in 1.18: Fix dependencies on version.h * configure 1.27: Regenerate * autoconf/config.h.in 1.19: Regen. * src/logging.c 1.3, src/logging.h 1.4, autoconf/acconfig.h 1.17, autoconf/configure.in 1.27: Try harder to detect utmp/utmpx stuff 1998-10-28 Geoff C. Wing * doc/yodl/rxvtRef-xpm.yo 1.6: Revert - reflects current & old behaviour 1998-10-26 Geoff C. Wing * src/command.c 1.37: Malloc on fly some tmp stuff. Bound it. * src/xpm.c 1.16, src/graphics.c 1.11, src/grkelot.c 1.8, src/logging.c 1.2, src/main.c 1.34, src/menubar.c 1.18, src/misc.c 1.10, src/netdisp.c 1.6, src/rmemset.c 1.13, src/screen.c 1.42, src/scrollbar.c 1.11, src/xdefaults.c 1.20, src/command.c 1.36: Remove rcsid[] strings - just leave one in main.c * src/xdefaults.c 1.19, src/menubar.c 1.17, src/misc.c 1.9, src/rxvt.h 1.26, src/screen.c 1.41, src/command.c 1.35, src/main.c 1.33: Resource variable name change. Also set up resource variables in one for() loop, rather than scattered everywhere. * src/command.c 1.34, src/command.h 1.5, src/main.c 1.32, src/rxvt.h 1.25: Move window_ops() from main.c to command.c as process_window_ops() * src/graphics.c 1.10: Gr_ButtonReport() is accessed externally, so change INTPROTO -> EXTPROTO * src/screen.c 1.40: In OLD_SELECTION, we run around the mark, not the beginning. * src/command.c 1.33: Free X modifier map after we're finished with it. * autoconf/config.h.in 1.18, configure 1.26: Regenerate * README.configure 1.6: Recomment for --disable-{new,old}-selection * src/screen.h 1.6, src/xdefaults.c 1.18, doc/yodl/rxvt-resources.yo 1.11, src/main.c 1.31, src/rxvt.h 1.24, src/screen.c 1.39, autoconf/acconfig.h 1.16, autoconf/configure.in 1.26: Allow compilation of old_selection/old_word_selection/new_selection Choice via resource 'selectstyle' - defaults to new. Possible settings "OLD" and "OLDWORD" (case insensitive). * src/Makefile.in 1.17: Another go at dependencies * src/Makefile.in 1.16: Get this dependency stuff working. * src/command.c 1.32, src/main.c 1.30, src/rxvt.h 1.23, src/xdefaults.c 1.17, doc/yodl/rxvt-resources.yo 1.10: Probe for Meta and NumLock mappings. ModMeta and ModNumLock resources have gone away. 1998-10-24 Geoff C. Wing * src/menubar.h 1.3, src/misc.c 1.8, src/netdisp.h 1.3, src/protos.h 1.7, src/rmemset.c 1.12, src/screen.c 1.38, src/scrollbar.c 1.10, src/xdefaults.c 1.16, src/xpm.h 1.4, src/Makefile.in 1.15, src/command.h 1.4, src/graphics.c 1.9, src/grkelot.c 1.7, src/logging.h 1.3, src/main.c 1.29, configure 1.25, autoconf/configure.in 1.25: Don't like this protos directory procedure * src/command.c 1.31, src/feature.h 1.13: Make scrolling via mouse wheel smoother * autoconf/config.h.in 1.17, configure 1.24: Regenerate * src/command.h 1.3, autoconf/acconfig.h 1.15, autoconf/configure.in 1.24, src/command.c 1.30: Better checking for Xsetlocale(), setlocale() from Stanislav Meduna 1998-10-22 Geoff C. Wing * src/Makefile.in 1.14: Change dependencies * src/Makefile.in 1.13: Clean up. * src/Makefile.in 1.12: Different method of not overmaking targets * autoconf/Make.common.in 1.3, autoconf/configure.in 1.23, Makefile 1.7, configure 1.23: Add checks for ECHO and CMP * src/main.c 1.28, src/protos.h 1.6: Clean up #ifdef DISPLAY_IS_IP * src/menubar.c 1.16: Now that we know which are internal routines, improve placement of #ifdef's * src/rmemset.c 1.11: Cast type correctly * src/screen.c 1.37: Remove unused variable * src/main.c 1.27: Lint picking * src/Makefile.in 1.11: Whoops. Wrong target in protos/ * Makefile 1.6: Regen * doc/Makefile.in 1.8: Update distribution list * doc/yodl/versioninfo.yo 1.6: Generated file * configure 1.22, autoconf/configure.in 1.22: Subst some more files. * doc/Makefile.in 1.7: Clean up some srcdir's * doc/yodl/rxvtRef.yo.in 1.2: yucky chdir() * doc/yodl/rxvt.yo.in 1.2: Twisted are the ways of vpaths * doc/yodl/rxvt.yo.in 1.1, doc/yodl/rxvtRef.yo.in 1.1: Have to set paths at configure time. * doc/yodl/rxvt.yo 1.3, doc/yodl/rxvtRef.yo 1.3: Have to set paths at configure time * src/Makefile.in 1.10: Typo * src/Makefile.in 1.9: it's ``be kind to gmake week'' * src/Makefile.in 1.8: Handle dependence better * src/logging.h 1.2, src/main.c 1.26, src/menubar.h 1.2, src/misc.c 1.7, src/netdisp.h 1.2, src/protos.h 1.5, src/rmemset.c 1.10, src/screen.c 1.36, src/scrollbar.c 1.9, src/xdefaults.c 1.15, src/xpm.h 1.3, src/Makefile.in 1.7, src/command.h 1.2, src/graphics.c 1.8, src/grkelot.c 1.6: Rearrange protos into their own directory. 1998-10-21 Geoff C. Wing * src/xpm.h 1.2, src/xpm.c 1.15: Cleanup. * src/makeprotos-sed 1.3: Changed to similar files: makeintprotos-sed & makeextprotos-sed * src/utmp.c 1.5, src/scrollbar.c 1.8, src/xdefaults.c 1.14, src/xpm.c 1.14, src/rmemset.c 1.9, src/screen.c 1.35, src/command.c 1.29, src/graphics.c 1.7, src/grkelot.c 1.5, src/logging.c 1.1, src/main.c 1.25, src/menubar.c 1.15, src/misc.c 1.6, src/netdisp.c 1.5, src/Makefile.in 1.6, src/command.h 1.1, src/feature.h 1.12, src/logging.h 1.1, src/menubar.h 1.1, src/netdisp.h 1.1, src/protos.h 1.4, src/rxvt.h 1.22, src/xpm.h 1.1: Reorganise source: Change PROTO to INTPROTO or EXTPROTO depending on whether it is only called from this source file or also from external files. Move unnecessary stuff out of common rxvt.h into own local header files. * src/makeextprotos-sed 1.1, src/makeintprotos-sed 1.1: Break up protos into those for local and external use * doc/rxvtRef.txt 1.7, doc/rxvt.1 1.11, doc/rxvt.html 1.10, doc/rxvt.pretbl 1.4, doc/rxvtRef.html 1.6: Generated files. Don't bother keeping in CVS. * doc/Makefile.in 1.6: rename rxvt.pretbl to rxvt.tbl 1998-10-20 Geoff C. Wing * src/menubar.c 1.14: change debug printf() to fprintf(stderr,) - reindent file. 1998-10-19 Geoff C. Wing * src/screen.c 1.34: blend make_screen_mem()/blank_line() into blank_screen_mem() to make us a bit safer. Rename scroll_text() to scr_scroll_text() and make scroll_text() a somewhat safer (w.r.t. memory allocation) counterpart. * src/command.c 1.28: Add CSI "T","^" and CSI "S" for scroll/pan down and scroll up * src/main.c 1.24: Window reporting functions a la XTerm * src/command.c 1.27, src/main.c 1.23, src/rxvt.h 1.21, src/screen.c 1.33: Clean up some const-ness 1998-10-06 Geoff C. Wing * src/command.c 1.26: Typos in cursor movement via CSI "A" * src/command.c 1.25: Typos in cursor movement via CSI "E" & "F": CPL & CNL * src/feature.h 1.11: Add NO_FRILLS define 1998-10-05 Geoff C. Wing * src/main.c 1.22: Change CNQueue manipulation slightly. Better check on screen resizing. * src/command.c 1.24, src/main.c 1.21: Clean up CSI number passing. Discard ConfigureNotify events we caused. Handle certain CSI window operations a la XTerm. 1998-10-02 Geoff C. Wing * src/command.c 1.23, src/screen.c 1.32: Fix scr_tab() - though not yet parsing for scr_tab(0) Add DECBI/DECFI backindex/forwardindex 1998-10-01 Geoff C. Wing * src/menubar.c 1.13: Resize menubar triangles. * src/screen.c 1.31: Fix outline cursor position calculation and check. * src/command.c 1.22: Rename rs_modifier to rs_modmeta. Add rs_modnumlock. Clean up some left over Mod1Mask bogons. Fix up mouse reporting. * src/rxvt.h 1.20, doc/yodl/rxvt-resources.yo 1.9, src/main.c 1.20, src/xdefaults.c 1.13: Rename rs_modifier to rs_modmeta. Add rs_modnumlock. * src/menubar.c 1.12: Add a pixel vertical space on either side of text. Use a couple of macros to clarify. 1998-09-30 Geoff C. Wing * src/menubar.c 1.11: Fix up menubar display - some funny calculations were going on previously * src/main.c 1.19, src/misc.c 1.5, src/command.c 1.21: Tidy up. * src/menubar.c 1.10: Change calculations for separator lines so HALFSHADOW also works. 1998-09-26 Geoff C. Wing * autoconf/acconfig.h 1.14, autoconf/config.h.in 1.16, autoconf/configure.in 1.21, configure 1.21: Readd --disable-resources and fix typo * src/screen.c 1.30: More diligent in checking selection 1998-09-24 Geoff C. Wing * doc/TODO 1.6: update. * src/main.c 1.18: Interpret backspace/delete resources * rxvt-2.4.6.lsm 1.3: Don't want this. * doc/LSM.in 1.3, doc/rxvt.1 1.10, doc/rxvt.html 1.9, doc/rxvt.pretbl 1.3, doc/yodl/versioninfo.yo 1.5, Makefile 1.5: Version 2.4.8 * src/version.h 1.5: bump version to 2.4.8 * src/xdefaults.c 1.12: Change reporting of backspace/delete * README.configure 1.5: Document backspace/delete --enable/--disable * autoconf/configure.in 1.20, configure 1.20: Tidy spacing * src/command.c 1.20: Shouldn't set PrivMode_BackSpace initially. * doc/changes.txt 1.7: Update * doc/yodl/rxvt-resources.yo 1.8, doc/rxvt.1 1.9, doc/rxvt.html 1.8, doc/rxvt.pretbl 1.2: Document resources `backspacekey' and `deletekey' * src/command.c 1.19, src/feature.h 1.10, src/main.c 1.17: Better handling of backspace - now use traditional settings if the resource is unset. * src/rxvt.h 1.19, src/xdefaults.c 1.11, src/command.c 1.18, src/feature.h 1.9, src/main.c 1.16: Make backspace/delete key handling configurable via resources * autoconf/acconfig.h 1.13, autoconf/config.h.in 1.15, autoconf/configure.in 1.19, configure 1.19: Reverse handling of backspace/delete keys (and it was broken anyway) * autoconf/acconfig.h 1.12, autoconf/config.h.in 1.14, autoconf/configure.in 1.18, configure 1.18: Add --enable-backspace and --enable-delete * src/command.c 1.17: Use NO_SETLOCALE define and cleanup. * autoconf/acconfig.h 1.11, autoconf/config.h.in 1.13, autoconf/configure.in 1.17, configure 1.17: Add check for setlocale() - which usually gets defined to _Xsetlocale() by X * src/command.c 1.16: Cleanup init_xlocale() a bit * src/main.c 1.15: Don't change pointer colour on change of default fg colour. * src/screen.c 1.29: Better bounds comparison in scroll_text() * src/screen.c 1.28: selection_extend_colrow() - hmm, why were we setting begin to mark if we're in the first line? * src/screen.c 1.27: Clean up some MULTICHAR_SET stuff. Fix cursor for MULTICHAR_SET * src/screen.c 1.26: Avoid leaving an out-of-date outline cursor on the screen 1998-09-23 Geoff C. Wing * src/screen.c 1.25: More selection checks: scr_erase_screen() * src/screen.c 1.24: Clean up some selection checks * src/screen.c 1.23: Try a better selection check in scr_add_lines() - check for writing inside a selection area. Remove bogon #ifdef CHAR_SETS 1998-09-22 Geoff C. Wing * src/screen.c 1.22: Keep the reverse video when resizing the screen * src/screen.c 1.21, src/screen.h 1.5: Moved too much into screen.h so move some back. * src/screen.c 1.20: Have to set the selection screen when we _start_ selecting. * src/screen.c 1.19: Forgot to set default flags for swap screen. * src/screen.c 1.18, src/screen.h 1.4, src/rxvt.h 1.18: Change some types * INSTALL 1.6: Update notes about editing config.h on cross-compile * src/screen.c 1.17: Cleanup. * src/Makefile.in 1.5: Add distribution of screen.h Depend screen.c on screen.h * src/screen.c 1.16: Clean up multichar handling of cursor display. Fix scr_insdel_lines() shifting selection. Break up selection reversing screen.rend into its own routine. * src/screen.h 1.3: Remove unused variables * src/rxvt.h 1.17, src/screen.c 1.15, src/screen.h 1.2, src/main.c 1.14: Remove RS_Cursor/RS_Select - handle differently Default cursorColor/cursorColor2/colorBD/colorUL to the appropriate _current_ settings if unset. * src/screen.h 1.1: Split up some defines for screen.c - allow manipulation from outside. * src/xdefaults.c 1.10, src/rxvt.h 1.16: Start removing CHAR_SETS - always have ACS graphics/UK char sets now that RS_Cursor and RS_Select are being removed. Split some of rxvt.h into screen.h - make import of Nat Friedman's Dingus easier. * autoconf/acconfig.h 1.10, autoconf/config.h.in 1.12, autoconf/configure.in 1.16, README.configure 1.4, configure 1.16: Remove --enable-small : it is now automatic * autoconf/configure.in 1.15, configure 1.15: Report on which types will be used for 16bit/32bit/pointer 1998-09-21 Geoff C. Wing * autoconf/acconfig.h 1.9, autoconf/config.h.in 1.11, autoconf/configure.in 1.14, src/rmemset.c 1.7, src/rxvt.h 1.15, configure 1.14: Move size type checking into configure * autoconf/config.h.in 1.10, autoconf/configure.in 1.13, configure 1.13: Add check for sizeof(int *) * src/screen.c 1.14: Not again, and it's #if not #ifdef * src/screen.c 1.13: Whoops, NSWAP is really NSCREENS * doc/TODO 1.5: Fixed Xlocale. Add note about char/short/int/long sizes * src/Makefile.in 1.4, src/command.c 1.15: Remove DEBUG_SELECTION define 1998-09-20 Geoff C. Wing * INSTALL 1.5: Update info about doc/rxvt.pretbl * doc/Makefile.in 1.5: Remove RMF in rxvt.1 rule * doc/Makefile.in 1.4: Make rxvt.pretbl a target and depend rxvt.1 on it. * src/xpm.c 1.13: Resurrect negative positioning. * src/main.c 1.13: Remove inline's * Makefile.in 1.3: Distribute README.configure * INSTALL 1.4, README.configure 1.3: Update memory stuff a bit and point INSTALL to README.configure * doc/rxvt.pretbl 1.1: Manual page before being run through tbl * doc/yodl/rxvt-resources.yo 1.7, doc/rxvt.1 1.8, doc/rxvt.html 1.7: Document modifier resource * doc/Makefile.in 1.3: Depend rxvt.1 better and leave pre-tbl version * configure 1.12, autoconf/configure.in 1.12: Fix check for Xlocale stuff. Be a bit nicer on cross compiles * src/rxvt.h 1.14: rmemset() uses longs now, not integers * src/rmemset.c 1.6: Use longs now, not integers. * src/xpm.c 1.12: scale_pixmap() returns 0 if XPM_BACKGROUND not defined 1998-09-19 Geoff C. Wing * src/xpm.c 1.11: Cleanup. * doc/changes.txt 1.6: Refix XPM position * src/xpm.c 1.10, doc/yodl/rxvt-resources.yo 1.6, doc/yodl/rxvtRef-xpm.yo 1.5, doc/rxvt.html 1.6, doc/rxvtRef.html 1.5, doc/rxvtRef.txt 1.6, doc/rxvt.1 1.7: Refix handling of positioning in pixmap geometry * README.configure 1.2: Document --enable-half-shadow * src/feature.h 1.8: Turn off SB_BORDER by default * doc/changes.txt 1.5: sync * src/main.c 1.12: Border pixel should be foreground colour, not background colour * autoconf/acconfig.h 1.8, autoconf/configure.in 1.11, src/feature.h 1.7, configure 1.11: Move HALFSHADOW from src/feature.h to ./configure * src/command.c 1.14: Formatting * autoconf/config.h.in 1.9: Regen OLD_SELECTION, OLD_WORD_SELECTION, HALFSHADOW * doc/yodl/rxvt-resources.yo 1.5, doc/rxvt.1 1.6, doc/rxvt.html 1.5, src/rxvt.h 1.13, src/xdefaults.c 1.9, src/main.c 1.11, src/scrollbar.c 1.7: Add troughColor and appropriate resource as colour of scrollbar trough area * doc/BUGS 1.4: Note bug in selection with swap screen use. * doc/BUGS 1.3: Fixed XPM * doc/TODO 1.4: Update to current status. * README.configure 1.1: Start adding slightly better documentation for the ./configure options * autoconf/configure.in 1.10, src/feature.h 1.6, configure 1.10: Move OLD_SELECTION and OLD_WORD_SELECTION into ./configure * autoconf/configure.in 1.9, configure 1.9: Stupidly used the wrong enable names in autoconf/configure.in * autoconf/acconfig.h 1.7, autoconf/config.h.in 1.8, autoconf/configure.in 1.8, src/feature.h 1.5, configure 1.8: Move USE_XGETDEFAULTS and NO_RESOURCES from src/feature.h to ./configure 1998-09-15 Geoff C. Wing * src/xpm.c 1.9: Clean up code/comments 1998-09-14 Geoff C. Wing * src/screen.c 1.12: Display fixes. Pixel dropping fix - now go backwards in the check since we don't want to overwrite what we're going to test next. 1998-09-04 Geoff C. Wing * doc/changes.txt 1.4: Document XPM changes * doc/rxvt.1 1.5, doc/yodl/rxvt-resources.yo 1.4, doc/yodl/rxvtRef-xpm.yo 1.4, src/xpm.c 1.8, doc/rxvtRef.txt 1.5, doc/rxvt.html 1.4, doc/rxvtRef.html 1.4: Change default XPM geom to 0x0-0-0: x/y position of -0 means centre pixmap in that axis * doc/yodl/rxvt-resources.yo 1.3, doc/yodl/rxvtRef-xpm.yo 1.3, src/xpm.c 1.7, doc/rxvt.1 1.4, doc/rxvtRef.txt 1.4: Change XPM geometry defaults and handling. When not tiled in a direction then a position of 0 means centred. Handle negative positions as being from the right/bottom of the window. Use X's tiling for base tiling. We should use more of it (future changes) 1998-08-29 Geoff C. Wing * src/screen.c 1.11, src/scrollbar.c 1.6, src/xdefaults.c 1.8, src/xpm.c 1.6, src/graphics.c 1.6, src/main.c 1.10, src/menubar.c 1.9, src/rxvt.h 1.12, src/command.c 1.13: Update colour name definitions 1998-08-28 Geoff C. Wing * doc/TODO 1.3: More stuff * doc/changes.txt 1.3: Update for 2.4.7 * src/feature.h 1.4: No default FORCE_* * Makefile 1.4, configure 1.7: Regenerate * src/grkelot.h 1.3: nitpick * doc/yodl/versioninfo.yo 1.4, doc/rxvt.1 1.3, doc/rxvt.html 1.3, doc/rxvtRef.html 1.3, doc/rxvtRef.txt 1.3: Regenerate * autoconf/acconfig.h 1.6, autoconf/config.h.in 1.7, autoconf/configure.in 1.7, src/rxvt.h 1.11: Rename SMALL to SMALLREND * src/xdefaults.c 1.7, src/xpm.c 1.5, src/scrollbar.c 1.5, src/utmp.c 1.4, src/misc.c 1.4, src/netdisp.c 1.4, src/rmemset.c 1.5, src/screen.c 1.10, src/graphics.c 1.5, src/grkelot.c 1.4, src/main.c 1.9, src/menubar.c 1.8, src/command.c 1.12: Attribute authors better * src/version.h 1.4: bump version to 2.4.7 1998-08-10 Geoff C. Wing * src/xpm.c 1.4, src/rxvt.h 1.10: Move xpm.h include into xpm.c * src/screen.c 1.9, src/command.c 1.11: Clean up some prototypes. 1998-08-09 Geoff C. Wing * src/screen.c 1.8: Fix test which was changed with RS_Dirty removal. * autoconf/config.h.in 1.6: RMEMSET 1998-08-08 Geoff C. Wing * src/screen.c 1.7: Whoops. Set **drawn_text to 0, not OR it * src/rxvt.h 1.9, autoconf/configure.in 1.6, autoconf/acconfig.h 1.5, configure 1.6: Add --disable-memset routine to use system's memset routine. * src/screen.c 1.6, src/rxvt.h 1.8, autoconf/configure.in 1.5, autoconf/config.h.in 1.5, autoconf/acconfig.h 1.4, configure 1.5: First cut --enable-small to shrink rend_t if possible * src/xpm.c 1.3, src/menubar.c 1.7: Clean up some #ifdef's to commit out procedure body's * autoconf/configure.in 1.4, autoconf/config.h.in 1.4, configure 1.4, INSTALL 1.3: Check for sizeof(char), sizeof(short), sizeof(long) * src/scrollbar.c 1.4, src/menubar.c 1.6, src/main.c 1.8: Move some stuff out of main.c into menubar.c & scrollbar.c * src/graphics.c 1.4, src/rxvt.h 1.7: Move XPM defines out of graphics.c * src/main.c 1.7: Remove some XPM and MenuBar stuff. * src/menubar.c 1.5: Move map_menuBar() here * src/xdefaults.c 1.6: Indent * src/command.c 1.10, src/feature.h 1.3, configure 1.3, autoconf/configure.in 1.3, autoconf/config.h.in 1.3, autoconf/acconfig.h 1.3: Move some options into configure 1998-08-07 Geoff C. Wing * src/Makefile.in 1.3: Add xpm.c stuff * src/main.c 1.6, src/xpm.c 1.2: Id * src/protos.h 1.3: Add xpm.pro * src/main.c 1.5: Split XPM only routines out of here * src/xpm.c 1.1: Split XPM only routines out of main.c 1998-07-28 Geoff C. Wing * src/rxvt.h 1.6, src/xdefaults.c 1.5, src/scrollbar.c 1.3, src/utmp.c 1.3, src/screen.c 1.5, src/misc.c 1.3, src/netdisp.c 1.3, src/rmemset.c 1.4, src/main.c 1.4, src/menubar.c 1.4, src/graphics.c 1.3, src/grkelot.c 1.3, src/command.c 1.9: Partially delint * src/screen.c 1.4: REMALLOC() -> REALLOC() 1998-07-20 Geoff C. Wing * doc/yodl/versioninfo.yo 1.3, Makefile 1.3: 2.4.7a * src/version.h 1.3: bump version to 2.4.7a * doc/yodl/rxvtRef-menubar.yo 1.3: Typo * src/rxvt.h 1.5, src/menubar.c 1.3, src/xdefaults.c 1.4, src/command.c 1.8: REMALLOC() --> REALLOC() 1998-07-18 Geoff C. Wing * src/command.c 1.7: REALLOC() --> REMALLOC() 1998-07-17 Geoff C. Wing * src/screen.c 1.3: Be careful with swap too. * src/rmemset.c 1.3: Optimise slightly. * src/command.c 1.6: Small cleanup. * src/command.c 1.5: Let print mode accept ESC sequence variation: John E. Davis 1998-07-16 Geoff C. Wing * src/rxvt.h 1.4, src/xdefaults.c 1.3, src/main.c 1.3, src/command.c 1.4: Meta Modifier selectable via resource: Guillaume Laurent * src/command.c 1.3: malloc() -> MALLOC() 1998-04-20 Geoff C. Wing * src/graphics/README 1.2, src/graphics/data 1.2: Add rcsid[] strings * src/version.h 1.2: bump version to 2.4.6 * src/.indent.pro 1.2, src/gcc-Wall 1.2, rclock/rclock.c 1.2, rclock/rclock.html 1.2, rclock/Makefile.in 1.2, rclock/feature.h 1.2, rclock/rclock.1.in 1.2, doc/menu/rxvt.menu 1.2, doc/menu/terminal.menu 1.2, doc/menu/menu 1.2, doc/menu/jedmenu.sl 1.2, doc/menu/example.menu 1.2, doc/etc/rxvt.termcap 1.2, doc/etc/rxvt.terminfo 1.2, doc/etc/XTerm.ad 1.2: Add rcsid[] strings * doc/rxvtRef.txt 1.2: *** empty log message *** * doc/rxvtRef-toc.html 1.2, doc/xterm.seq 1.2, doc/TODO 1.2, doc/changes.txt 1.2, doc/rxvtRef-frame.html 1.2, doc/LSM.in 1.2, doc/README.greek 1.2, doc/README.menu 1.2, doc/README.xvt 1.2, doc/BUGS 1.2, doc/FAQ 1.2, autoconf/acconfig.h 1.2, autoconf/install-sh 1.2, autoconf/mkinstalldirs 1.2: Add rcsid[] strings * rxvt-2.4.6.lsm 1.2: *** empty log message *** * INSTALL 1.2, configure 1.2, src/protos.h 1.2, src/rxvt.h 1.2, src/rxvtgrx.h 1.2: Add rcsid[] strings * src/makeprotos-sed 1.2: *** empty log message *** * src/feature.h 1.2, src/grkelot.h 1.2, src/command.c 1.2, src/graphics/grxlib.h 1.2, src/graphics/qplot.c 1.2, src/graphics/Makefile.in 1.2, src/graphics/grxlib.c 1.2, src/xdefaults.c 1.2: Add rcsid[] strings * src/utmp.c 1.2: *** empty log message *** * src/netdisp.c 1.2, src/rmemset.c 1.2, src/scrollbar.c 1.2, src/menubar.c 1.2, src/misc.c 1.2, src/main.c 1.2, src/graphics.c 1.2, src/grkelot.c 1.2, src/Makefile.in 1.2, doc/yodl/versioninfo.yo.in 1.2: Add rcsid[] strings * doc/yodl/rxvtRef.yo 1.2, doc/yodl/versioninfo.yo 1.2: *** empty log message *** * doc/yodl/rxvtRef-values.yo 1.2, doc/yodl/rxvtRef-xpm.yo 1.2, doc/yodl/rxvtRef-xterm.yo 1.2, doc/yodl/rxvtRef-mouse.yo 1.2, doc/yodl/rxvtRef-privatemodes.yo 1.2, doc/yodl/rxvtRef-sequences.yo 1.2, doc/yodl/rxvtRef-definitions.yo 1.2, doc/yodl/rxvtRef-graphics.yo 1.2, doc/yodl/rxvtRef-keycodes.yo 1.2, doc/yodl/rxvtRef-menubar.yo 1.2: Add rcsid[] strings * doc/yodl/rxvt.yo 1.2: *** empty log message *** * doc/yodl/rxvt-scrollbar.yo 1.2, doc/yodl/rxvt-textselection.yo 1.2, doc/yodl/rxvtRef-csi.yo 1.2, doc/yodl/rxvt-login.yo 1.2, doc/yodl/rxvt-mousereporting.yo 1.2, doc/yodl/rxvt-options.yo 1.2, doc/yodl/rxvt-resources.yo 1.2, doc/yodl/rxvt-colours.yo 1.2, doc/yodl/rxvt-environment.yo 1.2, doc/yodl/rxvt-files.yo 1.2, doc/yodl/rxvt-fonts.yo 1.2, doc/yodl/masonyodl.yo 1.2: Add rcsid[] strings * doc/rxvtRef.html 1.2, doc/rxvt.1 1.2, doc/rxvt.html 1.2: *** empty log message *** * doc/Makefile.in 1.2, autoconf/configure.in 1.2, autoconf/Make.common.in 1.2, autoconf/aclocal.m4 1.2, autoconf/config.h.in 1.2, Makefile 1.2, Makefile.in 1.2, src/screen.c 1.2: Add rcsid[] strings * doc/yodl/rxvtRef-xterm.yo 1.1, doc/yodl/versioninfo.yo 1.1, rclock/Makefile.in 1.1, rclock/feature.h 1.1, rclock/rclock.1.in 1.1, rclock/rclock.c 1.1, rclock/rclock.html 1.1, doc/menu/menu 1.1, doc/yodl/masonyodl.yo 1.1, doc/yodl/rxvt-colours.yo 1.1, doc/yodl/rxvt-environment.yo 1.1, doc/yodl/rxvt-files.yo 1.1, doc/yodl/rxvt-fonts.yo 1.1, doc/yodl/rxvt-login.yo 1.1, doc/yodl/rxvt-mousereporting.yo 1.1, doc/yodl/rxvt-options.yo 1.1, doc/yodl/rxvt-resources.yo 1.1, doc/yodl/rxvt-scrollbar.yo 1.1, doc/yodl/rxvt-textselection.yo 1.1, doc/yodl/rxvt.yo 1.1, doc/yodl/rxvtRef-csi.yo 1.1, doc/yodl/rxvtRef-definitions.yo 1.1, doc/yodl/rxvtRef-graphics.yo 1.1, doc/yodl/rxvtRef-keycodes.yo 1.1, doc/yodl/rxvtRef-menubar.yo 1.1, doc/yodl/rxvtRef-mouse.yo 1.1, doc/yodl/rxvtRef-privatemodes.yo 1.1, doc/yodl/rxvtRef-sequences.yo 1.1, doc/yodl/rxvtRef-values.yo 1.1, doc/yodl/rxvtRef-xpm.yo 1.1, doc/yodl/rxvtRef.yo 1.1, doc/yodl/versioninfo.yo.in 1.1, doc/BUGS 1.1, doc/FAQ 1.1, doc/README.greek 1.1, doc/README.menu 1.1, doc/README.xvt 1.1, doc/TODO 1.1, doc/changes.txt 1.1, doc/etc/XTerm.ad 1.1, doc/etc/rxvt.termcap 1.1, doc/etc/rxvt.terminfo 1.1, doc/menu/example.menu 1.1, doc/menu/jedmenu.sl 1.1, doc/menu/rxvt.menu 1.1, doc/menu/terminal.menu 1.1, doc/rxvt.html 1.1, doc/LSM.in 1.1, doc/Makefile.in 1.1, doc/rxvt.1 1.1, doc/rxvtRef-frame.html 1.1, doc/rxvtRef-toc.html 1.1, doc/rxvtRef.html 1.1, doc/rxvtRef.txt 1.1, doc/xterm.seq 1.1, src/graphics/Makefile.in 1.1, src/graphics/README 1.1, src/graphics/data 1.1, src/graphics/grxlib.c 1.1, src/graphics/grxlib.h 1.1, src/graphics/qplot.c 1.1, src/makeprotos-sed 1.1, src/command.c 1.1, src/graphics.c 1.1, src/grkelot.c 1.1, src/grkelot.h 1.1, src/main.c 1.1, src/menubar.c 1.1, src/misc.c 1.1, src/protos.h 1.1, src/rxvt.h 1.1, src/rxvtgrx.h 1.1, src/version.h 1.1, src/Makefile.in 1.1, src/gcc-Wall 1.1, src/netdisp.c 1.1, src/rmemset.c 1.1, src/screen.c 1.1, src/scrollbar.c 1.1, src/utmp.c 1.1, src/xdefaults.c 1.1, INSTALL 1.1, autoconf/Make.common.in 1.1, autoconf/acconfig.h 1.1, autoconf/aclocal.m4 1.1, autoconf/config.h.in 1.1, autoconf/configure.in 1.1, autoconf/install-sh 1.1, autoconf/mkinstalldirs 1.1, configure 1.1, rxvt-2.4.6.lsm 1.1, src/.indent.pro 1.1, src/feature.h 1.1, Makefile 1.1, Makefile.in 1.1: New file. rxvt-2.7.10/Makefile.in010064400001440000024000000065010763200134000133010ustar gcwstaff# ./Makefile.in -*- Makefile -*- # $Id: Makefile.in,v 1.16 2003/03/07 02:24:18 gcw Exp $ @MCOMMON@ srcdir = @srcdir@ VPATH = @srcdir@ .PATH: @srcdir@ first_rule: all dummy: subdirs = src doc rclock src/graphics src/test allsubdirs = W11 $(subdirs) DIST = INSTALL README.configure configure Makefile Makefile.in ChangeLog DIST_CFG = autoconf/aclocal.m4 autoconf/xpm.m4 autoconf/libtool.m4 \ autoconf/configure.in autoconf/config.h.in \ autoconf/Make.common.in autoconf/install-sh autoconf/mkinstalldirs \ autoconf/config.guess autoconf/config.sub \ autoconf/ltmain.sh \ MKDIR = $(srcdir)/autoconf/mkinstalldirs #------------------------------------------------------------------------- all allbin alldoc tags: @if test x@host_os@ = xcygwin; then (cd W11; ${MAKE} $@ || exit 1); fi @for I in ${subdirs}; do (cd $$I; ${MAKE} $@ || exit 1); done realclean: clean $(RMF) config.h config.status config.log libtool clean: $(RMF) *~ config.cache $(RMF) -r autom4te.cache @if test x@host_os@ = xcygwin; then (cd W11; ${MAKE} $@ || exit 1); fi @for I in ${subdirs}; do (cd $$I; ${MAKE} $@ || exit 1); done # # entry points for other programs # rxvt: (cd src; ${MAKE}) clock: (cd rclock; ${MAKE}) graphics qplot: (cd src/graphics; ${MAKE} qplot) tests: (cd src/test; ${MAKE} tests) #------------------------------------------------------------------------- configure: autoconf/configure.in autoconf/aclocal.m4 autoconf/config.h.in cd $(srcdir); ./.prebuild config.status: if test -x config.status; then config.status --recheck; \ else $(SHELL) configure; fi autoconf/config.h.in: autoconf/configure.in cd $(srcdir); ./.prebuild installdirs: $(MKDIR) $(DESTDIR)$(bindir) $(MKDIR) $(DESTDIR)$(mandir) install: installdirs @if test x@host_os@ = xcygwin; then (cd W11; ${MAKE} $@ || exit 1); fi @for I in $(subdirs); do (cd $$I; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done Makefiles: $(SHELL) config.status cleandir: realclean # distclean goal is for making a clean source tree, but if you have run # configure from a different directory, then doesn't destroy all your # hardly compiled and linked stuff. That's why there is always $(srcdir)/ # In that case most of those commands do nothing, except cleaning *~ # and cleaning source links. distclean: (cd $(srcdir); $(RMF) *~ config.cache config.h config.log config.status libtool) @for I in $(allsubdirs); do (cd $$I; $(MAKE) $@ || exit 1); done (cd $(srcdir); $(RMF) Makefile autoconf/Make.common) distdirs: mkdir ../$(VERNAME); mkdir ../$(VERNAME)/autoconf; @for I in $(allsubdirs); do (cd $$I; $(MAKE) $@ || (echo "Failed to make distclean in $$I"; exit 0) ); done distcopy: $(CP) -p $(DIST) ../$(VERNAME); $(CP) -p $(DIST_CFG) ../$(VERNAME)/autoconf; @for I in $(allsubdirs); do (cd $$I; $(MAKE) $@ || exit 1); done distrib: configure autoconf/config.h.in distdirs distcopy tar.gz: ../$(VERNAME).tar.gz ../$(VERNAME).tar.gz: (cd ..; tar cvf - $(VERNAME) | gzip -f9 > $(VERNAME).tar.gz) tar.Z: ../$(VERNAME).tar.Z ../$(VERNAME).tar.Z: (cd ..; tar cvf - $(VERNAME) | compress > $(VERNAME).tar.Z) tar.bz2: ../$(VERNAME).tar.bz2 ../$(VERNAME).tar.bz2: (cd ..; tar cvf - $(VERNAME) | bzip2 -f9 > $(VERNAME).tar.bz2) uuencode: tar.gz uuencode ../$(VERNAME).tar.gz $(VERNAME).tar.gz > ../$(VERNAME).tgz.uu # ------------------------------------------------------------------------ rxvt-2.7.10/Makefile010064400001440000024000000123720764024225200127070ustar gcwstaff# ./Makefile.in -*- Makefile -*- # $Id: Makefile.in,v 1.16 2003/03/07 02:24:18 gcw Exp $ # autoconf/Make.common.in -*- Makefile -*- # release date (man), LSM date, version number/name, current maintainer DATE=26 MARCH 2003 LSMDATE=26MAR03 VERSION=2.7.10 VERNAME=rxvt-$(VERSION)# MAINT=Geoff Wing# MAINTEMAIL=# WEBMAINT=Oezguer Kesim# WEBMAINTEMAIL=# WEBPAGE=# FTPSITENAME=ftp.rxvt.org# FTPSITEDIR=/pub/rxvt# #------------------------------------------------------------------------- RXVTNAME=rxvt SHELL = /bin/sh # This variable makes it possible to move the installation root to another # directory. This is useful when you're creating a binary distribution # If empty, normal root will be used. # You can run eg. 'make install DESTDIR=/packages/rxvt-xx' to accomplish # that. # DESTDIR = /usr/local/X11/$(VERNAME) # Installation target directories & other installation stuff prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin libdir = ${exec_prefix}/lib includedir = ${prefix}/include mandir = ${prefix}/man/man1 manext = 1 # Tools & program stuff CC = gcc CPP = gcc -E MV = /bin/mv RM = /bin/rm RMF = /bin/rm -f CP = /bin/cp LN = /bin/ln SED = /usr/bin/sed AWK = awk ECHO = /bin/echo CMP = /usr/bin/cmp TBL = /usr/bin/tbl INSTALL = /usr/bin/install -c INSTALL_PROGRAM = /usr/bin/install -c -m 755 INSTALL_DATA = /usr/bin/install -c -m 644 # Flags & libs # add -DBINDIR=\""$(bindir)/"\" to CPPFLAGS, if we need to spawn a program CFLAGS = -g -O2 CPPFLAGS = LDFLAGS = DEFS = -DHAVE_CONFIG_H LIBS = DINCLUDE = DLIB = # X Include directory XINC = -I/usr/X11R6/include # extra libraries needed by X on some systems, X library location XLIB = -L/usr/X11R6/lib -Wl,-rpath -Wl,/usr/X11R6/lib -lX11 LIBTOOL = $(SHELL) $(top_builddir)/libtool COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(DEBUG) $(DINCLUDE) $(XINC) -I$(basedir) -I$(srcdir) -I. LINK = $(CC) $(CFLAGS) $(LDFLAGS) # End of common section of the Makefile #------------------------------------------------------------------------- srcdir = . .PATH: . first_rule: all dummy: subdirs = src doc rclock src/graphics src/test allsubdirs = W11 $(subdirs) DIST = INSTALL README.configure configure Makefile Makefile.in ChangeLog DIST_CFG = autoconf/aclocal.m4 autoconf/xpm.m4 autoconf/libtool.m4 \ autoconf/configure.in autoconf/config.h.in \ autoconf/Make.common.in autoconf/install-sh autoconf/mkinstalldirs \ autoconf/config.guess autoconf/config.sub \ autoconf/ltmain.sh \ MKDIR = $(srcdir)/autoconf/mkinstalldirs #------------------------------------------------------------------------- all allbin alldoc tags: @if test xnetbsdelf1.6Q = xcygwin; then (cd W11; ${MAKE} $@ || exit 1); fi @for I in ${subdirs}; do (cd $$I; ${MAKE} $@ || exit 1); done realclean: clean $(RMF) config.h config.status config.log libtool clean: $(RMF) *~ config.cache $(RMF) -r autom4te.cache @if test xnetbsdelf1.6Q = xcygwin; then (cd W11; ${MAKE} $@ || exit 1); fi @for I in ${subdirs}; do (cd $$I; ${MAKE} $@ || exit 1); done # # entry points for other programs # rxvt: (cd src; ${MAKE}) clock: (cd rclock; ${MAKE}) graphics qplot: (cd src/graphics; ${MAKE} qplot) tests: (cd src/test; ${MAKE} tests) #------------------------------------------------------------------------- configure: autoconf/configure.in autoconf/aclocal.m4 autoconf/config.h.in cd $(srcdir); ./.prebuild config.status: if test -x config.status; then config.status --recheck; \ else $(SHELL) configure; fi autoconf/config.h.in: autoconf/configure.in cd $(srcdir); ./.prebuild installdirs: $(MKDIR) $(DESTDIR)$(bindir) $(MKDIR) $(DESTDIR)$(mandir) install: installdirs @if test xnetbsdelf1.6Q = xcygwin; then (cd W11; ${MAKE} $@ || exit 1); fi @for I in $(subdirs); do (cd $$I; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done Makefiles: $(SHELL) config.status cleandir: realclean # distclean goal is for making a clean source tree, but if you have run # configure from a different directory, then doesn't destroy all your # hardly compiled and linked stuff. That's why there is always $(srcdir)/ # In that case most of those commands do nothing, except cleaning *~ # and cleaning source links. distclean: (cd $(srcdir); $(RMF) *~ config.cache config.h config.log config.status libtool) @for I in $(allsubdirs); do (cd $$I; $(MAKE) $@ || exit 1); done (cd $(srcdir); $(RMF) Makefile autoconf/Make.common) distdirs: mkdir ../$(VERNAME); mkdir ../$(VERNAME)/autoconf; @for I in $(allsubdirs); do (cd $$I; $(MAKE) $@ || (echo "Failed to make distclean in $$I"; exit 0) ); done distcopy: $(CP) -p $(DIST) ../$(VERNAME); $(CP) -p $(DIST_CFG) ../$(VERNAME)/autoconf; @for I in $(allsubdirs); do (cd $$I; $(MAKE) $@ || exit 1); done distrib: configure autoconf/config.h.in distdirs distcopy tar.gz: ../$(VERNAME).tar.gz ../$(VERNAME).tar.gz: (cd ..; tar cvf - $(VERNAME) | gzip -f9 > $(VERNAME).tar.gz) tar.Z: ../$(VERNAME).tar.Z ../$(VERNAME).tar.Z: (cd ..; tar cvf - $(VERNAME) | compress > $(VERNAME).tar.Z) tar.bz2: ../$(VERNAME).tar.bz2 ../$(VERNAME).tar.bz2: (cd ..; tar cvf - $(VERNAME) | bzip2 -f9 > $(VERNAME).tar.bz2) uuencode: tar.gz uuencode ../$(VERNAME).tar.gz $(VERNAME).tar.gz > ../$(VERNAME).tgz.uu # ------------------------------------------------------------------------ rxvt-2.7.10/configure010075500001440000024000016047770764024163600132040ustar gcwstaff#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac fi # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case "X$ECHO" in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running ltconfig again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="src/feature.h" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION DATE LSMDATE LIBVERSION CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os LN_S ECHO RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LIBTOOL INSTALL_LIBRXVT MV RM CP LN SED CMP TBL X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XPM_CPPFLAGS XPM_CFLAGS XPM_LIBS rxvt_int16_typedef rxvt_u_int16_typedef rxvt_int32_typedef rxvt_u_int32_typedef rxvt_int64_typedef rxvt_u_int64_typedef rxvt_intp_define rxvt_u_intp_define DEBUG DINCLUDE DLIB OBJLIST LIBOBJLIST RXVTNAME include_stdarg_h include_stdlib_h include_unistd_h include_string_h include_fcntl_h include_util_h include_assert_h include_sys_ioctl_h include_sys_select_h include_sys_strredir_h include_sys_time_h include_time_h lib_multicharset LIBOBJS LTLIBOBJS' ac_subst_files='MCOMMON' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) 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 | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$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 | -n) 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_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } 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 "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # 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_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` 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 "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # 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 <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR Program names: --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 System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared=PKGS build shared libraries default=no --enable-static=PKGS build static libraries default=yes --enable-fast-install=PKGS optimize for fast installation default=yes --disable-libtool-lock avoid locking (might break parallel builds) --enable-everything enable standard non-multichoice features: marked * NOTE: this option is order dependent NOTE: automatically enabled with --enable-shared --enable-languages enable multichar glyph language support --enable-utmp enable utmp (utmpx) support * --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)* --enable-lastlog enable lastlog support (requires --enable-utmp) * --enable-xpm-background enable XPM background pixmaps * --enable-transparency enable transparent backgrounds * --enable-menubar enable menubar * --enable-graphics enable rxvt own graphics mode (see src/graphics) * --enable-rxvt-scroll enable rxvt style scrollbar * --enable-next-scroll enable NeXT style scrollbar * --enable-xterm-scroll enable Xterm style scrollbar * --enable-half-shadow use half width/height shadow on rxvt scrollbar --enable-xim XIM (X Input Method) protocol support * --enable-greek enable greek keyboard support --enable-ttygid enable tty setting to group named "tty" --disable-backspace-key disable handling of the backspace key --disable-delete-key disable handling of the delete key --disable-resources disable all resource checking --enable-xgetdefault enable resources via X instead of our small version --enable-strings enable some replacement system functions --disable-swapscreen disable swap screen support --enable-frills enable support for rarely used features * --enable-linespace enable support for linespace * --enable-24bit enable support for using 24bit visuals if available * --enable-keepscrolling enable continual scrolling on scrollbar arrow press * --enable-mousewheel enable scrolling via mouse wheel or buttons 4 & 5 * --enable-slipwheeling enable slip wheel scrolling (requires previous) * --enable-old-selection enable v2.20 (& prior) mouse selection style support* --disable-new-selection disable new mouse (xterm) selection style support --enable-dmalloc enable Gray Watson's malloc - for debugging use --enable-dlmalloc enable Doug Lea's malloc - for production use NOTE: enable only one malloc package --enable-smart-resize enable smart growth/shrink behaviour --enable-256-color enable 256-color support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-pic try to use only PIC/non-PIC objects default=use both --with-encoding=NAME set language default encoding to NAME (default: sjis) (eucj|sjis|big5|gb|kr|noenc) --with-term=NAME set the terminal to NAME (default \"xterm\") --with-terminfo=PATH set the path to the terminfo tree to PATH --with-x use the X Window System --with-xpm-includes=DIR use XPM includes in DIR --with-xpm-library=DIR use XPM library in DIR --with-xpm use XPM Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # 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 # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # 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 "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in autoconf $srcdir/autoconf; 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 elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&5 echo "$as_me: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. ac_config_headers="$ac_config_headers config.h:autoconf/config.h.in" VERSION=`sed -n -e 's/^.*[ \t]VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` DATE=`sed -n -e 's/^.*[ \t]DATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` LSMDATE=`sed -n -e 's/^.*[ \t]LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` LIBVERSION=`sed -n -e 's/^.*[ \t]LIBVERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` echo "" echo "configuring for rxvt $VERSION" echo "" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi 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 "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done 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 $# != 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl 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 "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # 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 # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # 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 "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done 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 "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&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_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' for ac_prog in gawk mawk nawk awk 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 "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for AIX" >&5 echo $ECHO_N "checking for AIX... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_strerror=no cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); int main () { strerror (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_strerror="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_strerror" = no; then for ac_lib in cposix; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); int main () { strerror (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_strerror="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 echo "${ECHO_T}$ac_cv_search_strerror" >&6 if test "$ac_cv_search_strerror" != no; then test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" fi # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case "$enableval" in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac else enable_shared=no fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case "$enableval" in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$ac_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case "$enableval" in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$ac_save_ifs" ;; esac else enable_fast_install=yes fi; # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by GCC" >&5 echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case "$ac_prog" in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then lt_cv_prog_gnu_ld=yes else lt_cv_prog_gnu_ld=no fi fi echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/${ac_tool_prefix}nm if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then lt_cv_path_NM="$tmp_nm -p" break else lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi NM="$lt_cv_path_NM" echo "$as_me:$LINENO: result: $NM" >&5 echo "${ECHO_T}$NM" >&6 echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # ['file_magic [regex]'] -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case "$host_os" in aix4*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin* | mingw* | pw32*) lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin*|rhapsody*) lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magiic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` ;; freebsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case "$host_cpu" in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20*|hpux11*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) case "$host_os" in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case "$LD" in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux-gnu*) case "$host_cpu" in alpha* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='file_magic NetBSD/[a-z0-9]* demand paged shared library' else lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' fi lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case "$host_vendor" in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; esac ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output" >&5 echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Define system-specific variables. case "$host_os" in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" ;; irix*) symcode='[BCDEGRST]' ;; solaris* | sysv5*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case "$host_os" in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTW]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" if test -z "$lt_cv_sys_global_symbol_pipe"; then global_symbol_to_cdecl= else global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" fi if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else 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 <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else 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 <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #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); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Only perform the check for file, if the check method requires it case "$deplibs_check_method" in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MAGIC_CMD" in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="/usr/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case "$deplibs_check_method" in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MAGIC_CMD" in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="/usr/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case "$deplibs_check_method" in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case "$host" in *-*-irix6*) # Find out which ABI we are using. echo '#line 4217 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case "`/usr/bin/file conftest.$ac_objext`" in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" need_locks="$enable_libtool_lock" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o if test x"$host" != x"$build"; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case "$host_os" in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac case "$host_os" in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" ## FIXME: this should be a separate macro ## echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$as_me:$LINENO: result: $objdir" >&5 echo "${ECHO_T}$objdir" >&6 ## ## END FIXME ## FIXME: this should be a separate macro ## # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # We assume here that the value for lt_cv_prog_cc_pic will not be cached # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "${lt_cv_prog_cc_pic+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_cc_pic= lt_cv_prog_cc_shlib= lt_cv_prog_cc_wl= lt_cv_prog_cc_static= lt_cv_prog_cc_no_builtin= lt_cv_prog_cc_can_build_shared=$can_build_shared if test "$GCC" = yes; then lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-static' case "$host_os" in beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # we not sure about C++ programs. lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' ;; sysv4*MP*) if test -d /usr/nec; then lt_cv_prog_cc_pic=-Kconform_pic fi ;; *) lt_cv_prog_cc_pic='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case "$host_os" in aix3* | aix4*) # All AIX code is PIC. lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' ;; hpux9* | hpux10* | hpux11*) # Is there a better lt_cv_prog_cc_static that works with the bundled CC? lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" lt_cv_prog_cc_pic='+Z' ;; irix5* | irix6*) lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; newsos6) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' ;; sco3.2v5*) lt_cv_prog_cc_pic='-Kpic' lt_cv_prog_cc_static='-dn' lt_cv_prog_cc_shlib='-belf' ;; solaris*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; sunos4*) lt_cv_prog_cc_pic='-PIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' if test "x$host_vendor" = xsni; then lt_cv_prog_cc_wl='-LD' else lt_cv_prog_cc_wl='-Wl,' fi ;; uts4*) lt_cv_prog_cc_pic='-pic' lt_cv_prog_cc_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_cv_prog_cc_pic='-Kconform_pic' lt_cv_prog_cc_static='-Bstatic' fi ;; *) lt_cv_prog_cc_can_build_shared=no ;; esac fi fi if test -z "$lt_cv_prog_cc_pic"; then echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 else echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5 echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6 # Check to make sure the pic_flag actually works. echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6 if test "${lt_cv_prog_cc_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then case "$host_os" in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then # they create non-PIC objects. So, if there were any warnings, we # assume that PIC is not supported. if test -s conftest.err; then lt_cv_prog_cc_pic_works=no else lt_cv_prog_cc_pic_works=yes fi ;; *) lt_cv_prog_cc_pic_works=yes ;; esac else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_prog_cc_pic_works=no fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi if test "X$lt_cv_prog_cc_pic_works" = Xno; then lt_cv_prog_cc_pic= lt_cv_prog_cc_can_build_shared=no else lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" fi echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5 echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6 fi ## ## END FIXME # Check for any special shared library compilation flags. if test -n "$lt_cv_prog_cc_shlib"; then { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5 echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then : else { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi ## FIXME: this should be a separate macro ## echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6 if test "${lt_cv_prog_cc_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_cc_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_prog_cc_static_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi # Belt *and* braces to stop my trousers falling down: test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5 echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6 pic_flag="$lt_cv_prog_cc_pic" special_shlib_compile_flags="$lt_cv_prog_cc_shlib" wl="$lt_cv_prog_cc_wl" link_static_flag="$lt_cv_prog_cc_static" no_builtin_flag="$lt_cv_prog_cc_no_builtin" can_build_shared="$lt_cv_prog_cc_can_build_shared" ## ## END FIXME ## FIXME: this should be a separate macro ## # Check to see if options -o and -c are simultaneously supported by compiler echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 $rm -r conftest 2>/dev/null mkdir conftest cd conftest echo "int some_variable = 0;" > conftest.$ac_ext mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no if { (eval echo configure:4742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then compiler_c_o=no else compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 compiler_c_o=no fi echo "$as_me:$LINENO: result: $compiler_c_o" >&5 echo "${ECHO_T}$compiler_c_o" >&6 CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6 compiler_o_lo=no save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int some_variable = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then compiler_o_lo=no else compiler_o_lo=yes fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $compiler_c_o" >&5 echo "${ECHO_T}$compiler_c_o" >&6 CFLAGS="$save_CFLAGS" else compiler_o_lo=no fi ## ## END FIXME ## FIXME: this should be a separate macro ## # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi ## ## END FIXME ## FIXME: this should be a separate macro ## if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int some_variable = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then compiler_rtti_exceptions=no else compiler_rtti_exceptions=yes fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5 echo "${ECHO_T}$compiler_rtti_exceptions" >&6 if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi ## ## END FIXME ## FIXME: this should be a separate macro ## # See if the linker supports building shared libraries. echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6 allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_into_libs=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= link_all_deplibs=unknown always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case "$host_os" in cygwin* | mingw* | pw32* ) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case "$host_os" in aix3* | aix4*) # On AIX, the GNU linker is very broken ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ test -f $output_objdir/impgen.exe || (cd $output_objdir && \ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soname > $output_objdir/$soname-def' old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ case "$host_os" in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ ;; esac # mingw and cygwin differ, and it's simplest to just exclude the union # of the two symbol sets. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one (in ltdll.c) if test "x$lt_cv_need_dllmain" = "xyes"; then ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' else ltdll_obj= ltdll_cmds= fi # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. # Be careful not to strip the DATA tag left be newer dlltools. export_symbols_cmds="$ltdll_cmds"' $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~ _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \$# in 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw* | pw32*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case "$host_os" in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4*) hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' hardcode_libdir_separator=':' if test "$GCC" = yes; then collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi shared_flag='-shared' else shared_flag='${wl}-bM:SRE' hardcode_direct=yes fi allow_undefined_flag=' ${wl}-berok' archive_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' case "$host_os" in aix4.[01]|aix4.[01].*) # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on always_export_symbols=yes ;; esac # We don't want to build shared libraries on unknown CPU types. case $host_cpu in powerpc | rs6000) ;; *) ld_shlibs=no ;; esac ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' ;; darwin* | rhapsody*) allow_undefined_flag='-undefined warning' archive_cmds='$CC `if test "$module" = "yes"; then echo -bundle; else echo -dynamiclib; fi` -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' ## What we need is to hardcode the path to the library, not the search path #hardcode_direct=yes #hardcode_libdir_flag_spec='-install_name $libdir/$lib' hardcode_shlibpath_var=no whole_archive_flag_spec='-all_load' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case "$host_os" in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' fi #Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case "$host_os" in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) if test "x$host_vendor" = xsno; then archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes # is this really true??? else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; unixware7*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no ## ## END FIXME ## FIXME: this should be a separate macro ## # Check hardcoding attributes. echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 ## ## END FIXME ## FIXME: this should be a separate macro ## striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ## ## END FIXME reload_cmds='$LD$reload_flag -o $output$reload_objs' test -z "$deplibs_check_method" && deplibs_check_method=unknown ## FIXME: this should be a separate macro ## # PORTME Fill in your ld.so characteristics echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case "$host_os" in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4*) version_type=linux # AIX has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. # We preserve .a as extension for shared libraries though AIX4.2 # and later linker supports .so library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' shlibpath_var=LIBPATH ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows need_version=no need_lib_prefix=no if test "$GCC" = yes; then library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' else library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' fi dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) need_lib_prefix=no need_version=no library_names_spec='${libname}.`if test "$module" = "yes"; then echo so; else echo dylib; fi`' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH postinstall_cmds='chmod +x $lib' ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case "$version_type" in freebsd-elf*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case "$host_os" in freebsd2*) shlibpath_overrides_runpath=yes ;; *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' case "$host_os" in irix5*) libsuff= shlibsuff= ;; *) case "$LD" in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos if test "$with_gnu_ld" = yes; then need_lib_prefix=no need_version=no fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case "$host_vendor" in sni) shlibpath_overrides_runpath=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no ## ## END FIXME ## FIXME: this should be a separate macro ## # Report the final consequences. echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 ## ## END FIXME if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case "$host_os" in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; cygwin* | mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; *) echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* 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_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* 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_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case "$lt_cv_dlopen" in dlopen) save_CPPFLAGS="$CPP_FLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif fnord() { int i=42;} main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif fnord() { int i=42;} main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case "$lt_cv_dlopen_self" in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case "$lt_cv_dlopen_self_static" in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ## FIXME: this should be a separate macro ## if test "$enable_shared" = yes && test "$GCC" = yes; then case "$archive_cmds" in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 if test "${lt_cv_archive_cmds_need_lc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $rm conftest* echo 'static int dummy;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_cv_prog_cc_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$save_allow_undefined_flag else cat conftest.err 1>&5 fi fi echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6 ;; esac fi need_lc=${lt_cv_archive_cmds_need_lc-yes} ## ## END FIXME ## FIXME: this should be a separate macro ## # The second clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then : else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi if test -f "$ltmain"; then trap "$rm \"${ofile}T\"; exit 1" 1 2 15 $rm -f "${ofile}T" echo creating $ofile # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS \ AR AR_FLAGS CC LD LN_S NM SHELL \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ old_striplib striplib file_magic_cmd export_symbols_cmds \ deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case "$var" in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done cat <<__EOF__ > "${ofile}T" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # 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 of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$need_lc # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # The default C compiler. CC=$lt_CC # Is the compiler the GNU C compiler? with_gcc=$GCC # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_pic_flag pic_mode=$pic_mode # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$lt_compiler_o_lo # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_global_symbol_to_cdecl # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case "$host_os" in aix3*) cat <<\EOF >> "${ofile}T" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac case "$host_os" in cygwin* | mingw* | pw32* | os2*) cat <<'EOF' >> "${ofile}T" # This is a source program that is used to create dlls on Windows # Don't remove nor modify the starting and closing comments # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ # This is a source program that is used to create import libraries # on Windows for dlls which lack them. Don't remove nor modify the # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999-2000 Free Software Foundation, Inc. # # This file is part of GNU libtool. # # 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 of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # */ # # #include /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* for strdup() */ # # /* O_BINARY isn't required (or even defined sometimes) under Unix */ # #ifndef O_BINARY # #define O_BINARY 0 # #endif # # static unsigned int # pe_get16 (fd, offset) # int fd; # int offset; # { # unsigned char b[2]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 2); # return b[0] + (b[1]<<8); # } # # static unsigned int # pe_get32 (fd, offset) # int fd; # int offset; # { # unsigned char b[4]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 4); # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # static unsigned int # pe_as32 (ptr) # void *ptr; # { # unsigned char *b = ptr; # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # int # main (argc, argv) # int argc; # char *argv[]; # { # int dll; # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; # unsigned long export_rva, export_size, nsections, secptr, expptr; # unsigned long name_rvas, nexp; # unsigned char *expdata, *erva; # char *filename, *dll_name; # # filename = argv[1]; # # dll = open(filename, O_RDONLY|O_BINARY); # if (!dll) # return 1; # # dll_name = filename; # # for (i=0; filename[i]; i++) # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') # dll_name = filename + i +1; # # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); # # if (num_entries < 1) /* no exports */ # return 1; # # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + # pe_get16 (dll, pe_header_offset + 4 + 16)); # # expptr = 0; # for (i = 0; i < nsections; i++) # { # char sname[8]; # unsigned long secptr1 = secptr + 40 * i; # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); # unsigned long vsize = pe_get32 (dll, secptr1 + 16); # unsigned long fptr = pe_get32 (dll, secptr1 + 20); # lseek(dll, secptr1, SEEK_SET); # read(dll, sname, 8); # if (vaddr <= export_rva && vaddr+vsize > export_rva) # { # expptr = fptr + (export_rva - vaddr); # if (export_rva + export_size > vaddr + vsize) # export_size = vsize - (export_rva - vaddr); # break; # } # } # # expdata = (unsigned char*)malloc(export_size); # lseek (dll, expptr, SEEK_SET); # read (dll, expdata, export_size); # erva = expdata - export_rva; # # nexp = pe_as32 (expdata+24); # name_rvas = pe_as32 (expdata+32); # # printf ("EXPORTS\n"); # for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) mv -f "${ofile}T" "$ofile" || \ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") chmod +x "$ofile" fi ## ## END FIXME # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion MALLOC_TYPE=S support_addstrings=no support_frills=no support_linespace=no support_graphics=no support_inheritpixmap=no support_keepscrolling=no support_menubar=no support_mousewheel=no support_mouseslipwheel=no support_oldselection=no support_utmp=no support_wtmp=no support_lastlog=no support_xim=no support_xpm=no support_scroll_rxvt=no support_scroll_next=no support_scroll_xterm=no multichar_set=no if test "x$enable_shared" = xyes; then cat >>confdefs.h <<\_ACEOF #define LIBRXVT 1 _ACEOF INSTALL_LIBRXVT=yes fi # Check whether --enable-everything or --disable-everything was given. if test "${enable_everything+set}" = set; then enableval="$enable_everything" if test x$enableval = xyes; then support_24bit=yes support_frills=yes support_linespace=yes support_graphics=yes support_inheritpixmap=yes support_keepscrolling=yes support_lastlog=yes support_menubar=yes support_mousewheel=yes support_mouseslipwheel=yes support_oldselection=yes support_scroll_rxvt=yes support_scroll_next=yes support_scroll_xterm=yes support_utmp=yes support_wtmp=yes support_xim=yes support_xpm=yes fi fi; # Check whether --enable-languages or --disable-languages was given. if test "${enable_languages+set}" = set; then enableval="$enable_languages" if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define MULTICHAR_SET 1 _ACEOF multichar_set=yes fi fi; # Check whether --with-encoding or --without-encoding was given. if test "${with_encoding+set}" = set; then withval="$with_encoding" if test x$enableval = xyes; then withval=`echo $withval | tr 'a-z' 'A-Z'` cat >>confdefs.h <<_ACEOF #define MULTICHAR_ENCODING $withval _ACEOF fi fi; # Check whether --enable-utmp or --disable-utmp was given. if test "${enable_utmp+set}" = set; then enableval="$enable_utmp" if test x$enableval = xyes -o x$enableval = xno; then support_utmp=$enableval fi fi; # Check whether --enable-wtmp or --disable-wtmp was given. if test "${enable_wtmp+set}" = set; then enableval="$enable_wtmp" if test x$enableval = xyes -o x$enableval = xno; then support_wtmp=$enableval fi fi; # Check whether --enable-lastlog or --disable-lastlog was given. if test "${enable_lastlog+set}" = set; then enableval="$enable_lastlog" if test x$enableval = xyes -o x$enableval = xno; then support_lastlog=$enableval fi fi; # Check whether --enable-xpm-background or --disable-xpm-background was given. if test "${enable_xpm_background+set}" = set; then enableval="$enable_xpm_background" if test x$enableval = xyes -o x$enableval = xno; then support_xpm=$enableval fi fi; # Check whether --enable-transparency or --disable-transparency was given. if test "${enable_transparency+set}" = set; then enableval="$enable_transparency" if test x$enableval = xyes -o x$enableval = xno; then support_inheritpixmap=$enableval fi fi; # Check whether --enable-menubar or --disable-menubar was given. if test "${enable_menubar+set}" = set; then enableval="$enable_menubar" if test x$enableval = xyes -o x$enableval = xno; then support_menubar=$enableval fi fi; # Check whether --enable-graphics or --disable-graphics was given. if test "${enable_graphics+set}" = set; then enableval="$enable_graphics" if test x$enableval = xyes -o x$enableval = xno; then support_graphics=$enableval fi fi; # Check whether --enable-rxvt-scroll or --disable-rxvt-scroll was given. if test "${enable_rxvt_scroll+set}" = set; then enableval="$enable_rxvt_scroll" if test x$enableval = xyes; then support_scroll_rxvt=yes fi fi; # Check whether --enable-next-scroll or --disable-next-scroll was given. if test "${enable_next_scroll+set}" = set; then enableval="$enable_next_scroll" if test x$enableval = xyes; then support_scroll_next=yes fi fi; # Check whether --enable-xterm-scroll or --disable-xterm-scroll was given. if test "${enable_xterm_scroll+set}" = set; then enableval="$enable_xterm_scroll" if test x$enableval = xyes; then support_scroll_xterm=yes fi fi; # Check whether --enable-half-shadow or --disable-half-shadow was given. if test "${enable_half_shadow+set}" = set; then enableval="$enable_half_shadow" if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define HALFSHADOW 1 _ACEOF fi fi; # Check whether --enable-xim or --disable-xim was given. if test "${enable_xim+set}" = set; then enableval="$enable_xim" if test x$enableval = xyes -o x$enableval = xno; then support_xim=$enableval fi fi; # Check whether --enable-greek or --disable-greek was given. if test "${enable_greek+set}" = set; then enableval="$enable_greek" if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define GREEK_SUPPORT 1 _ACEOF OBJGRKELOT="grkelot.o" fi fi; # Check whether --enable-ttygid or --disable-ttygid was given. if test "${enable_ttygid+set}" = set; then enableval="$enable_ttygid" if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define TTY_GID_SUPPORT 1 _ACEOF fi fi; # Check whether --enable-backspace-key or --disable-backspace-key was given. if test "${enable_backspace_key+set}" = set; then enableval="$enable_backspace_key" if test x$enableval = xno; then cat >>confdefs.h <<\_ACEOF #define NO_BACKSPACE_KEY 1 _ACEOF fi fi; # Check whether --enable-delete-key or --disable-delete-key was given. if test "${enable_delete_key+set}" = set; then enableval="$enable_delete_key" if test x$enableval = xno; then cat >>confdefs.h <<\_ACEOF #define NO_DELETE_KEY 1 _ACEOF fi fi; # Check whether --enable-resources or --disable-resources was given. if test "${enable_resources+set}" = set; then enableval="$enable_resources" if test x$enableval = xno; then cat >>confdefs.h <<\_ACEOF #define NO_RESOURCES 1 _ACEOF fi fi; # Check whether --enable-xgetdefault or --disable-xgetdefault was given. if test "${enable_xgetdefault+set}" = set; then enableval="$enable_xgetdefault" if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define USE_XGETDEFAULT 1 _ACEOF fi fi; # Check whether --enable-strings or --disable-strings was given. if test "${enable_strings+set}" = set; then enableval="$enable_strings" if test x$enableval = xyes -o x$enableval = xno; then support_addstrings=$enableval fi fi; # Check whether --enable-swapscreen or --disable-swapscreen was given. if test "${enable_swapscreen+set}" = set; then enableval="$enable_swapscreen" if test x$enableval = xno; then cat >>confdefs.h <<\_ACEOF #define NO_SECONDARY_SCREEN 1 _ACEOF fi fi; # Check whether --enable-frills or --disable-frills was given. if test "${enable_frills+set}" = set; then enableval="$enable_frills" if test x$enableval = xyes -o x$enableval = xno; then support_frills=$enableval fi fi; # Check whether --enable-linespace or --disable-linespace was given. if test "${enable_linespace+set}" = set; then enableval="$enable_linespace" if test x$enableval = xyes -o x$enableval = xno; then support_linespace=$enableval fi fi; # Check whether --enable-24bit or --disable-24bit was given. if test "${enable_24bit+set}" = set; then enableval="$enable_24bit" if test x$enableval = xyes -o x$enableval = xno; then support_24bit=$enableval fi fi; # Check whether --enable-keepscrolling or --disable-keepscrolling was given. if test "${enable_keepscrolling+set}" = set; then enableval="$enable_keepscrolling" if test x$enableval = xyes -o x$enableval = xno; then support_keepscrolling=$enableval fi fi; # Check whether --enable-mousewheel or --disable-mousewheel was given. if test "${enable_mousewheel+set}" = set; then enableval="$enable_mousewheel" if test x$enableval = xyes -o x$enableval = xno; then support_mousewheel=$enableval fi fi; # Check whether --enable-slipwheeling or --disable-slipwheeling was given. if test "${enable_slipwheeling+set}" = set; then enableval="$enable_slipwheeling" if test x$enableval = xyes -o x$enableval = xno; then support_mouseslipwheel=$enableval fi fi; # Check whether --enable-old-selection or --disable-old-selection was given. if test "${enable_old_selection+set}" = set; then enableval="$enable_old_selection" if test x$enableval = xyes -o x$enableval = xno; then support_oldselection=$enableval fi fi; # Check whether --enable-new-selection or --disable-new-selection was given. if test "${enable_new_selection+set}" = set; then enableval="$enable_new_selection" if test x$enableval = xno; then cat >>confdefs.h <<\_ACEOF #define NO_NEW_SELECTION 1 _ACEOF fi fi; # Check whether --enable-dmalloc or --disable-dmalloc was given. if test "${enable_dmalloc+set}" = set; then enableval="$enable_dmalloc" if test x$enableval = xyes; then MALLOC_TYPE=G DEBUG=-DDEBUG_MALLOC DLIB="-L/usr/local/lib -ldmalloc" DINCLUDE=-I/usr/local/include fi fi; # Check whether --enable-dlmalloc or --disable-dlmalloc was given. if test "${enable_dlmalloc+set}" = set; then enableval="$enable_dlmalloc" if test x$enableval = xyes; then MALLOC_TYPE=D DEBUG= DLIB="-L/usr/local/lib -ldlmalloc" DINCLUDE= fi fi; # Check whether --enable-smart-resize or --disable-smart-resize was given. if test "${enable_smart_resize+set}" = set; then enableval="$enable_smart_resize" if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define SMART_RESIZE 1 _ACEOF fi fi; # Check whether --enable-256-color or --disable-256-color was given. if test "${enable_256_color+set}" = set; then enableval="$enable_256_color" if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define TTY_256COLOR 1 _ACEOF fi fi; # Check whether --with-term or --without-term was given. if test "${with_term+set}" = set; then withval="$with_term" if test x$withval != x; then cat >>confdefs.h <<_ACEOF #define TERMENV "$withval" _ACEOF term="$withval" fi fi; # Check whether --with-terminfo or --without-terminfo was given. if test "${with_terminfo+set}" = set; then withval="$with_terminfo" if test x$withval != x; then cat >>confdefs.h <<_ACEOF #define RXVT_TERMINFO "$withval" _ACEOF terminfo="$withval" fi fi; cat >>confdefs.h <<\_ACEOF #define PROTOTYPES 1 _ACEOF if test -z "$CFLAGS"; then if test -z "$CCOPTS"; then CCOPTS='-O' fi CFLAGS="$CCOPTS" fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MV+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MV in [\\/]* | ?:[\\/]*) ac_cv_path_MV="$MV" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_MV" && ac_cv_path_MV="mv" ;; esac fi MV=$ac_cv_path_MV if test -n "$MV"; then echo "$as_me:$LINENO: result: $MV" >&5 echo "${ECHO_T}$MV" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_RM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RM in [\\/]* | ?:[\\/]*) ac_cv_path_RM="$RM" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_RM" && ac_cv_path_RM="rm" ;; esac fi RM=$ac_cv_path_RM if test -n "$RM"; then echo "$as_me:$LINENO: result: $RM" >&5 echo "${ECHO_T}$RM" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_CP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CP in [\\/]* | ?:[\\/]*) ac_cv_path_CP="$CP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_CP" && ac_cv_path_CP="cp" ;; esac fi CP=$ac_cv_path_CP if test -n "$CP"; then echo "$as_me:$LINENO: result: $CP" >&5 echo "${ECHO_T}$CP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "ln", so it can be a program name with args. set dummy ln; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_LN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $LN in [\\/]* | ?:[\\/]*) ac_cv_path_LN="$LN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LN="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_LN" && ac_cv_path_LN="ln" ;; esac fi LN=$ac_cv_path_LN if test -n "$LN"; then echo "$as_me:$LINENO: result: $LN" >&5 echo "${ECHO_T}$LN" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_SED" && ac_cv_path_SED="sed" ;; esac fi SED=$ac_cv_path_SED if test -n "$SED"; then echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "echo", so it can be a program name with args. set dummy echo; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_ECHO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ECHO in [\\/]* | ?:[\\/]*) ac_cv_path_ECHO="$ECHO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECHO="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_ECHO" && ac_cv_path_ECHO="echo" ;; esac fi ECHO=$ac_cv_path_ECHO if test -n "$ECHO"; then echo "$as_me:$LINENO: result: $ECHO" >&5 echo "${ECHO_T}$ECHO" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "cmp", so it can be a program name with args. set dummy cmp; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_CMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CMP in [\\/]* | ?:[\\/]*) ac_cv_path_CMP="$CMP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CMP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_CMP" && ac_cv_path_CMP="cmp" ;; esac fi CMP=$ac_cv_path_CMP if test -n "$CMP"; then echo "$as_me:$LINENO: result: $CMP" >&5 echo "${ECHO_T}$CMP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "tbl", so it can be a program name with args. set dummy tbl; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_TBL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $TBL in [\\/]* | ?:[\\/]*) ac_cv_path_TBL="$TBL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_TBL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi TBL=$ac_cv_path_TBL if test -n "$TBL"; then echo "$as_me:$LINENO: result: $TBL" >&5 echo "${ECHO_T}$TBL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 # 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 test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 conftest.dir if mkdir conftest.dir; then cd conftest.dir # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' acfindx: @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' _ACEOF 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 conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /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' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XtMalloc (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r $ac_dir/libXt.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 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 "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&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 "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. cat >>confdefs.h <<\_ACEOF #define X_DISPLAY_MISSING 1 _ACEOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . case `(uname -sr) 2>/dev/null` in "SunOS 5"*) echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_R_nospace=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_R_nospace=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test $ac_R_nospace = yes; then echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_R_space=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_R_space=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test $ac_R_space = yes; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 X_LIBS="$X_LIBS -R $x_libraries" else echo "$as_me:$LINENO: result: neither works" >&5 echo "${ECHO_T}neither works" >&6 fi fi LIBS=$ac_xsave_LIBS esac fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char XOpenDisplay (); int main () { XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dnet_ntoa (); int main () { dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dnet_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_dnet_ntoa=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dnet_ntoa (); int main () { dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); /* 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_gethostbyname) || defined (__stub___gethostbyname) choke me #else char (*f) () = gethostbyname; #endif #ifdef __cplusplus } #endif int main () { return f != gethostbyname; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = no; then echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gethostbyname=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6 if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); /* 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_connect) || defined (__stub___connect) choke me #else char (*f) () = connect; #endif #ifdef __cplusplus } #endif int main () { return f != connect; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = no; then echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); int main () { connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. echo "$as_me:$LINENO: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6 if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char remove (); /* 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_remove) || defined (__stub___remove) choke me #else char (*f) () = remove; #endif #ifdef __cplusplus } #endif int main () { return f != remove; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_remove=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6 if test $ac_cv_func_remove = no; then echo "$as_me:$LINENO: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char remove (); int main () { remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_posix_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_posix_remove=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo "$as_me:$LINENO: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6 if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shmat (); /* 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_shmat) || defined (__stub___shmat) choke me #else char (*f) () = shmat; #endif #ifdef __cplusplus } #endif int main () { return f != shmat; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shmat=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6 if test $ac_cv_func_shmat = no; then echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shmat (); int main () { shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ipc_shmat=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char IceConnectionNumber (); int main () { IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi if test x$support_xpm = xyes; then # Initialize some more variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. # If we find XPM, set shell vars xpm_includes and xpm_libraries to the # paths, otherwise set no_xpm=yes. # Uses ac_ vars as temps to allow command line to override cache and checks. echo "$as_me:$LINENO: checking for libXpm" >&5 echo $ECHO_N "checking for libXpm... $ECHO_C" >&6 # Check whether --with-xpm_includes or --without-xpm_includes was given. if test "${with_xpm_includes+set}" = set; then withval="$with_xpm_includes" xpm_includes="$withval" else xpm_includes=NO fi; # Check whether --with-xpm_library or --without-xpm_library was given. if test "${with_xpm_library+set}" = set; then withval="$with_xpm_library" xpm_libraries="$withval" else xpm_libraries=NO fi; # --without-xpm overrides everything else, but does not touch the cache. # Check whether --with-xpm or --without-xpm was given. if test "${with_xpm+set}" = set; then withval="$with_xpm" fi; if test "$with_xpm" = no; then have_xpm=disabled else if test "${ac_cv_have_xpm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else vt_xpm_include_X11=no if test -n "$xpm_includes"; then vt_xpm_includes=$xpm_includes else vt_xpm_includes=NO fi if test -n "$xpm_libraries"; then vt_xpm_libraries=$xpm_libraries else vt_xpm_libraries=NO fi if test "$vt_xpm_includes" = NO; then # Guess where to find xpm.h ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. vt_xpm_includes= vt_xpm_include_X11=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CPPFLAGS="$ac_save_CPPFLAGS" # Look for the header file in a standard set of common directories. 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/X11/xpm.h"; then vt_xpm_includes="$ac_dir" vt_xpm_include_X11=yes break else if test -r "$ac_dir/xpm.h"; then vt_xpm_includes=$ac_dir break fi fi done fi rm -f conftest.err conftest.$ac_ext fi if test "$vt_xpm_libraries" = NO; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS="$LIBS" LIBS="$LIBS $X_LIBS -lXpm -lX11" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { XpmReadFileToPixmap() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBS="$ac_save_LIBS" # We can link libXpm with no special library path. vt_xpm_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS="$ac_save_LIBS" # First see if replacing the include by lib works. for ac_dir in \ `echo "$vt_xpm_includes" | sed 's,include/X11,lib,;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 \ \ /usr/openwin/lib \ /usr/openwin/share/lib \ ; \ do for ac_extension in a so sl; do if test -r $ac_dir/libXpm.$ac_extension; then vt_xpm_libraries=$ac_dir break 2 fi done done fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi if test "$vt_xpm_includes" = NO -o "$vt_xpm_libraries" = NO; then ac_cv_have_xpm="have_xpm=no" else ac_cv_have_xpm="have_xpm=yes \ vt_xpm_includes=$vt_xpm_includes vt_xpm_libraries=$vt_xpm_libraries \ vt_xpm_include_X11=$vt_xpm_include_X11" fi fi eval "$ac_cv_have_xpm" fi if test "$have_xpm" != yes; then echo "$as_me:$LINENO: result: $have_xpm" >&5 echo "${ECHO_T}$have_xpm" >&6 no_xpm=yes else if test "$xpm_includes" != NO; then if test "$xpm_includes" = "$vt_xpm_includes"; then if test -r "$xpm_includes/X11/xpm.h"; then vt_xpm_include_X11=yes fi else vt_xpm_include_X11=no if test -z "$xpm_includes"; then cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then vt_xpm_include_X11=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_ext else if test -r "$xpm_includes/X11/xpm.h"; then vt_xpm_include_X11=yes fi fi fi vt_xpm_includes=$xpm_includes fi if test "x$xpm_libraries" != xNO; then vt_xpm_libraries=$xpm_libraries fi # Update the cache value to reflect the command line values. ac_cv_have_xpm="have_xpm=yes \ vt_xpm_includes=$vt_xpm_includes vt_xpm_libraries=$vt_xpm_libraries \ vt_xpm_include_X11=$vt_xpm_include_X11" eval "$ac_cv_have_xpm" echo "$as_me:$LINENO: result: -I$vt_xpm_includes, -L$vt_xpm_libraries" >&5 echo "${ECHO_T}-I$vt_xpm_includes, -L$vt_xpm_libraries" >&6 if test -n "$vt_xpm_includes"; then XPM_CPPFLAGS="-DHAVE_LIBXPM" fi if test -n "$vt_xpm_includes"; then XPM_CFLAGS="-I$vt_xpm_includes" fi XPM_LIBS="-lXpm" if test -n "$vt_xpm_libraries"; then XPM_LIBS="-L$vt_xpm_libraries $XPM_LIBS" fi if test "x$vt_xpm_include_X11" = xyes; then cat >>confdefs.h <<\_ACEOF #define XPM_INC_X11 1 _ACEOF fi fi if test x$no_xpm = xyes; then support_xpm=needsmanualspecification fi fi echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi for ac_header in \ assert.h \ fcntl.h \ grp.h \ libc.h \ lastlog.h \ stdarg.h \ stdlib.h \ string.h \ termios.h \ unistd.h \ sys/byteorder.h \ sys/ioctl.h \ sys/select.h \ sys/sockio.h \ sys/strredir.h \ sys/time.h \ utmp.h \ utmpx.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking whether termios.h and sys/ioctl.h may both be included" >&5 echo $ECHO_N "checking whether termios.h and sys/ioctl.h may both be included... $ECHO_C" >&6 if test "${rxvt_cv_header_sysioctl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef HAVE_TERMIOS_H #include #endif int main () { int a = ECHO; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_header_sysioctl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_header_sysioctl=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_header_sysioctl" >&5 echo "${ECHO_T}$rxvt_cv_header_sysioctl" >&6 if test -n "$GCC"; then LDARG="-Wl," else LDARG="" fi R_TRANSLATE='s/-L\([^ ]*\)/-L\1 '$LDARG'-rpath '$LDARG'\1/g' ac_save_CFLAGS=$CFLAGS ac_save_LIBS=$LIBS CFLAGS="$CFLAGS $X_CFLAGS" LIBS=`echo "$LIBS $X_LIBS $X_EXTRA_LIBS -lX11" | sed "$R_TRANSLATE"` echo "$as_me:$LINENO: checking for -rpath dynamic library path recording" >&5 echo $ECHO_N "checking for -rpath dynamic library path recording... $ECHO_C" >&6 if test "${rxvt_cv_rpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: WARNING: You may need to check the LIBS line" >&5 echo "$as_me: WARNING: You may need to check the LIBS line" >&2;} else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main() { exit(0); (void) XOpenDisplay("foobar"); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_rpath=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rxvt_cv_rpath=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $rxvt_cv_rpath" >&5 echo "${ECHO_T}$rxvt_cv_rpath" >&6 if test x$rxvt_cv_rpath != xyes; then R_TRANSLATE='s/-L\([^ ]*\)/-L\1 '$LDARG'-R\1/g' LIBS=`echo "$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11" | sed "$R_TRANSLATE"` echo "$as_me:$LINENO: checking for -R dynamic library path recording" >&5 echo $ECHO_N "checking for -R dynamic library path recording... $ECHO_C" >&6 if test "${rxvt_cv_R+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rxvt_cv_R=no else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main() { exit(0); (void) XOpenDisplay("foobar"); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_R=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rxvt_cv_R=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $rxvt_cv_R" >&5 echo "${ECHO_T}$rxvt_cv_R" >&6 if test x$rxvt_cv_R != xyes; then LIBS="$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11" fi fi echo "$as_me:$LINENO: checking for XPointer" >&5 echo $ECHO_N "checking for XPointer... $ECHO_C" >&6 if test "${rxvt_cv_xpointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XPointer dummy; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_xpointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_xpointer=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_xpointer" >&5 echo "${ECHO_T}$rxvt_cv_xpointer" >&6 if test x$rxvt_cv_xpointer = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_XPOINTER 1 _ACEOF fi LIBS=$ac_save_LIBS CFLAGS=$ac_save_CFLAGS echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* 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; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* 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 */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "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; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; no) cat >>confdefs.h <<\_ACEOF #define inline _ACEOF ;; *) cat >>confdefs.h <<_ACEOF #define inline $ac_cv_c_inline _ACEOF ;; esac echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((mode_t *) 0) return 0; if (sizeof (mode_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6 if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi echo "$as_me:$LINENO: checking for char" >&5 echo $ECHO_N "checking for char... $ECHO_C" >&6 if test "${ac_cv_type_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((char *) 0) return 0; if (sizeof (char)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_char=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_char=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 echo "${ECHO_T}$ac_cv_type_char" >&6 echo "$as_me:$LINENO: checking size of char" >&5 echo $ECHO_N "checking size of char... $ECHO_C" >&6 if test "${ac_cv_sizeof_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_char" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_char=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (char), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (char)); } unsigned long ulongval () { return (long) (sizeof (char)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (char))) < 0) { long i = longval (); if (i != ((long) (sizeof (char)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (char)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_char=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (char), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_char=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 echo "${ECHO_T}$ac_cv_sizeof_char" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_CHAR $ac_cv_sizeof_char _ACEOF echo "$as_me:$LINENO: checking for short" >&5 echo $ECHO_N "checking for short... $ECHO_C" >&6 if test "${ac_cv_type_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((short *) 0) return 0; if (sizeof (short)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_short=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 echo "${ECHO_T}$ac_cv_type_short" >&6 echo "$as_me:$LINENO: checking size of short" >&5 echo $ECHO_N "checking size of short... $ECHO_C" >&6 if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_short" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (short)); } unsigned long ulongval () { return (long) (sizeof (short)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (short))) < 0) { long i = longval (); if (i != ((long) (sizeof (short)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (short)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_short=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 echo "${ECHO_T}$ac_cv_sizeof_short" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF echo "$as_me:$LINENO: checking for int" >&5 echo $ECHO_N "checking for int... $ECHO_C" >&6 if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((int *) 0) return 0; if (sizeof (int)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6 echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6 if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_int" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (int)); } unsigned long ulongval () { return (long) (sizeof (int)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (int))) < 0) { long i = longval (); if (i != ((long) (sizeof (int)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (int)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_int=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6 if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((long *) 0) return 0; if (sizeof (long)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6 echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6 if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_long" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (long)); } unsigned long ulongval () { return (long) (sizeof (long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (long))) < 0) { long i = longval (); if (i != ((long) (sizeof (long)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (long)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_long=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF echo "$as_me:$LINENO: checking for long long" >&5 echo $ECHO_N "checking for long long... $ECHO_C" >&6 if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((long long *) 0) return 0; if (sizeof (long long)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6 echo "$as_me:$LINENO: checking size of long long" >&5 echo $ECHO_N "checking size of long long... $ECHO_C" >&6 if test "${ac_cv_sizeof_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_long_long" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (long long)); } unsigned long ulongval () { return (long) (sizeof (long long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (long long))) < 0) { long i = longval (); if (i != ((long) (sizeof (long long)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (long long)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_long_long=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF echo "$as_me:$LINENO: checking for int *" >&5 echo $ECHO_N "checking for int *... $ECHO_C" >&6 if test "${ac_cv_type_int_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((int * *) 0) return 0; if (sizeof (int *)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_int_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int_p=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int_p" >&5 echo "${ECHO_T}$ac_cv_type_int_p" >&6 echo "$as_me:$LINENO: checking size of int *" >&5 echo $ECHO_N "checking size of int *... $ECHO_C" >&6 if test "${ac_cv_sizeof_int_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_int_p" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int *))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int *))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int *))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int *))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int *))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int_p=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int *), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int *), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (int *)); } unsigned long ulongval () { return (long) (sizeof (int *)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (int *))) < 0) { long i = longval (); if (i != ((long) (sizeof (int *)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (int *)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int_p=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (int *), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int *), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_int_p=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_int_p" >&5 echo "${ECHO_T}$ac_cv_sizeof_int_p" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_INT_P $ac_cv_sizeof_int_p _ACEOF echo "$as_me:$LINENO: checking for int16_t" >&5 echo $ECHO_N "checking for int16_t... $ECHO_C" >&6 if test "${rxvt_cv_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int16_t dummy; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_int16_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 if test $ac_cv_sizeof_char -ge 2; then rxvt_cv_int16_t=" char" else if test $ac_cv_sizeof_short -ge 2; then rxvt_cv_int16_t=" short" else if test $ac_cv_sizeof_int -ge 2; then rxvt_cv_int16_t=" int" else if test $ac_cv_sizeof_long -ge 2; then rxvt_cv_int16_t=" long" else if test $ac_cv_sizeof_long_long -ge 2; then rxvt_cv_int16_t=" long long" else rxvt_cv_int16_t=" short" # we _must_ have a (possibly wrong) default fi fi fi fi fi fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_int16_t" >&5 echo "${ECHO_T}$rxvt_cv_int16_t" >&6 if test x"$rxvt_cv_int16_t" != xyes; then rxvt_int16_typedef="typedef $rxvt_cv_int16_t int16_t;" else if test x"" = x; then rxvt_int16_typedef="/* typedef short int16_t; */" else rxvt_int16_typedef="/* typedef short int16_t; */" fi fi echo "$as_me:$LINENO: checking for u_int16_t" >&5 echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 if test "${rxvt_cv_u_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { u_int16_t dummy; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_u_int16_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 if test $ac_cv_sizeof_char -ge 2; then rxvt_cv_u_int16_t="unsigned char" else if test $ac_cv_sizeof_short -ge 2; then rxvt_cv_u_int16_t="unsigned short" else if test $ac_cv_sizeof_int -ge 2; then rxvt_cv_u_int16_t="unsigned int" else if test $ac_cv_sizeof_long -ge 2; then rxvt_cv_u_int16_t="unsigned long" else if test $ac_cv_sizeof_long_long -ge 2; then rxvt_cv_u_int16_t="unsigned long long" else rxvt_cv_u_int16_t="unsigned short" # we _must_ have a (possibly wrong) default fi fi fi fi fi fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_u_int16_t" >&5 echo "${ECHO_T}$rxvt_cv_u_int16_t" >&6 if test x"$rxvt_cv_u_int16_t" != xyes; then rxvt_u_int16_typedef="typedef $rxvt_cv_u_int16_t u_int16_t;" else if test x"unsigned" = x; then rxvt_u_int16_typedef="/* typedef short u_int16_t; */" else rxvt_u_int16_typedef="/* typedef unsigned short u_int16_t; */" fi fi echo "$as_me:$LINENO: checking for int32_t" >&5 echo $ECHO_N "checking for int32_t... $ECHO_C" >&6 if test "${rxvt_cv_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int32_t dummy; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_int32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 if test $ac_cv_sizeof_char -ge 4; then rxvt_cv_int32_t=" char" else if test $ac_cv_sizeof_short -ge 4; then rxvt_cv_int32_t=" short" else if test $ac_cv_sizeof_int -ge 4; then rxvt_cv_int32_t=" int" else if test $ac_cv_sizeof_long -ge 4; then rxvt_cv_int32_t=" long" else if test $ac_cv_sizeof_long_long -ge 4; then rxvt_cv_int32_t=" long long" else rxvt_cv_int32_t=" int" # we _must_ have a (possibly wrong) default fi fi fi fi fi fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_int32_t" >&5 echo "${ECHO_T}$rxvt_cv_int32_t" >&6 if test x"$rxvt_cv_int32_t" != xyes; then rxvt_int32_typedef="typedef $rxvt_cv_int32_t int32_t;" else if test x"" = x; then rxvt_int32_typedef="/* typedef int int32_t; */" else rxvt_int32_typedef="/* typedef int int32_t; */" fi fi echo "$as_me:$LINENO: checking for u_int32_t" >&5 echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 if test "${rxvt_cv_u_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { u_int32_t dummy; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_u_int32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 if test $ac_cv_sizeof_char -ge 4; then rxvt_cv_u_int32_t="unsigned char" else if test $ac_cv_sizeof_short -ge 4; then rxvt_cv_u_int32_t="unsigned short" else if test $ac_cv_sizeof_int -ge 4; then rxvt_cv_u_int32_t="unsigned int" else if test $ac_cv_sizeof_long -ge 4; then rxvt_cv_u_int32_t="unsigned long" else if test $ac_cv_sizeof_long_long -ge 4; then rxvt_cv_u_int32_t="unsigned long long" else rxvt_cv_u_int32_t="unsigned int" # we _must_ have a (possibly wrong) default fi fi fi fi fi fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_u_int32_t" >&5 echo "${ECHO_T}$rxvt_cv_u_int32_t" >&6 if test x"$rxvt_cv_u_int32_t" != xyes; then rxvt_u_int32_typedef="typedef $rxvt_cv_u_int32_t u_int32_t;" else if test x"unsigned" = x; then rxvt_u_int32_typedef="/* typedef int u_int32_t; */" else rxvt_u_int32_typedef="/* typedef unsigned int u_int32_t; */" fi fi echo "$as_me:$LINENO: checking for int64_t" >&5 echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 if test "${rxvt_cv_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int64_t dummy; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_int64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 if test $ac_cv_sizeof_char -ge 8; then rxvt_cv_int64_t=" char" else if test $ac_cv_sizeof_short -ge 8; then rxvt_cv_int64_t=" short" else if test $ac_cv_sizeof_int -ge 8; then rxvt_cv_int64_t=" int" else if test $ac_cv_sizeof_long -ge 8; then rxvt_cv_int64_t=" long" else if test $ac_cv_sizeof_long_long -ge 8; then rxvt_cv_int64_t=" long long" else rxvt_cv_int64_t=" long long" # we _must_ have a (possibly wrong) default fi fi fi fi fi fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_int64_t" >&5 echo "${ECHO_T}$rxvt_cv_int64_t" >&6 if test x"$rxvt_cv_int64_t" != xyes; then rxvt_int64_typedef="typedef $rxvt_cv_int64_t int64_t;" else if test x"" = x; then rxvt_int64_typedef="/* typedef long long int64_t; */" else rxvt_int64_typedef="/* typedef long long int64_t; */" fi fi echo "$as_me:$LINENO: checking for u_int64_t" >&5 echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 if test "${rxvt_cv_u_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { u_int64_t dummy; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_u_int64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 if test $ac_cv_sizeof_char -ge 8; then rxvt_cv_u_int64_t="unsigned char" else if test $ac_cv_sizeof_short -ge 8; then rxvt_cv_u_int64_t="unsigned short" else if test $ac_cv_sizeof_int -ge 8; then rxvt_cv_u_int64_t="unsigned int" else if test $ac_cv_sizeof_long -ge 8; then rxvt_cv_u_int64_t="unsigned long" else if test $ac_cv_sizeof_long_long -ge 8; then rxvt_cv_u_int64_t="unsigned long long" else rxvt_cv_u_int64_t="unsigned long long" # we _must_ have a (possibly wrong) default fi fi fi fi fi fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_u_int64_t" >&5 echo "${ECHO_T}$rxvt_cv_u_int64_t" >&6 if test x"$rxvt_cv_u_int64_t" != xyes; then rxvt_u_int64_typedef="typedef $rxvt_cv_u_int64_t u_int64_t;" else if test x"unsigned" = x; then rxvt_u_int64_typedef="/* typedef long long u_int64_t; */" else rxvt_u_int64_typedef="/* typedef unsigned long long u_int64_t; */" fi fi if test $ac_cv_sizeof_int_p -eq 8; then rxvt_intp_define="#define intp_t int64_t" rxvt_u_intp_define="#define u_intp_t u_int64_t" else if test $ac_cv_sizeof_int_p -eq 4; then rxvt_intp_define="#define intp_t int32_t" rxvt_u_intp_define="#define u_intp_t u_int32_t" else if test $ac_cv_sizeof_int_p -eq 2; then rxvt_intp_define="#define intp_t int16_t" rxvt_u_intp_define="#define u_intp_t u_int16_t" else rxvt_intp_define="#error set intp_t" rxvt_u_intp_define="#error set u_intp_t" fi fi fi echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #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; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF case "$host_alias" in *ultrix) ac_cv_func_setsid='no' ;; *) break;; esac for ac_func in \ atexit \ revoke \ unsetenv \ setutent \ seteuid \ setreuid \ setsid \ setpgrp \ setpgid \ openpty \ _getpty \ grantpt \ unlockpt \ isastream \ on_exit \ nanosleep \ updwtmp \ ttyslot \ do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* 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 (); /* 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 char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_utmp_h+set}" = set; then echo "$as_me:$LINENO: checking for utmp.h" >&5 echo $ECHO_N "checking for utmp.h... $ECHO_C" >&6 if test "${ac_cv_header_utmp_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_utmp_h" >&5 echo "${ECHO_T}$ac_cv_header_utmp_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking utmp.h usability" >&5 echo $ECHO_N "checking utmp.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking utmp.h presence" >&5 echo $ECHO_N "checking utmp.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: utmp.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: utmp.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: utmp.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: utmp.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: utmp.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: utmp.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: utmp.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: utmp.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: utmp.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: utmp.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for utmp.h" >&5 echo $ECHO_N "checking for utmp.h... $ECHO_C" >&6 if test "${ac_cv_header_utmp_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_utmp_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_utmp_h" >&5 echo "${ECHO_T}$ac_cv_header_utmp_h" >&6 fi if test $ac_cv_header_utmp_h = yes; then echo "$as_me:$LINENO: checking for struct utmp" >&5 echo $ECHO_N "checking for struct utmp... $ECHO_C" >&6 if test "${rxvt_cv_struct_utmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct utmp ut; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_struct_utmp=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_struct_utmp=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_struct_utmp" >&5 echo "${ECHO_T}$rxvt_cv_struct_utmp" >&6 if test x$rxvt_cv_struct_utmp = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_UTMP 1 _ACEOF fi echo "$as_me:$LINENO: checking for ut_host in utmp struct" >&5 echo $ECHO_N "checking for ut_host in utmp struct... $ECHO_C" >&6 if test "${rxvt_cv_struct_utmp_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct utmp ut; ut.ut_host; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_struct_utmp_host=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_struct_utmp_host=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_struct_utmp_host" >&5 echo "${ECHO_T}$rxvt_cv_struct_utmp_host" >&6 if test x$rxvt_cv_struct_utmp_host = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UTMP_HOST 1 _ACEOF fi echo "$as_me:$LINENO: checking for ut_pid in utmp struct" >&5 echo $ECHO_N "checking for ut_pid in utmp struct... $ECHO_C" >&6 if test "${rxvt_cv_struct_utmp_pid+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct utmp ut; ut.ut_pid; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_struct_utmp_pid=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_struct_utmp_pid=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_struct_utmp_pid" >&5 echo "${ECHO_T}$rxvt_cv_struct_utmp_pid" >&6 if test x$rxvt_cv_struct_utmp_pid = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UTMP_PID 1 _ACEOF fi fi if test "${ac_cv_header_utmpx_h+set}" = set; then echo "$as_me:$LINENO: checking for utmpx.h" >&5 echo $ECHO_N "checking for utmpx.h... $ECHO_C" >&6 if test "${ac_cv_header_utmpx_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_utmpx_h" >&5 echo "${ECHO_T}$ac_cv_header_utmpx_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking utmpx.h usability" >&5 echo $ECHO_N "checking utmpx.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking utmpx.h presence" >&5 echo $ECHO_N "checking utmpx.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: utmpx.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: utmpx.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: utmpx.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: utmpx.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: utmpx.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: utmpx.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: utmpx.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: utmpx.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: utmpx.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: utmpx.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for utmpx.h" >&5 echo $ECHO_N "checking for utmpx.h... $ECHO_C" >&6 if test "${ac_cv_header_utmpx_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_utmpx_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_utmpx_h" >&5 echo "${ECHO_T}$ac_cv_header_utmpx_h" >&6 fi if test $ac_cv_header_utmpx_h = yes; then echo "$as_me:$LINENO: checking for struct utmpx" >&5 echo $ECHO_N "checking for struct utmpx... $ECHO_C" >&6 if test "${rxvt_cv_struct_utmpx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct utmpx ut; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_struct_utmpx=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_struct_utmpx=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_struct_utmpx" >&5 echo "${ECHO_T}$rxvt_cv_struct_utmpx" >&6 if test x$rxvt_cv_struct_utmpx = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_UTMPX 1 _ACEOF fi echo "$as_me:$LINENO: checking for host in utmpx struct" >&5 echo $ECHO_N "checking for host in utmpx struct... $ECHO_C" >&6 if test "${rxvt_cv_struct_utmpx_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct utmpx utx; utx.ut_host; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_struct_utmpx_host=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_struct_utmpx_host=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_struct_utmpx_host" >&5 echo "${ECHO_T}$rxvt_cv_struct_utmpx_host" >&6 if test x$rxvt_cv_struct_utmpx_host = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UTMPX_HOST 1 _ACEOF fi fi echo "$as_me:$LINENO: checking for struct lastlog" >&5 echo $ECHO_N "checking for struct lastlog... $ECHO_C" >&6 if test "${rxvt_cv_struct_lastlog+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef HAVE_LASTLOG_H #include #endif int main () { struct lastlog ll; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_struct_lastlog=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_struct_lastlog=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_struct_lastlog" >&5 echo "${ECHO_T}$rxvt_cv_struct_lastlog" >&6 if test x$rxvt_cv_struct_lastlog = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_LASTLOG 1 _ACEOF fi echo "$as_me:$LINENO: checking for struct lastlogx" >&5 echo $ECHO_N "checking for struct lastlogx... $ECHO_C" >&6 if test "${rxvt_cv_struct_lastlogx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef HAVE_LASTLOG_H #include #endif int main () { struct lastlogx ll; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_struct_lastlogx=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_struct_lastlogx=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_struct_lastlogx" >&5 echo "${ECHO_T}$rxvt_cv_struct_lastlogx" >&6 if test x$rxvt_cv_struct_lastlogx = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_LASTLOGX 1 _ACEOF fi echo "$as_me:$LINENO: checking where utmp is located" >&5 echo $ECHO_N "checking where utmp is located... $ECHO_C" >&6 if test "${rxvt_cv_path_utmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: WARNING: Define RXVT_UTMP_FILE in config.h manually" >&5 echo "$as_me: WARNING: Define RXVT_UTMP_FILE in config.h manually" >&2;} else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include main() { char **u, *utmplist[] = { "/var/run/utmp", "/var/adm/utmp", "/etc/utmp", "/usr/etc/utmp", "/usr/adm/utmp", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1); #ifdef UTMP_FILE fprintf(f, "%s\n", UTMP_FILE); exit(0); #endif #ifdef _PATH_UTMP fprintf(f, "%s\n", _PATH_UTMP); exit(0); #endif for (u = utmplist; *u; u++) { if ((a = fopen(*u, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *u); exit(0); } } exit(0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_path_utmp=`cat conftestval` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rxvt_cv_path_utmp= fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $rxvt_cv_path_utmp" >&5 echo "${ECHO_T}$rxvt_cv_path_utmp" >&6 if test x$rxvt_cv_path_utmp != x; then cat >>confdefs.h <<_ACEOF #define RXVT_UTMP_FILE "$rxvt_cv_path_utmp" _ACEOF fi echo "$as_me:$LINENO: checking where utmpx is located" >&5 echo $ECHO_N "checking where utmpx is located... $ECHO_C" >&6 if test "${rxvt_cv_path_utmpx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: WARNING: Define RXVT_UTMPX_FILE in config.h manually" >&5 echo "$as_me: WARNING: Define RXVT_UTMPX_FILE in config.h manually" >&2;} else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include #include #ifdef HAVE_STRING_H #include #endif main() { char **u, *p, *utmplist[] = { #ifdef UTMPX_FILE UTMPX_FILE, #endif #ifdef _PATH_UTMPX _PATH_UTMPX, #endif "/var/adm/utmpx", "/etc/utmpx", NULL }; FILE *a, *f=fopen("conftestval", "w"); struct stat statu, statux; if (!f) exit(1); for (u = utmplist; *u; u++) { if ((a = fopen(*u, "r")) != NULL || errno == EACCES) { if (stat(*u, &statux) < 0) continue; p = strdup(*u); p[strlen(p) - 1] = '\0'; if (stat(p, &statu) >= 0 && (statu.st_mtime - statux.st_mtime > 86400)) continue; fprintf(f, "%s\n", *u); exit(0); } } exit(0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_path_utmpx=`cat conftestval` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rxvt_cv_path_utmpx= fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $rxvt_cv_path_utmpx" >&5 echo "${ECHO_T}$rxvt_cv_path_utmpx" >&6 if test x$rxvt_cv_path_utmpx != x; then cat >>confdefs.h <<_ACEOF #define RXVT_UTMPX_FILE "$rxvt_cv_path_utmpx" _ACEOF fi echo "$as_me:$LINENO: checking where wtmp is located" >&5 echo $ECHO_N "checking where wtmp is located... $ECHO_C" >&6 if test "${rxvt_cv_path_wtmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: WARNING: Define RXVT_WTMP_FILE in config.h manually" >&5 echo "$as_me: WARNING: Define RXVT_WTMP_FILE in config.h manually" >&2;} else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef HAVE_UTMP_H #include #endif #include main() { char **w, *wtmplist[] = { "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1); #ifdef WTMP_FILE fprintf(f, "%s\n", WTMP_FILE); exit(0); #endif #ifdef _PATH_WTMP fprintf(f, "%s\n", _PATH_WTMP); exit(0); #endif for (w = wtmplist; *w; w++) { if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *w); exit(0); } } exit(0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_path_wtmp=`cat conftestval` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rxvt_cv_path_wtmp= fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $rxvt_cv_path_wtmp" >&5 echo "${ECHO_T}$rxvt_cv_path_wtmp" >&6 if test x$rxvt_cv_path_wtmp != x; then cat >>confdefs.h <<_ACEOF #define RXVT_WTMP_FILE "$rxvt_cv_path_wtmp" _ACEOF fi echo "$as_me:$LINENO: checking where wtmpx is located" >&5 echo $ECHO_N "checking where wtmpx is located... $ECHO_C" >&6 if test "${rxvt_cv_path_wtmpx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: WARNING: Define RXVT_WTMPX_FILE in config.h manually" >&5 echo "$as_me: WARNING: Define RXVT_WTMPX_FILE in config.h manually" >&2;} else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef HAVE_UTMPX_H #include #endif #include main() { char **w, *wtmplist[] = { "/var/log/wtmpx", "/var/adm/wtmpx", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1); #ifdef WTMPX_FILE fprintf(f, "%s\n", WTMPX_FILE); exit(0); #endif #ifdef _PATH_WTMPX fprintf(f, "%s\n", _PATH_WTMPX); exit(0); #endif for (w = wtmplist; *w; w++) { if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *w); exit(0); } } exit(0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_path_wtmpx=`cat conftestval` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rxvt_cv_path_wtmpx= fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $rxvt_cv_path_wtmpx" >&5 echo "${ECHO_T}$rxvt_cv_path_wtmpx" >&6 if test x$rxvt_cv_path_wtmpx != x; then cat >>confdefs.h <<_ACEOF #define RXVT_WTMPX_FILE "$rxvt_cv_path_wtmpx" _ACEOF fi echo "$as_me:$LINENO: checking where lastlog is located" >&5 echo $ECHO_N "checking where lastlog is located... $ECHO_C" >&6 if test "${rxvt_cv_path_lastlog+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: WARNING: Define RXVT_LASTLOG_FILE in config.h manually" >&5 echo "$as_me: WARNING: Define RXVT_LASTLOG_FILE in config.h manually" >&2;} else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef HAVE_UTMPX_H #include #elif defined(HAVE_UTMP_H) #include #endif #ifdef HAVE_LASTLOG_H #include #endif #include main() { char **w, *lastloglist[] = { "/var/log/lastlog", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1); #ifdef LASTLOG_FILE fprintf(f, "%s\n", LASTLOG_FILE); exit(0); #endif #ifdef _PATH_LASTLOG fprintf(f, "%s\n", _PATH_LASTLOG); exit(0); #endif for (w = lastloglist; *w; w++) { if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *w); exit(0); } } exit(0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_path_lastlog=`cat conftestval` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rxvt_cv_path_lastlog= fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $rxvt_cv_path_lastlog" >&5 echo "${ECHO_T}$rxvt_cv_path_lastlog" >&6 if test x$rxvt_cv_path_lastlog != x; then cat >>confdefs.h <<_ACEOF #define RXVT_LASTLOG_FILE "$rxvt_cv_path_lastlog" _ACEOF if test -d "$rxvt_cv_path_lastlog"; then cat >>confdefs.h <<\_ACEOF #define LASTLOG_IS_DIR 1 _ACEOF fi fi echo "$as_me:$LINENO: checking where lastlogx is located" >&5 echo $ECHO_N "checking where lastlogx is located... $ECHO_C" >&6 if test "${rxvt_cv_path_lastlogx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: WARNING: Define RXVT_LASTLOGX_FILE in config.h manually" >&5 echo "$as_me: WARNING: Define RXVT_LASTLOGX_FILE in config.h manually" >&2;} else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef HAVE_UTMPX_H #include #endif #include main() { char **w, *wtmplist[] = { "/var/log/lastlogx", "/var/adm/lastlogx", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1); #ifdef LASTLOGX_FILE fprintf(f, "%s\n", LASTLOGX_FILE); exit(0); #endif #ifdef _PATH_LASTLOGX fprintf(f, "%s\n", _PATH_LASTLOGX); exit(0); #endif for (w = wtmplist; *w; w++) { if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *w); exit(0); } } exit(0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_path_lastlogx=`cat conftestval` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rxvt_cv_path_lastlogx= fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $rxvt_cv_path_lastlogx" >&5 echo "${ECHO_T}$rxvt_cv_path_lastlogx" >&6 if test x$rxvt_cv_path_lastlogx != x; then cat >>confdefs.h <<_ACEOF #define RXVT_LASTLOGX_FILE "$rxvt_cv_path_lastlogx" _ACEOF fi echo "$as_me:$LINENO: checking where ttys/ttytab is located" >&5 echo $ECHO_N "checking where ttys/ttytab is located... $ECHO_C" >&6 if test "${rxvt_cv_path_ttytab+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for ttys_file in /etc/ttys /etc/ttytab; do if test -f "$ttys_file" ; then rxvt_cv_path_ttytab=$ttys_file break fi done fi echo "$as_me:$LINENO: result: $rxvt_cv_path_ttytab" >&5 echo "${ECHO_T}$rxvt_cv_path_ttytab" >&6 if test x$rxvt_cv_path_ttytab != x; then cat >>confdefs.h <<_ACEOF #define TTYTAB_FILENAME "$rxvt_cv_path_ttytab" _ACEOF fi ac_save_LIBS=$LIBS ac_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $X_CFLAGS" LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lX11" if test x$rxvt_cv_rpath = xyes -o x$rxvt_cv_R = xyes; then LIBS=`echo $LIBS | sed "$R_TRANSLATE"` fi echo "$as_me:$LINENO: checking for working Xlocale" >&5 echo $ECHO_N "checking for working Xlocale... $ECHO_C" >&6 if test "${rxvt_cv_func_xlocale+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: WARNING: Define NO_XLOCALE in config.h manually" >&5 echo "$as_me: WARNING: Define NO_XLOCALE in config.h manually" >&2;} else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include main() { char *p; if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p) exit (XSupportsLocale() ? 0 : 1); else exit (1);} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_func_xlocale=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rxvt_cv_func_xlocale=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $rxvt_cv_func_xlocale" >&5 echo "${ECHO_T}$rxvt_cv_func_xlocale" >&6 if test x$rxvt_cv_func_xlocale = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_XLOCALE 1 _ACEOF fi echo "$as_me:$LINENO: checking for working X setlocale" >&5 echo $ECHO_N "checking for working X setlocale... $ECHO_C" >&6 if test "${rxvt_cv_func_xsetlocale+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define X_LOCALE 1 #include int main () { setlocale(LC_CTYPE, ""); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_func_xsetlocale=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_func_xsetlocale=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_func_xsetlocale" >&5 echo "${ECHO_T}$rxvt_cv_func_xsetlocale" >&6 if test x$rxvt_cv_func_xsetlocale = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_XSETLOCALE 1 _ACEOF fi LIBS=$ac_save_LIBS CFLAGS=$ac_save_CFLAGS echo "$as_me:$LINENO: checking for working plain setlocale" >&5 echo $ECHO_N "checking for working plain setlocale... $ECHO_C" >&6 if test "${rxvt_cv_func_setlocale+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { setlocale(LC_CTYPE, ""); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_func_setlocale=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_func_setlocale=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_func_setlocale" >&5 echo "${ECHO_T}$rxvt_cv_func_setlocale" >&6 if test x$rxvt_cv_func_setlocale = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SETLOCALE 1 _ACEOF fi echo "$as_me:$LINENO: checking for working nl_langinfo" >&5 echo $ECHO_N "checking for working nl_langinfo... $ECHO_C" >&6 if test "${rxvt_cv_func_nl_langinfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { nl_langinfo(CODESET); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_func_nl_langinfo=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_func_nl_langinfo=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_func_nl_langinfo" >&5 echo "${ECHO_T}$rxvt_cv_func_nl_langinfo" >&6 if test x$rxvt_cv_func_nl_langinfo = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NL_LANGINFO 1 _ACEOF fi echo "$as_me:$LINENO: checking for getpt" >&5 echo $ECHO_N "checking for getpt... $ECHO_C" >&6 if test "${rxvt_cv_func_getpt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _GNU_SOURCE #ifdef HAVE_STDLIB_H # include #endif int main () { (void)getpt(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_func_getpt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_func_getpt=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rxvt_cv_func_getpt" >&5 echo "${ECHO_T}$rxvt_cv_func_getpt" >&6 if test x$rxvt_cv_func_getpt = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETPT 1 _ACEOF fi echo "$as_me:$LINENO: checking for pty/tty type" >&5 echo $ECHO_N "checking for pty/tty type... $ECHO_C" >&6 if test "${rxvt_cv_ptys+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test x$ac_cv_func_openpty = xyes; then rxvt_cv_ptys=OPENPTY else if test x$ac_cv_func__getpty = xyes; then rxvt_cv_ptys=SGI4 else if test -c /dev/ttyp20; then rxvt_cv_ptys=SCO else if test -c /dev/ptym/clone; then rxvt_cv_ptys=HPUX else if test x$rxvt_cv_func_getpt = xyes; then rxvt_cv_ptys=GLIBC else if test -c /dev/ptc -a -c /dev/pts; then rxvt_cv_ptys=PTC else if test -c /dev/ptc -a -d /dev/pts; then rxvt_cv_ptys=PTC else if test -c /dev/ptmx -a -c /dev/pts/0; then rxvt_cv_ptys=STREAMS else if test x$ac_cv_func_grantpt = xyes && test x$ac_cv_func_unlockpt = xyes; then rxvt_cv_ptys=STREAMS else rxvt_cv_ptys=BSD fi fi fi fi fi fi fi fi fi fi echo "$as_me:$LINENO: result: $rxvt_cv_ptys" >&5 echo "${ECHO_T}$rxvt_cv_ptys" >&6 if test x$rxvt_cv_ptys = xOPENPTY; then cat >>confdefs.h <<\_ACEOF #define PTYS_ARE_OPENPTY 1 _ACEOF fi if test x$rxvt_cv_ptys = xSCO; then cat >>confdefs.h <<\_ACEOF #define PTYS_ARE_NUMERIC 1 _ACEOF fi if test x$rxvt_cv_ptys = xSTREAMS; then cat >>confdefs.h <<\_ACEOF #define PTYS_ARE_PTMX 1 _ACEOF fi if test x$rxvt_cv_ptys = xPTC; then cat >>confdefs.h <<\_ACEOF #define PTYS_ARE_PTC 1 _ACEOF fi if test x$rxvt_cv_ptys = xSGI4; then cat >>confdefs.h <<\_ACEOF #define PTYS_ARE__GETPTY 1 _ACEOF fi if test x$rxvt_cv_ptys = xCONVEX; then cat >>confdefs.h <<\_ACEOF #define PTYS_ARE_GETPTY 1 _ACEOF fi if test x$rxvt_cv_ptys = xGLIBC; then cat >>confdefs.h <<\_ACEOF #define PTYS_ARE_GETPT 1 _ACEOF fi if test x$rxvt_cv_ptys = xHPUX; then cat >>confdefs.h <<\_ACEOF #define PTYS_ARE_CLONE 1 _ACEOF fi if test x$rxvt_cv_ptys = xBSD -o x$rxvt_cv_ptys = xHPUX -o x$rxvt_cv_ptys = xGLIBC; then cat >>confdefs.h <<\_ACEOF #define PTYS_ARE_SEARCHED 1 _ACEOF fi { echo "$as_me:$LINENO: checking for pty ranges..." >&5 echo "$as_me: checking for pty ranges..." >&6;} ptys=`echo /dev/pty??` pch1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` pch2=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` if test x$pch1 != x; then cat >>confdefs.h <<_ACEOF #define PTYCHAR1 "$pch1" _ACEOF fi if test x$pch2 != x; then cat >>confdefs.h <<_ACEOF #define PTYCHAR2 "$pch2" _ACEOF fi echo "$as_me:$LINENO: checking for setlocale in -lxpg4" >&5 echo $ECHO_N "checking for setlocale in -lxpg4... $ECHO_C" >&6 if test "${ac_cv_lib_xpg4_setlocale+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxpg4 $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setlocale (); int main () { setlocale (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_xpg4_setlocale=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_xpg4_setlocale=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_xpg4_setlocale" >&5 echo "${ECHO_T}$ac_cv_lib_xpg4_setlocale" >&6 if test $ac_cv_lib_xpg4_setlocale = yes; then LIBS="$LIBS -lxpg4" fi if test x$support_graphics = xyes; then cat >>confdefs.h <<\_ACEOF #define RXVT_GRAPHICS 1 _ACEOF OBJGRAPHICS="graphics.o" fi if test x$support_inheritpixmap = xyes; then cat >>confdefs.h <<\_ACEOF #define TRANSPARENT 1 _ACEOF fi if test x$support_keepscrolling = xno; then cat >>confdefs.h <<\_ACEOF #define NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1 _ACEOF fi if test x$support_menubar = xyes; then cat >>confdefs.h <<\_ACEOF #define MENUBAR 1 _ACEOF OBJMENUBAR="menubar.o" fi if test x$support_frills = xno; then cat >>confdefs.h <<\_ACEOF #define NO_FRILLS 1 _ACEOF fi if test x$support_linespace = xno; then cat >>confdefs.h <<\_ACEOF #define NO_LINESPACE 1 _ACEOF fi if test x$support_24bit = xyes; then cat >>confdefs.h <<\_ACEOF #define PREFER_24BIT 1 _ACEOF fi if test x$support_mousewheel = xyes; then cat >>confdefs.h <<\_ACEOF #define MOUSE_WHEEL 1 _ACEOF fi if test x$support_mouseslipwheel = xyes; then cat >>confdefs.h <<\_ACEOF #define MOUSE_SLIP_WHEELING 1 _ACEOF fi if test x$support_oldselection = xno; then cat >>confdefs.h <<\_ACEOF #define NO_OLD_SELECTION 1 _ACEOF fi if test x$support_utmp = xyes; then cat >>confdefs.h <<\_ACEOF #define UTMP_SUPPORT 1 _ACEOF OBJLOGGING="logging.o" fi if test x$support_wtmp = xyes; then cat >>confdefs.h <<\_ACEOF #define WTMP_SUPPORT 1 _ACEOF fi if test x$support_lastlog = xyes; then cat >>confdefs.h <<\_ACEOF #define LASTLOG_SUPPORT 1 _ACEOF fi if test x$support_xim = xyes -o x$multichar_set = xyes; then if test x$rxvt_cv_func_xlocale = xyes; then cat >>confdefs.h <<\_ACEOF #define USE_XIM 1 _ACEOF fi fi if test x$support_xpm = xyes; then cat >>confdefs.h <<\_ACEOF #define XPM_BACKGROUND 1 _ACEOF OBJXPM="xpm.o" fi if test x$support_scroll_rxvt = xyes; then cat >>confdefs.h <<\_ACEOF #define RXVT_SCROLLBAR 1 _ACEOF OBJSCROLLBAR="scrollbar-rxvt.o" scrolltypes="rxvt" fi if test x$support_scroll_next = xyes; then cat >>confdefs.h <<\_ACEOF #define NEXT_SCROLLBAR 1 _ACEOF OBJSCROLLBAR="$OBJSCROLLBAR scrollbar-next.o" scrolltypes="$scrolltypes next" fi if test x$support_scroll_xterm = xyes; then cat >>confdefs.h <<\_ACEOF #define XTERM_SCROLLBAR 1 _ACEOF OBJSCROLLBAR="$OBJSCROLLBAR scrollbar-xterm.o" scrolltypes="$scrolltypes xterm" fi CFLAGS=${CFLAGS--O} LDFLAGS=${LDFLAGS--O} CPPFLAGS="$CPPFLAGS" if test x$rxvt_cv_rpath = xyes -o x$rxvt_cv_R = xyes; then DLIB=`echo $DLIB | sed "$R_TRANSLATE"` LIBS=`echo $LIBS | sed "$R_TRANSLATE"` X_LIBS=`echo $X_LIBS | sed "$R_TRANSLATE"` X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed "$R_TRANSLATE"` XPM_LIBS=`echo $XPM_LIBS | sed "$R_TRANSLATE"` fi if test x$support_addstrings = xyes; then OBJSTRINGS="strings.o" else cat >>confdefs.h <<\_ACEOF #define NO_STRINGS 1 _ACEOF fi OBJLIST="command.o defaultfont.o init.o $OBJGRAPHICS $OBJGRKELOT $OBJLOGGING main.o $OBJMENUBAR misc.o netdisp.o ptytty.o screen.o scrollbar.o $OBJSCROLLBAR $OBJSTRINGS xdefaults.o $OBJXPM" LIBOBJLIST=`echo $OBJLIST | sed 's/\.o/.lo/g'` MCOMMON=./autoconf/Make.common test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed RXVTNAME=`echo rxvt|sed "$program_transform_name"` if test "$ac_cv_header_stdarg_h" = "yes" -o "$notset" = "dontmatch"; then include_stdarg_h="#include " else include_stdarg_h="/* #include */" fi if test "$ac_cv_header_stdlib_h" = "yes" -o "$notset" = "dontmatch"; then include_stdlib_h="#include " else include_stdlib_h="/* #include */" fi if test "$ac_cv_header_unistd_h" = "yes" -o "$notset" = "dontmatch"; then include_unistd_h="#include " else include_unistd_h="/* #include */" fi if test "$ac_cv_header_string_h" = "yes" -o "$notset" = "dontmatch"; then include_string_h="#include " else include_string_h="/* #include */" fi if test "$ac_cv_header_fcntl_h" = "yes" -o "$notset" = "dontmatch"; then include_fcntl_h="#include " else include_fcntl_h="/* #include */" fi if test "$ac_cv_header_util_h" = "yes" -o "$notset" = "dontmatch"; then include_util_h="#include " else include_util_h="/* #include */" fi if test "$ac_cv_header_assert_h" = "yes" -o "$notset" = "dontmatch"; then include_assert_h="#include " else include_assert_h="/* #include */" fi if test "$rxvt_cv_header_sysioctl" = "yes" -o "$notset" = "dontmatch"; then include_sys_ioctl_h="#include " else include_sys_ioctl_h="/* #include */" fi if test "$ac_cv_header_sys_select_h" = "yes" -o "$notset" = "dontmatch"; then include_sys_select_h="#include " else include_sys_select_h="/* #include */" fi if test "$ac_cv_header_sys_strredir_h" = "yes" -o "$notset" = "dontmatch"; then include_sys_strredir_h="#include " else include_sys_strredir_h="/* #include */" fi if test "$ac_cv_header_sys_time_h" = "yes" -o "$notset" = "dontmatch"; then include_sys_time_h="#include " else include_sys_time_h="/* #include */" fi if test "$ac_cv_header_sys_time_h" = "no" -o "$ac_cv_header_time" = "yes"; then include_time_h="#include " else include_time_h="/* #include */" fi if test "$multichar_set" = yes; then lib_multicharset="#define MULTICHAR_SET 1" else lib_multicharset="/* #undef MULTICHAR_SET */" fi ac_config_files="$ac_config_files autoconf/Make.common Makefile doc/Makefile src/Makefile src/graphics/Makefile src/test/Makefile src/rxvtlib.h rclock/Makefile W11/Makefile" cat >confcache <<\_ACEOF # 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, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # 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 | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "autoconf/Make.common" ) CONFIG_FILES="$CONFIG_FILES autoconf/Make.common" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/graphics/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/graphics/Makefile" ;; "src/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/test/Makefile" ;; "src/rxvtlib.h" ) CONFIG_FILES="$CONFIG_FILES src/rxvtlib.h" ;; "rclock/Makefile" ) CONFIG_FILES="$CONFIG_FILES rclock/Makefile" ;; "W11/Makefile" ) CONFIG_FILES="$CONFIG_FILES W11/Makefile" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:autoconf/config.h.in" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@VERSION@,$VERSION,;t t s,@DATE@,$DATE,;t t s,@LSMDATE@,$LSMDATE,;t t s,@LIBVERSION@,$LIBVERSION,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@AWK@,$AWK,;t t s,@EGREP@,$EGREP,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@INSTALL_LIBRXVT@,$INSTALL_LIBRXVT,;t t s,@MV@,$MV,;t t s,@RM@,$RM,;t t s,@CP@,$CP,;t t s,@LN@,$LN,;t t s,@SED@,$SED,;t t s,@CMP@,$CMP,;t t s,@TBL@,$TBL,;t t s,@X_CFLAGS@,$X_CFLAGS,;t t s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t s,@X_LIBS@,$X_LIBS,;t t s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t s,@XPM_CPPFLAGS@,$XPM_CPPFLAGS,;t t s,@XPM_CFLAGS@,$XPM_CFLAGS,;t t s,@XPM_LIBS@,$XPM_LIBS,;t t s,@rxvt_int16_typedef@,$rxvt_int16_typedef,;t t s,@rxvt_u_int16_typedef@,$rxvt_u_int16_typedef,;t t s,@rxvt_int32_typedef@,$rxvt_int32_typedef,;t t s,@rxvt_u_int32_typedef@,$rxvt_u_int32_typedef,;t t s,@rxvt_int64_typedef@,$rxvt_int64_typedef,;t t s,@rxvt_u_int64_typedef@,$rxvt_u_int64_typedef,;t t s,@rxvt_intp_define@,$rxvt_intp_define,;t t s,@rxvt_u_intp_define@,$rxvt_u_intp_define,;t t s,@DEBUG@,$DEBUG,;t t s,@DINCLUDE@,$DINCLUDE,;t t s,@DLIB@,$DLIB,;t t s,@OBJLIST@,$OBJLIST,;t t s,@LIBOBJLIST@,$LIBOBJLIST,;t t s,@RXVTNAME@,$RXVTNAME,;t t s,@include_stdarg_h@,$include_stdarg_h,;t t s,@include_stdlib_h@,$include_stdlib_h,;t t s,@include_unistd_h@,$include_unistd_h,;t t s,@include_string_h@,$include_string_h,;t t s,@include_fcntl_h@,$include_fcntl_h,;t t s,@include_util_h@,$include_util_h,;t t s,@include_assert_h@,$include_assert_h,;t t s,@include_sys_ioctl_h@,$include_sys_ioctl_h,;t t s,@include_sys_select_h@,$include_sys_select_h,;t t s,@include_sys_strredir_h@,$include_sys_strredir_h,;t t s,@include_sys_time_h@,$include_sys_time_h,;t t s,@include_time_h@,$include_time_h,;t t s,@lib_multicharset@,$lib_multicharset,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t /@MCOMMON@/r $MCOMMON s,@MCOMMON@,,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi echo "Configuration: Rxvt version: $VERSION : $DATE Source code location: $srcdir Install path: ${prefix}/bin Compiler: $CC Compiler flags: $CFLAGS" if test "$MALLOC_TYPE" = S; then echo " malloc support: system default" fi if test "$MALLOC_TYPE" = G; then echo " malloc support: Gray Watson's dmalloc" fi if test "$MALLOC_TYPE" = D; then echo " malloc support: Doug Lea's malloc" fi if test x$support_xpm = xyes; then echo " Xpm library: $XPM_LIBS" fi echo " Adding modules:" if test x$OBJGRAPHICS != x; then HASIT="yes"; else HASIT="no"; fi echo " graphics.o: "$HASIT if test x$OBJGRKELOT != x; then HASIT="yes"; else HASIT="no"; fi echo " grkelot.o: "$HASIT if test x$OBJLOGGING != x; then HASIT="yes"; else HASIT="no"; fi echo " logging.o: "$HASIT if test x$OBJMENUBAR != x; then HASIT="yes"; else HASIT="no"; fi echo " menubar.o: "$HASIT if test x$support_scroll_rxvt = xyes; then HASIT="yes"; else HASIT="no"; fi echo " scrollbar-rxvt.o: "$HASIT if test x$support_scroll_next = xyes; then HASIT="yes"; else HASIT="no"; fi echo " scrollbar-next.o: "$HASIT if test x$support_scroll_xterm = xyes; then HASIT="yes"; else HASIT="no"; fi echo " scrollbar-xterm.o: "$HASIT if test x$OBJSTRINGS != x; then HASIT="yes"; else HASIT="no"; fi echo " strings.o: "$HASIT if test x$OBJXPM != x; then HASIT="yes"; else HASIT="no"; fi echo " xpm.o: "$HASIT echo " The following are set in config.h " echo " multichar glyph languages: "$multichar_set echo " pty/tty type: "$rxvt_cv_ptys if test x$support_utmp != xyes; then echo " utmp support: disabled " else echo " utmp support: enabled utmp file: $rxvt_cv_path_utmp utmpx file: $rxvt_cv_path_utmpx wtmp file: $rxvt_cv_path_wtmp wtmpx file: $rxvt_cv_path_wtmpx lastlog file: $rxvt_cv_path_lastlog ttys/ttytab file: $rxvt_cv_path_ttytab " fi if test x$term != x; then echo " set TERM to: $term " fi if test x$terminfo != x; then echo " set TERMINFO to: $terminfo " fi if test x$rxvt_cv_ptys = xUNKNOWN; then echo ".----------------------------------------------------------------." echo ". WARNING: could not determine pty/tty type. Do not build until ." echo ". the appropriate PTYS_ARE_* is defined in config.h ." echo ".----------------------------------------------------------------." fi if test x$support_xpm = xneedsmanualspecification; then echo ".----------------------------------------------------------------." echo ". WARNING: --enable-xpm-background was specified however the ." echo ". XPM includes files and libraries could not be found. ." echo ". XPM backgrounds are now being DISABLED! If you want ." echo ". to use them you should rerun configure with the ." echo ". appropriate --with-xpm-includes=/path/to/xpm/includes ." echo ". and --with-xpm-library=/path/to/xpm/library lines. ." echo ".----------------------------------------------------------------." fi if test x$support_xim = xyes -a x$rxvt_cv_func_xlocale = xno; then echo ".----------------------------------------------------------------." echo ". WARNING: --enable-xim was specified however the locale support ." echo ". functions could not be found. ." echo ". XIM is now being DISABLED! ." echo ".----------------------------------------------------------------." fi echo " *** Please check src/feature.h for further options *** " rxvt-2.7.10/README.configure010064400001440000024000000115010752434622400141050ustar gcwstaff--enable-everything add support for all enable options marked with an asterisk listed in "./configure --help". Note that unlike other enable options this is order dependant. You can specify this and then disable options which this enables by _following_ this with the appropriate commands. --enable-languages add support for languages which require multiple character glyphs to display. --with-encoding=NAME set the default encoding for multi-char glyph languages to NAME. Options are: "eucj" EUC Japanese encoding; "sjis" Shift JIS encoding; "big5" BIG5 encoding; "gb" GB encoding; "kr" EUC Korean encoding; "noenc" no encoding. This option requires --enable-languages to also be specified. --enable-utmp write user and tty to utmp file (used by programs like ``w'') at start of rxvt execution and delete information when rxvt exits. --enable-wtmp write user and tty to wtmp file (used by programs like ``last'') at start of rxvt execution and write logout when rxvt exits. This option requires --enable-utmp to also be specified. --enable-lastlog write user and tty to lastlog file (used by programs like ``lastlogin'') at start of rxvt execution. This option requires --enable-utmp to also be specified. --enable-xpm-background add support for XPM background pixmaps --enable-transparency add support for inheriting parent backgrounds thus giving a fake transparency to the term --enable-menubar add support for our menu bar system --enable-graphics add support for our graphics mode (see src/graphics) --enable-rxvt-scroll add support for the original rxvt scrollbar --enable-next-scroll add support for a NeXT-like scrollbar --enable-xterm-scroll add support for an Xterm-like scrollbar --enable-half-shadow make shadows on the scrollbar only half the normal width & height. only applicable to rxvt scrollbars --enable-xim add support for XIM (X Input Method) protocol. This allows using alternative input methods (e.g. kinput2) and will also correctly set up the input for people using dead keys. --enable-greek add support for greek keyboard --enable-ttygid change tty device setting to group "tty" - only use this if your system uses this type of security --disable-backspace-key disable any handling of the backspace key by us - let the X server do it --disable-delete-key disable any handling of the delete key by us - let the X server do it --disable-resources remove all resources checking --enable-xgetdefault make resources checking via XGetDefault() instead of our small version which only checks ~/.Xdefaults, or if that doesn't exist then ~/.Xresources --enable-strings add support for our possibly faster memset() function and other various routines, overriding your system's versions which may have been hand-crafted in assembly or may require extra libraries to link in. (This has header problems on some Linux systems). --disable-swapscreen remove support for swap screen --enable-frills add support for some lesser used features --enable-linespace add support to provide user specified line spacing between text rows --enable-keepscrolling add support for continual scrolling of the display when you hold the mouse button down on a scrollbar arrow --enable-mousewheel add support for scrolling via mouse wheel or buttons 4 & 5 -enable-slipwheeling add support for continual scrolling (using the mouse wheel as an accelerator) while the control key is held down. This option requires --enable-mousewheel to also be specified. --enable-old-selection remove support for reverting the mouse selection style to that of v2.20 (and prior) --disable-new-selection remove support for mouse selection style like that of xterm --enable-dmalloc use Gray Watson's malloc - which is good for debugging See http://www.letters.com/dmalloc/ for details If you use either this or the next option, you may need to edit src/Makefile after compiling to point DINCLUDE and DLIB to the right places. You can only use either this option and the following (should you use either) --enable-dlmalloc use Doug Lea's malloc - which is good for a production version See http://g.oswego.edu/dl/html/malloc.html for details --enable-smart-resize add smart growth/shrink behaviour when changing font size via from hot keys. This should keep in a fixed position the rxvt corner which is closest to a corner of the screen --enable-256-color added support for 256 colours rather than the base 16 colours --with-term=NAME change the environmental variable for the terminal to NAME (default "xterm") --with-terminfo=PATH change the environmental variable for the path to the terminfo tree to PATH --with-x use the X Window System (pretty much default, eh?) --with-xpm-includes=DIR look for the XPM includes in DIR --with-xpm-library=DIR look for the XPM library in DIR --with-xpm not needed - define via --enable-xpm-background rxvt-2.7.10/INSTALL010064400001440000024000000065330733440553500123070ustar gcwstaff-------------------------------------------------------------------------- Using GNU autoconfig -------------------------------------------------------------------------- 1. If you retrieved a CVS version of this package, you need the GNU autoconf package to generate the configure script. This is done by running ./.prebuild in this directory which will automatically run autoconf with the appropriate options. 2. Run ./configure to generate config.h and the various Makefiles. ./configure --help gives a list of possible options with slightly longer descriptions in README.configure Note that configure options have changed since 2.6.x series. 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 Or if you're using a non Bourne-compatible shell, you can do: sh -c 'CFLAGS="-O2 -g" ./configure If you are making different versions of rxvt you can configure them to be installed with different names using configure arguments, e.g. ./configure --enable-languages --program-transform-name='s,rxvt,kxvt,;' 3. set any other main preferences: Edit "src/feature.h" Edit "config.h" if you didn't use ./configure options If you're cross-compiling, edit the following in "config.h" NO_XLOCALE SIZEOF_* # sizeof some types 4. Build it (repeat step 2 as desired): make 5. build rclock (small xclock with biff & appointments) and optionally edit rclock/feature.h to add/remove features: make clock 6. Install both rxvt and rclock: make install or install them separately (cd src; make install) (cd rclock; make install) you may also want to install doc/etc/rxvt.terminfo and doc/etc/rxvt.termcap 7 a. If compiled with UTMP_SUPPORT, you may need to install rxvt setuid root or setuid/setgid to match the file permissions on /etc/utmp 7 b. You may need to install setuid root anyway for some systems so that they can give you ownership of the tty devices. 8. On systems which dislike doc/rxvt.1 (cd doc; rm rxvt.1; make rxvt.1) =================================== NB: If you were able to compile OK but running rxvt prints out "rxvt: could not obtain control of tty" running "make tests" from this directory (or from src/test) should give you a breakdown of the failure point which is useful to the developers in fixing the problem NB: SunOS (with/without gcc?) gets reported by configure as #undef STDC_HEADERS #define HAVE_SYS_IOCTL_H 1 but the ioctl() defines aren't protected against multiple inclusion, in this case by so use a hack in "feature.h" to avoid the problem. Gave up checking for `STDC_HEADERS', since they really should be there and I don't want to deal with the problems when they don't exist. SunOS users might complain to the right places and get their system headers fixed so that one day the rest of us won't have to keep compensating :( SVR4 users (that aren't using gcc) will have to add -DSVR4 to CPPFLAGS for configure. -- EOF rxvt-2.7.10/rxvt-2.7.10.lsm010064400001440000024000000031650764024424100135120ustar gcwstaffBegin3 Title: rxvt Version: 2.7.10 Entered-date: 26MAR03 Description: Rxvt is an 8-bit clean, colour xterm replacement that uses significantly less memory than a conventional xterm, mostly since it doesn't support toolkit configurability or Tek graphics, but also since features can be removed at compile-time to reflect your needs. Some rxvt features (compilation dependent): ANSI-color, bold/blink attributes modify foreground/background colours, scrollbars with arrow buttons, kanji and greek support, printer-pipe, XPM backgrounds with on-the-fly scaling, user-definable menus. The distribution also includes rclock, the smaller/better xclock replacement with appointment scheduling and xbiff functionality. Keywords: rxvt colour color kanji xterm X11 vt100 terminal-emulator rclock xbiff xpm menu Author: * John Bovey [Univ. Kent at Canterbury] was the creator of the original xvt. * Rob Nation [Lockheed] re-wrote most of xvt to make a substantiallly enhanced version called rxvt (Rob's xvt) and also wrote rclock (Rob's clock). * Mark Olesen [Queen's Univ. at Kingston] made various improvements and cleanups. Coordinated development, versions 2.11 - 2.21 * Oezguer Kesim [FU Berlin] Coordinated development, versions 2.21a - 2.4.5 * Geoff Wing rewrote much of the screen refreshing routines and mouse selection. Coordinated development, versions 2.4.6 - Maintained-by: Geoff Wing Project Coordinator Original-site: ftp.rxvt.org /pub/rxvt 582k rxvt-2.7.10.tar.gz Platforms: requires X11 installed Copying-policy: GPL End