355b4669e025ff377602b6fc7caaf30dbc218371jacobs * CDDL HEADER START
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * The contents of this file are subject to the terms of the
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Common Development and Distribution License (the "License").
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * You may not use this file except in compliance with the License.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * See the License for the specific language governing permissions
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * and limitations under the License.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * When distributing Covered Code, include this CDDL HEADER in each
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * If applicable, add the following below this CDDL HEADER, with the
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * fields enclosed by brackets "[]" replaced with your own identifying
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * information: Portions Copyright [yyyy] [name of copyright owner]
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * CDDL HEADER END
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Use is subject to license terms.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#pragma ident "%Z%%M% %I% %E% SMI"
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * This file contains an extremely rudimentary implementation of PPD file
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * parsing support. The parsing done here converts the contents of a PPD
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * file into a set of PAPI attributes that applications can use to build
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * print panels.
355b4669e025ff377602b6fc7caaf30dbc218371jacobsprocess_line(char *line, char **key, char **value, char **comment)
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * line is in the form:
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * *key value/comment: data
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * line is in the form:
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * *key value/comment: data
355b4669e025ff377602b6fc7caaf30dbc218371jacobsPPDFileToAttributesList(papi_attribute_t ***attributes, char *filename)
355b4669e025ff377602b6fc7caaf30dbc218371jacobs /* we want *key...: "value" */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs snprintf(capability, sizeof (capability), "%s", value);
355b4669e025ff377602b6fc7caaf30dbc218371jacobs /* do nothing */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs /* do nothing */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs } else if ((strncasecmp(key, "Default", 7) == 0) && ui) {
355b4669e025ff377602b6fc7caaf30dbc218371jacobs } else if ((strcasecmp(key, capability) == 0) && ui) {