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
This commit is contained in:
parent
6dcb908025
commit
811584ded3
|
@ -592,6 +592,15 @@ struct ast_json *ast_json_object_get(struct ast_json *object, const char *key);
|
|||
*/
|
||||
#define ast_json_object_integer_get(object, key) ast_json_integer_get(ast_json_object_get(object, key))
|
||||
|
||||
/*!
|
||||
* \brief Get a double field from a JSON object.
|
||||
* \param object JSON object.
|
||||
* \param key Key of double field to look up.
|
||||
* \return Value of a JSON double.
|
||||
* \retval 0 if \a real is not a JSON real number.
|
||||
*/
|
||||
#define ast_json_object_real_get(object, key) ast_json_real_get(ast_json_object_get(object, key))
|
||||
|
||||
/*!
|
||||
* \brief Set a field in a JSON object.
|
||||
* \since 12.0.0
|
||||
|
|
Loading…
Reference in New Issue