Welcome, Guest. Please login or register.

Author Topic: Taglist question  (Read 1767 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline xeronTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 2533
    • Show all replies
    • http://www.petergordon.org.uk
Taglist question
« on: July 06, 2003, 04:01:36 PM »
I'm writing some software using GCC 2.95.3. At the moment its all contained in one executable, but later on I'm going to put a lot of the routines in a shared library.

Because of this, a lot of my routines expect taglists. At the moment i'm calling them like this:


struct TagItem mytags[2];

mytags[0].ti_Tag  = TAG_SOMETHING_OR_OTHER;
mytags[0].ti_Data = 1234;
mytags[1].ti_Tag  =TAG_DONE
mytags[1].ti_Data = 0;

myDoSomethingA( mytags )


Which is quite untidy, and annoying. Is it possible to call the function and specify the tags like you do normally? If so, how?
Playstation Network ID: xeron6
 

Offline xeronTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 2533
    • Show all replies
    • http://www.petergordon.org.uk
Re: Taglist question
« Reply #1 on: July 06, 2003, 05:19:30 PM »
RobinC on IRC gave me the answer! All I needed was:


ULONG myDoSomething( ULONG Tag, ... )
{
  return myDoSomethingA( (struct TagItem *)&Tag );
}

Playstation Network ID: xeron6
 

Offline xeronTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 2533
    • Show all replies
    • http://www.petergordon.org.uk
Re: Taglist question
« Reply #2 on: July 06, 2003, 05:54:52 PM »
@Dietmar:

Bear in mind that this is only a stub for my personal testing. Once the routines have been externalised into a library, proper headers will be created.
Playstation Network ID: xeron6