🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #6360

Re: Tags - How do they work.

#6360
From: Dan Zenchelsky
Date: Mon, 05 Nov 1990 19:01
58 lines
2393 bytes
In article <dillon.6960@overload.Berkeley.CA.US> 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 <stdio.h>
>	#include <stdarg.h>
>
>	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 <stdio.h>               
#include <stdarg.h>              
                                 
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__________|
|__________________________________|________________________________________|
Technical Details
Message-ID: <1990Nov5.190110.5100@mintaka.lcs.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!ogicse!mintaka!gnu!dzenc
References: <53246.657345554@atronx.UUCP> <15486@cbmvax.commodore.com> <dillon.6960@overload.Berkeley.CA.US>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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> <dillon.6960@overload.Berkeley.CA.US>
Sender: daemon@mintaka.lcs.mit.edu (Lucifer Maleficius)
Organization: MIT Laboratory for Computer Science
Lines: 58