-CHANGES.txt - 01/18/2002
+CHANGES.txt - 01/23/2002
------------------------
CHANGES IN CUPS V1.1.13
+ - Now set the TCP "no delay" option on network
+ connections to improve performance/response time.
+ - Improved the IRIX printing tools support with patches
+ from Andrea Suatoni.
+ - Added a new PrintcapGUI directive to specify the GUI
+ option panel program to use for the IRIX printing
+ tools support.
+ - The cupsGetDests() function did not check to see if a
+ user-defined default printer (set via lpoptions) still
+ existed.
+ - The pstops filter no longer assumes that the default
+ dictionary is writable when doing N-up processing.
- The pstops filter now supports printing N-up with the
page-set option.
- The imagetoraster filter now supports direct printing
#
-# "$Id: cupsd.conf,v 1.37 2002/01/02 17:58:37 mike Exp $"
+# "$Id: cupsd.conf,v 1.38 2002/01/23 17:25:33 mike Exp $"
#
# Sample configuration file for the Common UNIX Printing System (CUPS)
# scheduler.
#Printcap /etc/printcap
+#
+# PrintcapFormat: the format of the printcap file, currently either
+# BSD or Solaris. The default is BSD.
+#
+
+#PrintcapFormat BSD
+#PrintcapFormat Solaris
+
+#
+# PrintcapGUI: the name of the GUI options panel program to associate
+# with print queues under IRIX. The default is /usr/bin/glpoptions
+# from ESP Print Pro.
+#
+# This option is only used under IRIX; the options panel program
+# must accept the "-d printer" and "-o options" options and write
+# the selected printer options back to stdout on completion.
+#
+
+#PrintcapGUI /usr/bin/glpoptions
+
#
# RequestRoot: the directory where request files are stored.
# By default /var/spool/cups.
</Location>
#
-# End of "$Id: cupsd.conf,v 1.37 2002/01/02 17:58:37 mike Exp $".
+# End of "$Id: cupsd.conf,v 1.38 2002/01/23 17:25:33 mike Exp $".
#
#
-# "$Id: Makefile,v 1.64 2002/01/02 17:58:38 mike Exp $"
+# "$Id: Makefile,v 1.65 2002/01/23 17:25:34 mike Exp $"
#
# Support library Makefile for the Common UNIX Printing System (CUPS).
#
libcups.2.dylib: $(LIBOBJS) ../Makedefs
echo Linking $@...
- $(DSO) $(DSOFLAGS) -o $@ $(LIBOBJS) $(SSLLIBS)
+ $(DSO) $(DSOFLAGS) -o $@ \
+ -dylib_install_name $(LIBDIR)/libcups.dylib \
+ -dylib_current_version 2.0.4 \
+ -dylib_compatibility_version 2.0.0 \
+ $(LIBOBJS) $(SSLLIBS)
$(RM) libcups.dylib
$(LN) $@ libcups.dylib
#
-# End of "$Id: Makefile,v 1.64 2002/01/02 17:58:38 mike Exp $".
+# End of "$Id: Makefile,v 1.65 2002/01/23 17:25:34 mike Exp $".
#
/*
- * "$Id: dest.c,v 1.26 2002/01/02 17:58:38 mike Exp $"
+ * "$Id: dest.c,v 1.27 2002/01/23 17:25:34 mike Exp $"
*
* User-defined destination (and option) support for the Common UNIX
* Printing System (CUPS).
int /* O - Number of destinations */
cupsGetDests(cups_dest_t **dests) /* O - Destinations */
{
+ int i; /* Looping var */
int num_dests; /* Number of destinations */
cups_dest_t *dest; /* Destination pointer */
const char *home; /* HOME environment variable */
const char *defprinter; /* Default printer */
char name[1024], /* Copy of printer name */
*instance; /* Pointer to instance name */
+ int num_reals; /* Number of real queues */
+ cups_dest_t *reals; /* Real queues */
/*
num_dests = cups_get_sdests(CUPS_GET_PRINTERS, num_dests, dests);
num_dests = cups_get_sdests(CUPS_GET_CLASSES, num_dests, dests);
+ /*
+ * Make a copy of the "real" queues for a later sanity check...
+ */
+
+ if (num_dests > 0)
+ {
+ num_reals = num_dests;
+ reals = calloc(num_reals, sizeof(cups_dest_t));
+
+ if (reals)
+ memcpy(reals, *dests, num_reals * sizeof(cups_dest_t));
+ else
+ num_reals = 0;
+ }
+ else
+ {
+ num_reals = 0;
+ reals = NULL;
+ }
+
/*
* Grab the default destination...
*/
}
/*
- * Reset the default destination if the LPDEST or PRINTER environment
- * variables are set...
+ * Validate the current default destination - this prevents old
+ * Default lines in /etc/cups/lpoptions and ~/.lpoptions from
+ * pointing to a non-existent printer or class...
*/
- if (getenv("LPDEST") != NULL || getenv("PRINTER") != NULL)
+ if (num_reals)
{
/*
- * Lookup the printer and instance and make it the default...
+ * See if we have a default printer...
*/
- if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
- dest->is_default = 1;
+ if ((dest = cupsGetDest(NULL, NULL, num_dests, *dests)) != NULL)
+ {
+ /*
+ * Have a default; see if it is real...
+ */
+
+ dest = cupsGetDest(dest->name, NULL, num_reals, reals);
+ }
+
+ /*
+ * If dest is NULL, then no default (that exists) is set, so we
+ * need to set a default if one exists...
+ */
+
+ if (dest == NULL && defprinter != NULL)
+ {
+ for (i = 0; i < num_dests; i ++)
+ (*dests)[i].is_default = 0;
+
+ if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
+ dest->is_default = 1;
+ }
+
+ /*
+ * Free memory...
+ */
+
+ free(reals);
}
/*
/*
- * End of "$Id: dest.c,v 1.26 2002/01/02 17:58:38 mike Exp $".
+ * End of "$Id: dest.c,v 1.27 2002/01/23 17:25:34 mike Exp $".
*/
/*
- * "$Id: http.c,v 1.91 2002/01/02 17:58:39 mike Exp $"
+ * "$Id: http.c,v 1.92 2002/01/23 17:25:34 mike Exp $"
*
* HTTP routines for the Common UNIX Printing System (CUPS) scheduler.
*
setsockopt(http->fd, SOL_SOCKET, SO_REUSEPORT, &val, sizeof(val));
#endif /* SO_REUSEPORT */
+ /*
+ * Using TCP_NODELAY improves responsiveness, especially on systems
+ * with a slow loopback interface... Since we write large buffers
+ * when sending print files and requests, there shouldn't be any
+ * performance penalty for this...
+ */
+
+ val = 1;
+ setsockopt(http->fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val));
+
/*
* Connect to the server...
*/
/*
- * End of "$Id: http.c,v 1.91 2002/01/02 17:58:39 mike Exp $".
+ * End of "$Id: http.c,v 1.92 2002/01/23 17:25:34 mike Exp $".
*/
#
-# "$Id: Makefile,v 1.16 2002/01/02 17:58:41 mike Exp $"
+# "$Id: Makefile,v 1.17 2002/01/23 17:25:35 mike Exp $"
#
# Datafile makefile for the Common UNIX Printing System (CUPS).
#
for file in $(DATAFILES); do \
$(INSTALL_DATA) $$file $(DATADIR)/data; \
done
- -if test x$(PAMDIR) != x; then \
+ -if test x$(PAMDIR) != x$(BUILDROOT); then \
$(INSTALL_DIR) $(PAMDIR); \
if test -f /lib/security/pam_unix.so; then \
$(INSTALL_DATA) cups.suse $(PAMDIR)/cups; \
#
-# End of "$Id: Makefile,v 1.16 2002/01/02 17:58:41 mike Exp $".
+# End of "$Id: Makefile,v 1.17 2002/01/23 17:25:35 mike Exp $".
#
<LI><A HREF="#PreserveJobHistory">PreserveJobHistory</A></LI>
<LI><A HREF="#PreserveJobFiles">PreserveJobFiles</A></LI>
<LI><A HREF="#Printcap">Printcap</A></LI>
-<LI><A HREF="#Printcap">PrintcapFormat</A></LI>
+<LI><A HREF="#PrintcapFormat">PrintcapFormat</A></LI>
+<LI><A HREF="#PrintcapGUI">PrintcapGUI</A></LI>
<LI><A HREF="#RemoteRoot">RemoteRoot</A></LI>
<LI><A HREF="#RequestRoot">RequestRoot</A></LI>
<LI><A HREF="#Require">Require</A></LI>
</UL>
<LI><A HREF="#8_5">Printing to Mac OS Servers</A></LI>
<LI><A HREF="#8_6">Printing from Windows Clients</A></LI>
+<UL>
+<LI><A HREF="#8_6_1">Exporting Printer Drivers</A></LI>
+</UL>
<LI><A HREF="#8_7">Printing to Windows Servers</A></LI>
</UL>
<B><A HREF="#LICENSE">A - Software License Agreement</A></B>
<LI><A HREF="#PreserveJobHistory"><CODE>PreserveJobHistory</CODE></A></LI>
<LI><A HREF="#Printcap"><CODE>Printcap</CODE></A></LI>
<LI><A HREF="#PrintcapFormat"><CODE>PrintcapFormat</CODE></A></LI>
+<LI><A HREF="#PrintcapGUI"><CODE>PrintcapGUI</CODE></A></LI>
<LI><A HREF="#RemoteRoot"><CODE>RemoteRoot</CODE></A></LI>
<LI><A HREF="#RequestRoot"><CODE>RequestRoot</CODE></A></LI>
<LI><A HREF="#Require"><CODE>Require</CODE></A></LI>
look at the printcap file for the available printers.
<!-- NEED 3in -->
</P>
-<H3><A NAME="Printcap">PrintcapFormat</A></H3>
+<H3><A NAME="PrintcapFormat">PrintcapFormat</A></H3>
<HR>
<H4>Examples</H4>
<UL>
of the printcap file. The default is to generate a BSD printcap file.
<!-- NEED 3in -->
</P>
+<H3><A NAME="PrintcapGUI">PrintcapGUI</A></H3>
+<HR>
+<H4>Example</H4>
+<UL>
+<PRE>
+PrintcapGUI /usr/bin/glpoptions
+</PRE>
+</UL>
+<H4>Description</H4>
+<P>The <CODE>PrintcapGUI</CODE> directive sets the program to use when
+ displaying an option panel from an IRIX application that uses the
+ Impressario print API. The default program is the ESP Print Pro
+ "glpoptions" GUI.</P>
+<P>The program must accept the <CODE>-d</CODE> option to specify a
+ printer and the <CODE>-o</CODE> option to specify one or more options.
+ After allowing the user to select/change options, the program must then
+ write the list of printing options without the <CODE>-o</CODE> to the
+ standard output.
+<!-- NEED 3in -->
+</P>
<H3><A NAME="RemoteRoot">RemoteRoot</A></H3>
<HR>
<H4>Examples</H4>
<UL>
<PRE>
printing = cups
+printcap name = cups
</PRE>
</UL>
<P>That's all there is to it! Remote users will now be able to browse
and print to printers on your system.</P>
+<H3><A NAME="8_6_1">Exporting Printer Drivers</A></H3>
+<P>You can optionally export printer drivers from your CUPS server using
+ the <CODE>cupsaddsmb</CODE> command and the SAMBA 2.2.0 or higher
+ software.</P>
+<P>Before you can export the printers you must download the current
+ Adobe PostScript printer drivers from the Adobe web site (<A HREF="http://www.adobe.com/">
+http://www.adobe.com/</A>). Use the free <CODE>unzip</CODE> software to
+ extract the files from the self-extracting ZIP file containing the
+ drivers; you will need the following files:</P>
+<UL>
+<PRE>
+ADFONTS.MFM
+ADOBEPS4.DRV
+ADOBEPS4.HLP
+ADOBEPS5.DLL
+ADOBEPSU.DLL
+ADOBEPSU.HLP
+DEFPRTR2.PPD
+ICONLIB.DLL
+PSMON.DLL
+</PRE>
+</UL>
+<P>Copy these files to the<VAR> /usr/share/cups/drivers</VAR> directory
+ - you may need to rename some of the files so the filenames are all
+ UPPERCASE.</P>
+<P>Next, add a <CODE>print$</CODE> share for the printer drivers to your<VAR>
+ smb.conf</VAR> file:</P>
+<UL>
+<PRE>
+[print$]
+ comment = Printer Drivers
+ path = /etc/samba/drivers
+ browseable = yes
+ guest ok = no
+ read only = yes
+ write list = root
+</PRE>
+</UL>
+<P>The directory for your printer drivers can be anywhere on the system;
+ just make sure it is writable by the users specified by the <CODE>write
+ list</CODE> directive. Also, make sure that you have SAMBA passwords
+ defined for each user in the <CODE>write list</CODE> using the <CODE>
+smbpasswd(1)</CODE> command. Otherwise you will not be able to
+ authenticate</P>
+<P>Finally, run the <CODE>cupsaddsmb</CODE> command to export the
+ printer drivers for one or more queues:</P>
+<UL>
+<PRE>
+<KBD>cupsaddsmb -U root printer1 ... printerN <I>ENTER</I></KBD>
+</PRE>
+</UL>
+<P>Running <CODE>cupsaddsmb</CODE> with the <CODE>-a</CODE> option will
+ export all printers:</P>
+<UL>
+<PRE>
+<KBD>cupsaddsmb -U root -a <I>ENTER</I></KBD>
+</PRE>
+</UL>
<H2><A NAME="8_7">Printing to Windows Servers</A></H2>
<P>CUPS can print to Windows servers in one of two ways. The first way
uses the LPD protocol on the CUPS system and the "TCP/IP Printing
<LI><A HREF="#PreserveJobHistory"><CODE>PreserveJobHistory</CODE></A>
<LI><A HREF="#Printcap"><CODE>Printcap</CODE></A>
<LI><A HREF="#PrintcapFormat"><CODE>PrintcapFormat</CODE></A>
+ <LI><A HREF="#PrintcapGUI"><CODE>PrintcapGUI</CODE></A>
<LI><A HREF="#RemoteRoot"><CODE>RemoteRoot</CODE></A>
<LI><A HREF="#RequestRoot"><CODE>RequestRoot</CODE></A>
<LI><A HREF="#Require"><CODE>Require</CODE></A>
look at the printcap file for the available printers.
<!-- NEED 3in -->
-<H3><A NAME="Printcap">PrintcapFormat</A></H3>
+<H3><A NAME="PrintcapFormat">PrintcapFormat</A></H3>
<HR>
<H4>Examples</H4>
format of the printcap file. The default is to generate a BSD
printcap file.
+<!-- NEED 3in -->
+<H3><A NAME="PrintcapGUI">PrintcapGUI</A></H3>
+<HR>
+
+<H4>Example</H4>
+
+<UL><PRE>
+PrintcapGUI /usr/bin/glpoptions
+</PRE></UL>
+
+<H4>Description</H4>
+
+<P>The <CODE>PrintcapGUI</CODE> directive sets the program to
+use when displaying an option panel from an IRIX application
+that uses the Impressario print API. The default program is the
+ESP Print Pro "glpoptions" GUI.
+
+<P>The program must accept the <CODE>-d</CODE> option to specify
+a printer and the <CODE>-o</CODE> option to specify one or more
+options. After allowing the user to select/change options, the
+program must then write the list of printing options without the
+<CODE>-o</CODE> to the standard output.
+
<!-- NEED 3in -->
<H3><A NAME="RemoteRoot">RemoteRoot</A></H3>
<HR>
<UL><PRE>
printing = cups
+printcap name = cups
</PRE></UL>
<P>That's all there is to it! Remote users will now be able to browse and
print to printers on your system.
+<H3>Exporting Printer Drivers</H3>
+
+<P>You can optionally export printer drivers from your CUPS
+server using the <CODE>cupsaddsmb</CODE> command and the SAMBA
+2.2.0 or higher software.
+
+<P>Before you can export the printers you must download the
+current Adobe PostScript printer drivers from the Adobe web
+site (<A HREF="http://www.adobe.com/">http://www.adobe.com/</A>).
+Use the free <CODE>unzip</CODE> software to extract the files
+from the self-extracting ZIP file containing the drivers; you
+will need the following files:
+
+<UL><PRE>
+ADFONTS.MFM
+ADOBEPS4.DRV
+ADOBEPS4.HLP
+ADOBEPS5.DLL
+ADOBEPSU.DLL
+ADOBEPSU.HLP
+DEFPRTR2.PPD
+ICONLIB.DLL
+PSMON.DLL
+</PRE></UL>
+
+<P>Copy these files to the <VAR>/usr/share/cups/drivers</VAR>
+directory - you may need to rename some of the files so the
+filenames are all UPPERCASE.
+
+<P>Next, add a <CODE>print$</CODE> share for the printer
+drivers to your <VAR>smb.conf</VAR> file:
+
+<UL><PRE>
+[print$]
+ comment = Printer Drivers
+ path = /etc/samba/drivers
+ browseable = yes
+ guest ok = no
+ read only = yes
+ write list = root
+</PRE></UL>
+
+<P>The directory for your printer drivers can be anywhere on the
+system; just make sure it is writable by the users specified by
+the <CODE>write list</CODE> directive. Also, make sure that you
+have SAMBA passwords defined for each user in the <CODE>write
+list</CODE> using the <CODE>smbpasswd(1)</CODE> command.
+Otherwise you will not be able to authenticate
+
+<P>Finally, run the <CODE>cupsaddsmb</CODE> command to export
+the printer drivers for one or more queues:
+
+<UL><PRE>
+<KBD>cupsaddsmb -U root printer1 ... printerN <I>ENTER</I></KBD>
+</PRE></UL>
+
+<P>Running <CODE>cupsaddsmb</CODE> with the <CODE>-a</CODE> option
+will export all printers:
+
+<UL><PRE>
+<KBD>cupsaddsmb -U root -a <I>ENTER</I></KBD>
+</PRE></UL>
+
<H2>Printing to Windows Servers</H2>
<P>CUPS can print to Windows servers in one of two ways. The first way uses
#
-# "$Id: Makefile,v 1.55 2002/01/15 20:38:41 mike Exp $"
+# "$Id: Makefile,v 1.56 2002/01/23 17:25:38 mike Exp $"
#
# Filter makefile for the Common UNIX Printing System (CUPS).
#
libcupsimage.2.dylib: $(IMAGEOBJS) ../Makedefs
echo Linking $@...
- $(DSO) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) $(LINKCUPS) -lm -lcc_dynamic
+ $(DSO) $(DSOFLAGS) -o $@ \
+ -dylib_install_name $(LIBDIR)/libcupsimage.dylib \
+ -dylib_current_version 2.0.0 \
+ -dylib_compatibility_version 2.0.0 \
+ $(IMAGEOBJS) $(DSOLIBS) $(LINKCUPS) -lm -lcc_dynamic
$(RM) libcupsimage.dylib
$(LN) $@ libcupsimage.dylib
#
-# End of "$Id: Makefile,v 1.55 2002/01/15 20:38:41 mike Exp $".
+# End of "$Id: Makefile,v 1.56 2002/01/23 17:25:38 mike Exp $".
#
/*
- * "$Id: pstops.c,v 1.70 2002/01/22 00:30:05 mike Exp $"
+ * "$Id: pstops.c,v 1.71 2002/01/23 17:25:38 mike Exp $"
*
* PostScript filter for the Common UNIX Printing System (CUPS).
*
end_nup(int number) /* I - Page number */
{
if (Flip || Orientation || NUp > 1)
- puts("ESPsave restore");
+ puts("userdict /ESPsave get restore");
switch (NUp)
{
if (Flip || Orientation || NUp > 1)
- puts("/ESPsave save def");
+ puts("userdict /ESPsave save put");
if (Flip)
printf("%.1f 0.0 translate -1 1 scale\n", PageWidth);
/*
- * End of "$Id: pstops.c,v 1.70 2002/01/22 00:30:05 mike Exp $".
+ * End of "$Id: pstops.c,v 1.71 2002/01/23 17:25:38 mike Exp $".
*/
.\"
-.\" "$Id: accept.man,v 1.5 2002/01/02 17:59:05 mike Exp $"
+.\" "$Id: accept.man,v 1.6 2002/01/23 17:25:39 mike Exp $"
.\"
.\" accept/reject man page for the Common UNIX Printing System (CUPS).
.\"
.B reject
[ -E ] [ -h
.I server
-] [ -r [
+] [ -r
.I reason
-] ]
+]
destination(s)
.SH DESCRIPTION
\fIaccept\fR instructs the printing system to accept print jobs to the
.SH COPYRIGHT
Copyright 1993-2002 by Easy Software Products, All Rights Reserved.
.\"
-.\" End of "$Id: accept.man,v 1.5 2002/01/02 17:59:05 mike Exp $".
+.\" End of "$Id: accept.man,v 1.6 2002/01/23 17:25:39 mike Exp $".
.\"
.\"
-.\" "$Id: enable.man,v 1.5 2002/01/02 17:59:06 mike Exp $"
+.\" "$Id: enable.man,v 1.6 2002/01/23 17:25:39 mike Exp $"
.\"
.\" enable/disable man page for the Common UNIX Printing System (CUPS).
.\"
.B disable
[ -E ] [ \-c ] [ -h
.I server
-] [ \-r [
+] [ \-r
.I reason
-] ] destination(s)
+] destination(s)
.br
.B enable
[ -E ] destination(s)
Copyright 1993-2002 by Easy Software Products, All Rights Reserved.
.\"
-.\" End of "$Id: enable.man,v 1.5 2002/01/02 17:59:06 mike Exp $".
+.\" End of "$Id: enable.man,v 1.6 2002/01/23 17:25:39 mike Exp $".
.\"
/*
- * "$Id: client.c,v 1.107 2002/01/02 17:59:14 mike Exp $"
+ * "$Id: client.c,v 1.108 2002/01/23 17:25:39 mike Exp $"
*
* Client routines for the Common UNIX Printing System (CUPS) scheduler.
*
LogMessage(L_DEBUG, "AcceptClient() %d from %s:%d.", con->http.fd,
con->http.hostname, ntohs(con->http.hostaddr.sin_port));
+ /*
+ * Using TCP_NODELAY improves responsiveness, especially on systems
+ * with a slow loopback interface... Since we write large buffers
+ * when sending print files and requests, there shouldn't be any
+ * performance penalty for this...
+ */
+
+ val = 1;
+ setsockopt(con->http.fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val));
+
/*
* Add the socket to the select() input mask.
*/
/*
- * End of "$Id: client.c,v 1.107 2002/01/02 17:59:14 mike Exp $".
+ * End of "$Id: client.c,v 1.108 2002/01/23 17:25:39 mike Exp $".
*/
/*
- * "$Id: conf.c,v 1.98 2002/01/02 17:59:14 mike Exp $"
+ * "$Id: conf.c,v 1.99 2002/01/23 17:25:40 mike Exp $"
*
* Configuration routines for the Common UNIX Printing System (CUPS).
*
{ "PreserveJobFiles", &JobFiles, VAR_BOOLEAN, 0 },
{ "PreserveJobHistory", &JobHistory, VAR_BOOLEAN, 0 },
{ "Printcap", Printcap, VAR_STRING, sizeof(Printcap) },
+ { "PrintcapGUI", PrintcapGUI, VAR_STRING, sizeof(PrintcapGUI) },
{ "RemoteRoot", RemoteRoot, VAR_STRING, sizeof(RemoteRoot) },
{ "RequestRoot", RequestRoot, VAR_STRING, sizeof(RequestRoot) },
{ "RIPCache", RIPCache, VAR_STRING, sizeof(RIPCache) },
strcpy(ErrorLog, CUPS_LOGDIR "/error_log");
strcpy(PageLog, CUPS_LOGDIR "/page_log");
strcpy(Printcap, "/etc/printcap");
+ strcpy(PrintcapGUI, "/usr/bin/glpoptions");
strcpy(FontPath, CUPS_FONTPATH);
strcpy(RemoteRoot, "remroot");
/*
- * End of "$Id: conf.c,v 1.98 2002/01/02 17:59:14 mike Exp $".
+ * End of "$Id: conf.c,v 1.99 2002/01/23 17:25:40 mike Exp $".
*/
/*
- * "$Id: conf.h,v 1.41 2002/01/02 17:59:14 mike Exp $"
+ * "$Id: conf.h,v 1.42 2002/01/23 17:25:40 mike Exp $"
*
* Configuration file definitions for the Common UNIX Printing System (CUPS)
* scheduler.
/* Temporary directory */
Printcap[1024] VALUE(""),
/* Printcap file */
+ PrintcapGUI[1024] VALUE("/usr/bin/glpoptions"),
+ /* GUI program to use for IRIX */
FontPath[1024] VALUE(CUPS_FONTPATH),
/* Font search path */
RemoteRoot[32] VALUE("remroot"),
/*
- * End of "$Id: conf.h,v 1.41 2002/01/02 17:59:14 mike Exp $".
+ * End of "$Id: conf.h,v 1.42 2002/01/23 17:25:40 mike Exp $".
*/
/*
- * "$Id: ipp.c,v 1.152 2002/01/09 17:03:44 mike Exp $"
+ * "$Id: ipp.c,v 1.153 2002/01/23 17:25:41 mike Exp $"
*
* IPP routines for the Common UNIX Printing System (CUPS) scheduler.
*
StartPrinter(printer);
+ printer->state_message[0] = '\0';
+
if (dtype == CUPS_PRINTER_CLASS)
SaveAllClasses();
else
LogMessage(L_INFO, "Printer \'%s\' started by \'%s\'.", name,
con->username);
- printer->state_message[0] = '\0';
-
CheckJobs();
/*
StopPrinter(printer);
- if (dtype == CUPS_PRINTER_CLASS)
- SaveAllClasses();
- else
- SaveAllPrinters();
-
if ((attr = ippFindAttribute(con->request, "printer-state-message",
IPP_TAG_TEXT)) == NULL)
strcpy(printer->state_message, "Paused");
printer->state_message[sizeof(printer->state_message) - 1] = '\0';
}
+ if (dtype == CUPS_PRINTER_CLASS)
+ SaveAllClasses();
+ else
+ SaveAllPrinters();
+
if (dtype == CUPS_PRINTER_CLASS)
LogMessage(L_INFO, "Class \'%s\' stopped by \'%s\'.", name,
con->username);
/*
- * End of "$Id: ipp.c,v 1.152 2002/01/09 17:03:44 mike Exp $".
+ * End of "$Id: ipp.c,v 1.153 2002/01/23 17:25:41 mike Exp $".
*/
/*
- * "$Id: printers.c,v 1.108 2002/01/02 17:59:17 mike Exp $"
+ * "$Id: printers.c,v 1.109 2002/01/23 17:25:41 mike Exp $"
*
* Printer routines for the Common UNIX Printing System (CUPS).
*
* changed.
* StopPrinter() - Stop a printer from printing any jobs...
* ValidateDest() - Validate a printer/class destination.
+ * write_irix_state() - Update the status files used by IRIX printing
+ * desktop tools.
* write_printcap() - Write a pseudo-printcap file for older
* applications that need it...
*/
*/
static void write_printcap(void);
+#ifdef __sgi
+static void write_irix_state(printer_t *p);
+#endif /* __sgi */
/*
snprintf(filename, sizeof(filename), "/var/spool/lp/activeicons/%s", p->name);
unlink(filename);
+
+ snprintf(filename, sizeof(filename), "/var/spool/lp/pod/%s.config", p->name);
+ unlink(filename);
+
+ snprintf(filename, sizeof(filename), "/var/spool/lp/pod/%s.status", p->name);
+ unlink(filename);
#endif /* __sgi */
/*
*/
if (p == DefaultPrinter)
+ {
DefaultPrinter = Printers;
+#ifdef __sgi
+ write_irix_state(DefaultPrinter);
+#endif /* __sgi */
+ }
+
/*
* Remove this printer from any classes...
*/
printer->users[i]);
fputs("</Printer>\n", fp);
+#ifdef __sgi
+ /*
+ * Make IRIX desktop & printer status happy
+ */
+
+ write_irix_state(printer);
+
+#endif /* __sgi */
}
fclose(fp);
#ifdef __sgi
/*
* Add dummy interface and GUI scripts to fool SGI's "challenged" printing
- * tools.
+ * tools. First the interface script that tells the tools what kind of
+ * printer we have...
*/
snprintf(filename, sizeof(filename), "/var/spool/lp/interface/%s", p->name);
+
if ((fp = fopen(filename, "w")) != NULL)
{
fputs("#!/bin/sh\n", fp);
fputs("TYPE=PostScript\n", fp);
fclose(fp);
+
chmod(filename, 0755);
+ chown(filename, User, Group);
}
+ /*
+ * Then the member file that tells which device file the queue is connected
+ * to... Networked printers use "/dev/null" in this file, so that's what
+ * we use (the actual device URI can confuse some apps...)
+ */
+
snprintf(filename, sizeof(filename), "/var/spool/lp/member/%s", p->name);
if ((fp = fopen(filename, "w")) != NULL)
{
fputs("/dev/null\n", fp);
+
fclose(fp);
+
chmod(filename, 0644);
+ chown(filename, User, Group);
}
+ /*
+ * The gui_interface file is a script or program that launches a GUI
+ * option panel for the printer, using options specified on the
+ * command-line in the third argument. The option panel must send
+ * any printing options to stdout on a single line when the user
+ * accepts them, or nothing if the user cancels the dialog.
+ *
+ * The default options panel program is /usr/bin/glpoptions, from
+ * the ESP Print Pro software. You can select another using the
+ * PrintcapGUI option.
+ */
+
snprintf(filename, sizeof(filename), "/var/spool/lp/gui_interface/ELF/%s.gui", p->name);
+
if ((fp = fopen(filename, "w")) != NULL)
{
fputs("#!/bin/sh\n", fp);
- fprintf(fp, "/usr/bin/glpoptions -d %s -o \"$3\"\n", p->name);
+ fprintf(fp, "%s -d %s -o \"$3\"\n", PrintcapGUI, p->name);
+
fclose(fp);
+
chmod(filename, 0755);
+ chown(filename, User, Group);
}
- snprintf(filename, sizeof(filename), "/var/spool/lp/activeicons/%s", p->name);
+ /*
+ * The POD config file is needed by the printstatus command to show
+ * the printer location and device.
+ */
+
+ snprintf(filename, sizeof(filename), "/var/spool/lp/pod/%s.config", p->name);
if ((fp = fopen(filename, "w")) != NULL)
{
- fputs("#!/bin/sh\n", fp);
- if (p->type & CUPS_PRINTER_COLOR)
- fputs("#Tag 66240\n", fp);
- else
- fputs("#Tag 66208\n", fp);
+ fprintf(fp, "Printer Class | %s\n",
+ (p->type & CUPS_PRINTER_COLOR) ? "ColorPostScript" : "PostScript");
+ fprintf(fp, "Printer Model | %s\n", p->make_model);
+ fprintf(fp, "Location Code | %s\n", p->uri);
+ fprintf(fp, "Physical Location | %s\n", p->location);
+ fprintf(fp, "Port Path | %s\n", p->device_uri);
+ fprintf(fp, "Config Path | /var/spool/lp/pod/%s.config\n", p->name);
+ fprintf(fp, "Active Status Path | /var/spool/lp/pod/%s.status\n", p->name);
+ fputs("Status Update Wait | 10 seconds\n", fp);
+
fclose(fp);
- chmod(filename, 0755);
+
+ chmod(filename, 0664);
+ chown(filename, User, Group);
}
+
+ /*
+ * Write the IRIX printer status files...
+ */
+
+ write_irix_state(p);
#endif /* __sgi */
}
}
+#ifdef __sgi
+/*
+ * 'write_irix_state()' - Update the status files used by IRIX printing
+ * desktop tools.
+ */
+
+static void
+write_irix_state(printer_t *p) /* I - Printer to update */
+{
+ char filename[1024]; /* Interface script filename */
+ FILE *fp; /* Interface script file */
+ int tag; /* Status tag value */
+
+
+ /*
+ * The POD status file is needed for the printstatus window to
+ * provide the current status of the printer.
+ */
+
+ snprintf(filename, sizeof(filename), "/var/spool/lp/pod/%s.status", p->name);
+
+ if ((fp = fopen(filename, "w")) != NULL)
+ {
+ fprintf(fp, "Operational Status | %s\n",
+ (p->state == IPP_PRINTER_IDLE) ? "Idle" :
+ (p->state == IPP_PRINTER_PROCESSING) ? "Busy" :
+ "Faulted");
+ fprintf(fp, "Information | 01 00 00 | %s\n", CUPS_SVERSION);
+ fprintf(fp, "Information | 02 00 00 | %s jobs\n",
+ p->accepting ? "Accepting" : "Not accepting");
+ fprintf(fp, "Information | 03 00 00 | %s\n", p->state_message);
+
+ fclose(fp);
+
+ chmod(filename, 0664);
+ chown(filename, User, Group);
+ }
+
+ /*
+ * The activeicons file is needed to provide desktop icons for printers:
+ *
+ * [ quoted from /usr/lib/print/tagit ]
+ *
+ * --- Type of printer tags (base values)
+ *
+ * Dumb=66048 # 0x10200
+ * DumbColor=66080 # 0x10220
+ * Raster=66112 # 0x10240
+ * ColorRaster=66144 # 0x10260
+ * Plotter=66176 # 0x10280
+ * PostScript=66208 # 0x102A0
+ * ColorPostScript=66240 # 0x102C0
+ * MonoPostScript=66272 # 0x102E0
+ *
+ * --- Printer state modifiers for local printers
+ *
+ * Idle=0 # 0x0
+ * Busy=1 # 0x1
+ * Faulted=2 # 0x2
+ * Unknown=3 # 0x3 (Faulted due to unknown reason)
+ *
+ * --- Printer state modifiers for network printers
+ *
+ * NetIdle=8 # 0x8
+ * NetBusy=9 # 0x9
+ * NetFaulted=10 # 0xA
+ * NetUnknown=11 # 0xB (Faulted due to unknown reason)
+ */
+
+ snprintf(filename, sizeof(filename), "/var/spool/lp/activeicons/%s", p->name);
+
+ if ((fp = fopen(filename, "w")) != NULL)
+ {
+ if (p->type & CUPS_PRINTER_COLOR)
+ tag = 66240;
+ else
+ tag = 66208;
+
+ if (p->type & CUPS_PRINTER_REMOTE)
+ tag |= 8;
+
+ if (p->state == IPP_PRINTER_PROCESSING)
+ tag |= 1;
+
+ else if (p->state == IPP_PRINTER_STOPPED)
+ tag |= 2;
+
+ fputs("#!/bin/sh\n", fp);
+ fprintf(fp, "#Tag %d\n", tag);
+
+ fclose(fp);
+
+ chmod(filename, 0755);
+ chown(filename, User, Group);
+ }
+
+ /*
+ * The default file is needed by the printers window to show
+ * the default printer.
+ */
+
+ snprintf(filename, sizeof(filename), "/var/spool/lp/default");
+
+ if (DefaultPrinter != NULL)
+ {
+ if ((fp = fopen(filename, "w")) != NULL)
+ {
+ fprintf(fp, "%s\n", DefaultPrinter->name);
+
+ fclose(fp);
+
+ chmod(filename, 0644);
+ chown(filename, User, Group);
+ }
+ }
+ else
+ unlink(filename);
+}
+#endif /* __sgi */
+
+
/*
- * End of "$Id: printers.c,v 1.108 2002/01/02 17:59:17 mike Exp $".
+ * End of "$Id: printers.c,v 1.109 2002/01/23 17:25:41 mike Exp $".
*/