Add json_boolean() macro
authorPetri Lehtinen <petri@digip.org>
Mon, 30 Jul 2012 04:20:36 +0000 (07:20 +0300)
committerPetri Lehtinen <petri@digip.org>
Mon, 30 Jul 2012 04:20:37 +0000 (07:20 +0300)
commitb6a1d8cfd4da10c9fd703a3c037d23603f3785ed
tree58173b027f8a25475ccc54ed7cfec3d6ce7898dd
parent52924288b922c1b0c439e2b1bbb3006093a6486b
Add json_boolean() macro

Mostly for symmetry reasons. Makes it easier e.g. to:

  int ok = 0;
  if(something)
      ok = 1;

  json_object_set_new(obj, "ok", json_boolean(ok));

Fixes #86.
doc/apiref.rst
src/jansson.h
test/suites/api/test_simple.c