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 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 /*
27  * Copyright 2020 Joyent, Inc.
28  */
29 
30 #ifndef	_TOPO_BUILTIN_H
31 #define	_TOPO_BUILTIN_H
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 #include <topo_tree.h>
38 #include <topo_module.h>
39 #include <topo_digraph.h>
40 
41 #define	TOPO_BLTIN_TYPE_TREE		1
42 #define	TOPO_BLTIN_TYPE_DIGRAPH		2
43 /*
44  * topo_builtin.h
45  *
46  * This header file provides prototypes for any built-in scheme enumerators
47  * that are compiled directly into topo.  Prototypes for their init and
48  * fini routines can be added here and corresponding linkage information to
49  * these functions should be added to the table found in topo_builtin.c.
50  */
51 
52 typedef struct topo_builtin {
53 	const char *bltin_name;
54 	topo_version_t bltin_version;
55 	int (*bltin_init)(topo_mod_t *, topo_version_t version);
56 	void (*bltin_fini)(topo_mod_t *);
57 	uint_t bltin_type;
58 } topo_builtin_t;
59 
60 extern int topo_builtin_create(topo_hdl_t *, const char *);
61 
62 #ifdef	__cplusplus
63 }
64 #endif
65 
66 #endif	/* _TOPO_BUILTIN_H */
67