grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / intuition / freeremember.c
blobe6e029c0a1cd2257374e456bd588e03fe65584be
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
5 */
7 #include "intuition_intern.h"
8 #include <exec/memory.h>
9 #include <proto/exec.h>
11 /*****************************************************************************
13 NAME */
14 #include <intuition/intuition.h>
15 #include <proto/intuition.h>
17 AROS_LH2(void, FreeRemember,
19 /* SYNOPSIS */
20 AROS_LHA(struct Remember **, rememberKey, A0),
21 AROS_LHA(LONG , reallyForget, D0),
23 /* LOCATION */
24 struct IntuitionBase *, IntuitionBase, 68, Intuition)
26 /* FUNCTION
27 Free memory allocated by AllocRemember().
29 INPUTS
30 rememberKey - address of a pointer to struct Remember
31 reallyForget - TRUE release all memory
32 FALSE release only link nodes
34 RESULT
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 AllocRemember()
45 INTERNALS
47 *****************************************************************************/
49 AROS_LIBFUNC_INIT
51 struct Remember *next, *key;
53 DEBUG_REMEMBER(dprintf("FreeRemember: Key 0x%lx ReallyForget %d\n",
54 rememberKey, reallyForget));
56 for (next = *rememberKey; (key = next); )
58 next = key->NextRemember;
60 if (reallyForget)
61 FreeMem (key->Memory, key->RememberSize);
63 FreeMem (key, sizeof (struct Remember));
66 *rememberKey = NULL;
68 AROS_LIBFUNC_EXIT
69 } /* FreeRemember */