/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*/
/* $Id: ipp_types.c 146 2006-03-24 00:26:54Z njacobs $ */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ipp.h>
#include <errno.h>
#include <values.h>
#ifndef MININT
#endif
typedef struct {
char *name;
int min;
int max;
{"operation-attribute-group", DTAG_OPERATION_ATTRIBUTES, 0, 0},
{"job-attribute-group", DTAG_JOB_ATTRIBUTES, 0, 0},
{"printer-attribute-group", DTAG_PRINTER_ATTRIBUTES, 0, 0},
{"unsupported-attribute-group", DTAG_UNSUPPORTED_ATTRIBUTES, 0, 0},
{"subscription-attribute-group", DTAG_SUBSCRIPTION_ATTRIBUTES, 0, 0},
{"even-notificaton-attribute-group",
{"date-at-completed", VTAG_DATE_TIME, 0, 0},
{"date-at-creation", VTAG_DATE_TIME, 0, 0},
{"date-at-processing", VTAG_DATE_TIME, 0, 0},
{"printer-resolution", VTAG_RESOLUTION, 0, 0},
{"printer-resolution-default", VTAG_RESOLUTION, 0, 0},
{"printer-resolution-supported", VTAG_RESOLUTION, 0, 0},
{NULL, 0, 0, 0}
};
static attr_info_list_t *
{
int i;
return (&attr_list[i]);
}
return (NULL);
}
{
attr_info_list_t *t;
int result;
switch (type) {
case VTAG_INTEGER:
case VTAG_RANGE_OF_INTEGER:
case VTAG_ENUM:
break;
case VTAG_URI:
case VTAG_OCTET_STRING:
result = 1023;
break;
case VTAG_NATURAL_LANGUAGE:
case VTAG_URI_SCHEME:
case VTAG_CHARSET:
result = 63;
break;
case VTAG_MIME_MEDIA_TYPE:
case VTAG_KEYWORD:
result = 255;
break;
default:
}
#define min(a, b) ((a < b) ? a : b)
return (result);
}
{
attr_info_list_t *t;
int result;
switch (type) {
case VTAG_INTEGER:
case VTAG_RANGE_OF_INTEGER:
break;
case VTAG_ENUM:
result = 1;
break;
case VTAG_URI:
case VTAG_OCTET_STRING:
case VTAG_MIME_MEDIA_TYPE:
case VTAG_URI_SCHEME:
case VTAG_CHARSET:
case VTAG_NATURAL_LANGUAGE:
result = 0;
break;
case VTAG_KEYWORD:
result = 1;
break;
default:
}
#define max(a, b) ((a > b) ? a : b)
return (result);
}
int
is_keyword(char *k)
{
/* [a-z][a-z0-9._-]* */
if (*k < 'a' && *k > 'z')
return (0);
while (*(++k) != '\0')
if (*k < 'a' && *k > 'z' && *k < '0' && *k > '9' &&
*k != '.' && *k != '_' && *k != '-')
return (0);
return (1);
}
{
int i;
return (0);
}