Trust uboot's device list only if it does not look suspicious.
[AROS.git] / compiler / alib / buildeasyrequest.c
blob660d592c39b2d54500547883d76e7ed7871b5805
1 /*
2 Copyright � 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Varargs version of BuildEasyRequestArgs() (intuition.library)
6 Lang: english
7 */
8 #include <stdarg.h>
10 /*****************************************************************************
12 NAME */
13 #define NO_INLINE_STDARG /* turn off inline def */
14 #include <proto/exec.h>
15 #include <proto/intuition.h>
16 #include <intuition/intuition.h>
17 #include <exec/memory.h>
19 struct Window * BuildEasyRequest (
21 /* SYNOPSIS */
22 struct Window * RefWindow,
23 struct EasyStruct * easyStruct,
24 ULONG IDCMP,
25 ...)
27 /* FUNCTION
29 INPUTS
31 RESULT
33 NOTES
35 EXAMPLE
37 BUGS
39 SEE ALSO
40 intuition.library/BuildEasyRequestArgs()
42 INTERNALS
44 HISTORY
46 *****************************************************************************/
48 va_list args;
49 struct Window * rc;
50 const char *ptr;
51 int argcnt = 0;
52 IPTR *argtable = NULL;
54 for (ptr = easyStruct->es_TextFormat; *ptr; ptr++)
56 if (*ptr == '%')
58 if (ptr[1] == '%')
60 ptr++;
61 continue;
64 argcnt++;
68 for (ptr = easyStruct->es_GadgetFormat; *ptr; ptr++)
70 if (*ptr == '%')
72 if (ptr[1] == '%')
74 ptr++;
75 continue;
78 argcnt++;
82 if (argcnt)
84 va_start (args, IDCMP);
86 int i;
88 argtable = AllocVec(sizeof(IPTR)*argcnt, MEMF_PUBLIC);
90 for (i=0; i < argcnt; i++)
91 argtable[i] = va_arg(args, IPTR);
93 va_end (args);
96 rc = BuildEasyRequestArgs (RefWindow, easyStruct, IDCMP, (APTR)argtable);
98 if (argtable)
99 FreeVec(argtable);
101 return rc;
102 } /* BuildEasyRequest */