New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / rom / intuition / allocremember.c
blob6b47fd27dc849ef23fffe57469bea6ab9a0e9c5c
1 /*
2 Copyright © 1995-2003, 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_LH3(APTR, AllocRemember,
19 /* SYNOPSIS */
20 AROS_LHA(struct Remember **, rememberKey, A0),
21 AROS_LHA(ULONG , size, D0),
22 AROS_LHA(ULONG , flags, D1),
24 /* LOCATION */
25 struct IntuitionBase *, IntuitionBase, 66, Intuition)
27 /* FUNCTION
28 Allocate some memory and remeber it in the Remember-List.
30 INPUTS
31 rememberKey - Store information in this list
32 size - How many bytes to allocate
33 flags - Attributes (see AllocMem())
35 RESULT
36 Pointer to the allocated memory or NULL.
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
46 INTERNALS
48 HISTORY
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
53 AROS_LIBBASE_EXT_DECL(struct IntuitionBase *,IntuitionBase)
55 struct Remember *newKey;
56 APTR ptr = NULL;
58 DEBUG_REMEMBER(dprintf("AllocRemember: Key 0x%lx Size 0x%lx Flags 0x%08lx\n",
59 rememberKey, size, flags));
61 newKey = AllocMem (sizeof (struct Remember), MEMF_ANY);
63 if (newKey)
65 ptr = AllocMem (size, flags);
67 if (ptr)
69 newKey->NextRemember = *rememberKey;
70 newKey->Memory = ptr;
71 newKey->RememberSize = size;
73 *rememberKey = newKey;
75 else
77 FreeMem (newKey, sizeof (struct Remember));
81 DEBUG_REMEMBER(dprintf("AllocRemember: Ptr 0x%lx\n", ptr));
83 return ptr;
85 AROS_LIBFUNC_EXIT
86 } /* AllocRemember */