]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/testppd.c
Load cups into easysw/current.
[thirdparty/cups.git] / cups / testppd.c
index bdaf944a4e6190e5926cda88763a10d7fd51f6b9..37032ff62e5e37d2469eaa6fb84e98ec6f3a5539 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: testppd.c 5700 2006-06-26 19:20:39Z mike $"
+ * "$Id: testppd.c 5826 2006-08-15 19:04:11Z mike $"
  *
  *   PPD test program for the Common UNIX Printing System (CUPS).
  *
@@ -192,10 +192,18 @@ main(int  argc,                           /* I - Number of command-line arguments */
     else
     {
       int              i, j, k;        /* Looping vars */
+      ppd_attr_t       *attr;          /* Current attribute */
       ppd_group_t      *group;         /* Option group */
       ppd_option_t     *option;        /* Option */
+      char             lang[255];      /* LANG environment variable */
 
 
+      if (argc > 2)
+      {
+        snprintf(lang, sizeof(lang), "LANG=%s", argv[2]);
+       putenv(lang);
+      }
+
       ppdLocalize(ppd);
 
       for (i = ppd->num_groups, group = ppd->groups;
@@ -203,7 +211,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
           i --, group ++)
       {
        printf("%s (%s):\n", group->name, group->text);
-       
+
        for (j = group->num_options, option = group->options;
             j > 0;
             j --, option ++)
@@ -215,6 +223,14 @@ main(int  argc,                            /* I - Number of command-line arguments */
                   option->choices[k].text);
        }
       }
+
+      puts("Attributes:");
+
+      for (attr = (ppd_attr_t *)cupsArrayFirst(ppd->sorted_attrs);
+           attr;
+          attr = (ppd_attr_t *)cupsArrayNext(ppd->sorted_attrs))
+        printf("    *%s %s/%s: \"%s\"\n", attr->name, attr->spec,
+              attr->text, attr->value ? attr->value : "");
     }
   }
 
@@ -223,5 +239,5 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
 
 /*
- * End of "$Id: testppd.c 5700 2006-06-26 19:20:39Z mike $".
+ * End of "$Id: testppd.c 5826 2006-08-15 19:04:11Z mike $".
  */