]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/custom.c
Merge changes from CUPS 1.6svn-r9939.
[thirdparty/cups.git] / cups / custom.c
index bd7d166333f09c176e79ea942a9ad04c16302259..471361cc40496e88d97cae0a384b7e3c517bab9e 100644 (file)
@@ -1,25 +1,16 @@
 /*
- * "$Id: custom.c 177 2006-06-21 00:20:03Z jlovell $"
+ * "$Id: custom.c 6649 2007-07-11 21:46:42Z mike $"
  *
- *   PPD custom option routines for the Common UNIX Printing System (CUPS).
+ *   PPD custom option routines for CUPS.
  *
+ *   Copyright 2007-2011 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products and are protected by Federal
- *   copyright law.  Distribution and use rights are outlined in the file
- *   "LICENSE.txt" which should have been included with this file.  If this
- *   file is missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ *   property of Apple Inc. and are protected by Federal copyright
+ *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ *   which should have been included with this file.  If this file is
+ *   file is missing or damaged, see the license at "http://www.cups.org/".
  *
  *   PostScript is a trademark of Adobe Systems, Inc.
  *
  * Include necessary headers.
  */
 
-#include "globals.h"
-#include "debug.h"
+#include "cups-private.h"
 
 
 /*
  * 'ppdFindCustomOption()' - Find a custom option.
  *
- * @since CUPS 1.2@
+ * @since CUPS 1.2/Mac OS X 10.5@
  */
 
 ppd_coption_t *                                /* O - Custom option or NULL */
@@ -72,28 +62,33 @@ ppdFindCustomOption(ppd_file_t *ppd,        /* I - PPD file */
 /*
  * 'ppdFindCustomParam()' - Find a parameter for a custom option.
  *
- * @since CUPS 1.2@
+ * @since CUPS 1.2/Mac OS X 10.5@
  */
 
 ppd_cparam_t *                         /* O - Custom parameter or NULL */
 ppdFindCustomParam(ppd_coption_t *opt, /* I - Custom option */
                    const char    *name)        /* I - Parameter name */
 {
-  ppd_cparam_t key;                    /* Custom parameter search key */
+  ppd_cparam_t *param;                 /* Current custom parameter */
 
 
   if (!opt)
     return (NULL);
 
-  strlcpy(key.name, name, sizeof(key.name));
-  return ((ppd_cparam_t *)cupsArrayFind(opt->params, &key));
+  for (param = (ppd_cparam_t *)cupsArrayFirst(opt->params);
+       param;
+       param = (ppd_cparam_t *)cupsArrayNext(opt->params))
+    if (!_cups_strcasecmp(param->name, name))
+      break;
+
+  return (param);
 }
 
 
 /*
  * 'ppdFirstCustomParam()' - Return the first parameter for a custom option.
  *
- * @since CUPS 1.2@
+ * @since CUPS 1.2/Mac OS X 10.5@
  */
 
 ppd_cparam_t *                         /* O - Custom parameter or NULL */
@@ -109,7 +104,7 @@ ppdFirstCustomParam(ppd_coption_t *opt)     /* I - Custom option */
 /*
  * 'ppdNextCustomParam()' - Return the next parameter for a custom option.
  *
- * @since CUPS 1.2@
+ * @since CUPS 1.2/Mac OS X 10.5@
  */
 
 ppd_cparam_t *                         /* O - Custom parameter or NULL */
@@ -123,5 +118,5 @@ ppdNextCustomParam(ppd_coption_t *opt)      /* I - Custom option */
 
 
 /*
- * End of "$Id: custom.c 177 2006-06-21 00:20:03Z jlovell $".
+ * End of "$Id: custom.c 6649 2007-07-11 21:46:42Z mike $".
  */