revert between 56095 -> 55830 in arch
[AROS.git] / rom / partition / addpartition.c
blob3e1f8a8450cf1e146b0fb2c32a783f25f7083f99
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
5 */
6 #include <utility/tagitem.h>
7 #include "partition_intern.h"
8 #include "partition_support.h"
9 #include "platform.h"
11 /*****************************************************************************
13 NAME */
14 #include <libraries/partition.h>
16 AROS_LH2(struct PartitionHandle *, AddPartition,
18 /* SYNOPSIS */
19 AROS_LHA(struct PartitionHandle *, root, A1),
20 AROS_LHA(const struct TagItem * , taglist, A2),
22 /* LOCATION */
23 struct Library *, PartitionBase, 11, Partition)
25 /* FUNCTION
26 Add a new partition.
28 INPUTS
29 root - PartitionHandle, where to add the new partition
30 taglist - tags that specify more information about the partition
31 unknown tags are ignored
32 PT_DOSENVEC - ptr to a DosEnvec
33 de_LowCyl and de_HighCyl specify start and end of cylinder
34 de_Reserved, de_Bootblocks, ...
35 de_Surfaces, de_BlocksPerTrack, ... are inherited from "root"
36 PT_TYPE - partition type (depends on PartitionTable type)
37 PT_POSITION - position number within the partition table (MBR->PC)
38 PT_ACTIVE - set this partition active (MBR->PC)
39 PT_NAME - set partition name (HD0, HD1, ...)
41 RESULT
42 PartitionHandle of the new partition; 0 for an error
44 NOTES
46 EXAMPLE
48 BUGS
50 SEE ALSO
52 INTERNALS
54 *****************************************************************************/
56 AROS_LIBFUNC_INIT
58 if (root->table)
60 struct PTFunctionTable *handler = root->table->handler;
62 if (handler->addPartition)
63 return handler->addPartition(PartitionBase, root, taglist);
65 return 0;
66 AROS_LIBFUNC_EXIT