]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add IRIX improvements and manpage updates from Andrea.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 23 Jan 2002 17:25:41 +0000 (17:25 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 23 Jan 2002 17:25:41 +0000 (17:25 +0000)
Add TCP no-delay stuff from Apple.

Fix stale Default lines in lpoptions causing a bad default printer.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@2060 7a7537e8-13f0-0310-91df-b6672ffda945

18 files changed:
CHANGES.txt
conf/cupsd.conf
cups/Makefile
cups/dest.c
cups/http.c
data/Makefile
doc/sam.html
doc/sam.pdf
doc/sam.shtml
filter/Makefile
filter/pstops.c
man/accept.man
man/enable.man
scheduler/client.c
scheduler/conf.c
scheduler/conf.h
scheduler/ipp.c
scheduler/printers.c

index 1a10919d3e848aba9ebe96614a46dd8b89c4a91c..f2e83eeb22de10a57eb5f609e6cc9cb3b8c61020 100644 (file)
@@ -1,8 +1,20 @@
-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
index 18a4ab14bc9453e3e6308166ba6c114ac9da4cbd..21b3c02ae300082a3beae5948ebae8a16d0dd692 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$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.
@@ -208,6 +208,26 @@ LogLevel info
 
 #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.
@@ -696,5 +716,5 @@ Allow From 127.0.0.1
 </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 $".
 #
index 70e3cdc727d83a15a28610295f74fba8d3fd1622..47d105f01373e8d26b3cb637856caef2e8ee6ba4 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$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).
 #
@@ -106,7 +106,11 @@ libcups.so.2 libcups.sl.2: $(LIBOBJS) ../Makedefs
 
 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
 
@@ -200,5 +204,5 @@ $(OBJS):    ../Makedefs ../config.h
 
 
 #
-# 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 $".
 #
index 381d052d2c0d8464d4dd3252576fb6c4a376e8f6..a8de5518b40473c5ae0c7baaa9046113471f2c72 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$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).
@@ -207,6 +207,7 @@ cupsGetDest(const char  *name,              /* I - Name of destination */
 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 */
@@ -214,6 +215,8 @@ cupsGetDests(cups_dest_t **dests)   /* O - Destinations */
   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 */
 
 
  /*
@@ -230,6 +233,26 @@ cupsGetDests(cups_dest_t **dests)  /* O - Destinations */
   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...
   */
@@ -282,18 +305,45 @@ cupsGetDests(cups_dest_t **dests) /* O - Destinations */
   }
 
  /*
-  * 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);
   }
 
  /*
@@ -747,5 +797,5 @@ cups_get_sdests(ipp_op_t    op,             /* I - get-printers or get-classes */
 
 
 /*
- * 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 $".
  */
index d27fb3102bca0552ff0e68ed77e4b7c3a28d31ea..aeb41afafc71ce56c4a0237767c27131f4d78455 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$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.
  *
@@ -536,6 +536,16 @@ httpReconnect(http_t *http)        /* I - HTTP data */
   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...
   */
@@ -2201,5 +2211,5 @@ http_upgrade(http_t *http)        /* I - HTTP data */
 
 
 /*
- * 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 $".
  */
index 15e320924c6601522249a2ca85c8afcb9b1fd807..90fcffa82e43b4f771bdc0938e0b92bcd27b0255 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$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).
 #
@@ -93,7 +93,7 @@ install:
        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; \
@@ -104,5 +104,5 @@ install:
 
 
 #
-# 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 $".
 #
index 51f5b3aff31b9755a9ea5fa010ff1dbb229eaa5f..b0175e1031e250a40dad1db9b2b10a244b26d4c2 100644 (file)
@@ -161,7 +161,8 @@ Copyright 1997-2002, All Rights Reserved<BR>
 <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>
@@ -216,6 +217,9 @@ Copyright 1997-2002, All Rights Reserved<BR>
 </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>
@@ -1134,6 +1138,7 @@ HREF="#CLIENT_SETUP"> Chapter 5, &quot;Client Setup&quot;</A> for more
 <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>
@@ -2345,7 +2350,7 @@ Printcap /etc/printers.conf
  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>
@@ -2359,6 +2364,26 @@ PrintcapFormat Solaris
  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
+ &quot;glpoptions&quot; 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>
@@ -3360,10 +3385,69 @@ exit 0
 <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 &quot;TCP/IP Printing
index e5f2c169f7e22011b4974e155c7d99f4eb0565a5..7f7653deec7abcf55387ca023d280c726aa98a36 100644 (file)
Binary files a/doc/sam.pdf and b/doc/sam.pdf differ
index 593b3913a42909c8b98cdc17707550a7a8f85259..0ce82a8ea4ed3549ee916303f92c8b203c00e23f 100644 (file)
@@ -930,6 +930,7 @@ determine how the server operates:
        <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>
@@ -2379,7 +2380,7 @@ printcap file can then be used by applications that are hardcoded to
 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>
@@ -2395,6 +2396,29 @@ PrintcapFormat Solaris
 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>
@@ -3571,11 +3595,75 @@ replace the existing printing commands and options with the line:
 
 <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
index b2e6a2a1f5caf49d7f43dfbb5016af232f2a2ed4..5d486b51c9267c8ebb5ab6d595e05cca0c9b265a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$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).
 #
@@ -115,7 +115,11 @@ libcupsimage.so.2 libcupsimage.sl.2:       $(IMAGEOBJS) ../Makedefs
 
 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
 
@@ -238,5 +242,5 @@ $(OBJS):    ../Makedefs ../cups/cups.h ../cups/ppd.h ../cups/language.h
 
 
 #
-# 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 $".
 #
index 9cce31acc5742f565958813618cca4c060481094..af9feb4446535cf773035845d70ec871d5e5251d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$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).
  *
@@ -880,7 +880,7 @@ static void
 end_nup(int number)    /* I - Page number */
 {
   if (Flip || Orientation || NUp > 1)
-    puts("ESPsave restore");
+    puts("userdict /ESPsave get restore");
 
   switch (NUp)
   {
@@ -992,7 +992,7 @@ start_nup(int number)       /* I - Page number */
 
 
   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);
@@ -1113,5 +1113,5 @@ start_nup(int number)     /* I - Page number */
 
 
 /*
- * 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 $".
  */
index c02227a6462c3d8783f45521f945451aade78b30..70fcbad26b5752bf649f0de78c92097192beb701 100644 (file)
@@ -1,5 +1,5 @@
 .\"
-.\" "$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).
 .\"
@@ -31,9 +31,9 @@ destination(s)
 .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
@@ -56,5 +56,5 @@ http://localhost:631/documentation.html
 .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 $".
 .\"
index 4ffe0f7bf29a7f9ee2ea97edc887b89a48263a25..d748737e6cb7b2e94972159de780fc108c9978e6 100644 (file)
@@ -1,5 +1,5 @@
 .\"
-.\" "$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).
 .\"
@@ -28,9 +28,9 @@ disable, enable \- stop/start printers and classes
 .B disable
 [ -E ] [ \-c ] [ -h
 .I server
-] [ \-r [
+] [ \-r
 .I reason
-] destination(s)
+] destination(s)
 .br
 .B enable
 [ -E ] destination(s)
@@ -63,5 +63,5 @@ http://localhost:631/documentation.html
 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 $".
 .\"
index 7786515c9ff5074cd7ad9ba310b11775058848c4..38c30da00e1bdfc79be0fd59fc6435636282b313 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$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.
  *
@@ -224,6 +224,16 @@ AcceptClient(listener_t *lis)      /* I - Listener socket */
   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.
   */
@@ -2483,5 +2493,5 @@ pipe_command(client_t *con,       /* I - Client connection */
 
 
 /*
- * 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 $".
  */
index 0f5c42404e34966af7f02615b195abdcd26ced2c..ca07a79050f75b9db868d5645c399c1fbd462c5b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$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).
  *
@@ -109,6 +109,7 @@ static var_t        variables[] =
   { "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) },
@@ -222,6 +223,7 @@ ReadConfiguration(void)
   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");
 
@@ -1862,5 +1864,5 @@ get_address(char               *value,            /* I - Value string */
 
 
 /*
- * 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 $".
  */
index cee506b8e26e666e074e07061c43a15ff83df622..c07b9dbd983892ca6e21ce550ba4deae350fa721 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$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.
@@ -88,6 +88,8 @@ VAR char              SystemGroups[MAX_SYSTEM_GROUPS][32],
                                        /* 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"),
@@ -163,5 +165,5 @@ extern int  LogPage(job_t *job, const char *page);
 
 
 /*
- * 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 $".
  */
index cb0fc683853888d16ac70a4d3cbf5cb60be5e178..bbc070bf3b40454e35daa616fe83e09db56deac2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$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.
  *
@@ -5308,6 +5308,8 @@ start_printer(client_t        *con,       /* I - Client connection */
 
   StartPrinter(printer);
 
+  printer->state_message[0] = '\0';
+
   if (dtype == CUPS_PRINTER_CLASS)
     SaveAllClasses();
   else
@@ -5320,8 +5322,6 @@ start_printer(client_t        *con,       /* I - Client connection */
     LogMessage(L_INFO, "Printer \'%s\' started by \'%s\'.", name,
                con->username);
 
-  printer->state_message[0] = '\0';
-
   CheckJobs();
 
  /*
@@ -5398,11 +5398,6 @@ stop_printer(client_t        *con,       /* I - Client connection */
 
   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");
@@ -5413,6 +5408,11 @@ stop_printer(client_t        *con,       /* I - Client connection */
     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);
@@ -5626,5 +5626,5 @@ validate_user(client_t   *con,            /* I - Client connection */
 
 
 /*
- * 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 $".
  */
index 88595cd61d247f52f0b7c2b3c66b3227c267f3a3..4b71d0295f37d6adb27185d673c969b81eb87835 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$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).
  *
@@ -39,6 +39,8 @@
  *                            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...
  */
@@ -55,6 +57,9 @@
  */
 
 static void    write_printcap(void);
+#ifdef __sgi
+static void    write_irix_state(printer_t *p);
+#endif /* __sgi */
 
 
 /*
@@ -306,6 +311,12 @@ DeletePrinter(printer_t *p)        /* I - Printer to delete */
 
   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 */
 
  /*
@@ -313,8 +324,14 @@ DeletePrinter(printer_t *p)        /* I - Printer to delete */
   */
 
   if (p == DefaultPrinter)
+  {
     DefaultPrinter = Printers;
 
+#ifdef __sgi
+    write_irix_state(DefaultPrinter);
+#endif /* __sgi */
+  }
+
  /*
   * Remove this printer from any classes...
   */
@@ -777,6 +794,14 @@ SaveAllPrinters(void)
               printer->users[i]);
 
     fputs("</Printer>\n", fp);
+#ifdef __sgi
+    /*
+     * Make IRIX desktop & printer status happy
+     */
+
+    write_irix_state(printer);
+
+#endif /* __sgi */
   }
 
   fclose(fp);
@@ -1408,10 +1433,12 @@ SetPrinterAttrs(printer_t *p)           /* I - Printer to setup */
 #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);
@@ -1430,37 +1457,82 @@ SetPrinterAttrs(printer_t *p)           /* I - Printer to setup */
       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 */
 }
 
@@ -1802,6 +1874,127 @@ write_printcap(void)
 }
 
 
+#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 $".
  */