2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 #include <exec/memory.h>
7 #include <proto/exec.h>
8 #include "partition_support.h"
11 /*****************************************************************************
14 #include <libraries/partition.h>
16 AROS_LH2(LONG
, CreatePartitionTable
,
19 AROS_LHA(struct PartitionHandle
*, root
, A1
),
20 AROS_LHA(ULONG
, type
, D1
),
23 struct Library
*, PartitionBase
, 10, Partition
)
26 Create a new partition table.
29 root - partition to create table in
30 type - the type of the partition table to create
33 0 on success; an error code otherwise
36 After calling this function the state of the PartitionHandle will be the
37 same as when calling OpenPartitionTable(). Therefore before closing the
38 PartitionHandle you should call ClosePartitionTable().
48 21-02-02 first version
50 *****************************************************************************/
55 if (root
->table
== NULL
)
57 const struct PTFunctionTable
* const *pst
;
59 pst
= PartitionSupport
;
62 if (pst
[0]->type
== type
)
64 if (pst
[0]->createPartitionTable
)
66 root
->table
= AllocMem
68 sizeof(struct PartitionTableHandler
),
69 MEMF_PUBLIC
| MEMF_CLEAR
73 root
->table
->type
= type
;
74 root
->table
->handler
= (APTR
)*pst
;
75 retval
= pst
[0]->createPartitionTable(PartitionBase
, root
);
78 FreeMem(root
->table
, sizeof(struct PartitionTableHandler
));