BlinkenArea - GitList
Repositories
Blog
Wiki
libetherpix
Code
Commits
Branches
Tags
Search
Tree:
0cb7bcf
Branches
Tags
master
libetherpix
include
intern
config.h
v1.0.1
Stefan Schuermans
commited
0cb7bcf
at 2011-09-11 17:14:09
config.h
Blame
History
Raw
/* * FlexiPix library * !version: 1.0.1! !date: 2010-08-19! * * Copyright 2010 Stefan Schuermans <stefan schuermans info> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef FLP_CONFIG_H #define FLP_CONFIG_H #include <flexipix/msg.h> #include <flexipix/types.h> #include <intern/types.h> /** context information for processing config file */ typedef struct flp_config_ctx_s { flp_display_t *p_display; /**< display to configure */ unsigned int line_no; /**< current line in config file */ flp_msg_func_p_t p_msg_func; /**< message callback function or NULL */ void *p_msg_ctx; /**< user context for message callback */ } flp_config_ctx_t; /** * \brief process distributor from config file * * \param[in,out] p_ctx context information * \param[in] p_setting_part2 second half of setting to process * \param[in] p_value value of setting * \return 0 in case of success, -1 in case of error */ int flp_config_proc_distri(flp_config_ctx_t *p_ctx, char *p_setting_part2, char *value); /** * \brief process mapping from config file * * \param[in,out] p_ctx context information * \param[in] p_setting_part2 second half of setting to process * \param[in] p_value value of setting * \return 0 in case of success, -1 in case of error */ int flp_config_proc_mapping(flp_config_ctx_t *p_ctx, char *p_setting_part2, char *value); /** * \brief process pixel from config file * * \param[in,out] p_ctx context information * \param[in] sz_pixel text of pixel to process * \param[in] distri number of distributor * \param[in] out number of output * \param[in] pix number of pixel * \return 0 in case of success, -1 in case of error */ int flp_config_proc_pixel(flp_config_ctx_t *p_ctx, char *sz_pixel, unsigned int distri, unsigned int out, unsigned int pix); /** * \brief process output from config file * * \param[in,out] p_ctx context information * \param[in] p_setting_part2 second half of setting to process * \param[in] p_value value of setting * \return 0 in case of success, -1 in case of error */ int flp_config_proc_output(flp_config_ctx_t *p_ctx, char *p_setting_part2, char *value); /** * \brief process setting from config file * * \param[in,out] p_ctx context information * \param[in] p_setting setting to process * \param[in] p_value value of setting * \return 0 in case of success, -1 in case of error */ int flp_config_proc_setting(flp_config_ctx_t *p_ctx, char *p_setting, char *p_value); /** * \brief process line from config file * * \param[in,out] p_ctx context information * \param[in] p_line line to process * \return 0 in case of success, -1 in case of error */ int flp_config_proc_line(flp_config_ctx_t *p_ctx, char *p_line); /** * \brief process config file * * \param[in,out] p_display display to configure * \param[in] sz_config_file name of config file to read * \param[in] p_msg_func message callback function or NULL * \param[in] p_msg_ctx user context for message callback * \return 0 in case of success, -1 in case of error */ int flp_config_proc_file(flp_display_t *p_display, const char *sz_config_file, flp_msg_func_p_t p_msg_func, void *p_msg_ctx); #endif /* #ifndef FLP_CONFIG_H */