2002-12-21 19:07:30 +00:00
|
|
|
// partition.h
|
|
|
|
|
|
|
|
#ifndef _PARTSCAN_PARTITION_H
|
|
|
|
#define _PARTSCAN_PARTITION_H
|
|
|
|
|
|
|
|
#include <module.h>
|
|
|
|
|
|
|
|
struct extended_partition_info;
|
|
|
|
|
2002-12-25 15:13:25 +00:00
|
|
|
typedef bool (*partition_identify_hook)(int deviceFD,
|
|
|
|
const struct session_info *session, const uchar *block);
|
2002-12-21 19:07:30 +00:00
|
|
|
typedef status_t (*partition_get_nth_info_hook)(int deviceFD,
|
2002-12-25 15:13:25 +00:00
|
|
|
const struct session_info *session, const uchar *block, int32 index,
|
2002-12-21 19:07:30 +00:00
|
|
|
struct extended_partition_info *partitionInfo);
|
|
|
|
|
|
|
|
typedef struct partition_module_info {
|
|
|
|
module_info module;
|
|
|
|
|
|
|
|
partition_identify_hook identify;
|
|
|
|
partition_get_nth_info_hook get_nth_info;
|
|
|
|
} partition_module_info;
|
|
|
|
|
|
|
|
/*
|
|
|
|
identify():
|
|
|
|
----------
|
|
|
|
|
|
|
|
Checks whether the partition map of the given session can be recognized
|
|
|
|
by the module. Returns true, if it can, false otherwise.
|
|
|
|
|
|
|
|
params:
|
|
|
|
deviceFD: a device FD
|
2002-12-25 15:13:25 +00:00
|
|
|
sessionInfo: a complete info about the session the partition resides on
|
2002-12-21 19:07:30 +00:00
|
|
|
block: the first block of the session
|
|
|
|
|
|
|
|
|
|
|
|
get_nth_info():
|
|
|
|
--------------
|
|
|
|
|
|
|
|
Fills in the following fields of partitionInfo with information about
|
|
|
|
the indexth partition on the specified session:
|
|
|
|
* offset
|
|
|
|
* size
|
|
|
|
* flags
|
|
|
|
* partition_name
|
|
|
|
* partition_type
|
|
|
|
* partition_code
|
|
|
|
|
|
|
|
params:
|
|
|
|
deviceFD: a device FD
|
2002-12-25 15:13:25 +00:00
|
|
|
sessionInfo: a complete info about the session the partition resides on
|
2002-12-21 19:07:30 +00:00
|
|
|
block: the first block of the session
|
|
|
|
index: the partition index
|
|
|
|
partitionInfo: the partition info
|
|
|
|
|
|
|
|
The functions is only called, when a call to identify() returned
|
|
|
|
true.
|
|
|
|
|
|
|
|
Returns B_OK, if successful, B_ENTRY_NOT_FOUND, if the index is out of
|
|
|
|
range.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#endif _PARTSCAN_PARTITION_H
|