/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 1994, by Sun Microsytems, Inc.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "libtnf.h"
/*
*
*/
static struct ntop {
char *name;
} ntop[] = {
{ TNF_N_INLINE, TAG_PROP_INLINE },
{ TNF_N_TAGGED, TAG_PROP_TAGGED },
{ TNF_N_SCALAR, TAG_PROP_SCALAR },
{ TNF_N_ARRAY, TAG_PROP_ARRAY },
{ TNF_N_STRING, TAG_PROP_STRING },
{ TNF_N_STRUCT, TAG_PROP_STRUCT },
{ TNF_N_TYPE, TAG_PROP_TYPE },
{ NULL, 0}
};
static struct ntok {
char *name;
} scalar_ntok[] = {
{ TNF_N_CHAR, TNF_K_CHAR },
{ TNF_N_INT8, TNF_K_INT8 },
{ TNF_N_INT16, TNF_K_INT16 },
{ TNF_N_INT32, TNF_K_INT32 },
{ TNF_N_UINT8, TNF_K_UINT8 },
{ TNF_N_UINT16, TNF_K_UINT16 },
{ TNF_N_UINT32, TNF_K_UINT32 },
{ TNF_N_INT64, TNF_K_INT64 },
{ TNF_N_UINT64, TNF_K_UINT64 },
{ TNF_N_FLOAT32, TNF_K_FLOAT32 },
{ TNF_N_FLOAT64, TNF_K_FLOAT64 },
{ NULL, 0 }
};
/*
* Compute tag props
*/
{
struct ntop *p;
props = 0;
p = ntop;
/* No need to get base tag for inherited properties */
while (p->name) {
p++;
}
return (props);
}
/*
* Data kind depends on implementation properties of base tag
*/
{
char *base_name;
struct ntok *p;
p = scalar_ntok;
while (p->name) {
return (p->kind);
p++;
}
return (TNF_K_SCALAR);
return (TNF_K_STRING);
else
return (TNF_K_ARRAY);
return (TNF_K_TYPE);
return (TNF_K_STRUCT);
} else { /* abstract */
return (TNF_K_UNKNOWN);
}
}