4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
34 inj_item2str(inj_itemtype_t item
)
36 static const char *const names
[] = { "event", "fmri", "auth", "list" };
39 item
< sizeof (names
) / sizeof (char *) ? names
[item
] : "???");
43 inj_item2mem(inj_itemtype_t item
)
45 static const inj_memtype_t mems
[] = {
46 MEMTYPE_EVENT
, MEMTYPE_FMRI
, MEMTYPE_AUTH
, MEMTYPE_LIST
49 assert(item
>= 0 && item
< sizeof (mems
) / sizeof (inj_memtype_t
));
54 * Convert a *subset* of inj_memtype_t's to inj_itemtype_t's.
57 inj_mem2item(inj_memtype_t mem
)
61 return (ITEMTYPE_EVENT
);
63 return (ITEMTYPE_FMRI
);
65 return (ITEMTYPE_AUTH
);
67 return (ITEMTYPE_LIST
);
74 inj_mem2str(inj_memtype_t mem
)
76 static const char *names
[] = {
78 "int8", "int16", "int32", "int64",
79 "uint8", "uint16", "uint32", "uint64",
80 "bool", "string", "enum",
81 "event", "fmri", "auth"
85 mem
< sizeof (names
) / sizeof (char *) ? names
[mem
] : "???");