Permalink
Browse files

initial commit

  • Loading branch information...
codehero committed Feb 1, 2010
0 parents commit 4a706d9a98c8d8797f0121b36456f2d7566d2824
Showing with 2,886 additions and 0 deletions.
  1. +20 −0 LICENSE
  2. +88 −0 README
  3. +30 −0 SConstruct
  4. +10 −0 benejson/SConscript
  5. +917 −0 benejson/benejson.c
  6. +447 −0 benejson/benejson.h
  7. +467 −0 benejson/pull.cpp
  8. +271 −0 benejson/pull.hh
  9. +1 −0 data/arr.json
  10. +2 −0 data/colon.json
  11. +2 −0 data/content.json
  12. +11 −0 data/depth.json
  13. +2 −0 data/doublecolon.json
  14. +1 −0 data/false.json
  15. +2 −0 data/keytest.json
  16. +7 −0 data/test.json
  17. +15 −0 tests/SConscript
  18. +136 −0 tests/jsonbuff.c
  19. +149 −0 tests/jsontest.c
  20. +39 −0 tests/posix.cpp
  21. +39 −0 tests/posix.hh
  22. +153 −0 tests/pulltest.cpp
  23. +77 −0 tests/stepbystep.c
20 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 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.
@@ -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)
@@ -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'))
Oops, something went wrong.

0 comments on commit 4a706d9

Please sign in to comment.