20 Commits
v2.8 ... v2.9

Author SHA1 Message Date
Petri Lehtinen
b02db47881 jansson 2.9 2016-09-18 14:35:05 +03:00
Petri Lehtinen
074bb3838f Update copyrights for 2016 2016-09-18 14:17:03 +03:00
Petri Lehtinen
3ba3b23fdc Merge branch '2.8' 2016-09-16 08:05:48 +03:00
Matthew Johnston
e9fcab08fb Add install targets to be optional 2016-09-16 08:05:13 +03:00
Yuriy Romanenko
bdaf7584db Added test files to .gitignore 2016-09-16 08:05:13 +03:00
Petri Lehtinen
889280c976 Don't include jansson_config.h in dist tarballs
Fixes #306
2016-09-16 08:02:26 +03:00
Petri Lehtinen
f9e7aa5eeb Merge pull request #305 from warmwaffles/master
Allow install targets to be optionally defined
2016-09-12 07:46:52 +03:00
Matthew Johnston
9258671924 Add install targets to be optional 2016-09-11 00:04:49 -05:00
Petri Lehtinen
a2bbb44d96 Merge pull request #303 from groman2/yr-dev
Added test files to .gitignore
2016-09-08 07:59:04 +03:00
Yuriy Romanenko
16b516f976 Added test files to .gitignore 2016-09-07 10:13:52 -07:00
Petri Lehtinen
86196250b8 Merge branch '2.8' 2016-09-01 07:07:57 +03:00
Petri Lehtinen
ada5372cff Fix another typo 2016-09-01 07:06:25 +03:00
Petri Lehtinen
f11c1b9466 Merge pull request #302 from yujunz/patch-1
Fix typo
2016-09-01 07:05:20 +03:00
Yujun Zhang
811a30691e Fix typo 2016-09-01 08:44:08 +08:00
Petri Lehtinen
7d1af52ab4 Merge pull request #301 from npmccallum/master
Add support for the cleanup attribute in GCC/Clang
2016-08-31 17:57:23 +03:00
Nathaniel McCallum
63b9fd0552 Add support for the cleanup attribute in GCC/Clang
The new json_auto_t macro allows easy declaration of json_t types that
automatically decrement at the end of their scope.
2016-08-31 08:57:57 -04:00
Petri Lehtinen
b45745118d doc: Fix json_error_t::position type
Fixes #300
2016-08-31 12:18:25 +03:00
Petri Lehtinen
0ffecdbade doc: Fix json_error_t::position type
Fixes #300
2016-08-31 12:17:03 +03:00
Petri Lehtinen
ab1ba69027 Set documentation version to 2.9-dev 2016-08-30 21:19:51 +03:00
Petri Lehtinen
a5610c8895 Set documentation version to 2.8 2016-08-30 21:19:13 +03:00
47 changed files with 128 additions and 52 deletions

26
CHANGES
View File

@@ -1,3 +1,25 @@
Version 2.9
===========
Released 2016-09-18
* New features:
- Add ``json_auto_t`` to automatically decref a value that goes out
of scope. Available only on GCC and Clang. (#301)
* Build:
- Fix CMake build (at least on Linux) by removing conflicting
jansson_config.h from the distribution (#306)
- Change CMake install target generation to be optional (#305)
* Documentation:
- Small documentation fixes.
Version 2.8
===========
@@ -7,7 +29,7 @@ Released 2016-08-30
- Always preserve insertion order of object items.
`json_object_iter()` and friends, `json_object_foreach()` and
json_dumps() and friends now always work in the insertion order of
`json_dumps()` and friends now always work in the insertion order of
object items (#293).
- Add `json_object_foreach_safe()` macro that allows
@@ -80,7 +102,7 @@ Released 2016-08-30
- Other minor fixes (#221, #248).
* Ohter changes:
* Other changes:
- List all unrecognized object keys when strict unpacking fails
(#263).

View File

@@ -86,10 +86,10 @@ endif (WIN32)
# set (JANSSON_VERSION "2.3.1")
# set (JANSSON_SOVERSION 2)
set(JANSSON_DISPLAY_VERSION "2.8")
set(JANSSON_DISPLAY_VERSION "2.9")
# This is what is required to match the same numbers as automake's
set(JANSSON_VERSION "4.8.0")
set(JANSSON_VERSION "4.9.0")
set(JANSSON_SOVERSION 4)
# for CheckFunctionKeywords
@@ -655,6 +655,8 @@ set_target_properties(jansson PROPERTIES PUBLIC_HEADER "${JANSSON_HDR_PUBLIC}")
#
# Install targets.
#
option(JANSSON_INSTALL "Generate installation target" ON)
if (JANSSON_INSTALL)
install(TARGETS jansson
EXPORT JanssonTargets
LIBRARY DESTINATION "${JANSSON_INSTALL_LIB_DIR}" COMPONENT lib
@@ -676,6 +678,7 @@ install(FILES
# Install exports for the install-tree.
install(EXPORT JanssonTargets
DESTINATION "${JANSSON_INSTALL_CMAKE_DIR}" COMPONENT dev)
endif()
# For use when simply using add_library from a parent project to build jansson.
set(JANSSON_LIBRARIES jansson CACHE STRING "Jansson libraries")

View File

@@ -1,4 +1,4 @@
Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2010-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2010-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
AC_PREREQ([2.60])
AC_INIT([jansson], [2.8], [petri@digip.org])
AC_INIT([jansson], [2.9], [petri@digip.org])
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE([1.10 foreign])

View File

@@ -253,6 +253,26 @@ other. Moreover, trying to encode the values with any of the encoding
functions will fail. The encoder detects circular references and
returns an error status.
Scope Dereferencing
-------------------
.. versionadded:: 2.9
It is possible to use the ``json_auto_t`` type to automatically
dereference a value at the end of a scope. For example::
void function(void) {
json_auto_t *value = NULL;
value = json_string("foo");
/* json_decref(value) is automatically called. */
}
This feature is only available on GCC and Clang. So if your project
has a portability requirement for other compilers, you should avoid
this feature.
Additionally, as always, care should be taken when passing values to
functions that steal references.
True, False and Null
====================
@@ -808,7 +828,7 @@ this struct.
*character column*, not the byte column, i.e. a multibyte UTF-8
character counts as one column.
.. member:: size_t position
.. member:: int position
The position in bytes from the start of the input. This is
useful for debugging Unicode encoding problems.

View File

@@ -41,14 +41,14 @@ master_doc = 'index'
# General information about the project.
project = u'Jansson'
copyright = u'2009-2014, Petri Lehtinen'
copyright = u'2009-2016, Petri Lehtinen'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2.8-dev'
version = '2.9-dev'
# The full version, including alpha/beta/rc tags.
release = version

View File

@@ -19,7 +19,7 @@
<description of the json_object function>
:copyright: Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
:copyright: Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
:license: MIT, see LICENSE for details.
"""

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,6 +1,7 @@
EXTRA_DIST = jansson.def
include_HEADERS = jansson.h jansson_config.h
include_HEADERS = jansson.h
nodist_include_HEADERS = jansson_config.h
lib_LTLIBRARIES = libjansson.la
libjansson_la_SOURCES = \
@@ -23,4 +24,4 @@ libjansson_la_SOURCES = \
libjansson_la_LDFLAGS = \
-no-undefined \
-export-symbols-regex '^json_' \
-version-info 12:0:8
-version-info 13:0:9

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
@@ -21,11 +21,11 @@ extern "C" {
/* version */
#define JANSSON_MAJOR_VERSION 2
#define JANSSON_MINOR_VERSION 8
#define JANSSON_MINOR_VERSION 9
#define JANSSON_MICRO_VERSION 0
/* Micro version is omitted if it's 0 */
#define JANSSON_VERSION "2.8"
#define JANSSON_VERSION "2.9"
/* Version as a 3-byte hex number, e.g. 0x010201 == 1.2.1. Use this
for numeric comparisons, e.g. #if JANSSON_VERSION_HEX >= ... */
@@ -112,6 +112,19 @@ void json_decref(json_t *json)
json_delete(json);
}
#if defined(__GNUC__) || defined(__clang__)
static JSON_INLINE
void json_decrefp(json_t **json)
{
if(json) {
json_decref(*json);
*json = NULL;
}
}
#define json_auto_t json_t __attribute__((cleanup(json_decrefp)))
#endif
/* error reporting */

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2010-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2011-2012 Basile Starynkevitch <basile@starynkevitch.net>
*
* Jansson is free software; you can redistribute it and/or modify it

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2011-2012 Graeme Smecher <graeme.smecher@mail.mcgill.ca>
*
* Jansson is free software; you can redistribute it and/or modify

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

4
test/.gitignore vendored
View File

@@ -15,3 +15,7 @@ suites/api/test_pack
suites/api/test_simple
suites/api/test_unpack
suites/api/test_load_callback
run-suites.log
run-suites.trs
test-suite.log

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
# Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
#
# Jansson is free software; you can redistribute it and/or modify
# it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
# Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
#
# Jansson is free software; you can redistribute it and/or modify
# it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
# Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
#
# Jansson is free software; you can redistribute it and/or modify
# it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2010-2012 Graeme Smecher <graeme.smecher@mail.mcgill.ca>
*
* Jansson is free software; you can redistribute it and/or modify

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
@@ -224,4 +224,17 @@ static void run_tests()
json_incref(value);
if(value->refcount != (size_t)-1)
fail("refcounting null works incorrectly");
#ifdef json_auto_t
value = json_string("foo");
{
json_auto_t *test = json_incref(value);
/* Use test so GCC doesn't complain it is unused. */
if(!json_is_string(test))
fail("value type check failed");
}
if(value->refcount != 1)
fail("automatic decrement failed");
json_decref(value);
#endif
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2010-2012 Graeme Smecher <graeme.smecher@mail.mcgill.ca>
*
* Jansson is free software; you can redistribute it and/or modify

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
* Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
# Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
#
# Jansson is free software; you can redistribute it and/or modify
# it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
# Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
#
# Jansson is free software; you can redistribute it and/or modify
# it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
# Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
#
# Jansson is free software; you can redistribute it and/or modify
# it under the terms of the MIT license. See LICENSE for details.

View File

@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
# Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
#
# Jansson is free software; you can redistribute it and/or modify
# it under the terms of the MIT license. See LICENSE for details.