#define _MSDOS_H_
#include <disk/geom.h>
+#include <disk/partition.h>
-int parse_partition_table(struct driveinfo *, void *);
+typedef void (*p_callback)(struct driveinfo *, struct part_entry *, int, int);
+int parse_partition_table(struct driveinfo *, p_callback);
#endif /* _MSDOS_H_ */
#include <disk/common.h>
#include <disk/geom.h>
+#include <disk/msdos.h>
#include <disk/partition.h>
#include <disk/read.h>
**/
static int process_extended_partition(struct driveinfo *drive_info,
int partition_offset,
- void *callback(struct driveinfo *, struct part_entry *, int, int),
+ p_callback callback,
int nb_part_seen)
{
int status = 0;
* @callback: Callback to execute
**/
static int process_mbr(struct driveinfo *drive_info, struct part_entry *ptab,
- void *callback(struct driveinfo *, struct part_entry *, int, int))
+ p_callback callback)
{
int status = 0;
* parse_partition_table - execute a callback for each partition entry
* @d: driveinfo struct describing the drive
* @callback: Callback to execute
- * @error: Return the error code (I/O), if needed
*
* The signature of the callback should be the following:
*
* int offset_root,
* int nb_part_seen)
**/
-int parse_partition_table(struct driveinfo *d, void *callback)
+int parse_partition_table(struct driveinfo *d, p_callback callback)
{
char *mbr = malloc(SECTOR * sizeof(char));