Got rid of the module_identify() hook. Instead the module info features a short_name field now.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2554 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2003-01-26 15:06:23 +00:00
parent cd6210cc8d
commit 0b1ab795f4
2 changed files with 14 additions and 22 deletions

View File

@ -29,15 +29,22 @@ typedef status_t (*partition_partition_hook)(int deviceFD,
typedef struct partition_module_info {
module_info module;
const char *short_name;
partition_identify_hook identify;
partition_get_nth_info_hook get_nth_info;
partition_identify_module_hook identify_module;
partition_get_partitioning_params_hook get_partitioning_params;
partition_partition_hook partition;
} partition_module_info;
/*
short_name:
----------
Identifies the module. That's the identifier to be passed to
partition_session().
identify():
----------
@ -76,18 +83,6 @@ typedef struct partition_module_info {
range.
identify_module():
-----------------
Returns whether the module knows the supplied identifier. The module to
be used to partition a session is identified by this identifier.
params:
identifier: the identifier
Returns true, if the module knows the identifier, false otherwise.
get_partitioning_params():
-------------------------

View File

@ -21,6 +21,10 @@
#define INTEL_PARTITION_MODULE_NAME "disk_scanner/partition/intel/v1"
// partition module identifier
//static const char *const kShortModuleName = "intel";
#define kShortModuleName "intel"
// the maximal number of partitions we support (size of some static arrays)
static const int32 MAX_PARTITION_COUNT = 64;
@ -427,14 +431,6 @@ intel_get_nth_info(int deviceFD, const session_info *sessionInfo,
return error;
}
// intel_identify_module
static
bool
intel_identify_module(const char *identifier)
{
return (identifier && !strcmp(identifier, "intel"));
}
// intel_get_partitioning_params
static
status_t
@ -466,9 +462,10 @@ static partition_module_info intel_partition_module =
0, // better B_KEEP_LOADED?
std_ops
},
kShortModuleName,
intel_identify,
intel_get_nth_info,
intel_identify_module,
intel_get_partitioning_params,
intel_partition,
};