From c0b89ac5bfb90835ef01573267020e42d4fe070c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 23 Aug 2015 12:17:05 +0200 Subject: Imported Upstream version 1.8.0 --- yajl/yajl_tree.h | 3 +++ 1 file changed, 3 insertions(+) mode change 100644 => 100755 yajl/yajl_tree.h (limited to 'yajl/yajl_tree.h') diff --git a/yajl/yajl_tree.h b/yajl/yajl_tree.h old mode 100644 new mode 100755 index dc26183..d5cc286 --- a/yajl/yajl_tree.h +++ b/yajl/yajl_tree.h @@ -165,6 +165,9 @@ yajl_val yajl_tree_get_first(yajl_val n, const char *key, yajl_type type); * or NULL if the value is not a string. */ #define YAJL_GET_STRING(v) (YAJL_IS_STRING(v) ? (v)->u.string : NULL) +/* Same as above but return an allocated string or NULL */ +#define YAJL_GET_STRINGDUP(v) (YAJL_IS_STRING(v) ? strdup((v)->u.string) : NULL) + /** Get the string representation of a number. You should check type first, * perhaps using YAJL_IS_NUMBER */ #define YAJL_GET_NUMBER(v) ((v)->u.number.r) -- cgit v1.2.3