revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / reqtools / stubs / rtezrequest.c
blobf0b5841db275a8c2785a531d62f4e40c70d01d42
1 /*
2 Copyright � 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
9 #include <stdarg.h>
10 #include <libraries/reqtools.h>
11 #include <proto/exec.h>
12 #include <exec/memory.h>
14 #define NO_INLINE_STDARG /* turn off inline def */
15 #include <proto/reqtools.h>
17 extern struct ReqToolsBase * ReqToolsBase;
19 /*****************************************************************************
21 NAME */
22 ULONG rtEZRequest (
24 /* SYNOPSIS */
25 const char *bodyfmt,
26 const char *gadfmt,
27 struct rtReqInfo *reqinfo,
28 struct TagItem *taglist,
29 ...)
31 /* FUNCTION
33 INPUTS
35 RESULT
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 HISTORY
49 *****************************************************************************/
51 va_list args;
52 ULONG rc;
54 const char *ptr;
55 int argcnt = 0;
56 IPTR *argtable = NULL;
58 for (ptr = bodyfmt; *ptr; ptr++)
60 if (*ptr == '%')
62 if (ptr[1] == '%')
64 ptr++;
65 continue;
68 argcnt++;
72 for (ptr = gadfmt; *ptr; ptr++)
74 if (*ptr == '%')
76 if (ptr[1] == '%')
78 ptr++;
79 continue;
82 argcnt++;
86 if (argcnt)
88 va_start (args, taglist);
90 int i;
92 argtable = AllocVec(sizeof(IPTR)*argcnt, MEMF_PUBLIC);
94 for (i=0; i < argcnt; i++)
95 argtable[i] = va_arg(args, IPTR);
97 va_end (args);
100 rc = rtEZRequestA(bodyfmt, gadfmt, reqinfo, argtable, taglist);
102 if (argtable)
103 FreeVec(argtable);
105 return rc;
107 } /* rtEZRequest */