MythTV  master
lirc_client.h
Go to the documentation of this file.
1 /* NOTE: Extracted from LIRC release 0.8.4a -- dtk */
2 
3 /****************************************************************************
4  ** lirc_client.h ***********************************************************
5  ****************************************************************************
6  *
7  * lirc_client - common routines for lircd clients
8  *
9  * Copyright (C) 1998 Trent Piepho <xyzzy@u.washington.edu>
10  * Copyright (C) 1998 Christoph Bartelmus <lirc@bartelmus.de>
11  *
12  */
13 
14 #ifndef LIRC_CLIENT_H
15 #define LIRC_CLIENT_H
16 
17 #ifdef __cplusplus
18 #include <cstddef>
19 #else
20 #include <stddef.h>
21 #endif
22 
23 #define LIRC_RET_SUCCESS (0)
24 #define LIRC_RET_ERROR (-1)
25 
26 #define LIRC_ALL ((char *) (-1))
27 
28 enum lirc_flags {none=0x00,
29  once=0x01,
30  quit=0x02,
31  modex=0x04,
32  ecno=0x08,
35 };
36 
37 struct lirc_state
38 {
41  char *lirc_prog;
42  char *lirc_buffer;
45 };
46 
47 struct lirc_list
48 {
49  char *string;
50  struct lirc_list *next;
51 };
52 
53 struct lirc_code
54 {
55  char *remote;
56  char *button;
57  struct lirc_code *next;
58 };
59 
61 {
62  char *current_mode;
65 
66  int sockfd;
67 };
68 
70 {
71  char *prog;
72  struct lirc_code *code;
73  unsigned int rep_delay;
74  unsigned int rep;
75  struct lirc_list *config;
76  char *change_mode;
77  unsigned int flags;
78 
79  char *mode;
82 
84 };
85 
86 struct lirc_state *lirc_init(const char *lircrc_root_file,
87  const char *lircrc_user_file,
88  const char *prog, const char *lircd, int verbose);
89 int lirc_deinit(struct lirc_state *state);
90 
91 int lirc_readconfig(const struct lirc_state *state,
92  const char *file,struct lirc_config **config,
93  int (check)(char *s));
94 void lirc_freeconfig(struct lirc_config *config);
95 
96 #if 0
97 /* obsolete */
98 char *lirc_nextir(struct lirc_state *state);
99 /* obsolete */
100 char *lirc_ir2char(const struct lirc_state *state, struct lirc_config *config,char *code);
101 #endif
102 
103 int lirc_nextcode(struct lirc_state *state, char **code);
104 int lirc_code2char(const struct lirc_state *state, struct lirc_config *config,const char *code,char **string);
105 
106 /* new interface for client daemon */
107 int lirc_readconfig_only(const struct lirc_state *state,
108  const char *file, struct lirc_config **config,
109  int (check)(char *s));
110 int lirc_code2charprog(struct lirc_state *state,
111  struct lirc_config *config,char *code,char **string,
112  char **prog);
113 size_t lirc_getsocketname(const char *filename, char *buf, size_t size);
114 const char *lirc_getmode(const struct lirc_state *state, struct lirc_config *config);
115 const char *lirc_setmode(const struct lirc_state *state, struct lirc_config *config, const char *mode);
116 
117 #endif
lirc_freeconfig
void lirc_freeconfig(struct lirc_config *config)
Definition: lirc_client.cpp:1399
lirc_state::lircrc_root_file
char * lircrc_root_file
Definition: lirc_client.h:43
lirc_getmode
const char * lirc_getmode(const struct lirc_state *state, struct lirc_config *config)
Definition: lirc_client.cpp:1845
lirc_deinit
int lirc_deinit(struct lirc_state *state)
Definition: lirc_client.cpp:208
lirc_state
Definition: lirc_client.h:38
lirc_list
Definition: lirc_client.h:48
lirc_state::lirc_prog
char * lirc_prog
Definition: lirc_client.h:41
lirc_setmode
const char * lirc_setmode(const struct lirc_state *state, struct lirc_config *config, const char *mode)
Definition: lirc_client.cpp:1868
lirc_list::string
char * string
Definition: lirc_client.h:49
lirc_code::remote
char * remote
Definition: lirc_client.h:55
lirc_state::lirc_buffer
char * lirc_buffer
Definition: lirc_client.h:42
toggle_reset
@ toggle_reset
Definition: lirc_client.h:34
lirc_state::lirc_verbose
int lirc_verbose
Definition: lirc_client.h:40
lirc_config::current_mode
char * current_mode
Definition: lirc_client.h:62
lirc_config_entry::prog
char * prog
Definition: lirc_client.h:71
lirc_config_entry::change_mode
char * change_mode
Definition: lirc_client.h:76
lirc_config_entry::code
struct lirc_code * code
Definition: lirc_client.h:72
build_compdb.file
file
Definition: build_compdb.py:55
lirc_readconfig_only
int lirc_readconfig_only(const struct lirc_state *state, const char *file, struct lirc_config **config, int(check)(char *s))
Definition: lirc_client.cpp:944
modex
@ modex
Definition: lirc_client.h:31
lirc_list::next
struct lirc_list * next
Definition: lirc_client.h:50
quit
@ quit
Definition: lirc_client.h:30
lirc_code::next
struct lirc_code * next
Definition: lirc_client.h:57
lirc_getsocketname
size_t lirc_getsocketname(const char *filename, char *buf, size_t size)
Definition: lirc_client.cpp:1835
startup_mode
@ startup_mode
Definition: lirc_client.h:33
lirc_code
Definition: lirc_client.h:54
lirc_readconfig
int lirc_readconfig(const struct lirc_state *state, const char *file, struct lirc_config **config, int(check)(char *s))
Definition: lirc_client.cpp:837
none
@ none
Definition: lirc_client.h:28
lirc_state::lircrc_user_file
char * lircrc_user_file
Definition: lirc_client.h:44
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:634
lirc_config::first
struct lirc_config_entry * first
Definition: lirc_client.h:64
lirc_config
Definition: lirc_client.h:61
lirc_flags
lirc_flags
Definition: lirc_client.h:28
lirc_config_entry::rep_delay
unsigned int rep_delay
Definition: lirc_client.h:73
lirc_config::sockfd
int sockfd
Definition: lirc_client.h:66
lirc_config_entry
Definition: lirc_client.h:70
lirc_config_entry::next_config
struct lirc_list * next_config
Definition: lirc_client.h:80
lirc_state::lirc_lircd
int lirc_lircd
Definition: lirc_client.h:39
lirc_code2char
int lirc_code2char(const struct lirc_state *state, struct lirc_config *config, const char *code, char **string)
Definition: lirc_client.cpp:1629
once
@ once
Definition: lirc_client.h:29
lirc_nextcode
int lirc_nextcode(struct lirc_state *state, char **code)
Definition: lirc_client.cpp:1772
lirc_config_entry::next
struct lirc_config_entry * next
Definition: lirc_client.h:83
lirc_config::next
struct lirc_config_entry * next
Definition: lirc_client.h:63
lirc_init
struct lirc_state * lirc_init(const char *lircrc_root_file, const char *lircrc_user_file, const char *prog, const char *lircd, int verbose)
Definition: lirc_client.cpp:134
lirc_code::button
char * button
Definition: lirc_client.h:56
hardwareprofile.distros.mythtv_data.makeopts.verbose
verbose
Definition: makeopts.py:60
lirc_config_entry::mode
char * mode
Definition: lirc_client.h:79
lirc_config_entry::flags
unsigned int flags
Definition: lirc_client.h:77
lirc_code2charprog
int lirc_code2charprog(struct lirc_state *state, struct lirc_config *config, char *code, char **string, char **prog)
Definition: lirc_client.cpp:1663
lirc_config_entry::rep
unsigned int rep
Definition: lirc_client.h:74
ecno
@ ecno
Definition: lirc_client.h:32
lirc_config_entry::config
struct lirc_list * config
Definition: lirc_client.h:75
lirc_config_entry::next_code
struct lirc_code * next_code
Definition: lirc_client.h:81