[Asterisk-code-review] json.h: Add ast_json_object_real_get. (asterisk[master])

N A asteriskteam at digium.com
Fri Dec 16 12:27:49 CST 2022


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19719 )


Change subject: json.h: Add ast_json_object_real_get.
......................................................................

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
---
M include/asterisk/json.h
1 file changed, 24 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/19/19719/1

diff --git a/include/asterisk/json.h b/include/asterisk/json.h
index 9c42c3f..5edc3a9 100644
--- a/include/asterisk/json.h
+++ b/include/asterisk/json.h
@@ -593,6 +593,15 @@
 #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
  *

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19719
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I8d0e28d763febf27b05801cdc83b73282aa6ee7a
Gerrit-Change-Number: 19719
Gerrit-PatchSet: 1
Gerrit-Owner: N A <asterisk at phreaknet.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221216/afb22c19/attachment.html>


More information about the asterisk-code-review mailing list