Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 191a8a9815631149211a94f0cdc8f64d > files > 82

libnjb-devel-2.2.7-1.fc14.i686.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>libnjb: The libnjb configuration API</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.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">libnjb&#160;<span id="projectnumber">2.2.7</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">The libnjb configuration API</div>  </div>
</div>
<div class="contents">
<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">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__internals.html#gaa5ff48cc89e320bc1c1d89efd2613d77">NJB_Set_Debug</a> (int debug_flags)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__internals.html#ga22a893c243cd4398de35fcdea5b49b39">NJB_Set_Unicode</a> (int unicode_flag)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__internals.html#ga2497a98361bc58544b96d6244d3ef050">NJB_Error_Pending</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__internals.html#gab9e4e77cca9f237b5d980e1e1de43922">NJB_Error_Reset_Geterror</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__internals.html#gaecd04b956fc5af8d25bdf4f19ac2696c">NJB_Error_Geterror</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__internals.html#gae9b849a9a883fe1fd697278bd8d49585">NJB_Error_Dump</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, FILE *fp)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gae9b849a9a883fe1fd697278bd8d49585"></a><!-- doxytag: member="libnjb.h::NJB_Error_Dump" ref="gae9b849a9a883fe1fd697278bd8d49585" args="(njb_t *njb, FILE *fp)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void NJB_Error_Dump </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>fp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function dumps the current libnjb error stack to a file, such as stderr. All errors currently on the stack are dumped. After dumping, the error stack is cleared and errors are not returned again. The function may be called on an empty error stack without effect, but you may just as well check the stack yourself using <code><a class="el" href="group__internals.html#ga2497a98361bc58544b96d6244d3ef050">NJB_Error_Pending()</a></code> as in the example below.</p>
<p>Typical usage:</p>
<pre>
 njb_t *njb;</pre><pre> if (NJB_Error_Pending(njb)) {
     NJB_Error_Dump(njb, stderr);
 }
 </pre><dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the NJB object to use </td></tr>
    <tr><td class="paramname">fp</td><td>a file pointer to dump the textual representation of the error stack to. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__internals.html#ga2497a98361bc58544b96d6244d3ef050">NJB_Error_Pending()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a5">cursesplay.c</a>, <a class="el" href="delfile_8c-example.html#a5">delfile.c</a>, <a class="el" href="deltr_8c-example.html#a5">deltr.c</a>, <a class="el" href="dumpeax_8c-example.html#a6">dumpeax.c</a>, <a class="el" href="dumptime_8c-example.html#a6">dumptime.c</a>, <a class="el" href="files_8c-example.html#a13">files.c</a>, <a class="el" href="fwupgrade_8c-example.html#a7">fwupgrade.c</a>, <a class="el" href="getfile_8c-example.html#a5">getfile.c</a>, <a class="el" href="getowner_8c-example.html#a7">getowner.c</a>, <a class="el" href="gettr_8c-example.html#a5">gettr.c</a>, <a class="el" href="getusage_8c-example.html#a5">getusage.c</a>, <a class="el" href="handshake_8c-example.html#a6">handshake.c</a>, <a class="el" href="pl_8c-example.html#a20">pl.c</a>, <a class="el" href="play_8c-example.html#a5">play.c</a>, <a class="el" href="playlists_8c-example.html#a16">playlists.c</a>, <a class="el" href="sendfile_8c-example.html#a7">sendfile.c</a>, <a class="el" href="sendtr_8c-example.html#a9">sendtr.c</a>, <a class="el" href="setowner_8c-example.html#a7">setowner.c</a>, <a class="el" href="setpbm_8c-example.html#a5">setpbm.c</a>, <a class="el" href="settime_8c-example.html#a13">settime.c</a>, <a class="el" href="tagtr_8c-example.html#a9">tagtr.c</a>, and <a class="el" href="tracks_8c-example.html#a21">tracks.c</a>.</dd>
</dl>
<p>References <a class="el" href="group__internals.html#gaecd04b956fc5af8d25bdf4f19ac2696c">NJB_Error_Geterror()</a>, and <a class="el" href="group__internals.html#gab9e4e77cca9f237b5d980e1e1de43922">NJB_Error_Reset_Geterror()</a>.</p>

</div>
</div>
<a class="anchor" id="gaecd04b956fc5af8d25bdf4f19ac2696c"></a><!-- doxytag: member="libnjb.h::NJB_Error_Geterror" ref="gaecd04b956fc5af8d25bdf4f19ac2696c" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* NJB_Error_Geterror </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function returns the topmost error on the error stack as a string. The result is statically allocated and MUST NOT be freed by the calling application. This function should be repeatedly called until no errors remain and the function returns NULL. After retrieveing all error strings like this, the error stack is cleared and none of the errors will be returned again.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the NJB object to use </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a string representing one error on the error stack or NULL. </dd></dl>

<p>References <a class="el" href="structnjb__error__stack__struct.html#a6c39193a08f0c4eaba7ea87d33326d98">njb_error_stack_struct::count</a>, <a class="el" href="structnjb__struct.html#aa0782d852f52c99002785bf17224efc9">njb_struct::error_stack</a>, <a class="el" href="structnjb__error__stack__struct.html#af38f6c23ce1160e315fa936b131143f9">njb_error_stack_struct::idx</a>, and <a class="el" href="structnjb__error__stack__struct.html#ad53b49b0fba9e7531365ae16bd1eb7e1">njb_error_stack_struct::msg</a>.</p>

<p>Referenced by <a class="el" href="group__internals.html#gae9b849a9a883fe1fd697278bd8d49585">NJB_Error_Dump()</a>.</p>

</div>
</div>
<a class="anchor" id="ga2497a98361bc58544b96d6244d3ef050"></a><!-- doxytag: member="libnjb.h::NJB_Error_Pending" ref="ga2497a98361bc58544b96d6244d3ef050" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Error_Pending </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function tells wheter an error message is queued and pending for the current device. If so, the error should be retrieved using <code><a class="el" href="group__internals.html#gaecd04b956fc5af8d25bdf4f19ac2696c">NJB_Error_Geterror()</a></code> or dumped using <code>NJB_Error_Dumperror()</code>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the NJB object to use </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if there are no errors pending, 1 if there are errors pending </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__internals.html#gab9e4e77cca9f237b5d980e1e1de43922">NJB_Error_Reset_Geterror()</a> </dd>
<dd>
<a class="el" href="group__internals.html#gaecd04b956fc5af8d25bdf4f19ac2696c">NJB_Error_Geterror()</a> </dd>
<dd>
<a class="el" href="group__internals.html#gae9b849a9a883fe1fd697278bd8d49585">NJB_Error_Dump()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="dumptime_8c-example.html#a17">dumptime.c</a>, <a class="el" href="files_8c-example.html#a18">files.c</a>, <a class="el" href="gettr_8c-example.html#a17">gettr.c</a>, <a class="el" href="playlists_8c-example.html#a20">playlists.c</a>, and <a class="el" href="tracks_8c-example.html#a27">tracks.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__error__stack__struct.html#a6c39193a08f0c4eaba7ea87d33326d98">njb_error_stack_struct::count</a>, and <a class="el" href="structnjb__struct.html#aa0782d852f52c99002785bf17224efc9">njb_struct::error_stack</a>.</p>

</div>
</div>
<a class="anchor" id="gab9e4e77cca9f237b5d980e1e1de43922"></a><!-- doxytag: member="libnjb.h::NJB_Error_Reset_Geterror" ref="gab9e4e77cca9f237b5d980e1e1de43922" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void NJB_Error_Reset_Geterror </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function resets the internal error stack, so that old errors do not remain on following calls to retrieve the error.</p>
<p>Retrieve the errors if the function <code><a class="el" href="group__internals.html#ga2497a98361bc58544b96d6244d3ef050">NJB_Error_Pending()</a></code> indicate that there are errors pending. Typical usage:</p>
<pre>
 njb_t *njb;
 char *errstr;</pre><pre> if (NJB_Error_Pending(njb) {
    NJB_Error_Reset_Geterror(njb);
    while ( (errstr = NJB_Error_Geterror(njb)) != NULL )  {
          printf("%s\n", errstr);
    }
 }
 </pre><dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the NJB object to use </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__internals.html#ga2497a98361bc58544b96d6244d3ef050">NJB_Error_Pending()</a> </dd>
<dd>
<a class="el" href="group__internals.html#gaecd04b956fc5af8d25bdf4f19ac2696c">NJB_Error_Geterror()</a> </dd></dl>

<p>References <a class="el" href="structnjb__struct.html#aa0782d852f52c99002785bf17224efc9">njb_struct::error_stack</a>, and <a class="el" href="structnjb__error__stack__struct.html#af38f6c23ce1160e315fa936b131143f9">njb_error_stack_struct::idx</a>.</p>

<p>Referenced by <a class="el" href="group__internals.html#gae9b849a9a883fe1fd697278bd8d49585">NJB_Error_Dump()</a>.</p>

</div>
</div>
<a class="anchor" id="gaa5ff48cc89e320bc1c1d89efd2613d77"></a><!-- doxytag: member="libnjb.h::NJB_Set_Debug" ref="gaa5ff48cc89e320bc1c1d89efd2613d77" args="(int debug_flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void NJB_Set_Debug </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>debug_flags</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set the debug print mode for libnjb. The debug flag is created by OR:ing up the different possible flags.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__debugflags.html">Debug flags</a> </dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">debug_flags</td><td>the debug flags to use </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a2">cursesplay.c</a>, <a class="el" href="delfile_8c-example.html#a2">delfile.c</a>, <a class="el" href="deltr_8c-example.html#a2">deltr.c</a>, <a class="el" href="dumpeax_8c-example.html#a3">dumpeax.c</a>, <a class="el" href="dumptime_8c-example.html#a3">dumptime.c</a>, <a class="el" href="files_8c-example.html#a8">files.c</a>, <a class="el" href="fwupgrade_8c-example.html#a2">fwupgrade.c</a>, <a class="el" href="getfile_8c-example.html#a2">getfile.c</a>, <a class="el" href="getowner_8c-example.html#a2">getowner.c</a>, <a class="el" href="gettr_8c-example.html#a2">gettr.c</a>, <a class="el" href="getusage_8c-example.html#a2">getusage.c</a>, <a class="el" href="handshake_8c-example.html#a2">handshake.c</a>, <a class="el" href="pl_8c-example.html#a11">pl.c</a>, <a class="el" href="play_8c-example.html#a2">play.c</a>, <a class="el" href="playlists_8c-example.html#a11">playlists.c</a>, <a class="el" href="sendfile_8c-example.html#a2">sendfile.c</a>, <a class="el" href="sendtr_8c-example.html#a4">sendtr.c</a>, <a class="el" href="setowner_8c-example.html#a2">setowner.c</a>, <a class="el" href="setpbm_8c-example.html#a2">setpbm.c</a>, <a class="el" href="settime_8c-example.html#a10">settime.c</a>, <a class="el" href="tagtr_8c-example.html#a4">tagtr.c</a>, and <a class="el" href="tracks_8c-example.html#a16">tracks.c</a>.</dd>
</dl>
<p>References <a class="el" href="base_8c.html#acfa06caf868fa5b7c9f73f3bc26594e2">njb_set_debug()</a>.</p>

</div>
</div>
<a class="anchor" id="ga22a893c243cd4398de35fcdea5b49b39"></a><!-- doxytag: member="libnjb.h::NJB_Set_Unicode" ref="ga22a893c243cd4398de35fcdea5b49b39" args="(int unicode_flag)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void NJB_Set_Unicode </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>unicode_flag</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Defines the encoding used by libnjb. By default, ISO 8859-1 (or rather Windows Codepage 1252) will be used. However, all modern applications should make a call to this function and set the encoding to <code>NJB_UC_UTF8</code>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__unicodeflags.html">Unicode flags</a> </dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">unicode_flag</td><td>the encoding to use </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="files_8c-example.html#a9">files.c</a>, <a class="el" href="fwupgrade_8c-example.html#a3">fwupgrade.c</a>, <a class="el" href="getowner_8c-example.html#a3">getowner.c</a>, <a class="el" href="pl_8c-example.html#a12">pl.c</a>, <a class="el" href="playlists_8c-example.html#a12">playlists.c</a>, <a class="el" href="sendfile_8c-example.html#a3">sendfile.c</a>, <a class="el" href="sendtr_8c-example.html#a5">sendtr.c</a>, <a class="el" href="setowner_8c-example.html#a3">setowner.c</a>, <a class="el" href="tagtr_8c-example.html#a5">tagtr.c</a>, and <a class="el" href="tracks_8c-example.html#a17">tracks.c</a>.</dd>
</dl>
<p>References <a class="el" href="unicode_8c.html#a4af1a0bee89d7ee79ebb1bfb557f8e5e">njb_set_unicode()</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Sat Jun 25 2011 for libnjb by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>