Skip to content

Commit

Permalink
Merge pull request json-c#283 from commodo/json_pointer
Browse files Browse the repository at this point in the history
json_pointer: add first revision based on RFC 6901
  • Loading branch information
hawicz authored Nov 4, 2016
2 parents d4899bd + ee7fc26 commit e8ce1db
Show file tree
Hide file tree
Showing 17 changed files with 676 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
/tests/test_set_value
/tests/test_util_file
/tests/test_visit
/tests/test_json_pointer
/tests/*.vg.out
/tests/*.log
/tests/*.trs
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)

set(JSON_C_HEADERS
./compat/strdup.h
./json.h
${CMAKE_CURRENT_BINARY_DIR}/include/config.h
./json_config.h
Expand All @@ -31,6 +32,7 @@ set(JSON_C_HEADERS
./json_inttypes.h
./json_object.h
./json_object_private.h
./json_pointer.h
./json_tokener.h
./json_util.h
./linkhash.h
Expand All @@ -43,6 +45,7 @@ set(JSON_C_SOURCES
./arraylist.c
./debug.c
./json_object.c
./json_pointer.c
./json_tokener.c
./json_util.c
./linkhash.c
Expand Down
3 changes: 3 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ libjson_cincludedir = $(includedir)/json-c
libjson_cinclude_HEADERS = \
arraylist.h \
bits.h \
compat/strdup.h \
debug.h \
json.h \
json_c_version.h \
Expand All @@ -26,6 +27,7 @@ libjson_cinclude_HEADERS = \
json_object.h \
json_object_iterator.h \
json_object_private.h \
json_pointer.h \
json_tokener.h \
json_util.h \
json_visit.h \
Expand All @@ -42,6 +44,7 @@ libjson_c_la_SOURCES = \
json_c_version.c \
json_object.c \
json_object_iterator.c \
json_pointer.c \
json_tokener.c \
json_util.c \
json_visit.c \
Expand Down
13 changes: 13 additions & 0 deletions compat/strdup.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef __STRDUP_H_COMPAT__
#define __STRDUP_H_COMPAT__

#include "../config.h"

#if !defined(HAVE_STRDUP) && defined(_MSC_VER)
/* MSC has the version as _strdup */
# define strdup _strdup
#elif !defined(HAVE_STRDUP)
# error You do not have strdup on your system.
#endif /* HAVE_STRDUP */

#endif /* __STRDUP_H_COMPAT__ */
9 changes: 9 additions & 0 deletions json-c.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ copy json_config.h.win32 json_config.h"/>
<File
RelativePath=".\json_object.c">
</File>
<File
RelativePath=".\json_pointer.c">
</File>
<File
RelativePath=".\json_tokener.c">
</File>
Expand All @@ -131,6 +134,9 @@ copy json_config.h.win32 json_config.h"/>
<File
RelativePath=".\bits.h">
</File>
<File
RelativePath=".\compat\strdup.h">
</File>
<File
RelativePath=".\debug.h">
</File>
Expand All @@ -140,6 +146,9 @@ copy json_config.h.win32 json_config.h"/>
<File
RelativePath=".\json_object_private.h">
</File>
<File
RelativePath=".\json_pointer.h">
</File>
<File
RelativePath=".\json_tokener.h">
</File>
Expand Down
5 changes: 4 additions & 1 deletion json-c.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ copy json_config.h.win32 json_config.h
<ClCompile Include="arraylist.c" />
<ClCompile Include="debug.c" />
<ClCompile Include="json_object.c" />
<ClCompile Include="json_pointer.c" />
<ClCompile Include="json_tokener.c" />
<ClCompile Include="json_util.c" />
<ClCompile Include="linkhash.c" />
Expand All @@ -141,10 +142,12 @@ copy json_config.h.win32 json_config.h
</ItemGroup>
<ItemGroup>
<ClInclude Include="arraylist.h" />
<ClInclude Include="compat\strdup.h" />
<ClInclude Include="debug.h" />
<ClInclude Include="json_inttypes.h" />
<ClInclude Include="json_object.h" />
<ClInclude Include="json_object_private.h" />
<ClInclude Include="json_pointer.h" />
<ClInclude Include="json_tokener.h" />
<ClInclude Include="json_util.h" />
<ClInclude Include="linkhash.h" />
Expand All @@ -162,4 +165,4 @@ copy json_config.h.win32 json_config.h
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
11 changes: 10 additions & 1 deletion json-c.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<ClCompile Include="json_object.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="json_pointer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="json_tokener.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand All @@ -47,6 +50,9 @@
<ClInclude Include="arraylist.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="compat\strdup.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="debug.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand All @@ -56,6 +62,9 @@
<ClInclude Include="json_object_private.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="json_pointer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="json_tokener.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down Expand Up @@ -87,4 +96,4 @@
<None Include="README-WIN32.html" />
<None Include="README.html" />
</ItemGroup>
</Project>
</Project>
1 change: 1 addition & 0 deletions json.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ extern "C" {
#include "arraylist.h"
#include "json_util.h"
#include "json_object.h"
#include "json_pointer.h"
#include "json_tokener.h"
#include "json_object_iterator.h"
#include "json_c_version.h"
Expand Down
8 changes: 1 addition & 7 deletions json_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@
#include "json_object_private.h"
#include "json_util.h"
#include "math_compat.h"

#if !defined(HAVE_STRDUP) && defined(_MSC_VER)
/* MSC has the version as _strdup */
# define strdup _strdup
#elif !defined(HAVE_STRDUP)
# error You do not have strdup on your system.
#endif /* HAVE_STRDUP */
#include "compat/strdup.h"

#if !defined(HAVE_SNPRINTF) && defined(_MSC_VER)
/* MSC has the version as _snprintf */
Expand Down
Loading

0 comments on commit e8ce1db

Please sign in to comment.