]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Start of new PPD code.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 10 Apr 2003 03:01:49 +0000 (03:01 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 10 Apr 2003 03:01:49 +0000 (03:01 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3579 7a7537e8-13f0-0310-91df-b6672ffda945

cups/extended.c
cups/ppd.c
cups/ppd.h

index 7a5493a597a3c35cb786bc912ae26d29d45233ef..5f810c03810975a1755941873137cd1a7f4e6ae0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: extended.c,v 1.1.2.3 2003/01/07 18:26:24 mike Exp $"
+ * "$Id: extended.c,v 1.1.2.4 2003/04/10 03:01:48 mike Exp $"
  *
  *   Extended option routines for the Common UNIX Printing System (CUPS).
  *
@@ -57,12 +57,12 @@ static void ppd_unmark_choices(ppd_option_t *option);
  * 'ppdFindExtOption()' - Return a pointer to the extended option.
  */
 
-ppd_ext_option_t *                             /* O - Pointer to option or NULL */
-ppdFindExtOption(ppd_file_t *ppd,              /* I - PPD file data */
-                 const char *option)           /* I - Option/Keyword name */
+ppd_ext_option_t *                     /* O - Pointer to option or NULL */
+ppdFindExtOption(ppd_file_t *ppd,      /* I - PPD file data */
+                 const char *option)   /* I - Option/Keyword name */
 {
-  int                  i;                      /* Looping var */
-  ppd_ext_option_t     **o;                    /* Pointer to option */
+  int                  i;              /* Looping var */
+  ppd_ext_option_t     **o;            /* Pointer to option */
 
 
   if (ppd == NULL || option == NULL)
@@ -76,23 +76,51 @@ ppdFindExtOption(ppd_file_t *ppd,           /* I - PPD file data */
 }
 
 
+/*
+ * 'ppdFindExtParam()' - Find an extended parameter.
+ */
+
+ppd_ext_param_t *                      /* O - Parameter or NULL */
+ppdFindExtParam(ppd_ext_option_t *opt, /* I - Option */
+                const char       *param)/* I - Parameter name */
+{
+  int                  i;              /* Looping var */
+  ppd_ext_param_t      **p;            /* Pointer to parameter */
+
+
+  if (opt == NULL || param == NULL)
+    return (NULL);
+
+  for (i = opt->num_params, p = opt->params; i > 0; i --, p ++)
+    if (strcasecmp(p[0]->keyword, param) == 0)
+      return (*p);
+
+  return (NULL);
+}
+
+
 /*
  * 'ppdMarkCurve()' - Mark an extended curve option.
  */
 
-int                                            /* O - Number of conflicts */
-ppdMarkCurve(ppd_file_t *ppd,                  /* I - PPD file */
-             const char *keyword,              /* I - Option name */
-             float      low,                   /* I - Lower (start) value */
-            float      high,                   /* I - Upper (end) value */
-            float      gvalue)                 /* I - Gamma value for range */
+int                                    /* O - Number of conflicts */
+ppdMarkCurve(ppd_file_t *ppd,          /* I - PPD file */
+             const char *keyword,      /* I - Option name */
+             const char *param,                /* I - Parameter name */
+             float      low,           /* I - Lower (start) value */
+            float      high,           /* I - Upper (end) value */
+            float      gvalue)         /* I - Gamma value for range */
 {
-  ppd_ext_option_t     *o;                     /* Extended option */
+  ppd_ext_option_t     *o;             /* Extended option */
+  ppd_ext_param_t      *p;             /* Extended parameter */
 
 
   if ((o = ppdFindExtOption(ppd, keyword)) == NULL)
     return (-1);
 
+  if ((p = ppdFindExtParam(o, param)) == NULL)
+    return (-1);
+
   ppd_unmark_choices(o->option);
 
   return (ppdConflicts(ppd));
@@ -103,17 +131,22 @@ ppdMarkCurve(ppd_file_t *ppd,                     /* I - PPD file */
  * 'ppdMarkGamma()' - Mark an extended gamma option.
  */
 
-int                                            /* O - Number of conflicts */
-ppdMarkGamma(ppd_file_t *ppd,                  /* I - PPD file */
-             const char *keyword,              /* I - Option name */
-             float      gvalue)                        /* I - Gamma value */
+int                                    /* O - Number of conflicts */
+ppdMarkGamma(ppd_file_t *ppd,          /* I - PPD file */
+             const char *keyword,      /* I - Option name */
+             const char *param,                /* I - Parameter name */
+             float      gvalue)                /* I - Gamma value */
 {
-  ppd_ext_option_t     *o;                     /* Extended option */
+  ppd_ext_option_t     *o;             /* Extended option */
+  ppd_ext_param_t      *p;             /* Extended parameter */
 
 
   if ((o = ppdFindExtOption(ppd, keyword)) == NULL)
     return (-1);
 
+  if ((p = ppdFindExtParam(o, param)) == NULL)
+    return (-1);
+
   ppd_unmark_choices(o->option);
 
   return (ppdConflicts(ppd));
@@ -124,17 +157,22 @@ ppdMarkGamma(ppd_file_t *ppd,                     /* I - PPD file */
  * 'ppdMarkInteger()' - Mark an extended integer option.
  */
 
-int                                            /* O - Number of conflicts */
-ppdMarkInteger(ppd_file_t *ppd,                        /* I - PPD file */
-               const char *keyword,            /* I - Option name */
-               int        value)               /* I - Option value */
+int                                    /* O - Number of conflicts */
+ppdMarkInteger(ppd_file_t *ppd,                /* I - PPD file */
+               const char *keyword,    /* I - Option name */
+               const char *param,      /* I - Parameter name */
+               int        value)       /* I - Option value */
 {
-  ppd_ext_option_t     *o;                     /* Extended option */
+  ppd_ext_option_t     *o;             /* Extended option */
+  ppd_ext_param_t      *p;             /* Extended parameter */
 
 
   if ((o = ppdFindExtOption(ppd, keyword)) == NULL)
     return (-1);
 
+  if ((p = ppdFindExtParam(o, param)) == NULL)
+    return (-1);
+
   ppd_unmark_choices(o->option);
 
   return (ppdConflicts(ppd));
@@ -145,18 +183,24 @@ ppdMarkInteger(ppd_file_t *ppd,                   /* I - PPD file */
  * 'ppdMarkIntegerArray()' - Mark an extended integer array option.
  */
 
-int                                            /* O - Number of conflicts */
-ppdMarkIntegerArray(ppd_file_t *ppd,           /* I - PPD file */
-                    const char *keyword,       /* I - Option name */
-                    int        num_values,     /* I - Number of values */
-                   const int  *values)         /* I - Values */
+int                                    /* O - Number of conflicts */
+ppdMarkIntegerArray(ppd_file_t *ppd,   /* I - PPD file */
+                    const char *keyword,/* I - Option name */
+                   const char *param,  /* I - Parameter name */
+                    int        num_values,
+                                       /* I - Number of values */
+                   const int  *values) /* I - Values */
 {
-  ppd_ext_option_t     *o;                     /* Extended option */
+  ppd_ext_option_t     *o;             /* Extended option */
+  ppd_ext_param_t      *p;             /* Extended parameter */
 
 
   if ((o = ppdFindExtOption(ppd, keyword)) == NULL)
     return (-1);
 
+  if ((p = ppdFindExtParam(o, param)) == NULL)
+    return (-1);
+
   ppd_unmark_choices(o->option);
 
   return (ppdConflicts(ppd));
@@ -167,17 +211,22 @@ ppdMarkIntegerArray(ppd_file_t *ppd,              /* I - PPD file */
  * 'ppdMarkReal()' - Mark an extended real option.
  */
 
-int                                            /* O - Number of conflicts */
-ppdMarkReal(ppd_file_t *ppd,                   /* I - PPD file */
-            const char *keyword,               /* I - Option name */
-            float      value)                  /* I - Option value */
+int                                    /* O - Number of conflicts */
+ppdMarkReal(ppd_file_t *ppd,           /* I - PPD file */
+            const char *keyword,       /* I - Option name */
+            const char *param,         /* I - Parameter name */
+            float      value)          /* I - Option value */
 {
-  ppd_ext_option_t     *o;                     /* Extended option */
+  ppd_ext_option_t     *o;             /* Extended option */
+  ppd_ext_param_t      *p;             /* Extended parameter */
 
 
   if ((o = ppdFindExtOption(ppd, keyword)) == NULL)
     return (-1);
 
+  if ((p = ppdFindExtParam(o, param)) == NULL)
+    return (-1);
+
   ppd_unmark_choices(o->option);
 
   return (ppdConflicts(ppd));
@@ -188,18 +237,23 @@ ppdMarkReal(ppd_file_t *ppd,                      /* I - PPD file */
  * 'ppdMarkRealArray()' - Mark an extended real array option.
  */
 
-int                                            /* O - Number of conflicts */
-ppdMarkRealArray(ppd_file_t  *ppd,             /* I - PPD file */
-                 const char  *keyword,         /* I - Option name */
-                 int         num_values,       /* I - Number of values */
-                const float *values)           /* I - Values */
+int                                    /* O - Number of conflicts */
+ppdMarkRealArray(ppd_file_t  *ppd,     /* I - PPD file */
+                 const char  *keyword, /* I - Option name */
+                 const char  *param,   /* I - Parameter name */
+                 int         num_values,/* I - Number of values */
+                const float *values)   /* I - Values */
 {
-  ppd_ext_option_t     *o;                     /* Extended option */
+  ppd_ext_option_t     *o;             /* Extended option */
+  ppd_ext_param_t      *p;             /* Extended parameter */
 
 
   if ((o = ppdFindExtOption(ppd, keyword)) == NULL)
     return (-1);
 
+  if ((p = ppdFindExtParam(o, param)) == NULL)
+    return (-1);
+
   ppd_unmark_choices(o->option);
 
   return (ppdConflicts(ppd));
@@ -210,17 +264,22 @@ ppdMarkRealArray(ppd_file_t  *ppd,                /* I - PPD file */
  * 'ppdMarkText()' - Mark an extended text option.
  */
 
-int                                            /* O - Number of conflicts */
-ppdMarkText(ppd_file_t *ppd,                   /* I - PPD file */
-            const char *keyword,               /* I - Option name */
-            const char *value)                 /* I - Option value */
+int                                    /* O - Number of conflicts */
+ppdMarkText(ppd_file_t *ppd,           /* I - PPD file */
+            const char *keyword,       /* I - Option name */
+            const char *param,         /* I - Parameter name */
+            const char *value)         /* I - Option value */
 {
-  ppd_ext_option_t     *o;                     /* Extended option */
+  ppd_ext_option_t     *o;             /* Extended option */
+  ppd_ext_param_t      *p;             /* Extended parameter */
 
 
   if ((o = ppdFindExtOption(ppd, keyword)) == NULL)
     return (-1);
 
+  if ((p = ppdFindExtParam(o, param)) == NULL)
+    return (-1);
+
   ppd_unmark_choices(o->option);
 
   return (ppdConflicts(ppd));
@@ -232,10 +291,10 @@ ppdMarkText(ppd_file_t *ppd,                      /* I - PPD file */
  */
 
 static void
-ppd_unmark_choices(ppd_option_t *option)       /* I - Option choice */
+ppd_unmark_choices(ppd_option_t *option)/* I - Option choice */
 {
-  int          i;                              /* Looping var */
-  ppd_choice_t *c;                             /* Current choice */
+  int          i;                      /* Looping var */
+  ppd_choice_t *c;                     /* Current choice */
 
 
   for (i = option->num_choices, c = option->choices; i > 0; i --, c++)
@@ -244,5 +303,5 @@ ppd_unmark_choices(ppd_option_t *option)    /* I - Option choice */
 
 
 /*
- * End of "$Id: extended.c,v 1.1.2.3 2003/01/07 18:26:24 mike Exp $".
+ * End of "$Id: extended.c,v 1.1.2.4 2003/04/10 03:01:48 mike Exp $".
  */
index 297f9275afdfcd194a4c925910187ccfe8bdf6f0..cf4bf2af19ab9ec6163e5bfe93ab3c8363c289a4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.c,v 1.51.2.49 2003/02/28 21:07:32 mike Exp $"
+ * "$Id: ppd.c,v 1.51.2.50 2003/04/10 03:01:48 mike Exp $"
  *
  *   PPD file routines for the Common UNIX Printing System (CUPS).
  *
@@ -51,7 +51,8 @@
  *                           0x9f to be valid ISO-8859-1 characters...
  *   ppd_free_group()      - Free a single UI group.
  *   ppd_free_option()     - Free a single option.
- *   ppd_get_extopt()      - Get an extended option record.
+ *   ppd_get_extoption()   - Get an extended option record.
+ *   ppd_get_extparam()    - Get an extended parameter record.
  *   ppd_get_group()       - Find or create the named group as needed.
  *   ppd_get_option()      - Find or create the named option as needed.
  *   ppd_read()            - Read a line from a PPD file, skipping comment
@@ -120,7 +121,10 @@ static void                ppd_fix(char *string);
 #endif /* !__APPLE__ */
 static void            ppd_free_group(ppd_group_t *group);
 static void            ppd_free_option(ppd_option_t *option);
-static ppd_ext_option_t        *ppd_get_extopt(ppd_file_t *ppd, const char *name);
+static ppd_ext_option_t        *ppd_get_extoption(ppd_file_t *ppd, const char *name);
+static ppd_ext_param_t *ppd_get_extparam(ppd_ext_option_t *opt,
+                                         const char *param,
+                                         const char *text);
 static ppd_group_t     *ppd_get_group(ppd_file_t *ppd, const char *name,
                                       const char *text);
 static ppd_option_t    *ppd_get_option(ppd_group_t *group, const char *name);
@@ -155,12 +159,14 @@ _ppd_attr_compare(ppd_attr_t **a, /* I - First attribute */
 void
 ppdClose(ppd_file_t *ppd)              /* I - PPD file record */
 {
-  int          i;                      /* Looping var */
-  ppd_emul_t   *emul;                  /* Current emulation */
-  ppd_group_t  *group;                 /* Current group */
-  char         **font;                 /* Current font */
-  char         **filter;               /* Current filter */
-  ppd_attr_t   **attr;                 /* Current attribute */
+  int                  i, j;           /* Looping var */
+  ppd_emul_t           *emul;          /* Current emulation */
+  ppd_group_t          *group;         /* Current group */
+  char                 **font;         /* Current font */
+  char                 **filter;       /* Current filter */
+  ppd_attr_t           **attr;         /* Current attribute */
+  ppd_ext_option_t     **opt;          /* Current extended option */
+  ppd_ext_param_t      **param;        /* Current extended parameter */
 
 
  /*
@@ -273,6 +279,21 @@ ppdClose(ppd_file_t *ppd)          /* I - PPD file record */
     ppd_free(ppd->attrs);
   }
 
+  if (ppd->num_extended)
+  {
+    for (i = ppd->num_extended, opt = ppd->extended; i > 0; i --, opt ++)
+    {
+      ppd_free((*opt)->code);
+
+      for (j = (*opt)->num_params, param = (*opt)->params; j > 0; j --, param ++)
+        ppd_free((*param)->value);
+
+      ppd_free((*opt)->params);
+    }
+
+    ppd_free(ppd->extended);
+  }
+
  /*
   * Free the whole record...
   */
@@ -465,7 +486,7 @@ ppdOpen(FILE *fp)                   /* I - File to read from */
   * Allocate memory for the PPD file record...
   */
 
-  if ((ppd = calloc(sizeof(ppd_file_t), 1)) == NULL)
+  if ((ppd = calloc(1, sizeof(ppd_file_t))) == NULL)
   {
     ppd_status = PPD_ALLOC_ERROR;
 
@@ -1146,7 +1167,7 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
        }
 
       ppd->num_emulations = count;
-      ppd->emulations     = calloc(sizeof(ppd_emul_t), count);
+      ppd->emulations     = calloc(count, sizeof(ppd_emul_t));
 
       for (i = 0, sptr = string; i < count; i ++)
       {
@@ -1687,7 +1708,7 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
              strcmp(keyword, "NonUIConstraints") == 0)
     {
       if (ppd->num_consts == 0)
-       constraint = calloc(sizeof(ppd_const_t), 1);
+       constraint = calloc(1, sizeof(ppd_const_t));
       else
        constraint = realloc(ppd->consts,
                             (ppd->num_consts + 1) * sizeof(ppd_const_t));
@@ -1879,6 +1900,7 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
       choice->code = string;
       string = NULL;                   /* Don't free this string below */
     }
+#if 0
     else if (strcmp(keyword, "cupsUIType") == 0 &&
              (mask & (PPD_KEYWORD | PPD_STRING)) == (PPD_KEYWORD | PPD_STRING) &&
             option != NULL)
@@ -1887,7 +1909,7 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
       * Define an extended option value type...
       */
 
-      extopt = ppd_get_extopt(ppd, name);
+      extopt = ppd_get_extoption(ppd, name);
 
       if (strcmp(string, "Text") == 0)
         option->ui = PPD_UI_CUPS_TEXT;
@@ -1948,7 +1970,7 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
       * Define an extended option minimum value...
       */
 
-      extopt = ppd_get_extopt(ppd, name);
+      extopt = ppd_get_extoption(ppd, name);
 
       switch (option->ui)
       {
@@ -1994,7 +2016,7 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
       * Define an extended option minimum value...
       */
 
-      extopt = ppd_get_extopt(ppd, name);
+      extopt = ppd_get_extoption(ppd, name);
 
       switch (option->ui)
       {
@@ -2040,7 +2062,7 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
       * Define an extended option maximum value...
       */
 
-      extopt = ppd_get_extopt(ppd, name);
+      extopt = ppd_get_extoption(ppd, name);
 
       switch (option->ui)
       {
@@ -2086,11 +2108,12 @@ ppdOpen(FILE *fp)                       /* I - File to read from */
       * Define an extended option command...
       */
 
-      extopt = ppd_get_extopt(ppd, name);
+      extopt = ppd_get_extoption(ppd, name);
 
       extopt->command = string;
       string = NULL;
     }
+#endif /* 0 */
     else if (strcmp(keyword, "OpenSubGroup") != 0 &&
              strcmp(keyword, "CloseSubGroup") != 0)
     {
@@ -2640,12 +2663,12 @@ ppd_free_option(ppd_option_t *option)   /* I - Option to free */
 
 
 /*
- * 'ppd_get_extopt()' - Get an extended option record.
+ * 'ppd_get_extoption()' - Get an extended option record.
  */
 
 static ppd_ext_option_t        *               /* O - Extended option... */
-ppd_get_extopt(ppd_file_t *ppd,                /* I - PPD file */
-               const char *name)       /* I - Name of option */
+ppd_get_extoption(ppd_file_t *ppd,     /* I - PPD file */
+                  const char *name)    /* I - Name of option */
 {
   ppd_ext_option_t     **temp,         /* New array pointer */
                        *extopt;        /* New extended option */
@@ -2662,7 +2685,7 @@ ppd_get_extopt(ppd_file_t *ppd,           /* I - PPD file */
   * Not found, so create the extended option record...
   */
 
-  if ((extopt = calloc(sizeof(ppd_ext_option_t), 1)) == NULL)
+  if ((extopt = calloc(1, sizeof(ppd_ext_option_t))) == NULL)
     return (NULL);
 
   strlcpy(extopt->keyword, name, sizeof(extopt->keyword));
@@ -2696,6 +2719,75 @@ ppd_get_extopt(ppd_file_t *ppd,          /* I - PPD file */
 }
 
 
+/*
+ * 'ppd_get_extparam()' - Get an extended parameter record.
+ */
+
+static ppd_ext_param_t *               /* O - Extended option... */
+ppd_get_extparam(ppd_ext_option_t *opt,        /* I - PPD file */
+                 const char      *param,/* I - Name of parameter */
+                const char      *text) /* I - Human-readable text */
+{
+  ppd_ext_param_t      **temp,         /* New array pointer */
+                       *extparam;      /* New extended parameter */
+
+
+ /*
+  * See if the parameter already exists...
+  */
+
+  if ((extparam = ppdFindExtParam(opt, param)) != NULL)
+    return (extparam);
+
+ /*
+  * Not found, so create the extended parameter record...
+  */
+
+  if ((extparam = calloc(1, sizeof(ppd_ext_param_t))) == NULL)
+    return (NULL);
+
+  if ((extparam->value = calloc(4, sizeof(ppd_ext_value_t))) == NULL)
+  {
+    ppd_free(extparam);
+    return (NULL);
+  }
+
+  extparam->defval = extparam->value + 1;
+  extparam->minval = extparam->value + 2;
+  extparam->maxval = extparam->value + 3;
+
+  strlcpy(extparam->keyword, param, sizeof(extparam->keyword));
+  strlcpy(extparam->text, text, sizeof(extparam->text));
+
+ /*
+  * Add this record to the end of the array...
+  */
+
+  if (opt->num_params == 0)
+    temp = malloc(sizeof(ppd_ext_param_t *));
+  else
+    temp = realloc(opt->params, sizeof(ppd_ext_param_t *) *
+                                       (opt->num_params + 1));
+
+  if (temp == NULL)
+  {
+    free(extparam);
+    return (NULL);
+  }
+
+  opt->params           = temp;
+  temp[opt->num_params] = extparam;
+
+  opt->num_params ++;
+
+ /*
+  * Return the new record...
+  */
+
+  return (extparam);
+}
+
+
 /*
  * 'ppd_get_group()' - Find or create the named group as needed.
  */
@@ -3251,5 +3343,5 @@ ppd_read(FILE *fp,                        /* I - File to read from */
 
 
 /*
- * End of "$Id: ppd.c,v 1.51.2.49 2003/02/28 21:07:32 mike Exp $".
+ * End of "$Id: ppd.c,v 1.51.2.50 2003/04/10 03:01:48 mike Exp $".
  */
index 218cc15c9d9d25d3bf4d3c8fb16672f21ed0f9b3..c4b9f1800859f957f13d5116bc820cd4782fc55c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.h,v 1.24.2.16 2003/03/13 05:45:29 mike Exp $"
+ * "$Id: ppd.h,v 1.24.2.17 2003/04/10 03:01:49 mike Exp $"
  *
  *   PostScript Printer Description definitions for the Common UNIX Printing
  *   System (CUPS).
@@ -73,20 +73,11 @@ extern "C" {
  * Types and structures...
  */
 
-typedef enum                   /**** UI types ****/
+typedef enum                   /**** UI Types ****/
 {
   PPD_UI_BOOLEAN,              /* True or False option */
   PPD_UI_PICKONE,              /* Pick one from a list */
-  PPD_UI_PICKMANY,             /* Pick zero or more from a list */
-  /**** New in CUPS 1.2 ****/
-  PPD_UI_CUPS_TEXT,            /* Specify a string */
-  PPD_UI_CUPS_INTEGER,         /* Specify an integer number */
-  PPD_UI_CUPS_REAL,            /* Specify a real number */
-  PPD_UI_CUPS_GAMMA,           /* Specify a gamma number */
-  PPD_UI_CUPS_CURVE,           /* Specify start, end, and gamma numbers */
-  PPD_UI_CUPS_INTEGER_ARRAY,   /* Specify an array of integer numbers */
-  PPD_UI_CUPS_REAL_ARRAY,      /* Specify an array of real numbers */
-  PPD_UI_CUPS_XY_ARRAY         /* Specify an array of X/Y real numbers */
+  PPD_UI_PICKMANY              /* Pick zero or more from a list */
 } ppd_ui_t;
 
 typedef enum                   /**** Order dependency sections ****/
@@ -187,49 +178,6 @@ typedef struct ppd_group_str       /**** Groups ****/
                                /* Sub-groups (max depth = 1) */
 } ppd_group_t;
 
-typedef union                  /**** Extended Values ****/
-{
-  char         *text;          /* Text value */
-  int          integer;        /* Integer value */
-  float                real;           /* Real value */
-  float                gamma;          /* Gamma value */
-  /**** New in CUPS 1.2 ****/
-  struct
-  {
-    float      start,          /* Linear (density) start value for curve */
-               end,            /* Linear (density) end value for curve */
-               gamma;          /* Gamma correction */
-  }            curve;          /* Curve values */
-  struct
-  {
-    int                num_elements,   /* Number of array elements */
-               *elements;      /* Array of integer values */
-  }            integer_array;  /* Integer array value */
-  struct
-  {
-    int                num_elements;   /* Number of array elements */
-    float      *elements;      /* Array of real values */
-  }            real_array;     /* Real array value */
-  struct
-  {
-    int                num_elements;   /* Number of array elements */
-    float      *elements;      /* Array of XY values */
-  }            xy_array;       /* XY array value */
-} ppd_ext_value_t;
-
-/**** New in CUPS 1.2 ****/
-typedef struct                 /**** Extended Options ****/
-{
-  char         keyword[PPD_MAX_NAME];
-                               /* Name of option that is being extended... */
-  ppd_option_t *option;        /* Option that is being extended... */
-  const char   *command;       /* Generic command for extended options */
-  ppd_ext_value_t value,       /* Current values */
-               defval,         /* Default values */
-               minval,         /* Minimum numeric values */
-               maxval;         /* Maximum numeric values */
-} ppd_ext_option_t;
-
 typedef struct                 /**** Constraints ****/
 {
   char         option1[PPD_MAX_NAME],
@@ -274,6 +222,71 @@ typedef struct                     /**** sRGB Color Profiles ****/
                matrix[3][3];   /* Transform matrix */
 } ppd_profile_t;
 
+/**** New in CUPS 1.1.19 ****/
+typedef enum                   /**** Extended UI Types ****/
+{
+  PPD_UI_CUPS_TEXT,            /* Specify a string */
+  PPD_UI_CUPS_INTEGER,         /* Specify an integer number */
+  PPD_UI_CUPS_REAL,            /* Specify a real number */
+  PPD_UI_CUPS_GAMMA,           /* Specify a gamma number */
+  PPD_UI_CUPS_CURVE,           /* Specify start, end, and gamma numbers */
+  PPD_UI_CUPS_INTEGER_ARRAY,   /* Specify an array of integer numbers */
+  PPD_UI_CUPS_REAL_ARRAY,      /* Specify an array of real numbers */
+  PPD_UI_CUPS_XY_ARRAY         /* Specify an array of X/Y real numbers */
+} ppd_ext_ui_t;
+
+typedef union                  /**** Extended Values ****/
+{
+  char         *text;          /* Text value */
+  int          integer;        /* Integer value */
+  float                real;           /* Real value */
+  float                gamma;          /* Gamma value */
+  struct
+  {
+    float      start,          /* Linear (density) start value for curve */
+               end,            /* Linear (density) end value for curve */
+               gamma;          /* Gamma correction */
+  }            curve;          /* Curve values */
+  struct
+  {
+    int                num_elements,   /* Number of array elements */
+               *elements;      /* Array of integer values */
+  }            integer_array;  /* Integer array value */
+  struct
+  {
+    int                num_elements;   /* Number of array elements */
+    float      *elements;      /* Array of real values */
+  }            real_array;     /* Real array value */
+  struct
+  {
+    int                num_elements;   /* Number of array elements */
+    float      *elements;      /* Array of XY values */
+  }            xy_array;       /* XY array value */
+} ppd_ext_value_t;
+
+typedef struct                 /**** Extended Parameter ****/
+{
+  char         keyword[PPD_MAX_NAME],
+                               /* Parameter name */
+               text[PPD_MAX_TEXT];
+                               /* Human-readable text */
+  ppd_ext_value_t *value,      /* Current values */
+               *defval,        /* Default values */
+               *minval,        /* Minimum numeric values */
+               *maxval;        /* Maximum numeric values */
+} ppd_ext_param_t;
+
+typedef struct                 /**** Extended Options ****/
+{
+  char         keyword[PPD_MAX_NAME];
+                               /* Name of option that is being extended... */
+  ppd_option_t *option;        /* Option that is being extended... */
+  int          marked;         /* Extended option is marked */
+  char         *code;          /* Generic PS code for extended options */
+  int          num_params;     /* Number of parameters */
+  ppd_ext_param_t **params;    /* Parameters */
+} ppd_ext_option_t;
+
 typedef struct                 /**** Files ****/
 {
   int          language_level, /* Language level of device */
@@ -325,8 +338,6 @@ typedef struct                      /**** Files ****/
   int          num_attrs,      /* Number of attributes */
                cur_attr;       /* Current attribute */
   ppd_attr_t   **attrs;        /* Attributes */
-
-  /**** New in CUPS 1.2 ****/
   int          num_extended;   /* Number of extended options */
   ppd_ext_option_t **extended; /* Extended options */
 } ppd_file_t;
@@ -368,25 +379,30 @@ extern ppd_attr_t *ppdFindAttr(ppd_file_t *ppd, const char *name,
 extern ppd_attr_t      *ppdFindNextAttr(ppd_file_t *ppd, const char *name,
                                         const char *spec);
 extern ppd_status_t    ppdLastError(int *line);
-
-/**** New in CUPS 1.2 ****/
 extern ppd_ext_option_t        *ppdFindExtOption(ppd_file_t *ppd, const char *keyword);
+extern ppd_ext_param_t *ppdFindExtParam(ppd_ext_option_t *opt, const char *param);
 extern int             ppdMarkCurve(ppd_file_t *ppd, const char *keyword,
-                                    float low, float high, float gvalue);
+                                    const char *param, float low, float high,
+                                    float gvalue);
 extern int             ppdMarkGamma(ppd_file_t *ppd, const char *keyword,
-                                    float gvalue);
+                                    const char *param, float gvalue);
 extern int             ppdMarkInteger(ppd_file_t *ppd, const char *keyword,
-                                      int value);
+                                      const char *param, int value);
 extern int             ppdMarkIntegerArray(ppd_file_t *ppd, const char *keyword,
-                                           int num_values, const int *values);
+                                           const char *param, int num_values,
+                                           const int *values);
 extern int             ppdMarkReal(ppd_file_t *ppd, const char *keyword,
-                                   float value);
+                                   const char *param, float value);
 extern int             ppdMarkRealArray(ppd_file_t *ppd, const char *keyword,
-                                        int num_values, const float *values);
+                                        const char *param, int num_values,
+                                        const float *values);
 extern int             ppdMarkText(ppd_file_t *ppd, const char *keyword,
-                                   const char *value);
+                                   const char *param, const char *value);
 extern int             ppdMarkXYArray(ppd_file_t *ppd, const char *keyword,
-                                      int num_values, const float *values);
+                                      const char *param, int num_values,
+                                      const float *values);
+
+/**** New in CUPS 1.2 ****/
 extern int             ppdSave(ppd_file_t *ppd, FILE *fp);
 extern int             ppdSaveFd(ppd_file_t *ppd, int fd);
 extern int             ppdSaveFile(ppd_file_t *ppd, const char *filename);
@@ -402,5 +418,5 @@ extern int          ppdSaveFile(ppd_file_t *ppd, const char *filename);
 #endif /* !_CUPS_PPD_H_ */
 
 /*
- * End of "$Id: ppd.h,v 1.24.2.16 2003/03/13 05:45:29 mike Exp $".
+ * End of "$Id: ppd.h,v 1.24.2.17 2003/04/10 03:01:49 mike Exp $".
  */