]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/attr.c
Merge changes from CUPS 1.5svn-r9000.
[thirdparty/cups.git] / cups / attr.c
index c2c6eb5128e91a17b827e99a7e86a53795457200..2cae04f3d65b6912760efa48a563fd979b1d7ad2 100644 (file)
@@ -1,10 +1,9 @@
 /*
  * "$Id: attr.c 7584 2008-05-16 22:55:53Z mike $"
  *
- *   PPD model-specific attribute routines for the Common UNIX Printing System
- *   (CUPS).
+ *   PPD model-specific attribute routines for CUPS.
  *
- *   Copyright 2007-2009 by Apple Inc.
+ *   Copyright 2007-2010 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -15,8 +14,9 @@
  *
  * Contents:
  *
- *   ppdFindAttr()     - Find the first matching attribute.
- *   ppdFindNextAttr() - Find the next matching attribute.
+ *   ppdFindAttr()               - Find the first matching attribute.
+ *   ppdFindNextAttr()           - Find the next matching attribute.
+ *   _ppdNormalizeMakeAndModel() - Normalize a product/make-and-model string.
  */
 
 /*
@@ -140,89 +140,6 @@ ppdFindNextAttr(ppd_file_t *ppd,   /* I - PPD file data */
 }
 
 
-/*
- * '_ppdGet1284Values()' - Get 1284 device ID keys and values.
- *
- * The returned dictionary is a CUPS option array that can be queried with
- * cupsGetOption and freed with cupsFreeOptions.
- */
-
-int                                    /* O - Number of key/value pairs */
-_ppdGet1284Values(
-    const char *device_id,             /* I - IEEE-1284 device ID string */
-    cups_option_t **values)            /* O - Array of key/value pairs */
-{
-  int          num_values;             /* Number of values */
-  char         key[256],               /* Key string */
-               value[256],             /* Value string */
-               *ptr;                   /* Pointer into key/value */
-
-
- /*
-  * Range check input...
-  */
-
-  if (values)
-    *values = NULL;
-
-  if (!device_id || !values)
-    return (0);
-
- /*
-  * Parse the 1284 device ID value into keys and values.  The format is
-  * repeating sequences of:
-  *
-  *   [whitespace]key:value[whitespace];
-  */
-
-  num_values = 0;
-  while (*device_id)
-  {
-    while (isspace(*device_id & 255))
-      device_id ++;
-
-    if (!*device_id)
-      break;
-
-    for (ptr = key; *device_id && *device_id != ':'; device_id ++)
-      if (ptr < (key + sizeof(key) - 1))
-        *ptr++ = *device_id;
-
-    if (!*device_id)
-      break;
-
-    while (ptr > key && isspace(ptr[-1] & 255))
-      ptr --;
-
-    *ptr = '\0';
-    device_id ++;
-
-    while (isspace(*device_id & 255))
-      device_id ++;
-
-    if (!*device_id)
-      break;
-
-    for (ptr = value; *device_id && *device_id != ';'; device_id ++)
-      if (ptr < (value + sizeof(value) - 1))
-        *ptr++ = *device_id;
-
-    if (!*device_id)
-      break;
-
-    while (ptr > value && isspace(ptr[-1] & 255))
-      ptr --;
-
-    *ptr = '\0';
-    device_id ++;
-
-    num_values = cupsAddOption(key, value, num_values, values);
-  }
-
-  return (num_values);
-}
-
-
 /*
  * '_ppdNormalizeMakeAndModel()' - Normalize a product/make-and-model string.
  *