]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sat, 7 Jun 2003 16:35:56 +0000 (16:35 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sat, 7 Jun 2003 16:35:56 +0000 (16:35 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3764 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.1.txt
cups/emit.c
cups/ppd.c
systemv/cupstestppd.c

index 2be4a3215d01a8efe5561e4b446fb9480ea1663c..509a892754b4cb656322792ca3254956659e32e8 100644 (file)
@@ -3,6 +3,12 @@ CHANGES-1.1.txt
 
 CHANGES IN CUPS V1.1.20rc1
 
+       - The ppdOpen() functions now add all Default attributes
+         to the attribute list; previously only certain
+         unassigned default attributes would be added (STR
+         #139)
+       - The ppdEmitJCL() function wrote JCL commands to stdout
+         instead of the passed file pointer (STR #142)
        - The httpGets() function could, in certain states,
          block waiting for data (STR #132)
        - The cupsEmitJCL() function not outputs an empty @PJL
index 461f307b76d1e369ad13fe9d5750d8050e6ede9d..9456e095714ebf11b2e596c518742b594c211177 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: emit.c,v 1.23.2.10 2003/06/02 20:24:19 mike Exp $"
+ * "$Id: emit.c,v 1.23.2.11 2003/06/07 16:35:54 mike Exp $"
  *
  *   PPD code emission routines for the Common UNIX Printing System (CUPS).
  *
@@ -607,10 +607,10 @@ ppdEmitJCL(ppd_file_t *ppd,               /* I - PPD file record */
             job_id, user, temp);
   }
   else
-    fputs(ppd->jcl_begin, stdout);
+    fputs(ppd->jcl_begin, fp);
 
-  ppdEmit(ppd, stdout, PPD_ORDER_JCL);
-  fputs(ppd->jcl_ps, stdout);
+  ppdEmit(ppd, fp, PPD_ORDER_JCL);
+  fputs(ppd->jcl_ps, fp);
 
   return (0);
 }
@@ -709,5 +709,5 @@ ppd_sort(ppd_choice_t **c1, /* I - First choice */
 
 
 /*
- * End of "$Id: emit.c,v 1.23.2.10 2003/06/02 20:24:19 mike Exp $".
+ * End of "$Id: emit.c,v 1.23.2.11 2003/06/07 16:35:54 mike Exp $".
  */
index 4244b11ef6942184874949defcc5d030599b340c..769084920e840b6da9c85d4993bb485183e829e9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.c,v 1.51.2.51 2003/04/11 13:07:36 mike Exp $"
+ * "$Id: ppd.c,v 1.51.2.52 2003/06/07 16:35:54 mike Exp $"
  *
  *   PPD file routines for the Common UNIX Printing System (CUPS).
  *
@@ -808,21 +808,6 @@ ppdOpen(FILE *fp)                  /* I - File to read from */
       ppd->color_device = strcmp(string, "True") == 0;
     else if (strcmp(keyword, "ContoneOnly") == 0)
       ppd->contone_only = strcmp(string, "True") == 0;
-    else if (strcmp(keyword, "DefaultColorSpace") == 0)
-    {
-      if (strcmp(string, "CMY") == 0)
-        ppd->colorspace = PPD_CS_CMY;
-      else if (strcmp(string, "CMYK") == 0)
-        ppd->colorspace = PPD_CS_CMYK;
-      else if (strcmp(string, "RGB") == 0)
-        ppd->colorspace = PPD_CS_RGB;
-      else if (strcmp(string, "RGBK") == 0)
-        ppd->colorspace = PPD_CS_RGBK;
-      else if (strcmp(string, "N") == 0)
-        ppd->colorspace = PPD_CS_N;
-      else
-        ppd->colorspace = PPD_CS_GRAY;
-    }
     else if (strcmp(keyword, "cupsFlipDuplex") == 0)
       ppd->flip_duplex = strcmp(string, "True") == 0;
     else if (strcmp(keyword, "cupsManualCopies") == 0)
@@ -1688,39 +1673,64 @@ ppdOpen(FILE *fp)                       /* I - File to read from */
       if (string == NULL)
         continue;
 
+     /*
+      * Drop UI text, if any, from value...
+      */
+
       if (strchr(string, '/') != NULL)
         *strchr(string, '/') = '\0';
 
-      if (option == NULL)
-      {
-        if ((option = ppdFindOption(ppd, keyword + 7)) != NULL)
-       {
-         strlcpy(option->defchoice, string, sizeof(option->defchoice));
-         option = NULL;
-       }
-       else
-       {
-        /*
-         * Option not found; add this as an attribute...
-         */
+     /*
+      * Assign the default value as appropriate...
+      */
 
-          ppd_add_attr(ppd, keyword, "", "", string);
+      if (strcmp(keyword, "DefaultColorSpace") == 0)
+      {
+       /*
+        * Set default colorspace...
+       */
 
-          string = NULL;               /* Don't free this string below */
-       }
+       if (strcmp(string, "CMY") == 0)
+          ppd->colorspace = PPD_CS_CMY;
+       else if (strcmp(string, "CMYK") == 0)
+          ppd->colorspace = PPD_CS_CMYK;
+       else if (strcmp(string, "RGB") == 0)
+          ppd->colorspace = PPD_CS_RGB;
+       else if (strcmp(string, "RGBK") == 0)
+          ppd->colorspace = PPD_CS_RGBK;
+       else if (strcmp(string, "N") == 0)
+          ppd->colorspace = PPD_CS_N;
+       else
+          ppd->colorspace = PPD_CS_GRAY;
       }
-      else if (strcmp(keyword + 7, option->keyword) == 0)
+      else if (option && strcmp(keyword + 7, option->keyword) == 0)
+      {
+       /*
+        * Set the default as part of the current option...
+       */
+
         strlcpy(option->defchoice, string, sizeof(option->defchoice));
+      }
       else
       {
        /*
-       * Default doesn't match this option; add as an attribute...
+        * Lookup option and set if it has been defined...
        */
 
-        ppd_add_attr(ppd, keyword, "", "", string);
+        ppd_option_t   *toption;       /* Temporary option */
+
 
-        string = NULL;                 /* Don't free this string below */
+        if ((toption = ppdFindOption(ppd, keyword + 7)) != NULL)
+         strlcpy(toption->defchoice, string, sizeof(toption->defchoice));
       }
+
+     /*
+      * Add default as attribute, too...
+      */
+
+      ppd_add_attr(ppd, keyword, "", "", string);
+
+      string = NULL;           /* Don't free this string below */
     }
     else if (strcmp(keyword, "UIConstraints") == 0 ||
              strcmp(keyword, "NonUIConstraints") == 0)
@@ -3361,5 +3371,5 @@ ppd_read(FILE *fp,                        /* I - File to read from */
 
 
 /*
- * End of "$Id: ppd.c,v 1.51.2.51 2003/04/11 13:07:36 mike Exp $".
+ * End of "$Id: ppd.c,v 1.51.2.52 2003/06/07 16:35:54 mike Exp $".
  */
index b982948b47f313102a30b4df39c1812a39557709..5eb0a8934c0f8f750990c31da01bab6f28087b5f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cupstestppd.c,v 1.1.2.22 2003/05/23 15:25:11 mike Exp $"
+ * "$Id: cupstestppd.c,v 1.1.2.23 2003/06/07 16:35:56 mike Exp $"
  *
  *   PPD test program for the Common UNIX Printing System (CUPS).
  *
@@ -854,6 +854,13 @@ main(int  argc,                    /* I - Number of command-line arguments */
        printf("    num_fonts = %d\n", ppd->num_fonts);
        for (j = 0; j < ppd->num_fonts; j ++)
          printf("        fonts[%d] = %s\n", j, ppd->fonts[j]);
+
+       printf("    num_attrs = %d\n", ppd->num_attrs);
+       for (j = 0; j < ppd->num_attrs; j ++)
+         printf("        attrs[%d] = %s %s%s%s: \"%s\"\n", j,
+                ppd->attrs[j]->name, ppd->attrs[j]->spec,
+                ppd->attrs[j]->text[0] ? "/" : "", ppd->attrs[j]->text,
+                ppd->attrs[j]->value ? ppd->attrs[j]->value : "(null)");
       }
 
       ppdClose(ppd);
@@ -980,5 +987,5 @@ usage(void)
 
 
 /*
- * End of "$Id: cupstestppd.c,v 1.1.2.22 2003/05/23 15:25:11 mike Exp $".
+ * End of "$Id: cupstestppd.c,v 1.1.2.23 2003/06/07 16:35:56 mike Exp $".
  */