2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
6 #include <exec/memory.h>
7 #include <proto/exec.h>
9 #include "partition_intern.h"
10 #include "partition_support.h"
13 /*****************************************************************************
16 #include <libraries/partition.h>
18 AROS_LH1(LONG
, OpenPartitionTable
,
21 AROS_LHA(struct PartitionHandle
*, root
, A1
),
24 struct Library
*, PartitionBase
, 7, Partition
)
27 Open a partition table. On success root->list will be filled with a
28 list of PartitionHandles. If one partition contains more
29 subpartitions, the caller should call OpenPartitionTable() on the
30 PartitionHandle recursively.
36 0 for success; an error code otherwise.
48 *****************************************************************************/
52 const struct PTFunctionTable
* const *pst
;
54 pst
= PartitionSupport
;
57 if (pst
[0]->checkPartitionTable(PartitionBase
, root
))
59 root
->table
= AllocMem(sizeof(struct PartitionTableHandler
), MEMF_PUBLIC
| MEMF_CLEAR
);
65 NEWLIST(&root
->table
->list
);
67 root
->table
->type
= pst
[0]->type
;
68 root
->table
->handler
= (void *)pst
[0];
70 retval
= pst
[0]->openPartitionTable(PartitionBase
, root
);
73 FreeMem(root
->table
, sizeof(struct PartitionTableHandler
));