Reverted #44466 because it looks ugly.
[AROS.git] / rom / partition / getpartitiontableattrs.c
blob4baf96025d155db992f9020827eca5e1d6312a55
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
5 */
7 #include <proto/utility.h>
9 #include "partition_support.h"
10 #include "platform.h"
11 #include "debug.h"
13 /*****************************************************************************
15 NAME */
16 #include <utility/tagitem.h>
17 #include <libraries/partition.h>
19 AROS_LH2(LONG, GetPartitionTableAttrs,
21 /* SYNOPSIS */
22 AROS_LHA(struct PartitionHandle *, root, A1),
23 AROS_LHA(const struct TagItem *, taglist, A2),
25 /* LOCATION */
26 struct Library *, PartitionBase, 13, Partition)
28 /* FUNCTION
29 get attributes of a partition table
31 INPUTS
32 ph - PartitionHandle of the partition table
33 taglist - list of attributes; unknown tags are ignored
34 PTT_TYPE - ULONG * ; get partition table type
35 PTT_MAXLEADIN - LONG *
36 PTT_RESERVED - ULONG * ; get number of reserved blocks
38 RESULT
40 NOTES
42 EXAMPLE
44 BUGS
46 SEE ALSO
48 INTERNALS
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
54 if (root->table)
56 struct PTFunctionTable *handler = root->table->handler;
57 struct TagItem *tag;
59 while ((tag = NextTagItem((struct TagItem **)&taglist)))
61 LONG sup;
63 if (handler->getPartitionTableAttr)
64 sup = handler->getPartitionTableAttr(PartitionBase, root, tag);
65 else
66 sup = 0;
68 if (!sup)
70 switch (tag->ti_Tag)
72 case PTT_TYPE:
73 *((LONG *)tag->ti_Data) = root->table->type;
74 break;
76 case PTT_MAXLEADIN:
77 case PTT_RESERVED:
78 case PTT_MAX_PARTITIONS:
79 *((LONG *)tag->ti_Data) = 0;
80 break;
85 return 1;
88 /* There's no partition table here */
89 return 0;
91 AROS_LIBFUNC_EXIT