xwininfo 1.0.3

This commit is contained in:
matthieu 2007-09-16 17:30:15 +00:00
parent 7387f85bf1
commit 9977061927
13 changed files with 947 additions and 638 deletions

View File

@ -1,46 +1,261 @@
2006-04-01 Adam Jackson <ajax@freedesktop.org>
commit b7e88cd9d28a3d3e467b769f3efe87f7c2f4c0a5
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Mon Aug 27 14:20:35 2007 -0700
* configure.ac:
Bump to 1.0.2.
Version bump: 1.0.3
2006-03-09 Alan Coopersmith <alan.coopersmith@sun.com>
commit 56f0b5dfb1486e262eb514fac44c73cea4bb4471
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Mon Aug 27 14:20:02 2007 -0700
* xwininfo.c:
Clear two tiny memory leaks. (Coverity ids #900 & 901)
Replace static ChangeLog with dist-hook to generate from git log
2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org>
commit c8d205c30547ca526404a0b257c3cc5d40970be6
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Tue Aug 7 15:50:13 2007 -0700
* configure.ac:
Update package version for X11R7 release.
Add static & const qualifiers to xwininfo.c
2005-12-14 Kevin E. Martin <kem-at-freedesktop-dot-org>
commit 77d50c0bf824f847bd9ede30c21618845258de76
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Tue Aug 7 15:38:23 2007 -0700
* configure.ac:
Update package version number for final X11R7 release candidate.
Replace sprintf's with snprintf & strlcat
2005-12-06 Kevin E. Martin <kem-at-freedesktop-dot-org>
commit 118bd50a9bbc10cab7846fb6ac1a0d25ba4c3422
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Mon Aug 6 19:52:13 2007 -0700
* Makefile.am:
Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
dsimple.c: ANSIfy function declarations
2005-12-03 Kevin E. Martin <kem-at-freedesktop-dot-org>
commit e093e4be56bb2be385a972962cf89f234e987ab4
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Mon Aug 6 19:44:24 2007 -0700
* configure.ac:
Update package version number for X11R7 RC3 release.
Purge unused code from dsimple.c
dsimple.c was originally shared source among several X apps.
Since modularization gave each app it's own copy, much of the code is
no longer needed in each app.
2005-11-20 Alan Coopersmith <alan.coopersmith@sun.com>
commit 59bbe12a40fdb3d39429d0d0ce809ad28116e7ed
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Mon Aug 6 19:18:57 2007 -0700
* configure.ac:
Change dependency from xmu to xmuu since the full xmu
(with all its baggage like Xt) is not needed here.
Rename xwininfo_CFLAGS to AM_CFLAGS to make automake-1.10 happier
Makefile.am:27: compiling `dsimple.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.ac'
2005-11-19 Kevin E. Martin <kem-at-freedesktop-dot-org>
commit 5a251886c0f158f4c8a342b6fbdeebf3dbd1c0fd
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Thu May 24 18:20:11 2007 -0700
* configure.ac:
Update dependencies to work with separate build roots.
Man page formatting: make -geometry bold like other options
2005-10-18 Kevin E. Martin <kem-at-freedesktop-dot-org>
commit 07459b14b36f15cfdfc6384019aaf020c7920cd4
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Thu May 24 18:17:28 2007 -0700
* configure.ac:
Update package version number for RC1 release.
renamed: .cvsignore -> .gitignore
commit 24fc2a569df9eaa776bcdddbb26bf4ea97b69d13
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Thu May 24 18:16:53 2007 -0700
X.Org bug #10616: Add all the X info commands to See Also in man page
X.Org Bugzilla #10616: <https://bugs.freedesktop.org/show_bug.cgi?id=10616>
Reported upstream from
Debian bug #350313 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=350313>
commit 412a3232373131634072df0d0b4843abf360def4
Author: Adam Jackson <ajax@nwnk.net>
Date: Sun Apr 2 01:19:53 2006 +0000
Bump to 1.0.2.
commit 8d62050702532be39688d468663466199492510b
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date: Fri Mar 10 02:37:18 2006 +0000
Clear two tiny memory leaks. (Coverity ids #900 & 901)
commit 609828be5a05bc71fffaf8fc129a0cae8082fd57
Author: Kevin E Martin <kem@kem.org>
Date: Wed Dec 21 02:29:55 2005 +0000
Update package version for X11R7 release.
commit a4169ffa7eb6eb9a28fd64a0686a813da975736c
Author: Adam Jackson <ajax@nwnk.net>
Date: Mon Dec 19 16:22:48 2005 +0000
Stub COPYING files
commit b9403df95678e568a326fe3f37bf29285a6a211e
Author: Kevin E Martin <kem@kem.org>
Date: Thu Dec 15 00:24:12 2005 +0000
Update package version number for final X11R7 release candidate.
commit 6f9523999cc4eb34accfe0bcc2c7a74bae9259ef
Author: Kevin E Martin <kem@kem.org>
Date: Tue Dec 6 22:48:27 2005 +0000
Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
commit 28c0455ea50bdf37f1d9d53c6756beebed429f0e
Author: Kevin E Martin <kem@kem.org>
Date: Sat Dec 3 05:49:29 2005 +0000
Update package version number for X11R7 RC3 release.
commit 988471c67e10a5ca309b90146b37a6037f5b2efc
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date: Mon Nov 28 22:01:48 2005 +0000
Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4
update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir)
commit 4496e95380b2f0ad7e9bdca02ec192dbb6d5e2e5
Author: Eric Anholt <anholt@freebsd.org>
Date: Mon Nov 21 10:35:09 2005 +0000
Another pass at .cvsignores for apps.
commit 296d8e6ab8a86e5653529d0497ca5751d89f23b5
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date: Mon Nov 21 03:14:17 2005 +0000
Change dependency from xmu to xmuu since the full xmu (with all its baggage
like Xt) is not needed here.
commit 27898506332f1a4e698cbd65aecc47fdbc6d0a7b
Author: Eric Anholt <anholt@freebsd.org>
Date: Sun Nov 20 22:08:56 2005 +0000
Add/improve .cvsignore files for apps.
commit ee7bf4989434ba5f30451c3f07e4a6e01e6532d4
Author: Kevin E Martin <kem@kem.org>
Date: Sat Nov 19 07:15:38 2005 +0000
Update pkgconfig files to separate library build-time dependencies from
application build-time dependencies, and update package deps to work
with separate build roots.
commit 4e58b0e12d46503c5f75ead9a859694aafd5b9b7
Author: Kevin E Martin <kem@kem.org>
Date: Wed Oct 19 02:47:58 2005 +0000
Update package version number for RC1 release.
commit fc097904a8d7ded9a60df35fd58b9f5b5e226e17
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date: Mon Oct 17 23:56:25 2005 +0000
Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
work better with BSD make
commit 22feb546d5bf499ec0bc726c60a6c46f2e2cbd1c
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date: Fri Oct 14 00:25:48 2005 +0000
Use sed to fill in variables in man page
commit 9b1a4cbaf609bb102adec047934ad4c1b05f01ab
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date: Mon Aug 1 20:25:33 2005 +0000
Install man pages to section 1 instead of section m (Patch from Donnie
Berkholz)
commit 70ed22f5e63d5759a0b7c6574a92d124c0777562
Author: Kevin E Martin <kem@kem.org>
Date: Fri Jul 29 21:22:39 2005 +0000
Various changes preparing packages for RC0:
- Verify and update package version numbers as needed
- Implement versioning scheme
- Change bug address to point to bugzilla bug entry form
- Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to
reenable it)
- Fix makedepend to use pkgconfig and pass distcheck
- Update build script to build macros first
- Update modular Xorg version
commit 270145dc0f3ad5c7ad7d6086da19c0a25ea853a9
Author: Adam Jackson <ajax@nwnk.net>
Date: Wed Jul 20 19:32:05 2005 +0000
Use a unique token for PKG_CHECK_MODULES. Otherwise, if you use a global
configure cache, you cache it, and the cached value is probably wrong.
commit 97aa768841e147fde3cf16ba9a4c852358085d27
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Fri Jul 8 21:00:46 2005 +0000
Build system for xwininfo
commit 5cd08344c43c739c9a6837f1a60ae7c42e5afabe
Author: Roland Mainz <roland.mainz@nrubsig.org>
Date: Wed Oct 6 19:29:59 2004 +0000
Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=1518 - Add filter
support to "xlsfonts" that it can filter builtin-, glyph- and/or other
kinds of printer fonts (controlled by the xp-listfonts-modes attribute
as described in the CDE DtPrint and Xprint specifications).
commit ac7cc196b722ee4653326aee459f40ad16a260c1
Author: Egbert Eich <eich@suse.de>
Date: Fri Apr 23 19:55:09 2004 +0000
Merging XORG-CURRENT into trunk
commit 43e099d499d4dbabb32ca0410175e0e1b814cd94
Author: Egbert Eich <eich@suse.de>
Date: Sun Mar 14 08:35:54 2004 +0000
Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
commit cd710399eb415673c180f65080d685ee8d149361
Author: Egbert Eich <eich@suse.de>
Date: Wed Mar 3 12:13:20 2004 +0000
Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
commit 436a7ecb4b764394abcdd06fd99d6232c633cad1
Author: Egbert Eich <eich@suse.de>
Date: Thu Feb 26 13:36:32 2004 +0000
readding XFree86's cvs IDs
commit 6dfbd3f819f10e4d04653df2074526860007968e
Author: Egbert Eich <eich@suse.de>
Date: Thu Feb 26 09:24:18 2004 +0000
Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
commit a2fa980ce0e98c2bbc503d1d9fe51ab539b7ea46
Author: Egbert Eich <eich@suse.de>
Date: Thu Jan 29 08:09:21 2004 +0000
Importing vendor version xf86-012804-2330 on Thu Jan 29 00:06:33 PST 2004
commit 429530ba6f7699436d6f789a17550ec1a691c675
Author: Kaleb Keithley <kaleb@freedesktop.org>
Date: Tue Nov 25 19:29:23 2003 +0000
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
commit be0f398fee08e03ab73ec0d580df688cc989fbaa
Author: Kaleb Keithley <kaleb@freedesktop.org>
Date: Fri Nov 14 16:49:24 2003 +0000
XFree86 4.3.0.1
commit 5e5a590668dc3ebe7e2cb568aad4c9c14021f2a2
Author: Kaleb Keithley <kaleb@freedesktop.org>
Date: Fri Nov 14 15:54:55 2003 +0000
R6.6 is the Xorg base-line

View File

@ -21,7 +21,7 @@
bin_PROGRAMS = xwininfo
xwininfo_CFLAGS = $(XWININFO_CFLAGS)
AM_CFLAGS = $(XWININFO_CFLAGS)
xwininfo_LDADD = $(XWININFO_LIBS)
xwininfo_SOURCES = \
@ -37,8 +37,16 @@ appmandir = $(APP_MAN_DIR)
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
EXTRA_DIST = $(appman_PRE)
EXTRA_DIST = $(appman_PRE) ChangeLog autogen.sh
CLEANFILES = $(appman_DATA)
MAINTAINERCLEANFILES = ChangeLog
.PHONY: ChangeLog
ChangeLog:
(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
dist-hook: ChangeLog
SED = sed

13
app/xwininfo/autogen.sh Normal file
View File

@ -0,0 +1,13 @@
#! /bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
$srcdir/configure --enable-maintainer-mode "$@"

View File

@ -1,9 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
timestamp='2005-07-08'
timestamp='2007-07-22'
# 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
@ -106,7 +107,7 @@ set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@ -160,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
@ -206,8 +208,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
@ -325,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:SunOS:5.*:*)
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
@ -764,12 +769,19 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
case ${UNAME_MACHINE} in
pc98)
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
i*:MINGW*:*)
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
@ -779,9 +791,15 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
x86:Interix*:[34]*)
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
exit ;;
*:Interix*:[3456]*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
@ -794,7 +812,7 @@ EOF
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:*)
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
@ -817,6 +835,9 @@ EOF
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit ;;
@ -851,7 +872,11 @@ EOF
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
@ -870,9 +895,16 @@ EOF
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
@ -916,9 +948,15 @@ EOF
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
xtensa:Linux:*:*)
echo xtensa-unknown-linux-gnu
exit ;;
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
@ -961,7 +999,7 @@ EOF
LIBC=gnulibc1
# endif
#else
#ifdef __INTEL_COMPILER
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
LIBC=gnu
#else
LIBC=gnuaout
@ -971,7 +1009,11 @@ EOF
LIBC=dietlibc
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^LIBC/{
s: ::g
p
}'`"
test x"${LIBC}" != x && {
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit
@ -1173,6 +1215,15 @@ EOF
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
@ -1182,7 +1233,6 @@ EOF
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
*86) UNAME_PROCESSOR=i686 ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@ -1261,6 +1311,9 @@ EOF
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2

View File

@ -1,9 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
timestamp='2005-07-08'
timestamp='2007-06-28'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@ -119,8 +120,9 @@ esac
# 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* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@ -171,6 +173,10 @@ case $os in
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@ -187,6 +193,10 @@ case $os in
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# 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/'`
@ -231,15 +241,16 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@ -257,28 +268,27 @@ case $basic_machine in
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| ms1 \
| mt \
| msp430 \
| nios | nios2 \
| ns16k | ns32k \
| or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| score \
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b \
| strongarm \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
m32c)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
@ -286,6 +296,9 @@ case $basic_machine in
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
@ -305,18 +318,18 @@ case $basic_machine in
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \
| avr-* | avr32-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| m32r-* | m32rle-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
@ -336,31 +349,30 @@ case $basic_machine in
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| ms1-* \
| mt-* \
| msp430-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa-* \
| ymp-* \
| z8k-*)
;;
m32c-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
@ -463,8 +475,8 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
cr16c)
basic_machine=cr16c-unknown
cr16)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
@ -671,6 +683,10 @@ case $basic_machine in
basic_machine=i386-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
@ -696,6 +712,9 @@ case $basic_machine in
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
mvs)
basic_machine=i370-ibm
os=-mvs
@ -803,6 +822,12 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
@ -859,6 +884,10 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
rdos)
basic_machine=i386-pc
os=-rdos
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@ -885,6 +914,10 @@ case $basic_machine in
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
@ -896,6 +929,9 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
@ -1101,7 +1137,7 @@ case $basic_machine in
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b)
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
@ -1174,21 +1210,23 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -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* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -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* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku*)
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@ -1340,6 +1378,12 @@ else
# system, and we'll never get to this point.
case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
@ -1349,9 +1393,9 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
c4x-* | tic4x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
@ -1377,6 +1421,9 @@ case $basic_machine in
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;

View File

@ -22,7 +22,7 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ([2.57])
AC_INIT(xwininfo,[1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xwininfo)
AC_INIT(xwininfo,[1.0.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xwininfo)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
@ -31,6 +31,8 @@ AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_INSTALL
AC_CHECK_FUNCS([strlcat])
# Checks for pkg-config packages
PKG_CHECK_MODULES(XWININFO, xmuu xext x11)
AC_SUBST(XWININFO_CFLAGS)

View File

@ -1,9 +1,10 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-07-09.11
scriptversion=2006-10-15.18
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -91,7 +92,20 @@ gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
@ -276,6 +290,46 @@ icc)
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
@ -288,13 +342,13 @@ tru64)
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mecanism is used in libtool 1.4 series to
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in in $dir.libs/$base.o.d and
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is

View File

@ -41,13 +41,10 @@ from The Open Group.
* Written by Mark Lillibridge. Last updated 7/1/87
*/
#ifdef BUILD_PRINTSUPPORT
#include <X11/XprintUtil/xprintutil.h>
#endif /* BUILD_PRINTSUPPORT */
#include "dsimple.h"
/*
* Just_display: A group of routines designed to make the writting of simple
* Just_display: A group of routines designed to make the writing of simple
* X11 applications which open a display but do not open
* any windows much faster and easier. Unless a routine says
* otherwise, it may be assumed to require program_name, dpy,
@ -61,54 +58,15 @@ from The Open Group.
char *program_name = "unknown_program";
Display *dpy = NULL;
int screen = 0;
Bool printer_output = False; /* Video or printer output ? */
#ifdef BUILD_PRINTSUPPORT
XPContext pcontext = None;
#endif /* BUILD_PRINTSUPPORT */
static void _bitmap_error(int, char *);
/*
* Malloc: like malloc but handles out of memory using Fatal_Error.
*/
char *Malloc(size)
unsigned size;
{
char *data;
if (!(data = malloc(size)))
Fatal_Error("Out of memory!");
return(data);
}
/*
* Realloc: like Malloc except for realloc, handles NULL using Malloc.
*/
char *Realloc(ptr, size)
char *ptr;
int size;
{
char *new_ptr;
if (!ptr)
return(Malloc(size));
if (!(new_ptr = realloc(ptr, size)))
Fatal_Error("Out of memory!");
return(new_ptr);
}
/*
* Get_Display_Name (argc, argv) Look for -display, -d, or host:dpy (obselete)
* If found, remove it from command line. Don't go past a lone -.
*/
char *Get_Display_Name(pargc, argv)
int *pargc; /* MODIFIED */
char **argv; /* MODIFIED */
char *Get_Display_Name(
int *pargc, /* MODIFIED */
char **argv) /* MODIFIED */
{
int argc = *pargc;
char **pargv = argv+1;
@ -138,49 +96,12 @@ char *Get_Display_Name(pargc, argv)
}
#ifdef BUILD_PRINTSUPPORT
/*
* Get_Printer_Name (argc, argv) Look for -printer, -p,
* If found, remove it from command line. Don't go past a lone -.
*/
char *Get_Printer_Name(pargc, argv)
int *pargc; /* MODIFIED */
char **argv; /* MODIFIED */
{
int argc = *pargc;
char **pargv = argv+1;
char *printername = NULL;
int i;
for (i = 1; i < argc; i++) {
char *arg = argv[i];
if (!strcmp (arg, "-printer") || !strcmp (arg, "-p")) {
if (++i >= argc) usage ();
printername = argv[i];
*pargc -= 2;
continue;
}
if (!strcmp(arg,"-")) {
while (i<argc)
*pargv++ = argv[i++];
break;
}
*pargv++ = arg;
}
*pargv = NULL;
return (printername);
}
#endif /* BUILD_PRINTSUPPORT */
/*
* Open_Display: Routine to open a display with correct error handling.
* Does not require dpy or screen defined on entry.
*/
Display *Open_Display(display_name)
char *display_name;
Display *Open_Display(char *display_name)
{
Display *d;
@ -203,41 +124,15 @@ char *display_name;
* for this display is then stored in screen.
* Does not require dpy or screen defined.
*/
void Setup_Display_And_Screen(argc, argv)
int *argc; /* MODIFIED */
char **argv; /* MODIFIED */
void Setup_Display_And_Screen(
int *argc, /* MODIFIED */
char **argv) /* MODIFIED */
{
char *displayname = NULL,
*printername = NULL;
char *displayname = NULL;
displayname = Get_Display_Name(argc, argv);
#ifdef BUILD_PRINTSUPPORT
printername = Get_Printer_Name(argc, argv);
if (displayname && printername) {
fprintf (stderr, "%s: you cannot specify -printer (-p) and -display (-d) at the same time.\n",
program_name);
usage ();
}
if (printername) {
printer_output = True;
if (XpuGetPrinter(printername, &dpy, &pcontext) != 1) {
fprintf(stderr, "%s: Cannot open printer '%s'.\n", program_name, printername);
exit(EXIT_FAILURE);
}
screen = XScreenNumberOfScreen(XpGetScreenOfContext(dpy, pcontext));
}
else
#endif /* BUILD_PRINTSUPPORT */
{
printer_output = False;
dpy = Open_Display (displayname);
screen = XDefaultScreen(dpy);
}
dpy = Open_Display (displayname);
screen = XDefaultScreen(dpy);
}
/*
@ -248,95 +143,8 @@ void Close_Display(void)
if (dpy == NULL)
return;
#ifdef BUILD_PRINTSUPPORT
if (printer_output) {
XpuClosePrinterDisplay(dpy, pcontext);
dpy = NULL;
pcontext = None;
printer_output = False;
}
else
#endif /* BUILD_PRINTSUPPORT */
{
XCloseDisplay(dpy);
dpy = NULL;
}
}
/*
* Open_Font: This routine opens a font with error handling.
*/
XFontStruct *Open_Font(name)
char *name;
{
XFontStruct *font;
if (!(font=XLoadQueryFont(dpy, name)))
Fatal_Error("Unable to open font %s!", name);
return(font);
}
/*
* Beep: Routine to beep the display.
*/
void Beep()
{
XBell(dpy, 50);
}
/*
* ReadBitmapFile: same as XReadBitmapFile except it returns the bitmap
* directly and handles errors using Fatal_Error.
*/
static void _bitmap_error(status, filename)
int status;
char *filename;
{
if (status == BitmapOpenFailed)
Fatal_Error("Can't open file %s!", filename);
else if (status == BitmapFileInvalid)
Fatal_Error("file %s: Bad bitmap format.", filename);
else
Fatal_Error("Out of memory!");
}
Pixmap ReadBitmapFile(d, filename, width, height, x_hot, y_hot)
Drawable d;
char *filename;
int *width, *height, *x_hot, *y_hot;
{
Pixmap bitmap;
int status;
status = XReadBitmapFile(dpy, RootWindow(dpy, screen), filename,
(unsigned int *)width, (unsigned int *)height,
&bitmap, x_hot, y_hot);
if (status != BitmapSuccess)
_bitmap_error(status, filename);
return(bitmap);
}
/*
* WriteBitmapFile: same as XWriteBitmapFile except it handles errors
* using Fatal_Error.
*/
void WriteBitmapFile(filename, bitmap, width, height, x_hot, y_hot)
char *filename;
Pixmap bitmap;
int width, height, x_hot, y_hot;
{
int status;
status= XWriteBitmapFile(dpy, filename, bitmap, width, height, x_hot,
y_hot);
if (status != BitmapSuccess)
_bitmap_error(status, filename);
XCloseDisplay(dpy);
dpy = NULL;
}
@ -362,9 +170,9 @@ void WriteBitmapFile(filename, bitmap, width, height, x_hot, y_hot)
* all command line arguments, and other setup is done.
* For examples of usage, see xwininfo, xwd, or xprop.
*/
Window Select_Window_Args(rargc, argv)
int *rargc;
char **argv;
Window Select_Window_Args(
int *rargc,
char **argv)
#define ARGC (*rargc)
{
int nargc=1;
@ -420,91 +228,12 @@ Window Select_Window_Args(rargc, argv)
* Written by Mark Lillibridge. Last updated 7/1/87
*/
/*
* Resolve_Color: This routine takes a color name and returns the pixel #
* that when used in the window w will be of color name.
* (WARNING: The colormap of w MAY be modified! )
* If colors are run out of, only the first n colors will be
* as correct as the hardware can make them where n depends
* on the display. This routine does not require wind to
* be defined.
*/
unsigned long Resolve_Color(w, name)
Window w;
char *name;
{
XColor c;
Colormap colormap;
XWindowAttributes wind_info;
/*
* The following is a hack to insure machines without a rgb table
* handle at least white & black right.
*/
if (!strcmp(name, "white"))
name="#ffffffffffff";
if (!strcmp(name, "black"))
name="#000000000000";
XGetWindowAttributes(dpy, w, &wind_info);
colormap = wind_info.colormap;
if (!XParseColor(dpy, colormap, name, &c))
Fatal_Error("Bad color format '%s'.", name);
if (!XAllocColor(dpy, colormap, &c))
Fatal_Error("XAllocColor failed!");
return(c.pixel);
}
/*
* Bitmap_To_Pixmap: Convert a bitmap to a 2 colored pixmap. The colors come
* from the foreground and background colors of the gc.
* Width and height are required solely for efficiency.
* If needed, they can be obtained via. XGetGeometry.
*/
Pixmap Bitmap_To_Pixmap(dpy, d, gc, bitmap, width, height)
Display *dpy;
Drawable d;
GC gc;
Pixmap bitmap;
int width, height;
{
Pixmap pix;
int x;
unsigned int i, depth;
Drawable root;
if (!XGetGeometry(dpy, d, &root, &x, &x, &i, &i, &i, &depth))
return(0);
pix = XCreatePixmap(dpy, d, width, height, (int)depth);
XCopyPlane(dpy, bitmap, pix, gc, 0, 0, width, height, 0, 0, 1);
return(pix);
}
/*
* blip: a debugging routine. Prints Blip! on stderr with flushing.
*/
void blip()
{
fflush(stdout);
fprintf(stderr, "blip!\n");
fflush(stderr);
}
/*
* Routine to let user select a window using the mouse
*/
Window Select_Window(dpy)
Display *dpy;
Window Select_Window(Display *dpy)
{
int status;
Cursor cursor;
@ -554,10 +283,10 @@ Window Select_Window(dpy)
* one found will be returned. Only top and its subwindows
* are looked at. Normally, top should be the RootWindow.
*/
Window Window_With_Name(dpy, top, name)
Display *dpy;
Window top;
char *name;
Window Window_With_Name(
Display *dpy,
Window top,
char *name)
{
Window *children, dummy;
unsigned int nchildren;
@ -580,27 +309,9 @@ Window Window_With_Name(dpy, top, name)
return(w);
}
/*
* outl: a debugging routine. Flushes stdout then prints a message on stderr
* and flushes stderr. Used to print messages when past certain points
* in code so we can tell where we are. Outl may be invoked like
* printf with up to 7 arguments.
*/
void
outl(char *msg, ...)
{
va_list args;
fflush(stdout);
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
fprintf(stderr, "\n");
fflush(stderr);
}
/*
* Standard fatal error routine - call like printf but maximum of 7 arguments.
* Standard fatal error routine - call like printf
* Does not require dpy or screen defined.
*/
void Fatal_Error(char *msg, ...)

View File

@ -47,34 +47,21 @@ from The Open Group.
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif /* MIN */
/* Global variables used by routines in just_display.c */
/* Global variables used by routines in dsimple.c */
extern char *program_name; /* Name of this program */
extern Display *dpy; /* The current display */
extern int screen; /* The current screen */
extern Bool printer_output; /* Video or printer output ? */
#ifdef BUILD_PRINTSUPPORT
extern XPContext pcontext; /* The current print context */
#endif /* BUILD_PRINTSUPPORT */
#define INIT_NAME program_name=argv[0] /* use this in main to setup
program_name */
/* Declaritions for functions in just_display.c */
/* Declaritions for functions in dsimple.c */
char *Malloc(unsigned);
char *Realloc(char *, int);
char *Get_Display_Name(int *, char **);
#ifdef BUILD_PRINTSUPPORT
char *Get_Printer_Name(int *, char **);
#endif /* BUILD_PRINTSUPPORT */
Display *Open_Display(char *);
void Setup_Display_And_Screen(int *, char **);
void Close_Display(void);
XFontStruct *Open_Font(char *);
void Beep(void);
Pixmap ReadBitmapFile(Drawable, char *, int *, int *, int *, int *);
void WriteBitmapFile(char *, Pixmap, int, int, int, int);
Window Select_Window_Args(int *, char **);
void usage(void);
@ -89,14 +76,10 @@ void usage(void);
* Send bugs, etc. to chariot@athena.mit.edu.
*/
unsigned long Resolve_Color(Window, char *);
Pixmap Bitmap_To_Pixmap(Display *, Drawable, GC, Pixmap, int, int);
Window Select_Window(Display *);
void blip(void);
Window Window_With_Name(Display *, Window, char *);
#ifdef __GNUC__
void Fatal_Error(char *, ...) __attribute__((__noreturn__));
#else
void Fatal_Error(char *, ...);
#endif
void outl(char *, ...);

View File

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-05-14.22
scriptversion=2006-10-14.15
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -39,15 +39,24 @@ scriptversion=2005-05-14.22
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# put in absolute paths if you don't have them in your path; or use env. vars.
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
@ -58,7 +67,13 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chmodcmd="$chmodprog 0755"
posix_glob=
posix_mkdir=
# Desired mode of installed file.
mode=0755
chmodcmd=$chmodprog
chowncmd=
chgrpcmd=
stripcmd=
@ -95,7 +110,7 @@ Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test -n "$1"; do
while test $# -ne 0; do
case $1 in
-c) shift
continue;;
@ -111,9 +126,15 @@ while test -n "$1"; do
--help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2"
-m) mode=$2
shift
shift
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
continue;;
-o) chowncmd="$chownprog $2"
@ -136,25 +157,33 @@ while test -n "$1"; do
--version) echo "$0 $scriptversion"; exit $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
done
if test -z "$1"; then
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
@ -164,6 +193,33 @@ if test -z "$1"; then
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
@ -173,15 +229,11 @@ do
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
@ -208,53 +260,188 @@ do
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
obsolete_mkdir_used=false
# Make sure that the destination directory exists.
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
shift
IFS=$oIFS
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
pathcomp=
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix=/ ;;
-*) prefix=./ ;;
*) prefix= ;;
esac
case $posix_glob in
'')
if (set -f) 2>/dev/null; then
posix_glob=true
else
posix_glob=false
fi ;;
esac
oIFS=$IFS
IFS=/
$posix_glob && set -f
set fnord $dstdir
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
$posix_glob && set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
pathcomp=$pathcomp/
done
fi
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
@ -262,10 +449,9 @@ do
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@ -276,10 +462,10 @@ do
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
@ -291,11 +477,12 @@ do
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
if test -f "$dst"; then
$doit $rmcmd -f "$dst" 2>/dev/null \
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
else
@ -304,16 +491,13 @@ do
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
$doit $mvcmd "$dsttmp" "$dst"
}
}
fi || { (exit 1); exit 1; }
done
} || exit 1
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit 0
}
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)

View File

@ -1,9 +1,9 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2005-06-08.21
scriptversion=2006-05-10.23
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
@ -33,6 +33,8 @@ if test $# -eq 0; then
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
@ -44,7 +46,7 @@ fi
msg="missing on your system"
case "$1" in
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
@ -77,6 +79,7 @@ Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
@ -106,7 +109,7 @@ esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
case $1 in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
@ -135,7 +138,7 @@ esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
case $1 in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
@ -164,7 +167,7 @@ WARNING: \`$1' is $msg. You should only need it if
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@ -192,8 +195,8 @@ WARNING: \`$1' is needed, but is $msg.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
@ -214,25 +217,25 @@ WARNING: \`$1' $msg. You should only need it if
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
if test $# -ne 1; then
eval LASTARG="\${$#}"
case "$LASTARG" in
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
@ -244,18 +247,18 @@ WARNING: \`$1' is $msg. You should only need it if
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
if test $# -ne 1; then
eval LASTARG="\${$#}"
case "$LASTARG" in
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
@ -267,11 +270,9 @@ WARNING: \`$1' is $msg. You should only need it if
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
@ -289,11 +290,17 @@ WARNING: \`$1' is $msg. You should only need it if
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
@ -317,13 +324,13 @@ WARNING: \`$1' is $msg. You should only need it if
fi
firstarg="$1"
if shift; then
case "$firstarg" in
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0

View File

@ -1,4 +1,4 @@
/* $XdotOrg: app/xwininfo/xwininfo.c,v 1.3 2006/03/10 02:37:18 alanc Exp $ */
/* $XdotOrg: $ */
/* $Xorg: xwininfo.c,v 1.4 2001/02/09 02:06:04 xorgcvs Exp $ */
/*
@ -45,6 +45,7 @@ of the copyright holder.
* 16-Jun-87
*/
#include "config.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
@ -62,32 +63,49 @@ of the copyright holder.
typedef struct {
long code;
char *name;
const char *name;
} binding;
void scale_init(void);
char *nscale(int, int, int, char *);
char *xscale(int);
char *yscale(int);
char *bscale(int);
int bad_window_handler(Display *, XErrorEvent *);
static void scale_init(void);
static char *nscale(int, int, int, char *, size_t);
static char *xscale(int);
static char *yscale(int);
static char *bscale(int);
static int bad_window_handler(Display *, XErrorEvent *);
int main(int, char **);
char *LookupL(long, binding *);
char *Lookup(int, binding *);
void Display_Window_Id(Window, int);
void Display_Stats_Info(Window);
void Display_Bits_Info(Window);
void Display_Event_Mask(long);
void Display_Events_Info(Window);
void Display_Tree_Info(Window, int);
void display_tree_info_1(Window, int, int);
void Display_Hints(XSizeHints *);
void Display_Size_Hints(Window);
void Display_Window_Shape(Window);
void Display_WM_Info(Window);
static const char *LookupL(long, const binding *);
static const char *Lookup(int, const binding *);
static void Display_Window_Id(Window, int);
static void Display_Stats_Info(Window);
static void Display_Bits_Info(Window);
static void Display_Event_Mask(long);
static void Display_Events_Info(Window);
static void Display_Tree_Info(Window, int);
static void display_tree_info_1(Window, int, int);
static void Display_Hints(XSizeHints *);
static void Display_Size_Hints(Window);
static void Display_Window_Shape(Window);
static void Display_WM_Info(Window);
static char *window_id_format = "0x%lx";
#ifndef HAVE_STRLCAT
static size_t strlcat(char *dst, const char *src, size_t dstsize)
{
size_t sd = strlen(dst);
size_t ss = strlen(src);
size_t s = sd + ss;
if (s < dstsize) {
strcpy(dst + sd, src);
} else {
strncpy(dst + sd, src, dstsize-sd-1);
dst[dstsize] = '\0';
}
return s;
}
#endif
/*
* Report the syntax for calling xwininfo:
*/
@ -151,12 +169,12 @@ usage(void)
*/
#define getdsp(var,fn) var = fn(dpy, DefaultScreen(dpy))
int xp=0, xmm=0;
int yp=0, ymm=0;
int bp=0, bmm=0;
int english = 0, metric = 0;
static int xp=0, xmm=0;
static int yp=0, ymm=0;
static int bp=0, bmm=0;
static int english = 0, metric = 0;
void
static void
scale_init(void)
{
getdsp(yp, DisplayHeight);
@ -171,87 +189,95 @@ scale_init(void)
#define YARD (3*12)
#define FOOT (12)
char *
nscale(int n, int np, int nmm, char *nbuf)
static char *
nscale(int n, int np, int nmm, char *nbuf, size_t nbufsize)
{
sprintf(nbuf, "%d", n);
if(metric||english) {
sprintf(nbuf+strlen(nbuf), " (");
}
if(metric) {
sprintf(nbuf+strlen(nbuf),"%.2f mm%s", ((double) n)*nmm/np, english?"; ":"");
}
if(english) {
double inch_frac;
Bool printed_anything = False;
int mi, yar, ft, inr;
int s;
snprintf(nbuf, nbufsize, "%d", n);
if (metric||english) {
s = strlcat(nbuf, " (", nbufsize);
inch_frac = ((double) n)*(nmm/25.4)/np;
inr = (int)inch_frac;
inch_frac -= (double)inr;
if(inr>=MILE) {
mi = inr/MILE;
inr %= MILE;
sprintf(nbuf+strlen(nbuf), "%d %s(?!?)",
mi, (mi==1)?"mile":"miles");
printed_anything = True;
if (metric) {
snprintf(nbuf+s, nbufsize-s, "%.2f mm%s",
((double) n)*nmm/np, english ? "; " : "");
}
if (english) {
double inch_frac;
Bool printed_anything = False;
int mi, yar, ft, inr;
inch_frac = ((double) n)*(nmm/25.4)/np;
inr = (int)inch_frac;
inch_frac -= (double)inr;
if (inr >= MILE) {
mi = inr/MILE;
inr %= MILE;
s = strlen(nbuf);
snprintf(nbuf+s, nbufsize-s, "%d %s(?!?)",
mi, (mi==1) ? "mile" : "miles");
printed_anything = True;
}
if (inr >= YARD) {
yar = inr/YARD;
inr %= YARD;
if (printed_anything)
strlcat(nbuf, ", ", nbufsize);
s = strlen(nbuf);
snprintf(nbuf+s, nbufsize-s, "%d %s",
yar, (yar==1) ? "yard" : "yards");
printed_anything = True;
}
if (inr >= FOOT) {
ft = inr/FOOT;
inr %= FOOT;
if (printed_anything)
strlcat(nbuf, ", ", nbufsize);
s = strlen(nbuf);
snprintf(nbuf+s, nbufsize-s, "%d %s",
ft, (ft==1) ? "foot" : "feet");
printed_anything = True;
}
if (!printed_anything || inch_frac != 0.0 || inr != 0) {
if (printed_anything)
strlcat(nbuf, ", ", nbufsize);
s = strlen(nbuf);
snprintf(nbuf+s, nbufsize-s, "%.2f inches", inr+inch_frac);
}
}
strlcat (nbuf, ")", nbufsize);
}
if(inr>=YARD) {
yar = inr/YARD;
inr %= YARD;
if (printed_anything)
sprintf(nbuf+strlen(nbuf), ", ");
sprintf(nbuf+strlen(nbuf), "%d %s",
yar, (yar==1)?"yard":"yards");
printed_anything = True;
}
if(inr>=FOOT) {
ft = inr/FOOT;
inr %= FOOT;
if (printed_anything)
sprintf(nbuf+strlen(nbuf), ", ");
sprintf(nbuf+strlen(nbuf), "%d %s",
ft, (ft==1)?"foot":"feet");
printed_anything = True;
}
if (!printed_anything || inch_frac != 0.0 || inr != 0) {
if (printed_anything)
sprintf(nbuf+strlen(nbuf), ", ");
sprintf(nbuf+strlen(nbuf), "%.2f inches", inr+inch_frac);
}
}
if (english || metric) strcat (nbuf, ")");
return(nbuf);
return(nbuf);
}
char xbuf[BUFSIZ];
char *
static char xbuf[BUFSIZ];
static char *
xscale(int x)
{
if(!xp) {
scale_init();
}
return(nscale(x, xp, xmm, xbuf));
return(nscale(x, xp, xmm, xbuf, sizeof(xbuf)));
}
char ybuf[BUFSIZ];
char *
static char ybuf[BUFSIZ];
static char *
yscale(int y)
{
if(!yp) {
scale_init();
}
return(nscale(y, yp, ymm, ybuf));
return(nscale(y, yp, ymm, ybuf, sizeof(ybuf)));
}
char bbuf[BUFSIZ];
char *
static char bbuf[BUFSIZ];
static char *
bscale(int b)
{
if(!bp) {
scale_init();
}
return(nscale(b, bp, bmm, bbuf));
return(nscale(b, bp, bmm, bbuf, sizeof(bbuf)));
}
/* end of pixel to inch, metric converter */
@ -260,12 +286,12 @@ bscale(int b)
to see if the -id the user specified is valid. */
/* ARGSUSED */
int
static int
bad_window_handler(Display *disp, XErrorEvent *err)
{
char badid[20];
sprintf(badid, window_id_format, err->resourceid);
snprintf(badid, sizeof(badid), window_id_format, err->resourceid);
Fatal_Error("No such window with id %s.", badid);
exit (1);
return 0;
@ -422,12 +448,13 @@ main(int argc, char **argv)
*/
static char _lookup_buffer[100];
char *
LookupL(long code, binding *table)
static const char *
LookupL(long code, const binding *table)
{
char *name;
const char *name;
sprintf(_lookup_buffer, "unknown (code = %ld. = 0x%lx)", code, code);
snprintf(_lookup_buffer, sizeof(_lookup_buffer),
"unknown (code = %ld. = 0x%lx)", code, code);
name = _lookup_buffer;
while (table->name) {
@ -441,8 +468,8 @@ LookupL(long code, binding *table)
return(name);
}
char *
Lookup(int code, binding *table)
static const char *
Lookup(int code, const binding *table)
{
return LookupL((long)code, table);
}
@ -451,7 +478,7 @@ Lookup(int code, binding *table)
* Routine to display a window id in dec/hex with name if window has one
*/
void
static void
Display_Window_Id(Window window, Bool newline_wanted)
{
#ifdef NO_I18N
@ -509,24 +536,24 @@ Display_Window_Id(Window window, Bool newline_wanted)
/*
* Display Stats on window
*/
static binding _window_classes[] = {
static const binding _window_classes[] = {
{ InputOutput, "InputOutput" },
{ InputOnly, "InputOnly" },
{ 0, 0 } };
static binding _map_states[] = {
static const binding _map_states[] = {
{ IsUnmapped, "IsUnMapped" },
{ IsUnviewable, "IsUnviewable" },
{ IsViewable, "IsViewable" },
{ 0, 0 } };
static binding _backing_store_states[] = {
static const binding _backing_store_states[] = {
{ NotUseful, "NotUseful" },
{ WhenMapped, "WhenMapped" },
{ Always, "Always" },
{ 0, 0 } };
static binding _bit_gravity_states[] = {
static const binding _bit_gravity_states[] = {
{ ForgetGravity, "ForgetGravity" },
{ NorthWestGravity, "NorthWestGravity" },
{ NorthGravity, "NorthGravity" },
@ -540,7 +567,7 @@ static binding _bit_gravity_states[] = {
{ StaticGravity, "StaticGravity" },
{ 0, 0 }};
static binding _window_gravity_states[] = {
static const binding _window_gravity_states[] = {
{ UnmapGravity, "UnmapGravity" },
{ NorthWestGravity, "NorthWestGravity" },
{ NorthGravity, "NorthGravity" },
@ -554,7 +581,7 @@ static binding _window_gravity_states[] = {
{ StaticGravity, "StaticGravity" },
{ 0, 0 }};
static binding _visual_classes[] = {
static const binding _visual_classes[] = {
{ StaticGray, "StaticGray" },
{ GrayScale, "GrayScale" },
{ StaticColor, "StaticColor" },
@ -563,7 +590,7 @@ static binding _visual_classes[] = {
{ DirectColor, "DirectColor" },
{ 0, 0 }};
void
static void
Display_Stats_Info(Window window)
{
XWindowAttributes win_attributes;
@ -730,7 +757,7 @@ Display_Stats_Info(Window window)
/*
* Display bits info:
*/
static binding _gravities[] = {
static const binding _gravities[] = {
{ UnmapGravity, "UnMapGravity" }, /* WARNING: both of these have*/
{ ForgetGravity, "ForgetGravity" }, /* the same value - see code */
{ NorthWestGravity, "NorthWestGravity" },
@ -745,18 +772,18 @@ static binding _gravities[] = {
{ StaticGravity, "StaticGravity" },
{ 0, 0 } };
static binding _backing_store_hint[] = {
static const binding _backing_store_hint[] = {
{ NotUseful, "NotUseful" },
{ WhenMapped, "WhenMapped" },
{ Always, "Always" },
{ 0, 0 } };
static binding _bool[] = {
static const binding _bool[] = {
{ 0, "No" },
{ 1, "Yes" },
{ 0, 0 } };
void
static void
Display_Bits_Info(Window window)
{
XWindowAttributes win_attributes;
@ -782,7 +809,7 @@ Display_Bits_Info(Window window)
/*
* Routine to display all events in an event mask
*/
static binding _event_mask_names[] = {
static const binding _event_mask_names[] = {
{ KeyPressMask, "KeyPress" },
{ KeyReleaseMask, "KeyRelease" },
{ ButtonPressMask, "ButtonPress" },
@ -810,7 +837,7 @@ static binding _event_mask_names[] = {
{ OwnerGrabButtonMask, "OwnerGrabButton" },
{ 0, 0 } };
void
static void
Display_Event_Mask(long mask)
{
long bit, bit_mask;
@ -825,7 +852,7 @@ Display_Event_Mask(long mask)
/*
* Display info on events
*/
void
static void
Display_Events_Info(Window window)
{
XWindowAttributes win_attributes;
@ -854,7 +881,7 @@ Display_Events_Info(Window window)
* Display root, parent, and (recursively) children information
* recurse - true to show children information
*/
void
static void
Display_Tree_Info(Window window, int recurse)
{
display_tree_info_1(window, recurse, 0);
@ -863,7 +890,7 @@ Display_Tree_Info(Window window, int recurse)
/*
* level - recursion level
*/
void
static void
display_tree_info_1(Window window, int recurse, int level)
{
int i, j;
@ -935,7 +962,7 @@ display_tree_info_1(Window window, int recurse, int level)
/*
* Display a set of size hints
*/
void
static void
Display_Hints(XSizeHints *hints)
{
long flags;
@ -1013,7 +1040,7 @@ Display_Hints(XSizeHints *hints)
/*
* Display Size Hints info
*/
void
static void
Display_Size_Hints(Window window)
{
XSizeHints *hints = XAllocSizeHints();
@ -1039,7 +1066,7 @@ Display_Size_Hints(Window window)
}
void
static void
Display_Window_Shape (Window window)
{
Bool ws, bs;
@ -1071,7 +1098,7 @@ Display_Window_Shape (Window window)
/*
* Display Window Manager Info
*/
static binding _state_hints[] = {
static const binding _state_hints[] = {
{ DontCareState, "Don't Care State" },
{ NormalState, "Normal State" },
{ ZoomState, "Zoomed State" },
@ -1079,7 +1106,7 @@ static binding _state_hints[] = {
{ InactiveState, "Inactive State" },
{ 0, 0 } };
void
static void
Display_WM_Info(Window window)
{
XWMHints *wmhints;

View File

@ -188,11 +188,16 @@ xwininfo: Window id: 0x60000f "xterm"
.B DISPLAY
To get the default host and display number.
.SH SEE ALSO
X(__miscmansuffix__), xprop(1)
.IR X (__miscmansuffix__),
.IR xprop (__appmansuffix__),
.IR xdpyinfo (__appmansuffix__),
.IR xdriinfo (__appmansuffix__),
.IR xvinfo (__appmansuffix__),
.IR glxinfo (__appmansuffix__)
.SH BUGS
Using \fB\-stats \-bits\fP shows some redundant information.
.PP
The -geometry string displayed must make assumptions about the
The \fB-geometry\fP string displayed must make assumptions about the
window's border width and the behavior of the application and the
window manager. As a result, the location given is not always
correct.