2 * Copyright (C) 2004 Jack O'Quin
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 * $Id: varargs.h,v 1.3 2005/11/23 11:24:00 letz Exp $
21 #ifndef __jack_varargs_h__
22 #define __jack_varargs_h__
32 /* variable argument structure */
34 char *server_name
; /* server name */
35 char *load_name
; /* load module name */
36 char *load_init
; /* initialization string */
40 static char* jack_default_server_name (void) {
42 if ((server_name
= getenv("JACK_DEFAULT_SERVER")) == NULL
)
43 server_name
= "default";
47 static inline void jack_varargs_init (jack_varargs_t
*va
) {
48 memset (va
, 0, sizeof(jack_varargs_t
));
49 va
->server_name
= jack_default_server_name();
52 static inline void jack_varargs_parse (jack_options_t options
, va_list ap
, jack_varargs_t
*va
) {
53 // initialize default settings
54 jack_varargs_init (va
);
56 if ((options
& JackServerName
)) {
57 char *sn
= va_arg(ap
, char *);
61 if ((options
& JackLoadName
))
62 va
->load_name
= va_arg(ap
, char *);
63 if ((options
& JackLoadInit
))
64 va
->load_init
= va_arg(ap
, char *);
71 #endif /* __jack_varargs_h__ */