/*
- * "$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 */
/*
* '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 */
/*
* '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 */
/*
- * 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 $".
*/