Mostly minor fixes up until version 0.8.10.
[irreco.git] / lirc-0.8.4a / tools / lirc_client.h
blobd393fd74e230a77d08aa7487ddf548ac2dca2088
1 /* $Id: lirc_client.h,v 5.11 2008/05/20 18:54:37 lirc Exp $ */
3 /****************************************************************************
4 ** lirc_client.h ***********************************************************
5 ****************************************************************************
7 * lirc_client - common routines for lircd clients
9 * Copyright (C) 1998 Trent Piepho <xyzzy@u.washington.edu>
10 * Copyright (C) 1998 Christoph Bartelmus <lirc@bartelmus.de>
12 */
14 #ifndef LIRC_CLIENT_H
15 #define LIRC_CLIENT_H
17 #include <stddef.h>
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
23 #define LIRC_RET_SUCCESS (0)
24 #define LIRC_RET_ERROR (-1)
26 #define LIRC_ALL ((char *) (-1))
28 enum lirc_flags {none=0x00,
29 once=0x01,
30 quit=0x02,
31 mode=0x04,
32 ecno=0x08,
33 startup_mode=0x10,
34 toggle_reset=0x20,
37 struct lirc_list
39 char *string;
40 struct lirc_list *next;
43 struct lirc_code
45 char *remote;
46 char *button;
47 struct lirc_code *next;
50 struct lirc_config
52 char *current_mode;
53 struct lirc_config_entry *next;
54 struct lirc_config_entry *first;
56 int sockfd;
59 struct lirc_config_entry
61 char *prog;
62 struct lirc_code *code;
63 unsigned int rep_delay;
64 unsigned int rep;
65 struct lirc_list *config;
66 char *change_mode;
67 unsigned int flags;
69 char *mode;
70 struct lirc_list *next_config;
71 struct lirc_code *next_code;
73 struct lirc_config_entry *next;
76 int lirc_init(char *prog,int verbose);
77 int lirc_deinit(void);
79 int lirc_readconfig(char *file,struct lirc_config **config,
80 int (check)(char *s));
81 void lirc_freeconfig(struct lirc_config *config);
83 /* obsolete */
84 char *lirc_nextir(void);
85 /* obsolete */
86 char *lirc_ir2char(struct lirc_config *config,char *code);
88 int lirc_nextcode(char **code);
89 int lirc_code2char(struct lirc_config *config,char *code,char **string);
91 /* new interface for client daemon */
92 int lirc_readconfig_only(char *file,struct lirc_config **config,
93 int (check)(char *s));
94 int lirc_code2charprog(struct lirc_config *config,char *code,char **string,
95 char **prog);
96 size_t lirc_getsocketname(const char *filename, char *buf, size_t size);
97 const char *lirc_getmode(struct lirc_config *config);
98 const char *lirc_setmode(struct lirc_config *config, const char *mode);
100 #ifdef __cplusplus
102 #endif
104 #endif