Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!mcsun!unido!laura!tommy!klute From: klute@tommy.informatik.uni-dortmund.de (Rainer Klute) Newsgroups: comp.sys.atari.st.tech Subject: Re: rsrc_gaddr(), etc. Keywords: rsrc_gaddr, pointers to fields Message-ID: <3235@laura.UUCP> Date: 6 May 91 14:46:38 GMT References: <1991May6.023631.1912@ux1.cso.uiuc.edu> Sender: news@laura.UUCP Organization: University of Dortmund, Germany Lines: 26 In article <1991May6.023631.1912@ux1.cso.uiuc.edu>, mts10271@uxa.cso.uiuc.edu (Michael T Stepniczka) writes: |> I have been trying to figure out how to get the address |> of an object in a tree using rsrc_gaddr() without any success. |> The problem is that I have 2 trees, and in each tree several objects. |> I can't seem to get the address of object 1 from tree 0 and object 1 |> from tree 1- I get the same address (obj. 1 from tree 0) for both |> of them. Is there some way to have the rsrc_gaddr distinguish the |> 2 objects from one another? You should use rsrc_gaddr() only to get the address of the root object of a tree, ie. rsrc_gaddr (R_TREE, TREE0, &tree0Pointer); rsrc_gaddr (R_TREE, TREE1, &tree1Pointer); To get the addresses of objects inside a tree use pointer arithmetic: objectPointer = tree1Pointer + OBJECT1 Now objectPointer references the object with index OBJECT1 inside the object tree with index TREE1. -- Dipl.-Inform. Rainer Klute klute@irb.informatik.uni-dortmund.de Univ. Dortmund, IRB klute@unido.uucp, klute@unido.bitnet Postfach 500500 |)|/ Tel.: +49 231 755-4663 D-4600 Dortmund 50 |\|\ Fax : +49 231 755-2386