Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!rutgers!cbmvax!peter From: peter@cbmvax.commodore.com (Peter Cherna) Newsgroups: comp.sys.amiga.tech Subject: Re: Tags - How do they work. Message-ID: <15599@cbmvax.commodore.com> Date: 5 Nov 90 15:32:25 GMT References: <53246.657345554@atronx.UUCP> <15486@cbmvax.commodore.com> Reply-To: peter@cbmvax.commodore.com (Peter Cherna) Organization: Commodore, West Chester, PA Lines: 38 In article dillon@overload.Berkeley.CA.US (Matthew Dillon) writes: > > It turns out that it is extremely easy to implement stack-based tags, > as someone on BIX pointed out to me. Under 2.0, the Amiga.Lib already > has routines to do this for some commands.... for example, > > OpenWindowTags() -stack based tags method, tags are > individual arguments to the routine > > OpenWindowTagList() -pointer to array of tags method, you > pass a pointer to the tags array. Stubs will eventually be added to amiga.lib for DOS and ASL varargs functions, too. > One can easily implement one's own routine to convert a stack based > tags list into an array pointer tags list using VAR ARGS. For > example, the implementation of SystemTags() would be: Here's a simpler way, that doesn't use ANSI-varargs but is perfectly valid given the Amiga stack conventions: #include LONG SystemTags( UBYTE *command, Tag firsttag, ...) { return( System( command, &firsttag ) ); } > -Matt Peter -- Peter Cherna, Software Engineer, Commodore-Amiga, Inc. {uunet|rutgers}!cbmvax!peter peter@cbmvax.cbm.commodore.com My opinions do not necessarily represent the opinions of my employer. "She read him like a book: she liked to peek at his end."