Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!ogicse!mintaka!gnu!dzenc From: dzenc@gnu.ai.mit.edu (Dan Zenchelsky) Newsgroups: comp.sys.amiga.tech Subject: Re: Tags - How do they work. Message-ID: <1990Nov5.190110.5100@mintaka.lcs.mit.edu> Date: 5 Nov 90 19:01:10 GMT References: <53246.657345554@atronx.UUCP> <15486@cbmvax.commodore.com> Sender: daemon@mintaka.lcs.mit.edu (Lucifer Maleficius) Organization: MIT Laboratory for Computer Science Lines: 58 In article dillon@overload.Berkeley.CA.US (Matthew Dillon) writes: > > 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: > > #include > #include > > long > SystemTags(cmd, ...) > char *cmd; > { > va_list va; > long error; > > va_start(va, cmd); > error = System(cmd, va); > va_end(va); > return(error); > } > > > -Matt > Although I haven't yet tried it, this routine should work for any Tag based system call: #include #include long CallTags(long (*cmd)(), ...) { va_list va; long error; va_start(va, cmd); error = cmd(va); va_end(va); return(error); } For example: CallTags(System,argv[1],SYS_Input,infile,SYS_Output,outfile, SYS_Asynch,FALSE,TAG_DONE); -Dan -- ___________________________________________________________________________ | _______ |________________________________________| | || |o| Dan Zenchelsky | | | ||____| | | Any sufficiently advanced bug is | | | ___ | dzenc@gnu.ai.mit.edu | indistinguishable from a feature. | | |_|___|_| |______________-- Rich Kulawiec__________| |__________________________________|________________________________________|