Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update yajl #4

Open
wants to merge 4 commits into
base: parser
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include *.txt
include *.md
include Makefile
graft flojay
1 change: 1 addition & 0 deletions flojay/lloyd-yajl/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
Makefile
/build/
16 changes: 9 additions & 7 deletions flojay/lloyd-yajl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2011, Lloyd Hilaiel <[email protected]>
# Copyright (c) 2007-2014, Lloyd Hilaiel <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
Expand All @@ -17,8 +17,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(YetAnotherJSONParser C)

SET (YAJL_MAJOR 2)
SET (YAJL_MINOR 0)
SET (YAJL_MICRO 1)
SET (YAJL_MINOR 1)
SET (YAJL_MICRO 0)

SET (YAJL_DIST_NAME "yajl-${YAJL_MAJOR}.${YAJL_MINOR}.${YAJL_MICRO}")

Expand All @@ -28,7 +28,7 @@ ENDIF (NOT CMAKE_BUILD_TYPE)

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")

IF (WIN32)
IF (WIN32)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
ADD_DEFINITIONS(-DWIN32)
SET(linkFlags "/PDB:NONE /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF")
Expand Down Expand Up @@ -60,7 +60,7 @@ ELSE (WIN32)

SET(CMAKE_C_FLAGS_DEBUG "-DDEBUG -g")
SET(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O2 -Wuninitialized")
ENDIF (WIN32)
ENDIF (WIN32)


ADD_SUBDIRECTORY(src)
Expand All @@ -74,6 +74,8 @@ INCLUDE(YAJLDoc.cmake)

# a test target
ADD_CUSTOM_TARGET(test
./run_tests.sh ${CMAKE_CURRENT_BINARY_DIR}/test/yajl_test
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
./run_tests.sh ${CMAKE_CURRENT_BINARY_DIR}/test/parsing/yajl_test
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test/parsing)

ADD_CUSTOM_TARGET(test-api ${CMAKE_CURRENT_SOURCE_DIR}/test/api/run_tests.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test/api)
4 changes: 2 additions & 2 deletions flojay/lloyd-yajl/COPYING
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2007-2011, Lloyd Hilaiel <[email protected]>
Copyright (c) 2007-2014, Lloyd Hilaiel <[email protected]>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand All @@ -10,4 +10,4 @@ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
32 changes: 32 additions & 0 deletions flojay/lloyd-yajl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
2.1.0
* @nonodename, @patperry - fixed some compiler warnings
* @yep, @emaste - documentation improvements
* @sgravrock - build fix for NetBSD (and whenever sh != bash)
* @rotty, @brimstone3, @lloyd - allow client to reset generator
* @sgravrock - remove bash dependencies
* @lloyd - add api tests
* @rflynn - remove ruby dependency
* @cloderic - nmake install works on windows
* @shahbag - build fix for qnx
* @breese - debugging improvements
* @lloyd - json_verify supports -s flag for stream processing
* @lloyd - json_reformat supports -s flag for stream processing

2.0.4
* @jcekstrom - additional checking in integer parsing
* @jcekstrom - fix a bug in yajl_tree that would cause valid json integersto fail to parse
* @plaguemorin - fix a memory leak in yajl_tree (error strings were being leaked)
* @7AC - reset errno
* @ConradIrwin - include flags to reformatter to allow toggling of escape solidus option

2.0.3
* John Stamp generation of a pkgconfig file at build time.
* @robzuber bugfix in yajl_tree_get()
* @lloyd - fix for compilation on 64 bit windows

2.0.2
* lth fix typos in yajl_tree.h macros YAJL_IS_INTEGER and YAJL_IS_DOUBLE,
contributed by Artem S Vybornov.
* lth add #ifdef __cplusplus wrappers to yajl_tree to allow proper
usage from many populer C++ compilers.

2.0.1
* lth generator flag to allow client to specify they want
escaped solidi '/'. issue #28
Expand Down
4 changes: 2 additions & 2 deletions flojay/lloyd-yajl/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
**********************************************************************
This is YAJL 2, for the legacy version of YAJL. see
This is YAJL 2. For the legacy version of YAJL see
https://github.com/lloyd/yajl/tree/1.x
**********************************************************************

Expand All @@ -20,7 +20,7 @@ unable to find one that satisfies my requirements. Those are,
7. simple to use
8. tiny

Numbers 3, 5, 6, and 7 where particularly hard to find, and were what
Numbers 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 some
of the more important aspects of YAJL.

Expand Down
120 changes: 61 additions & 59 deletions flojay/lloyd-yajl/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
#!/bin/sh
#
# Copyright (c) 2007-2011, Lloyd Hilaiel <[email protected]>
# Copyright (c) 2007-2014, Lloyd Hilaiel <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
Expand All @@ -14,66 +14,68 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

require 'fileutils'
require 'optparse'
prefix="/usr/local"
if [ "$1" = "--help" ]
then
cat <<EOS
Usage: configure [options]
-p, --prefix PATH Set installation prefix
-h, --help Output usage summary
EOS
exit 0
fi
if [ "$1" = "-p" ]; then
if [ "$#" != 2 ]; then
./configure.sh --help
exit 1
fi
prefix="$2"
fi

prefix = "/usr/local"
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: configure [options]"
opts.on("-p", "--prefix PATH", "Set installation prefix") do |p|
prefix = p
end
opts.on_tail("-h", "--help", "Output usage summary") do
puts opts
exit
end
echo "== removing old build files"
rm -rf build
rm -f Makefile
echo "== running CMake in build directory"
mkdir build || exit 1
cd build || exit 1
cmake -DCMAKE_INSTALL_PREFIX="$prefix" .. ||
{
echo "The \"cmake\" program is required to configure yajl."
echo "It's available from most ports/packaging systems and http://cmake.org"
exit 1
}
cd ..

opts.parse!(ARGV)
end
echo "== Generating Makefile"
cat > ./Makefile <<EOS
.PHONY: all clean distclean install package test distro
all: distro doc test test-api

puts "== removing old build files"
FileUtils.rm_rf("build")
FileUtils.rm_f("Makefile")
puts "== running CMake in build directory"
FileUtils.mkdir("build")
FileUtils.cd("build") do
if (!system("cmake -DCMAKE_INSTALL_PREFIX='#{prefix}' .."))
puts "The \"cmake\" program is required to configure yajl. It's"
puts "available from most ports/packaging systems and http://cmake.org"
exit 1
end
end
distro:
@cd build && make

doc:
@cd build && make doc

test:
@cd build && make test

test-api:
@cd build && make test-api

clean:
@cd build && make clean

distclean:
@rm -rf Makefile build
@rm -f yajl-*.tgz

# now generate a Makefile
puts "== Generating Makefile"
File.open("Makefile", "w+") do |f|
f.puts ".PHONY: all clean distclean install package test distro"
f.puts "all: distro doc test"
f.puts
f.puts "distro:"
f.puts " @cd build && make"
f.puts
f.puts "doc:"
f.puts " @cd build && make doc"
f.puts
f.puts "test:"
f.puts " @cd build && make test"
f.puts
f.puts "clean:"
f.puts " @cd build && make clean"
f.puts
f.puts "distclean:"
f.puts " @rm -rf Makefile build"
f.puts " @rm -f yajl-*.tgz"
f.puts
f.puts "install: all"
f.puts " @cd build && make install"
f.puts
f.puts "package: all"
f.puts " @echo \"compressing to `basename build/yajl-*`.tgz\""
f.puts " @cd build && tar czf ../`basename yajl-*`.tgz yajl-*"
end
install: distro doc
@cd build && make install

puts "== Configured with installation prefix: #{prefix}"
package: all
@echo \"compressing to $(basename build/yajl-*).tgz\"
@cd build && tar czf ../$(basename yajl-*).tgz yajl-*
EOS

echo "== Configured with installation prefix: $prefix"
2 changes: 1 addition & 1 deletion flojay/lloyd-yajl/example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2011, Lloyd Hilaiel <[email protected]>
# Copyright (c) 2007-2014, Lloyd Hilaiel <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion flojay/lloyd-yajl/example/parse_config.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, Lloyd Hilaiel <[email protected]>
* Copyright (c) 2007-2014, Lloyd Hilaiel <[email protected]>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion flojay/lloyd-yajl/perf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2011, Lloyd Hilaiel <[email protected]>
# Copyright (c) 2007-2014, Lloyd Hilaiel <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion flojay/lloyd-yajl/perf/documents.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007-2011, Lloyd Hilaiel <[email protected]>
* Copyright (c) 2007-2014, Lloyd Hilaiel <[email protected]>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion flojay/lloyd-yajl/perf/documents.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007-2011, Lloyd Hilaiel <[email protected]>
* Copyright (c) 2007-2014, Lloyd Hilaiel <[email protected]>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion flojay/lloyd-yajl/perf/perftest.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007-2011, Lloyd Hilaiel <[email protected]>
* Copyright (c) 2007-2014, Lloyd Hilaiel <[email protected]>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down
12 changes: 8 additions & 4 deletions flojay/lloyd-yajl/reformatter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2007-2011, Lloyd Hilaiel <[email protected]>
# Copyright (c) 2007-2014, Lloyd Hilaiel <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -28,12 +28,16 @@ ADD_EXECUTABLE(json_reformat ${SRCS})

TARGET_LINK_LIBRARIES(json_reformat yajl_s)

# In some environments, we must explicitly link libm (like qnx,
# thanks @shahbag)
IF (NOT WIN32)
TARGET_LINK_LIBRARIES(json_reformat m)
ENDIF (NOT WIN32)

# copy the binary into the output directory
GET_TARGET_PROPERTY(binPath json_reformat LOCATION)

ADD_CUSTOM_COMMAND(TARGET json_reformat POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${binPath} ${binDir})

IF (NOT WIN32)
INSTALL(TARGETS json_reformat RUNTIME DESTINATION bin)
ENDIF ()
INSTALL(TARGETS json_reformat RUNTIME DESTINATION bin)
Loading