Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
codehero committed Feb 1, 2010
0 parents commit 4a706d9
Show file tree
Hide file tree
Showing 23 changed files with 2,886 additions and 0 deletions.
20 changes: 20 additions & 0 deletions LICENSE
@@ -0,0 +1,20 @@
Copyright (c) 2010 David Bender, rights assigned to Benegon Enterprises LLC

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
88 changes: 88 additions & 0 deletions README
@@ -0,0 +1,88 @@
BeneJSON Library
----------------

SUMMARY

Abstract:
BeneJSON is a JSON input library written with a core written in C and
distributed with a high level C++ interface. The core is meant to be
fast, minimal and easy to integrate directly into source.

Current release information:
Date: January 31, 2010
Version: 0.8.0
Type: Alpha, User Interface Release Candidate

Current version dependencies:
-Usable <stdint.h>
-Optional <wchar.h>, <math.h>
-C++ for pull parsing
-scons building environment (http://www.scons.org)
-POSIX compliant environment to build test cases

DESCRIPTION

Use cases:
-Stream parsing
-Memory constrained embedded systems
-Web services handling JSON input
-Configuration file reading
-One by one pull parsing
-Basis for scripting language bindings.

-The author will not provide functions for DOM-like tree generation,
though users are certainly welcome to write their own.

Goals:
-Full verification of JSON spec
-Additional support of interpreting NaN, +/- Infinity values
-Provide the BEST solution for the needs of embedded systems
-Provide a COMPETITIVE solution for uses in other computing domains
-Easy to integrate
-Direct source integration
-Dynamic library
-Basis of scripting library binding
-Use in callback based architectures or directly read results on return

-Provide C based core
-Operates in both callback and return type modes using the same function
-ZERO use of global variables, including malloc calls
-Zero memory leaks by design
-Inhibit DoS attacks by limiting depth and avoiding eager evaluations
-User can provide an alphabetically sorted array of character strings
against which the library will match map keys. The library will tag
each value with the index of user's array, thus speeding up value
identification within maps.

-Provide high level C++ interface
-Simplified usage of C core
-ZERO use of malloc and global variables in shipped code
-Streaming pull parsing API
-Verify input's syntactic properties
-Easy integration with external input sources, I/O libraries


Future Goals (after 1.0.0):
-Provide support for different build systems (make, Visual studio)
-Provide JSON formatted output routines
-Pretty formatting
-Compact formatting
-Aligned string formatting
-Create patches to C core for parsing arbitrary precision numbers

NOTES

Version 0.8.0 Known Bugs/TODO:

1) UTF-8 is not yet fully verified in strings
2) UTF-16 not properly handled if fragmented
3) pull.hh:Consume() is not handled for fragmenting cases yet
4) Key enum mappings do not yet work with unescaped chars, UTF-8 mapping
5) No support for wide char key enums
6) Complete regression and verification programs
7) Add more test cases for said regression/verification
8) PullParser::FileOffset not implemented
9) Error reporting in PullParser is incomplete

Copyright (c) 2010 David Bender assigned to Benegon Enterprises LLC
See the file LICENSE for full license information.
30 changes: 30 additions & 0 deletions SConstruct
@@ -0,0 +1,30 @@
# Copyright (c) 2010 David Bender assigned to Benegon Enterprises LLC
# See the file LICENSE for full license information.

#Default construction environment

import os

mydir = os.getcwd()

#Set default C++ building flags for both libraries and executables
default_env = Environment(ENV = os.environ)
default_env.Append(CPPPATH = [mydir + '/include'])
default_env.Append(CCFLAGS = ' -Wall -pedantic -std=c99')
default_env.Append(CCFLAGS = ' -O2 -fomit-frame-pointer')

default_env.LibDest = mydir + '/lib'
default_env.BinDest = mydir + '/bin'
default_env.IncDest = mydir + '/include'

#Set linking flags for executables
bin_env = default_env.Clone()
bin_env.Append(LIBPATH = [bin_env.LibDest])
bin_env.Append(LINKFLAGS = ['-Wl'])

#set linking flags for libraries
lib_env = default_env.Clone()
lib_env.Append(LINKFLAGS = ['-fPIC'])

SConscript('benejson/SConscript', exports='bin_env lib_env', variant_dir='build/benejson', duplicate = 0)
SConscript('tests/SConscript', exports='bin_env lib_env', variant_dir='build/tests', duplicate = 0)
10 changes: 10 additions & 0 deletions benejson/SConscript
@@ -0,0 +1,10 @@
# Copyright (c) 2010 David Bender assigned to Benegon Enterprises LLC
# See the file LICENSE for full license information.

Import('*')

lib_env = lib_env.Clone()

lt = lib_env.SharedLibrary('benejson', Split('benejson.c pull.cpp'))
li = lib_env.Install(bin_env.LibDest, lt)
lh = lib_env.Install(lib_env.IncDest + "/benejson", Split('benejson.h pull.hh'))

0 comments on commit 4a706d9

Please sign in to comment.