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