stop & detach driver when exiting due to -T/--temporary flag
[jack.git] / jack / varargs.h
bloba2e6a913496876fb6fc6dcd2fea82501cc6e0169
1 /*
2 * Copyright (C) 2004 Jack O'Quin
3 *
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.
8 *
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.
20 #ifndef __jack_varargs_h__
21 #define __jack_varargs_h__
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
27 /* variable argument structure */
28 typedef struct {
29 char *server_name; /* server name */
30 char *load_name; /* load module name */
31 char *load_init; /* initialization string */
32 } jack_varargs_t;
34 static inline void
35 jack_varargs_init (jack_varargs_t *va)
37 memset (va, 0, sizeof(jack_varargs_t));
38 va->server_name = jack_default_server_name ();
41 static inline void
42 jack_varargs_parse (jack_options_t options, va_list ap, jack_varargs_t *va)
44 /* initialize default settings */
45 jack_varargs_init (va);
47 if ((options & JackServerName)) {
48 char *sn = va_arg(ap, char *);
49 if (sn)
50 va->server_name = sn;
52 if ((options & JackLoadName))
53 va->load_name = va_arg(ap, char *);
54 if ((options & JackLoadInit))
55 va->load_init = va_arg(ap, char *);
58 #ifdef __cplusplus
60 #endif
62 #endif /* __jack_varargs_h__ */