Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / lib / fm / libdiagcode / common / diagcode.h
blob81d4931361ca734037b4469aaf7b7e0afc49ebbc
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _FM_DIAGCODE_H
28 #define _FM_DIAGCODE_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <sys/types.h>
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
39 * The following interfaces are private to Sun and should
40 * not be used by applications developed outside of Sun.
41 * They may change incompatibly or go away without notice.
44 #define FM_DC_VERSION 1 /* pass to fm_dc_opendict() */
46 typedef struct fm_dc_handle fm_dc_handle_t;
48 /* open a dictionary, return opaque handle */
49 fm_dc_handle_t *fm_dc_opendict(int version, const char *dirpath,
50 const char *dictname);
52 /* close a dictionary */
53 void fm_dc_closedict(fm_dc_handle_t *dhp);
55 /* return maximum length (in bytes) of diagcodes for a given dictionary */
56 size_t fm_dc_codelen(fm_dc_handle_t *dhp);
58 /* return number of strings in key for a given dictionary, plus 1 for null */
59 int fm_dc_maxkey(fm_dc_handle_t *dhp);
61 /* given a key, construct a diagcode */
62 int fm_dc_key2code(fm_dc_handle_t *dhp,
63 const char *key[], char *code, size_t maxcode);
65 /* given a diagcode, return the key (array of strings) */
66 int fm_dc_code2key(fm_dc_handle_t *dhp, const char *code,
67 char *key[], int maxkey);
69 /* return the right-hand side of a names property from the dict header */
70 const char *fm_dc_getprop(fm_dc_handle_t *dhp, const char *name);
72 #ifdef __cplusplus
74 #endif
76 #endif /* _FM_DIAGCODE_H */