Welcome, Guest. Please login or register.

Author Topic: Repetition of Tags in a TagItem array and AmigaOS functions...  (Read 1775 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Repetition of Tags in a TagItem array and AmigaOS functions...
« on: January 18, 2006, 04:02:02 PM »
Hi. I'm not at home so can't read anything to confirm but I'd like to clarify this doubt anway.
I want to be able to pass multiple indetical Tags (in ti_Tag), among other different ones, to be able to pass multiple items of a certain type (the type being identified by ti_Tag). GetTagData() will get me the first TagItem in the array that has the ti_Tag I requested but how do I call the next ones ? If call GetTagData() again with the TagItem returned by the 1st call to it, I suspect it will return the same TagItem so the solution seems to be calling NexTagItem after that and then use the returned value to call GetTagData() again. Now NextTagItem() uses a double indirect pointer.

All this makes the process cumbersome and, to me the most important, inefficient, is there another way ?

\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: Repetition of Tags in a TagItem array and AmigaOS functions...
« Reply #1 on: January 18, 2006, 04:11:59 PM »
Hmm, I guess I'll make another array with those repeated items and pass a pointer to it in a TagItem...
Still the former method was more flexible to other people writting code for it (this is a function the makes part of a very small API for other people to be able to extend my own program's actions)...

Cheers
José
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: Repetition of Tags in a TagItem array and AmigaOS functions...
« Reply #2 on: January 21, 2006, 01:04:41 PM »
@Piru

Thanks. That's more or less similar to the example they have on the NextTagItem autodoc IIRC.
In my case it's a bit more complicated because inside the function I want to make up an array from all the Tags of a certain type, so I have to first count how many there are before allocating the array (wich I could do easily by raising a counter everytime the case statement correponding to that Tag type is executed). But after allocating the array I have to copy the items to it and hence my question about going from one Tag type to the next one of the same type. That's why I'm almost decided to pass pointers to arrays in ti_Data instead of condensing all information in a TagArray.

BTW I'm using TAG_USER + 1, 2, ... as the start of my Tags, why the "+ 0xbad000" ?

Cheers
\\"We made Amiga, they {bleep}ed it up\\"