/src/bdrcfg.h

http://bdremote-ng.googlecode.com/ · C Header · 119 lines · 35 code · 18 blank · 66 comment · 0 complexity · bb78e2fe0113ae65fb41effb403c58aa MD5 · raw file

  1. /*
  2. * bdremoteng - helper daemon for Sony(R) BD Remote Control
  3. * Based on bdremoted, written by Anton Starikov <antst@mail.ru>.
  4. *
  5. * Copyright (C) 2009 Michael Wojciechowski <wojci@wojci.dk>
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. */
  23. /** @defgroup Gen Generic
  24. * This group contains generic structures and functions used by this application.
  25. * @{
  26. */
  27. /*! \file bdrcfg.h
  28. \brief Configuration struct and functions used for handling it.
  29. The configuration struct and the functions in this header files
  30. are used for storing the configuration of this application.
  31. */
  32. #ifndef BD_CFG_H
  33. #define BD_CFG_H
  34. /** Common configuration. */
  35. typedef struct
  36. {
  37. /** Listen to this port for LIRC connections. */
  38. int listen_port;
  39. /** Disconnect BT peers after this number of seconds. */
  40. int disconnect_timeout;
  41. /** Repeat rate, number of messages per second. */
  42. int repeat_rate;
  43. /** Repeat delay - the amount of messages to ignore before
  44. repeating.*/
  45. int repeat_delay;
  46. /** Generate key release appended with the following string */
  47. char* release;
  48. /** Enable/disable use of LIRC namespace. */
  49. int lirc_namespace;
  50. /** Enable/disable use of uinput based event output device. */
  51. int event_out;
  52. /** Enable/disable printing of debug messages. */
  53. int debug;
  54. /** Indicates if the BT address of the interface to use was set. */
  55. int interface_addr_set;
  56. /** BT address of the interface to use. */
  57. char* interface_addr;
  58. /** BT address of the PS3 remote. */
  59. char* remote_addr;
  60. /** Enable/disable detach from TTY.*/
  61. int detach;
  62. /** Change to the UID of this user. */
  63. char* user;
  64. /** Change to the GID of this group. */
  65. char* group;
  66. /** Indicates if the log filename was set.*/
  67. int log_filename_set;
  68. /** Write log to this file name. */
  69. char* log_filename;
  70. /** Inidcates that script to execute when battery info changes was
  71. * set.
  72. */
  73. int battery_script_set;
  74. /** Script executed when battery info changes. */
  75. char* battery_script;
  76. } configuration;
  77. /** Set default configuration. */
  78. void setDefaults(configuration* _config);
  79. /** Set the remote BD address to use. */
  80. void setRemoteAddress(configuration* _config, const char* _address);
  81. /** Set the BD address of the interface to use. */
  82. void setInterfaceAddress(configuration* _config, const char* _address);
  83. /** Set release key append string. */
  84. void setRelease(configuration* _config, const char* _release);
  85. /** Set user to change to after opening sockets. */
  86. void setUser(configuration* _config, const char* _user);
  87. /** Set group to change to after opening sockets. */
  88. void setGroup(configuration* _config, const char* _group);
  89. /** Return 1 if both user and group were set. 0 otherwise. */
  90. int userAndGroupSet(const configuration* _config);
  91. /** Set filename used for logging. */
  92. void setLogFilename(configuration* _config, const char* _filename);
  93. /** Set battery info script. */
  94. void setBatteryScript(configuration* _config, const char* _script);
  95. /** Destroy the config. */
  96. void destroyConfig(configuration* _config);
  97. /** Print each config item on a line of its own. */
  98. void printConfig(const configuration* _config);
  99. #endif /* BD_CFG_H */
  100. /*@}*/