kmodloader: properly handle modules with both underscores and dashes in their name
[project/ubox.git] / libblkid-tiny / libblkid-tiny.h
1 /*
2  * Copyright (C) 2013 Felix Fietkau <nbd@openwrt.org>
3  * Copyright (C) 2013 John Crispin <blogic@openwrt.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License version 2.1
7  * as published by the Free Software Foundation
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  */
14
15 #include <libubox/list.h>
16
17 struct blkid_idmag;
18 struct blkid_idmag;
19 struct blkid_idinfo;
20
21 struct blkid_idmag
22 {
23         const char      *magic;
24         unsigned int    len;
25
26         long            kboff;
27         unsigned int    sboff;
28 };
29
30
31 struct blkid_idinfo;
32
33 struct blkid_struct_probe
34 {
35         const struct blkid_idinfo       *id;
36         struct list_head                list;
37
38         int     fd;
39         int     err;
40         char    dev[32];
41         char    uuid[64];
42         char    label[64];
43         char    name[64];
44         char    version[64];
45 };
46
47 struct blkid_idinfo
48 {
49         const char      *name;
50         int             usage;
51         int             flags;
52         int             minsz;
53         int (*probefunc)(struct blkid_struct_probe *pr, const struct blkid_idmag *mag);
54         struct blkid_idmag      magics[];
55 };
56
57 extern int probe_block(char *block, struct blkid_struct_probe *pr);
58 extern int mkblkdev(void);