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

N A asteriskteam at digium.com
Thu Dec 22 08:20:17 CST 2022


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


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/34/19734/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/+/19734
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I8d0e28d763febf27b05801cdc83b73282aa6ee7a
Gerrit-Change-Number: 19734
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/20221222/cab6e302/attachment-0001.html>


More information about the asterisk-code-review mailing list