2 * Copyright (C) 2013 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2013 John Crispin <blogic@openwrt.org>
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
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.
14 #ifndef _LIBBLKID_TINY_H
15 #define _LIBBLKID_TINY_H
17 #include <libubox/list.h>
19 struct blkid_struct_probe;
22 * Filesystem / Raid magic strings
26 const char *magic; /* magic string */
27 unsigned int len; /* length of magic */
29 long kboff; /* kilobyte offset of superblock */
30 unsigned int sboff; /* byte offset within superblock */
34 * Filesystem / Raid description
38 const char *name; /* fs, raid or partition table name */
39 int usage; /* BLKID_USAGE_* flag */
40 int flags; /* BLKID_IDINFO_* flags */
41 int minsz; /* minimal device size */
44 int (*probefunc)(struct blkid_struct_probe *pr, const struct blkid_idmag *mag);
46 struct blkid_idmag magics[]; /* NULL or array with magic strings */
49 /* Smaller version of the struct provided in blkidP.h */
50 struct blkid_struct_probe
52 const struct blkid_idinfo *id;
53 struct list_head list;
62 struct list_head buffers; /* list of buffers */
65 struct blkid_struct_probe *blkidtiny_new_probe(void);
66 void blkidtiny_free_probe(struct blkid_struct_probe *pr);
68 extern int probe_block(char *block, struct blkid_struct_probe *pr);
69 extern int mkblkdev(void);
71 #endif /* _LIBBLKID_TINY_H */