- Notifications
You must be signed in to change notification settings - Fork435
A fast streaming JSON parsing library in C.
License
NotificationsYou must be signed in to change notification settings
lloyd/yajl
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
********************************************************************** This is YAJL 2. For the legacy version of YAJL seehttps://github.com/lloyd/yajl/tree/1.x**********************************************************************Welcome to Yet Another JSON Library (YAJL)## Why does the world need another C library for parsing JSON? Good question. In a review of current C JSON parsing libraries I was unable to find one that satisfies my requirements. Those are, 0. written in C1. portable2. robust -- as close to "crash proof" as possible3. data representation independent4. fast5. generates verbose, useful error messages including context of where the error occurs in the input text.6. can parse JSON data off a stream, incrementally7. simple to use8. tinyNumbers 3, 5, 6, and 7 were particularly hard to find, and were what caused me to ultimately create YAJL. This document is a tour of someof the more important aspects of YAJL.## YAJL is Free.Permissive licensing means you can use it in open source andcommercial products alike without any fees. My request beyond thelicensing is that if you find bugs drop me a email, or better yet,fork and fix.Porting YAJL should be trivial, the implementation is ANSI C. If youport to new systems I'd love to hear of it and integrate your patches.## YAJL is data representation independent.BYODR! Many JSON libraries impose a structure based data representationon you. This is a benefit in some cases and a drawback in others.YAJL uses callbacks to remain agnostic of the in-memory representation.So if you wish to build up an in-memory representation, you may do sousing YAJL, but you must bring the code that defines and populates thein memory structure.This also means that YAJL can be used by other (higher level) JSONlibraries if so desired.## YAJL supports stream parsingThis means you do not need to hold the whole JSON representation intextual form in memory. This makes YAJL ideal for filtering projects,where you're converting YAJL from one form to another (i.e. XML). Theincluded JSON pretty printer is an example of such a filter program.## YAJL is fastMinimal memory copying is performed. YAJL, when possible, returnspointers into the client provided text (i.e. for strings that have noembedded escape chars, hopefully the common case). I've put a lot ofeffort into profiling and tuning performance, but I have ignored acouple possible performance improvements to keep the interface clean,small, and flexible. My hope is that YAJL will perform comparably tothe fastest JSON parser out there.YAJL should impose both minimal CPU and memory requirements on yourapplication.## YAJL is tiny.Fat free. No whip.enjoy,Lloyd - July, 2007
About
A fast streaming JSON parsing library in C.
Resources
License
Stars
Watchers
Forks
Packages0
No packages published