Tidy up "make" output along the lines of a 2.6 kernel make (just a short
[exim.git] / src / exim_monitor / em_xs.c
CommitLineData
c988f1f4 1/* $Cambridge: exim/src/exim_monitor/em_xs.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */
059ec3d9
PH
2
3/*************************************************
4* Exim Monitor *
5*************************************************/
6
c988f1f4 7/* Copyright (c) University of Cambridge, 1995 - 2005 */
059ec3d9
PH
8/* See the file NOTICE for conditions of use and distribution. */
9
10/* This file contains a number of subroutines that are in effect
11just alternative packaging for calls to various X functions that
12happen to be convenient for this program. */
13
14#include "em_hdr.h"
15
16
17
18/*************************************************
19* xs_SetValues *
20*************************************************/
21
22/* Unpick a variable-length argument list and set up an
23appropriate call to XtSetValues. To make it reasonably
24efficient, we keep a working Arg structure of length 15;
25the largest call in eximon sets 11 values. The code uses
26malloc/free if more, just in case there is ever a longer
27one that gets overlooked. */
28
29static Arg xs_temparg[15];
30
31void xs_SetValues(Widget w, Cardinal num_args, ...)
32{
33int i;
34va_list ap;
35Arg *aa = (num_args > 15)? (Arg *)malloc(num_args*sizeof(Arg)) : xs_temparg;
36va_start(ap, num_args);
37for (i = 0; i < num_args; i++)
38 {
39 aa[i].name = va_arg(ap, String);
40 aa[i].value = va_arg(ap, XtArgVal);
41 }
42XtSetValues(w, aa, num_args);
43if (num_args > 15) free(aa);
44}
45
46/* End of em_xs.c */