Little fix.
[irreco.git] / lirc-0.8.4a / daemons / config_file.h
blob965add3603f12a5de2036cf384bb31b9ef099398
1 /* $Id: config_file.h,v 5.11 2008/05/09 18:40:59 lirc Exp $ */
3 /****************************************************************************
4 ** config_file.h ***********************************************************
5 ****************************************************************************
7 * config_file.h - parses the config file of lircd
9 * Copyright (C) 1998 Pablo d'Angelo (pablo@ag-trek.allgaeu.org)
13 #ifndef _CONFIG_FILE_H
14 #define _CONFIG_FILE_H
16 #include <sys/types.h>
17 #include <unistd.h>
19 #include "ir_remote.h"
21 struct flaglist {
22 char *name;
23 int flag;
26 static struct flaglist all_flags[]=
28 {"RAW_CODES", RAW_CODES},
29 {"RC5", RC5},
30 {"SHIFT_ENC", SHIFT_ENC}, /* obsolete */
31 {"RC6", RC6},
32 {"RCMM", RCMM},
33 {"SPACE_ENC", SPACE_ENC},
34 {"SPACE_FIRST", SPACE_FIRST},
35 {"GOLDSTAR", GOLDSTAR},
36 {"GRUNDIG", GRUNDIG},
37 {"BO", BO},
38 {"SERIAL", SERIAL},
40 {"REVERSE", REVERSE},
41 {"NO_HEAD_REP", NO_HEAD_REP},
42 {"NO_FOOT_REP", NO_FOOT_REP},
43 {"CONST_LENGTH", CONST_LENGTH}, /* remember to adapt warning
44 message when changing this */
45 {"REPEAT_HEADER", REPEAT_HEADER},
46 {NULL,0},
50 config stuff
53 enum directive {ID_none,ID_remote,ID_codes,ID_raw_codes,ID_raw_name};
55 struct ptr_array
57 void **ptr;
58 size_t nr_items;
59 size_t chunk_size;
62 struct void_array
64 void *ptr;
65 size_t item_size;
66 size_t nr_items;
67 size_t chunk_size;
70 void **init_void_array(struct void_array *ar,size_t chunk_size, size_t item_size);
71 int add_void_array(struct void_array *ar, void * data);
72 inline void * get_void_array(struct void_array *ar);
74 /* some safer functions */
75 void * s_malloc(size_t size);
76 char * s_strdup(char * string);
77 ir_code s_strtocode(const char *val);
78 unsigned long s_strtoul(char *val);
79 int s_strtoi(char *val);
80 unsigned int s_strtoui(char *val);
81 lirc_t s_strtolirc_t(char *val);
83 int checkMode(int is_mode, int c_mode, char *error);
84 int parseFlags(char *val);
85 int addSignal(struct void_array *signals, char *val);
86 struct ir_ncode * defineCode(char *key, char *val, struct ir_ncode *code);
87 struct ir_code_node *defineNode(struct ir_ncode *code, const char *val);
88 int defineRemote(char * key, char * val, char *val2, struct ir_remote *rem);
89 struct ir_remote *read_config(FILE *f, const char *name);
90 void free_config(struct ir_remote *remotes);
92 #endif