Skip to content

Commit fb8ee4f

Browse files
InterLinked1Friendly Automation
authored and
Friendly Automation
committed
json.h: Add ast_json_object_real_get.
json.h contains macros to get a string and an integer from a JSON object. However, the macro to do this for JSON reals is missing. This adds that. ASTERISK-30361 #close Change-Id: I8d0e28d763febf27b05801cdc83b73282aa6ee7a
1 parent 82d5239 commit fb8ee4f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/asterisk/json.h

+9
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,15 @@ struct ast_json *ast_json_object_get(struct ast_json *object, const char *key);
592592
*/
593593
#define ast_json_object_integer_get(object, key) ast_json_integer_get(ast_json_object_get(object, key))
594594

595+
/*!
596+
* \brief Get a double field from a JSON object.
597+
* \param object JSON object.
598+
* \param key Key of double field to look up.
599+
* \return Value of a JSON double.
600+
* \retval 0 if \a real is not a JSON real number.
601+
*/
602+
#define ast_json_object_real_get(object, key) ast_json_real_get(ast_json_object_get(object, key))
603+
595604
/*!
596605
* \brief Set a field in a JSON object.
597606
* \since 12.0.0

0 commit comments

Comments
 (0)