Skip to content

Commit

Permalink
Merge pull request #12 from lindig/master
Browse files Browse the repository at this point in the history
Update upstream JSON library, simplify Travis setup
  • Loading branch information
mseri authored Sep 19, 2017
2 parents 88f49c3 + 6e711f2 commit fa8c7f9
Show file tree
Hide file tree
Showing 17 changed files with 267 additions and 126 deletions.
17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

os:
- linux
sudo: required
language: c
services:
- docker

dist: trusty
sudo: required
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y zlib1g-dev valgrind
script:
- docker run -itv $PWD:/mnt xenserver/xenserver-build-env bash -c "cd /mnt; ./travis-ci.sh"
- make
- make test
- make valgrind
- make clean
2 changes: 1 addition & 1 deletion parson
File renamed without changes.
23 changes: 11 additions & 12 deletions parson-c22be79/README.md → parson-578b25e/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
##About
## About
Parson is a lighweight [json](http://json.org) library written in C.

##Features
## Features
* Full JSON support
* Lightweight (only 2 files)
* Simple API
* Addressing json values with dot notation (similiar to C structs or objects in most OO languages, e.g. "objectA.objectB.value")
* C89 compatible
* Test suites

##Installation
## Installation
Run:
```
git clone https://github.com/kgabis/parson.git
Expand All @@ -18,8 +18,8 @@ and copy parson.h and parson.c to you source code tree.

Run ```make test``` to compile and run tests.

##Examples
###Parsing JSON
## Examples
### Parsing JSON
Here is a function, which prints basic commit info (date, sha and author) from a github repository.
```c
void print_commits_info(const char *username, const char *repo) {
Expand Down Expand Up @@ -75,7 +75,7 @@ Date SHA Author
...
```
###Persistence
### Persistence
In this example I'm using parson to save user information to a file and then load it and validate later.
```c
void persistence_example(void) {
Expand All @@ -98,7 +98,7 @@ void persistence_example(void) {
}
```

###Serialization
### Serialization
Creating JSON values is very simple thanks to the dot notation.
Object hierarchy is automatically created when addressing specific fields.
In the following example I create a simple JSON value containing basic information about a person.
Expand Down Expand Up @@ -136,11 +136,10 @@ Output:
}
```
##Contributing
## Contributing
I will always merge *working* bug fixes. However, if you want to add something to the API,
I *won't* merge it without prior discussion.
I will always merge *working* bug fixes. However, if you want to add something new to the API, please create an "issue" on github for this first so we can discuss if it should end up in the library before you start implementing it.
Remember to follow parson's code style and write appropriate tests.
##License
[The MIT License (MIT)](http://opensource.org/licenses/mit-license.php)
## License
[The MIT License (MIT)](http://opensource.org/licenses/mit-license.php)
File renamed without changes.
Loading

0 comments on commit fa8c7f9

Please sign in to comment.