jansson.h (jansson-2.13.1.tar.bz2) | : | jansson.h (jansson-2.14.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
#include "jansson_config.h" | #include "jansson_config.h" | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
/* version */ | /* version */ | |||
#define JANSSON_MAJOR_VERSION 2 | #define JANSSON_MAJOR_VERSION 2 | |||
#define JANSSON_MINOR_VERSION 13 | #define JANSSON_MINOR_VERSION 14 | |||
#define JANSSON_MICRO_VERSION 1 | #define JANSSON_MICRO_VERSION 0 | |||
/* Micro version is omitted if it's 0 */ | /* Micro version is omitted if it's 0 */ | |||
#define JANSSON_VERSION "2.13.1" | #define JANSSON_VERSION "2.14" | |||
/* Version as a 3-byte hex number, e.g. 0x010201 == 1.2.1. Use this | /* Version as a 3-byte hex number, e.g. 0x010201 == 1.2.1. Use this | |||
for numeric comparisons, e.g. #if JANSSON_VERSION_HEX >= ... */ | for numeric comparisons, e.g. #if JANSSON_VERSION_HEX >= ... */ | |||
#define JANSSON_VERSION_HEX \ | #define JANSSON_VERSION_HEX \ | |||
((JANSSON_MAJOR_VERSION << 16) | (JANSSON_MINOR_VERSION << 8) | \ | ((JANSSON_MAJOR_VERSION << 16) | (JANSSON_MINOR_VERSION << 8) | \ | |||
(JANSSON_MICRO_VERSION << 0)) | (JANSSON_MICRO_VERSION << 0)) | |||
/* If __atomic or __sync builtins are available the library is thread | /* If __atomic or __sync builtins are available the library is thread | |||
* safe for all read-only functions plus reference counting. */ | * safe for all read-only functions plus reference counting. */ | |||
#if JSON_HAVE_ATOMIC_BUILTINS || JSON_HAVE_SYNC_BUILTINS | #if JSON_HAVE_ATOMIC_BUILTINS || JSON_HAVE_SYNC_BUILTINS | |||
skipping to change at line 191 | skipping to change at line 191 | |||
static JSON_INLINE enum json_error_code json_error_code(const json_error_t *e) { | static JSON_INLINE enum json_error_code json_error_code(const json_error_t *e) { | |||
return (enum json_error_code)e->text[JSON_ERROR_TEXT_LENGTH - 1]; | return (enum json_error_code)e->text[JSON_ERROR_TEXT_LENGTH - 1]; | |||
} | } | |||
/* getters, setters, manipulation */ | /* getters, setters, manipulation */ | |||
void json_object_seed(size_t seed); | void json_object_seed(size_t seed); | |||
size_t json_object_size(const json_t *object); | size_t json_object_size(const json_t *object); | |||
json_t *json_object_get(const json_t *object, const char *key) | json_t *json_object_get(const json_t *object, const char *key) | |||
JANSSON_ATTRS((warn_unused_result)); | JANSSON_ATTRS((warn_unused_result)); | |||
json_t *json_object_getn(const json_t *object, const char *key, size_t key_len) | ||||
JANSSON_ATTRS((warn_unused_result)); | ||||
int json_object_set_new(json_t *object, const char *key, json_t *value); | int json_object_set_new(json_t *object, const char *key, json_t *value); | |||
int json_object_setn_new(json_t *object, const char *key, size_t key_len, json_t *value); | ||||
int json_object_set_new_nocheck(json_t *object, const char *key, json_t *value); | int json_object_set_new_nocheck(json_t *object, const char *key, json_t *value); | |||
int json_object_setn_new_nocheck(json_t *object, const char *key, size_t key_len | ||||
, | ||||
json_t *value); | ||||
int json_object_del(json_t *object, const char *key); | int json_object_del(json_t *object, const char *key); | |||
int json_object_deln(json_t *object, const char *key, size_t key_len); | ||||
int json_object_clear(json_t *object); | int json_object_clear(json_t *object); | |||
int json_object_update(json_t *object, json_t *other); | int json_object_update(json_t *object, json_t *other); | |||
int json_object_update_existing(json_t *object, json_t *other); | int json_object_update_existing(json_t *object, json_t *other); | |||
int json_object_update_missing(json_t *object, json_t *other); | int json_object_update_missing(json_t *object, json_t *other); | |||
int json_object_update_recursive(json_t *object, json_t *other); | int json_object_update_recursive(json_t *object, json_t *other); | |||
void *json_object_iter(json_t *object); | void *json_object_iter(json_t *object); | |||
void *json_object_iter_at(json_t *object, const char *key); | void *json_object_iter_at(json_t *object, const char *key); | |||
void *json_object_key_to_iter(const char *key); | void *json_object_key_to_iter(const char *key); | |||
void *json_object_iter_next(json_t *object, void *iter); | void *json_object_iter_next(json_t *object, void *iter); | |||
const char *json_object_iter_key(void *iter); | const char *json_object_iter_key(void *iter); | |||
size_t json_object_iter_key_len(void *iter); | ||||
json_t *json_object_iter_value(void *iter); | json_t *json_object_iter_value(void *iter); | |||
int json_object_iter_set_new(json_t *object, void *iter, json_t *value); | int json_object_iter_set_new(json_t *object, void *iter, json_t *value); | |||
#define json_object_foreach(object, key, value) \ | #define json_object_foreach(object, key, value) \ | |||
for (key = json_object_iter_key(json_object_iter(object)); \ | for (key = json_object_iter_key(json_object_iter(object)); \ | |||
key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ | key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ | |||
key = json_object_iter_key( \ | key = json_object_iter_key( \ | |||
json_object_iter_next(object, json_object_key_to_iter(key)))) | json_object_iter_next(object, json_object_key_to_iter(key)))) | |||
#define json_object_keylen_foreach(object, key, key_len, value) | ||||
\ | ||||
for (key = json_object_iter_key(json_object_iter(object)), | ||||
\ | ||||
key_len = json_object_iter_key_len(json_object_key_to_iter(key)); | ||||
\ | ||||
key && (value = json_object_iter_value(json_object_key_to_iter(key))); | ||||
\ | ||||
key = json_object_iter_key( | ||||
\ | ||||
json_object_iter_next(object, json_object_key_to_iter(key))), | ||||
\ | ||||
key_len = json_object_iter_key_len(json_object_key_to_iter(key))) | ||||
#define json_object_foreach_safe(object, n, key, value) \ | #define json_object_foreach_safe(object, n, key, value) \ | |||
for (key = json_object_iter_key(json_object_iter(object)), \ | for (key = json_object_iter_key(json_object_iter(object)), \ | |||
n = json_object_iter_next(object, json_object_key_to_iter(key)); \ | n = json_object_iter_next(object, json_object_key_to_iter(key)); \ | |||
key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ | key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ | |||
key = json_object_iter_key(n), \ | key = json_object_iter_key(n), \ | |||
n = json_object_iter_next(object, json_object_key_to_iter(key))) | n = json_object_iter_next(object, json_object_key_to_iter(key))) | |||
#define json_object_keylen_foreach_safe(object, n, key, key_len, value) | ||||
\ | ||||
for (key = json_object_iter_key(json_object_iter(object)), | ||||
\ | ||||
n = json_object_iter_next(object, json_object_key_to_iter(key)), | ||||
\ | ||||
key_len = json_object_iter_key_len(json_object_key_to_iter(key)); | ||||
\ | ||||
key && (value = json_object_iter_value(json_object_key_to_iter(key))); | ||||
\ | ||||
key = json_object_iter_key(n), key_len = json_object_iter_key_len(n), | ||||
\ | ||||
n = json_object_iter_next(object, json_object_key_to_iter(key))) | ||||
#define json_array_foreach(array, index, value) \ | #define json_array_foreach(array, index, value) \ | |||
for (index = 0; \ | for (index = 0; \ | |||
index < json_array_size(array) && (value = json_array_get(array, index) ); \ | index < json_array_size(array) && (value = json_array_get(array, index) ); \ | |||
index++) | index++) | |||
static JSON_INLINE int json_object_set(json_t *object, const char *key, json_t * value) { | static JSON_INLINE int json_object_set(json_t *object, const char *key, json_t * value) { | |||
return json_object_set_new(object, key, json_incref(value)); | return json_object_set_new(object, key, json_incref(value)); | |||
} | } | |||
static JSON_INLINE int json_object_setn(json_t *object, const char *key, size_t | ||||
key_len, | ||||
json_t *value) { | ||||
return json_object_setn_new(object, key, key_len, json_incref(value)); | ||||
} | ||||
static JSON_INLINE int json_object_set_nocheck(json_t *object, const char *key, | static JSON_INLINE int json_object_set_nocheck(json_t *object, const char *key, | |||
json_t *value) { | json_t *value) { | |||
return json_object_set_new_nocheck(object, key, json_incref(value)); | return json_object_set_new_nocheck(object, key, json_incref(value)); | |||
} | } | |||
static JSON_INLINE int json_object_setn_nocheck(json_t *object, const char *key, | ||||
size_t key_len, json_t *value) { | ||||
return json_object_setn_new_nocheck(object, key, key_len, json_incref(value) | ||||
); | ||||
} | ||||
static JSON_INLINE int json_object_iter_set(json_t *object, void *iter, json_t * value) { | static JSON_INLINE int json_object_iter_set(json_t *object, void *iter, json_t * value) { | |||
return json_object_iter_set_new(object, iter, json_incref(value)); | return json_object_iter_set_new(object, iter, json_incref(value)); | |||
} | } | |||
static JSON_INLINE int json_object_update_new(json_t *object, json_t *other) { | static JSON_INLINE int json_object_update_new(json_t *object, json_t *other) { | |||
int ret = json_object_update(object, other); | int ret = json_object_update(object, other); | |||
json_decref(other); | json_decref(other); | |||
return ret; | return ret; | |||
} | } | |||
End of changes. 11 change blocks. | ||||
3 lines changed or deleted | 51 lines changed or added |