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 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #define LIRC_RET_SUCCESS (0)
28 #define LIRC_RET_ERROR (-1)
29 
30 #define LIRC_ALL ((char *) (-1))
31 
32 enum lirc_flags {none=0x00,
33  once=0x01,
34  quit=0x02,
35  modex=0x04,
36  ecno=0x08,
39 };
40 
41 struct lirc_state
42 {
45  char *lirc_prog;
46  char *lirc_buffer;
49 };
50 
51 struct lirc_list
52 {
53  char *string;
54  struct lirc_list *next;
55 };
56 
57 struct lirc_code
58 {
59  char *remote;
60  char *button;
61  struct lirc_code *next;
62 };
63 
65 {
66  char *current_mode;
69 
70  int sockfd;
71 };
72 
74 {
75  char *prog;
76  struct lirc_code *code;
77  unsigned int rep_delay;
78  unsigned int rep;
79  struct lirc_list *config;
80  char *change_mode;
81  unsigned int flags;
82 
83  char *mode;
86 
88 };
89 
90 struct lirc_state *lirc_init(const char *lircrc_root_file,
91  const char *lircrc_user_file,
92  const char *prog, const char *lircd, int verbose);
93 int lirc_deinit(struct lirc_state*);
94 
95 int lirc_readconfig(const struct lirc_state *state,
96  const char *file,struct lirc_config **config,
97  int (check)(char *s));
98 void lirc_freeconfig(struct lirc_config *config);
99 
100 #if 0
101 /* obsolete */
102 char *lirc_nextir(struct lirc_state *state);
103 /* obsolete */
104 char *lirc_ir2char(const struct lirc_state *state, struct lirc_config *config,char *code);
105 #endif
106 
107 int lirc_nextcode(struct lirc_state *state, char **code);
108 int lirc_code2char(const struct lirc_state *state, struct lirc_config *config,char *code,char **string);
109 
110 /* new interface for client daemon */
111 int lirc_readconfig_only(const struct lirc_state *state,
112  const char *file, struct lirc_config **config,
113  int (check)(char *s));
114 int lirc_code2charprog(struct lirc_state *state,
115  struct lirc_config *config,char *code,char **string,
116  char **prog);
117 size_t lirc_getsocketname(const char *filename, char *buf, size_t size);
118 const char *lirc_getmode(const struct lirc_state *state, struct lirc_config *config);
119 const char *lirc_setmode(const struct lirc_state *state, struct lirc_config *config, const char *mode);
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif
char * lircrc_user_file
Definition: lirc_client.h:48
struct lirc_code * next_code
Definition: lirc_client.h:85
Definition: lirc_client.h:73
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.c:134
int lirc_deinit(struct lirc_state *)
Definition: lirc_client.c:208
size_t lirc_getsocketname(const char *filename, char *buf, size_t size)
Definition: lirc_client.c:1833
struct lirc_config_entry * next
Definition: lirc_client.h:87
char * change_mode
Definition: lirc_client.h:80
int lirc_nextcode(struct lirc_state *state, char **code)
Definition: lirc_client.c:1771
int lirc_readconfig(const struct lirc_state *state, const char *file, struct lirc_config **config, int(check)(char *s))
Definition: lirc_client.c:836
const char * lirc_getmode(const struct lirc_state *state, struct lirc_config *config)
Definition: lirc_client.c:1843
struct lirc_code * next
Definition: lirc_client.h:61
char * string
Definition: lirc_client.h:53
const char * lirc_setmode(const struct lirc_state *state, struct lirc_config *config, const char *mode)
Definition: lirc_client.c:1866
struct lirc_list * next
Definition: lirc_client.h:54
int lirc_readconfig_only(const struct lirc_state *state, const char *file, struct lirc_config **config, int(check)(char *s))
Definition: lirc_client.c:943
int lirc_verbose
Definition: lirc_client.h:44
struct lirc_config_entry * first
Definition: lirc_client.h:68
unsigned int rep
Definition: lirc_client.h:78
struct lirc_list * next_config
Definition: lirc_client.h:84
int lirc_code2charprog(struct lirc_state *state, struct lirc_config *config, char *code, char **string, char **prog)
Definition: lirc_client.c:1662
char * lirc_prog
Definition: lirc_client.h:45
int lirc_code2char(const struct lirc_state *state, struct lirc_config *config, char *code, char **string)
Definition: lirc_client.c:1628
char * current_mode
Definition: lirc_client.h:66
char * lirc_buffer
Definition: lirc_client.h:46
struct lirc_code * code
Definition: lirc_client.h:76
char * lircrc_root_file
Definition: lirc_client.h:47
lirc_flags
Definition: lirc_client.h:32
int lirc_lircd
Definition: lirc_client.h:43
char * prog
Definition: lirc_client.h:75
char * button
Definition: lirc_client.h:60
char * mode
Definition: lirc_client.h:83
void lirc_freeconfig(struct lirc_config *config)
Definition: lirc_client.c:1398
struct lirc_config_entry * next
Definition: lirc_client.h:67
unsigned int rep_delay
Definition: lirc_client.h:77
unsigned int flags
Definition: lirc_client.h:81
char * remote
Definition: lirc_client.h:59
struct lirc_list * config
Definition: lirc_client.h:79