Sophie

Sophie

distrib > CentOS > 6 > i386 > media > updates > by-pkgid > 5d98b2995a46d456a9243853c7259619 > files > 26

libcollection-devel-0.5.0-28.el6_0.2.i686.rpm

<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libcollection: Item management</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.1 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Item management<br/>
<small>
[<a class="el" href="group__collection.html">COLLECTION interface</a>]</small>
</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Modules</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__compflags.html">Comparison flags</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__outflags.html">Comparison results flags</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dispvalues.html">Disposition constants</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__insflags.html">Flags used in insert item functions</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__modwrap.html">Item modification wrappers</a></td></tr>
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#ga211ec338c8d21d9a4242c6387a9cb370">col_get_item_property</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *ci, int *property_len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get item property.  <a href="#ga211ec338c8d21d9a4242c6387a9cb370"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#gafa211925f7de1da5b72fa6ffde01332d">col_get_item_type</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *ci)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get item type.  <a href="#gafa211925f7de1da5b72fa6ffde01332d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#ga940c49325d6d532b222fe1e8143617d6">col_get_item_length</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *ci)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get value length from the item.  <a href="#ga940c49325d6d532b222fe1e8143617d6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#ga3445065760480b4156296d5850cf1261">col_get_item_data</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *ci)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get property value from the item.  <a href="#ga3445065760480b4156296d5850cf1261"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint64_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#gacf4c9e0a0bb6bc36db34c031bd15daa4">col_get_item_hash</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *ci)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get hash value from the item.  <a href="#gacf4c9e0a0bb6bc36db34c031bd15daa4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint64_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#gaa4d91994856e4cb24b0a2d9397c5bd0c">col_make_hash</a> (const char *string, int sub_len, int *length)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calculate hash value for a string.  <a href="#gaa4d91994856e4cb24b0a2d9397c5bd0c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#gabea52969bb67682c91f7b694e8cace5a">col_compare_items</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *first, struct <a class="el" href="structcollection__item.html">collection_item</a> *second, unsigned in_flags, unsigned *out_flags)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compare two items.  <a href="#gabea52969bb67682c91f7b694e8cace5a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#gaffce843dbd40ba630f85110c2b34b2f7">col_modify_item</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *item, const char *property, int type, const void *data, int length)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Modify any item element.  <a href="#gaffce843dbd40ba630f85110c2b34b2f7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#ga74a69184405c8af4506274571af117c8">col_extract_item</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *ci, const char *subcollection, int disposition, const char *refprop, int idx, int type, struct <a class="el" href="structcollection__item.html">collection_item</a> **ret_ref)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Extract item from the collection.  <a href="#ga74a69184405c8af4506274571af117c8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#ga37b47831decd9f22ed11d864adaca93a">col_extract_item_from_current</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *ci, int disposition, const char *refprop, int idx, int type, struct <a class="el" href="structcollection__item.html">collection_item</a> **ret_ref)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Extract item from the current collection.  <a href="#ga37b47831decd9f22ed11d864adaca93a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#ga771d46d58ced79e7cd4804b5c01f7971">col_remove_item</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *ci, const char *subcollection, int disposition, const char *refprop, int idx, int type)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove item from the collection.  <a href="#ga771d46d58ced79e7cd4804b5c01f7971"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#ga7efbfc13c34701a8a40f180c82f4c7ec">col_remove_item_from_current</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *ci, int disposition, const char *refprop, int idx, int type)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove item from the current collection.  <a href="#ga7efbfc13c34701a8a40f180c82f4c7ec"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#ga3afb65bde3bbd68c9669f7d3ea9d78b3">col_insert_item</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *ci, const char *subcollection, struct <a class="el" href="structcollection__item.html">collection_item</a> *item, int disposition, const char *refprop, int idx, unsigned flags)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Insert item to the collection.  <a href="#ga3afb65bde3bbd68c9669f7d3ea9d78b3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#gae577b1c49fe867a7da598c869ab45b4e">col_insert_item_into_current</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *ci, struct <a class="el" href="structcollection__item.html">collection_item</a> *item, int disposition, const char *refprop, int idx, unsigned flags)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Insert item to the current collection.  <a href="#gae577b1c49fe867a7da598c869ab45b4e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__getitem.html#ga0342fca1c1b2c00c3b058f3c40e6c8fe">col_delete_item</a> (struct <a class="el" href="structcollection__item.html">collection_item</a> *item)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Delete extracted item.  <a href="#ga0342fca1c1b2c00c3b058f3c40e6c8fe"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Group of functions that allows retrieving individual elements of the <a class="el" href="structcollection__item.html">collection_item</a> hiding the internal implementation. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gabea52969bb67682c91f7b694e8cace5a"></a><!-- doxytag: member="collection.h::col_compare_items" ref="gabea52969bb67682c91f7b694e8cace5a" args="(struct collection_item *first, struct collection_item *second, unsigned in_flags, unsigned *out_flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int col_compare_items </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>second</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>in_flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned *&nbsp;</td>
          <td class="paramname"> <em>out_flags</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Compare two items. </p>
<p>The second item is evaluated against the first. Function returns 0 if two items are the same and non-zero otherwise. The <a class="el" href="group__compflags.html">in_flags</a> is a bit mask that defines how the items should be compared.</p>
<p>If items are different they might be sorted following some order. For example one can order items by name but not by type. If the result of the function is non-zero the <a class="el" href="group__outflags.html">out_flags</a> (if provided) will be set to indicate if the second item is greater then the first.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>first</em>&nbsp;</td><td>First item to compare. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>second</em>&nbsp;</td><td>Second item to compare. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>in_flags</em>&nbsp;</td><td>See <a class="el" href="group__compflags.html">comparison flags</a>. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>out_flags</em>&nbsp;</td><td>See <a class="el" href="group__outflags.html">output flags</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if items are the same and nonzero otherwise. </dd></dl>

</div>
</div>
<a class="anchor" id="ga0342fca1c1b2c00c3b058f3c40e6c8fe"></a><!-- doxytag: member="collection.h::col_delete_item" ref="ga0342fca1c1b2c00c3b058f3c40e6c8fe" args="(struct collection_item *item)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void col_delete_item </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>item</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Delete extracted item. </p>
<p><b>NEVER</b> use this function to delete an item that was not previously extracted from the collection.</p>
<p>There is currently no function to create an item aside and then insert it into the collection so the col_delete_item has only one use. In future this may change.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>item</em>&nbsp;</td><td>Item to delete. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga74a69184405c8af4506274571af117c8"></a><!-- doxytag: member="collection.h::col_extract_item" ref="ga74a69184405c8af4506274571af117c8" args="(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, int type, struct collection_item **ret_ref)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int col_extract_item </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>ci</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>subcollection</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>disposition</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>refprop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> **&nbsp;</td>
          <td class="paramname"> <em>ret_ref</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Extract item from the collection. </p>
<p>Function to find and remove an item from the collection. Function does not destroy the item instead it returns a reference to the item so it can be used later and inserted back into this or other collection. The function assumes that the caller knows the collection the property is stored in. The header of the collection can't be extracted with this function but the reference to the collection can.</p>
<p>Function allows specifying relative position of the item in the collection. One can specify that he wants to extract an item that is first in the collection or last, or after other item in the collection. For more details see parameter definitions.</p>
<p>After extracting the item from the collection the caller has to either insert it back into some collection using <a class="el" href="group__getitem.html#ga3afb65bde3bbd68c9669f7d3ea9d78b3">col_insert_item</a> or delete it using <a class="el" href="group__getitem.html#ga0342fca1c1b2c00c3b058f3c40e6c8fe">col_delete_item</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ci</em>&nbsp;</td><td>Collection object. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>subcollection</em>&nbsp;</td><td>Name of the sub collection to extract item from. If NULL, the top level collection is used. One can use "foo!bar!baz" notation to identify the sub collection. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>disposition</em>&nbsp;</td><td>Constant that controls how the relative position of the item to extract is determined. For more information see <a class="el" href="group__dispvalues.html">disposition constants</a>. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>refprop</em>&nbsp;</td><td>Name of the property to relate to. This can be used to specify that function should extract next item after the item with this name. Leave NULL if the disposition you are using does not relate to an item in the collection. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>idx</em>&nbsp;</td><td>Index of the property to extract. Useful for multi-value properties where several properties have same name in a row. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>type</em>&nbsp;</td><td>Type filter. Only the item of the matching type will be used. It can be a bit mask of more than one type. Use 0 if you do not need to filter by type. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>ret_ref</em>&nbsp;</td><td>Variable will receive the value of the pointer to the extracted item.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 - Item was successfully extracted. </dd>
<dd>
ENOMEM - No memory. </dd>
<dd>
EINVAL - The value of some of the arguments is invalid. </dd>
<dd>
ENOENT - Sub collection is not found. The position can't be determined. For example extracting next item after item with name "foo" will cause this error if item "foo" is the last item in the collection. There are other cases when this error can be returned but the common theme is that something was not found. </dd>
<dd>
ENOSYS Unknown disposition value. </dd></dl>

</div>
</div>
<a class="anchor" id="ga37b47831decd9f22ed11d864adaca93a"></a><!-- doxytag: member="collection.h::col_extract_item_from_current" ref="ga37b47831decd9f22ed11d864adaca93a" args="(struct collection_item *ci, int disposition, const char *refprop, int idx, int type, struct collection_item **ret_ref)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int col_extract_item_from_current </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>ci</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>disposition</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>refprop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> **&nbsp;</td>
          <td class="paramname"> <em>ret_ref</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Extract item from the current collection. </p>
<p>Function is similar to the <a class="el" href="group__getitem.html#ga74a69184405c8af4506274571af117c8">col_extract_item</a>. It acts exactly the same as <a class="el" href="group__getitem.html#ga74a69184405c8af4506274571af117c8">col_extract_item</a> when the subcollection parameter of the <a class="el" href="group__getitem.html#ga74a69184405c8af4506274571af117c8">col_extract_item</a> is set to NULL.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ci</em>&nbsp;</td><td>Collection object. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>disposition</em>&nbsp;</td><td>Constant that controls how the relative position of the item to extract is determined. For more information see <a class="el" href="group__dispvalues.html">disposition constants</a>. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>refprop</em>&nbsp;</td><td>Name of the property to relate to. This can be used to specify that function should extract next item after the item with this name. Leave NULL if the disposition you are using does not relate to an item in the collection. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>idx</em>&nbsp;</td><td>Index of the property to extract. Useful for multi-value properties where several properties have same name in a row. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>type</em>&nbsp;</td><td>Type filter. Only the item of the matching type will be used. It can be a bit mask of more than one type. Use 0 if you do not need to filter by type. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>ret_ref</em>&nbsp;</td><td>Variable will receive the value of the pointer to the extracted item.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 - Item was successfully extracted. </dd>
<dd>
ENOMEM - No memory. </dd>
<dd>
EINVAL - The value of some of the arguments is invalid. </dd>
<dd>
ENOENT - Sub collection is not found. The position can't be determined. For example extracting next item after item with name "foo" will cause this error if item "foo" is the last item in the collection. There are other cases when this error can be returned but the common theme is that something was not found. </dd>
<dd>
ENOSYS Unknown disposition value. </dd></dl>

</div>
</div>
<a class="anchor" id="ga3445065760480b4156296d5850cf1261"></a><!-- doxytag: member="collection.h::col_get_item_data" ref="ga3445065760480b4156296d5850cf1261" args="(struct collection_item *ci)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* col_get_item_data </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>ci</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get property value from the item. </p>
<p>Get property value from the item.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ci</em>&nbsp;</td><td>Item to get value from. If item is invalid the function will cause a segment violation.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Property value. </dd></dl>

</div>
</div>
<a class="anchor" id="gacf4c9e0a0bb6bc36db34c031bd15daa4"></a><!-- doxytag: member="collection.h::col_get_item_hash" ref="gacf4c9e0a0bb6bc36db34c031bd15daa4" args="(struct collection_item *ci)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint64_t col_get_item_hash </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>ci</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get hash value from the item. </p>
<p>Get hash value from the item. The hash value is 64-bit hash created from the property name. It is done to optimize the searches.</p>
<p>This function is exposed for some corner cases that require low level operations, for example for custom search callbacks to take advantage of the internal hashes.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ci</em>&nbsp;</td><td>Item to get hash from. If item is invalid the function will cause a segment violation.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Hash value. </dd></dl>

</div>
</div>
<a class="anchor" id="ga940c49325d6d532b222fe1e8143617d6"></a><!-- doxytag: member="collection.h::col_get_item_length" ref="ga940c49325d6d532b222fe1e8143617d6" args="(struct collection_item *ci)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int col_get_item_length </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>ci</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get value length from the item. </p>
<p>Get value length from the item. For strings this includes NULL terminating zero.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ci</em>&nbsp;</td><td>Item to get value length from. If item is invalid the function will cause a segment violation.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Value length. </dd></dl>

</div>
</div>
<a class="anchor" id="ga211ec338c8d21d9a4242c6387a9cb370"></a><!-- doxytag: member="collection.h::col_get_item_property" ref="ga211ec338c8d21d9a4242c6387a9cb370" args="(struct collection_item *ci, int *property_len)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* col_get_item_property </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>ci</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>property_len</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get item property. </p>
<p>Get name of the property from the item. If the item is a header the name of the property is the name of the collection. The element that denotes the collection header has type <a class="el" href="group__coltypes.html#ga0ff21ddd44cb076df3f7ec73f403d0fe">COL_TYPE_COLLECTION</a>. Optionally the property length can be retrieved too.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ci</em>&nbsp;</td><td>Item to get property from. If item is invalid the function will cause a segment violation. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>property_len</em>&nbsp;</td><td>If not NULL the variable will receive the length of the property not counting terminating 0.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Property name. </dd></dl>

</div>
</div>
<a class="anchor" id="gafa211925f7de1da5b72fa6ffde01332d"></a><!-- doxytag: member="collection.h::col_get_item_type" ref="gafa211925f7de1da5b72fa6ffde01332d" args="(struct collection_item *ci)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int col_get_item_type </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>ci</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get item type. </p>
<p>Get type from the item.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ci</em>&nbsp;</td><td>Item to get type from. If item is invalid the function will cause a segment violation.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Item type. </dd></dl>

</div>
</div>
<a class="anchor" id="ga3afb65bde3bbd68c9669f7d3ea9d78b3"></a><!-- doxytag: member="collection.h::col_insert_item" ref="ga3afb65bde3bbd68c9669f7d3ea9d78b3" args="(struct collection_item *ci, const char *subcollection, struct collection_item *item, int disposition, const char *refprop, int idx, unsigned flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int col_insert_item </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>ci</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>subcollection</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>item</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>disposition</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>refprop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>flags</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Insert item to the collection. </p>
<p><b>WARNING:</b> Only use this function to insert items that were extracted using <a class="el" href="group__getitem.html#ga74a69184405c8af4506274571af117c8">col_extract_item</a> or <a class="el" href="group__getitem.html#ga37b47831decd9f22ed11d864adaca93a">col_extract_item_from_current</a>. <b>NEVER</b> use it with items that were returned by:</p>
<ul>
<li><a class="el" href="group__collection.html#gaca7cf872ff4092f06d300cfd6f32689f">col_get_item</a></li>
<li><a class="el" href="group__addproperty.html">add property</a> functions</li>
<li><a class="el" href="group__addprop__withref.html">add property with reference</a> functions</li>
<li><a class="el" href="group__insertproperty.html">instert property</a> functions.</li>
</ul>
<p>The fundamental difference is that when you extracted item using <a class="el" href="group__getitem.html#ga74a69184405c8af4506274571af117c8" title="Extract item from the collection.">col_extract_item()</a> it stops to be managed by a collection. With such item you can:</p>
<ul>
<li>a) Insert this item into another (or same) collection</li>
<li>b) Get item information using corresponding item management functions.</li>
<li>c) Destroy item using <a class="el" href="group__getitem.html#ga0342fca1c1b2c00c3b058f3c40e6c8fe" title="Delete extracted item.">col_delete_item()</a>.</li>
</ul>
<p>You are required to do either a) or c) with such item.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ci</em>&nbsp;</td><td>Collection object. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>subcollection</em>&nbsp;</td><td>Name of the sub collection to insert item into. If NULL, the top level collection is used. One can use "foo!bar!baz" notation to identify the sub collection. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>item</em>&nbsp;</td><td>Item to insert. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>disposition</em>&nbsp;</td><td>Constant that controls where to insert the item. For more information see <a class="el" href="group__dispvalues.html">disposition constants</a>. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>refprop</em>&nbsp;</td><td>Name of the property to relate to. This can be used to specify that function should insert the item after the item with this name. Leave NULL if the disposition you are using does not relate to an item in the collection. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>idx</em>&nbsp;</td><td>Index of the property to insert. Useful for multi-value properties where several properties have same name in a row. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>flags</em>&nbsp;</td><td>Flags that control naming issues. See <a class="el" href="group__insflags.html">insert flags</a> for more details.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 - Item was successfully extracted. </dd>
<dd>
ENOMEM - No memory. </dd>
<dd>
EINVAL - The value of some of the arguments is invalid. </dd>
<dd>
ENOENT - Sub collection is not found. The position can't be determined. For example extracting next item after item with name "foo" will cause this error if item "foo" is the last item in the collection. There are other cases when this error can be returned but the common theme is that something was not found. </dd>
<dd>
ENOSYS Unknown disposition value. </dd>
<dd>
EEXIST If duplicate name/type checking is turned on and duplicate name/type is detected. </dd></dl>

</div>
</div>
<a class="anchor" id="gae577b1c49fe867a7da598c869ab45b4e"></a><!-- doxytag: member="collection.h::col_insert_item_into_current" ref="gae577b1c49fe867a7da598c869ab45b4e" args="(struct collection_item *ci, struct collection_item *item, int disposition, const char *refprop, int idx, unsigned flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int col_insert_item_into_current </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>ci</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>item</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>disposition</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>refprop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>flags</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Insert item to the current collection. </p>
<p>Function is equivalent to <a class="el" href="group__getitem.html#ga3afb65bde3bbd68c9669f7d3ea9d78b3">col_insert_item</a> with subcollection parameter equal NULL.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ci</em>&nbsp;</td><td>Collection object. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>item</em>&nbsp;</td><td>Item to insert. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>disposition</em>&nbsp;</td><td>Constant that controls where to insert the item. For more information see <a class="el" href="group__dispvalues.html">disposition constants</a>. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>refprop</em>&nbsp;</td><td>Name of the property to relate to. This can be used to specify that function should insert the item after the item with this name. Leave NULL if the disposition you are using does not relate to an item in the collection. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>idx</em>&nbsp;</td><td>Index of the property to insert. Useful for multi-value properties where several properties have same name in a row. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>flags</em>&nbsp;</td><td>Flags that control naming issues. See <a class="el" href="group__insflags.html">insert flags</a> for more details.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 - Item was successfully extracted. </dd>
<dd>
ENOMEM - No memory. </dd>
<dd>
EINVAL - The value of some of the arguments is invalid. </dd>
<dd>
ENOENT - Sub collection is not found. The position can't be determined. For example extracting next item after item with name "foo" will cause this error if item "foo" is the last item in the collection. There are other cases when this error can be returned but the common theme is that something was not found. </dd>
<dd>
ENOSYS Unknown disposition value. </dd>
<dd>
EEXIST If duplicate name/type checking is turned on and duplicate name/type is detected. </dd></dl>

</div>
</div>
<a class="anchor" id="gaa4d91994856e4cb24b0a2d9397c5bd0c"></a><!-- doxytag: member="collection.h::col_make_hash" ref="gaa4d91994856e4cb24b0a2d9397c5bd0c" args="(const char *string, int sub_len, int *length)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint64_t col_make_hash </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>sub_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>length</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Calculate hash value for a string. </p>
<p>Calculates hash value of the string using internal hashing algorithm. Populates "length" with length of the string not counting 0.</p>
<p>This function is useful if you want to build a custom search or collection sorting function.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>string</em>&nbsp;</td><td>String to hash. If NULL hash is 0. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>sub_len</em>&nbsp;</td><td>If it is greater than zero it is used to count how many characters from string should be included into hash calculation. If 0 the actual length of the string is determined and used. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>length</em>&nbsp;</td><td>Will receive the calculated length of the provided string. Length argument can be NULL.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Hash value. </dd></dl>

</div>
</div>
<a class="anchor" id="gaffce843dbd40ba630f85110c2b34b2f7"></a><!-- doxytag: member="collection.h::col_modify_item" ref="gaffce843dbd40ba630f85110c2b34b2f7" args="(struct collection_item *item, const char *property, int type, const void *data, int length)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int col_modify_item </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>item</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>property</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>length</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Modify any item element. </p>
<p>This function is useful if you want to modify the item that you got as a result of <a class="el" href="group__iterfunc.html">iterating</a> through collection or by calling <a class="el" href="group__collection.html#gaca7cf872ff4092f06d300cfd6f32689f">col_get_item</a>. Previous type and data of the item is destroyed.</p>
<p>If you want to rename an item provide a new name in the property argument otherwise keep it NULL.</p>
<p>If you want the data to remain unchanged use 0 as a length parameter.</p>
<p>If item is a reference or a collection the call will return an error.</p>
<p>The are several convenience function that are wrappers around this function. For more information see <a class="el" href="group__modwrap.html">item modification wrappers</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>item</em>&nbsp;</td><td>Item to modify. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>property</em>&nbsp;</td><td>Property name. Use NULL to leave the property unchanged. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>type</em>&nbsp;</td><td>See <a class="el" href="group__coltypes.html">types</a> for more information. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>data</em>&nbsp;</td><td>New value. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>length</em>&nbsp;</td><td>New value. Use 0 to leave the value and its type unchanged.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 - Item was successfully modified. </dd>
<dd>
ENOMEM - No memory. </dd>
<dd>
EINVAL - The value of some of the arguments is invalid. The attempt to modify an item which is a reference to a collection or a collection name. </dd></dl>

</div>
</div>
<a class="anchor" id="ga771d46d58ced79e7cd4804b5c01f7971"></a><!-- doxytag: member="collection.h::col_remove_item" ref="ga771d46d58ced79e7cd4804b5c01f7971" args="(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, int type)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int col_remove_item </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>ci</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>subcollection</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>disposition</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>refprop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>type</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Remove item from the collection. </p>
<p>Function internally calls <a class="el" href="group__getitem.html#ga74a69184405c8af4506274571af117c8">col_extract_item</a> and then <a class="el" href="group__getitem.html#ga0342fca1c1b2c00c3b058f3c40e6c8fe">col_delete_item</a> for the extracted item.</p>
<p>Function is similar to <a class="el" href="group__collection.html#ga5131d6b4f5e41cc3d63771452ef1d29b">col_delete_property</a> function but allows more specific information about what item (property) to remove.</p>
<p>The header will not be considered for deletion.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ci</em>&nbsp;</td><td>Collection object. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>subcollection</em>&nbsp;</td><td>Name of the sub collection to remove item from. If NULL, the top level collection is used. One can use "foo!bar!baz" notation to identify the sub collection. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>disposition</em>&nbsp;</td><td>Constant that controls how the relative position of the item to remove is determined. For more information see <a class="el" href="group__dispvalues.html">disposition constants</a>. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>refprop</em>&nbsp;</td><td>Name of the property to relate to. This can be used to specify that function should remove next item after the item with this name. Leave NULL if the disposition you are using does not relate to an item in the collection. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>idx</em>&nbsp;</td><td>Index of the property to remove. Useful for multi-value properties where several properties have same name in a row. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>type</em>&nbsp;</td><td>Type filter. Only the item of the matching type will be used. It can be a bit mask of more than one type. Use 0 if you do not need to filter by type.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 - Item was successfully removed. </dd>
<dd>
ENOMEM - No memory. </dd>
<dd>
EINVAL - The value of some of the arguments is invalid. </dd>
<dd>
ENOENT - Sub collection is not found. The position can't be determined. For example deleting next item after item with name "foo" will cause this error if item "foo" is the last item in the collection. There are other cases when this error can be returned but the common theme is that something was not found. </dd>
<dd>
ENOSYS Unknown disposition value. </dd></dl>

</div>
</div>
<a class="anchor" id="ga7efbfc13c34701a8a40f180c82f4c7ec"></a><!-- doxytag: member="collection.h::col_remove_item_from_current" ref="ga7efbfc13c34701a8a40f180c82f4c7ec" args="(struct collection_item *ci, int disposition, const char *refprop, int idx, int type)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int col_remove_item_from_current </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcollection__item.html">collection_item</a> *&nbsp;</td>
          <td class="paramname"> <em>ci</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>disposition</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>refprop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>type</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Remove item from the current collection. </p>
<p>Function is similar to the <a class="el" href="group__getitem.html#ga771d46d58ced79e7cd4804b5c01f7971">col_remove_item</a>. It acts exactly the same as <a class="el" href="group__getitem.html#ga771d46d58ced79e7cd4804b5c01f7971">col_remove_item</a> when the subcollection parameter of the <a class="el" href="group__getitem.html#ga771d46d58ced79e7cd4804b5c01f7971">col_remove_item</a> is set to NULL.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ci</em>&nbsp;</td><td>Collection object. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>disposition</em>&nbsp;</td><td>Constant that controls how the relative position of the item to remove is determined. For more information see <a class="el" href="group__dispvalues.html">disposition constants</a>. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>refprop</em>&nbsp;</td><td>Name of the property to relate to. This can be used to specify that function should remove next item after the item with this name. Leave NULL if the disposition you are using does not relate to an item in the collection. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>idx</em>&nbsp;</td><td>Index of the property to remove. Useful for multi-value properties where several properties have same name in a row. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>type</em>&nbsp;</td><td>Type filter. Only the item of the matching type will be used. It can be a bit mask of more than one type. Use 0 if you do not need to filter by type.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 - Item was successfully removed. </dd>
<dd>
ENOMEM - No memory. </dd>
<dd>
EINVAL - The value of some of the arguments is invalid. </dd>
<dd>
ENOENT - Sub collection is not found. The position can't be determined. For example deleting next item after item with name "foo" will cause this error if item "foo" is the last item in the collection. There are other cases when this error can be returned but the common theme is that something was not found. </dd>
<dd>
ENOSYS Unknown disposition value. </dd></dl>

</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Data Structures</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr size="1"/><address style="text-align: right;"><small>Generated on 25 Jun 2011 for libcollection by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>