Don't get OOPBase in this ugly way.
[tangerine.git] / rom / intuition / freeintuimessage.c
blobd7e80747dfde699e731224e467ee7a56e2e8b0a4
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 <proto/utility.h>
8 #include "intuition_intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <proto/intuition.h>
15 AROS_LH1(void, FreeIntuiMessage,
17 /* SYNOPSIS */
18 AROS_LHA(struct IntuiMessage *, imsg, A0),
20 /* LOCATION */
21 struct IntuitionBase *, IntuitionBase, 149, Intuition)
23 /* FUNCTION
24 Private to AROS: free an IntuiMessage previously allocated
25 with AllocIntuiMessage.
27 INPUTS
28 imsg - The IntuiMessage. May be NULL.
30 RESULT
31 none
33 NOTES
35 EXAMPLE
37 BUGS
39 SEE ALSO
41 INTERNALS
43 HISTORY
45 *****************************************************************************/
47 AROS_LIBFUNC_INIT
48 AROS_LIBBASE_EXT_DECL(struct IntuitionBase *,IntuitionBase)
50 DEBUG_FREEINTUIMESSAGE(dprintf("FreeIntuiMessage: Msg 0x%lx\n", imsg));
52 ASSERT_VALID_PTR_OR_NULL(imsg);
54 #define EIM(x) ((struct ExtIntuiMessage *)(x))
56 if (imsg)
58 if ((imsg->Class == IDCMP_IDCMPUPDATE) && (imsg->IAddress))
60 FreeTagItems((struct TagItem *)imsg->IAddress);
63 if (EIM(imsg)->eim_TabletData)
65 if (EIM(imsg)->eim_TabletData->td_TagList) FreeTagItems(EIM(imsg)->eim_TabletData->td_TagList);
66 FreePooled(GetPrivIBase(IntuitionBase)->IDCMPPool,EIM(imsg)->eim_TabletData,sizeof (struct TabletData));
68 FreePooled(GetPrivIBase(IntuitionBase)->IDCMPPool,imsg, sizeof(struct IntIntuiMessage));
71 DEBUG_FREEINTUIMESSAGE(dprintf("FreeIntuiMessage: done\n"));
72 AROS_LIBFUNC_EXIT