revert between 56095 -> 55830 in arch
[AROS.git] / rom / partition / getpartitiontableattrs.c
blob4060ccef86995856a243a51b7999e3d44da6499d
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/utility.h>
8 #include "partition_support.h"
9 #include "platform.h"
10 #include "debug.h"
12 /*****************************************************************************
14 NAME */
15 #include <utility/tagitem.h>
16 #include <libraries/partition.h>
18 AROS_LH2(LONG, GetPartitionTableAttrs,
20 /* SYNOPSIS */
21 AROS_LHA(struct PartitionHandle *, root, A1),
22 AROS_LHA(const struct TagItem *, taglist, A2),
24 /* LOCATION */
25 struct Library *, PartitionBase, 13, Partition)
27 /* FUNCTION
28 Get attributes of a partition table.
30 INPUTS
31 ph - PartitionHandle of the partition table
32 taglist - list of attributes; unknown tags are ignored
34 TAGS
35 PTT_TYPE (ULONG *)
36 Get partition table type
37 PTT_MAXLEADIN (LONG *)
38 PTT_RESERVED (ULONG *)
39 Get number of reserved blocks
41 RESULT
43 NOTES
45 EXAMPLE
47 BUGS
49 SEE ALSO
51 INTERNALS
53 *****************************************************************************/
55 AROS_LIBFUNC_INIT
57 if (root->table)
59 struct PTFunctionTable *handler = root->table->handler;
60 struct TagItem *tag;
62 while ((tag = NextTagItem((struct TagItem **)&taglist)))
64 LONG sup;
66 if (handler->getPartitionTableAttr)
67 sup = handler->getPartitionTableAttr(PartitionBase, root, tag);
68 else
69 sup = 0;
71 if (!sup)
73 switch (tag->ti_Tag)
75 case PTT_TYPE:
76 *((LONG *)tag->ti_Data) = root->table->type;
77 break;
79 case PTT_MAXLEADIN:
80 case PTT_RESERVED:
81 case PTT_MAX_PARTITIONS:
82 *((LONG *)tag->ti_Data) = 0;
83 break;
88 return 1;
91 /* There's no partition table here */
92 return 0;
94 AROS_LIBFUNC_EXIT