From 51901aa2ed0a177ad7a2bca3e22be3c8d39bde25 Mon Sep 17 00:00:00 2001 From: Kinsey Moore Date: Thu, 9 Jan 2014 20:34:19 +0000 Subject: astobj2: Correct ao2_iterator opacity violations This corrects the ao2_iterator opacity violations in res_pjsip_session.c by adding a global function to get the number of elements inside the container hidden behind the iterator. (closes issue ASTERISK-23053) Review: https://reviewboard.asterisk.org/r/3111/ Reported by: Richard Mudgett ........ Merged revisions 405253 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405254 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/astobj2.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/asterisk/astobj2.h b/include/asterisk/astobj2.h index 9129c4b67..2a9be185a 100644 --- a/include/asterisk/astobj2.h +++ b/include/asterisk/astobj2.h @@ -1933,4 +1933,13 @@ void __ao2_cleanup_debug(void *obj, const char *file, int line, const char *func #endif void ao2_iterator_cleanup(struct ao2_iterator *iter); +/*! + * \brief Get a count of the iterated container objects. + * + * \param iter the iterator to query + * + * \retval The number of objects in the iterated container + */ +int ao2_iterator_count(struct ao2_iterator *iter); + #endif /* _ASTERISK_ASTOBJ2_H */ -- cgit v1.2.3