jack2 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.

98 lines
3.1KB

  1. /*
  2. Copyright (C) 2003 Bob Ham <rah@bash.sh>
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2.1 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #ifndef __jack_driver_interface_h__
  16. #define __jack_driver_interface_h__
  17. #ifdef __cplusplus
  18. extern "C"
  19. {
  20. #endif
  21. #include <limits.h>
  22. #include "jslist.h"
  23. #include "JackCompilerDeps.h"
  24. #include "JackSystemDeps.h"
  25. #define JACK_DRIVER_NAME_MAX 15
  26. #define JACK_DRIVER_PARAM_NAME_MAX 15
  27. #define JACK_DRIVER_PARAM_STRING_MAX 63
  28. #define JACK_DRIVER_PARAM_DESC 255
  29. #define JACK_PATH_MAX 511
  30. /** Driver parameter types */
  31. typedef enum
  32. {
  33. JackDriverParamInt = 1,
  34. JackDriverParamUInt,
  35. JackDriverParamChar,
  36. JackDriverParamString,
  37. JackDriverParamBool
  38. } jack_driver_param_type_t;
  39. /** Driver parameter value */
  40. typedef union
  41. {
  42. uint32_t ui;
  43. int32_t i;
  44. char c;
  45. char str[JACK_DRIVER_PARAM_STRING_MAX + 1];
  46. } jack_driver_param_value_t;
  47. /** A driver parameter descriptor */
  48. typedef struct {
  49. char name[JACK_DRIVER_NAME_MAX + 1]; /**< The parameter's name */
  50. char character; /**< The parameter's character (for getopt, etc) */
  51. jack_driver_param_type_t type; /**< The parameter's type */
  52. jack_driver_param_value_t value; /**< The parameter's (default) value */
  53. char short_desc[64]; /**< A short (~30 chars) description for the user */
  54. char long_desc[1024]; /**< A longer description for the user */
  55. }
  56. jack_driver_param_desc_t;
  57. /** A driver parameter */
  58. typedef struct {
  59. char character;
  60. jack_driver_param_value_t value;
  61. }
  62. jack_driver_param_t;
  63. /** A struct for describing a jack driver */
  64. typedef struct {
  65. char name[JACK_DRIVER_NAME_MAX + 1]; /**< The driver's canonical name */
  66. char desc[JACK_DRIVER_PARAM_DESC + 1]; /**< The driver's extended description */
  67. char file[JACK_PATH_MAX + 1]; /**< The filename of the driver's shared object file */
  68. uint32_t nparams; /**< The number of parameters the driver has */
  69. jack_driver_param_desc_t * params; /**< An array of parameter descriptors */
  70. }
  71. jack_driver_desc_t;
  72. SERVER_EXPORT int jack_parse_driver_params (jack_driver_desc_t * desc, int argc, char* argv[], JSList ** param_ptr);
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif /* __jack_driver_interface_h__ */