1 Star 0 Fork 48

waylon_li / conf-c

forked from gitone / conf-c 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

conf-c

基于C语言的轻量级读取/创建配置文件的函数库

简介

conf-c是使用c语言开发的读取/创建配置文件的函数库,它的参数数据结构为 CONF_VALUE * CONF_VALUE结构有两个参数,一个键key和一个字符数组value key为键,value为参数,其中value[0]为第一个参数,value[1]为第二个参数(如果有的话)

读取的配置文件为键/多值参数对并将其放入一个散列表里,再通过使用conf_value_get函数得到一个CONF_VALUE的键/多参数对,具体的使用方法请看两个示例文件.

配置文件的格式为

key = arg1,arg2,arg3,...

并以#字开头为注释行

如若想在参数中添加特殊符号如' " ,空白符以及#等可以使用成对出现的'或者"

比如: key=1234 5678 这是一个错误的参数格式 正确的格式应为 key='1234 5678' 或 key="1234 5678" 当参数中有"时使用'当参数中有'时则使用" 在没有使用'或者"包裹的参数行中逗号,表示多个参数的分隔符,即

key=1234,5678 则value[0]为1234 value[1]为5678 (CONF_VALUE结构)

*使用gcc编译时需要使用-lconf参数

安装

make make install (需要root权限)

卸载

make uninstall (需要root权限)

The MIT License (MIT) Copyright (c) 2014 炕头 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于C语言的轻量级读取/创建配置文件的函数库 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/waylon_li/conf-c.git
git@gitee.com:waylon_li/conf-c.git
waylon_li
conf-c
conf-c
master

搜索帮助

14c37bed 8189591 565d56ea 8189591