1 /* $Cambridge: exim/src/exim_monitor/em_xs.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */
3 /*************************************************
5 *************************************************/
7 /* Copyright (c) University of Cambridge, 1995 - 2005 */
8 /* See the file NOTICE for conditions of use and distribution. */
10 /* This file contains a number of subroutines that are in effect
11 just alternative packaging for calls to various X functions that
12 happen to be convenient for this program. */
18 /*************************************************
20 *************************************************/
22 /* Unpick a variable-length argument list and set up an
23 appropriate call to XtSetValues. To make it reasonably
24 efficient, we keep a working Arg structure of length 15;
25 the largest call in eximon sets 11 values. The code uses
26 malloc/free if more, just in case there is ever a longer
27 one that gets overlooked. */
29 static Arg xs_temparg
[15];
31 void xs_SetValues(Widget w
, Cardinal num_args
, ...)
35 Arg
*aa
= (num_args
> 15)? (Arg
*)malloc(num_args
*sizeof(Arg
)) : xs_temparg
;
36 va_start(ap
, num_args
);
37 for (i
= 0; i
< num_args
; i
++)
39 aa
[i
].name
= va_arg(ap
, String
);
40 aa
[i
].value
= va_arg(ap
, XtArgVal
);
42 XtSetValues(w
, aa
, num_args
);
43 if (num_args
> 15) free(aa
);