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>
19 #include "ir_remote.h"
26 static struct flaglist all_flags
[]=
28 {"RAW_CODES", RAW_CODES
},
30 {"SHIFT_ENC", SHIFT_ENC
}, /* obsolete */
33 {"SPACE_ENC", SPACE_ENC
},
34 {"SPACE_FIRST", SPACE_FIRST
},
35 {"GOLDSTAR", GOLDSTAR
},
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
},
53 enum directive
{ID_none
,ID_remote
,ID_codes
,ID_raw_codes
,ID_raw_name
};
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
);