%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/proc/self/root/usr/share/nagios/html/docs/
Upload File :
Create Path :
Current File : //proc/self/root/proc/self/root/usr/share/nagios/html/docs/squeue_8h.html

<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Nagios: squeue.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Nagios
   &#160;<span id="projectnumber">4.4.3</span>
   </div>
   <div id="projectbrief">Dev docs for Nagios core and neb-module hackers</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.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)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pages</a></div>

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

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">squeue.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Scheduling queue function declarations.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;sys/time.h&gt;</code><br/>
<code>#include &lt;time.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="pqueue_8h_source.html">pqueue.h</a>&quot;</code><br/>
</div>
<p><a href="squeue_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="memitem:ac28bd57977dc5085282f046a2b44b845"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac28bd57977dc5085282f046a2b44b845"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#ac28bd57977dc5085282f046a2b44b845">SQUEUE_FREE_DATA</a>&#160;&#160;&#160;(1 &lt;&lt; 0) /** Call free() on all data pointers */</td></tr>
<tr class="memdesc:ac28bd57977dc5085282f046a2b44b845"><td class="mdescLeft">&#160;</td><td class="mdescRight">Options for <a class="el" href="squeue_8h.html#a8dfd33fdc99ab4a5008b90ba377ad1f5" title="Destroys a scheduling queue completely. ">squeue_destroy()</a>'s flag parameter. <br/></td></tr>
<tr class="separator:ac28bd57977dc5085282f046a2b44b845"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a08d3dad0b19f729274daafd22f5803b5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a08d3dad0b19f729274daafd22f5803b5"></a>
typedef <a class="el" href="structpqueue__t.html">pqueue_t</a>&#160;</td><td class="memItemRight" valign="bottom"><b>squeue_t</b></td></tr>
<tr class="separator:a08d3dad0b19f729274daafd22f5803b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c7c907c2f2ba7ae441e7e2801f2a9a6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3c7c907c2f2ba7ae441e7e2801f2a9a6"></a>
typedef struct squeue_event&#160;</td><td class="memItemRight" valign="bottom"><b>squeue_event</b></td></tr>
<tr class="separator:a3c7c907c2f2ba7ae441e7e2801f2a9a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a943d1b7cd0ed4ac2e9b2691ef7b6ff72"><td class="memItemLeft" align="right" valign="top">struct timeval *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#a943d1b7cd0ed4ac2e9b2691ef7b6ff72">squeue_event_runtime</a> (squeue_event *evt)</td></tr>
<tr class="memdesc:a943d1b7cd0ed4ac2e9b2691ef7b6ff72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the scheduled runtime of this event.  <a href="#a943d1b7cd0ed4ac2e9b2691ef7b6ff72">More...</a><br/></td></tr>
<tr class="separator:a943d1b7cd0ed4ac2e9b2691ef7b6ff72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac39f0c791fd125c677a18590d158e033"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#ac39f0c791fd125c677a18590d158e033">squeue_event_data</a> (squeue_event *evt)</td></tr>
<tr class="memdesc:ac39f0c791fd125c677a18590d158e033"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get data of an squeue_event struct.  <a href="#ac39f0c791fd125c677a18590d158e033">More...</a><br/></td></tr>
<tr class="separator:ac39f0c791fd125c677a18590d158e033"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42409351d1a75662f0a3dd9ba1ee6622"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structpqueue__t.html">squeue_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#a42409351d1a75662f0a3dd9ba1ee6622">squeue_create</a> (unsigned int size)</td></tr>
<tr class="memdesc:a42409351d1a75662f0a3dd9ba1ee6622"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a scheduling queue optimized for handling events within the given timeframe.  <a href="#a42409351d1a75662f0a3dd9ba1ee6622">More...</a><br/></td></tr>
<tr class="separator:a42409351d1a75662f0a3dd9ba1ee6622"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8dfd33fdc99ab4a5008b90ba377ad1f5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#a8dfd33fdc99ab4a5008b90ba377ad1f5">squeue_destroy</a> (<a class="el" href="structpqueue__t.html">squeue_t</a> *q, int flags)</td></tr>
<tr class="memdesc:a8dfd33fdc99ab4a5008b90ba377ad1f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys a scheduling queue completely.  <a href="#a8dfd33fdc99ab4a5008b90ba377ad1f5">More...</a><br/></td></tr>
<tr class="separator:a8dfd33fdc99ab4a5008b90ba377ad1f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac87233f11bb78fdfc606559435597bb8"><td class="memItemLeft" align="right" valign="top">squeue_event *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#ac87233f11bb78fdfc606559435597bb8">squeue_add_tv</a> (<a class="el" href="structpqueue__t.html">squeue_t</a> *q, struct timeval *tv, void *data)</td></tr>
<tr class="memdesc:ac87233f11bb78fdfc606559435597bb8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enqueue an event with microsecond precision.  <a href="#ac87233f11bb78fdfc606559435597bb8">More...</a><br/></td></tr>
<tr class="separator:ac87233f11bb78fdfc606559435597bb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5cefe0f89f4550d27b3b7e72a49ff3f9"><td class="memItemLeft" align="right" valign="top">squeue_event *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#a5cefe0f89f4550d27b3b7e72a49ff3f9">squeue_add</a> (<a class="el" href="structpqueue__t.html">squeue_t</a> *q, time_t when, void *data)</td></tr>
<tr class="memdesc:a5cefe0f89f4550d27b3b7e72a49ff3f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds an event to the scheduling queue.  <a href="#a5cefe0f89f4550d27b3b7e72a49ff3f9">More...</a><br/></td></tr>
<tr class="separator:a5cefe0f89f4550d27b3b7e72a49ff3f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a6b4f97bff4c22a00117e976c75dba0"><td class="memItemLeft" align="right" valign="top">squeue_event *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#a2a6b4f97bff4c22a00117e976c75dba0">squeue_add_usec</a> (<a class="el" href="structpqueue__t.html">squeue_t</a> *q, time_t when, time_t usec, void *data)</td></tr>
<tr class="memdesc:a2a6b4f97bff4c22a00117e976c75dba0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds an event to the scheduling queue with millisecond precision See notes on <a class="el" href="squeue_8h.html#ac87233f11bb78fdfc606559435597bb8" title="Enqueue an event with microsecond precision. ">squeue_add_tv()</a> for details.  <a href="#a2a6b4f97bff4c22a00117e976c75dba0">More...</a><br/></td></tr>
<tr class="separator:a2a6b4f97bff4c22a00117e976c75dba0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a916fbcfd3d3eda39b4f643a5b2368eca"><td class="memItemLeft" align="right" valign="top">squeue_event *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#a916fbcfd3d3eda39b4f643a5b2368eca">squeue_add_msec</a> (<a class="el" href="structpqueue__t.html">squeue_t</a> *q, time_t when, time_t msec, void *data)</td></tr>
<tr class="memdesc:a916fbcfd3d3eda39b4f643a5b2368eca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds an event to the scheduling queue with millisecond precision See notes on <a class="el" href="squeue_8h.html#ac87233f11bb78fdfc606559435597bb8" title="Enqueue an event with microsecond precision. ">squeue_add_tv()</a> for details.  <a href="#a916fbcfd3d3eda39b4f643a5b2368eca">More...</a><br/></td></tr>
<tr class="separator:a916fbcfd3d3eda39b4f643a5b2368eca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61a20563cf66ffcf704b4ce8e99a0f94"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#a61a20563cf66ffcf704b4ce8e99a0f94">squeue_change_priority_tv</a> (<a class="el" href="structpqueue__t.html">squeue_t</a> *q, squeue_event *evt, struct timeval *tv)</td></tr>
<tr class="memdesc:a61a20563cf66ffcf704b4ce8e99a0f94"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change an event's priority to a new time.  <a href="#a61a20563cf66ffcf704b4ce8e99a0f94">More...</a><br/></td></tr>
<tr class="separator:a61a20563cf66ffcf704b4ce8e99a0f94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa73c23393d49cf0f9e38a286af44176"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#afa73c23393d49cf0f9e38a286af44176">squeue_peek</a> (<a class="el" href="structpqueue__t.html">squeue_t</a> *q)</td></tr>
<tr class="memdesc:afa73c23393d49cf0f9e38a286af44176"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the data of the next scheduled event from the scheduling queue without removing it from the queue.  <a href="#afa73c23393d49cf0f9e38a286af44176">More...</a><br/></td></tr>
<tr class="separator:afa73c23393d49cf0f9e38a286af44176"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba66f0428786d416b3cc609ff4ef90a0"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#aba66f0428786d416b3cc609ff4ef90a0">squeue_pop</a> (<a class="el" href="structpqueue__t.html">squeue_t</a> *q)</td></tr>
<tr class="memdesc:aba66f0428786d416b3cc609ff4ef90a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pops the next scheduled event from the scheduling queue and returns the data for it.  <a href="#aba66f0428786d416b3cc609ff4ef90a0">More...</a><br/></td></tr>
<tr class="separator:aba66f0428786d416b3cc609ff4ef90a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2500eec0813f5cdd854e472509ec86d3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#a2500eec0813f5cdd854e472509ec86d3">squeue_remove</a> (<a class="el" href="structpqueue__t.html">squeue_t</a> *q, squeue_event *evt)</td></tr>
<tr class="memdesc:a2500eec0813f5cdd854e472509ec86d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the given event from the scheduling queue.  <a href="#a2500eec0813f5cdd854e472509ec86d3">More...</a><br/></td></tr>
<tr class="separator:a2500eec0813f5cdd854e472509ec86d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba306724eece998c56f5b22c1c628ef4"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#aba306724eece998c56f5b22c1c628ef4">squeue_size</a> (<a class="el" href="structpqueue__t.html">squeue_t</a> *q)</td></tr>
<tr class="memdesc:aba306724eece998c56f5b22c1c628ef4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of events in the scheduling queue.  <a href="#aba306724eece998c56f5b22c1c628ef4">More...</a><br/></td></tr>
<tr class="separator:aba306724eece998c56f5b22c1c628ef4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7da35a0b70389e01ef10e34500321fc6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="squeue_8h.html#a7da35a0b70389e01ef10e34500321fc6">squeue_evt_when_is_after</a> (squeue_event *evt, struct timeval *reftime)</td></tr>
<tr class="memdesc:a7da35a0b70389e01ef10e34500321fc6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if passed timeval is after the time for the event.  <a href="#a7da35a0b70389e01ef10e34500321fc6">More...</a><br/></td></tr>
<tr class="separator:a7da35a0b70389e01ef10e34500321fc6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Scheduling queue function declarations. </p>
<p>This library is based on the pqueue api, which implements a priority queue based on a binary heap, providing O(lg n) times for insert() and remove(), and O(1) time for peek(). </p>
<dl class="section note"><dt>Note</dt><dd>There is no "find". Callers must maintain pointers to their scheduled events if they wish to be able to remove them. </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a5cefe0f89f4550d27b3b7e72a49ff3f9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">squeue_event* squeue_add </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpqueue__t.html">squeue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">time_t&#160;</td>
          <td class="paramname"><em>when</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds an event to the scheduling queue. </p>
<p>See notes for <a class="el" href="squeue_8h.html#ac87233f11bb78fdfc606559435597bb8" title="Enqueue an event with microsecond precision. ">squeue_add_tv()</a> for details</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>The scheduling queue to add to </td></tr>
    <tr><td class="paramname">when</td><td>The unix timestamp when this event is to occur </td></tr>
    <tr><td class="paramname">data</td><td>Pointer to any kind of data </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The complete scheduled event </dd></dl>

</div>
</div>
<a class="anchor" id="a916fbcfd3d3eda39b4f643a5b2368eca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">squeue_event* squeue_add_msec </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpqueue__t.html">squeue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">time_t&#160;</td>
          <td class="paramname"><em>when</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">time_t&#160;</td>
          <td class="paramname"><em>msec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds an event to the scheduling queue with millisecond precision See notes on <a class="el" href="squeue_8h.html#ac87233f11bb78fdfc606559435597bb8" title="Enqueue an event with microsecond precision. ">squeue_add_tv()</a> for details. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">q</td><td>The scheduling queue to add to </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">when</td><td>Unix timestamp when this event should occur </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">msec</td><td>Millisecond of above this event should occur </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Pointer to any kind of data </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>NULL on errors. squeue_event pointer on success </dd></dl>

</div>
</div>
<a class="anchor" id="ac87233f11bb78fdfc606559435597bb8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">squeue_event* squeue_add_tv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpqueue__t.html">squeue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct timeval *&#160;</td>
          <td class="paramname"><em>tv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enqueue an event with microsecond precision. </p>
<p>It's up to the caller to keep the event pointer in case he/she wants to remove the event from the queue later.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>The scheduling queue to add to </td></tr>
    <tr><td class="paramname">tv</td><td>When this event should occur </td></tr>
    <tr><td class="paramname">data</td><td>Pointer to any kind of data </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The complete scheduled event </dd></dl>

</div>
</div>
<a class="anchor" id="a2a6b4f97bff4c22a00117e976c75dba0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">squeue_event* squeue_add_usec </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpqueue__t.html">squeue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">time_t&#160;</td>
          <td class="paramname"><em>when</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">time_t&#160;</td>
          <td class="paramname"><em>usec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds an event to the scheduling queue with millisecond precision See notes on <a class="el" href="squeue_8h.html#ac87233f11bb78fdfc606559435597bb8" title="Enqueue an event with microsecond precision. ">squeue_add_tv()</a> for details. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">q</td><td>The scheduling queue to add to </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">when</td><td>Unix timestamp when this event should occur </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">usec</td><td>Millisecond of above this event should occur </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Pointer to any kind of data </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>NULL on errors. squeue_event pointer on success </dd></dl>

</div>
</div>
<a class="anchor" id="a61a20563cf66ffcf704b4ce8e99a0f94"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void squeue_change_priority_tv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpqueue__t.html">squeue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">squeue_event *&#160;</td>
          <td class="paramname"><em>evt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct timeval *&#160;</td>
          <td class="paramname"><em>tv</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Change an event's priority to a new time. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>The scheduling queue holding the event. </td></tr>
    <tr><td class="paramname">evt</td><td>The event to reschedule. </td></tr>
    <tr><td class="paramname">tv</td><td>When the event should be rescheduled to. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a42409351d1a75662f0a3dd9ba1ee6622"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structpqueue__t.html">squeue_t</a>* squeue_create </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>size</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a scheduling queue optimized for handling events within the given timeframe. </p>
<p>Callers should take care to create a queue of a decent but not overly large size, as too small or too large a queue will impact performance negatively. A queue can hold any number of events. A good value for "horizon" would be the max seconds into the future one expects to schedule things, although with few scheduled items in that timeframe you'd be better off using a more narrow horizon.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">size</td><td>Hint about how large this queue will get </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to a scheduling queue </dd></dl>

</div>
</div>
<a class="anchor" id="a8dfd33fdc99ab4a5008b90ba377ad1f5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void squeue_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpqueue__t.html">squeue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroys a scheduling queue completely. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">q</td><td>The doomed queue </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">flags</td><td>Flags determining the the level of destruction </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac39f0c791fd125c677a18590d158e033"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* squeue_event_data </td>
          <td>(</td>
          <td class="paramtype">squeue_event *&#160;</td>
          <td class="paramname"><em>evt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get data of an squeue_event struct. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">evt</td><td>The event to operate on </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The data object pointed to by the event </dd></dl>

</div>
</div>
<a class="anchor" id="a943d1b7cd0ed4ac2e9b2691ef7b6ff72"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct timeval* squeue_event_runtime </td>
          <td>(</td>
          <td class="paramtype">squeue_event *&#160;</td>
          <td class="paramname"><em>evt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the scheduled runtime of this event. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">evt</td><td>The event to get runtime of </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>struct timeval on success, NULL on errors </dd></dl>

</div>
</div>
<a class="anchor" id="a7da35a0b70389e01ef10e34500321fc6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int squeue_evt_when_is_after </td>
          <td>(</td>
          <td class="paramtype">squeue_event *&#160;</td>
          <td class="paramname"><em>evt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct timeval *&#160;</td>
          <td class="paramname"><em>reftime</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if passed timeval is after the time for the event. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">evt</td><td>The queue event to inspect </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">reftime</td><td>The reference time to compare to the queue event time </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if reftime &gt; event time, 0 otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="afa73c23393d49cf0f9e38a286af44176"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* squeue_peek </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpqueue__t.html">squeue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the data of the next scheduled event from the scheduling queue without removing it from the queue. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>The scheduling queue to peek into </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aba66f0428786d416b3cc609ff4ef90a0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* squeue_pop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpqueue__t.html">squeue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pops the next scheduled event from the scheduling queue and returns the data for it. </p>
<p>This is equivalent to <a class="el" href="squeue_8h.html#afa73c23393d49cf0f9e38a286af44176" title="Returns the data of the next scheduled event from the scheduling queue without removing it from the q...">squeue_peek()</a> + <a class="el" href="squeue_8h.html#aba66f0428786d416b3cc609ff4ef90a0" title="Pops the next scheduled event from the scheduling queue and returns the data for it. ">squeue_pop()</a> </p>
<dl class="section note"><dt>Note</dt><dd>This causes the squeue_event to be free()'d.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>The scheduling queue to pop from </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2500eec0813f5cdd854e472509ec86d3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int squeue_remove </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpqueue__t.html">squeue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">squeue_event *&#160;</td>
          <td class="paramname"><em>evt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Removes the given event from the scheduling queue. </p>
<dl class="section note"><dt>Note</dt><dd>This causes the associated squeue_event() to be free()'d. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">q</td><td>The scheduling queue to remove from </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">evt</td><td>The event to remove </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aba306724eece998c56f5b22c1c628ef4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int squeue_size </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpqueue__t.html">squeue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the number of events in the scheduling queue. </p>
<p>This function never fails.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">q</td><td>The scheduling queue to inspect </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of events in the inspected queue </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>

Zerion Mini Shell 1.0