PageRenderTime 46ms CodeModel.GetById 28ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 1ms

/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
 24/** @defgroup Gen Generic
 25 *  This group contains generic structures and functions used by this application.
 26 *  @{
 27 */
 28
 29/*! \file bdrcfg.h
 30  \brief Configuration struct and functions used for handling it.
 31
 32  The configuration struct and the functions in this header files
 33  are used for storing the configuration of this application.
 34*/
 35
 36#ifndef BD_CFG_H
 37#define BD_CFG_H
 38
 39/** Common configuration. */
 40typedef struct
 41{
 42   /** Listen to this port for LIRC connections. */
 43   int listen_port;
 44   /** Disconnect BT peers after this number of seconds. */
 45   int disconnect_timeout;
 46   /** Repeat rate, number of messages per second. */
 47   int repeat_rate;
 48   /** Repeat delay - the amount of messages to ignore before
 49       repeating.*/
 50   int repeat_delay;
 51   /** Generate key release appended with the following string */
 52   char* release;
 53   /** Enable/disable use of LIRC namespace. */
 54   int lirc_namespace;
 55   /** Enable/disable use of uinput based event output device. */
 56   int event_out;
 57   /** Enable/disable printing of debug messages. */
 58   int debug;
 59   /** Indicates if the BT address of the interface to use was set. */
 60   int interface_addr_set;
 61   /** BT address of the interface to use. */
 62   char* interface_addr;
 63   /** BT address of the PS3 remote. */
 64   char* remote_addr;
 65   /** Enable/disable detach from TTY.*/
 66   int detach;
 67   /** Change to the UID of this user. */
 68   char* user;
 69   /** Change to the GID of this group. */
 70   char* group;
 71   /** Indicates if the log filename was set.*/
 72   int log_filename_set;
 73   /** Write log to this file name. */
 74   char* log_filename;
 75   /** Inidcates that script to execute when battery info changes was
 76    *  set. 
 77    */
 78   int battery_script_set;
 79   /** Script executed when battery info changes. */
 80   char* battery_script;
 81} configuration;
 82
 83/** Set default configuration. */
 84void setDefaults(configuration* _config);
 85
 86/** Set the remote BD address to use. */
 87void setRemoteAddress(configuration* _config, const char* _address);
 88
 89/** Set the BD address of the interface to use. */
 90void setInterfaceAddress(configuration* _config, const char* _address);
 91
 92/** Set release key append string. */
 93void setRelease(configuration* _config, const char* _release);
 94
 95/** Set user to change to after opening sockets. */
 96void setUser(configuration* _config, const char* _user);
 97
 98/** Set group to change to after opening sockets. */
 99void setGroup(configuration* _config, const char* _group);
100
101/** Return 1 if both user and group were set. 0 otherwise. */
102int userAndGroupSet(const configuration* _config);
103
104/** Set filename used for logging. */
105void setLogFilename(configuration* _config, const char* _filename);
106
107/** Set battery info script. */
108void setBatteryScript(configuration* _config, const char* _script);
109
110/** Destroy the config. */
111void destroyConfig(configuration* _config);
112
113/** Print each config item on a line of its own. */
114void printConfig(const configuration* _config);
115
116#endif /* BD_CFG_H */
117
118/*@}*/
119