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