2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
7 #include <exec/memory.h>
8 #include <proto/exec.h>
10 #include "partition_intern.h"
11 #include "partition_support.h"
14 /*****************************************************************************
17 #include <libraries/partition.h>
19 AROS_LH1(LONG
, OpenPartitionTable
,
22 AROS_LHA(struct PartitionHandle
*, root
, A1
),
25 struct Library
*, PartitionBase
, 7, Partition
)
28 Open a partition table. On success root->list will be filled with a
29 list of PartitionHandles. If one partition contains more
30 subpartitions, the caller should call OpenPartitionTable() on the
31 PartitionHandle recursively.
37 0 for success; an error code otherwise.
50 21-02-02 first version
52 *****************************************************************************/
56 const struct PTFunctionTable
* const *pst
;
58 pst
= PartitionSupport
;
61 if (pst
[0]->checkPartitionTable(PartitionBase
, root
))
63 root
->table
= AllocMem(sizeof(struct PartitionTableHandler
), MEMF_PUBLIC
| MEMF_CLEAR
);
69 NEWLIST(&root
->table
->list
);
71 root
->table
->type
= pst
[0]->type
;
72 root
->table
->handler
= (void *)pst
[0];
74 retval
= pst
[0]->openPartitionTable(PartitionBase
, root
);
77 FreeMem(root
->table
, sizeof(struct PartitionTableHandler
));