added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / libs / partition / getpartitionattrs.c
blob5f7f81b3aa7fb181e8a1299d4a59b99776c1364b
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 */
6 #include "partition_support.h"
7 #include "platform.h"
9 #ifndef DEBUG
10 #define DEBUG 1
11 #endif
12 #include "debug.h"
14 /*****************************************************************************
16 NAME */
17 #include <utility/tagitem.h>
18 #include <libraries/partition.h>
20 AROS_LH2(LONG, GetPartitionAttrs,
22 /* SYNOPSIS */
23 AROS_LHA(struct PartitionHandle *, ph, A1),
24 AROS_LHA(struct TagItem *, taglist, A2),
26 /* LOCATION */
27 struct Library *, PartitionBase, 15, Partition)
29 /* FUNCTION
30 get attributes of a partition
32 INPUTS
33 ph - PartitionHandle
34 taglist - list of attributes; unknown tags are ignored
35 PT_DOSENVEC - struct DosEnvec *; get DosEnvec values
36 PT_TYPE - struct PartitionType * ; get partition type (MBR-PC)
37 PT_POSITION - ULONG * ; position of partition (MBR-PC)
38 PT_ACTIVE - LONG * ; is partition active
39 PT_NAME - STRPTR ; get name of partition (max 31 Bytes + NULL-byte)
41 RESULT
43 NOTES
45 EXAMPLE
47 BUGS
49 SEE ALSO
51 INTERNALS
53 HISTORY
54 21-02-02 first version
56 *****************************************************************************/
58 AROS_LIBFUNC_INIT
60 if (ph->root)
62 struct PTFunctionTable *handler = ph->root->table->handler;
64 if (handler->getPartitionAttrs)
65 return handler->getPartitionAttrs(PartitionBase, ph, taglist);
67 else
69 /* we are the root partition */
70 while (taglist[0].ti_Tag != TAG_DONE)
72 switch (taglist[0].ti_Tag)
74 case PT_GEOMETRY:
76 struct DriveGeometry *dg = (struct DriveGeometry *)taglist[0].ti_Data;
77 CopyMem(&ph->dg, dg, sizeof(struct DriveGeometry));
79 break;
80 case PT_DOSENVEC:
81 CopyMem(&ph->de, (struct DosEnvec *)taglist[0].ti_Data, sizeof(struct DosEnvec));
82 break;
84 taglist++;
87 return 0;
88 AROS_LIBFUNC_EXIT