Skip to content

ajwans/libtoml

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

libtoml

Fast C parser using Ragel to generate the state machine.

Currently targetted at TOML v0.4.0

Usage

#include <toml.h>

struct toml_node *root;
struct toml_node *node;
char *buf = "[foo]\nbar = 1\n";
char *value;

toml_init(&root);
toml_parse(root, buf, len);

node = toml_get(root, "foo.bar");

toml_dump(root, stdout);

value = toml_value_as_string(node);
free(value);

toml_free(root);

Building it

Building libtoml requires cmake, ragel (the parser generator) and libicu for unicode support.

> cmake -G "Unix Makefiles" .
> make

Testing it

Compatible with toml-test when invoked as 'parser_test'

> ln -s main parser_test
> $GOPATH/bin/toml-test $PWD/parser_test

TODO

More tests

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages