【文件属性】:
文件名称:yaml:将yaml文件解析为c中的哈希
文件大小:14KB
文件格式:ZIP
更新时间:2021-05-09 01:20:33
C
yaml
一个非常简单的模块来读取Yaml
给你一个像(“ app.url”:“ localhost”)的
安装:
clib install pbrandt1/yaml
例子:
test.yaml
app :
url : localhost
port : 8080
在test.c中
hash_t *config = yaml_read( " test.yaml " );
printf ( " app listening on port %s \n " , ( char *)hash_get(config, " app.port " ));
使用 。
编写Yaml的一些易于使用的规则:
使用两个空格缩进
不要使用像url: localhost # comment这样的行尾注释url: localhost # comment
不要在按键中使用圆点
不要使用url:
【文件预览】:
yaml-master
----test.yaml(140B)
----package.json(235B)
----main.c(289B)
----deps()
--------hash()
----yaml.h(100B)
----main(18KB)
----yaml.c(2KB)
----Makefile(97B)
----README.md(660B)