revert previous incorrect version of commit and recommit correct version to allow...
[AROS.git] / rom / partition / closepartitiontable.c
blob38ed2f18c4651f64b65aeca52f7841d011fe6770
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/memory.h>
7 #include <proto/exec.h>
8 #include "partition_support.h"
9 #include "partition_intern.h"
10 #include "platform.h"
12 /*****************************************************************************
14 NAME */
15 #include <libraries/partition.h>
17 AROS_LH1(void, ClosePartitionTable,
19 /* SYNOPSIS */
20 AROS_LHA(struct PartitionHandle *, root, A1),
22 /* LOCATION */
23 struct Library *, PartitionBase, 8, Partition)
25 /* FUNCTION
26 Close a partition table (and discard all changes). All partitions
27 and subpartitions in root->list will be removed recursively.
29 INPUTS
30 root - partition table to close
32 RESULT
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
42 INTERNALS
44 *****************************************************************************/
46 AROS_LIBFUNC_INIT
48 if (root->table)
50 struct PTFunctionTable *handler = root->table->handler;
52 if (handler->closePartitionTable)
53 handler->closePartitionTable(PartitionBase, root);
54 FreeMem(root->table, sizeof(struct PartitionTableHandler));
55 root->table = 0;
58 AROS_LIBFUNC_EXIT