xref: /titanic_50/usr/src/lib/fm/libfmevent/common/fmev_impl.h (revision d6114e2d100d9ec3b45f9968d45ac2e3a0827af0)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _FMEV_IMPL_H
28 #define	_FMEV_IMPL_H
29 
30 /*
31  * libfmevent - private implementation
32  *
33  * Note: The contents of this file are private to the implementation of
34  * libfmevent and are subject to change at any time without notice.
35  * This file is not delivered into /usr/include.
36  */
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 #include <assert.h>
43 #include <errno.h>
44 #include <libuutil.h>
45 #include <libsysevent.h>
46 #include <fm/libfmevent.h>
47 
48 #ifdef DEBUG
49 #define	ASSERT(x) (assert(x))
50 #else
51 #define	ASSERT(x)
52 #endif
53 
54 struct fmev_hdl_cmn {
55 	uint32_t hc_magic;
56 	uint32_t hc_api_vers;
57 	void *(*hc_alloc)(size_t);
58 	void *(*hc_zalloc)(size_t);
59 	void (*hc_free)(void *, size_t);
60 };
61 
62 struct fmev_hdl_cmn *fmev_shdl_cmn(fmev_shdl_t);
63 
64 extern int fmev_api_init(struct fmev_hdl_cmn *);
65 extern int fmev_api_enter(struct fmev_hdl_cmn *, uint32_t);
66 extern void fmev_api_freetsd(void);
67 extern fmev_err_t fmev_seterr(fmev_err_t);
68 extern int fmev_shdl_valid(fmev_shdl_t);
69 extern fmev_t fmev_sysev2fmev(fmev_shdl_t, sysevent_t *sep, char **,
70     nvlist_t **);
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* _FMEV_IMPL_H */
77