1 /*************************************************
3 *************************************************/
5 /* Copyright (c) University of Cambridge, 1995 - 2016 */
6 /* See the file NOTICE for conditions of use and distribution. */
7 /* SPDX-License-Identifier: GPL-2.0-or-later */
9 /* This file contains a number of subroutines that are in effect
10 just alternative packaging for calls to various X functions that
11 happen to be convenient for this program. */
17 /*************************************************
19 *************************************************/
21 /* Unpick a variable-length argument list and set up an
22 appropriate call to XtSetValues. To make it reasonably
23 efficient, we keep a working Arg structure of length 15;
24 the largest call in eximon sets 11 values. The code uses
25 malloc/free if more, just in case there is ever a longer
26 one that gets overlooked. */
28 static Arg xs_temparg[15];
30 void xs_SetValues(Widget w, Cardinal num_args, ...)
34 Arg *aa = (num_args > 15)? store_malloc(num_args*sizeof(Arg)) : xs_temparg;
35 va_start(ap, num_args);
36 for (i = 0; i < num_args; i++)
38 aa[i].name = va_arg(ap, String);
39 aa[i].value = va_arg(ap, XtArgVal);
42 XtSetValues(w, aa, num_args);
43 if (num_args > 15) store_free(aa);