Instead of "eax" and "edx" in asm constraints use "a" and "d"
[tangerine.git] / rom / intuition / nextobject.c
bloba802b464c72bf1e55dc9c589fae61533e0575f5b
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$
6 Iterate through a list of objects.
7 */
9 #include <exec/types.h>
10 #include <exec/nodes.h>
11 #include "intuition_intern.h"
13 /*****************************************************************************
15 NAME */
16 #include <intuition/classes.h>
17 #include <proto/intuition.h>
19 AROS_LH1(APTR, NextObject,
21 /* SYNOPSIS */
22 AROS_LHA(APTR, objectPtrPtr, A0),
24 /* LOCATION */
25 struct IntuitionBase *, IntuitionBase, 111, Intuition)
27 /* FUNCTION
28 Use this function to iterate through a list of BOOPSI objects.
29 You may do whatever you want with the object returned, even
30 remove it from the list or disposing it and then continue to
31 iterate thought the list.
33 INPUTS
34 objectPtrPtr - the pointer to a variable. This must be the same
35 variable, as long as you iterate though the same list. This
36 variable must initially be filled with the lh_Head of a list.
38 RESULT
39 A BOOPSI object, which can be manipulated.
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
48 NewObject(),
49 "Basic Object-Oriented Programming System for Intuition" and
50 "boopsi Class Reference" Dokument.
52 INTERNALS
54 HISTORY
56 *****************************************************************************/
58 AROS_LIBFUNC_INIT
59 AROS_LIBBASE_EXT_DECL(struct IntuitionBase *,IntuitionBase)
61 struct _Object *nextobject;
62 APTR oldobject;
64 DEBUG_NEXTOBJECT(dprintf("NextObject: optr 0x%lx\n",
65 objectPtrPtr));
67 IntuitionBase = IntuitionBase; /* shut up the compiler */
69 SANITY_CHECKR(objectPtrPtr,FALSE)
71 nextobject = (struct _Object *)(*((struct _Object **)objectPtrPtr))->o_Node.mln_Succ;
72 if (nextobject)
74 oldobject = (Object *)BASEOBJECT(*((struct _Object **)objectPtrPtr));
75 *((struct _Object **)objectPtrPtr) = nextobject;
77 else
79 oldobject = NULL;
82 return oldobject;
84 AROS_LIBFUNC_EXIT
85 } /* NextObject() */