Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Official code repository for json-c. See the wiki for release tarballs for download.

Merge pull request #153 from LeSpocky/doc

improve doc for json_object_to_json_string()
latest commit ec4879ac5b
Eric Haszlakiewicz hawicz authored
Failed to load latest commit information.
tests Simplify the tests Makefile to avoid repeating the name of each test.
.gitignore Rename the "test_case" test to "test_charcase" to make it slightly le…
AUTHORS Add Jehiah and myself to the list of authors.
Android.configure.mk Add an Android-friendly build system
COPYING Add my copyright.
ChangeLog Bump versions up to 0.12.99 since a 0.12 release was just created.
Doxyfile Bump versions up to 0.12.99 since a 0.12 release was just created.
Makefile.am Patch to address the following issues:
Makefile.am.inc Patch to address the following issues:
NEWS Add an empty README file to placate autoconf.
README Add an empty README file to placate autoconf.
README-WIN32.html strndup is gone, remove it from the README file.
README.html Update README files with pointers to new github repo and googlegroups…
README.md Fix minor typo in README file.
RELEASE_CHECKLIST.txt Update the release checklist to include calculating the tarball check…
arraylist.c Move the json_min() and json_max() macros to json_util.h and mark eve…
arraylist.h Add new json_object_array_sort function
autogen.sh Default autogen.sh to not running configure, unless some command line…
bits.h Move the json_min() and json_max() macros to json_util.h and mark eve…
config.h.in Patch to address the following issues:
config.h.win32 Direct people to send bug reports to the json-c google group.
configure.ac Bump versions up to 0.12.99 since a 0.12 release was just created.
debug.c Eliminate the deprecated mc_abort() function and MC_ABORT macro.
debug.h Eliminate the deprecated mc_abort() function and MC_ABORT macro.
json-c-uninstalled.pc.in Re-add the "json" pkg-config file as a compatibility shim.
json-c.pc.in Modify install names for library and include files
json-c.vcproj * printbuf.c - C. Watford (christopher dot watford at gmail dot com)
json.h Move the json_min() and json_max() macros to json_util.h and mark eve…
json_c_version.c Add a json_c_version.h header (included from json.h), and several mac…
json_c_version.h Bump versions up to 0.12.99 since a 0.12 release was just created.
json_config.h.in Include json_inttypes.h in json_object.h since we use types like int3…
json_inttypes.h Fix the _MSC_VER check so it compiles on non-windows compilers. Issue#91
json_object.c Check for failures when allocating memory; return NULL and set errno=…
json_object.h Merge pull request #153 from LeSpocky/doc
json_object_iterator.c Since we already use a local json_bool type, replace any stdbool.h us…
json_object_iterator.h Issue #76: use old style comment to allow json_object_iterator.h to b…
json_object_private.h Add a json_set_serializer() function to allow the string output of a …
json_tokener.c Move the json_min() and json_max() macros to json_util.h and mark eve…
json_tokener.h Patch to address the following issues:
json_util.c Move the json_min() and json_max() macros to json_util.h and mark eve…
json_util.h Move the json_min() and json_max() macros to json_util.h and mark eve…
libjson.c Add an autoconf test to test whether the .section .gnu<warning>
linkhash.c Patch to address the following issues:
linkhash.h Patch to address the following issues:
math_compat.h Issue #103: allow Infinity and -Infinity to be parsed.
printbuf.c Move the json_min() and json_max() macros to json_util.h and mark eve…
printbuf.h Remove the "#undef PRINTBUF_DEBUG" from printbuf.h so it can be more …
random_seed.c Merge pull request #150 from ams-cs/master
random_seed.h Patch to address the following issues:

README.md

json-c

Building on Unix with git, gcc and autotools

Home page for json-c: https://github.com/json-c/json-c/wiki

Caution: do NOT use sources from svn.metaparadigm.com, they are old.

Prerequisites:

  • gcc, clang, or another C compiler
  • libtool

If you're not using a release tarball, you'll also need:

  • autoconf (autoreconf)
  • automake

Make sure you have a complete libtool install, including libtoolize.

json-c GitHub repo: https://github.com/json-c/json-c

$ git clone https://github.com/json-c/json-c.git
$ cd json-c
$ sh autogen.sh

followed by

$ ./configure
$ make
$ make install

To build and run the test programs:

$ make check

Linking to libjson-c

If your system has pkgconfig, then you can just add this to your makefile:

CFLAGS += $(shell pkg-config --cflags json-c)
LDFLAGS += $(shell pkg-config --libs json-c)

Without pkgconfig, you would do something like this:

JSON_C_DIR=/path/to/json_c/install
CFLAGS += -I$(JSON_C_DIR)/include/json-c
LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c
Something went wrong with that request. Please try again.