lib: nuke 0@0
[unleashed.git] / include / devid.h
blobb8129d1da0ba2af9f4d4c867a42003ee81993573
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _DEVID_H
28 #define _DEVID_H
30 #ifndef _KERNEL
31 #include <sys/types.h>
32 #endif /* _KERNEL */
34 #include <sys/sunddi.h>
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
40 typedef struct devid_nmlist {
41 char *devname;
42 dev_t dev;
43 } devid_nmlist_t;
45 extern int devid_get(int fd, ddi_devid_t *retdevid);
46 extern void devid_free(ddi_devid_t devid);
47 extern int devid_get_minor_name(int fd, char **retminor_name);
48 extern size_t devid_sizeof(ddi_devid_t devid);
49 extern int devid_compare(ddi_devid_t devid1, ddi_devid_t devid2);
50 extern int devid_deviceid_to_nmlist(char *search_path, ddi_devid_t devid,
51 char *minor_name, devid_nmlist_t **retlist);
52 extern void devid_free_nmlist(devid_nmlist_t *list);
53 extern int devid_valid(ddi_devid_t devid);
54 extern char *devid_str_encode(ddi_devid_t devid, char *minor_name);
55 extern int devid_str_decode(char *devidstr,
56 ddi_devid_t *retdevid, char **retminor_name);
57 extern void devid_str_free(char *devidstr);
59 #ifdef __cplusplus
61 #endif
63 #endif /* _DEVID_H */