jack1 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.8KB

  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.
  13. *
  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.
  17. *
  18. */
  19. #ifndef __jack_varargs_h__
  20. #define __jack_varargs_h__
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* variable argument structure */
  25. typedef struct {
  26. char *server_name; /* server name */
  27. char *load_name; /* load module name */
  28. char *load_init; /* initialization string */
  29. char *sess_uuid;
  30. } jack_varargs_t;
  31. static inline void
  32. jack_varargs_init (jack_varargs_t *va)
  33. {
  34. memset (va, 0, sizeof(jack_varargs_t));
  35. va->server_name = jack_default_server_name ();
  36. }
  37. static inline void
  38. jack_varargs_parse (jack_options_t options, va_list ap, jack_varargs_t *va)
  39. {
  40. /* initialize default settings */
  41. jack_varargs_init (va);
  42. if ((options & JackServerName)) {
  43. char *sn = va_arg (ap, char *);
  44. if (sn) {
  45. va->server_name = sn;
  46. }
  47. }
  48. if ((options & JackLoadName)) {
  49. va->load_name = va_arg (ap, char *);
  50. }
  51. if ((options & JackLoadInit)) {
  52. va->load_init = va_arg (ap, char *);
  53. }
  54. if ((options & JackSessionID)) {
  55. va->sess_uuid = va_arg (ap, char *);
  56. }
  57. }
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #endif /* __jack_varargs_h__ */