*
* Page size functions for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
#include "ppd.h"
#include "string.h"
#include <ctype.h>
+#include "debug.h"
/*
ppd_cparam_t *cparam; /* Custom option parameter */
+ DEBUG_printf(("2ppdPageSize(ppd=%p, name=\"%s\")", ppd, name));
+
if (!ppd)
+ {
+ DEBUG_puts("3ppdPageSize: Bad PPD pointer, returning NULL...");
return (NULL);
+ }
if (name)
{
break;
if (!i)
+ {
+ DEBUG_puts("3ppdPageSize: No custom sizes, returning NULL...");
return (NULL);
+ }
/*
* Variable size; size name can be one of the following:
* Return the page size...
*/
+ DEBUG_printf(("3ppdPageSize: Returning %p (\"%s\", %gx%g)", size,
+ size->name, size->width, size->length));
+
return (size);
}
else
*/
for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
- if (!strcmp(name, size->name))
+ if (!strcasecmp(name, size->name))
+ {
+ DEBUG_printf(("3ppdPageSize: Returning %p (\"%s\", %gx%g)", size,
+ size->name, size->width, size->length));
+
return (size);
+ }
}
}
else
for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++)
if (size->marked)
+ {
+ DEBUG_printf(("3ppdPageSize: Returning %p (\"%s\", %gx%g)", size,
+ size->name, size->width, size->length));
+
return (size);
+ }
}
+ DEBUG_puts("3ppdPageSize: Size not found, returning NULL");
+
return (NULL);
}
* If the specified PPD file does not support custom page sizes, both
* "minimum" and "maximum" are filled with zeroes.
*
- * @since CUPS 1.4@
+ * @since CUPS 1.4/Mac OS X 10.6@
*/
int /* O - 1 if custom sizes are supported, 0 otherwise */