Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 36c3913465aa447b7a02f02786061291 > files > 23

libfprint-devel-0.3.0-1.fc14.x86_64.rpm

<!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>libfprint: Polling and timing operations</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.1 -->
<script type="text/javascript">
function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}

function removeClass(ele,cls) {
  if (hasClass(ele,cls)) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    ele.className=ele.className.replace(reg,' ');
  }
}

function toggleVisibility(linkObj) {
 var base = linkObj.getAttribute('id');
 var summary = document.getElementById(base + '-summary');
 var content = document.getElementById(base + '-content');
 var trigger = document.getElementById(base + '-trigger');
 if ( hasClass(linkObj,'closed') ) {
   summary.style.display = 'none';
   content.style.display = 'block';
   trigger.src = 'open.png';
   removeClass(linkObj,'closed');
   addClass(linkObj,'opened');
 } else if ( hasClass(linkObj,'opened') ) {
   summary.style.display = 'block';
   content.style.display = 'none';
   trigger.src = 'closed.png';
   removeClass(linkObj,'opened');
   addClass(linkObj,'closed');
 }
 return false;
}
</script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <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>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<h1>Polling and timing operations</h1>  </div>
</div>
<div class="contents">

<p>These functions are only applicable to users of libfprint's asynchronous API.  
<a href="#_details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__poll.html#ga1bcfb2aa35f80831c8f83cbf37c16c59">fp_handle_events_timeout</a> (struct timeval *timeout)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Handle any pending events.  <a href="#ga1bcfb2aa35f80831c8f83cbf37c16c59"></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__poll.html#gac90ddc168b563df89954f0cabf9f298e">fp_handle_events</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convenience function for calling <a class="el" href="group__poll.html#ga1bcfb2aa35f80831c8f83cbf37c16c59" title="Handle any pending events.">fp_handle_events_timeout()</a> with a sensible default timeout value of two seconds (subject to change if we decide another value is more sensible).  <a href="#gac90ddc168b563df89954f0cabf9f298e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__poll.html#gac7aa1c4d7dc0b3bc6704c76202823d1f">fp_get_pollfds</a> (struct <a class="el" href="structfp__pollfd.html">fp_pollfd</a> **pollfds)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Retrieve a list of file descriptors that should be polled for events interesting to libfprint.  <a href="#gac7aa1c4d7dc0b3bc6704c76202823d1f"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>These functions are only applicable to users of libfprint's asynchronous API. </p>
<p>libfprint does not create internal library threads and hence can only execute when your application is calling a libfprint function. However, libfprint often has work to be do, such as handling of completed USB transfers, and processing of timeouts required in order for the library to function. Therefore it is essential that your own application must regularly "phone into" libfprint so that libfprint can handle any pending events.</p>
<p>The function you must call is <a class="el" href="group__poll.html#gac90ddc168b563df89954f0cabf9f298e" title="Convenience function for calling fp_handle_events_timeout() with a sensible default timeout value of ...">fp_handle_events()</a> or a variant of it. This function will handle any pending events, and it is from this context that all asynchronous event callbacks from the library will occur. You can view this function as a kind of iteration function.</p>
<p>If there are no events pending, <a class="el" href="group__poll.html#gac90ddc168b563df89954f0cabf9f298e" title="Convenience function for calling fp_handle_events_timeout() with a sensible default timeout value of ...">fp_handle_events()</a> will block for a few seconds (and will handle any new events should anything occur in that time). If you wish to customise this timeout, you can use <a class="el" href="group__poll.html#ga1bcfb2aa35f80831c8f83cbf37c16c59" title="Handle any pending events.">fp_handle_events_timeout()</a> instead. If you wish to do a nonblocking iteration, call <a class="el" href="group__poll.html#ga1bcfb2aa35f80831c8f83cbf37c16c59" title="Handle any pending events.">fp_handle_events_timeout()</a> with a zero timeout.</p>
<p>TODO: document how application is supposed to know when to call these functions. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga1bcfb2aa35f80831c8f83cbf37c16c59"></a><!-- doxytag: member="poll.c::fp_handle_events_timeout" ref="ga1bcfb2aa35f80831c8f83cbf37c16c59" args="(struct timeval *timeout)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int fp_handle_events_timeout </td>
          <td>(</td>
          <td class="paramtype">struct timeval *&nbsp;</td>
          <td class="paramname"> <em>timeout</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Handle any pending events. </p>
<p>If a non-zero timeout is specified, the function will potentially block for the specified amount of time, although it may return sooner if events have been handled. The function acts as non-blocking for a zero timeout.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>Maximum timeout for this blocking function </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, non-zero on error. </dd></dl>

<p>Referenced by <a class="el" href="group__poll.html#gac90ddc168b563df89954f0cabf9f298e">fp_handle_events()</a>.</p>

</div>
</div>
<a class="anchor" id="gac90ddc168b563df89954f0cabf9f298e"></a><!-- doxytag: member="poll.c::fp_handle_events" ref="gac90ddc168b563df89954f0cabf9f298e" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int fp_handle_events </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Convenience function for calling <a class="el" href="group__poll.html#ga1bcfb2aa35f80831c8f83cbf37c16c59" title="Handle any pending events.">fp_handle_events_timeout()</a> with a sensible default timeout value of two seconds (subject to change if we decide another value is more sensible). </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, non-zero on error. </dd></dl>

<p>References <a class="el" href="group__poll.html#ga1bcfb2aa35f80831c8f83cbf37c16c59">fp_handle_events_timeout()</a>.</p>

<p>Referenced by <a class="el" href="group__dev.html#gaa073e271cfbbea1fecc3e4fc6abb7299">fp_dev_close()</a>, <a class="el" href="group__dev.html#gaadd81517ba2e3f1279525a326d0e6ee4">fp_dev_open()</a>, <a class="el" href="group__dev.html#gae8f36a456208018fe2aa53fa44979e3f">fp_enroll_finger_img()</a>, <a class="el" href="group__dev.html#ga65d5a34cf824ef2225f93a5742d2c2f6">fp_identify_finger_img()</a>, and <a class="el" href="group__dev.html#ga267c6b214779a7d1bfbc722b6094ef20">fp_verify_finger_img()</a>.</p>

</div>
</div>
<a class="anchor" id="gac7aa1c4d7dc0b3bc6704c76202823d1f"></a><!-- doxytag: member="poll.c::fp_get_pollfds" ref="gac7aa1c4d7dc0b3bc6704c76202823d1f" args="(struct fp_pollfd **pollfds)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t fp_get_pollfds </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structfp__pollfd.html">fp_pollfd</a> **&nbsp;</td>
          <td class="paramname"> <em>pollfds</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Retrieve a list of file descriptors that should be polled for events interesting to libfprint. </p>
<p>This function is only for users who wish to combine libfprint's file descriptor set with other event sources - more simplistic users will be able to call <a class="el" href="group__poll.html#gac90ddc168b563df89954f0cabf9f298e" title="Convenience function for calling fp_handle_events_timeout() with a sensible default timeout value of ...">fp_handle_events()</a> or a variant directly.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pollfds</em>&nbsp;</td><td>output location for a list of pollfds. If non-NULL, must be released with free() when done. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of pollfds in the resultant list, or negative on error. </dd></dl>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Sep 8 2010 for libfprint by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>