<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7206">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Jenkins2: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">vectors: Add new macro and a string vector definition.<br><br>* AST_VECTOR_STEAL_ELEMENTS - steal the array of elements for use<br>  with non-vector code.<br>* struct ast_vector_string - a vector of 'char *'.<br><br>Change-Id: I104d1b204be03fccf67e02a195596adcb5ab1e42<br>---<br>M include/asterisk/vector.h<br>1 file changed, 23 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/include/asterisk/vector.h b/include/asterisk/vector.h<br>index 8270e25..2ee5e29 100644<br>--- a/include/asterisk/vector.h<br>+++ b/include/asterisk/vector.h<br>@@ -51,6 +51,9 @@<br> /*! \brief Integer vector definition */<br> AST_VECTOR(ast_vector_int, int);<br> <br>+/*! \brief String vector definition */<br>+AST_VECTOR(ast_vector_string, char *);<br>+<br> /*!<br>  * \brief Define a vector structure with a read/write lock<br>  *<br>@@ -91,6 +94,26 @@<br> })<br> <br> /*!<br>+ * \brief Steal the elements from a vector and reinitialize.<br>+ *<br>+ * \param vec Vector to operate on.<br>+ *<br>+ * This allows you to use vector.h to construct a list and use the<br>+ * data as a bare array.<br>+ *<br>+ * \note The stolen array must eventually be released using ast_free.<br>+ *<br>+ * \warning AST_VECTOR_SIZE and AST_VECTOR_MAX_SIZE are both reset<br>+ *          to 0.  If either are needed they must be saved to a local<br>+ *          variable before stealing the elements.<br>+ */<br>+#define AST_VECTOR_STEAL_ELEMENTS(vec) ({ \<br>+     typeof((vec)->elems) __elems = (vec)->elems; \<br>+ AST_VECTOR_INIT((vec), 0); \<br>+ (__elems); \<br>+})<br>+<br>+/*!<br>  * \brief Initialize a vector with a read/write lock<br>  *<br>  * If \a size is 0, then no space will be allocated until the vector is<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7206">change 7206</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7206"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I104d1b204be03fccf67e02a195596adcb5ab1e42 </div>
<div style="display:none"> Gerrit-Change-Number: 7206 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>