Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet 315aee3b85 Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.1.12@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
146 arquivos alterados com 6956 adições e 1146 exclusões
+8
Ver Arquivo
@@ -0,0 +1,8 @@
config.cache
config.h
config.log
config.status
cups-config
cups.list
cups.sh
Makedefs
+227 -1
Ver Arquivo
@@ -1,6 +1,232 @@
CHANGES.txt - 06/28/2001
CHANGES.txt - 11/14/2001
------------------------
CHANGES IN CUPS V1.1.12
- Added "Polish" to the list of known languages for PPD
files.
- Added missing directory definition to cups-config.
- The CUPS-Move-Job operation did not set the
destination type for the new destination.
- The CUPS-Add-Printer operation did not support the
allow=all or deny=none values to clear the per-user
printer ACLs.
- The SetPrinterAttrs() function did not handle invalid
PPD files that were missing the required NickName
attribute. It now looks for NickName, ModelName, and
then substitutes the string "Bad PPD File" for the
printer-make-and-model attribute.
CHANGES IN CUPS V1.1.11
- Added support for embedded TrueType fonts in PDF
files.
- Added support for PostScript functions in PDF
files.
- Added new "cupsaddsmb" utility for exporting
CUPS printer drivers to SAMBA/Windows clients.
- Added preliminary support for Darwin/MacOS X.
- The CUPS-Add-Printer operation no longer allows
arbitrary scheme names in device URIs to be used - it
now restricts the available schemes to those found in
the device list (lpinfo -m).
- The ippRead() and ipp_read_file() functions could not
handle more than IPP_MAX_VALUES (100) values in a
1setOf attribute. These functions have been updated
to dynamically allocate more memory as needed, and the
IPP_MAX_VALUES constant now represents the allocation
increment. [this caused some versions of the
GIMP-print drivers to fail since the number of media
options exceeded 100...]
- The scheduler could crash when BrowseShortNames
was set to "No".
- The scheduler did not prevent MaxClients from being
set to 0, which could cause the scheduler to go in an
infinite loop when accepting a request.
- Made some performance optimizations in the ippRead()
functions to make IPP request/response processing
faster.
- The accept/reject/enable/disable command did not
support properly support the "-h" or default
server name.
- The scheduler did not save the quota configuration
when the job-quota-period attribute was set to 0.
- The LPDEST and PRINTER environment variables did not
support printer instances.
- The text filter now handles more types of boldface and
underline formatting.
- The cupsTempFd() function did not fail if the
temporary directory did not exist; this would cause it
to loop indefinitely instead of returning an error
(-1).
- Stopping (disabling) a printer class did not stop jobs
from printing to printers in that class.
- The cupsGetDests() function was sending the
requested-attributes attribute as a name instead of a
keyword; this caused a serious performance problem on
slower systems since more information had to be
transferred from server to client.
- The web interfaces did not always quote < and & in
things like the job title. This had the potential for
browser-based security violations (on the browser's
machine); bug report from SuSE.
- The scheduler now treats unauthenticated usernames as
case-insensitive when doing quota and allow/deny
processing.
- The lp command sent the "request ID is ..." message
to stderr instead of stdout...
- The PostScript filter (pstops) now handles EPS files,
adding a showpage command to the files as needed.
- The configure script checked for the <stdlib.h> header
file before the JPEG libraries; since the JPEG headers
can define HAVE_STDLIB_H, the configure check would
cause the JPEG check to fail on some systems.
- The scheduler now supports localized banner files,
using the subdirectory approach, e.g. the "es"
subdirectory under /usr/share/cups/banners is used for
the Spanish banner files.
- Updated the scheduler so it knows the correct
language abbreviation to use for all supported
PPD LanguageVersion values. The new code also
supports country codes as well, so "English-GB"
maps to the "en_GB" locale.
- The cups-lpd mini-daemon did not support
anonymous printing (no username specified).
While the username is REQUIRED by RFC-1179,
MacOS clients do not send the REQUIRED username
information when printing via LPD.
- Added many warning and informational messages
to cups-lpd where they were missing.
- Added Czech message file contributed by SuSE.
- The cups-lpd mini-daemon now returns a non-zero
status if an invalid destination or job ID is
provided.
- The scheduler did not honor the KeepAlive setting in
cupsd.conf.
- Increased the size of the file read/write buffers to
32k.
- *BSD static library creation fixes.
- Use mkstemps() instead of tmpnam() in pdftops whenever
possible.
- Added httpGetHostByName() function as a wrapper around
gethostbyname() - some implementations of this
function do not support IP addresses (e.g. MacOS X.)
- Added casts to all printf's of file lengths, since
there is currently no standard way of formatting long
long values.
- The client filename field was not cleared in all
instances, resulting in old form data being submitted
to CGIs.
- The httpConnect*() functions now try all available
addresses for a host when connecting for the first
time.
- The pstoraster filter would "lose" all drawing
commands when the PageSize was set but the printer
bitmap was not reallocated. This was most noticeable
with the output from StarOffice 6 beta and would
result in a blank page being output...
- The IPP backend was sending a PAGE comment even when
printing the output from a filter (it should only send
page comments when printing files directly...)
- The pdftops filter didn't properly map glyph names of
embedded Asian TrueType fonts.
- Changed the CUPS startup script to look for a program
named "cupsd", not just any program with "cupsd" in
the name (this caused the apcupsd UPS monitoring
daemon to be stopped/restarted...)
- The CUPS-Move-Job operation did not change the
internal destination name for held jobs, so moved (but
held) jobs would still show up as queued on the
original destination.
- The cups-polld program didn't send the
requested-attributes attribute in the
CUPS-Get-Printers and CUPS-Get-Classes requests, which
made it use more CPU and bandwidth than required.
- The scheduler and CUPS API incorrectly added a
job-sheets-default attribute for remote printers. This
caused banner pages to be omitted from client system
prints.
CHANGES IN CUPS V1.1.10-1
- Minor fixes to the filter, systemv, and template
makefiles to install files properly.
CHANGES IN CUPS V1.1.10
- Added a driver for DYMO label printers.
- Added new ClassifyOverride directive to allow users
to override the classification of individual jobs.
- Added new BrowseProtocols directive to control which
browse protocols are used (currently CUPS and SLP).
- Added SLPv2 support (thanks to Matt Peterson for
contributing the initial implementation for CUPS.)
- Adding a raw printer on a remote CUPS server now
correctly redirects PPD file requests to the remote
server.
- The serial backend now limits writes to 1/10th
second worth of data to avoid buffer overflows
with some types of flow control.
- The scheduler did not properly process PUT requests,
so configuration files could not be uploaded to the
server.
- The scheduler did not strip trailing whitespace on
lines in the configuration files.
- The httpWrite() function did not transition the PUT
request to the HTTP_STATUS state to get the status
from the server.
- The scheduler did not properly handle trailing null
("-") filters when testing a driver that sent data
to the file: pseudo-backend.
- The IPP backend now only sends a document-format of
"application/vnd.cups-raw" when printing to another
CUPS server using a local printer driver or interface
script. Previously the job's document format was
used, which was incorrect.
- The lpadmin command didn't use the ppd-name attribute
with the -m option; this prevented the use of the
"raw" model from the command-line.
- The pstoraster filter output draft (1-bit) 6-color
output in the wrong order; this resulted in yellow
being printed instead of black on Stylus Photo
printers.
- The pdftops filter did not have the Japanese and
Chinese text support compiled into it.
- The IPP and AppSocket backends did not clear the
"waiting for print job to complete" status message,
which caused some confusion... :)
- The serial backend now opens the port in "no delay"
mode to avoid DCD detection problems with some OS's.
CHANGES IN CUPS V1.1.9-1
- The configure script did not substitute the
correct user and group names.
- The configure script did not use the full path
to the install-sh script when it was used.
- The pstoraster filter did not correctly support
DuplexTumble mode for printers that used flip
duplexing.
- The cups.list.in file was missing from the
distribution.
- The New DeskJet series driver did not use the
correct OrderDependency for the Duplex option.
- Use read() instead of fread() to read piped
print files in lpr/lp. This avoids a bug in the
HP-UX 10.20 fread() function.
- Updated the pstoraster filter to use the MIPS_FIXADE
system call under IRIX to fix bus error problems on
R12000 processors (Ghostscript is not 64-bit clean...)
- Some Xerox PPD files (most notably the Phaser 790)
have illegal whitespace in the option keyword in the
OpenUI line. This caused the PageRegion option to not
be recognized properly for the Phaser 790.
CHANGES IN CUPS V1.1.9
- Revamped the configure script to use a modular
+6 -4
Ver Arquivo
@@ -1,5 +1,5 @@
INSTALL - CUPS v1.1.9 - 07/06/2001
----------------------------------
INSTALL - CUPS v1.1.12 - 11/14/2001
-----------------------------------
This file describes how to compile and install CUPS from source
code. For more information on CUPS see the file called
@@ -48,11 +48,12 @@ another location:
If the PNG, JPEG, TIFF, and ZLIB libraries are not installed in
a system default location (typically "/usr/include" and
"/usr/lib") you'll need to set the CFLAGS, CXXFLAGS, and LDFLAGS
environment variables prior to running configure:
"/usr/lib") you'll need to set the CFLAGS, CXXFLAGS, DSOFLAGS,
and LDFLAGS environment variables prior to running configure:
setenv CFLAGS "-I/some/directory" ENTER
setenv CXXFLAGS "-I/some/directory" ENTER
setenv DSOFLAGS "-L/some/directory" ENTER
setenv LDFLAGS "-L/some/directory" ENTER
./configure ... ENTER
@@ -60,6 +61,7 @@ or:
CFLAGS="-I/some/directory"; export CFLAGS ENTER
CXXFLAGS="-I/some/directory"; export CXXFLAGS ENTER
DSOFLAGS="-L/some/directory"; export DSOFLAGS ENTER
LDFLAGS="-L/some/directory"; export LDFLAGS ENTER
./configure ... ENTER
+20 -17
Ver Arquivo
@@ -69,6 +69,7 @@ LIBCUPSIMAGE = @LIBCUPSIMAGE@
LIBJPEG = @LIBJPEG@
LIBMALLOC = @LIBMALLOC@
LIBPNG = @LIBPNG@
LIBSLP = @LIBSLP@
LIBTIFF = @LIBTIFF@
LIBZ = @LIBZ@
@@ -80,7 +81,7 @@ LIBZ = @LIBZ@
# extra debug info)
#
ARFLAGS = crvs
ARFLAGS = @ARFLAGS@
CFLAGS = @CFLAGS@ -I.. $(OPTIONS)
CXXFLAGS = @CXXFLAGS@ -I.. $(OPTIONS)
DSOFLAGS = @DSOFLAGS@
@@ -125,24 +126,26 @@ srcdir = @srcdir@
sysconfdir = @sysconfdir@
top_srcdir = @top_srcdir@
AMANDIR = @AMANDIR@
BINDIR = @bindir@
DATADIR = @CUPS_DATADIR@
DOCDIR = @CUPS_DOCROOT@
INCLUDEDIR = $(includedir)
AMANDIR = $(BUILDROOT)@AMANDIR@
BINDIR = $(BUILDROOT)@bindir@
DATADIR = $(BUILDROOT)@CUPS_DATADIR@
DOCDIR = $(BUILDROOT)@CUPS_DOCROOT@
INCLUDEDIR = $(BUILDROOT)$(includedir)
INITDIR = @INITDIR@
INITDDIR = @INITDDIR@
LIBDIR = $(libdir)
LOCALEDIR = @CUPS_LOCALEDIR@
LOGDIR = @CUPS_LOGDIR@
MANDIR = @mandir@
PAMDIR = @PAMDIR@
REQUESTS = @CUPS_REQUESTS@
SBINDIR = @sbindir@
SERVERBIN = @CUPS_SERVERBIN@
SERVERROOT = @CUPS_SERVERROOT@
LIBDIR = $(BUILDROOT)$(libdir)
LOCALEDIR = $(BUILDROOT)@CUPS_LOCALEDIR@
LOGDIR = $(BUILDROOT)@CUPS_LOGDIR@
MANDIR = $(BUILDROOT)@mandir@
PAMDIR = $(BUILDROOT)@PAMDIR@
PMANDIR = $(BUILDROOT)@PMANDIR@
REQUESTS = $(BUILDROOT)@CUPS_REQUESTS@
SBINDIR = $(BUILDROOT)@sbindir@
SERVERBIN = $(BUILDROOT)@CUPS_SERVERBIN@
SERVERROOT = $(BUILDROOT)@CUPS_SERVERROOT@
CAT1EXT = @CAT1EXT@
CAT3EXT = @CAT3EXT@
CAT5EXT = @CAT5EXT@
CAT8EXT = @CAT8EXT@
MAN8EXT = @MAN8EXT@
@@ -153,14 +156,14 @@ MAN8DIR = @MAN8DIR@
#
.SILENT:
.SUFFIXES: .a .c .cxx .h .man .o .0 .1 .1m .5 .8 .z
.SUFFIXES: .a .c .cxx .h .man .o .0 .1 .1m .3 .5 .8 .z
.c.o:
echo Compiling $<...
$(CC) $(OPTIM) $(CFLAGS) -c $<
.cxx.o:
echo Compiling $<...
$(CXX) $(OPTIM) $(CXXFLAGS) -c $<
.man.0 .man.1 .man.1m .man.5 .man.8:
.man.0 .man.1 .man.1m .man.3 .man.5 .man.8:
echo Formatting $<...
$(RM) $@
$(NROFF) -man $< >$@
+23 -13
Ver Arquivo
@@ -74,22 +74,32 @@ install:
(cd ppd; $(MAKE) $(MFLAGS) install)
echo Installing in templates...
(cd templates; $(MAKE) $(MFLAGS) install)
echo Installing cups-config script...
$(INSTALL_DIR) $(bindir)
$(INSTALL_SCRIPT) cups-config $(bindir)/cups-config
echo Installing startup script...
if test "x$INITDIR" != "x"; then \
$(INSTALL_DIR) $(prefix)/$(INITDIR)/init.d; \
$(INSTALL_SCRIPT) cups.sh $(prefix)/$(INITDIR)/init.d/cups; \
$(INSTALL_DIR) $(prefix)/$(INITDIR)/rc0.d; \
$(INSTALL_SCRIPT) cups.sh $(prefix)/$(INITDIR)/rc0.d/K00cups; \
$(INSTALL_DIR) $(prefix)/$(INITDIR)/rc2.d; \
$(INSTALL_SCRIPT) cups.sh $(prefix)/$(INITDIR)/rc2.d/S99cups; \
$(INSTALL_DIR) $(prefix)/$(INITDIR)/rc3.d; \
$(INSTALL_SCRIPT) cups.sh $(prefix)/$(INITDIR)/rc3.d/S99cups; \
$(INSTALL_DIR) $(prefix)/$(INITDIR)/rc5.d; \
$(INSTALL_SCRIPT) cups.sh $(prefix)/$(INITDIR)/rc5.d/S99cups; \
if test "x$(INITDIR)" != "x"; then \
$(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/init.d; \
$(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
$(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc0.d; \
$(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
$(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc2.d; \
$(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \
$(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc3.d; \
$(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \
$(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc5.d; \
$(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
fi
if test "x$(INITDIR)" = "x" -a "x$(INITDDIR)" != "x"; then \
$(INSTALL_DIR) $(prefix)/$(INITDDIR); \
$(INSTALL_SCRIPT) cups.sh $(prefix)/$(INITDDIR)/cups; \
$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
if test "$(INITDDIR)" = "/System/Library/StartupItems/CUPS"; then \
$(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDDIR)/CUPS; \
$(INSTALL_DATA) cups.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
$(INSTALL_DATA) cups.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
else \
$(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
fi \
fi
+10 -7
Ver Arquivo
@@ -1,5 +1,5 @@
README - CUPS v1.1.9 - 07/06/2001
---------------------------------
README - CUPS v1.1.12 - 11/14/2001
----------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
instead...
@@ -27,8 +27,8 @@ that are used to support non-PostScript printers. Sample
drivers for HP and EPSON printers are included that use these
filters.
Drivers for over 2300 printers are provided with our ESP Print
Pro software, available at:
Drivers for thousands of printers are provided with our ESP
Print Pro software, available at:
http://www.easysw.com/printpro
@@ -191,15 +191,18 @@ Similarly, for the other sample drivers you can use:
Driver PPD File
----------------------------- ------------
HP DeskJet Series deskjet.ppd
HP New DeskJet Series deskjet2.ppd
HP LaserJet Series laserjet.ppd
Dymo Label Printers dymo.ppd
EPSON Stylus Color Series stcolor.ppd
EPSON Stylus Photo Series stphoto.ppd
EPSON Stylus New Color Series stcolor2.ppd
EPSON Stylus New Photo Series stphoto2.ppd
EPSON 9-pin Series epson9.ppd
EPSON 24-pin Series epson24.ppd
HP DeskJet Series deskjet.ppd
HP New DeskJet Series deskjet2.ppd
HP LaserJet Series laserjet.ppd
OKIDATA 9-Pin Series okidata9.ppd
OKIDATA 24-Pin Series okidat24.ppd
These sample drivers provide basic printing capabilities, but
generally do not exercise the full potential of the printers or
+7
Ver Arquivo
@@ -0,0 +1,7 @@
ipp
lpd
usb
parallel
betest
serial
socket
+5 -1
Ver Arquivo
@@ -50,7 +50,11 @@ clean:
install:
$(INSTALL_DIR) $(SERVERBIN)/backend
$(INSTALL_BIN) $(BACKENDS) http $(SERVERBIN)/backend
for file in $(BACKENDS); do \
$(INSTALL_BIN) $$file $(SERVERBIN)/backend; \
done
$(RM) $(SERVERBIN)/backend/http
$(LN) ipp $(SERVERBIN)/backend/http
#
+12 -2
Ver Arquivo
@@ -431,7 +431,12 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
options = NULL;
num_options = cupsParseOptions(argv[5], 0, &options);
if ((content_type = getenv("CONTENT_TYPE")) != NULL && format_sup != NULL)
if (argc > 6)
content_type = getenv("CONTENT_TYPE");
else
content_type = "application/vnd.cups-raw";
if (content_type != NULL && format_sup != NULL)
{
for (i = 0; i < format_sup->num_values; i ++)
if (strcasecmp(content_type, format_sup->values[i].string.text) == 0)
@@ -472,6 +477,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (ipp_status > IPP_OK_CONFLICT)
{
job_id = 0;
if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
ipp_status == IPP_PRINTER_BUSY)
{
@@ -497,7 +504,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (response)
ippDelete(response);
if (ipp_status <= IPP_OK_CONFLICT)
if (ipp_status <= IPP_OK_CONFLICT && argc > 6)
{
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
copies --;
@@ -621,6 +628,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Return the queue status...
*/
if (ipp_status <= IPP_OK_CONFLICT)
fputs("INFO: Ready to print.\n", stderr);
return (ipp_status > IPP_OK_CONFLICT);
}
+1 -1
Ver Arquivo
@@ -399,7 +399,7 @@ lpd_queue(char *hostname, /* I - Host to connect to */
* First try to reserve a port for this connection...
*/
if ((hostaddr = gethostbyname(hostname)) == NULL)
if ((hostaddr = httpGetHostByName(hostname)) == NULL)
{
fprintf(stderr, "ERROR: Unable to locate printer \'%s\' - %s",
hostname, strerror(errno));
+5 -4
Ver Arquivo
@@ -189,7 +189,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
do
{
if ((fd = open(resource, O_WRONLY | O_NOCTTY | O_EXCL)) == -1)
if ((fd = open(resource, O_WRONLY | O_NOCTTY | O_EXCL | O_NDELAY)) == -1)
{
if (errno == EBUSY)
{
@@ -213,7 +213,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
bufsize = 480; /* 9600 baud / 10 bits/char / 2Hz */
bufsize = 96; /* 9600 baud / 10 bits/char / 10Hz */
dtrdsr = 0; /* No dtr/dsr flow control */
if (options != NULL)
@@ -255,7 +255,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Set the baud rate...
*/
bufsize = atoi(value) / 20;
bufsize = atoi(value) / 100;
#if B19200 == 19200
cfsetispeed(&opts, atoi(value));
@@ -378,6 +378,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
tcsetattr(fd, TCSANOW, &opts);
fcntl(fd, F_SETFL, 0);
/*
* Now that we are "connected" to the port, ignore SIGTERM so that we
@@ -480,7 +481,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
/*
* Close the socket connection and input file and return...
* Close the serial port and input file and return...
*/
close(fd);
+3 -1
Ver Arquivo
@@ -146,7 +146,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Then try to connect to the remote host...
*/
if ((hostaddr = gethostbyname(hostname)) == NULL)
if ((hostaddr = httpGetHostByName(hostname)) == NULL)
{
fprintf(stderr, "ERROR: Unable to locate printer \'%s\' - %s\n",
hostname, strerror(errno));
@@ -336,6 +336,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (fp != stdin)
fclose(fp);
fputs("INFO: Ready to print.\n", stderr);
return (0);
}
+4
Ver Arquivo
@@ -0,0 +1,4 @@
lpc
lpq
lpr
lprm
+3 -1
Ver Arquivo
@@ -49,7 +49,9 @@ clean:
install:
$(INSTALL_DIR) $(BINDIR)
$(INSTALL_BIN) lpq lpr lprm $(BINDIR)
$(INSTALL_BIN) lpq $(BINDIR)
$(INSTALL_BIN) lpr $(BINDIR)
$(INSTALL_BIN) lprm $(BINDIR)
$(INSTALL_DIR) $(SBINDIR)
$(INSTALL_BIN) lpc $(SBINDIR)
+2
Ver Arquivo
@@ -72,7 +72,9 @@ main(int argc, /* I - Number of command-line arguments */
longstatus; /* Show file details */
int num_dests; /* Number of destinations */
cups_dest_t *dests; /* Destinations */
#ifdef HAVE_LIBSSL
http_encryption_t encryption; /* Encryption? */
#endif /* HAVE_LIBSSL */
/*
+1 -1
Ver Arquivo
@@ -366,7 +366,7 @@ main(int argc, /* I - Number of command-line arguments */
return (1);
}
while ((i = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
while ((i = read(0, buffer, sizeof(buffer))) > 0)
write(temp, buffer, i);
i = lseek(temp, 0, SEEK_CUR);
+5
Ver Arquivo
@@ -0,0 +1,5 @@
admin.cgi
classes.cgi
jobs.cgi
libcgi.a
printers.cgi
+3 -1
Ver Arquivo
@@ -51,7 +51,9 @@ clean:
install:
$(INSTALL_DIR) $(SERVERBIN)/cgi-bin
$(INSTALL_BIN) $(CGIS) $(SERVERBIN)/cgi-bin
for file in $(CGIS); do \
$(INSTALL_BIN) $$file $(SERVERBIN)/cgi-bin; \
done
#
+4 -2
Ver Arquivo
@@ -480,11 +480,13 @@ cgi_puts(const char *s,
{
while (*s)
{
if (s[0] == '<' && s[1] != '/' && !isalpha(s[1]))
if (s[0] == '<')
fputs("&lt;", out);
else if (s[0] == '>')
fputs("&gt;", out);
else if (*s == '\"')
fputs("&quot;", out);
else if (s[0] == '&' && isspace(s[1]))
else if (s[0] == '&')
fputs("&amp;", out);
else
putc(*s, out);
+35 -4
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: cupsd.conf 1779 2001-06-22 15:50:53Z mike $"
# "$Id: cupsd.conf 1891 2001-09-14 16:52:08Z mike $"
#
# Sample configuration file for the Common UNIX Printing System (CUPS)
# scheduler.
@@ -75,6 +75,7 @@
# Classification: the classification level of the server. If set, this
# classification is displayed on all pages, and raw printing is disabled.
# The default is the empty string.
#
#Classification classified
#Classification confidential
@@ -82,6 +83,17 @@
#Classification topsecret
#Classification unclassified
#
# ClassifyOverride: whether to allow users to override the classification
# on printouts. If enabled, users can limit banner pages to before or
# after the job, and can change the classification of a job, but cannot
# completely eliminate the classification or banners.
#
# The default is off.
#
#ClassifyOverride off
#
# DataDir: the root directory for the CUPS data files.
# By default /usr/share/cups.
@@ -184,10 +196,10 @@ LogLevel info
#
# MaxJobs: maximum number of jobs to keep in memory (active and completed.)
# Default is 0 (no limit.)
# Default is 500; the value 0 is used for no limit.
#
#MaxJobs 0
#MaxJobs 500
#
# Printcap: the name of the printcap file. Default is /etc/printcap.
@@ -370,6 +382,25 @@ Port 631
#Browsing On
#
# BrowseProtocols: which protocols to use for browsing. Can be
# any of the following separated by whitespace and/or commas:
#
# all - Use all supported protocols.
# cups - Use the CUPS browse protocol.
# slp - Use the SLPv2 protocol.
#
# The default is "cups".
#
# NOTE: If you choose to use SLPv2, it is *strongly* recommended that
# you have at least one SLP Directory Agent (DA) on your
# network. Otherwise, browse updates can take several seconds,
# during which the scheduler will not response to client
# requests.
#
#BrowseProtocols cups
#
# BrowseAddress: specifies a broadcast address to be used. By
# default browsing information is not sent!
@@ -665,5 +696,5 @@ Allow From 127.0.0.1
</Location>
#
# End of "$Id: cupsd.conf 1779 2001-06-22 15:50:53Z mike $".
# End of "$Id: cupsd.conf 1891 2001-09-14 16:52:08Z mike $".
#
+34 -12
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-common.m4 1811 2001-06-29 14:19:09Z mike $"
dnl "$Id: cups-common.m4 1939 2001-11-02 17:34:55Z mike $"
dnl
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -35,18 +35,22 @@ AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
if test "$INSTALL" = "$ac_install_sh"; then
# Use full path to install-sh script...
INSTALL="`pwd`/install-sh -c"
fi
AC_PROG_RANLIB
AC_PATH_PROG(AR,ar)
AC_PATH_PROG(HTMLDOC,htmldoc)
AC_PATH_PROG(MV,mv)
AC_PATH_PROG(NROFF,nroff)
if test "$NROFF" = ""; then
AC_PATH_PROG(GROFF,groff)
if test "$GROFF" = ""; then
NROFF="echo"
else
NROFF="$GROFF -T ascii"
fi
AC_PATH_PROG(GROFF,groff)
if test "$GROFF" = ""; then
NROFF="echo"
else
NROFF="$GROFF -T ascii"
fi
fi
AC_PATH_PROG(RM,rm)
AC_PATH_PROG(SED,sed)
@@ -79,8 +83,6 @@ AC_HEADER_DIRENT
AC_CHECK_HEADER(crypt.h,AC_DEFINE(HAVE_CRYPT_H))
AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H))
AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
AC_CHECK_HEADER(stddef.h,AC_DEFINE(HAVE_STDDEF_H))
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
@@ -110,8 +112,8 @@ case "$uname" in
;;
esac
dnl Checks for mkstemp function.
AC_CHECK_FUNCS(mkstemp)
dnl Checks for mkstemp and mkstemps functions.
AC_CHECK_FUNCS(mkstemp mkstemps)
dnl Checks for vsyslog function.
AC_CHECK_FUNCS(vsyslog)
@@ -127,6 +129,26 @@ dnl Checks for wait functions.
AC_CHECK_FUNCS(waitpid)
AC_CHECK_FUNCS(wait3)
dnl See if the tm structure has the tm_gmtoff member...
AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
AC_TRY_COMPILE([#include <time.h>],[struct tm t;
int o = t.tm_gmtoff;],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_TM_GMTOFF),
AC_MSG_RESULT(no))
dnl Flags for "ar" command...
case $uname in
Darwin* | *BSD*)
ARFLAGS="-rcv"
;;
*)
ARFLAGS="crvs"
;;
esac
AC_SUBST(ARFLAGS)
dnl
dnl End of "$Id: cups-common.m4 1811 2001-06-29 14:19:09Z mike $".
dnl End of "$Id: cups-common.m4 1939 2001-11-02 17:34:55Z mike $".
dnl
+37 -3
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-compiler.m4 1823 2001-07-03 17:07:29Z mike $"
dnl "$Id: cups-compiler.m4 1939 2001-11-02 17:34:55Z mike $"
dnl
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -27,13 +27,36 @@ dnl for them...
OPTIM=""
AC_SUBST(OPTIM)
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],
[if test x$enable_debug = xyes; then
OPTIM="-g"
fi])
dnl Update compiler options...
if test -n "$GCC"; then
# Starting with GCC 3.0, you must link C++ programs against either
# libstdc++ (shared by default), or libsupc++ (always static). If
# you care about binary portability between Linux distributions,
# you need to either 1) build your own GCC with static C++ libraries
# or 2) link using gcc and libsupc++. We choose the latter since
# CUPS doesn't (currently) use any of the stdc++ library.
#
# Also, GCC 3.0.x still has problems compiling some code. You may
# or may not have success with it. USE 3.0.x WITH EXTREME CAUTION!
#
# Previous versions of GCC do not have the reliance on the stdc++
# or g++ libraries, so the extra supc++ library is not needed.
case "`$CXX --version`" in
3*)
AC_MSG_WARN(GCC 3.0.x is known to produce incorrect code - use with caution!)
LIBS="$LIBS -lsupc++"
;;
3.1*)
LIBS="$LIBS -lsupc++"
;;
esac
CXX="$CC"
if test -z "$OPTIM"; then
@@ -44,9 +67,11 @@ if test -n "$GCC"; then
OPTIM="-O2"
fi
fi
if test $PICFLAG = 1 -a $uname != AIX; then
OPTIM="-fPIC $OPTIM"
fi
OPTIM="-Wall $OPTIM"
else
case $uname in
@@ -113,6 +138,15 @@ else
esac
fi
case $uname in
Darwin* | *BSD)
ARFLAGS="-rcv"
;;
*)
ARFLAGS="crvs"
;;
esac
dnl
dnl End of "$Id: cups-compiler.m4 1823 2001-07-03 17:07:29Z mike $".
dnl End of "$Id: cups-compiler.m4 1939 2001-11-02 17:34:55Z mike $".
dnl
+15 -9
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-directories.m4 1794 2001-06-27 19:06:46Z mike $"
dnl "$Id: cups-directories.m4 1939 2001-11-02 17:34:55Z mike $"
dnl
dnl Directory stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -24,10 +24,10 @@ dnl
AC_PREFIX_DEFAULT(/)
AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
dnl Fix "prefix" variable if it hasn't been specified...
if test "$prefix" = "NONE"; then
@@ -105,6 +105,12 @@ if test x$rcdir = x; then
INITDDIR="/etc/rc.d"
;;
Darwin*)
# Darwin and MacOS X - this is just strange...
INITDIR=""
INITDDIR="/System/Library/StartupItems/CUPS"
;;
Linux*)
# Linux seems to choose an init.d directory at random...
if test -d /sbin/init.d; then
@@ -165,8 +171,8 @@ fi
dnl See what directory to put server executables...
case "$uname" in
FreeBSD* | NetBSD* | OpenBSD*)
# *BSD
*BSD* | Darwin*)
# *BSD and Darwin (MacOS X)
INSTALL_SYSV=""
CUPS_SERVERBIN='${exec_prefix}/libexec/cups'
AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$exec_prefix/libexec/cups")
@@ -187,7 +193,7 @@ AC_SUBST(CUPS_REQUESTS)
dnl Set the CUPS_LOCALE directory...
case "$uname" in
Linux* | FreeBSD* | NetBSD* | OpenBSD*)
Linux* | *BSD* | Darwin*)
CUPS_LOCALEDIR='${datadir}/locale'
AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$datadir/locale")
;;
@@ -226,5 +232,5 @@ dnl Set the CUPS_FONTPATH directory...
AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$fontpath")
dnl
dnl End of "$Id: cups-directories.m4 1794 2001-06-27 19:06:46Z mike $".
dnl End of "$Id: cups-directories.m4 1939 2001-11-02 17:34:55Z mike $".
dnl
+4 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-image.m4 1794 2001-06-27 19:06:46Z mike $"
dnl "$Id: cups-image.m4 1912 2001-10-04 16:50:18Z mike $"
dnl
dnl Image library stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -65,6 +65,8 @@ AC_CHECK_HEADER(tiff.h,
dnl Restore original LIBS settings...
LIBS="$SAVELIBS"
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
dnl
dnl End of "$Id: cups-image.m4 1794 2001-06-27 19:06:46Z mike $".
dnl End of "$Id: cups-image.m4 1912 2001-10-04 16:50:18Z mike $".
dnl
+5 -6
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-libtool.m4 1794 2001-06-27 19:06:46Z mike $"
dnl "$Id: cups-libtool.m4 1880 2001-08-06 19:37:10Z mike $"
dnl
dnl Libtool stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -24,8 +24,8 @@ dnl
AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported=LIBTOOL_PATH
turn on building with libtool (UNSUPPORTED!) [default=no]],
[if test x$enable_libtool != xno; then
LIBTOOL="$enable_libtool"
[if test x$enable_libtool_unsupported != xno; then
LIBTOOL="$enable_libtool_unsupported"
enable_shared=no
echo "WARNING: libtool is not supported or endorsed by Easy Software Products."
echo " WE DO NOT PROVIDE TECHNICAL SUPPORT FOR LIBTOOL PROBLEMS."
@@ -41,10 +41,9 @@ if test x$LIBTOOL != x; then
LIBCUPSIMAGE="libcupsimage.la"
LINKCUPS="../cups/\$(LIBCUPS)"
LINKCUPSIMAGE="../filter/\$(LIBCUPSIMAGE)"
DSO=":"
DSOFLAGS=""
DSO="\$(CC)"
fi
dnl
dnl End of "$Id: cups-libtool.m4 1794 2001-06-27 19:06:46Z mike $".
dnl End of "$Id: cups-libtool.m4 1880 2001-08-06 19:37:10Z mike $".
dnl
+15 -5
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-manpages.m4 1813 2001-06-29 19:14:56Z mike $"
dnl "$Id: cups-manpages.m4 1939 2001-11-02 17:34:55Z mike $"
dnl
dnl Manpage stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -25,33 +25,39 @@ dnl
dnl Fix "mandir" variable...
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
case "$uname" in
FreeBSD* | NetBSD* | OpenBSD* | AIX*)
# *BSD + AIX
Darwin* | Linux* | *BSD* | AIX*)
# Darwin, MacOS X, Linux, *BSD, and AIX
mandir="/usr/share/man"
AMANDIR="/usr/share/man"
PMANDIR="/usr/share/man"
;;
IRIX*)
# SGI IRIX
mandir="/usr/share/catman/u_man"
AMANDIR="/usr/share/catman/a_man"
PMANDIR="/usr/share/catman/p_man"
;;
*)
# All others
mandir="/usr/man"
AMANDIR="/usr/man"
PMANDIR="/usr/man"
;;
esac
else
AMANDIR="$mandir"
PMANDIR="$mandir"
fi
AC_SUBST(AMANDIR)
AC_SUBST(PMANDIR)
dnl Setup manpage extensions...
case "$uname" in
FreeBSD* | NetBSD* | OpenBSD*)
*BSD* | Darwin*)
# *BSD
CAT1EXT=0
CAT3EXT=0
CAT5EXT=0
CAT8EXT=0
MAN8EXT=8
@@ -60,6 +66,7 @@ case "$uname" in
IRIX*)
# SGI IRIX
CAT1EXT=z
CAT3EXT=z
CAT5EXT=z
CAT8EXT=z
MAN8EXT=1m
@@ -68,6 +75,7 @@ case "$uname" in
SunOS* | HP-UX*)
# Solaris and HP-UX
CAT1EXT=1
CAT3EXT=3
CAT5EXT=5
CAT8EXT=1m
MAN8EXT=1m
@@ -76,6 +84,7 @@ case "$uname" in
*)
# All others
CAT1EXT=1
CAT3EXT=3
CAT5EXT=5
CAT8EXT=8
MAN8EXT=8
@@ -84,11 +93,12 @@ case "$uname" in
esac
AC_SUBST(CAT1EXT)
AC_SUBST(CAT3EXT)
AC_SUBST(CAT5EXT)
AC_SUBST(CAT8EXT)
AC_SUBST(MAN8EXT)
AC_SUBST(MAN8DIR)
dnl
dnl End of "$Id: cups-manpages.m4 1813 2001-06-29 19:14:56Z mike $".
dnl End of "$Id: cups-manpages.m4 1939 2001-11-02 17:34:55Z mike $".
dnl
+47
Ver Arquivo
@@ -0,0 +1,47 @@
dnl
dnl "$Id: cups-openslp.m4 1870 2001-07-24 20:23:03Z mike $"
dnl
dnl OpenSLP configuration stuff for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2001 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
dnl copyright law. Distribution and use rights are outlined in the file
dnl "LICENSE.txt" which should have been included with this file. If this
dnl file is missing or damaged please contact Easy Software Products
dnl at:
dnl
dnl Attn: CUPS Licensing Information
dnl Easy Software Products
dnl 44141 Airport View Drive, Suite 204
dnl Hollywood, Maryland 20636-3111 USA
dnl
dnl Voice: (301) 373-9603
dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl
AC_ARG_ENABLE(slp, [ --enable-slp turn on SLP support [default=yes]])
AC_ARG_WITH(openslp-libs, [ --with-openslp-libs set directory for OpenSLP library],
LDFLAGS="-L$withval $LDFLAGS"
DSOFLAGS="-L$withval $DSOFLAGS",)
AC_ARG_WITH(openslp-includes, [ --with-openslp-includes set directory for OpenSLP includes],
CFLAGS="-I$withval $CFLAGS"
CXXFLAGS="-I$withval $CXXFLAGS",)
LIBSLP=""
if test x$enable_slp != xno; then
AC_CHECK_HEADER(slp.h,
AC_CHECK_LIB(slp, SLPOpen,
AC_DEFINE(HAVE_LIBSLP)
LIBSLP="-lslp"))
fi
AC_SUBST(LIBSLP)
dnl
dnl End of "$Id: cups-openslp.m4 1870 2001-07-24 20:23:03Z mike $".
dnl
+32 -29
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-openssl.m4 1794 2001-06-27 19:06:46Z mike $"
dnl "$Id: cups-openssl.m4 1870 2001-07-24 20:23:03Z mike $"
dnl
dnl OpenSSL stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -22,45 +22,48 @@ dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl
AC_ARG_ENABLE(ssl, [ --enable-ssl turn on SSL/TLS support [default=yes]])
AC_ARG_WITH(openssl-libs, [ --with-openssl-libs set directory for OpenSSL library],
AC_ARG_ENABLE(ssl, [ --enable-ssl turn on SSL/TLS support [default=yes]])
AC_ARG_WITH(openssl-libs, [ --with-openssl-libs set directory for OpenSSL library],
LDFLAGS="-L$withval $LDFLAGS"
DSOFLAGS="-L$withval $DSOFLAGS",)
AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenSSL includes],
AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenSSL includes],
CFLAGS="-I$withval $CFLAGS"
CXXFLAGS="-I$withval $CXXFLAGS",)
dnl Save the current libraries so the crypto stuff isn't always
dnl included...
SAVELIBS="$LIBS"
dnl Some ELF systems can't resolve all the symbols in libcrypto
dnl if libcrypto was linked against RSAREF, and fail to link the
dnl test program correctly, even though a correct installation
dnl of OpenSSL exists. So we test the linking three times in
dnl case the RSAREF libraries are needed.
SSLLIBS=""
for libcrypto in \
"-lcrypto" \
"-lcrypto -lrsaref" \
"-lcrypto -lRSAglue -lrsaref"
do
AC_CHECK_LIB(ssl,SSL_new,
[SSLLIBS="-lssl $libcrypto"
AC_DEFINE(HAVE_LIBSSL)],,
$libcrypto)
if test x$enable_ssl != xno; then
AC_CHECK_HEADER(openssl/ssl.h,
dnl Save the current libraries so the crypto stuff isn't always
dnl included...
SAVELIBS="$LIBS"
if test "x${SSLLIBS}" != "x"; then
break
fi
done
dnl Some ELF systems can't resolve all the symbols in libcrypto
dnl if libcrypto was linked against RSAREF, and fail to link the
dnl test program correctly, even though a correct installation
dnl of OpenSSL exists. So we test the linking three times in
dnl case the RSAREF libraries are needed.
LIBS="$SAVELIBS"
for libcrypto in \
"-lcrypto" \
"-lcrypto -lrsaref" \
"-lcrypto -lRSAglue -lrsaref"
do
AC_CHECK_LIB(ssl,SSL_new,
[SSLLIBS="-lssl $libcrypto"
AC_DEFINE(HAVE_LIBSSL)],,
$libcrypto)
if test "x${SSLLIBS}" != "x"; then
break
fi
done
LIBS="$SAVELIBS")
fi
AC_SUBST(SSLLIBS)
dnl
dnl End of "$Id: cups-openssl.m4 1794 2001-06-27 19:06:46Z mike $".
dnl End of "$Id: cups-openssl.m4 1870 2001-07-24 20:23:03Z mike $".
dnl
+6 -6
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-opsys.m4 1823 2001-07-03 17:07:29Z mike $"
dnl "$Id: cups-opsys.m4 1870 2001-07-24 20:23:03Z mike $"
dnl
dnl Operating system stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -30,7 +30,7 @@ if test x$uname = xIRIX64; then
fi
dnl Determine the correct username and group for this OS...
AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS],
AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS],
CUPS_USER="$withval",
AC_MSG_CHECKING(for default print user)
if test -f /etc/passwd; then
@@ -52,7 +52,7 @@ AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS],
AC_MSG_RESULT(no password file, using "$CUPS_USER")
fi)
AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS],
AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS],
CUPS_GROUP="$withval",
AC_MSG_CHECKING(for default print group)
if test -f /etc/group; then
@@ -77,9 +77,9 @@ AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS],
AC_SUBST(CUPS_USER)
AC_SUBST(CUPS_GROUP)
AC_DEFINE(CUPS_DEFAULT_USER, "$CUPS_USER")
AC_DEFINE(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER")
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
dnl
dnl "$Id: cups-opsys.m4 1823 2001-07-03 17:07:29Z mike $"
dnl "$Id: cups-opsys.m4 1870 2001-07-24 20:23:03Z mike $"
dnl
+3 -3
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-pam.m4 1794 2001-06-27 19:06:46Z mike $"
dnl "$Id: cups-pam.m4 1870 2001-07-24 20:23:03Z mike $"
dnl
dnl PAM stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -22,7 +22,7 @@ dnl EMail: cups-info@cups.org
dnl WWW: http://www.cups.org
dnl
AC_ARG_ENABLE(pam, [ --enable-pam turn on PAM support [default=yes]])
AC_ARG_ENABLE(pam, [ --enable-pam turn on PAM support [default=yes]])
dnl Don't use PAM with AIX...
if test $uname = AIX; then
@@ -55,5 +55,5 @@ AC_SUBST(PAMDIR)
AC_SUBST(PAMLIBS)
dnl
dnl End of "$Id: cups-pam.m4 1794 2001-06-27 19:06:46Z mike $".
dnl End of "$Id: cups-pam.m4 1870 2001-07-24 20:23:03Z mike $".
dnl
+20 -11
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-sharedlibs.m4 1810 2001-06-29 14:01:15Z mike $"
dnl "$Id: cups-sharedlibs.m4 1924 2001-10-26 03:16:48Z mike $"
dnl
dnl Shared library support for the Common UNIX Printing System (CUPS).
dnl
@@ -25,7 +25,7 @@ dnl
PICFLAG=1
DSOFLAGS="${DSOFLAGS:=}"
AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=yes]])
AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=yes]])
if test x$enable_shared != xno; then
case "$uname" in
@@ -47,6 +47,12 @@ if test x$enable_shared != xno; then
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
;;
Darwin*)
LIBCUPS="libcups.2.dylib"
LIBCUPSIMAGE="libcupsimage.2.dylib"
DSO="ld"
DSOFLAGS="$DSOFLAGS -dylib /usr/lib/dylib1.o -lc"
;;
AIX*)
LIBCUPS="libcups_s.a"
LIBCUPSIMAGE="libcupsimage_s.a"
@@ -74,20 +80,18 @@ AC_SUBST(DSOFLAGS)
AC_SUBST(LIBCUPS)
AC_SUBST(LIBCUPSIMAGE)
LDFLAGS="-L../cups -L../filter $LDFLAGS"
if test x$enable_shared = xno; then
LINKCUPS="-lcups"
LINKCUPSIMAGE="-lcupsimage"
LINKCUPS="-L../cups -lcups"
LINKCUPSIMAGE="-L../filter -lcupsimage"
LINKCUPS="$LINKCUPS \$(SSLLIBS)"
else
if test $uname = AIX; then
LINKCUPS="-lcups_s"
LINKCUPSIMAGE="-lcupsimage_s"
LINKCUPS="-L../cups -lcups_s"
LINKCUPSIMAGE="-L../filter -lcupsimage_s"
else
LINKCUPS="-lcups"
LINKCUPSIMAGE="-lcupsimage"
LINKCUPS="-L../cups -lcups"
LINKCUPSIMAGE="-L../filter -lcupsimage"
fi
fi
@@ -122,6 +126,11 @@ if test "$DSO" != ":"; then
DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -Wl,-R$libdir"
;;
Linux*)
# Linux
DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
;;
esac
else
DSOLIBS=""
@@ -132,5 +141,5 @@ AC_SUBST(DSOLIBS)
AC_SUBST(IMGLIBS)
dnl
dnl End of "$Id: cups-sharedlibs.m4 1810 2001-06-29 14:01:15Z mike $".
dnl End of "$Id: cups-sharedlibs.m4 1924 2001-10-26 03:16:48Z mike $".
dnl
+17 -2
Ver Arquivo
@@ -28,7 +28,7 @@
* Version of software...
*/
#define CUPS_SVERSION "CUPS v1.1.9"
#define CUPS_SVERSION "CUPS v1.1.12"
/*
@@ -173,6 +173,13 @@
#undef HAVE_LIBSSL
/*
* Do we have the OpenSLP library?
*/
#undef HAVE_LIBSLP
/*
* Do we have <sys/ioctl.h>?
*/
@@ -181,10 +188,18 @@
/*
* Do we have mkstemp()?
* Do we have mkstemp() and/or mkstemps()?
*/
#undef HAVE_MKSTEMP
#undef HAVE_MKSTEMPS
/*
* Does the "tm" structure contain the "tm_gmtoff" member?
*/
#undef HAVE_TM_GMTOFF
/*
+4 -1
Ver Arquivo
@@ -35,10 +35,13 @@ sinclude(config-scripts/cups-compiler.m4)
sinclude(config-scripts/cups-image.m4)
sinclude(config-scripts/cups-network.m4)
sinclude(config-scripts/cups-openslp.m4)
sinclude(config-scripts/cups-openssl.m4)
sinclude(config-scripts/cups-pam.m4)
AC_OUTPUT(Makedefs cups.list cups.sh)
AC_OUTPUT(Makedefs cups.list cups.sh cups-config)
chmod +x cups-config
dnl
dnl End of "$Id$".
Arquivo executável
+133
Ver Arquivo
@@ -0,0 +1,133 @@
#! /bin/sh
#
# "$Id$"
#
# CUPS configuration utility.
#
# Copyright 2001 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
# copyright law. Distribution and use rights are outlined in the file
# "LICENSE.txt" which should have been included with this file. If this
# file is missing or damaged please contact Easy Software Products
# at:
#
# Attn: CUPS Licensing Information
# Easy Software Products
# 44141 Airport View Drive, Suite 204
# Hollywood, Maryland 20636-3111 USA
#
# Voice: (301) 373-9603
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
#
VERSION="1.1.11-1"
APIVERSION="1.1"
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
includedir=@includedir@
libdir=@libdir@
datadir=@datadir@
sysconfdir=@sysconfdir@
cups_datadir=@CUPS_DATADIR@
cups_serverbin=@CUPS_SERVERBIN@
cups_serverroot=@CUPS_SERVERROOT@
# flags for C++ compiler:
CFLAGS="@CFLAGS@"
LDFLAGS="@LDFLAGS@"
LIBS="@SSLLIBS@ @NETLIBS@ @LIBS@"
if test $includedir != /usr/include; then
CFLAGS="$CFLAGS -I$includedir"
fi
if test $libdir != /usr/lib -a $libdir != /usr/lib32; then
LDFLAGS="$LDFLAGS -L$libdir"
fi
usage ()
{
echo "Usage: cups-config --api-version"
echo " cups-config --cflags"
echo " cups-config --datadir"
echo " cups-config --help"
echo " cups-config --ldflags"
echo " cups-config [--image] [--static] --libs"
echo " cups-config --serverbin"
echo " cups-config --serverroot"
echo " cups-config --version"
exit $1
}
if test $# -eq 0; then
usage 1
fi
# Parse command line options
static=no
image=no
while test $# -gt 0; do
case $1 in
--api-version)
echo $APIVERSION
;;
--cflags)
echo $CFLAGS
;;
--datadir)
echo $cups_datadir
;;
--help)
usage 0
;;
--image)
image=yes
;;
--ldflags)
echo $LDFLAGS
;;
--libs)
if test $static = no; then
if test $image = no; then
echo -lcups $LIBS
else
echo -lcupsimage -lcups $LIBS
fi
else
if test $image = no; then
echo $libdir/libcups.a $LIBS
else
echo $libdir/libcupsimage.a $libdir/libcups.a $LIBS
fi
fi
;;
--serverbin)
echo $cups_serverbin
;;
--serverroot)
echo $cups_serverroot
;;
--static)
static=yes
;;
--version)
echo $VERSION
;;
*)
usage 1
;;
esac
shift
done
#
# End of "$Id$".
#
+368
Ver Arquivo
@@ -0,0 +1,368 @@
#
# "$Id$"
#
# ESP Package Manager (EPM) file list for the Common UNIX Printing
# System (CUPS).
#
# Copyright 1997-2001 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
# copyright law. Distribution and use rights are outlined in the file
# "LICENSE.txt" which should have been included with this file. If this
# file is missing or damaged please contact Easy Software Products
# at:
#
# Attn: CUPS Licensing Information
# Easy Software Products
# 44141 Airport View Drive, Suite 204
# Hollywood, Maryland 20636-3111 USA
#
# Voice: (301) 373-9603
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
#
# Product information
%product Common UNIX Printing System
%copyright 1993-2001 by Easy Software Products, All Rights Reserved.
%vendor Easy Software Products
%license LICENSE.txt
%readme README.txt
%version 1.1.12
%provides cups
%provides cupsys
%provides cups-devel
%provides cupsys-devel
%provides cups-pstoraster
%provides libcups1
%provides libcups.so.2
#
# GNU variables...
#
$prefix=@prefix@
$exec_prefix=@exec_prefix@
$bindir=@bindir@
$datadir=@datadir@
$includedir=@includedir@
$infodir=@infodir@
$libdir=@libdir@
$libexecdir=@libexecdir@
$localstatedir=@localstatedir@
$mandir=@mandir@
$oldincludedir=@oldincludedir@
$sbindir=@sbindir@
$sharedstatedir=@sharedstatedir@
$srcdir=@srcdir@
$sysconfdir=@sysconfdir@
$top_srcdir=@top_srcdir@
#
# ESP variables...
#
$AMANDIR=@AMANDIR@
$BINDIR=@bindir@
$DATADIR=@CUPS_DATADIR@
$DOCDIR=@CUPS_DOCROOT@
$INCLUDEDIR=${includedir}
$INITDIR=@INITDIR@
$INITDDIR=@INITDDIR@
$LIBDIR=${libdir}
$LOCALEDIR=@CUPS_LOCALEDIR@
$LOGDIR=@CUPS_LOGDIR@
$MANDIR=@mandir@
$PAMDIR=@PAMDIR@
$PMANDIR=@PMANDIR@
$REQUESTS=@CUPS_REQUESTS@
$SBINDIR=@sbindir@
$SERVERBIN=@CUPS_SERVERBIN@
$SERVERROOT=@CUPS_SERVERROOT@
$CUPS_USER=@CUPS_USER@
$CAT1EXT=@CAT1EXT@
$CAT3EXT=@CAT3EXT@
$CAT5EXT=@CAT5EXT@
$CAT8EXT=@CAT8EXT@
$MAN8EXT=@MAN8EXT@
$MAN8DIR=@MAN8DIR@
# Make sure the MD5 password file is now owned by CUPS_USER...
%postinstall if test -f $SERVERROOT/passwd.md5; then
%postinstall chown $CUPS_USER $SERVERROOT/passwd.md5
%postinstall fi
# Server programs
%system all
# Server files
f 0555 root sys $SBINDIR/cupsd scheduler/cupsd
d 0555 root sys $SERVERBIN -
d 0555 root sys $SERVERBIN/backend -
f 0555 root sys $SERVERBIN/backend/ipp backend/ipp
l 0555 root sys $SERVERBIN/backend/http ipp
f 0555 root sys $SERVERBIN/backend/lpd backend/lpd
f 0555 root sys $SERVERBIN/backend/parallel backend/parallel
f 0555 root sys $SERVERBIN/backend/serial backend/serial
f 0555 root sys $SERVERBIN/backend/socket backend/socket
f 0555 root sys $SERVERBIN/backend/usb backend/usb
d 0555 root sys $SERVERBIN/cgi-bin -
f 0555 root sys $SERVERBIN/cgi-bin/admin.cgi cgi-bin/admin.cgi
f 0555 root sys $SERVERBIN/cgi-bin/classes.cgi cgi-bin/classes.cgi
f 0555 root sys $SERVERBIN/cgi-bin/jobs.cgi cgi-bin/jobs.cgi
f 0555 root sys $SERVERBIN/cgi-bin/printers.cgi cgi-bin/printers.cgi
d 0555 root sys $SERVERBIN/daemon -
f 0555 root sys $SERVERBIN/daemon/cups-lpd scheduler/cups-lpd
f 0555 root sys $SERVERBIN/daemon/cups-polld scheduler/cups-polld
d 0555 root sys $SERVERBIN/filter -
f 0555 root sys $SERVERBIN/filter/pstoraster pstoraster/pstoraster
f 0555 root sys $SERVERBIN/filter/pdftops pdftops/pdftops
f 0555 root sys $SERVERBIN/filter/imagetops filter/imagetops
f 0555 root sys $SERVERBIN/filter/pstops filter/pstops
f 0555 root sys $SERVERBIN/filter/texttops filter/texttops
f 0555 root sys $SERVERBIN/filter/rastertoepson filter/rastertoepson
f 0555 root sys $SERVERBIN/filter/rastertohp filter/rastertohp
f 0555 root sys $SERVERBIN/filter/hpgltops filter/hpgltops
f 0555 root sys $SERVERBIN/filter/imagetoraster filter/imagetoraster
# Admin commands
l 0555 root sys $BINDIR/disable $SBINDIR/accept
l 0555 root sys $BINDIR/enable $SBINDIR/accept
l 0555 root sys $LIBDIR/accept $SBINDIR/accept
l 0555 root sys $LIBDIR/lpadmin $SBINDIR/lpadmin
l 0555 root sys $LIBDIR/reject accept
f 0555 root sys $SBINDIR/accept systemv/accept
f 0555 root sys $SBINDIR/cupsaddsmb systemv/cupsaddsmb
f 0555 root sys $SBINDIR/lpadmin systemv/lpadmin
f 0555 root sys $SBINDIR/lpc berkeley/lpc
f 0555 root sys $SBINDIR/lpinfo systemv/lpinfo
f 0555 root sys $SBINDIR/lpmove systemv/lpmove
l 0555 root sys $SBINDIR/reject accept
%system irix
l 0555 root sys /usr/etc/lpc $SBINDIR/lpc
%system all
# User commands
f 0555 root sys $BINDIR/cancel systemv/cancel
f 0555 root sys $BINDIR/lp systemv/lp
f 0555 root sys $BINDIR/lpoptions systemv/lpoptions
f 4555 $CUPS_USER sys $BINDIR/lppasswd systemv/lppasswd
f 0555 root sys $BINDIR/lpq berkeley/lpq
f 0555 root sys $BINDIR/lpr berkeley/lpr
f 0555 root sys $BINDIR/lprm berkeley/lprm
f 0555 root sys $BINDIR/lpstat systemv/lpstat
%system irix
l 0555 root sys /usr/bsd/lpq $BINDIR/lpq
l 0555 root sys /usr/bsd/lpr $BINDIR/lpr
l 0555 root sys /usr/bsd/lprm $BINDIR/lprm
%system all
# DSOs
%system hpux
f 0555 root sys $LIBDIR/libcups.sl.2 cups/libcups.sl.2
l 0555 root sys $LIBDIR/libcups.sl libcups.sl.2
f 0555 root sys $LIBDIR/libcupsimage.sl.2 filter/libcupsimage.sl.2
l 0555 root sys $LIBDIR/libcupsimage.sl libcupsimage.sl.2
%system aix
f 0555 root sys $LIBDIR/libcups_s.a cups/libcups_s.a
f 0555 root sys $LIBDIR/libcupsimage_s.a filter/libcupsimage_s.a
%system !hpux !aix
f 0555 root sys $LIBDIR/libcups.so.2 cups/libcups.so.2
l 0555 root sys $LIBDIR/libcups.so libcups.so.2
f 0555 root sys $LIBDIR/libcupsimage.so.2 filter/libcupsimage.so.2
l 0555 root sys $LIBDIR/libcupsimage.so libcupsimage.so.2
%system all
# Directories
d 0755 root sys $LOGDIR -
d 0700 $CUPS_USER sys $REQUESTS -
d 1700 $CUPS_USER sys $REQUESTS/tmp -
# Data files
f 0444 root sys $LOCALEDIR/C/cups_C locale/C/cups_C
f 0444 root sys $LOCALEDIR/de/cups_de locale/de/cups_de
f 0444 root sys $LOCALEDIR/en/cups_en locale/en/cups_en
f 0444 root sys $LOCALEDIR/es/cups_es locale/es/cups_es
f 0444 root sys $LOCALEDIR/fr/cups_fr locale/fr/cups_fr
f 0444 root sys $LOCALEDIR/it/cups_it locale/it/cups_it
d 0555 root sys $DATADIR -
d 0555 root sys $DATADIR/banners -
f 0444 root sys $DATADIR/banners/classified data/classified
f 0444 root sys $DATADIR/banners/confidential data/confidential
f 0444 root sys $DATADIR/banners/secret data/secret
f 0444 root sys $DATADIR/banners/standard data/standard
f 0444 root sys $DATADIR/banners/topsecret data/topsecret
f 0444 root sys $DATADIR/banners/unclassified data/unclassified
d 0555 root sys $DATADIR/charsets -
f 0444 root sys $DATADIR/charsets/windows-874 data/windows-874
f 0444 root sys $DATADIR/charsets/windows-1250 data/windows-1250
f 0444 root sys $DATADIR/charsets/windows-1251 data/windows-1251
f 0444 root sys $DATADIR/charsets/windows-1252 data/windows-1252
f 0444 root sys $DATADIR/charsets/windows-1253 data/windows-1253
f 0444 root sys $DATADIR/charsets/windows-1254 data/windows-1254
f 0444 root sys $DATADIR/charsets/windows-1255 data/windows-1255
f 0444 root sys $DATADIR/charsets/windows-1256 data/windows-1256
f 0444 root sys $DATADIR/charsets/windows-1257 data/windows-1257
f 0444 root sys $DATADIR/charsets/windows-1258 data/windows-1258
f 0444 root sys $DATADIR/charsets/iso-8859-1 data/iso-8859-1
f 0444 root sys $DATADIR/charsets/iso-8859-14 data/iso-8859-14
f 0444 root sys $DATADIR/charsets/iso-8859-15 data/iso-8859-15
f 0444 root sys $DATADIR/charsets/iso-8859-2 data/iso-8859-2
f 0444 root sys $DATADIR/charsets/iso-8859-3 data/iso-8859-3
f 0444 root sys $DATADIR/charsets/iso-8859-4 data/iso-8859-4
f 0444 root sys $DATADIR/charsets/iso-8859-5 data/iso-8859-5
f 0444 root sys $DATADIR/charsets/iso-8859-6 data/iso-8859-6
f 0444 root sys $DATADIR/charsets/iso-8859-7 data/iso-8859-7
f 0444 root sys $DATADIR/charsets/iso-8859-8 data/iso-8859-8
f 0444 root sys $DATADIR/charsets/iso-8859-9 data/iso-8859-9
f 0444 root sys $DATADIR/charsets/utf-8 data/utf-8
d 0555 root sys $DATADIR/data -
f 0444 root sys $DATADIR/data/HPGLprolog data/HPGLprolog
f 0444 root sys $DATADIR/data/psglyphs data/psglyphs
f 0444 root sys $DATADIR/data/testprint.ps data/testprint.ps
d 0555 root sys $DATADIR/fonts -
f 0444 root sys $DATADIR/fonts fonts/*
d 0555 root sys $DATADIR/pstoraster -
f 0444 root sys $DATADIR/pstoraster/Fontmap pstoraster/Fontmap
f 0444 root sys $DATADIR/pstoraster pstoraster/gs*.ps
d 0555 root sys $DATADIR/model -
f 0444 root sys $DATADIR/model ppd/*.ppd
d 0555 root sys $DATADIR/templates -
c 0444 root sys $DATADIR/templates templates/*.tmpl
# Config files
d 0555 root sys $SERVERROOT -
d 0711 root sys $SERVERROOT/certs -
d 0755 root sys $SERVERROOT/interfaces -
d 0755 root sys $SERVERROOT/ppd -
c 0644 root sys $SERVERROOT conf/*.conf
c 0644 root sys $SERVERROOT/mime.convs conf/mime.convs
c 0644 root sys $SERVERROOT/mime.types conf/mime.types
%system linux
d 0555 root sys $PAMDIR -
c 0644 root sys $PAMDIR/cups data/cups.pam
c 0644 root sys $PAMDIR/cups.suse data/cups.suse
%install if test -f /lib/security/pam_unix.so; then
%install mv $PAMDIR/cups.suse $PAMDIR/cups
%install fi
%system all
# Developer files
f 0555 root sys $BINDIR/cups-config cups-config
d 0555 root sys $INCLUDEDIR/cups -
f 0444 root sys $INCLUDEDIR/cups/cups.h cups/cups.h
f 0444 root sys $INCLUDEDIR/cups/http.h cups/http.h
f 0444 root sys $INCLUDEDIR/cups/image.h filter/image.h
f 0444 root sys $INCLUDEDIR/cups/ipp.h cups/ipp.h
f 0444 root sys $INCLUDEDIR/cups/language.h cups/language.h
f 0444 root sys $INCLUDEDIR/cups/md5.h cups/md5.h
f 0444 root sys $INCLUDEDIR/cups/ppd.h cups/ppd.h
f 0444 root sys $INCLUDEDIR/cups/raster.h filter/raster.h
f 0444 root sys $LIBDIR/libcups.a cups/libcups.a
# Documentation files
d 0555 root sys $DOCDIR -
f 0444 root sys $DOCDIR/cups.css doc/cups.css
f 0444 root sys $DOCDIR doc/*.html
f 0444 root sys $DOCDIR doc/*.pdf
d 0555 root sys $DOCDIR/images -
f 0444 root sys $DOCDIR/images doc/images/*.gif
# Man pages
d 0555 root sys $AMANDIR -
d 0555 root sys $AMANDIR/cat$MAN8DIR -
d 0555 root sys $AMANDIR/man$MAN8DIR -
d 0555 root sys $MANDIR -
d 0555 root sys $MANDIR/cat1 -
d 0555 root sys $PMANDIR/cat3 -
d 0555 root sys $MANDIR/cat5 -
d 0555 root sys $MANDIR/man1 -
d 0555 root sys $PMANDIR/man3 -
d 0555 root sys $MANDIR/man5 -
f 0444 root sys $MANDIR/cat1/backend.$CAT1EXT man/backend.$CAT1EXT
f 0444 root sys $MANDIR/cat1/filter.$CAT1EXT man/filter.$CAT1EXT
f 0444 root sys $MANDIR/cat1/lpoptions.$CAT1EXT man/lpoptions.$CAT1EXT
f 0444 root sys $MANDIR/cat1/lppasswd.$CAT1EXT man/lppasswd.$CAT1EXT
f 0444 root sys $MANDIR/cat1/lpq.$CAT1EXT man/lpq.$CAT1EXT
f 0444 root sys $MANDIR/cat1/lprm.$CAT1EXT man/lprm.$CAT1EXT
f 0444 root sys $MANDIR/cat1/lpr.$CAT1EXT man/lpr.$CAT1EXT
f 0444 root sys $MANDIR/cat1/lpstat.$CAT1EXT man/lpstat.$CAT1EXT
f 0444 root sys $MANDIR/cat1/lp.$CAT1EXT man/lp.$CAT1EXT
l 0444 root sys $MANDIR/cat1/cancel.$CAT1EXT lp.$CAT1EXT
f 0444 root sys $PMANDIR/cat3/cups-config.$CAT3EXT man/cups-config.$CAT3EXT
f 0444 root sys $MANDIR/cat5/classes.conf.$CAT5EXT man/classes.conf.$CAT5EXT
f 0444 root sys $MANDIR/cat5/cupsd.conf.$CAT5EXT man/cupsd.conf.$CAT5EXT
f 0444 root sys $MANDIR/cat5/mime.convs.$CAT5EXT man/mime.convs.$CAT5EXT
f 0444 root sys $MANDIR/cat5/mime.types.$CAT5EXT man/mime.types.$CAT5EXT
f 0444 root sys $MANDIR/cat5/printers.conf.$CAT5EXT man/printers.conf.$CAT5EXT
f 0444 root sys $AMANDIR/cat$MAN8DIR/accept.$CAT8EXT man/accept.$CAT8EXT
l 0444 root sys $AMANDIR/cat$MAN8DIR/reject.$CAT8EXT accept.$CAT8EXT
f 0444 root sys $AMANDIR/cat$MAN8DIR/cupsaddsmb.$CAT8EXT man/cupsaddsmb.$CAT8EXT
f 0444 root sys $AMANDIR/cat$MAN8DIR/cups-lpd.$CAT8EXT man/cups-lpd.$CAT8EXT
f 0444 root sys $AMANDIR/cat$MAN8DIR/cups-polld.$CAT8EXT man/cups-polld.$CAT8EXT
f 0444 root sys $AMANDIR/cat$MAN8DIR/cupsd.$CAT8EXT man/cupsd.$CAT8EXT
f 0444 root sys $AMANDIR/cat$MAN8DIR/enable.$CAT8EXT man/enable.$CAT8EXT
l 0444 root sys $AMANDIR/cat$MAN8DIR/disable.$CAT8EXT enable.$CAT8EXT
f 0444 root sys $AMANDIR/cat$MAN8DIR/lpadmin.$CAT8EXT man/lpadmin.$CAT8EXT
f 0444 root sys $AMANDIR/cat$MAN8DIR/lpc.$CAT8EXT man/lpc.$CAT8EXT
f 0444 root sys $AMANDIR/cat$MAN8DIR/lpinfo.$CAT8EXT man/lpinfo.$CAT8EXT
f 0444 root sys $AMANDIR/cat$MAN8DIR/lpmove.$CAT8EXT man/lpmove.$CAT8EXT
f 0444 root sys $MANDIR/man1/backend.$MAN1EXT man/backend.man
f 0444 root sys $MANDIR/man1/filter.$MAN1EXT man/filter.man
f 0444 root sys $MANDIR/man1/lpoptions.$MAN1EXT man/lpoptions.man
f 0444 root sys $MANDIR/man1/lppasswd.$MAN1EXT man/lppasswd.man
f 0444 root sys $MANDIR/man1/lpq.$MAN1EXT man/lpq.man
f 0444 root sys $MANDIR/man1/lprm.$MAN1EXT man/lprm.man
f 0444 root sys $MANDIR/man1/lpr.$MAN1EXT man/lpr.man
f 0444 root sys $MANDIR/man1/lpstat.$MAN1EXT man/lpstat.man
f 0444 root sys $MANDIR/man1/lp.$MAN1EXT man/lp.man
l 0444 root sys $MANDIR/man1/cancel.$MAN1EXT lp.man
f 0444 root sys $PMANDIR/man3/cups-config.$MAN3EXT man/cups-config.man
f 0444 root sys $MANDIR/man5/classes.conf.$MAN5EXT man/classes.conf.man
f 0444 root sys $MANDIR/man5/cupsd.conf.$MAN5EXT man/cupsd.conf.man
f 0444 root sys $MANDIR/man5/mime.convs.$MAN5EXT man/mime.convs.man
f 0444 root sys $MANDIR/man5/mime.types.$MAN5EXT man/mime.types.man
f 0444 root sys $MANDIR/man5/printers.conf.$MAN5EXT man/printers.conf.man
f 0444 root sys $AMANDIR/man$MAN8DIR/accept.$MAN8EXT man/accept.man
l 0444 root sys $AMANDIR/man$MAN8DIR/reject.$MAN8EXT accept.man
f 0444 root sys $AMANDIR/man$MAN8DIR/cupsaddsmb.$MAN8EXT man/cupsaddsmb.man
f 0444 root sys $AMANDIR/man$MAN8DIR/cups-lpd.$MAN8EXT man/cups-lpd.man
f 0444 root sys $AMANDIR/man$MAN8DIR/cups-polld.$MAN8EXT man/cups-polld.man
f 0444 root sys $AMANDIR/man$MAN8DIR/cupsd.$MAN8EXT man/cupsd.man
f 0444 root sys $AMANDIR/man$MAN8DIR/enable.$MAN8EXT man/enable.man
l 0444 root sys $AMANDIR/man$MAN8DIR/disable.$MAN8EXT enable.man
f 0444 root sys $AMANDIR/man$MAN8DIR/lpadmin.$MAN8EXT man/lpadmin.man
f 0444 root sys $AMANDIR/man$MAN8DIR/lpc.$MAN8EXT man/lpc.man
f 0444 root sys $AMANDIR/man$MAN8DIR/lpinfo.$MAN8EXT man/lpinfo.man
f 0444 root sys $AMANDIR/man$MAN8DIR/lpmove.$MAN8EXT man/lpmove.man
# Startup script
%system all
i 0555 root sys cups cups.sh
#
# End of "$Id$".
#
+11
Ver Arquivo
@@ -0,0 +1,11 @@
{
Description = "CUPS Printing";
Provides = ("CUPS");
Requires = ("Resolver");
OrderPreference = "None";
Messages =
{
start = "Starting CUPS";
stop = "Stopping CUPS";
};
}
+27 -9
Ver Arquivo
@@ -43,6 +43,7 @@
#### OS-Dependent Configuration
case "`uname`" in
IRIX*)
IS_ON=/sbin/chkconfig
@@ -52,6 +53,16 @@ case "`uname`" in
IS_ON=:
;;
Darwin*)
. /etc/rc.common
if test "${CUPS:=-YES-}" = "-NO-"; then
exit 0
fi
IS_ON=:
;;
*)
IS_ON=/bin/true
;;
@@ -65,10 +76,14 @@ esac
# all but IRIX, which can configure verbose bootup messages.
#
if $IS_ON verbose; then
ECHO=echo
if test "`uname`" = "Darwin"; then
ECHO=ConsoleMessage
else
ECHO=:
if $IS_ON verbose; then
ECHO=echo
else
ECHO=:
fi
fi
#
@@ -76,18 +91,21 @@ fi
#
case "`uname`" in
IRIX* | HP-UX* | SunOS* | AIX* | SINIX*)
pid=`ps -e | awk '{print $1,$4}' | grep cupsd | awk '{print $1}'`
IRIX* | HP-UX* | AIX* | SINIX*)
pid=`ps -e | awk '{if (match($4, ".*/cupsd$") || $4 == "cupsd") print $1}'`
;;
SunOS*)
pid=`ps -e | nawk '{if (match($4, ".*/cupsd$") || $4 == "cupsd") print $1}'`
;;
UnixWare*)
pid=`ps -e | awk '{print $1,$6}' | grep cupsd | awk '{print $1}'`
pid=`ps -e | awk '{if (match($6, ".*/cupsd$") || $6 == "cupsd") print $1}'`
. /etc/TIMEZONE
;;
OSF1*)
pid=`ps -e | awk '{print $1,$5}' | grep cupsd | awk '{print $1}'`
pid=`ps -e | awk '{if (match($5, ".*/cupsd$") || $5 == "cupsd") print $1}'`
;;
Linux* | NetBSD*)
pid=`ps ax | awk '{print $1,$5}' | grep cupsd | awk '{print $1}'`
Linux* | NetBSD* | Darwin*)
pid=`ps ax | awk '{if (match($5, ".*/cupsd$") || $5 == "cupsd") print $1}'`
;;
*)
pid=""
+33 -26
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: cups.spec 1824 2001-07-05 15:34:47Z mike $"
# "$Id: cups.spec 1949 2001-11-13 19:34:47Z mike $"
#
# RPM "spec" file for the Common UNIX Printing System (CUPS).
#
@@ -26,16 +26,19 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.1.9
Release: 1
Version: 1.1.12
Release: 0
Copyright: GPL
Group: System Environment/Daemons
Source: ftp://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.gz
Url: http://www.cups.org
Packager: Michael Sweet <mike@easysw.com>
Vendor: Easy Software Products
# use buildroot so as not to disturb the version already installed
# Use buildroot so as not to disturb the version already installed
BuildRoot: /var/tmp/%{name}-root
# Dependencies...
Conflicts: lpr, LPRng
Provides: libcups.so.2
Provides: libcupsimage.so.2
@@ -44,6 +47,7 @@ Provides: cups
%package devel
Summary: Common Unix Printing System - development environment
Group: Development/Libraries
Provides: libcups1
%package pstoraster
Summary: Common Unix Printing System - PostScript RIP
@@ -59,7 +63,7 @@ CUPS provides the System V and Berkeley command-line interfaces.
%description devel
The Common UNIX Printing System provides a portable printing layer for
UNIX® operating systems. This is the development package for creating
additional printer drivers, and other CUPS services.
additional printer drivers and other CUPS services.
%description pstoraster
The Common UNIX Printing System provides a portable printing layer for
@@ -70,7 +74,7 @@ supporting non-PostScript printer drivers.
%setup
%build
./configure
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_OPT_FLAGS" ./configure
# If we got this far, all prerequisite libraries must be here.
make
@@ -79,23 +83,7 @@ make
# Make sure the RPM_BUILD_ROOT directory exists.
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT \
exec_prefix=$RPM_BUILD_ROOT/usr \
AMANDIR=$RPM_BUILD_ROOT/usr/man \
BINDIR=$RPM_BUILD_ROOT/usr/bin \
DATADIR=$RPM_BUILD_ROOT/usr/share/cups \
DOCDIR=$RPM_BUILD_ROOT/usr/share/doc/cups \
INCLUDEDIR=$RPM_BUILD_ROOT/usr/include \
LIBDIR=$RPM_BUILD_ROOT/usr/lib \
LOGDIR=$RPM_BUILD_ROOT/var/log/cups \
LOCALEDIR=$RPM_BUILD_ROOT/usr/share/locale \
MANDIR=$RPM_BUILD_ROOT/usr/man \
PAMDIR=$RPM_BUILD_ROOT/etc/pam.d \
REQUESTS=$RPM_BUILD_ROOT/var/spool/cups \
SBINDIR=$RPM_BUILD_ROOT/usr/sbin \
SERVERBIN=$RPM_BUILD_ROOT/usr/lib/cups \
SERVERROOT=$RPM_BUILD_ROOT/etc/cups \
install
make BUILDROOT=$RPM_BUILD_ROOT install
%post
if test -x /sbin/chkconfig; then
@@ -163,7 +151,10 @@ rm -rf $RPM_BUILD_ROOT
#/sbin/rc.d/rc3.d/*
#/sbin/rc.d/rc5.d/*
/usr/bin/*
/usr/bin/cancel
/usr/bin/disable
/usr/bin/enable
/usr/bin/lp*
/usr/lib/*.so*
%dir /usr/lib/cups
%dir /usr/lib/cups/backend
@@ -181,7 +172,6 @@ rm -rf $RPM_BUILD_ROOT
/usr/lib/cups/filter/rastertoepson
/usr/lib/cups/filter/rastertohp
/usr/lib/cups/filter/texttops
/usr/man/*
/usr/sbin/*
%dir /usr/share/cups
%dir /usr/share/cups/banners
@@ -198,6 +188,19 @@ rm -rf $RPM_BUILD_ROOT
/usr/share/doc/cups/*
%dir /usr/share/locale
/usr/share/locale/*
%dir /usr/share/man/cat1
/usr/share/man/cat1/*
%dir /usr/share/man/cat5
/usr/share/man/cat5/*
%dir /usr/share/man/cat8
/usr/share/man/cat8/*
%dir /usr/share/man/man1
/usr/share/man/man1/*
%dir /usr/share/man/man5
/usr/share/man/man5/*
%dir /usr/share/man/man8
/usr/share/man/man8/*
%attr(0700,lp,root) %dir /var/spool/cups
%attr(1700,lp,root) %dir /var/spool/cups/tmp
@@ -205,6 +208,10 @@ rm -rf $RPM_BUILD_ROOT
%dir /usr/include/cups
/usr/include/cups/*
/usr/lib/*.a
%dir /usr/share/man/cat3
/usr/share/man/cat3/*
%dir /usr/share/man/man3
/usr/share/man/man1/*
%files pstoraster
%dir /usr/lib/cups/filter
@@ -215,5 +222,5 @@ rm -rf $RPM_BUILD_ROOT
/usr/share/cups/pstoraster/*
#
# End of "$Id: cups.spec 1824 2001-07-05 15:34:47Z mike $".
# End of "$Id: cups.spec 1949 2001-11-13 19:34:47Z mike $".
#
+9
Ver Arquivo
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>Starting CUPS</key>
<string>Starting CUPS</string>
</dict>
</plist>
+4
Ver Arquivo
@@ -0,0 +1,4 @@
libcups.a
libcups.sl.2
libcups.so.2
libcups_s.a
+27 -4
Ver Arquivo
@@ -69,11 +69,23 @@ clean:
install: all
$(INSTALL_DIR) $(INCLUDEDIR)/cups
$(INSTALL_DATA) $(HEADERS) $(INCLUDEDIR)/cups
for file in $(HEADERS); do \
$(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
done
$(INSTALL_DIR) $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
$(INSTALL_LIB) libcups.a `basename $(LIBCUPS) .2` $(LIBDIR); \
$(INSTALL_LIB) libcups.a $(LIBDIR); \
$(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
$(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
fi
if test $(LIBCUPS) = "libcups.2.dylib"; then \
$(INSTALL_LIB) libcups.a $(LIBDIR); \
$(RM) $(LIBDIR)/libcups.dylib; \
$(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
fi
if test $(LIBCUPS) = "libcups_s.a"; then \
$(INSTALL_LIB) libcups.a $(LIBDIR); \
fi
@@ -88,6 +100,17 @@ libcups.so.2 libcups.sl.2: $(LIBOBJS) ../Makedefs
$(LN) $@ `basename $@ .2`
#
# libcups.2.dylib
#
libcups.2.dylib: $(LIBOBJS) ../Makedefs
echo Linking $@...
$(DSO) $(DSOFLAGS) -o $@ $(LIBOBJS) $(SSLLIBS)
$(RM) libcups.dylib
$(LN) $@ libcups.dylib
#
# libcups_s.a
#
@@ -107,8 +130,8 @@ libcups_s.a: $(LIBOBJS) ../Makedefs
libcups.la: $(LIBOBJS) ../Makedefs
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
-version-info 2:3 $(SSLLIBS)
$(DSO) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
-version-info 2:4 $(SSLLIBS)
#
+1 -1
Ver Arquivo
@@ -46,7 +46,7 @@ extern "C" {
* Constants...
*/
# define CUPS_VERSION 1.0109
# define CUPS_VERSION 1.0111
# define CUPS_DATE_ANY -1
+29 -4
Ver Arquivo
@@ -253,6 +253,15 @@ cupsGetDests(cups_dest_t **dests) /* O - Destinations */
if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
dest->is_default = 1;
}
else
{
/*
* This initialization of "instance" is unnecessary, but avoids a
* compiler warning...
*/
instance = NULL;
}
/*
* Load the /etc/cups/lpoptions and ~/.lpoptions files...
@@ -272,6 +281,21 @@ cupsGetDests(cups_dest_t **dests) /* O - Destinations */
num_dests = cups_get_dests(filename, num_dests, dests);
}
/*
* Reset the default destination if the LPDEST or PRINTER environment
* variables are set...
*/
if (getenv("LPDEST") != NULL || getenv("PRINTER") != NULL)
{
/*
* Lookup the printer and instance and make it the default...
*/
if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
dest->is_default = 1;
}
/*
* Return the number of destinations...
*/
@@ -632,7 +656,7 @@ cups_get_sdests(ipp_op_t op, /* I - get-printers or get-classes */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]),
NULL, pattrs);
@@ -660,7 +684,7 @@ cups_get_sdests(ipp_op_t op, /* I - get-printers or get-classes */
name = NULL;
strcpy(job_sheets, "none,none");
strcpy(job_sheets, "");
while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
{
@@ -697,8 +721,9 @@ cups_get_sdests(ipp_op_t op, /* I - get-printers or get-classes */
num_dests = cupsAddDest(name, NULL, num_dests, dests);
if ((dest = cupsGetDest(name, NULL, num_dests, *dests)) != NULL)
dest->num_options = cupsAddOption("job-sheets", job_sheets, 0,
&(dest->options));
if (job_sheets[0])
dest->num_options = cupsAddOption("job-sheets", job_sheets, 0,
&(dest->options));
if (attr == NULL)
break;
+135 -9
Ver Arquivo
@@ -32,6 +32,8 @@
* httpConnectEncrypt() - Connect to a HTTP server using encryption.
* httpEncryption() - Set the required encryption on the link.
* httpReconnect() - Reconnect to a HTTP server...
* httpGetHostByName() - Lookup a hostname or IP address, and return
* address records for the specified name.
* httpSeparate() - Separate a Universal Resource Identifier into its
* components.
* httpGetSubField() - Get a sub-field value.
@@ -339,6 +341,7 @@ httpConnectEncrypt(const char *host, /* I - Host to connect to */
http_encryption_t encrypt)
/* I - Type of encryption to use */
{
int i; /* Looping var */
http_t *http; /* New HTTP connection */
struct hostent *hostaddr; /* Host address data */
@@ -352,7 +355,7 @@ httpConnectEncrypt(const char *host, /* I - Host to connect to */
* Lookup the host...
*/
if ((hostaddr = gethostbyname(host)) == NULL)
if ((hostaddr = httpGetHostByName(host)) == NULL)
{
/*
* This hack to make users that don't have a localhost entry in
@@ -361,7 +364,7 @@ httpConnectEncrypt(const char *host, /* I - Host to connect to */
if (strcasecmp(host, "localhost") != 0)
return (NULL);
else if ((hostaddr = gethostbyname("127.0.0.1")) == NULL)
else if ((hostaddr = httpGetHostByName("127.0.0.1")) == NULL)
return (NULL);
}
@@ -390,7 +393,6 @@ httpConnectEncrypt(const char *host, /* I - Host to connect to */
*/
strncpy(http->hostname, host, sizeof(http->hostname) - 1);
memcpy((char *)&(http->hostaddr.sin_addr), hostaddr->h_addr, hostaddr->h_length);
http->hostaddr.sin_family = hostaddr->h_addrtype;
#ifdef WIN32
http->hostaddr.sin_port = htons((u_short)port);
@@ -405,16 +407,34 @@ httpConnectEncrypt(const char *host, /* I - Host to connect to */
http->encryption = encrypt;
/*
* Connect to the remote system...
* Loop through the addresses we have until one of them connects...
*/
if (httpReconnect(http))
strncpy(http->hostname, host, sizeof(http->hostname) - 1);
for (i = 0; hostaddr->h_addr_list[i]; i ++)
{
free(http);
return (NULL);
/*
* Load the address...
*/
memcpy((char *)&(http->hostaddr.sin_addr), hostaddr->h_addr_list[i],
hostaddr->h_length);
/*
* Connect to the remote system...
*/
if (!httpReconnect(http))
return (http);
}
else
return (http);
/*
* Could not connect to any known address - bail out!
*/
free(http);
return (NULL);
}
@@ -583,6 +603,69 @@ httpReconnect(http_t *http) /* I - HTTP data */
}
/*
* 'httpGetHostByName()' - Lookup a hostname or IP address, and return
* address records for the specified name.
*/
struct hostent * /* O - Host entry */
httpGetHostByName(const char *name) /* I - Hostname or IP address */
{
unsigned ip[4]; /* IP address components */
static unsigned packed_ip; /* Packed IPv4 address */
static char *packed_ptr[2]; /* Pointer to packed address */
static struct hostent host_ip; /* Host entry for IP address */
/*
* This function is needed because some operating systems have a
* buggy implementation of httpGetHostByName() that does not support
* IP addresses. If the first character of the name string is a
* number, then sscanf() is used to extract the IP components.
* We then pack the components into an IPv4 address manually,
* since the inet_aton() function is deprecated. We use the
* htonl() macro to get the right byte order for the address.
*/
if (isdigit(name[0]))
{
/*
* We have an IP address; break it up and provide the host entry
* to the caller. Currently only supports IPv4 addresses, although
* it should be trivial to support IPv6 in CUPS 1.2.
*/
if (sscanf(name, "%u.%u.%u.%u", ip, ip + 1, ip + 2, ip + 3) != 4)
return (NULL); /* Must have 4 numbers */
packed_ip = htonl(((((((ip[0] << 8) | ip[1]) << 8) | ip[2]) << 8) | ip[3]));
/*
* Fill in the host entry and return it...
*/
host_ip.h_name = (char *)name;
host_ip.h_aliases = NULL;
host_ip.h_addrtype = AF_INET;
host_ip.h_length = 4;
host_ip.h_addr_list = packed_ptr;
packed_ptr[0] = (char *)(&packed_ip);
packed_ptr[1] = NULL;
return (&host_ip);
}
else
{
/*
* Use the gethostbyname() function to get the IP address for
* the name...
*/
return (gethostbyname(name));
}
}
/*
* 'httpSeparate()' - Separate a Universal Resource Identifier into its
* components.
@@ -1094,6 +1177,47 @@ httpRead(http_t *http, /* I - HTTP data */
else if (length > http->data_remaining)
length = http->data_remaining;
if (http->used == 0 && length <= 256)
{
/*
* Buffer small reads for better performance...
*/
if (http->data_remaining > sizeof(http->buffer))
bytes = sizeof(http->buffer);
else
bytes = http->data_remaining;
#ifdef HAVE_LIBSSL
if (http->tls)
bytes = SSL_read((SSL *)(http->tls), http->buffer, bytes);
else
#endif /* HAVE_LIBSSL */
{
DEBUG_printf(("httpRead: reading %d bytes from socket into buffer...\n",
bytes));
bytes = recv(http->fd, http->buffer, bytes, 0);
DEBUG_printf(("httpRead: read %d bytes from socket into buffer...\n",
bytes));
}
if (bytes > 0)
http->used = bytes;
else if (bytes < 0)
{
#if defined(WIN32) || defined(__EMX__)
http->error = WSAGetLastError();
#else
http->error = errno;
#endif /* WIN32 || __EMX__ */
return (-1);
}
else
return (0);
}
if (http->used > 0)
{
if (length > http->used)
@@ -1181,6 +1305,8 @@ httpWrite(http_t *http, /* I - HTTP data */
if (http->state == HTTP_POST_RECV)
http->state ++;
else if (http->state == HTTP_PUT_RECV)
http->state = HTTP_STATUS;
else
http->state = HTTP_WAITING;
+1
Ver Arquivo
@@ -301,6 +301,7 @@ extern char *httpGets(char *line, int length, http_t *http);
extern const char *httpGetDateString(time_t t);
extern time_t httpGetDateTime(const char *s);
# define httpGetField(http,field) (http)->fields[field]
extern struct hostent *httpGetHostByName(const char *name);
extern char *httpGetSubField(http_t *http, http_field_t field,
const char *name, char *value);
extern int httpHead(http_t *http, const char *uri);
+74 -9
Ver Arquivo
@@ -563,7 +563,7 @@ ippDelete(ipp_t *ipp) /* I - IPP request */
*next; /* Next attribute */
DEBUG_printf(("ippNew(): %p\n", ipp));
DEBUG_printf(("ippDelete(): %p\n", ipp));
if (ipp == NULL)
return;
@@ -1027,12 +1027,37 @@ ippRead(http_t *http, /* I - HTTP data */
return (IPP_ERROR);
/*
* Finally, make sure we don't have too many elements in the
* attribute array...
* Finally, reallocate the attribute array as needed...
*/
if (attr->num_values >= IPP_MAX_VALUES)
return (IPP_ERROR);
if ((attr->num_values % IPP_MAX_VALUES) == 0)
{
ipp_attribute_t *temp, /* Pointer to new buffer */
*ptr; /* Pointer in attribute list */
/*
* Reallocate memory...
*/
if ((temp = realloc(attr, sizeof(ipp_attribute_t) +
(attr->num_values + IPP_MAX_VALUES - 1) *
sizeof(ipp_value_t))) == NULL)
return (IPP_ERROR);
/*
* Reset pointers in the list...
*/
for (ptr = ipp->attrs; ptr && ptr->next != attr; ptr = ptr->next);
if (ptr)
ptr->next = temp;
else
ipp->attrs = temp;
attr = ipp->current = ipp->last = temp;
}
}
else
{
@@ -1099,7 +1124,9 @@ ippRead(http_t *http, /* I - HTTP data */
buffer[n] = '\0';
DEBUG_printf(("ippRead: value = \'%s\'\n", buffer));
attr->values[attr->num_values].string.text = strdup((char *)buffer);
attr->values[attr->num_values].string.text = malloc(n + 1);
memcpy(attr->values[attr->num_values].string.text,
buffer, n + 1);
break;
case IPP_TAG_DATE :
if (ipp_read(http, buffer, 11) < 11)
@@ -1162,7 +1189,6 @@ ippRead(http_t *http, /* I - HTTP data */
memcpy(attr->values[attr->num_values].string.text,
bufptr + 2, n);
break;
default : /* Other unsupported values */
@@ -1894,15 +1920,54 @@ ipp_read(http_t *http, /* I - Client connection */
{
int tbytes, /* Total bytes read */
bytes; /* Bytes read this pass */
char len[32]; /* Length string */
/*
* Loop until all bytes are read...
*/
for (tbytes = 0, bytes = 0; tbytes < length; tbytes += bytes, buffer += bytes)
if ((bytes = httpRead(http, (char *)buffer, length - tbytes)) <= 0)
{
if (http->used > 0)
{
/*
* Do "fast read" from HTTP buffer directly...
*/
if (http->used > (length - tbytes))
bytes = length - tbytes;
else
bytes = http->used;
if (bytes == 1)
buffer[0] = http->buffer[0];
else
memcpy(buffer, http->buffer, bytes);
http->used -= bytes;
http->data_remaining -= bytes;
if (http->used > 0)
memcpy(http->buffer, http->buffer + bytes, http->used);
if (http->data_remaining == 0)
{
if (http->data_encoding == HTTP_ENCODE_CHUNKED)
httpGets(len, sizeof(len), http);
if (http->data_encoding != HTTP_ENCODE_CHUNKED)
{
if (http->state == HTTP_POST_RECV)
http->state ++;
else
http->state = HTTP_WAITING;
}
}
}
else if ((bytes = httpRead(http, (char *)buffer, length - tbytes)) <= 0)
break;
}
/*
* Return the number of bytes read...
+2 -3
Ver Arquivo
@@ -61,7 +61,7 @@ extern "C" {
*/
# define IPP_MAX_NAME 256
# define IPP_MAX_VALUES 100
# define IPP_MAX_VALUES 10 /* Now just an allocation increment */
/*
@@ -364,8 +364,7 @@ typedef union /**** Attribute Value ****/
typedef struct ipp_attribute_s /**** Attribute ****/
{
struct ipp_attribute_s *next;
/* Next atrtribute in list */
struct ipp_attribute_s *next; /* Next attribute in list */
ipp_tag_t group_tag, /* Job/Printer/Operation group tag */
value_tag; /* What type of value is it? */
char *name; /* Name of attribute */
+17 -6
Ver Arquivo
@@ -284,12 +284,16 @@ ppd_get_group(ppd_file_t *ppd, /* I - PPD file */
ppd_group_t *group; /* Group */
DEBUG_printf(("ppd_get_group(%p, \"%s\")\n", ppd, name));
for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++)
if (strcmp(group->text, name) == 0)
break;
if (i == 0)
{
DEBUG_printf(("Adding group %s...\n", name));
if (ppd->num_groups == 0)
group = malloc(sizeof(ppd_group_t));
else
@@ -926,7 +930,13 @@ ppdOpen(FILE *fp) /* I - File to read from */
*/
if (name[0] == '*')
strcpy(name, name + 1);
strcpy(name, name + 1); /* Eliminate leading asterisk */
for (i = strlen(name) - 1; i > 0 && isspace(name[i]); i --)
name[i] = '\0'; /* Eliminate trailing spaces */
DEBUG_printf(("OpenUI of %s in group %s...\n", name,
group ? group->text : "(null)"));
if (subgroup != NULL)
option = ppd_get_option(subgroup, name);
@@ -955,6 +965,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
return (NULL);
}
DEBUG_printf(("Adding to group %s...\n", group->text));
option = ppd_get_option(group, name);
group = NULL;
}
@@ -1764,7 +1775,7 @@ ppd_read(FILE *fp, /* I - File to read from */
*lineptr = '\0';
DEBUG_printf(("LINE = \"%s\"\n", line));
/* DEBUG_printf(("LINE = \"%s\"\n", line));*/
if (ch == EOF && lineptr == line)
return (0);
@@ -1807,7 +1818,7 @@ ppd_read(FILE *fp, /* I - File to read from */
mask |= PPD_KEYWORD;
DEBUG_printf(("keyword = \"%s\", lineptr = \"%s\"\n", keyword, lineptr));
/* DEBUG_printf(("keyword = \"%s\", lineptr = \"%s\"\n", keyword, lineptr));*/
if (isspace(*lineptr))
{
@@ -1827,7 +1838,7 @@ ppd_read(FILE *fp, /* I - File to read from */
*optptr = '\0';
mask |= PPD_OPTION;
DEBUG_printf(("option = \"%s\", lineptr = \"%s\"\n", option, lineptr));
/* DEBUG_printf(("option = \"%s\", lineptr = \"%s\"\n", option, lineptr));*/
if (*lineptr == '/')
{
@@ -1849,7 +1860,7 @@ ppd_read(FILE *fp, /* I - File to read from */
mask |= PPD_TEXT;
}
DEBUG_printf(("text = \"%s\", lineptr = \"%s\"\n", text, lineptr));
/* DEBUG_printf(("text = \"%s\", lineptr = \"%s\"\n", text, lineptr));*/
}
if (*lineptr == ':')
@@ -1875,7 +1886,7 @@ ppd_read(FILE *fp, /* I - File to read from */
*strptr = '\0';
DEBUG_printf(("string = \"%s\", lineptr = \"%s\"\n", *string, lineptr));
/* DEBUG_printf(("string = \"%s\", lineptr = \"%s\"\n", *string, lineptr));*/
mask |= PPD_STRING;
}
+2 -2
Ver Arquivo
@@ -139,8 +139,8 @@ cupsTempFd(char *filename, /* I - Pointer to buffer */
fd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0600);
#endif /* O_NOFOLLOW */
if (fd < 0 && errno == EPERM)
break; /* Stop immediately if permission denied! */
if (fd < 0 && (errno == EPERM || errno == ENOENT))
break; /* Stop immediately if permission denied or the dir doesn't exist! */
}
while (fd < 0);
+3 -2
Ver Arquivo
@@ -124,9 +124,10 @@ main(int argc, /* I - Number of command-line arguments */
for (k = 0, option = group->options; k < group->num_options; k ++, option ++)
{
printf(" options[%d] = %s (%s) %s %s %.0f\n", k,
printf(" options[%d] = %s (%s) %s %s %.0f (%d choices)\n", k,
option->keyword, option->text, uis[option->ui],
sections[option->section], option->order);
sections[option->section], option->order,
option->num_choices);
if (strcmp(option->keyword, "PageSize") == 0 ||
strcmp(option->keyword, "PageRegion") == 0)
+4 -3
Ver Arquivo
@@ -174,7 +174,7 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
FILE *file; /* File to send */
struct stat fileinfo; /* File information */
int bytes; /* Number of bytes read/written */
char buffer[8192]; /* Output buffer */
char buffer[32768]; /* Output buffer */
const char *password; /* Password string */
char realm[HTTP_MAX_VALUE], /* realm="xyz" string */
nonce[HTTP_MAX_VALUE], /* nonce="xyz" string */
@@ -244,9 +244,10 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
*/
if (filename != NULL)
sprintf(length, "%u", ippLength(request) + (size_t)fileinfo.st_size);
sprintf(length, "%lu", (unsigned long)(ippLength(request) +
(size_t)fileinfo.st_size));
else
sprintf(length, "%u", ippLength(request));
sprintf(length, "%lu", (unsigned long)ippLength(request));
httpClearFields(http);
httpSetField(http, HTTP_FIELD_CONTENT_LENGTH, length);
+9 -3
Ver Arquivo
@@ -82,11 +82,17 @@ clean:
install:
$(INSTALL_DIR) $(DATADIR)/banners
$(INSTALL_DATA) $(BANNERS) $(DATADIR)/banners
for file in $(BANNERS); do \
$(INSTALL_DATA) $$file $(DATADIR)/banners; \
done
$(INSTALL_DIR) $(DATADIR)/charsets
$(INSTALL_DATA) $(CHARSETS) $(DATADIR)/charsets
for file in $(CHARSETS); do \
$(INSTALL_DATA) $$file $(DATADIR)/charsets; \
done
$(INSTALL_DIR) $(DATADIR)/data
$(INSTALL_DATA) $(DATAFILES) $(DATADIR)/data
for file in $(DATAFILES); do \
$(INSTALL_DATA) $$file $(DATADIR)/data; \
done
-if test x$(PAMDIR) != x; then \
$(INSTALL_DIR) $(PAMDIR); \
if test -f /lib/security/pam_unix.so; then \
+14 -6
Ver Arquivo
@@ -119,13 +119,21 @@ clean:
install:
$(INSTALL_DIR) $(DOCDIR)
$(INSTALL_MAN) $(WEBPAGES) $(DOCDIR)
$(INSTALL_MAN) overview.html overview.pdf $(DOCDIR)
$(INSTALL_MAN) $(DOCUMENTS:.shtml=.html) $(DOCDIR)
$(INSTALL_MAN) $(DOCUMENTS:.shtml=.pdf) $(DOCDIR)
for file in $(WEBPAGES); do \
$(INSTALL_MAN) $$file $(DOCDIR); \
done
$(INSTALL_MAN) overview.html $(DOCDIR)
$(INSTALL_MAN) overview.pdf $(DOCDIR)
for file in $(DOCUMENTS:.shtml=.html); do \
$(INSTALL_MAN) $$file $(DOCDIR); \
done
for file in $(DOCUMENTS:.shtml=.pdf); do \
$(INSTALL_MAN) $$file $(DOCDIR); \
done
$(INSTALL_DIR) $(DOCDIR)/images
$(INSTALL_MAN) $(WEBIMAGES) $(DOCDIR)/images
$(INSTALL_MAN) $(DOCIMAGES) $(DOCDIR)/images
for file in $(WEBIMAGES) $(DOCIMAGES); do \
$(INSTALL_MAN) $$file $(DOCDIR)/images; \
done
#
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
Arquivo binário não exibido.
+68 -4
Ver Arquivo
@@ -4,7 +4,7 @@
<TITLE>CUPS Software Administrators Manual</TITLE>
<META NAME="author" CONTENT="Easy Software Products">
<META NAME="copyright" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="docnumber" CONTENT="CUPS-SAM-1.1.9">
<META NAME="docnumber" CONTENT="CUPS-SAM-1.1.12">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<STYLE TYPE="text/css"><!--
BODY { font-family: serif }
@@ -22,7 +22,7 @@ PRE { font-family: monospace }
<BODY BGCOLOR="#ffffff">
<CENTER><A HREF="#CONTENTS"><IMG SRC="images/cups-large.gif" BORDER="0" WIDTH="431" HEIGHT="511"><BR>
<H1>CUPS Software Administrators Manual</H1></A><BR>
CUPS-SAM-1.1.9<BR>
CUPS-SAM-1.1.12<BR>
Easy Software Products<BR>
Copyright 1997-2001, All Rights Reserved<BR>
</CENTER>
@@ -119,11 +119,13 @@ Copyright 1997-2001, All Rights Reserved<BR>
<LI><A HREF="#BrowseInterval">BrowseInterval</A></LI>
<LI><A HREF="#BrowsePoll">BrowsePoll</A></LI>
<LI><A HREF="#BrowsePort">BrowsePort</A></LI>
<LI><A HREF="#BrowseProtocols">BrowseProtocols</A></LI>
<LI><A HREF="#BrowseRelay">BrowseRelay</A></LI>
<LI><A HREF="#BrowseShortNames">BrowseShortNames</A></LI>
<LI><A HREF="#BrowseTimeout">BrowseTimeout</A></LI>
<LI><A HREF="#Browsing">Browsing</A></LI>
<LI><A HREF="#Classification">Classification</A></LI>
<LI><A HREF="#ClassifyOverride">ClassifyOverride</A></LI>
<LI><A HREF="#DataDir">DataDir</A></LI>
<LI><A HREF="#DefaultCharset">DefaultCharset</A></LI>
<LI><A HREF="#DefaultLanguage">DefaultLanguage</A></LI>
@@ -266,7 +268,7 @@ Copyright 1997-2001, All Rights Reserved<BR>
<H1 ALIGN="RIGHT"><A NAME="1">Preface</A></H1>
<P>This software administrators manual provides printer administration
information for the Common UNIX Printing System<SUP>TM</SUP> (&quot;CUPS<SUP>
TM</SUP>&quot;), version 1.1.9.</P>
TM</SUP>&quot;), version 1.1.12.</P>
<H2><A NAME="1_1">System Overview</A></H2>
<P>CUPS provides a portable printing layer for UNIX&reg;-based operating
systems. It has been developed by<A HREF="http://www.easysw.com"> Easy
@@ -743,6 +745,17 @@ file:/directory/filename</CODE> while network devices use the more
with CUPS. You'll find a complete list of PPD files and the printers
they will work with in<A HREF="#PRINTER_DRIVERS"> Appendix C, &quot;Printer
Drivers&quot;</A>.</P>
<P>For a dot matrix printer connected to the serial port this would
might look like:</P>
<UL>
<PRE>
<B>/usr/sbin/lpadmin -p DotMatrix -E -v serial:/dev/ttyS0?baud=9600+size=8+parity=none+flow=soft deskjet.ppd ENTER</B>
</PRE>
</UL>
<P>Here you specify the serial port (e.g. S0,S1, d0, d1), baud rate
(e.g. 9600, 19200, 38400, 115200, etc.), number of bits, parity, and
flow control. If you do not need flow control, delete the &quot;+flow=soft&quot;
portion.</P>
<H3><A NAME="ADD_WEB">Adding Your First Printer from the Web</A></H3>
<P>The CUPS web server provides a user-friendly &quot;wizard&quot; interface for
adding your printers. Rather than figuring out which device URI and PPD
@@ -1074,19 +1087,21 @@ HREF="#CLIENT_SETUP"> Chapter 5, &quot;Client Setup&quot;</A> for more
<LI><A HREF="#BrowseOrder"><CODE>BrowseOrder</CODE></A></LI>
<LI><A HREF="#BrowsePoll"><CODE>BrowsePoll</CODE></A></LI>
<LI><A HREF="#BrowsePort"><CODE>BrowsePort</CODE></A></LI>
<LI><A HREF="#BrowseProtocols"><CODE>BrowseProtocols</CODE></A></LI>
<LI><A HREF="#BrowseRelay"><CODE>BrowseRelay</CODE></A></LI>
<LI><A HREF="#BrowseShortNames"><CODE>BrowseShortNames</CODE></A></LI>
<LI><A HREF="#BrowseTimeout"><CODE>BrowseTimeout</CODE></A></LI>
<LI><A HREF="#Browsing"><CODE>Browsing</CODE></A></LI>
<LI><A HREF="#Classification"><CODE>Classification</CODE></A></LI>
<LI><A HREF="#ClassifyOverride"><CODE>ClassifyOverride</CODE></A></LI>
<LI><A HREF="#DataDir"><CODE>DataDir</CODE></A></LI>
<LI><A HREF="#DefaultCharset"><CODE>DefaultCharset</CODE></A></LI>
<LI><A HREF="#DefaultLanguage"><CODE>DefaultLanguage</CODE></A></LI>
<LI><A HREF="#Deny"><CODE>Deny</CODE></A></LI>
<LI><A HREF="#DocumentRoot"><CODE>DocumentRoot</CODE></A></LI>
</TD><TD VALIGN="TOP"> &nbsp;&nbsp;&nbsp;</TD><TD VALIGN="TOP">
<LI><A HREF="#Encryption"><CODE>Encryption</CODE></A></LI>
<LI><A HREF="#ErrorLog"><CODE>ErrorLog</CODE></A></LI>
</TD><TD VALIGN="TOP"> &nbsp;&nbsp;&nbsp;</TD><TD VALIGN="TOP">
<LI><A HREF="#FilterLimit"><CODE>FilterLimit</CODE></A></LI>
<LI><A HREF="#FontPath"><CODE>FontPath</CODE></A></LI>
<LI><A HREF="#Group"><CODE>Group</CODE></A></LI>
@@ -1452,6 +1467,35 @@ BrowsePort 9999
</TABLE>
</CENTER>
<!-- NEED 3in -->
</P>
<H3><A NAME="BrowseProtocols">BrowseProtocols</A></H3>
<HR>
<H4>Examples</H4>
<UL>
<PRE>
BrowseProtocols CUPS
BrowseProtocols SLP
BrowseProtocols CUPS SLP
BrowseProtocols all
</PRE>
</UL>
<H4>Description</H4>
<P>The <CODE>BrowseProtocols</CODE> directive specifies the protocols to
use when collecting and distributing shared printers on the local
network. The default protocol is <CODE>CUPS</CODE>, which is a
broadcast-based protocol.
<CENTER>
<TABLE BGCOLOR="#cccccc" BORDER="1" CELLPADDING="5" WIDTH="80%">
<TR><TD><B> NOTE:</B>
<P>When using the <CODE>SLP</CODE> protocol, you must have at least one
Directory Agent (DA) server on your network. Otherwise the CUPS
scheduler (<CODE>cupsd</CODE>) will not respond to client requests for
several seconds while polling the network.</P>
</TD></TR>
</TABLE>
</CENTER>
<!-- NEED 4in -->
</P>
<H3><A NAME="BrowseRelay">BrowseRelay</A></H3>
@@ -1566,6 +1610,26 @@ Classification unclassified
classification level.
<!-- NEED 3in -->
</P>
<H3><A NAME="ClassifyOverride">ClassifyOverride</A></H3>
<HR>
<H4>Examples</H4>
<UL>
<PRE>
ClassifyOverride Yes
ClassifyOverride No
</PRE>
</UL>
<H4>Description</H4>
<P>The <CODE>ClassifyOverride</CODE> directive specifies whether users
can override the default classification level on the server. When the
server classification is set, users can change the classification using
the <CODE>job-sheets</CODE> option and can choose to only print one
security banner before or after the job. If the <CODE>job-sheets</CODE>
option is set to <CODE>none</CODE> then the server default
classification is used.</P>
<P>The default is to not allow classification overrides.
<!-- NEED 3in -->
</P>
<H3><A NAME="DataDir">DataDir</A></H3>
<HR>
<H4>Examples</H4>
BIN
Ver Arquivo
Arquivo binário não exibido.
+74 -5
Ver Arquivo
@@ -1,7 +1,7 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.1.9">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.1.12">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Administrators Manual</TITLE>
</HEAD>
@@ -11,7 +11,7 @@
<P>This software administrators manual provides printer administration
information for the Common UNIX Printing System<SUP>TM</SUP>
("CUPS<SUP>TM</SUP>"), version 1.1.9.
("CUPS<SUP>TM</SUP>"), version 1.1.12.
<EMBED SRC="system-overview.shtml">
@@ -449,6 +449,18 @@ the PPD files for the HP DeskJet and HP LaserJet drivers included with CUPS.
You'll find a complete list of PPD files and the printers they will work with
in <A HREF="#PRINTER_DRIVERS">Appendix C, "Printer Drivers"</A>.
<P>For a dot matrix printer connected to the serial port this would might look like:
<UL><PRE>
<B>/usr/sbin/lpadmin -p DotMatrix -E -v serial:/dev/ttyS0?baud=9600+size=8+parity=none+flow=soft deskjet.ppd ENTER</B>
</PRE></UL>
<P>Here you specify the serial port (e.g. S0,S1, d0, d1), baud rate
(e.g. 9600, 19200, 38400, 115200, etc.), number of bits, parity, and flow control.
If you do not need flow control, delete the "+flow=soft" portion.
<H3><A NAME="ADD_WEB">Adding Your First Printer from the Web</A></H3>
<P>The CUPS web server provides a user-friendly "wizard" interface for
@@ -844,7 +856,6 @@ can use your favorite text editor to make changes to it.
determine how the server operates:
<UL>
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD VALIGN="TOP">
@@ -862,18 +873,18 @@ determine how the server operates:
<LI><A HREF="#BrowseOrder"><CODE>BrowseOrder</CODE></A>
<LI><A HREF="#BrowsePoll"><CODE>BrowsePoll</CODE></A>
<LI><A HREF="#BrowsePort"><CODE>BrowsePort</CODE></A>
<LI><A HREF="#BrowseProtocols"><CODE>BrowseProtocols</CODE></A>
<LI><A HREF="#BrowseRelay"><CODE>BrowseRelay</CODE></A>
<LI><A HREF="#BrowseShortNames"><CODE>BrowseShortNames</CODE></A>
<LI><A HREF="#BrowseTimeout"><CODE>BrowseTimeout</CODE></A>
<LI><A HREF="#Browsing"><CODE>Browsing</CODE></A>
<LI><A HREF="#Classification"><CODE>Classification</CODE></A>
<LI><A HREF="#ClassifyOverride"><CODE>ClassifyOverride</CODE></A>
<LI><A HREF="#DataDir"><CODE>DataDir</CODE></A>
<LI><A HREF="#DefaultCharset"><CODE>DefaultCharset</CODE></A>
<LI><A HREF="#DefaultLanguage"><CODE>DefaultLanguage</CODE></A>
<LI><A HREF="#Deny"><CODE>Deny</CODE></A>
<LI><A HREF="#DocumentRoot"><CODE>DocumentRoot</CODE></A>
<LI><A HREF="#Encryption"><CODE>Encryption</CODE></A>
<LI><A HREF="#ErrorLog"><CODE>ErrorLog</CODE></A>
</TD>
<TD VALIGN="TOP">
@@ -881,6 +892,8 @@ determine how the server operates:
</TD>
<TD VALIGN="TOP">
<LI><A HREF="#Encryption"><CODE>Encryption</CODE></A>
<LI><A HREF="#ErrorLog"><CODE>ErrorLog</CODE></A>
<LI><A HREF="#FilterLimit"><CODE>FilterLimit</CODE></A>
<LI><A HREF="#FontPath"><CODE>FontPath</CODE></A>
<LI><A HREF="#Group"><CODE>Group</CODE></A>
@@ -1333,6 +1346,39 @@ used for browse packets. The default port number is 631.
</TR>
</TABLE></CENTER>
<!-- NEED 3in -->
<H3><A NAME="BrowseProtocols">BrowseProtocols</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
BrowseProtocols CUPS
BrowseProtocols SLP
BrowseProtocols CUPS SLP
BrowseProtocols all
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>BrowseProtocols</CODE> directive specifies the protocols to
use when collecting and distributing shared printers on the local network.
The default protocol is <CODE>CUPS</CODE>, which is a broadcast-based
protocol.
<CENTER><TABLE WIDTH="80%" BORDER="1" CELLPADDING="5" BGCOLOR="#cccccc">
<TR>
<TD>
<B>NOTE:</B>
<P>When using the <CODE>SLP</CODE> protocol, you must have at least
one Directory Agent (DA) server on your network. Otherwise the
CUPS scheduler (<CODE>cupsd</CODE>) will not respond to client
requests for several seconds while polling the network.
</TD>
</TR>
</TABLE></CENTER>
<!-- NEED 4in -->
<H3><A NAME="BrowseRelay">BrowseRelay</A></H3>
<HR>
@@ -1459,6 +1505,29 @@ on the server. When this option is set, at least one of the banner pages
is forced to the classification level, and the classification is placed
on each page of output. The default is no classification level.
<!-- NEED 3in -->
<H3><A NAME="ClassifyOverride">ClassifyOverride</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
ClassifyOverride Yes
ClassifyOverride No
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>ClassifyOverride</CODE> directive specifies whether users
can override the default classification level on the server. When the
server classification is set, users can change the classification using
the <CODE>job-sheets</CODE> option and can choose to only print one
security banner before or after the job. If the <CODE>job-sheets</CODE>
option is set to <CODE>none</CODE> then the server default classification
is used.
<P>The default is to not allow classification overrides.
<!-- NEED 3in -->
<H3><A NAME="DataDir">DataDir</A></H3>
<HR>
+2 -2
Ver Arquivo
@@ -63,7 +63,7 @@ Copyright 1997-2001, All Rights Reserved<BR>
<LI><A HREF="#3_3_1">3.3.1 admin.cgi</A></LI>
<LI><A HREF="#3_3_2">3.3.2 classes.cgi</A></LI>
<LI><A HREF="#3_3_3">3.3.3 jobs.cgi</A></LI>
<LI><A HREF="#3_3_4">3.3.4 printers.cgi</A></LI>
<LI><A HREF="#3_3_4">3.3.4 printers.php</A></LI>
</UL>
<LI><A HREF="#3_4">3.4 CUPS Application Programmers Interface</A></LI>
<UL>
@@ -334,7 +334,7 @@ printer-uri-supported</CODE> attribute from the printer or host.</P>
<H3><A NAME="3_3_3">3.3.3 jobs.cgi</A></H3>
<P>The jobs CGI lists the queued print jobs in order of priority. The
list can be limited by printer or job.</P>
<H3><A NAME="3_3_4">3.3.4 printers.cgi</A></H3>
<H3><A NAME="3_3_4">3.3.4 printers.php</A></H3>
<P>The printers CGI lists the available printer queues and any pending
jobs for the printer. The user can click on individual printers to
limit the display and click on jobs to see the job status.</P>
BIN
Ver Arquivo
Arquivo binário não exibido.
+4 -3
Ver Arquivo
@@ -4,7 +4,7 @@
<TITLE>CUPS Software Programmers Manual</TITLE>
<META NAME="author" CONTENT="Easy Software Products">
<META NAME="copyright" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="docnumber" CONTENT="CUPS-SPM-1.1.9">
<META NAME="docnumber" CONTENT="CUPS-SPM-1.1.12">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<STYLE TYPE="text/css"><!--
BODY { font-family: serif }
@@ -22,7 +22,7 @@ PRE { font-family: monospace }
<BODY BGCOLOR="#ffffff">
<CENTER><A HREF="#CONTENTS"><IMG SRC="images/cups-large.gif" BORDER="0" WIDTH="431" HEIGHT="511"><BR>
<H1>CUPS Software Programmers Manual</H1></A><BR>
CUPS-SPM-1.1.9<BR>
CUPS-SPM-1.1.12<BR>
Easy Software Products<BR>
Copyright 1997-2001, All Rights Reserved<BR>
</CENTER>
@@ -1073,7 +1073,8 @@ Copyright 1997-2001, All Rights Reserved<BR>
<HR>
<H1 ALIGN="RIGHT"><A NAME="1">Preface</A></H1>
<P>This software programmers manual provides software programming
information for the Common UNIX Printing System (&quot;CUPS&quot;) Version 1.1.9.</P>
information for the Common UNIX Printing System (&quot;CUPS&quot;) Version
1.1.12.</P>
<H2><A NAME="1_1">System Overview</A></H2>
<P>CUPS provides a portable printing layer for UNIX&reg;-based operating
systems. It has been developed by<A HREF="http://www.easysw.com"> Easy
BIN
Ver Arquivo
Arquivo binário não exibido.
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SPM-1.1.9">
<META NAME="DOCNUMBER" CONTENT="CUPS-SPM-1.1.12">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Programmers Manual</TITLE>
</HEAD>
@@ -11,7 +11,7 @@
<P>This software programmers manual provides software
programming information for the Common UNIX Printing System
("CUPS") Version 1.1.9.
("CUPS") Version 1.1.12.
<EMBED SRC="system-overview.shtml">
+1 -1
Ver Arquivo
@@ -166,7 +166,7 @@ Low</TD></TR>
None</TD><TD>Medium</TD></TR>
<TR><TD>jobs.cgi</TD><TD>93k</TD><TD>Size of job objects</TD><TD>None</TD><TD>
Medium</TD></TR>
<TR><TD>printers.cgi</TD><TD>95k</TD><TD>Size of printer objects</TD><TD>
<TR><TD>printers.php</TD><TD>95k</TD><TD>Size of printer objects</TD><TD>
None</TD><TD>Medium</TD></TR>
<TR><TH COLSPAN="3">Command-Line Programs</TH></TR>
<TR><TH>Program</TH><TH>Base Memory</TH><TH>Max Memory</TH><TH>Temp
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
+3 -3
Ver Arquivo
@@ -4,7 +4,7 @@
<TITLE>CUPS Software Users Manual</TITLE>
<META NAME="author" CONTENT="Easy Software Products">
<META NAME="copyright" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="docnumber" CONTENT="CUPS-SUM-1.1.9">
<META NAME="docnumber" CONTENT="CUPS-SUM-1.1.12">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<STYLE TYPE="text/css"><!--
BODY { font-family: serif }
@@ -22,7 +22,7 @@ PRE { font-family: monospace }
<BODY BGCOLOR="#ffffff">
<CENTER><A HREF="#CONTENTS"><IMG SRC="images/cups-large.gif" BORDER="0" WIDTH="431" HEIGHT="511"><BR>
<H1>CUPS Software Users Manual</H1></A><BR>
CUPS-SUM-1.1.9<BR>
CUPS-SUM-1.1.12<BR>
Easy Software Products<BR>
Copyright 1997-2001, All Rights Reserved<BR>
</CENTER>
@@ -125,7 +125,7 @@ Copyright 1997-2001, All Rights Reserved<BR>
<HR>
<H1 ALIGN="RIGHT"><A NAME="1">Preface</A></H1>
<P>This software users manual describes how to use the Common UNIX
Printing System<SUP>TM</SUP> (&quot;CUPS<SUP>TM</SUP>&quot;) Version 1.1.9.</P>
Printing System<SUP>TM</SUP> (&quot;CUPS<SUP>TM</SUP>&quot;) Version 1.1.12.</P>
<H2><A NAME="1_1">System Overview</A></H2>
<P>CUPS provides a portable printing layer for UNIX&reg;-based operating
systems. It has been developed by<A HREF="http://www.easysw.com"> Easy
BIN
Ver Arquivo
Arquivo binário não exibido.
+2 -2
Ver Arquivo
@@ -2,7 +2,7 @@
<HEAD>
<META NAME="Description" CONTENT="Common UNIX Printing System Software Users Manual">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.1.9">
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.1.12">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Users Manual</TITLE>
</HEAD>
@@ -11,7 +11,7 @@
<H1 ALIGN="RIGHT">Preface</H1>
<P>This software users manual describes how to use the Common UNIX Printing
System<SUP>TM</SUP> ("CUPS<SUP>TM</SUP>") Version 1.1.9.
System<SUP>TM</SUP> ("CUPS<SUP>TM</SUP>") Version 1.1.12.
<EMBED SRC="system-overview.shtml">
BIN
Ver Arquivo
Arquivo binário não exibido.
+13
Ver Arquivo
@@ -0,0 +1,13 @@
hpgltops
imagetops
imagetoraster
libcupsimage.a
libcupsimage.dylib.2
libcupsimage.sl.2
libcupsimage.so.2
libcupsimage_s.a
pstops
rastertodymo
rastertoepson
rastertohp
texttops
+37 -9
Ver Arquivo
@@ -25,7 +25,7 @@
include ../Makedefs
TARGETS = hpgltops texttops pstops imagetops imagetoraster \
rastertoepson rastertohp
rastertodymo rastertoepson rastertohp
HPGLOBJS = hpgl-attr.o hpgl-config.o hpgl-main.o hpgl-prolog.o \
hpgl-char.o hpgl-input.o hpgl-polygon.o hpgl-vector.o
@@ -36,8 +36,8 @@ IMAGEOBJS = image-bmp.o image-colorspace.o image-gif.o image-jpeg.o \
FORMOBJS = form-attr.o form-main.o form-ps.o form-text.o form-tree.o
OBJS = $(HPGLOBJS) $(IMAGEOBJS) $(FORMOBJS) \
imagetops.o imagetoraster.o common.o pstops.o raster.o \
rastertoepson.o rastertohp.o texttops.o textcommon.o
rastertodymo.o rastertoepson.o rastertohp.o texttops.o \
textcommon.o
#
# Make all targets...
@@ -59,13 +59,20 @@ clean:
#
install:
$(INSTALL_DIR) $(SERVERBIN)/filter
for file in $(TARGETS); do \
$(INSTALL_BIN) $$file $(SERVERBIN)/filter; \
done
$(INSTALL_DIR) $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
if test $(LIBCUPSIMAGE) != "libcupsimage.a" -a $(LIBCUPSIMAGE) != "libcupsimage.la"; then \
$(INSTALL_LIB) `basename $(LIBCUPSIMAGE) .2` $(LIBDIR); \
-if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
$(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
$(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
fi
-if test $(LIBCUPSIMAGE) = "libcupsimage.2.dylib"; then \
$(RM) $(LIBDIR)/libcupsimage.dylib; \
$(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
fi
$(INSTALL_DIR) $(SERVERBIN)/filter
$(INSTALL_BIN) $(TARGETS) $(SERVERBIN)/filter
$(INSTALL_DIR) $(INCLUDEDIR)/cups
$(INSTALL_DATA) raster.h $(INCLUDEDIR)/cups
@@ -101,6 +108,17 @@ libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS) ../Makedefs
$(LN) $@ `basename $@ .2`
#
# libcupsimage.2.dylib
#
libcupsimage.2.dylib: $(IMAGEOBJS) ../Makedefs
echo Linking $@...
$(DSO) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) $(LINKCUPS) -lm -lcc_dynamic
$(RM) libcupsimage.dylib
$(LN) $@ libcupsimage.dylib
#
# libcupsimage_s.a
#
@@ -119,8 +137,8 @@ libcupsimage_s.a: $(IMAGEOBJS) ../Makedefs
libcupsimage.la: $(IMAGEOBJS) ../Makedefs
echo Linking $@...
$(CC) -o $@ $(IMAGEOBJS:.o=.lo) -rpath $(LIBDIR) \
-version-info 2:0
$(DSO) -o $(DSOFLAGS) $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
-rpath $(LIBDIR) -version-info 2:0
#
@@ -171,6 +189,16 @@ pstops: pstops.o common.o ../Makedefs ../cups/$(LIBCUPS)
pstops.o: common.h
#
# rastertodymo
#
rastertodymo: rastertodymo.o ../Makedefs ../cups/$(LIBCUPS) libcupsimage.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ rastertodymo.o libcupsimage.a $(LIBS)
rastertodymo.o: raster.h
#
# rastertoepson
#
+31 -4
Ver Arquivo
@@ -23,6 +23,7 @@
*
* Contents:
*
* ImageSetProfile() - Set the device color profile.
* ImageWhiteToWhite() - Convert luminance colors to device-dependent
* ImageWhiteToRGB() - Convert luminance data to RGB.
* ImageWhiteToBlack() - Convert luminance colors to black.
@@ -56,12 +57,13 @@
/*
* Globals...
* Local globals...
*/
extern int ImageHaveProfile;
extern int ImageDensity[256];
extern int ImageMatrix[3][3][256];
static int ImageHaveProfile = 0; /* Do we have a color profile? */
static int ImageDensity[256]; /* Ink/marker density LUT */
static int ImageMatrix[3][3][256]; /* Color transform matrix LUT */
/*
* Local functions...
@@ -78,6 +80,31 @@ static void zrotate(float [3][3], float, float);
static void zshear(float [3][3], float, float);
/*
* 'ImageSetProfile()' - Set the device color profile.
*/
void
ImageSetProfile(float d, /* I - Ink/marker density */
float g, /* I - Ink/marker gamma */
float matrix[3][3]) /* I - Color transform matrix */
{
int i, j, k; /* Looping vars */
float m; /* Current matrix value */
int *im; /* Pointer into ImageMatrix */
ImageHaveProfile = 1;
for (i = 0, im = ImageMatrix[0][0]; i < 3; i ++)
for (j = 0; j < 3; j ++)
for (k = 0, m = matrix[i][j]; k < 256; k ++)
*im++ = (int)(k * m + 0.5);
for (k = 0, im = ImageDensity; k < 256; k ++)
*im++ = 255.0 * d * pow((float)k / 255.0, g) + 0.5;
}
/*
* 'ImageWhiteToWhite()' - Convert luminance colors to device-dependent
* luminance.
-35
Ver Arquivo
@@ -26,7 +26,6 @@
* ImageOpen() - Open an image file and read it into memory.
* ImageClose() - Close an image file.
* ImageSetMaxTiles() - Set the maximum number of tiles to cache.
* ImageSetProfile() - Set the device color profile.
* ImageGetCol() - Get a column of pixels from an image.
* ImageGetRow() - Get a row of pixels from an image.
* ImagePutCol() - Put a column of pixels to an image.
@@ -46,15 +45,6 @@
#include <cups/cups.h>
/*
* Globals...
*/
int ImageHaveProfile = 0; /* Do we have a color profile? */
int ImageDensity[256]; /* Ink/marker density LUT */
int ImageMatrix[3][3][256]; /* Color transform matrix LUT */
/*
* Local functions...
*/
@@ -311,31 +301,6 @@ ImageSetMaxTiles(image_t *img, /* I - Image to set */
}
/*
* 'ImageSetProfile()' - Set the device color profile.
*/
void
ImageSetProfile(float d, /* I - Ink/marker density */
float g, /* I - Ink/marker gamma */
float matrix[3][3]) /* I - Color transform matrix */
{
int i, j, k; /* Looping vars */
float m; /* Current matrix value */
int *im; /* Pointer into ImageMatrix */
ImageHaveProfile = 1;
for (i = 0, im = ImageMatrix[0][0]; i < 3; i ++)
for (j = 0; j < 3; j ++)
for (k = 0, m = matrix[i][j]; k < 256; k ++)
*im++ = (int)(k * m + 0.5);
for (k = 0, im = ImageDensity; k < 256; k ++)
*im++ = 255.0 * d * pow((float)k / 255.0, g) + 0.5;
}
/*
* 'ImageGetCol()' - Get a column of pixels from an image.
*/
+9 -2
Ver Arquivo
@@ -268,6 +268,12 @@ main(int argc, /* I - Number of command-line arguments */
return (1);
}
/*
* See if this is an EPS file...
*/
UseESPsp = strstr(line, "EPS") != NULL;
/*
* Start sending the document with any commands needed...
*/
@@ -300,14 +306,15 @@ main(int argc, /* I - Number of command-line arguments */
*/
UseESPsp = 1;
}
WriteLabelProlog(val);
WriteLabelProlog(val);
if (UseESPsp)
puts("userdict begin\n"
"/ESPshowpage /showpage load def\n"
"/showpage { } def\n"
"end");
}
if (Copies > 1 && (!Collate || !slowcollate))
{
+361
Ver Arquivo
@@ -0,0 +1,361 @@
/*
* "$Id$"
*
* DYMO label printer filter for the Common UNIX Printing System (CUPS).
*
* Copyright 2001 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636-3111 USA
*
* Voice: (301) 373-9603
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*
* Contents:
*
* Setup() - Prepare the printer for printing.
* StartPage() - Start a page of graphics.
* EndPage() - Finish a page of graphics.
* Shutdown() - Shutdown the printer.
* CancelJob() - Cancel the current job...
* CompressData() - Compress a line of graphics.
* OutputLine() - Output a line of graphics.
* main() - Main entry and processing of driver.
*/
/*
* Include necessary headers...
*/
#include <cups/cups.h>
#include <cups/string.h>
#include "raster.h"
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
/*
* Globals...
*/
unsigned char *Buffer; /* Output buffer */
int Page, /* Current page */
Feed; /* Number of lines to skip */
/*
* Prototypes...
*/
void Setup(void);
void StartPage(cups_page_header_t *header);
void EndPage(void);
void CancelJob(int sig);
/**** MRS - supported resolutions = 136, 203, 300 ****/
/*
* 'Setup()' - Prepare the printer for printing.
*/
void
Setup(void)
{
int i; /* Looping var */
/*
* Clear any remaining data...
*/
for (i = 0; i < 100; i ++)
putchar(0x1b);
}
/*
* 'StartPage()' - Start a page of graphics.
*/
void
StartPage(cups_page_header_t *header) /* I - Page header */
{
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
/*
* Register a signal handler to eject the current page if the
* job is cancelled.
*/
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, CancelJob);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = CancelJob;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, CancelJob);
#endif /* HAVE_SIGSET */
/*
* Setup printer/job attributes...
*/
printf("\033L%c%c", header->cupsHeight, header->cupsHeight >> 8);
printf("\033D%c", header->cupsBytesPerLine);
printf("\033%c", header->cupsCompression + 'c'); /* Darkness */
/*
* Allocate memory for a line of graphics...
*/
Buffer = malloc(header->cupsBytesPerLine);
Feed = 0;
}
/*
* 'EndPage()' - Finish a page of graphics.
*/
void
EndPage(void)
{
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
/*
* Eject the current page...
*/
printf("\033E");
fflush(stdout);
/*
* Unregister the signal handler...
*/
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, SIG_IGN);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = SIG_IGN;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, SIG_IGN);
#endif /* HAVE_SIGSET */
/*
* Free memory...
*/
free(Buffer);
}
/*
* 'CancelJob()' - Cancel the current job...
*/
void
CancelJob(int sig) /* I - Signal */
{
int i; /* Looping var */
(void)sig;
/*
* Send out lots of ESC bytes to clear out any pending raster data...
*/
for (i = 0; i < 100; i ++)
putchar(0x1b);
/*
* End the current page and exit...
*/
EndPage();
exit(0);
}
/*
* 'main()' - Main entry and processing of driver.
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
{
int fd; /* File descriptor */
cups_raster_t *ras; /* Raster stream for printing */
cups_page_header_t header; /* Page header from file */
int y; /* Current line */
/*
* Make sure status messages are not buffered...
*/
setbuf(stderr, NULL);
/*
* Check command-line...
*/
if (argc < 6 || argc > 7)
{
/*
* We don't have the correct number of arguments; write an error message
* and return.
*/
fputs("ERROR: rastertodymo job-id user title copies options [file]\n", stderr);
return (1);
}
/*
* Open the page stream...
*/
if (argc == 7)
{
if ((fd = open(argv[6], O_RDONLY)) == -1)
{
perror("ERROR: Unable to open raster file - ");
sleep(1);
return (1);
}
}
else
fd = 0;
ras = cupsRasterOpen(fd, CUPS_RASTER_READ);
/*
* Initialize the print device...
*/
Setup();
/*
* Process pages as needed...
*/
Page = 0;
while (cupsRasterReadHeader(ras, &header))
{
/*
* Write a status message with the page number and number of copies.
*/
Page ++;
fprintf(stderr, "PAGE: %d 1\n", Page);
/*
* Start the page...
*/
StartPage(&header);
/*
* Loop for each line on the page...
*/
for (y = 0; y < header.cupsHeight; y ++)
{
/*
* Let the user know how far we have progressed...
*/
if ((y & 15) == 0)
fprintf(stderr, "INFO: Printing page %d, %d%% complete...\n", Page,
100 * y / header.cupsHeight);
/*
* Read a line of graphics...
*/
if (cupsRasterReadPixels(ras, Buffer, header.cupsBytesPerLine) < 1)
break;
/*
* See if the line is blank; if not, write it to the printer...
*/
if (Buffer[0] ||
memcmp(Buffer, Buffer + 1, header.cupsBytesPerLine - 1))
{
if (Feed)
{
printf("\033f\001%c", Feed);
Feed = 0;
}
putchar(0x16);
fwrite(Buffer, header.cupsBytesPerLine, 1, stdout);
}
else
Feed ++;
}
/*
* Eject the page...
*/
EndPage();
}
/*
* Close the raster stream...
*/
cupsRasterClose(ras);
if (fd != 0)
close(fd);
/*
* If no pages were printed, send an error message...
*/
if (Page == 0)
fputs("ERROR: No pages found!\n", stderr);
else
fputs("INFO: " CUPS_SVERSION " is ready to print.\n", stderr);
return (Page == 0);
}
/*
* End of "$Id$".
*/
+9
Ver Arquivo
@@ -970,10 +970,19 @@ TextMain(const char *name, /* I - Name of filter */
if (PrettyPrint)
Page[line][i].attr = attr;
else if (ch == ' ' && Page[line][i].ch)
ch = Page[line][i].ch;
else if (ch == Page[line][i].ch)
Page[line][i].attr |= ATTR_BOLD;
else if (Page[line][i].ch == '_')
Page[line][i].attr |= ATTR_UNDERLINE;
else if (ch == '_')
{
Page[line][i].attr |= ATTR_UNDERLINE;
if (Page[line][i].ch)
ch = Page[line][i].ch;
}
else
Page[line][i].attr = attr;
+3 -1
Ver Arquivo
@@ -65,7 +65,9 @@ clean:
install:
$(INSTALL_DIR) $(DATADIR)/fonts
$(INSTALL_DATA) $(FONTS) $(DATADIR)/fonts
for file in $(FONTS); do \
$(INSTALL_DATA) $$file $(DATADIR)/fonts; \
done
#
+17 -17
Ver Arquivo
@@ -109,7 +109,7 @@ then
echo "install: no input file specified"
exit 1
else
true
:
fi
if [ x"$dir_arg" != x ]; then
@@ -120,7 +120,7 @@ if [ x"$dir_arg" != x ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
instcmd=$mkdirprog
fi
else
@@ -130,7 +130,7 @@ else
if [ -f $src -o -d $src ]
then
true
:
else
echo "install: $src does not exist"
exit 1
@@ -141,7 +141,7 @@ else
echo "install: no destination specified"
exit 1
else
true
:
fi
# If destination is a directory, append the input filename; if your system
@@ -151,7 +151,7 @@ else
then
dst="$dst"/`basename $src`
else
true
:
fi
fi
@@ -163,8 +163,8 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
@@ -183,7 +183,7 @@ while [ $# -ne 0 ] ; do
then
$mkdirprog "${pathcomp}"
else
true
:
fi
pathcomp="${pathcomp}/"
@@ -194,10 +194,10 @@ if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
@@ -216,7 +216,7 @@ else
then
dstfile=`basename $dst`
else
true
:
fi
# Make a temp file name in the proper directory.
@@ -235,10 +235,10 @@ else
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
# Now rename the file to the real destination.
+1 -1
Ver Arquivo
@@ -28,7 +28,7 @@ include ../Makedefs
# Locales...
#
LOCALES = C de en es fr it
LOCALES = C cs de en es fr it
#
+133
Ver Arquivo
@@ -0,0 +1,133 @@
iso-8859-2
OK
Zru¹it
Nápovìda
Ukonèit
Zavøít
Ano
Ne
Zap
Vyp
UloŸit
Zahodit
Výchozí
MoŸnosti
Více informací
Èerná
Barva
Azurová
Purpurová
®lutá
Copyright 1993-2001 Easy Software Products, v¹echna práva vyhrazena.
Obecné
Tiskárna
Obrázek
HP-GL/2
Extra
Dokument
Ostatní
Vytisknout stránky:
Celý dokument
Rozsah stránek:
Obrácené poøadí:
Formát stránky:
1-Up
2-Up
4-Up
Zvìt¹ení obrázku:
PouŸít pøirozenou velikost
Zvìt¹it podle procent
Zvìt¹it podle PPI
Zrcadlit obrázek:
Barevné nasycení:
Svìtlost:
Pøizpùsobit stránce:
Stínování:
©íøka pera:
Gamma korekce:
Jas:
Pøidat
Smazat
Zmìnit
URI tiskárny
Název tiskárny
Umístìní tiskárny
Info o tiskárnì
Model tiskárny
URI zaøízení
Formátuji stránku
Tisknu stránku
Inicializuji tiskárnu
Stav tiskárny
Pøijímá úlohy
Nepøijímá úlohy
Vytisknout úlohy
Tøída
Lokální
Vzdálená
Duplexní
Se¹ití
Rychlé kopie
Srovnané kopie
Dìrování
Obal
Vazba
Tøídìní
Malé (aŸ do 9.5x14in)
Støední (od 9.5x14in do 13x19in)
Velké (13x19in a vìt¹í)
Vlastní velikost
Neèinná
Probíhá zpracování
Zastaveno
V¹e
Liché
Sudé
Svìtlej¹í Tmavìj¹í
Velikost média
Typ média
Zdroj média
Orientace:
Portrét
Krajina
Stav úlohy
Název úlohy
UŸivatelské jméno
Priorita
Kopie
Velikost souboru
Nevyøízená
Výstupní reŸim
Rozli¹ení
Text
Hezký tisk
Okraje
Vlevo
Vpravo
Dole
Nahoøe
Soubor(y)
Tisk
400 Vá¹ prohlíŸeè odeslal poŸadavek, kterému tento server nerozumí.
Server nemohl ovìøit, zda máte oprávnìní pøistupovat k tomuto zdroji.
Pøístup k tomuto serveru je placený.
Nemáte oprávnìní pøistupovat k tomuto zdroji.
PoŸadovaný zdroj nebyl nalezen na tomto serveru.
PoŸadovaná metoda není pøípustná.
Odpovídající reprezentace zdroje nebyla nalezena.
Nemáte oprávnìní pouŸívat tento server jako proxy hostitele.
PoŸadavek zabral pøíli¹ mnoho èasu a byl pøeru¹en.
PoŸadovaný zdroj má více neŸ jednu hodnotu.
PoŸadovaný zdroj byl zru¹en bez náhrady.
PoŸadovaná metoda vyŸaduje platné pole Content-Length.
Podmínka tohoto poŸadavku byla vyhodnocena zápornì.
PoŸadavek je pro tento server pøíli¹ velký ke zpracování.
URI poŸadavku je pro tento server pøíli¹ velké ke zpracování.
Formát poŸadavku nebyl serverem pochopen.
426 Je vyŸadována aktualizace na zabezpeèený protokol. Vidíte-li tuto zprávu ve WWW prohlíŸeèi, znamená to, Ÿe není podporován.
500 Server narazil na kritickou chybu a nemùŸe pokraèovat ve zpracování poŸadavku.
PoŸadovaná metoda není implementována.
Proxy server obdrŸel neplatnou odpovìï od nadøazeného serveru.
PoŸadovaný zdroj je momentálnì nedostupný.
Proxy server zabral pøíli¹ mnoho èasu na odpovìï tomuto serveru.
Tento server nepodporuje HTTP ve verzi, kterou poŸaduje vá¹ prohlíŸeè.
+6
Ver Arquivo
@@ -0,0 +1,6 @@
*.0
*.1
*.3
*.5
*.8
*.z
+35 -24
Ver Arquivo
@@ -30,12 +30,15 @@ include ../Makedefs
MAN1 = backend.man filter.man lp.man lpoptions.man lppasswd.man \
lpq.man lprm.man lpr.man lpstat.man
MAN3 = cups-config.man
MAN5 = classes.conf.man cupsd.conf.man mime.convs.man mime.types.man \
printers.conf.man
MAN8 = accept.man cups-lpd.man cups-polld.man cupsd.man enable.man \
lpadmin.man lpinfo.man lpmove.man lpc.man
MAN8 = accept.man cupsaddsmb.man cups-lpd.man cups-polld.man \
cupsd.man enable.man lpadmin.man lpinfo.man lpmove.man \
lpc.man
CAT1 = $(MAN1:.man=.$(CAT1EXT))
CAT3 = $(MAN3:.man=.$(CAT3EXT))
CAT5 = $(MAN5:.man=.$(CAT5EXT))
CAT8 = $(MAN8:.man=.$(CAT8EXT))
@@ -44,7 +47,7 @@ CAT8 = $(MAN8:.man=.$(CAT8EXT))
# Make everything...
#
all: $(CAT1) $(CAT5) $(CAT8)
all: $(CAT1) $(CAT3) $(CAT5) $(CAT8)
#
@@ -52,7 +55,7 @@ all: $(CAT1) $(CAT5) $(CAT8)
#
clean:
$(RM) $(CAT1) $(CAT5) $(CAT8)
$(RM) $(CAT1) $(CAT3) $(CAT5) $(CAT8)
#
@@ -64,9 +67,12 @@ install:
for file in $(MAN1); do \
$(INSTALL_MAN) $$file $(MANDIR)/man1/`basename $$file man`1; \
done
$(RM) cancel.1
$(LN) lp.1 cancel.1
$(INSTALL_MAN) cancel.1 $(MANDIR)/man1
$(RM) $(MANDIR)/man1/cancel.1
$(LN) lp.1 $(MANDIR)/man1/cancel.1
$(INSTALL_DIR) $(PMANDIR)/man3
for file in $(MAN3); do \
$(INSTALL_MAN) $$file $(PMANDIR)/man3/`basename $$file man`3; \
done
$(INSTALL_DIR) $(MANDIR)/man5
for file in $(MAN5); do \
$(INSTALL_MAN) $$file $(MANDIR)/man5/`basename $$file man`5; \
@@ -75,27 +81,32 @@ install:
for file in $(MAN8); do \
$(INSTALL_MAN) $$file $(AMANDIR)/man$(MAN8EXT)/`basename $$file man`$(MAN8EXT); \
done
$(RM) reject.$(MAN8EXT)
$(LN) accept.$(MAN8EXT) reject.$(MAN8EXT)
$(INSTALL_MAN) reject.$(MAN8EXT) $(AMANDIR)/man$(MAN8EXT)
$(RM) $(AMANDIR)/man$(MAN8EXT)/reject.$(MAN8EXT)
$(LN) accept.$(MAN8EXT) $(AMANDIR)/man$(MAN8EXT)/reject.$(MAN8EXT)
$(RM) $(AMANDIR)/man$(MAN8EXT)/disable.$(MAN8EXT)
$(LN) enable.$(MAN8EXT) disable.$(MAN8EXT)
$(INSTALL_MAN) disable.$(MAN8EXT) $(AMANDIR)/man$(MAN8EXT)
$(LN) enable.$(MAN8EXT) $(AMANDIR)/man$(MAN8EXT)/disable.$(MAN8EXT)
$(INSTALL_DIR) $(MANDIR)/cat1
$(INSTALL_MAN) $(CAT1) $(MANDIR)/cat1
$(RM) cancel.$(CAT1EXT)
$(LN) lp.$(CAT1EXT) cancel.$(CAT1EXT)
$(INSTALL_MAN) cancel.$(CAT1EXT) $(MANDIR)/cat1
for file in $(CAT1); do \
$(INSTALL_MAN) $$file $(MANDIR)/cat1; \
done
$(RM) $(MANDIR)/cat1/cancel.$(CAT1EXT)
$(LN) lp.$(CAT1EXT) $(MANDIR)/cat1/cancel.$(CAT1EXT)
$(INSTALL_DIR) $(PMANDIR)/cat3
for file in $(CAT3); do \
$(INSTALL_MAN) $$file $(PMANDIR)/cat3; \
done
$(INSTALL_DIR) $(MANDIR)/cat5
$(INSTALL_MAN) $(CAT5) $(MANDIR)/cat5
for file in $(CAT5); do \
$(INSTALL_MAN) $$file $(MANDIR)/cat5; \
done
$(INSTALL_DIR) $(AMANDIR)/cat$(MAN8EXT)
$(INSTALL_MAN) $(CAT8) $(AMANDIR)/cat$(MAN8EXT)
$(RM) reject.$(CAT8EXT)
$(LN) accept.$(CAT8EXT) reject.$(CAT8EXT)
$(INSTALL_MAN) reject.$(CAT8EXT) $(AMANDIR)/cat$(MAN8EXT)
$(RM) disable.$(CAT8EXT)
$(LN) enable.$(CAT8EXT) disable.$(CAT8EXT)
$(INSTALL_MAN) disable.$(CAT8EXT) $(AMANDIR)/cat$(MAN8EXT)
for file in $(CAT8); do \
$(INSTALL_MAN) $$file $(AMANDIR)/cat$(MAN8EXT); \
done
$(RM) $(AMANDIR)/cat$(MAN8EXT)/reject.$(CAT8EXT)
$(LN) accept.$(CAT8EXT) $(AMANDIR)/cat$(MAN8EXT)/reject.$(CAT8EXT)
$(RM) $(AMANDIR)/cat$(MAN8EXT)/disable.$(CAT8EXT)
$(LN) enable.$(CAT8EXT) $(AMANDIR)/cat$(MAN8EXT)/disable.$(CAT8EXT)
#
+95
Ver Arquivo
@@ -0,0 +1,95 @@
.\"
.\" "$Id: cups-config.man 1924 2001-10-26 03:16:48Z mike $"
.\"
.\" cups-config man page for the Common UNIX Printing System (CUPS).
.\"
.\" Copyright 1997-2001 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.\" property of Easy Software Products and are protected by Federal
.\" copyright law. Distribution and use rights are outlined in the file
.\" "LICENSE.txt" which should have been included with this file. If this
.\" file is missing or damaged please contact Easy Software Products
.\" at:
.\"
.\" Attn: CUPS Licensing Information
.\" Easy Software Products
.\" 44141 Airport View Drive, Suite 204
.\" Hollywood, Maryland 20636-3111 USA
.\"
.\" Voice: (301) 373-9603
.\" EMail: cups-info@cups.org
.\" WWW: http://www.cups.org
.\"
.TH cups-config 3 "Common UNIX Printing System" "25 October 2001" "Easy Software Products"
.SH NAME
cups-config \- get cups api, compiler, directory, and link information.
.SH SYNOPSIS
.B cups-config
--api-version
.br
.B cups-config
--cflags
.br
.B cups-config
--datadir
.br
.B cups-config
--help
.br
.B cups-config
--ldflags
.br
.B cups-config
[
.I --image
] [
.I --static
] --libs
.br
.B cups-config
--serverbin
.br
.B cups-config
--serverroot
.br
.B cups-config
--version
.br
.SH DESCRIPTION
\fBcups-config\fR is the CUPS program configuration utility. It should be
used by application developers to determine the necessary command-line
options for the compiler and linker, as well as determining installation
directories for filters, configuration files, and drivers.
.LP
The \fI--api-version\fR command displays the current API version (major.minor).
.LP
The \fI--cflags\fR command displays the necessary compiler options.
.LP
The \fI--datadir\fR command displays the default CUPS data directory.
.LP
The \fI--help\fR command displays the program usage message.
.LP
The \fI--ldflags\fR command displays the necessary linker options.
.LP
The \fI--libs\fR command displays the necessary librarys to link to.
The \fI--image\fR option adds the CUPS imaging library to the list.
The \fI--static\fR option shows the static libraries instead of the
default (shared) libraries.
.LP
The \fI--serverbin\fR command displays the default CUPS binary directory,
where filters and backends are stored.
.LP
The \fI--serverroot\fR command displays the default CUPS configuration
file directory.
.LP
The \fI--version\fR command displays the full version number of the
CUPS installation (major.minor.patch).
.SH SEE ALSO
CUPS Software Programmers Manual,
http://localhost:631/documentation.html
.SH COPYRIGHT
Copyright 1993-2001 by Easy Software Products, All Rights Reserved.
.\"
.\" End of "$Id: cups-config.man 1924 2001-10-26 03:16:48Z mike $".
.\"
+114
Ver Arquivo
@@ -0,0 +1,114 @@
.\"
.\" "$Id: cupsaddsmb.man 1943 2001-11-09 17:19:44Z mike $"
.\"
.\" cupsaddsmb man page for the Common UNIX Printing System (CUPS).
.\"
.\" Copyright 1997-2001 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
.\" property of Easy Software Products and are protected by Federal
.\" copyright law. Distribution and use rights are outlined in the file
.\" "LICENSE.txt" which should have been included with this file. If this
.\" file is missing or damaged please contact Easy Software Products
.\" at:
.\"
.\" Attn: CUPS Licensing Information
.\" Easy Software Products
.\" 44141 Airport View Drive, Suite 204
.\" Hollywood, Maryland 20636-3111 USA
.\"
.\" Voice: (301) 373-9603
.\" EMail: cups-info@cups.org
.\" WWW: http://www.cups.org
.\"
.TH cupsaddsmb 8 "Common UNIX Printing System" "9 November 2001" "Easy Software Products"
.SH NAME
cupsaddsmb \- export printers to samba for windows clients
.SH SYNOPSIS
.B cupsaddsmb
[ -a ] [ -U
.I user
] [ -v ]
.br
.B cupsaddsmb
[ -u
.I user
] [ -v ] [ printer1 ... printerN ]
.SH DESCRIPTION
\fIcupsaddsmb\fR exports printers to the SAMBA software (version
2.2.0 or higher) for use with Windows clients. Depending on the
SAMBA configuration, you may need to provide a password to
export the printers. This program requires the Adobe PostScript
printer driver files described below.
.LP
The \fI-a\fR option exports all known printers. Otherwise, only
the named printers are exported.
.LP
The \fI-U\fR option specifies the print admin username which defaults
to your current username.
.LP
The \fI-v\fR option specifies that verbose information should be
shown and is useful for debugging SAMBA configuration problems.
.SH SAMBA CONFIGURATION
\fIcupsaddsmb\fR uses the new RPC-based printing support in
SAMBA 2.2.x to provide printer drivers and PPD files to Windows
client machines. In order to use this functionality, you must
first configure SAMBA (via the smb.conf file) to support
printing through CUPS and provide a printer driver download
share, as follows:
.nf
[global]
load printers = yes
printing = cups
printcap name = cups
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
public = yes
guest ok = yes
writable = no
printable = yes
printer admin = root
[print$]
comment = Printer Drivers
path = /etc/samba/drivers
browseable = yes
guest ok = no
read only = yes
write list = root
.fi
.LP
This configuration assumes a FHS-compliant installation of
SAMBA; adjust the [printers] and [print$] share paths
accordingly on your system as needed.
.SH ADOBE POSTSCRIPT DRIVERS FOR WINDOWS
\fIcupsaddsmb\fR uses the Adobe PostScript printer drivers for
Windows, which are available for download from the Adobe web
site (http://www.adobe.com). Once you have extracted the driver
files, create a "drivers" directory in the CUPS data directory
(usually /usr/share/cups) and copy the Adobe files using
UPPERCASE filenames, as follows:
.nf
ADFONTS.MFM
ADOBEPS4.DRV
ADOBEPS4.HLP
ADOBEPS5.DLL
ADOBEPSU.DLL
ADOBEPSU.HLP
DEFPRTR2.PPD
ICONLIB.DLL
PSMON.DLL
.fi
.SH SEE ALSO
CUPS Software Administrators Manual,
http://localhost:631/documentation.html
.SH COPYRIGHT
Copyright 1993-2001 by Easy Software Products, All Rights Reserved.
.\"
.\" End of "$Id: cupsaddsmb.man 1943 2001-11-09 17:19:44Z mike $".
.\"
+12 -8
Ver Arquivo
@@ -1,5 +1,5 @@
.\"
.\" "$Id: lp.man 1625 2001-03-09 14:26:54Z mike $"
.\" "$Id: lp.man 1904 2001-09-25 16:00:44Z mike $"
.\"
.\" lp/cancel man page for the Common UNIX Printing System (CUPS).
.\"
@@ -21,7 +21,7 @@
.\" EMail: cups-info@cups.org
.\" WWW: http://www.cups.org
.\"
.TH lp 1 "Common UNIX Printing System" "23 January 2001" "Easy Software Products"
.TH lp 1 "Common UNIX Printing System" "25 September 2001" "Easy Software Products"
.SH NAME
lp \- print files
.br
@@ -36,7 +36,7 @@ cancel \- cancel jobs
.I num-copies
[ \-o
.I option
] [ \-p/q
] [ \-q
.I priority
] [ \-s ] [ \-t
.I title
@@ -57,7 +57,7 @@ cancel \- cancel jobs
.I num-copies
[ \-o
.I option
] [ \-p/q
] [ \-q
.I priority
] [ \-t
.I title
@@ -114,10 +114,10 @@ Sets the number of copies to print from 1 to 100.
.br
Sets a job option.
.TP 5
\-p/q \fIpriority\fR
\-q \fIpriority\fR
.br
Sets the job priority from 1 (lowest) to 100 (highest). The default priority
is 50.
Sets the job priority from 1 (lowest) to 100 (highest). The
default priority is 50.
.TP 5
\-s
.br
@@ -145,6 +145,10 @@ any printable character except SPACE and TAB. Also, printer and class names are
\fBnot\fR case-sensitive.
.LP
The "m" option is not functional in CUPS 1.1.
.LP
The "q" option accepts a different range of values than the
Solaris lp command, matching the IPP job priority values (1-100)
instead of the Solaris values (0-39).
.SH SEE ALSO
lpstat(1),
CUPS Software Users Manual,
@@ -152,5 +156,5 @@ http://localhost:631/documentation.html
.SH COPYRIGHT
Copyright 1993-2001 by Easy Software Products, All Rights Reserved.
.\"
.\" End of "$Id: lp.man 1625 2001-03-09 14:26:54Z mike $".
.\" End of "$Id: lp.man 1904 2001-09-25 16:00:44Z mike $".
.\"
+1
Ver Arquivo
@@ -0,0 +1 @@
pdftops
+908
Ver Arquivo
@@ -1625,3 +1625,911 @@ void Type1CFontConverter::getDeltaReal(char *buf, const char *name, double *nop,
}
sprintf(buf, "] def\n");
}
//------------------------------------------------------------------------
// TrueTypeFontFile
//------------------------------------------------------------------------
//
// Terminology
// -----------
//
// character code = number used as an element of a text string
//
// character name = glyph name = name for a particular glyph within a
// font
//
// glyph index = position (within some internal table in the font)
// where the instructions to draw a particular glyph are
// stored
//
// Type 1 fonts
// ------------
//
// Type 1 fonts contain:
//
// Encoding: array of glyph names, maps char codes to glyph names
//
// Encoding[charCode] = charName
//
// CharStrings: dictionary of instructions, keyed by character names,
// maps character name to glyph data
//
// CharStrings[charName] = glyphData
//
// TrueType fonts
// --------------
//
// TrueType fonts contain:
//
// 'cmap' table: mapping from character code to glyph index; there may
// be multiple cmaps in a TrueType font
//
// cmap[charCode] = glyphIdx
//
// 'post' table: mapping from glyph index to glyph name
//
// post[glyphIdx] = glyphName
//
// Type 42 fonts
// -------------
//
// Type 42 fonts contain:
//
// Encoding: array of glyph names, maps char codes to glyph names
//
// Encoding[charCode] = charName
//
// CharStrings: dictionary of glyph indexes, keyed by character names,
// maps character name to glyph index
//
// CharStrings[charName] = glyphIdx
//
struct TTFontTableHdr {
char tag[4];
Guint checksum;
Guint offset;
Guint length;
};
// TrueType tables required by the Type 42 spec.
static char *t42ReqTables[9] = {
"head",
"hhea",
"loca",
"maxp",
"cvt ",
"prep",
"glyf",
"hmtx",
"fpgm"
};
// Glyph names in some arbitrary standard that Apple uses for their
// TrueType fonts.
static char *macGlyphNames[258] = {
".notdef",
"null",
"CR",
"space",
"exclam",
"quotedbl",
"numbersign",
"dollar",
"percent",
"ampersand",
"quotesingle",
"parenleft",
"parenright",
"asterisk",
"plus",
"comma",
"hyphen",
"period",
"slash",
"zero",
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
"eight",
"nine",
"colon",
"semicolon",
"less",
"equal",
"greater",
"question",
"at",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
"bracketleft",
"backslash",
"bracketright",
"asciicircum",
"underscore",
"grave",
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
"braceleft",
"bar",
"braceright",
"asciitilde",
"Adieresis",
"Aring",
"Ccedilla",
"Eacute",
"Ntilde",
"Odieresis",
"Udieresis",
"aacute",
"agrave",
"acircumflex",
"adieresis",
"atilde",
"aring",
"ccedilla",
"eacute",
"egrave",
"ecircumflex",
"edieresis",
"iacute",
"igrave",
"icircumflex",
"idieresis",
"ntilde",
"oacute",
"ograve",
"ocircumflex",
"odieresis",
"otilde",
"uacute",
"ugrave",
"ucircumflex",
"udieresis",
"dagger",
"degree",
"cent",
"sterling",
"section",
"bullet",
"paragraph",
"germandbls",
"registered",
"copyright",
"trademark",
"acute",
"dieresis",
"notequal",
"AE",
"Oslash",
"infinity",
"plusminus",
"lessequal",
"greaterequal",
"yen",
"mu1",
"partialdiff",
"summation",
"product",
"pi",
"integral",
"ordfeminine",
"ordmasculine",
"Ohm",
"ae",
"oslash",
"questiondown",
"exclamdown",
"logicalnot",
"radical",
"florin",
"approxequal",
"increment",
"guillemotleft",
"guillemotright",
"ellipsis",
"nbspace",
"Agrave",
"Atilde",
"Otilde",
"OE",
"oe",
"endash",
"emdash",
"quotedblleft",
"quotedblright",
"quoteleft",
"quoteright",
"divide",
"lozenge",
"ydieresis",
"Ydieresis",
"fraction",
"currency",
"guilsinglleft",
"guilsinglright",
"fi",
"fl",
"daggerdbl",
"periodcentered",
"quotesinglbase",
"quotedblbase",
"perthousand",
"Acircumflex",
"Ecircumflex",
"Aacute",
"Edieresis",
"Egrave",
"Iacute",
"Icircumflex",
"Idieresis",
"Igrave",
"Oacute",
"Ocircumflex",
"applelogo",
"Ograve",
"Uacute",
"Ucircumflex",
"Ugrave",
"dotlessi",
"circumflex",
"tilde",
"overscore",
"breve",
"dotaccent",
"ring",
"cedilla",
"hungarumlaut",
"ogonek",
"caron",
"Lslash",
"lslash",
"Scaron",
"scaron",
"Zcaron",
"zcaron",
"brokenbar",
"Eth",
"eth",
"Yacute",
"yacute",
"Thorn",
"thorn",
"minus",
"multiply",
"onesuperior",
"twosuperior",
"threesuperior",
"onehalf",
"onequarter",
"threequarters",
"franc",
"Gbreve",
"gbreve",
"Idot",
"Scedilla",
"scedilla",
"Cacute",
"cacute",
"Ccaron",
"ccaron",
"dmacron"
};
TrueTypeFontFile::TrueTypeFontFile(const char *file, int len) {
int pos, i;
this->file = file;
this->len = len;
encoding = NULL;
freeEnc = gTrue;
// read table directory
nTables = getUShort(4);
tableHdrs = (TTFontTableHdr *)gmalloc(nTables * sizeof(TTFontTableHdr));
pos = 12;
for (i = 0; i < nTables; ++i) {
tableHdrs[i].tag[0] = getByte(pos+0);
tableHdrs[i].tag[1] = getByte(pos+1);
tableHdrs[i].tag[2] = getByte(pos+2);
tableHdrs[i].tag[3] = getByte(pos+3);
tableHdrs[i].checksum = getULong(pos+4);
tableHdrs[i].offset = getULong(pos+8);
tableHdrs[i].length = getULong(pos+12);
pos += 16;
}
// check for tables that are required by both the TrueType spec
// and the Type 42 spec
if (seekTable("head") < 0 ||
seekTable("hhea") < 0 ||
seekTable("loca") < 0 ||
seekTable("maxp") < 0 ||
seekTable("glyf") < 0 ||
seekTable("hmtx") < 0) {
error(-1, "TrueType font file is missing a required table");
return;
}
// read the 'head' table
pos = seekTable("head");
bbox[0] = getShort(pos + 36);
bbox[1] = getShort(pos + 38);
bbox[2] = getShort(pos + 40);
bbox[3] = getShort(pos + 42);
locaFmt = getShort(pos + 50);
// read the 'maxp' table
pos = seekTable("maxp");
nGlyphs = getUShort(pos + 4);
}
TrueTypeFontFile::~TrueTypeFontFile() {
if (encoding && freeEnc) {
delete encoding;
}
gfree(tableHdrs);
}
const char *TrueTypeFontFile::getName() {
return NULL;
}
FontEncoding *TrueTypeFontFile::getEncoding(GBool taken) {
int cmap[256];
int nCmaps, cmapPlatform, cmapEncoding, cmapFmt, cmapLen, cmapOffset;
int segCnt, segStart, segEnd, segDelta, segOffset;
int pos, i, j, k;
Guint fmt;
GString *s;
int stringIdx, stringPos, len;
//----- construct the (char code) -> (glyph idx) mapping
// map everything to the missing glyph
for (i = 0; i < 256; ++i) {
cmap[i] = 0;
}
// look for the 'cmap' table
if ((pos = seekTable("cmap")) >= 0) {
nCmaps = getUShort(pos+2);
// if the font has a Windows-symbol cmap, use it;
// otherwise, use the first cmap in the table
for (i = 0; i < nCmaps; ++i) {
cmapPlatform = getUShort(pos + 4 + 8*i);
cmapEncoding = getUShort(pos + 4 + 8*i + 2);
if (cmapPlatform == 3 && cmapEncoding == 0) {
break;
}
}
if (i >= nCmaps) {
i = 0;
cmapPlatform = getUShort(pos + 4);
cmapEncoding = getUShort(pos + 4 + 2);
}
pos += getULong(pos + 4 + 8*i + 4);
// read the cmap
cmapFmt = getUShort(pos);
switch (cmapFmt) {
case 0: // byte encoding table (Apple standard)
cmapLen = getUShort(pos + 2);
for (i = 0; i < cmapLen && i < 256; ++i) {
cmap[i] = getByte(pos + 6 + i);
}
break;
case 4: // segment mapping to delta values (Microsoft standard)
if (cmapPlatform == 3 && cmapEncoding == 0) {
// Windows-symbol uses char codes 0xf000 - 0xf0ff
cmapOffset = 0xf000;
} else {
cmapOffset = 0;
}
segCnt = getUShort(pos + 6) / 2;
for (i = 0; i < segCnt; ++i) {
segEnd = getUShort(pos + 14 + 2*i);
segStart = getUShort(pos + 16 + 2*segCnt + 2*i);
segDelta = getUShort(pos + 16 + 4*segCnt + 2*i);
segOffset = getUShort(pos + 16 + 6*segCnt + 2*i);
if (segStart - cmapOffset <= 0xff &&
segEnd - cmapOffset >= 0) {
for (j = (segStart - cmapOffset >= 0) ? segStart : cmapOffset;
j <= segEnd && j - cmapOffset <= 0xff;
++j) {
if (segOffset == 0) {
k = (j + segDelta) & 0xffff;
} else {
k = getUShort(pos + 16 + 6*segCnt + 2*i +
segOffset + 2 * (j - segStart));
if (k != 0) {
k = (k + segDelta) & 0xffff;
}
}
cmap[j - cmapOffset] = k;
}
}
}
break;
default:
error(-1, "Unimplemented cmap type (%d) in TrueType font file\n",
cmapFmt);
break;
}
}
//----- construct the (glyph idx) -> (glyph name) mapping
//----- and compute the (char code) -> (glyph name) mapping
encoding = new FontEncoding();
if ((pos = seekTable("post")) >= 0) {
fmt = getULong(pos);
// Apple font
if (fmt == 0x00010000) {
for (i = 0; i < 256; ++i) {
j = (cmap[i] < 258) ? cmap[i] : 0;
encoding->addChar(i, copyString(macGlyphNames[j]));
}
// Microsoft font
} else if (fmt == 0x00020000) {
stringIdx = 0;
stringPos = pos + 34 + 2*nGlyphs;
for (i = 0; i < 256; ++i) {
fprintf(stderr, "cmap[%d] = %x (%d)\n", i, cmap[i], cmap[i]);
if (cmap[i] < nGlyphs) {
j = getUShort(pos + 34 + 2 * cmap[i]);
if (j < 258) {
encoding->addChar(i, copyString(macGlyphNames[j]));
} else {
j -= 258;
fprintf(stderr, "j = %x (%d)\n", j, j);
if (j != stringIdx) {
for (stringIdx = 0, stringPos = pos + 34 + 2*nGlyphs;
stringIdx < j;
++stringIdx, stringPos += 1 + getByte(stringPos)) ;
}
len = getByte(stringPos);
s = new GString(file + stringPos + 1, len);
encoding->addChar(i, copyString(s->getCString()));
delete s;
++stringIdx;
stringPos += 1 + len;
}
} else {
encoding->addChar(i, copyString(macGlyphNames[0]));
}
}
// Apple subset
} else if (fmt == 0x00028000) {
for (i = 0; i < 256; ++i) {
if (cmap[i] < nGlyphs) {
j = i + getChar(pos + 32 + cmap[i]);
} else {
j = 0;
}
encoding->addChar(i, copyString(macGlyphNames[j]));
}
// Ugh, just assume the Apple glyph set + Unicode...
} else {
for (i = 0; i < 256; ++i)
if (cmap[i] < 258) {
// Use Mac encoding names for the first Unicode page...
j = (cmap[i] < 258) ? cmap[i] : 0;
encoding->addChar(i, copyString(macGlyphNames[j]));
} else {
// Map other chars to Unicode names...
char uniCODE[8];
sprintf(uniCODE, "uni%04X", cmap[i]);
encoding->addChar(i, copyString(uniCODE));
}
}
// no "post" table: assume the Apple glyph set
} else {
for (i = 0; i < 256; ++i) {
j = (cmap[i] < 258) ? cmap[i] : 0;
encoding->addChar(i, copyString(macGlyphNames[j]));
}
}
if (taken) {
freeEnc = gFalse;
}
return encoding;
}
void TrueTypeFontFile::convertToType42(const char *name, FontEncoding *encoding,
FILE *out) {
// write the header
fprintf(out, "%%!PS-TrueTypeFont-%g\n", getFixed(0));
// begin the font dictionary
fprintf(out, "10 dict begin\n");
fprintf(out, "/FontName /%s def\n", name);
fprintf(out, "/FontType 42 def\n");
fprintf(out, "/FontMatrix [1 0 0 1 0 0] def\n");
fprintf(out, "/FontBBox [%d %d %d %d] def\n",
bbox[0], bbox[1], bbox[2], bbox[3]);
fprintf(out, "/PaintType 0 def\n");
// write the guts of the dictionary
cvtEncoding(encoding, out);
cvtCharStrings(encoding, out);
cvtSfnts(out);
// end the dictionary and define the font
fprintf(out, "FontName currentdict end definefont pop\n");
}
int TrueTypeFontFile::getByte(int pos) {
return file[pos] & 0xff;
}
int TrueTypeFontFile::getChar(int pos) {
int x;
x = file[pos] & 0xff;
if (x & 0x80)
x |= 0xffffff00;
return x;
}
int TrueTypeFontFile::getUShort(int pos) {
int x;
x = file[pos] & 0xff;
x = (x << 8) + (file[pos+1] & 0xff);
return x;
}
int TrueTypeFontFile::getShort(int pos) {
int x;
x = file[pos] & 0xff;
x = (x << 8) + (file[pos+1] & 0xff);
if (x & 0x8000)
x |= 0xffff0000;
return x;
}
Guint TrueTypeFontFile::getULong(int pos) {
int x;
x = file[pos] & 0xff;
x = (x << 8) + (file[pos+1] & 0xff);
x = (x << 8) + (file[pos+2] & 0xff);
x = (x << 8) + (file[pos+3] & 0xff);
return x;
}
double TrueTypeFontFile::getFixed(int pos) {
int x, y;
x = getShort(pos);
y = getUShort(pos+2);
return (double)x + (double)y / 65536;
}
int TrueTypeFontFile::seekTable(const char *tag) {
int i;
for (i = 0; i < nTables; ++i) {
if (!strncmp(tableHdrs[i].tag, tag, 4))
return tableHdrs[i].offset;
}
return -1;
}
void TrueTypeFontFile::cvtEncoding(FontEncoding *encoding, FILE *out) {
const char *name;
int i;
fprintf(out, "/Encoding 256 array\n");
for (i = 0; i < 256; ++i) {
if (!(name = encoding->getCharName(i))) {
name = ".notdef";
}
fprintf(out, "dup %d /%s put\n", i, name);
}
fprintf(out, "readonly def\n");
}
void TrueTypeFontFile::cvtCharStrings(FontEncoding *encoding, FILE *out) {
int cmap[256];
int nCmaps, cmapPlatform, cmapEncoding, cmapFmt, cmapLen, cmapOffset;
int segCnt, segStart, segEnd, segDelta, segOffset;
const char *name;
int pos, i, j, k;
//----- read the cmap: construct the (char code) -> (glyph idx) mapping
// map everything to the missing glyph
for (i = 0; i < 256; ++i) {
cmap[i] = 0;
}
// look for the 'cmap' table
if ((pos = seekTable("cmap")) >= 0) {
nCmaps = getUShort(pos+2);
// if the font has a Windows-symbol cmap, use it;
// otherwise, use the first cmap in the table
for (i = 0; i < nCmaps; ++i) {
cmapPlatform = getUShort(pos + 4 + 8*i);
cmapEncoding = getUShort(pos + 4 + 8*i + 2);
if (cmapPlatform == 3 && cmapEncoding == 0) {
break;
}
}
if (i >= nCmaps) {
i = 0;
cmapPlatform = getUShort(pos + 4);
cmapEncoding = getUShort(pos + 4 + 2);
}
pos += getULong(pos + 4 + 8*i + 4);
// read the cmap
cmapFmt = getUShort(pos);
switch (cmapFmt) {
case 0: // byte encoding table (Apple standard)
cmapLen = getUShort(pos + 2);
for (i = 0; i < cmapLen && i < 256; ++i) {
cmap[i] = getByte(pos + 6 + i);
}
break;
case 4: // segment mapping to delta values (Microsoft standard)
if (cmapPlatform == 3 && cmapEncoding == 0) {
// Windows-symbol uses char codes 0xf000 - 0xf0ff
cmapOffset = 0xf000;
} else {
cmapOffset = 0;
}
segCnt = getUShort(pos + 6) / 2;
for (i = 0; i < segCnt; ++i) {
segEnd = getUShort(pos + 14 + 2*i);
segStart = getUShort(pos + 16 + 2*segCnt + 2*i);
segDelta = getUShort(pos + 16 + 4*segCnt + 2*i);
segOffset = getUShort(pos + 16 + 6*segCnt + 2*i);
if (segStart - cmapOffset <= 0xff &&
segEnd - cmapOffset >= 0) {
for (j = (segStart - cmapOffset >= 0) ? segStart : cmapOffset;
j <= segEnd && j - cmapOffset <= 0xff;
++j) {
if (segOffset == 0) {
k = (j + segDelta) & 0xffff;
} else {
k = getUShort(pos + 16 + 6*segCnt + 2*i +
segOffset + 2 * (j - segStart));
if (k != 0) {
k = (k + segDelta) & 0xffff;
}
}
cmap[j - cmapOffset] = k;
}
}
}
break;
default:
error(-1, "Unimplemented cmap type (%d) in TrueType font file\n",
cmapFmt);
break;
}
}
//----- map char code to glyph index
// 1. use encoding to map name to char code
// 2. use cmap to map char code to glyph index
fprintf(out, "/CharStrings 256 dict dup begin\n");
fprintf(out, "/.notdef 0 def\n");
// kludge: this loop goes backward because the WinAnsi and MacRoman
// encodings define certain chars multiple times (space, hyphen,
// etc.), and we want the lowest-numbered definition to "stick"
// (because the higher-numbered defn(s) may not have valid cmap
// entries)
i = encoding->getSize();
if (i > 255) {
i = 255;
}
for (; i >= 0; --i) {
name = encoding->getCharName(i);
if (name && strcmp(name, ".notdef")) {
fprintf(out, "/%s %d def\n", name, cmap[i]);
}
}
fprintf(out, "end readonly def\n");
}
void TrueTypeFontFile::cvtSfnts(FILE *out) {
char tableDir[12 + 9*16];
int *list;
int nTablesOut, pos, destPos, i, j, k1, k2;
fprintf(out, "/sfnts [\n");
// count tables
nTablesOut = 0;
for (i = 0; i < 9; ++i) {
for (j = 0; j < nTables; ++j) {
if (!strncmp(t42ReqTables[i], tableHdrs[j].tag, 4)) {
++nTablesOut;
break;
}
}
}
// header
tableDir[0] = 0x00; // sfnt version
tableDir[1] = 0x01;
tableDir[2] = 0x00;
tableDir[3] = 0x00;
tableDir[4] = (nTablesOut >> 8) & 0xff; // numTables
tableDir[5] = nTablesOut & 0xff;
tableDir[6] = 0; // searchRange
tableDir[7] = 128;
tableDir[8] = 0; // entrySelector
tableDir[9] = 3;
tableDir[10] = 0; // rangeShift
tableDir[11] = 16;
// table directory
pos = 12;
destPos = 12 + 16 * nTablesOut;
for (i = 0; i < 9; ++i) {
for (j = 0; j < nTables; ++j) {
if (!strncmp(t42ReqTables[i], tableHdrs[j].tag, 4)) {
break;
}
}
if (j < nTables) {
memcpy(&tableDir[pos], t42ReqTables[i], 4);
tableDir[pos+4] = (tableHdrs[j].checksum >> 24) & 0xff;
tableDir[pos+5] = (tableHdrs[j].checksum >> 16) & 0xff;
tableDir[pos+6] = (tableHdrs[j].checksum >> 8) & 0xff;
tableDir[pos+7] = tableHdrs[j].checksum & 0xff;
tableDir[pos+8] = (destPos >> 24) & 0xff;
tableDir[pos+9] = (destPos >> 16) & 0xff;
tableDir[pos+10] = (destPos >> 8) & 0xff;
tableDir[pos+11] = destPos & 0xff;
tableDir[pos+12] = (tableHdrs[j].length >> 24) & 0xff;
tableDir[pos+13] = (tableHdrs[j].length >> 16) & 0xff;
tableDir[pos+14] = (tableHdrs[j].length >> 8) & 0xff;
tableDir[pos+15] = tableHdrs[j].length & 0xff;
pos += 16;
destPos += tableHdrs[j].length;
if (tableHdrs[j].length & 3) {
destPos += 4 - (tableHdrs[j].length & 3);
}
}
}
dumpString(tableDir, 12 + 16 * nTablesOut, out);
for (i = 0; i < 9; ++i) {
for (j = 0; j < nTables; ++j) {
if (!strncmp(t42ReqTables[i], tableHdrs[j].tag, 4)) {
break;
}
}
if (j < nTables) {
if (!strcmp(t42ReqTables[i], "glyf") && tableHdrs[j].length > 65532) {
// the 'glyf' table won't fit in a single string, and we're only
// allowed to break at glyph boundaries
list = (int *)gmalloc((nGlyphs + 1) * sizeof(int));
pos = seekTable("loca");
for (k1 = 0; k1 <= nGlyphs; ++k1) {
if (locaFmt) {
list[k1] = getULong(pos + 4*k1);
} else {
list[k1] = 2 * getUShort(pos + 2*k1);
}
}
k1 = 0;
while (k1 < nGlyphs) {
for (k2 = k1 + 1;
k2 < nGlyphs && list[k2+1] - list[k1] <= 65532;
++k2) ;
// ghostscript is unhappy if we break at anything other
// than a multiple of four bytes
while (((list[k2] - list[k1]) & 3) && k2 > k1 + 1) {
--k2;
}
dumpString(file + tableHdrs[j].offset + list[k1],
list[k2] - list[k1], out);
k1 = k2;
}
gfree(list);
} else {
dumpString(file + tableHdrs[j].offset, tableHdrs[j].length, out);
}
}
}
fprintf(out, "] def\n");
}
void TrueTypeFontFile::dumpString(const char *s, int len, FILE *out) {
int i, j;
fprintf(out, "<");
for (i = 0; i < len; i += 32) {
for (j = 0; j < 32 && i+j < len; ++j) {
fprintf(out, "%02X", s[i+j] & 0xff);
}
if (i+32 < len) {
fprintf(out, "\n");
}
}
if (len & 3) {
for (i = 0; i < 4 - (len & 3); ++i) {
fprintf(out, "00");
}
}
// append an extra mystery zero byte because the Type 42 spec says so
fprintf(out, "00>\n");
}
+53
Ver Arquivo
@@ -114,4 +114,57 @@ private:
int line; // number of eexec chars on current line
};
//------------------------------------------------------------------------
// TrueTypeFontFile
//------------------------------------------------------------------------
struct TTFontTableHdr;
class TrueTypeFontFile: public FontFile {
public:
TrueTypeFontFile(const char *file, int len);
~TrueTypeFontFile();
// This always returns NULL, since it's probably better to trust the
// font name in the PDF file rather than the one in the TrueType
// font file.
virtual const char *getName();
virtual FontEncoding *getEncoding(GBool taken);
// Convert to a Type 42 font, suitable for embedding in a PostScript
// file. The name will be used as the PostScript font name (so we
// don't need to depend on the 'name' table in the font). The
// encoding is needed because the PDF Font object can modify the
// encoding.
void convertToType42(const char *name, FontEncoding *encoding, FILE *out);
private:
const char *file;
int len;
FontEncoding *encoding;
GBool freeEnc;
TTFontTableHdr *tableHdrs;
int nTables;
int bbox[4];
int locaFmt;
int nGlyphs;
int getByte(int pos);
int getChar(int pos);
int getUShort(int pos);
int getShort(int pos);
Guint getULong(int pos);
double getFixed(int pos);
int seekTable(const char *tag);
void cvtEncoding(FontEncoding *encoding, FILE *out);
void cvtCharStrings(FontEncoding *encoding, FILE *out);
void cvtSfnts(FILE *out);
void dumpString(const char *s, int len, FILE *out);
};
#endif
+17 -4
Ver Arquivo
@@ -106,7 +106,7 @@ GfxFont::GfxFont(const char *tag1, Ref id1, Dict *fontDict) {
// without embedding them, so munge the names into the equivalent
// PostScript names. This is a kludge -- it would be nice if Adobe
// followed their own spec.
if (type == fontTrueType) {
if (type == fontTrueType && name) {
p = name->getCString();
name2 = NULL;
if (!strncmp(p, "Arial", 5)) {
@@ -433,7 +433,7 @@ void GfxFont::getEncAndWidths(Dict *fontDict, BuiltinFont *builtinFont,
obj1.free();
// check embedded or external font file for base encoding
if ((type == fontType1 || type == fontType1C) &&
if ((type == fontType1 || type == fontType1C || type == fontTrueType) &&
(extFontFile || embFontID.num >= 0)) {
if (extFontFile)
buf = readExtFontFile(&len);
@@ -442,8 +442,10 @@ void GfxFont::getEncAndWidths(Dict *fontDict, BuiltinFont *builtinFont,
if (buf) {
if (type == fontType1)
fontFile = new Type1FontFile(buf, len);
else
else if (type == fontType1C)
fontFile = new Type1CFontFile(buf, len);
else
fontFile = new TrueTypeFontFile(buf, len);
if (fontFile->getName()) {
if (embFontName)
delete embFontName;
@@ -601,6 +603,8 @@ void GfxFont::makeWidths(Dict *fontDict, FontEncoding *builtinEncoding,
if ((charName = encoding->getCharName(code)) &&
(code2 = builtinEncoding->getCharCode(charName)) >= 0)
widths[code] = builtinWidths[code2] * 0.001;
else
widths[code] = builtinWidths[' '] * 0.001;
}
// get widths from font dict
@@ -712,8 +716,14 @@ void GfxFont::getType0EncAndWidths(Dict *fontDict) {
error(-1, "Xpdf was compiled without Chinese CNS font support");
goto err4;
#endif
#if 0 // This needs a lot of work to support Identity (Unicode) mapping
} else if (obj4.getString()->cmp("Adobe") == 0 &&
obj5.getString()->cmp("Identity") == 0) {
is16 = gTrue;
enc16.charSet = font16AdobeIdentity;
#endif // 0
} else {
error(-1, "Uknown Type 0 character set: %s-%s",
error(-1, "Unknown Type 0 character set: %s-%s",
obj4.getString()->getCString(), obj5.getString()->getCString());
goto err4;
}
@@ -956,6 +966,9 @@ void GfxFont::getType0EncAndWidths(Dict *fontDict) {
enc16.enc = gfxCNS13Tab[i].enc;
}
# endif
if (enc16.charSet == font16AdobeIdentity) {
enc16.enc = NULL;
}
obj1.free();
return;
+2 -1
Ver Arquivo
@@ -28,7 +28,8 @@ struct BuiltinFont;
enum GfxFontCharSet16 {
font16AdobeJapan12, // Adobe-Japan1-2
font16AdobeGB12, // Adobe-GB1-2 (Chinese)
font16AdobeCNS13 // Adobe-CNS1-3 (Chinese)
font16AdobeCNS13, // Adobe-CNS1-3 (Chinese)
font16AdobeIdentity // Adobe-Identity (Unicode)
};
//------------------------------------------------------------------------
+856
Ver Arquivo
@@ -10,8 +10,10 @@
#pragma implementation
#endif
#include <stdlib.h>
#include <stddef.h>
#include <math.h>
#include <ctype.h>
#include <string.h> // for memcpy()
#include "gmem.h"
#include "Error.h"
@@ -1273,6 +1275,8 @@ Function *Function::parse(Object *funcObj) {
func = new SampledFunction(funcObj, dict);
} else if (funcType == 2) {
func = new ExponentialFunction(funcObj, dict);
} else if (funcType == 4) {
func = new PostScriptFunction(funcObj, dict);
} else {
error(-1, "Unimplemented function type");
return NULL;
@@ -1689,6 +1693,858 @@ void ExponentialFunction::transform(double *in, double *out) {
return;
}
//------------------------------------------------------------------------
// PostScriptFunction
//------------------------------------------------------------------------
enum PSOp {
psOpAbs,
psOpAdd,
psOpAnd,
psOpAtan,
psOpBitshift,
psOpCeiling,
psOpCopy,
psOpCos,
psOpCvi,
psOpCvr,
psOpDiv,
psOpDup,
psOpEq,
psOpExch,
psOpExp,
psOpFalse,
psOpFloor,
psOpGe,
psOpGt,
psOpIdiv,
psOpIndex,
psOpLe,
psOpLn,
psOpLog,
psOpLt,
psOpMod,
psOpMul,
psOpNe,
psOpNeg,
psOpNot,
psOpOr,
psOpPop,
psOpRoll,
psOpRound,
psOpSin,
psOpSqrt,
psOpSub,
psOpTrue,
psOpTruncate,
psOpXor,
psOpIf,
psOpIfelse,
psOpReturn
};
// Note: 'if' and 'ifelse' are parsed separately.
// The rest are listed here in alphabetical order.
// The index in this table is equivalent to the entry in PSOp.
char *psOpNames[] = {
"abs",
"add",
"and",
"atan",
"bitshift",
"ceiling",
"copy",
"cos",
"cvi",
"cvr",
"div",
"dup",
"eq",
"exch",
"exp",
"false",
"floor",
"ge",
"gt",
"idiv",
"index",
"le",
"ln",
"log",
"lt",
"mod",
"mul",
"ne",
"neg",
"not",
"or",
"pop",
"roll",
"round",
"sin",
"sqrt",
"sub",
"true",
"truncate",
"xor"
};
#define nPSOps (sizeof(psOpNames) / sizeof(char *))
enum PSObjectType {
psBool,
psInt,
psReal,
psOperator,
psBlock
};
// In the code array, 'if'/'ifelse' operators take up three slots
// plus space for the code in the subclause(s).
//
// +---------------------------------+
// | psOperator: psOpIf / psOpIfelse |
// +---------------------------------+
// | psBlock: ptr=<A> |
// +---------------------------------+
// | psBlock: ptr=<B> |
// +---------------------------------+
// | if clause |
// | ... |
// | psOperator: psOpReturn |
// +---------------------------------+
// <A> | else clause |
// | ... |
// | psOperator: psOpReturn |
// +---------------------------------+
// <B> | ... |
//
// For 'if', pointer <A> is present in the code stream but unused.
struct PSObject {
PSObjectType type;
union {
GBool booln; // boolean (stack only)
int intg; // integer (stack and code)
double real; // real (stack and code)
PSOp op; // operator (code only)
int blk; // if/ifelse block pointer (code only)
};
};
#define psStackSize 100
class PSStack {
public:
PSStack() { sp = psStackSize; }
void pushBool(GBool booln);
void pushInt(int intg);
void pushReal(double real);
GBool popBool();
int popInt();
double popNum();
GBool empty() { return sp == psStackSize; }
GBool topIsInt() { return sp < psStackSize && stack[sp].type == psInt; }
GBool topTwoAreInts()
{ return sp < psStackSize - 1 &&
stack[sp].type == psInt &&
stack[sp+1].type == psInt; }
GBool topIsReal() { return sp < psStackSize && stack[sp].type == psReal; }
GBool topTwoAreNums()
{ return sp < psStackSize - 1 &&
(stack[sp].type == psInt || stack[sp].type == psReal) &&
(stack[sp+1].type == psInt || stack[sp+1].type == psReal); }
void copy(int n);
void roll(int n, int j);
void index(int i);
void pop();
private:
GBool checkOverflow(int n = 1);
GBool checkUnderflow();
GBool checkType(PSObjectType t1, PSObjectType t2);
PSObject stack[psStackSize];
int sp;
};
GBool PSStack::checkOverflow(int n) {
if (sp - n < 0) {
error(-1, "Stack overflow in PostScript function");
return gFalse;
}
return gTrue;
}
GBool PSStack::checkUnderflow() {
if (sp == psStackSize) {
error(-1, "Stack underflow in PostScript function");
return gFalse;
}
return gTrue;
}
GBool PSStack::checkType(PSObjectType t1, PSObjectType t2) {
if (stack[sp].type != t1 && stack[sp].type != t2) {
error(-1, "Type mismatch in PostScript function");
return gFalse;
}
return gTrue;
}
void PSStack::pushBool(GBool booln) {
if (checkOverflow()) {
stack[--sp].type = psBool;
stack[sp].booln = booln;
}
}
void PSStack::pushInt(int intg) {
if (checkOverflow()) {
stack[--sp].type = psInt;
stack[sp].intg = intg;
}
}
void PSStack::pushReal(double real) {
if (checkOverflow()) {
stack[--sp].type = psReal;
stack[sp].real = real;
}
}
GBool PSStack::popBool() {
if (checkUnderflow() && checkType(psBool, psBool)) {
return stack[sp++].booln;
}
return gFalse;
}
int PSStack::popInt() {
if (checkUnderflow() && checkType(psInt, psInt)) {
return stack[sp++].intg;
}
return 0;
}
double PSStack::popNum() {
double ret;
if (checkUnderflow() && checkType(psInt, psReal)) {
ret = (stack[sp].type == psInt) ? (double)stack[sp].intg : stack[sp].real;
++sp;
return ret;
}
return 0;
}
void PSStack::copy(int n) {
int i;
if (!checkOverflow(n)) {
return;
}
for (i = sp + n - 1; i <= sp; ++i) {
stack[i - n] = stack[i];
}
sp -= n;
}
void PSStack::roll(int n, int j) {
PSObject obj;
int i, k;
if (j >= 0) {
j %= n;
} else {
j = -j % n;
if (j != 0) {
j = n - j;
}
}
if (n <= 0 || j == 0) {
return;
}
for (i = 0; i < j; ++i) {
obj = stack[sp];
for (k = sp; k < sp + n - 1; ++k) {
stack[k] = stack[k+1];
}
stack[sp + n - 1] = obj;
}
}
void PSStack::index(int i) {
if (!checkOverflow()) {
return;
}
--sp;
stack[sp] = stack[sp + 1 + i];
}
void PSStack::pop() {
if (!checkUnderflow()) {
return;
}
++sp;
}
PostScriptFunction::PostScriptFunction(Object *funcObj, Dict *dict) {
Stream *str;
int codePtr;
GString *tok;
code = NULL;
codeSize = 0;
ok = gFalse;
//----- initialize the generic stuff
if (!init(dict)) {
goto err1;
}
if (!hasRange) {
error(-1, "Type 4 function is missing range");
goto err1;
}
//----- get the stream
if (!funcObj->isStream()) {
error(-1, "Type 4 function isn't a stream");
goto err1;
}
str = funcObj->getStream();
//----- parse the function
str->reset();
if (!(tok = getToken(str)) || tok->cmp("{")) {
error(-1, "Expected '{' at start of PostScript function");
if (tok) {
delete tok;
}
goto err1;
}
delete tok;
codePtr = 0;
if (!parseCode(str, &codePtr)) {
goto err2;
}
str->close();
ok = gTrue;
err2:
str->close();
err1:
return;
}
PostScriptFunction::PostScriptFunction(PostScriptFunction *func) {
memcpy(this, func, sizeof(PostScriptFunction));
code = (PSObject *)gmalloc(codeSize * sizeof(PSObject));
memcpy(code, func->code, codeSize * sizeof(PSObject));
}
PostScriptFunction::~PostScriptFunction() {
gfree(code);
}
void PostScriptFunction::transform(double *in, double *out) {
PSStack *stack;
int i;
stack = new PSStack();
for (i = 0; i < m; ++i) {
//~ may need to check for integers here
stack->pushReal(in[i]);
}
exec(stack, 0);
for (i = n - 1; i >= 0; --i) {
out[i] = stack->popNum();
if (out[i] < range[i][0]) {
out[i] = range[i][0];
} else if (out[i] > range[i][1]) {
out[i] = range[i][1];
}
}
// if (!stack->empty()) {
// error(-1, "Extra values on stack at end of PostScript function");
// }
delete stack;
}
GBool PostScriptFunction::parseCode(Stream *str, int *codePtr) {
GString *tok;
char *p;
GBool isReal;
int opPtr, elsePtr;
int a, b, m, cmp;
while (1) {
if (!(tok = getToken(str))) {
error(-1, "Unexpected end of PostScript function stream");
return gFalse;
}
p = tok->getCString();
if (isdigit(*p) || *p == '.' || *p == '-') {
isReal = gFalse;
for (++p; *p; ++p) {
if (*p == '.') {
isReal = gTrue;
break;
}
}
resizeCode(*codePtr);
if (isReal) {
code[*codePtr].type = psReal;
code[*codePtr].real = atof(tok->getCString());
} else {
code[*codePtr].type = psInt;
code[*codePtr].intg = atoi(tok->getCString());
}
++*codePtr;
delete tok;
} else if (!tok->cmp("{")) {
delete tok;
opPtr = *codePtr;
*codePtr += 3;
resizeCode(opPtr + 2);
if (!parseCode(str, codePtr)) {
return gFalse;
}
if (!(tok = getToken(str))) {
error(-1, "Unexpected end of PostScript function stream");
return gFalse;
}
if (!tok->cmp("{")) {
elsePtr = *codePtr;
if (!parseCode(str, codePtr)) {
return gFalse;
}
} else {
elsePtr = -1;
}
delete tok;
if (!(tok = getToken(str))) {
error(-1, "Unexpected end of PostScript function stream");
return gFalse;
}
if (!tok->cmp("if")) {
if (elsePtr >= 0) {
error(-1, "Got 'if' operator with two blocks in PostScript function");
return gFalse;
}
code[opPtr].type = psOperator;
code[opPtr].op = psOpIf;
code[opPtr+2].type = psBlock;
code[opPtr+2].blk = *codePtr;
} else if (!tok->cmp("ifelse")) {
if (elsePtr < 0) {
error(-1, "Got 'ifelse' operator with one blocks in PostScript function");
return gFalse;
}
code[opPtr].type = psOperator;
code[opPtr].op = psOpIfelse;
code[opPtr+1].type = psBlock;
code[opPtr+1].blk = elsePtr;
code[opPtr+2].type = psBlock;
code[opPtr+2].blk = *codePtr;
} else {
error(-1, "Expected if/ifelse operator in PostScript function");
delete tok;
return gFalse;
}
delete tok;
} else if (!tok->cmp("}")) {
delete tok;
resizeCode(*codePtr);
code[*codePtr].type = psOperator;
code[*codePtr].op = psOpReturn;
++*codePtr;
break;
} else {
a = -1;
b = nPSOps;
// invariant: psOpNames[a] < tok < psOpNames[b]
while (b - a > 1) {
m = (a + b) / 2;
cmp = tok->cmp(psOpNames[m]);
if (cmp > 0) {
a = m;
} else if (cmp < 0) {
b = m;
} else {
a = b = m;
}
}
if (cmp != 0) {
error(-1, "Unknown operator '%s' in PostScript function",
tok->getCString());
delete tok;
return gFalse;
}
delete tok;
resizeCode(*codePtr);
code[*codePtr].type = psOperator;
code[*codePtr].op = (PSOp)a;
++*codePtr;
}
}
return gTrue;
}
GString *PostScriptFunction::getToken(Stream *str) {
GString *s;
int c;
s = new GString();
do {
c = str->getChar();
} while (c != EOF && isspace(c));
if (c == '{' || c == '}') {
s->append((char)c);
} else if (isdigit(c) || c == '.' || c == '-') {
while (1) {
s->append((char)c);
c = str->lookChar();
if (c == EOF || !(isdigit(c) || c == '.' || c == '-')) {
break;
}
str->getChar();
}
} else {
while (1) {
s->append((char)c);
c = str->lookChar();
if (c == EOF || !isalnum(c)) {
break;
}
str->getChar();
}
}
return s;
}
void PostScriptFunction::resizeCode(int newSize) {
if (newSize >= codeSize) {
codeSize += 64;
code = (PSObject *)grealloc(code, codeSize * sizeof(PSObject));
}
}
void PostScriptFunction::exec(PSStack *stack, int codePtr) {
int i1, i2;
double r1, r2;
GBool b1, b2;
while (1) {
switch (code[codePtr].type) {
case psInt:
stack->pushInt(code[codePtr++].intg);
break;
case psReal:
stack->pushReal(code[codePtr++].real);
break;
case psOperator:
switch (code[codePtr++].op) {
case psOpAbs:
if (stack->topIsInt()) {
stack->pushInt(abs(stack->popInt()));
} else {
stack->pushReal(fabs(stack->popNum()));
}
break;
case psOpAdd:
if (stack->topTwoAreInts()) {
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushInt(i1 + i2);
} else {
r2 = stack->popNum();
r1 = stack->popNum();
stack->pushReal(r1 + r2);
}
break;
case psOpAnd:
if (stack->topTwoAreInts()) {
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushInt(i1 & i2);
} else {
b2 = stack->popBool();
b1 = stack->popBool();
stack->pushReal(b1 && b2);
}
break;
case psOpAtan:
r2 = stack->popNum();
r1 = stack->popNum();
stack->pushReal(atan2(r1, r2));
break;
case psOpBitshift:
i2 = stack->popInt();
i1 = stack->popInt();
if (i2 > 0) {
stack->pushInt(i1 << i2);
} else if (i2 < 0) {
stack->pushInt((int)((Guint)i1 >> i2));
} else {
stack->pushInt(i1);
}
break;
case psOpCeiling:
if (!stack->topIsInt()) {
stack->pushReal(ceil(stack->popNum()));
}
break;
case psOpCopy:
stack->copy(stack->popInt());
break;
case psOpCos:
stack->pushReal(cos(stack->popNum()));
break;
case psOpCvi:
if (!stack->topIsInt()) {
stack->pushInt((int)stack->popNum());
}
break;
case psOpCvr:
if (!stack->topIsReal()) {
stack->pushReal(stack->popNum());
}
break;
case psOpDiv:
r2 = stack->popNum();
r1 = stack->popNum();
stack->pushReal(r1 / r2);
break;
case psOpDup:
stack->copy(1);
break;
case psOpEq:
if (stack->topTwoAreInts()) {
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushBool(i1 == i2);
} else if (stack->topTwoAreNums()) {
r2 = stack->popNum();
r1 = stack->popNum();
stack->pushBool(r1 == r2);
} else {
b2 = stack->popBool();
b1 = stack->popBool();
stack->pushBool(b1 == b2);
}
break;
case psOpExch:
stack->roll(2, 1);
break;
case psOpExp:
r2 = stack->popInt();
r1 = stack->popInt();
stack->pushReal(pow(r1, r2));
break;
case psOpFalse:
stack->pushBool(gFalse);
break;
case psOpFloor:
if (!stack->topIsInt()) {
stack->pushReal(floor(stack->popNum()));
}
break;
case psOpGe:
if (stack->topTwoAreInts()) {
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushBool(i1 >= i2);
} else {
r2 = stack->popNum();
r1 = stack->popNum();
stack->pushBool(r1 >= r2);
}
break;
case psOpGt:
if (stack->topTwoAreInts()) {
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushBool(i1 > i2);
} else {
r2 = stack->popNum();
r1 = stack->popNum();
stack->pushBool(r1 > r2);
}
break;
case psOpIdiv:
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushInt(i1 / i2);
break;
case psOpIndex:
stack->index(stack->popInt());
break;
case psOpLe:
if (stack->topTwoAreInts()) {
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushBool(i1 <= i2);
} else {
r2 = stack->popNum();
r1 = stack->popNum();
stack->pushBool(r1 <= r2);
}
break;
case psOpLn:
stack->pushReal(log(stack->popNum()));
break;
case psOpLog:
stack->pushReal(log10(stack->popNum()));
break;
case psOpLt:
if (stack->topTwoAreInts()) {
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushBool(i1 < i2);
} else {
r2 = stack->popNum();
r1 = stack->popNum();
stack->pushBool(r1 < r2);
}
break;
case psOpMod:
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushInt(i1 % i2);
break;
case psOpMul:
if (stack->topTwoAreInts()) {
i2 = stack->popInt();
i1 = stack->popInt();
//~ should check for out-of-range, and push a real instead
stack->pushInt(i1 * i2);
} else {
r2 = stack->popNum();
r1 = stack->popNum();
stack->pushReal(r1 * r2);
}
break;
case psOpNe:
if (stack->topTwoAreInts()) {
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushBool(i1 != i2);
} else if (stack->topTwoAreNums()) {
r2 = stack->popNum();
r1 = stack->popNum();
stack->pushBool(r1 != r2);
} else {
b2 = stack->popBool();
b1 = stack->popBool();
stack->pushBool(b1 != b2);
}
break;
case psOpNeg:
if (stack->topIsInt()) {
stack->pushInt(-stack->popInt());
} else {
stack->pushReal(-stack->popNum());
}
break;
case psOpNot:
if (stack->topIsInt()) {
stack->pushInt(~stack->popInt());
} else {
stack->pushReal(!stack->popBool());
}
break;
case psOpOr:
if (stack->topTwoAreInts()) {
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushInt(i1 | i2);
} else {
b2 = stack->popBool();
b1 = stack->popBool();
stack->pushReal(b1 || b2);
}
break;
case psOpPop:
stack->pop();
break;
case psOpRoll:
i2 = stack->popInt();
i1 = stack->popInt();
stack->roll(i1, i2);
break;
case psOpRound:
if (!stack->topIsInt()) {
r1 = stack->popNum();
stack->pushReal((r1 >= 0) ? floor(r1 + 0.5) : ceil(r1 - 0.5));
}
break;
case psOpSin:
stack->pushReal(cos(stack->popNum()));
break;
case psOpSqrt:
stack->pushReal(sqrt(stack->popNum()));
break;
case psOpSub:
if (stack->topTwoAreInts()) {
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushInt(i1 - i2);
} else {
r2 = stack->popNum();
r1 = stack->popNum();
stack->pushReal(r1 - r2);
}
break;
case psOpTrue:
stack->pushBool(gTrue);
break;
case psOpTruncate:
if (!stack->topIsInt()) {
r1 = stack->popNum();
stack->pushReal((r1 >= 0) ? floor(r1) : ceil(r1));
}
break;
case psOpXor:
if (stack->topTwoAreInts()) {
i2 = stack->popInt();
i1 = stack->popInt();
stack->pushInt(i1 ^ i2);
} else {
b2 = stack->popBool();
b1 = stack->popBool();
stack->pushReal(b1 ^ b2);
}
break;
case psOpIf:
b1 = stack->popBool();
if (b1) {
exec(stack, codePtr + 2);
}
codePtr = code[codePtr + 1].blk;
break;
case psOpIfelse:
b1 = stack->popBool();
if (b1) {
exec(stack, codePtr + 2);
} else {
exec(stack, code[codePtr].blk);
}
codePtr = code[codePtr + 1].blk;
break;
case psOpReturn:
return;
}
break;
default:
error(-1, "Internal: bad object in PostScript function code");
break;
}
}
}
//------------------------------------------------------------------------
// GfxImageColorMap
//------------------------------------------------------------------------
+27
Ver Arquivo
@@ -19,6 +19,8 @@
class Array;
class Function;
class GfxFont;
struct PSObject;
class PSStack;
//------------------------------------------------------------------------
// GfxColor
@@ -594,6 +596,31 @@ private:
GBool ok;
};
//------------------------------------------------------------------------
// PostScriptFunction
//------------------------------------------------------------------------
class PostScriptFunction: public Function {
public:
PostScriptFunction(Object *funcObj, Dict *dict);
virtual ~PostScriptFunction();
virtual Function *copy() { return new PostScriptFunction(this); }
virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; }
private:
PostScriptFunction(PostScriptFunction *func);
GBool parseCode(Stream *str, int *codePtr);
GString *getToken(Stream *str);
void resizeCode(int newSize);
void exec(PSStack *stack, int codePtr);
PSObject *code;
int codeSize;
GBool ok;
};
//------------------------------------------------------------------------
// GfxImageColorMap
//------------------------------------------------------------------------
+66 -32
Ver Arquivo
@@ -467,16 +467,12 @@ PSOutputDev::~PSOutputDev() {
if (f) {
if (doForm) {
writePS("/Foo exch /Form defineresource pop\n");
} else if (psOutEPS) {
} else {
writePS("%%%%Trailer\n");
writePS("end\n");
writePS("%%%%DocumentSuppliedResources:\n");
writePS("%s", embFontList->getCString());
writePS("%%%%EOF\n");
} else {
writePS("%%%%Trailer\n");
writePS("end\n");
writePS("%%%%EOF\n");
}
if (fileType == psFile) {
#ifdef MACOS
@@ -600,6 +596,11 @@ void PSOutputDev::setupFont(GfxFont *font) {
psName = font->getEmbeddedFontName();
setupEmbeddedType1CFont(font, &fontFileID, psName);
} else if (embedType1 && font->getType() == fontTrueType &&
font->getEmbeddedFontID(&fontFileID)) {
psName = font->getEmbeddedFontName();
setupEmbeddedTrueTypeFont(font, &fontFileID, psName);
} else if (font->is16Bit() && font->getCharSet16() == font16AdobeJapan12) {
psName = "Ryumin-Light-RKSJ";
do16Bit = gTrue;
@@ -634,6 +635,8 @@ void PSOutputDev::setupFont(GfxFont *font) {
if (font->isItalic())
i += 1;
psName = psSubstFonts[i].psName;
fprintf(stderr, "DEBUG: Substituting font %d (%s) for Type3 font...\n",
i, psName);
if ((code = font->getCharCode("m")) >= 0) {
w1 = font->getWidth(code);
} else {
@@ -660,6 +663,9 @@ void PSOutputDev::setupFont(GfxFont *font) {
}
}
fprintf(stderr, "psName = \"%s\", type = %d, is16Bit = %d\n", psName,
font->getType(), font->is16Bit());
// generate PostScript code to set up the font
if (do16Bit) {
writePS("/F%d_%d /%s pdfMakeFont16\n",
@@ -671,7 +677,9 @@ void PSOutputDev::setupFont(GfxFont *font) {
writePS((i == 0) ? "[ " : " ");
for (j = 0; j < 8; ++j) {
charName = font->getCharName(i+j);
writePS("/%s", charName ? charName : (i + j) == 32 ? "space" : ".notdef");
if ((!charName || strcmp(charName, ".notdef") == 0) && (i + j) == 32)
charName = "space";
writePS("/%s", charName ? charName : ".notdef");
}
writePS((i == 256-8) ? "]\n" : "\n");
}
@@ -729,12 +737,10 @@ void PSOutputDev::setupEmbeddedType1Font(Ref *id, const char *psName) {
obj2.free();
// beginning comment
if (psOutEPS) {
writePS("%%%%BeginResource: font %s\n", psName);
embFontList->append("%%+ font ");
embFontList->append(psName);
embFontList->append("\n");
}
writePS("%%%%BeginResource: font %s\n", psName);
embFontList->append("%%+ font ");
embFontList->append(psName);
embFontList->append("\n");
// copy ASCII portion of font
strObj.streamReset();
@@ -790,9 +796,7 @@ void PSOutputDev::setupEmbeddedType1Font(Ref *id, const char *psName) {
writePS("cleartomark\n");
// ending comment
if (psOutEPS) {
writePS("%%%%EndResource\n");
}
writePS("%%%%EndResource\n");
err1:
strObj.streamClose();
@@ -822,12 +826,10 @@ void PSOutputDev::setupEmbeddedType1Font(GString *fileName, const char *psName)
fontFileNames[fontFileNameLen++] = fileName->copy();
// beginning comment
if (psOutEPS) {
writePS("%%%%BeginResource: font %s\n", psName);
embFontList->append("%%+ font ");
embFontList->append(psName);
embFontList->append("\n");
}
writePS("%%%%BeginResource: font %s\n", psName);
embFontList->append("%%+ font ");
embFontList->append(psName);
embFontList->append("\n");
// copy the font file
if (!(fontFile = fopen(fileName->getCString(), "rb"))) {
@@ -839,9 +841,7 @@ void PSOutputDev::setupEmbeddedType1Font(GString *fileName, const char *psName)
fclose(fontFile);
// ending comment
if (psOutEPS) {
writePS("%%%%EndResource\n");
}
writePS("%%%%EndResource\n");
}
void PSOutputDev::setupEmbeddedType1CFont(GfxFont *font, Ref *id,
@@ -866,12 +866,10 @@ void PSOutputDev::setupEmbeddedType1CFont(GfxFont *font, Ref *id,
fontFileIDs[fontFileIDLen++] = *id;
// beginning comment
if (psOutEPS) {
writePS("%%%%BeginResource: font %s\n", psName);
embFontList->append("%%+ font ");
embFontList->append(psName);
embFontList->append("\n");
}
writePS("%%%%BeginResource: font %s\n", psName);
embFontList->append("%%+ font ");
embFontList->append(psName);
embFontList->append("\n");
// convert it to a Type 1 font
fontBuf = font->readEmbFontFile(&fontLen);
@@ -881,9 +879,45 @@ void PSOutputDev::setupEmbeddedType1CFont(GfxFont *font, Ref *id,
gfree((void *)fontBuf);
// ending comment
if (psOutEPS) {
writePS("%%%%EndResource\n");
writePS("%%%%EndResource\n");
}
void PSOutputDev::setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id,
const char *psName) {
const char *fontBuf;
int fontLen;
TrueTypeFontFile *ttFile;
int i;
// check if font is already embedded
for (i = 0; i < fontFileIDLen; ++i) {
if (fontFileIDs[i].num == id->num &&
fontFileIDs[i].gen == id->gen)
return;
}
// add entry to fontFileIDs list
if (fontFileIDLen >= fontFileIDSize) {
fontFileIDSize += 64;
fontFileIDs = (Ref *)grealloc(fontFileIDs, fontFileIDSize * sizeof(Ref));
}
fontFileIDs[fontFileIDLen++] = *id;
// beginning comment
writePS("%%%%BeginResource: font %s\n", psName);
embFontList->append("%%+ font ");
embFontList->append(psName);
embFontList->append("\n");
// convert it to a Type 42 font
fontBuf = font->readEmbFontFile(&fontLen);
ttFile = new TrueTypeFontFile(fontBuf, fontLen);
ttFile->convertToType42(psName, font->getEncoding(), f);
delete ttFile;
gfree((void *)fontBuf);
// ending comment
writePS("%%%%EndResource\n");
}
void PSOutputDev::setupImages(Dict *resDict) {
+1
Ver Arquivo
@@ -147,6 +147,7 @@ private:
void setupEmbeddedType1Font(Ref *id, const char *psName);
void setupEmbeddedType1Font(GString *fileName, const char *psName);
void setupEmbeddedType1CFont(GfxFont *font, Ref *id, const char *psName);
void setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id, const char *psName);
void setupImages(Dict *resDict);
void setupImage(Ref id, Stream *str);
void doPath(GfxPath *path);
+76 -12
Ver Arquivo
@@ -1,11 +1,11 @@
xpdf
====
version 0.90
99-aug-02
version 0.92
2000-dec-03
The xpdf software and documentation are
copyright 1996-1999 Derek B. Noonburg.
copyright 1996-2000 Derek B. Noonburg.
Email: derekn@foolabs.com
WWW: http://www.foolabs.com/xpdf/
@@ -168,7 +168,20 @@ For Japanese support, you will need a Japanese font of the form:
-*-fixed-medium-r-normal-*-NN-*-*-*-*-*-jisx0208.1983-0
and an X server that can handle 16-bit fonts.
and an X server that can handle 16-bit fonts. You can also set this
font using the xpdf.japaneseFont resource.
For Chinese GB support, you will need a font of the form:
-*-fangsong ti-medium-r-normal-*-%s-*-*-*-*-*-gb2312.1980-0
You can replace this font using the xpdf.chineseGBFont resource.
For Chinese CNS support, you will need a font of the form:
-*-fixed-medium-r-normal--*-%s-*-*-*-*-big5-0
You can replace this font using the xpdf.chineseCNSFont resource.
If compiled with t1lib support, xpdf will use t1lib to render embedded
Type 1 and Type 1C fonts. In addition, xpdf can be configured to use
@@ -191,6 +204,28 @@ example:
xpdf.t1Symbol: /usr/local/fonts/Symbol.pfa
xpdf.t1ZapfDingbats: /usr/local/fonts/ZapfDingbats.pfa
Ghostscript comes with a set of free, high-quality Type 1 fonts,
donated by URW++ Design and Development Incorporated. The xpdf X
resources needed for these fonts are:
xpdf.t1TimesRoman: /usr/ghostscript/fonts/n021003l.pfb
xpdf.t1TimesItalic: /usr/ghostscript/fonts/n021023l.pfb
xpdf.t1TimesBold: /usr/ghostscript/fonts/n021004l.pfb
xpdf.t1TimesBoldItalic: /usr/ghostscript/fonts/n021024l.pfb
xpdf.t1Helvetica: /usr/ghostscript/fonts/n019003l.pfb
xpdf.t1HelveticaOblique: /usr/ghostscript/fonts/n019023l.pfb
xpdf.t1HelveticaBold: /usr/ghostscript/fonts/n019004l.pfb
xpdf.t1HelveticaBoldOblique: /usr/ghostscript/fonts/n019024l.pfb
xpdf.t1Courier: /usr/ghostscript/fonts/n022003l.pfb
xpdf.t1CourierOblique: /usr/ghostscript/fonts/n022023l.pfb
xpdf.t1CourierBold: /usr/ghostscript/fonts/n022004l.pfb
xpdf.t1CourierBoldOblique: /usr/ghostscript/fonts/n022024l.pfb
xpdf.t1Symbol: /usr/ghostscript/fonts/s050000l.pfb
xpdf.t1ZapfDingbats: /usr/ghostscript/fonts/d050000l.pfb
You will obviously need to replace '/usr/ghostscript/fonts' with the
appropriate path on your system.
The Unisys LZW Patent
---------------------
@@ -230,8 +265,7 @@ See the separate file, INSTALL.
Bugs
----
This release of xpdf should improve the situation with embedded
fonts. However, Type 3 and TrueType fonts are still not handled.
Type 3 fonts are still not well supported by xpdf.
If you find a bug in xpdf, i.e., if it prints an error message,
crashes, or incorrectly displays a document, and you don't see that
@@ -245,7 +279,8 @@ Acknowledgments
Thanks to:
* Patrick Voigt for help with the remote server code.
* Patrick Moreau and Martin P.J. Zinser for the VMS port.
* Patrick Moreau, Martin P.J. Zinser, and David Mathog for the VMS
port.
* David Boldt and Rick Rodgers for sample man pages.
* Brendan Miller for the icon idea.
* Olly Betts for help testing pdftotext.
@@ -255,6 +290,8 @@ Thanks to:
* Leo Smiers for the decryption patches.
* Rainer Menzner for creating t1lib, and for helping me adapt it to
xpdf.
* Pine Tree Systems A/S for funding the OPI and EPS support in
pdftops.
References
@@ -276,19 +313,42 @@ Addison-Wesley, 1990, ISBN 0-201-18127-4.
Adobe Systems, Inc., _Adobe CMap and CIDFont Files Specification_,
Adobe Developer Support Technical Specification #5014. 1995.
http://www.adobe.com/supportservice/devrelations/PDFS/TN/5014.CIDFont_Spec.pdf
[CMap file format needed for Japanese font support.]
[CMap file format needed for Japanese and Chinese font support.]
Adobe Systems, Inc., _Adobe-Japan1-2 Character Collection for
CID-Keyed Fonts_ (Bitmap Character Image Version), Adobe Developer
Support Technical Note #5078-b. 1994.
http://www.adobe.com/supportservice/devrelations/PDFS/TN/5078b.pdf
[The complete Adobe Japanese character set.]
CID-Keyed Fonts_, Adobe Developer Support Technical Note #5078.
1994.
http://partners.adobe.com/asn/developer/PDFS/TN/5078.CID_Glyph.pdf
[The Adobe Japanese character set.]
Adobe Systems, Inc., _Adobe-GB1-3 Character Collection for
CID-Keyed Fonts_, Adobe Developer Support Technical Note #5079.
1998.
http://partners.adobe.com/asn/developer/PDFS/TN/5079.GB_CharColl.pdf
[The Adobe Chinese GB character set.]
Adobe Systems, Inc., _Adobe-CNS1-3 Character Collection for
CID-Keyed Fonts_, Adobe Developer Support Technical Note #5080.
2000.
http://partners.adobe.com/asn/developer/PDFS/TN/5080.CNS_CharColl.pdf
[The Adobe Chinese CNS character set.]
Adobe Systems Inc., _Supporting the DCT Filters in PostScript Level
2_, Adobe Developer Support Technical Note #5116. 1992.
http://www.adobe.com/supportservice/devrelations/PDFS/TN/5116.PS2_DCT.PDF
[Description of the DCTDecode filter parameters.]
Adobe Systems Inc., _Open Prepress Interface (OPI) Specification -
Version 2.0_, Adobe Developer Support Technical Note #5660. 2000.
http://partners.adobe.com/asn/developer/PDFS/TN/5660.OPI_2.0.pdf
Adobe Systems Inc., CMap files.
ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/
[The actual CMap files for the 16-bit CJK encodings.]
Aldus Corp., _OPI: Open Prepress Interface Specification 1.3_. 1993.
http://partners.adobe.com/asn/developer/PDFS/TN/OPI_13.pdf
Anonymous, RC4 source code.
ftp://ftp.ox.ac.uk/pub/crypto/misc/rc4.tar.gz
ftp://idea.sec.dsi.unimi.it/pub/crypt/code/rc4.tar.gz
@@ -329,6 +389,10 @@ Fast 1-D DCT Algorithms with 11 Multiplications". IEEE Intl. Conf. on
Acoustics, Speech & Signal Processing, 1989, 988-991.
[The fast IDCT algorithm used in the DCTDecode filter.]
Charles Poynton, "Color FAQ".
http://www.inforamp.net/~poynton/ColorFAQ.html
[The mapping from the CIE 1931 (XYZ) color space to RGB.]
R. Rivest, "The MD5 Message-Digest Algorithm". RFC 1321.
[MD5 is used in PDF document encryption.]
+5
Ver Arquivo
@@ -42,6 +42,11 @@
#define xpdfConfigFile ".xpdfrc"
#endif
// Support Unicode/etc.
#define JAPANESE_SUPPORT 1
#define CHINESE_GB_SUPPORT 1
#define CHINESE_CNS_SUPPORT 1
//------------------------------------------------------------------------
// X-related constants
//------------------------------------------------------------------------

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais