boot.library is no more, *.handler to *-handler.
[AROS.git] / compiler / alib / easyrequest.c
blobbce187a3d3527aaa5259dc1baad20f7ed673d1a3
1 /*
2 Copyright � 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <stdarg.h>
8 /*****************************************************************************
10 NAME */
11 #define NO_INLINE_STDARG /* turn off inline def */
12 #include <proto/intuition.h>
13 #include <intuition/intuition.h>
14 #include <proto/exec.h>
15 #include <exec/memory.h>
16 LONG EasyRequest (
18 /* SYNOPSIS */
19 struct Window * window,
20 struct EasyStruct * easyStruct,
21 ULONG * idcmpPtr,
22 ...)
24 /* FUNCTION
26 INPUTS
28 RESULT
30 NOTES
32 EXAMPLE
34 BUGS
36 SEE ALSO
38 INTERNALS
40 HISTORY
41 27-11-96 digulla automatically created from
42 intuition_lib.fd and clib/intuition_protos.h
44 *****************************************************************************/
46 va_list args;
47 LONG rc;
48 const char *ptr;
49 int argcnt = 0;
50 IPTR *argtable = NULL;
52 for (ptr = easyStruct->es_TextFormat; *ptr; ptr++)
54 if (*ptr == '%')
56 if (ptr[1] == '%')
58 ptr++;
59 continue;
62 argcnt++;
66 for (ptr = easyStruct->es_GadgetFormat; *ptr; ptr++)
68 if (*ptr == '%')
70 if (ptr[1] == '%')
72 ptr++;
73 continue;
76 argcnt++;
80 if (argcnt)
82 va_start (args, idcmpPtr);
84 int i;
86 argtable = AllocVec(sizeof(IPTR)*argcnt, MEMF_PUBLIC);
88 for (i=0; i < argcnt; i++)
89 argtable[i] = va_arg(args, IPTR);
91 va_end (args);
94 rc = EasyRequestArgs (window, easyStruct, idcmpPtr, (APTR)argtable);
96 if (argtable)
97 FreeVec(argtable);
99 return rc;
100 } /* EasyRequest */