Support rastport clipping rectangle for layerless rastports
[tangerine.git] / rom / boopsi / nextobject.c
blob1a7a26aa9342392361259daf2eb362aa0e221c32
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Iterate through a list of objects
6 Lang: english
7 */
8 #include <exec/types.h>
9 #include <exec/nodes.h>
10 #include "intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <intuition/classes.h>
16 #include <proto/boopsi.h>
18 AROS_LH1(APTR, NextObject,
20 /* SYNOPSIS */
21 AROS_LHA(APTR, objectPtrPtr, A0),
23 /* LOCATION */
24 struct Library *, BOOPSIBase, 12, BOOPSI)
26 /* FUNCTION
27 Use this function to iterate through a list of BOOPSI objects.
28 You may do whatever you want with the object returned, even
29 remove it from the list or disposing it and then continue to
30 iterate thought the list.
32 INPUTS
33 objectPtrPtr - the pointer to a variable. This must be the same
34 variable, as long as you iterate though the same list. This
35 variable must initially be filled with the lh_Head of a list.
37 RESULT
38 A BOOPSI object, which can be manipulated.
40 NOTES
42 EXAMPLE
44 BUGS
46 SEE ALSO
47 NewObject(),
48 "Basic Object-Oriented Programming System for Intuition" and
49 "boopsi Class Reference" Dokument.
51 INTERNALS
53 HISTORY
55 *****************************************************************************/
57 AROS_LIBFUNC_INIT
58 AROS_LIBBASE_EXT_DECL(struct Library *,BOOPSIBase)
60 APTR oldobject;
61 struct _Object *nextobject;
63 nextobject = (struct _Object *)(*((struct _Object **)objectPtrPtr))->o_Node.mln_Succ;
64 if (nextobject)
66 oldobject = (Object *)BASEOBJECT(*((struct _Object **)objectPtrPtr));
67 *((struct _Object **)objectPtrPtr) = nextobject;
69 else
71 oldobject = NULL;
74 return oldobject;
75 AROS_LIBFUNC_EXIT
76 } /* NextObject */