Skip to content

rmccullagh/libjsonparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libjsonparser

JSON parser in C implements https://www.ietf.org/rfc/rfc4627.txt. It parses JSON text into a C representation. The data structure is a C struct named Object, which is a C library located at https://github.com/libobject. Object supports every value that JSON has and even more.

Dependencies

Install

Example

#include <object.h>
#include <jsonparser.h>
#include <stdio.h>

static const char* source = "{\"name\": \"Ryan\"}";

int main(void)
{
	Object* JSON = json_parse(source);
	json_error_t error;

	if(!JSON)
	{
		json_last_error(&error);
		printf("json_parse: %s on line %zu, column %zu, token '%c'\n", 
				error.message, error.line, error.column, error.token);
		return 1;
	}

	OBJECT_DUMP(JSON);
	
	objectDestroy(JSON);
	
	return 0;
}

About

a JSON parser and serialization framework in C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published