Sophie

Sophie

distrib > Fedora > 13 > x86_64 > by-pkgid > ca44e7e21c4b6cd5e0c5fdfbf12b4de7 > files > 80

libnjb-devel-2.2.6-6.fc12.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;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.5.9 -->
<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><a href="dirs.html"><span>Directories</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>The libnjb configuration API</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__internals.html#ga5ff48cc89e320bc1c1d89efd2613d77">NJB_Set_Debug</a> (int debug_flags)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__internals.html#g22a893c243cd4398de35fcdea5b49b39">NJB_Set_Unicode</a> (int unicode_flag)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__internals.html#g2497a98361bc58544b96d6244d3ef050">NJB_Error_Pending</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__internals.html#gb9e4e77cca9f237b5d980e1e1de43922">NJB_Error_Reset_Geterror</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__internals.html#gecd04b956fc5af8d25bdf4f19ac2696c">NJB_Error_Geterror</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__internals.html#ge9b849a9a883fe1fd697278bd8d49585">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" name="ge9b849a9a883fe1fd697278bd8d49585"></a><!-- doxytag: member="libnjb.h::NJB_Error_Dump" ref="ge9b849a9a883fe1fd697278bd8d49585" 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> *&nbsp;</td>
          <td class="paramname"> <em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&nbsp;</td>
          <td class="paramname"> <em>fp</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <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#g2497a98361bc58544b96d6244d3ef050">NJB_Error_Pending()</a></code> as in the example below.<p>
Typical usage:<p>
<pre>
 njb_t *njb;</pre><p>
<pre> if (NJB_Error_Pending(njb)) {
     NJB_Error_Dump(njb, stderr);
 }
 </pre><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>njb</em>&nbsp;</td><td>a pointer to the NJB object to use </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>fp</em>&nbsp;</td><td>a file pointer to dump the textual representation of the error stack to. </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__internals.html#g2497a98361bc58544b96d6244d3ef050">NJB_Error_Pending()</a> </dd></dl>
<dl compact><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>.</dl>
<p>References <a class="el" href="njb__error_8c_source.html#l00368">NJB_Error_Geterror()</a>, and <a class="el" href="njb__error_8c_source.html#l00342">NJB_Error_Reset_Geterror()</a>.</p>

</div>
</div><p>
<a class="anchor" name="gecd04b956fc5af8d25bdf4f19ac2696c"></a><!-- doxytag: member="libnjb.h::NJB_Error_Geterror" ref="gecd04b956fc5af8d25bdf4f19ac2696c" 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> *&nbsp;</td>
          <td class="paramname"> <em>njb</em>          </td>
          <td>&nbsp;)&nbsp;</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 compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>njb</em>&nbsp;</td><td>a pointer to the NJB object to use </td></tr>
  </table>
</dl>
<dl class="return" compact><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="njb__error_8h_source.html#l00048">njb_error_stack_struct::count</a>, <a class="el" href="libnjb_8h_source.html#l00193">njb_struct::error_stack</a>, <a class="el" href="njb__error_8h_source.html#l00047">njb_error_stack_struct::idx</a>, and <a class="el" href="njb__error_8h_source.html#l00049">njb_error_stack_struct::msg</a>.</p>

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

</div>
</div><p>
<a class="anchor" name="g2497a98361bc58544b96d6244d3ef050"></a><!-- doxytag: member="libnjb.h::NJB_Error_Pending" ref="g2497a98361bc58544b96d6244d3ef050" 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> *&nbsp;</td>
          <td class="paramname"> <em>njb</em>          </td>
          <td>&nbsp;)&nbsp;</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#gecd04b956fc5af8d25bdf4f19ac2696c">NJB_Error_Geterror()</a></code> or dumped using <code>NJB_Error_Dumperror()</code>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>njb</em>&nbsp;</td><td>a pointer to the NJB object to use </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if there are no errors pending, 1 if there are errors pending </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__internals.html#gb9e4e77cca9f237b5d980e1e1de43922">NJB_Error_Reset_Geterror()</a> <p>
<a class="el" href="group__internals.html#gecd04b956fc5af8d25bdf4f19ac2696c">NJB_Error_Geterror()</a> <p>
<a class="el" href="group__internals.html#ge9b849a9a883fe1fd697278bd8d49585">NJB_Error_Dump()</a> </dd></dl>
<dl compact><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>.</dl>
<p>References <a class="el" href="njb__error_8h_source.html#l00048">njb_error_stack_struct::count</a>, and <a class="el" href="libnjb_8h_source.html#l00193">njb_struct::error_stack</a>.</p>

</div>
</div><p>
<a class="anchor" name="gb9e4e77cca9f237b5d980e1e1de43922"></a><!-- doxytag: member="libnjb.h::NJB_Error_Reset_Geterror" ref="gb9e4e77cca9f237b5d980e1e1de43922" 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> *&nbsp;</td>
          <td class="paramname"> <em>njb</em>          </td>
          <td>&nbsp;)&nbsp;</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>
Retrieve the errors if the function <code><a class="el" href="group__internals.html#g2497a98361bc58544b96d6244d3ef050">NJB_Error_Pending()</a></code> indicate that there are errors pending. Typical usage:<p>
<pre>
 njb_t *njb;
 char *errstr;</pre><p>
<pre> if (NJB_Error_Pending(njb) {
    NJB_Error_Reset_Geterror(njb);
    while ( (errstr = NJB_Error_Geterror(njb)) != NULL )  {
          printf("%s\n", errstr);
    }
 }
 </pre><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>njb</em>&nbsp;</td><td>a pointer to the NJB object to use </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__internals.html#g2497a98361bc58544b96d6244d3ef050">NJB_Error_Pending()</a> <p>
<a class="el" href="group__internals.html#gecd04b956fc5af8d25bdf4f19ac2696c">NJB_Error_Geterror()</a> </dd></dl>

<p>References <a class="el" href="libnjb_8h_source.html#l00193">njb_struct::error_stack</a>, and <a class="el" href="njb__error_8h_source.html#l00047">njb_error_stack_struct::idx</a>.</p>

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

</div>
</div><p>
<a class="anchor" name="ga5ff48cc89e320bc1c1d89efd2613d77"></a><!-- doxytag: member="libnjb.h::NJB_Set_Debug" ref="ga5ff48cc89e320bc1c1d89efd2613d77" 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&nbsp;</td>
          <td class="paramname"> <em>debug_flags</em>          </td>
          <td>&nbsp;)&nbsp;</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" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__debugflags.html">Debug flags</a> </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>debug_flags</em>&nbsp;</td><td>the debug flags to use </td></tr>
  </table>
</dl>
<dl compact><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>.</dl>
<p>References <a class="el" href="base_8c_source.html#l00350">njb_set_debug()</a>.</p>

</div>
</div><p>
<a class="anchor" name="g22a893c243cd4398de35fcdea5b49b39"></a><!-- doxytag: member="libnjb.h::NJB_Set_Unicode" ref="g22a893c243cd4398de35fcdea5b49b39" 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&nbsp;</td>
          <td class="paramname"> <em>unicode_flag</em>          </td>
          <td>&nbsp;)&nbsp;</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" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__unicodeflags.html">Unicode flags</a> </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>unicode_flag</em>&nbsp;</td><td>the encoding to use </td></tr>
  </table>
</dl>
<dl compact><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>.</dl>
<p>References <a class="el" href="unicode_8c_source.html#l00035">njb_set_unicode()</a>.</p>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Jul 26 17:17:29 2009 for libnjb by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>