Update to xpr 1.0.4

This commit is contained in:
matthieu 2012-04-07 16:10:39 +00:00
parent 8563437cef
commit 23e4b1c787
14 changed files with 11949 additions and 1008 deletions

View File

@ -1,12 +1,53 @@
This is a stub file. This package has not yet had its complete licensing
information compiled. Please see the individual source files for details on
your rights to use and modify this software.
Please submit updated COPYING files to the Xorg bugzilla:
Copyright (c) 1985, 1988 X Consortium
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
All licensing questions regarding this software should be directed at the
Xorg mailing list:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
http://lists.freedesktop.org/mailman/listinfo/xorg
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 X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1986 by Marvin Solomon and the University of Wisconsin
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the names of Marvin Solomon and
the University of Wisconsin not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
Neither Marvin Solomon nor the University of Wisconsin
makes any representations about the suitability of
this software for any purpose. It is provided "as is"
without express or implied warranty.
Copyright (c) 1988 by Hewlett-Packard Company
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that
Hewlett-Packard not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.

View File

@ -1,3 +1,165 @@
commit 699aa034b8368a4052aa0318d4bca74dd688a7c2
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Mar 31 16:57:47 2012 -0700
xpr 1.0.4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit c9b09f54d783689261855bd87a2bc68bfb3d9731
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Fri Nov 11 11:32:05 2011 -0800
Use memmove rather than bcopy
bcopy was removed in POSIX 2008. I didn't check to see if we could
safely use memcpy.
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
commit 28eaec94f936534573907425cf0fb5198979aab3
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Oct 6 22:40:45 2011 -0700
Add _X_NORETURN to usage() & leave() as suggested by gcc -Wmissing-noreturn
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 3b8fed17575db9d8d571d240bbaebd05d4547060
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Oct 6 22:38:36 2011 -0700
Add const attributes to fix gcc -Wwrite-strings warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit b7d620037e130de1b0b309119c045d4f6a6ba8c5
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Oct 6 22:35:31 2011 -0700
Fix printf type warnings in LP64 builds
x2jet.c:300:6: warning: format %ld expects type long int, but argument 4 has type CARD32
x2jet.c:300:6: warning: format %ld expects type long int, but argument 5 has type CARD32
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 787f9d6d8f6dd6663af27e3cd21facaee6bed4f5
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu Oct 6 22:33:33 2011 -0700
Strip trailing whitespace
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}'
git diff -w & git diff -b show no diffs from this change
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit fbd4b8fe00ba600b44232619425f76a6f4fa8208
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Jan 29 11:45:11 2011 -0800
Define pixel mask constant as unsigned long
Clears Sun Studio cc warning of:
"x2jet.c", line 1681: warning: constant promoted to unsigned long
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 0b7c07a1667c1f7e692b7694d374f27d46c3c923
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Jan 29 11:41:41 2011 -0800
Refactor invalid depth error reporting to allow printf format checking
Clears gcc warnings:
x2jet.c: In function `validate_visual':
x2jet.c:1053: warning: format not a string literal, argument types not checked
x2jet.c:1055: warning: format not a string literal, argument types not checked
x2jet.c:1057: warning: format not a string literal, argument types not checked
x2jet.c:1059: warning: format not a string literal, argument types not checked
x2jet.c:1064: warning: format not a string literal, argument types not checked
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit a02099a6869064c8b8c04a91acf5ece8568c7389
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Jan 29 11:03:40 2011 -0800
Replace gcc noreturn & printf attributes with macros from <X11/Xfuncproto.h>
Adds dependency on x11proto 7.0.17 to get the definition of _X_NORETURN
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 303aa90258f0ceff98e389b226860f0d0afe4c12
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Jan 29 10:48:47 2011 -0800
config: Replace obsolete argument to AC_OUTPUT with AC_CONFIG_FILES
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 43f7a9381d0c056ee2a3da193fa8d953e5881dcc
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Jan 29 10:47:32 2011 -0800
config: Remove unnecessary calls from configure.ac
AC_PROG_CC & AC_PROG_INSTALL are provided by XORG_DEFAULT_OPTIONS now
PKG_CONFIG_MODULES handles AC_SUBST of the CFLAGS & LIBS variables
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit dde63ef2968b104d6deb99a2a56f576382b763a5
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Jan 29 10:47:04 2011 -0800
config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS
Regroup AC statements under the Autoconf initialization section.
Regroup AM statements under the Automake initialization section.
Add missing AC_CONFIG_SRCDIR
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 9ffea606516f4138d91a163038b03669ce787b4a
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Sat Jan 29 10:44:22 2011 -0800
config: update AC_PREREQ statement to 2.60
Unrelated to the previous patches, the new value simply reflects
the reality that the minimum level for autoconf to configure
all x.org modules is 2.60 dated June 2006.
ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 96c2e6761517f2d8618e3b252e4825c25b5b7627
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Jan 29 10:43:20 2011 -0800
config: upgrade to util-macros 1.8 for additional man page support
Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS
The value of MAN_SUBST is the same for all X.Org packages.
Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS
Enables use of platform appropriate version of sed.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 11569289123fb178e23fd1aa284e9fa10e6c1e8c
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Aug 6 15:09:48 2010 -0700
Fill in COPYING file with copyright notices from source code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit ae7e1530f9e60e9a8747a1d4c38579510675f023
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Fri Oct 16 19:13:21 2009 -0700

View File

@ -1,6 +1,6 @@
#
#
# Copyright 2005 Red Hat, Inc.
#
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
@ -10,7 +10,7 @@
# specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@ -62,26 +62,8 @@ appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
EXTRA_DIST += $(appman_PRE)
CLEANFILES += $(appman_DATA)
SED = sed
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@
XORGMANNAME = X Version 11
MAN_SUBSTS = \
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xservername__|Xorg|g' \
-e 's|__xconfigfile__|xorg.conf|g' \
-e 's|__projectroot__|$(prefix)|g' \
-e 's|__apploaddir__|$(appdefaultdir)|' \
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
-e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
SUFFIXES = .$(APP_MAN_SUFFIX) .man
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
.man.$(APP_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@

View File

@ -14,9 +14,9 @@
@SET_MAKE@
#
#
# Copyright 2005 Red Hat, Inc.
#
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
@ -26,7 +26,7 @@
# specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@ -46,9 +46,9 @@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
install_sh_DATA = ${SHELL} $(install_sh) -c -m 644
install_sh_PROGRAM = ${SHELL} $(install_sh) -c
install_sh_SCRIPT = ${SHELL} $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
@ -113,18 +113,21 @@ am__remove_distdir = \
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@ -145,6 +148,7 @@ EXEEXT = @EXEEXT@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -159,6 +163,7 @@ MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
OBJEXT = @OBJEXT@
@ -170,10 +175,13 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
XPR_CFLAGS = @XPR_CFLAGS@
XPR_LIBS = @XPR_LIBS@
ac_ct_CC = @ac_ct_CC@
@ -192,7 +200,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@ -240,24 +247,6 @@ EXTRA_DIST = xdpr.script ChangeLog autogen.sh $(appman_PRE)
MAINTAINERCLEANFILES = ChangeLog
appmandir = $(APP_MAN_DIR)
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
SED = sed
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@
XORGMANNAME = X Version 11
MAN_SUBSTS = \
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xservername__|Xorg|g' \
-e 's|__xconfigfile__|xorg.conf|g' \
-e 's|__projectroot__|$(prefix)|g' \
-e 's|__apploaddir__|$(appdefaultdir)|' \
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
-e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
SUFFIXES = .$(APP_MAN_SUFFIX) .man
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@ -691,6 +680,7 @@ ChangeLog:
dist-hook: ChangeLog
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
.man.$(APP_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.

1587
app/xpr/aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

10880
app/xpr/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
dnl Copyright 2005 Red Hat, Inc.
dnl
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
dnl documentation for any purpose is hereby granted without fee, provided that
dnl the above copyright notice appear in all copies and that both that
@ -10,7 +10,7 @@ dnl advertising or publicity pertaining to distribution of the software without
dnl specific, written prior permission. Red Hat makes no
dnl representations about the suitability of this software for any purpose. It
dnl is provided "as is" without express or implied warranty.
dnl
dnl
dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@ -21,26 +21,25 @@ dnl PERFORMANCE OF THIS SOFTWARE.
dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ([2.57])
AC_INIT(xpr,[1.0.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xpr)
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xpr], [1.0.4],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xpr])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
# Initialize Automake
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.3)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_INSTALL
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
# Checks for pkg-config packages
PKG_CHECK_MODULES(XPR, xmuu x11)
AC_SUBST(XPR_CFLAGS)
AC_SUBST(XPR_LIBS)
PKG_CHECK_MODULES(XPR, [xmuu x11 xproto >= 7.0.17])
AC_OUTPUT([Makefile])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View File

@ -27,13 +27,13 @@
Copyright (c) 1988 by Hewlett-Packard Company
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that
Hewlett-Packard not be used in advertising or publicity
pertaining to distribution of the software without specific, written
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that
Hewlett-Packard not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.
********************************************************/
@ -72,6 +72,7 @@ from the X Consortium.
#include <stdarg.h>
#include <X11/Xlib.h>
#include <X11/XWDFile.h>
#include <X11/Xfuncproto.h>
#include "xpr.h"
@ -260,10 +261,7 @@ static void write_image (
enum orientation orient,
enum device device);
static void fatal_err (const char *s, ...)
#if defined(__GNUC__) && (__GNUC__ > 2)
__attribute__((noreturn, format(printf, 1, 2)))
#endif
;
_X_NORETURN _X_ATTRIBUTE_PRINTF(1,2);
/* Computes the centipoint width of one printer dot. */
@ -296,7 +294,7 @@ void set_image_limits (
if ((limit.width != xwd_header.pixmap_width)
|| (limit.height != xwd_header.pixmap_height))
fprintf(stderr,(catgets(nlmsg_fd,NL_SETN,1, "%s: Warning: %ld x %ld image clipped to %ld x %ld.\n")),
fprintf(stderr,(catgets(nlmsg_fd,NL_SETN,1, "%s: Warning: %d x %d image clipped to %ld x %ld.\n")),
progname,
xwd_header.pixmap_width, xwd_header.pixmap_height,
limit.width, limit.height);
@ -523,7 +521,7 @@ static unsigned short fullintensity;
static long *colormap;
/* Pjcolor array is used to hold the scaled RGB triple values
/* Pjcolor array is used to hold the scaled RGB triple values
* programmed into the printer.
*/
static long pjcolor[MAX_PJ_COLOR];
@ -548,7 +546,7 @@ typedef struct colorindex {
/* Global data for color interpretation. This structure serves as a home
* for the color index lists (only used when processing DirectColor or
* TrueColor visual types). It also holds color processing switches and a
* TrueColor visual types). It also holds color processing switches and a
* pointer to the output file to reduce parameter passing overhead.
*/
static struct {
@ -616,7 +614,7 @@ void reset_color_mapping (void)
/* preload for monochrome output */
pjcolor[0] = WHITE;
pjcolor[1] = BLACK;
}
}
if (Direct_or_TrueColor) {
/* move color index chain cells onto the free list */
@ -648,7 +646,7 @@ void prepare_color_mapping (
fullintensity = (fullintensity << 1) | 1;
for (n = sizeof(short) * 8 - xwd_header.bits_per_rgb; n > 0; n--)
fullintensity = (fullintensity << 1);
Direct_or_TrueColor = (xwd_header.visual_class == DirectColor
|| xwd_header.visual_class == TrueColor);
color.PaintJet = paintjet;
@ -736,7 +734,7 @@ int load_printer_color (
{
int n, red, blue, green, xred, xgreen, xblue;
long compositeRGB;
if (colormap[index] != EMPTY)
/* printer has already been programmed for this color index */
return(1); /* "success" */
@ -1043,27 +1041,35 @@ void download_colors (
}
static _X_INLINE _X_NORETURN
void invalid_depth_for_visual(int depth, const char *name)
{
fatal_err(catgets(nlmsg_fd,NL_SETN,25,
"%d bit deep %s bitmap not supported.\n"),
depth, name);
}
static
void validate_visual(void)
{
int depth = xwd_header.pixmap_depth;
char *errmsg = catgets(nlmsg_fd,NL_SETN,25,
"%d bit deep %s bitmap not supported.\n");
switch (xwd_header.visual_class) {
case GrayScale:
if (depth > 8) fatal_err(errmsg, depth, "GrayScale"); break;
if (depth > 8) invalid_depth_for_visual(depth, "GrayScale"); break;
case StaticGray:
if (depth > 8) fatal_err(errmsg, depth, "StaticGray"); break;
if (depth > 8) invalid_depth_for_visual(depth, "StaticGray"); break;
case PseudoColor:
if (depth > 8) fatal_err(errmsg, depth, "PseudoColor"); break;
if (depth > 8) invalid_depth_for_visual(depth, "PseudoColor"); break;
case StaticColor:
if (depth > 8) fatal_err(errmsg, depth, "StaticColor"); break;
if (depth > 8) invalid_depth_for_visual(depth, "StaticColor"); break;
case DirectColor:
if (depth != 12 && depth != 24)
invalid_depth_for_visual(depth, "DirectColor");
break;
case TrueColor:
if (depth != 12 && depth != 24)
fatal_err(errmsg, depth, (xwd_header.visual_class == DirectColor)
? "DirectColor" : "TrueColor");
invalid_depth_for_visual(depth, "TrueColor");
break;
default:
fatal_err((catgets(nlmsg_fd,NL_SETN,26,
@ -1173,7 +1179,7 @@ void write_image_prefix (
fprintf(out,"\033&a%dH\033&a%dV",
/* imageloc x & y are written in decipoints */
(int) imageloc.x / 10, (int) imageloc.y / 10);
/* If doing transparencies, tell the printer before raster graphics */
if (slide && device != LJET)
fprintf(out, "\033&k3W");
@ -1415,7 +1421,7 @@ void index_by_pixel(
long *lp;
char *line_pixels;
register char *lc;
if (!(line_pixels = malloc(length)))
fatal_err((catgets(nlmsg_fd,NL_SETN,17,
"Could not allocate raster line memory.")));
@ -1444,7 +1450,7 @@ void write_raster_line (
long *lp;
char *line_colors, *raster_line;
register char *lc, *rl, byte = 0;
if (device == PJETXL) {
if (Direct_or_TrueColor)
direct_by_pixel(out, line, length, device);
@ -1647,7 +1653,7 @@ void write_image (
write_XY_image(out, scale, orient, device); break;
case ZPixmap:
write_Z_image(out, scale, orient, device); break;
default:
default:
fatal_err((catgets(nlmsg_fd,NL_SETN,23, "image not in XY or Z format.")));
}
}
@ -1674,7 +1680,7 @@ void x2jet(
read_xwd_data(in);
Z_pixel_mask = ~(0xFFFFFFFFL << xwd_header.pixmap_depth);
Z_pixel_mask = ~(0xFFFFFFFFUL << xwd_header.pixmap_depth);
prepare_color_mapping(invert, paintjet, cutoff, out);
@ -1684,7 +1690,7 @@ void x2jet(
write_image_prefix(out, scale, density, header, device, position_on_page,
initial_formfeed, orient, gamma, render, slide);
write_image(out, scale, orient, device);
write_image_suffix(out, trailer, position_on_page, slide, render, device);

View File

@ -11,6 +11,7 @@
#include <X11/XWDFile.h>
#include <X11/Xfuncs.h>
#include <errno.h>
#include <string.h>
#include "pmp.h"
#include "xpr.h"
@ -23,7 +24,7 @@
/* Local prototypes */
static unsigned char *magnification_table(int scale);
static int bits_set(int n);
static void leave(const char *s);
static void leave(const char *s) _X_NORETURN;
static void p_move_abs(FILE *p, int x, int y);
static void p_save_cursor(FILE *p, int reg);
static void p_restore_cursor(FILE *p, int reg);
@ -55,7 +56,7 @@ void x2pmp(FILE *in, FILE *out,
/* Read header from file */
if (fread((char *)&header, sizeof(header), 1, in) != 1) {
if (feof(in))
if (feof(in))
return;
else
leave("fread");
@ -86,7 +87,7 @@ void x2pmp(FILE *in, FILE *out,
one_plane_size = byte_width * height;
buffer_size = one_plane_size *
((header.pixmap_format == ZPixmap)? header.pixmap_depth: 1);
/* Determine orientation and scale if not specified */
if (orient == UNSPECIFIED)
orient = (fixed_width <= height)? PORTRAIT: LANDSCAPE;
@ -185,7 +186,7 @@ void x2pmp(FILE *in, FILE *out,
unsigned char *tbl = magnification_table(scale);
unsigned char *scale_buf;
int i, j, k;
if ((scale_buf = (unsigned char *)
calloc((unsigned) (buffer_size *= scale*scale), sizeof(char)))
== NULL)
@ -198,7 +199,7 @@ void x2pmp(FILE *in, FILE *out,
unsigned char *dst = ss+j*scale;
unsigned char *expansion = tbl+scale*src[j];
for(k = 0; k < scale; k++, dst += byte_width*scale) {
bcopy((char *) expansion, (char *) dst, scale);
memmove((char *) dst, (char *) expansion, scale);
}
}
}
@ -351,10 +352,10 @@ void p_bitmap(
puthl2(h, p);
puthl2(w, p);
puthl3(buflen, p);
while(buflen) {
int len;
len = min(buflen, MAX_VECTOR_LEN);
PMP(p, len);
(void) fwrite((char *) buf, 1, len, p);

View File

@ -25,9 +25,9 @@ xdpr \- dump an X window directly to a printer
.SH DESCRIPTION
.I Xdpr
uses the commands
uses the commands
.I xwd,
.I xpr,
.I xpr,
and
.I lpr
or
@ -52,7 +52,7 @@ printed instead of selecting an X window.
Specifies a printer to send the output to. If a printer name is not
specified here, \fIxdpr\fP (really, \fIlpr\fP or \fIlp\fP)
will send your output to the
printer specified by the \fIPRINTER\fP environment variable.
printer specified by the \fIPRINTER\fP environment variable.
Be sure that type of the printer matches the type specified
with the \fI\-device\fP option.
.TP
@ -101,8 +101,8 @@ provided only for backwards compatibility.
This option displays the list of options known to
.I xdpr.
.PP
Any other arguments
will be passed to the
Any other arguments
will be passed to the
.I xwd,
.I xpr,
and

View File

@ -108,7 +108,7 @@ while [ $1 ]; do
xprv="$xprv $1"
else
echo "xdpr: Invalid argument "$1""
echo $usage
echo $usage
exit 1
fi
esac
@ -149,7 +149,7 @@ if [ "$out" ]; then
exit 0
fi
# print only
# print only
if [ "$infile" ]; then
if [ "$xwdv" ]; then
echo "xdpr: The following arguments will be ignored:"
@ -161,6 +161,6 @@ fi
# dump & print (default)
xwd $xwdv | xpr -header "$header" -trailer "$trailer" $xprv | $LP $lprv
exit 0
exit 0
# EOF

View File

@ -40,10 +40,10 @@ from the X Consortium.
* by using run-length encoding on white (1) pixels.
* This version does not (yet) support the following options
* -append -dump -noff -nosixopt -split
*
*
* Changes
* Copyright 1986 by Marvin Solomon and the University of Wisconsin
*
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
@ -57,7 +57,7 @@ from the X Consortium.
* makes any representations about the suitability of
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
*
* Modified by Bob Scheifler for 2x2 grayscale, then ...
* Modified by Angela Bock and E. Mike Durbin, Rich Inc., to produce output
* using 2x2, 3x3, or 4x4 grayscales. This version modifies the grayscale
@ -77,6 +77,7 @@ from the X Consortium.
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>
#include <string.h>
#ifndef WIN32
#include <pwd.h>
#endif
@ -131,8 +132,8 @@ int debug = 0;
#define DEFAULT_CUTOFF ((unsigned int) (0xFFFF * 0.50))
static char *infilename = NULL;
char *progname = NULL;
static const char *infilename = NULL;
const char *progname = NULL;
typedef struct _grayRec {
int level;
@ -170,7 +171,7 @@ char hex2[]="000000000000000088888888888888884444444444444444cccccccccccccccc\
/* Local prototypes */
static void usage(void);
static void usage(void) _X_NORETURN;
static
void parse_args(
int argc,
@ -280,8 +281,8 @@ static void ps_output_bits(
const char *data);
static int ps_putbuf(
register unsigned char *s,
register int n,
register int ocount,
register int n,
register int ocount,
int compact);
static void ps_bitrot(
unsigned char *s,
@ -292,8 +293,8 @@ static void ps_bitrot(
static void fullread (
int file,
char *data,
int nbytes);
int nbytes);
int main(int argc, char **argv)
{
unsigned long swaptest = 1;
@ -319,16 +320,16 @@ int main(int argc, char **argv)
enum orientation orientation;
enum device device;
XColor *colors = (XColor *)NULL;
if (!(progname = argv[0]))
progname = "xpr";
#ifdef NLS
nlmsg_fd = catopen("xpr", 0);
#endif
parse_args (argc, argv, &scale, &width, &height, &left, &top, &device,
parse_args (argc, argv, &scale, &width, &height, &left, &top, &device,
&flags, &split, &header, &trailer, &plane, &gray,
&density, &cutoff, &gamma, &render);
if (device == PP) {
x2pmp(stdin, stdout, scale,
width >= 0? inch2pel((float)width/300.0): X_MAX_PELS,
@ -369,7 +370,7 @@ int main(int argc, char **argv)
w_name = malloc((unsigned)(win.header_size - sizeof win));
fullread(0, w_name, (int) (win.header_size - sizeof win));
if(win.ncolors) {
XWDColor xwdcolor;
colors = (XColor *)malloc((unsigned) (win.ncolors * sizeof(XColor)));
@ -436,7 +437,7 @@ int main(int argc, char **argv)
/* ln03_grind_fonts(sixmap, iw, ih, scale, &pixmap); */
ln03_setup(iw, ih, orientation, scale, left, top,
&left_margin, &top_margin, flags, header, trailer);
ln03_output_sixels(sixmap, iw, ih, (flags & F_NOSIXOPT), split,
ln03_output_sixels(sixmap, iw, ih, (flags & F_NOSIXOPT), split,
scale, top_margin, left_margin);
ln03_finish();
} else if (device == LA100) {
@ -451,13 +452,13 @@ int main(int argc, char **argv)
} else {
fprintf(stderr, "xpr: device not supported\n");
}
/* print some statistics */
if (flags & F_REPORT) {
fprintf(stderr, "Name: %s\n", w_name);
fprintf(stderr, "Width: %d, Height: %d\n", (int)win.pixmap_width,
fprintf(stderr, "Width: %d, Height: %d\n", (int)win.pixmap_width,
(int)win.pixmap_height);
fprintf(stderr, "Orientation: %s, Scale: %d\n",
fprintf(stderr, "Orientation: %s, Scale: %d\n",
(orientation==PORTRAIT) ? "Portrait" : "Landscape", scale);
}
if (((device == LN03) || (device == LA100)) && (flags & F_DUMP))
@ -783,7 +784,7 @@ void parse_args(
f = open(output_filename, O_WRONLY, 0);
}
if (f < 0) {
fprintf(stderr, "xpr: error opening \"%s\" for output\n",
fprintf(stderr, "xpr: error opening \"%s\" for output\n",
output_filename);
perror("xpr");
exit(1);
@ -825,7 +826,7 @@ void setup_layout(
/* check maximum width and height; set orientation and scale*/
if (device == LN03 || device == PS) {
if ((win_width < win_height || (flags & F_PORTRAIT)) &&
if ((win_width < win_height || (flags & F_PORTRAIT)) &&
!(flags & F_LANDSCAPE)) {
*orientation = PORTRAIT;
w_max = (width > 0)? width : W_MAX;
@ -1156,7 +1157,7 @@ void ln03_setup(
register int lm, tm, xm;
char buf[256];
register char *bp = buf;
if (!(flags & F_APPEND)) {
sprintf(bp, LN_STR); bp += 4;
sprintf(bp, LN_SSU, 7); bp += 5;
@ -1183,7 +1184,7 @@ void ln03_setup(
xm = (((scale * iw) - (i * 30)) / 2) + lm;
sprintf(bp, LN_HPA, xm); bp += strlen(bp);
sprintf(bp, LN_SGR, 3); bp += strlen(bp);
bcopy(header, bp, i);
memmove(bp, header, i);
bp += i;
}
if (trailer != NULL) {
@ -1192,7 +1193,7 @@ void ln03_setup(
xm = (((scale * iw) - (i * 30)) / 2) + lm;
sprintf(bp, LN_HPA, xm); bp += strlen(bp);
sprintf(bp, LN_SGR, 3); bp += strlen(bp);
bcopy(trailer, bp, i);
memmove(bp, trailer, i);
bp += i;
}
@ -1214,13 +1215,13 @@ void ln03_finish(void)
sprintf(bp, LN_DECOPM_RESET); bp += sizeof LN_DECOPM_SET - 1;
sprintf(bp, LN_LNM); bp += 5;
sprintf(bp, LN_PUM); bp += 5;
sprintf(bp, LN_PFS, "?20"); bp += 7;
sprintf(bp, LN_SGR, 0); bp += strlen(bp);
sprintf(bp, LN_PFS, "?20"); bp += 7;
sprintf(bp, LN_SGR, 0); bp += strlen(bp);
sprintf(bp, LN_HPA, 1); bp += strlen(bp);
sprintf(bp, LN_VPA, 1); bp += strlen(bp);
write(1, buf, bp-buf);
write(1, buf, bp-buf);
}
/*ARGSUSED*/
@ -1348,7 +1349,7 @@ char *ps_prolog_compact[] = {
NULL
};
static const
static const
char *ps_prolog[] = {
"%%Pages: 1",
"%%EndProlog",
@ -1740,7 +1741,7 @@ void ps_output_bits(
ibuf = (unsigned char *)malloc((unsigned)(iwb + 3));
for (i=0;i<ih;i++) {
bcopy((char *)buffer, (char *)ibuf, iwb);
memmove((char *)ibuf, (char *)buffer, iwb);
buffer += iwb;
if (!(*(char *) &swaptest))
_swaplong((char *)ibuf,(long)iwb);
@ -1814,7 +1815,7 @@ void _invbits (
*b = ~*b;
b++;
} while (--n > 0);
}
/* copied from lib/X/XPutImage.c */
@ -1827,7 +1828,7 @@ void _swapbits (
*b = _reverse_byte[*b];
b++;
} while (--n > 0);
}
void _swapshort (
@ -1983,7 +1984,7 @@ void ps_bitrot(
}
}
/* fullread() is the same as read(), except that it guarantees to
/* fullread() is the same as read(), except that it guarantees to
read all the bytes requested. */
static

View File

@ -32,7 +32,7 @@ enum orientation {
enum device {LN01, LN03, LA100, PS, PP, LJET, PJET, PJETXL};
/* Global variables */
extern char *progname;
extern const char *progname;
extern int debug;
/* Global prototypes */

View File

@ -86,7 +86,7 @@ prints the largest possible representation of the window on the
output page. Options allow the user to add headers and trailers,
specify margins, adjust the scale and orientation, and append
multiple window dumps to a single output file. Output is to
standard output unless
standard output unless
.B \-output
is specified.
.sp 1
@ -131,7 +131,7 @@ Affects the size of the window on the page. The PostScript, LN03, and HP
printers are able to
translate each bit in a window pixel map into a grid of a specified size.
For example each bit might translate into a 3x3 grid. This would be
specified by \fB\-scale\fP \fI3\fP. By default a window is printed
specified by \fB\-scale\fP \fI3\fP. By default a window is printed
with the largest scale that will fit onto the page for the specified
orientation.
.IP "\fB\-height\fP \fIinches\fP"
@ -178,7 +178,7 @@ is to be appended.
When specified in conjunction with \fB\-append\fP, the window will appear
on the same page as the previous window.
.IP "\fB\-split\fP \fIn\fP"
This option allows the user to split a window onto several pages.
This option allows the user to split a window onto several pages.
This might be necessary for very large windows that would otherwise
cause the printer to overload and print the page in an obscure manner.
.IP "\fB\-psfig\fP"
@ -331,7 +331,7 @@ Copyright 1988, Hewlett Packard Company.
.br
See \fIX(1)\fP for a full statement of rights and permissions.
.SH AUTHORS
Michael R. Gretzinger, MIT Project Athena,
Michael R. Gretzinger, MIT Project Athena,
Jose Capo, MIT Project Athena (PP3812 support),
Marvin Solomon, University of Wisconsin,
Bob Scheifler, MIT, Angela Bock and E. Mike Durbin, Rich Inc. (grayscale),