summaryrefslogtreecommitdiff
path: root/yajl/yajl_tree.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-08-23 12:22:51 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-08-23 12:22:51 +0200
commitbc3604d9b226ac475a104cd8ae2ca2d1d4a27984 (patch)
treee796661f371a94a50edfdc693388bb911b253dfd /yajl/yajl_tree.h
parent509016be676f7915d635fa57144d2a441e3090ca (diff)
parentc0b89ac5bfb90835ef01573267020e42d4fe070c (diff)
Merge new upstream release
Diffstat (limited to 'yajl/yajl_tree.h')
-rwxr-xr-x[-rw-r--r--]yajl/yajl_tree.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/yajl/yajl_tree.h b/yajl/yajl_tree.h
index dc26183..d5cc286 100644..100755
--- 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)