| 1 |
michael |
3253 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 |
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
| 3 |
|
|
<title>DatabasePrimitivesLibrary: ll_flush.c Source File</title> |
| 4 |
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css"> |
| 5 |
|
|
</head><body> |
| 6 |
|
|
<!-- Generated by Doxygen 1.4.4 --> |
| 7 |
|
|
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div> |
| 8 |
|
|
<h1>ll_flush.c</h1><a href="ll__flush_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> |
| 9 |
|
|
<a name="l00002"></a>00002 <span class="comment">** Copyright (C) 2002 by Kevin L. Mitchell <klmitch@mit.edu></span> |
| 10 |
|
|
<a name="l00003"></a>00003 <span class="comment">**</span> |
| 11 |
|
|
<a name="l00004"></a>00004 <span class="comment">** This library is free software; you can redistribute it and/or</span> |
| 12 |
|
|
<a name="l00005"></a>00005 <span class="comment">** modify it under the terms of the GNU Library General Public</span> |
| 13 |
|
|
<a name="l00006"></a>00006 <span class="comment">** License as published by the Free Software Foundation; either</span> |
| 14 |
|
|
<a name="l00007"></a>00007 <span class="comment">** version 2 of the License, or (at your option) any later version.</span> |
| 15 |
|
|
<a name="l00008"></a>00008 <span class="comment">**</span> |
| 16 |
|
|
<a name="l00009"></a>00009 <span class="comment">** This library is distributed in the hope that it will be useful,</span> |
| 17 |
|
|
<a name="l00010"></a>00010 <span class="comment">** but WITHOUT ANY WARRANTY; without even the implied warranty of</span> |
| 18 |
|
|
<a name="l00011"></a>00011 <span class="comment">** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> |
| 19 |
|
|
<a name="l00012"></a>00012 <span class="comment">** Library General Public License for more details.</span> |
| 20 |
|
|
<a name="l00013"></a>00013 <span class="comment">**</span> |
| 21 |
|
|
<a name="l00014"></a>00014 <span class="comment">** You should have received a copy of the GNU Library General Public</span> |
| 22 |
|
|
<a name="l00015"></a>00015 <span class="comment">** License along with this library; if not, write to the Free</span> |
| 23 |
|
|
<a name="l00016"></a>00016 <span class="comment">** Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</span> |
| 24 |
|
|
<a name="l00017"></a>00017 <span class="comment">** MA 02111-1307, USA</span> |
| 25 |
|
|
<a name="l00018"></a>00018 <span class="comment">**</span> |
| 26 |
|
|
<a name="l00019"></a>00019 <span class="comment">** @(#)$Id: ll__flush_8c-source.html,v 1.3 2006/09/04 15:12:17 spale Exp $</span> |
| 27 |
|
|
<a name="l00020"></a>00020 <span class="comment">*/</span> |
| 28 |
|
|
<a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="dbprim_8h.html">dbprim.h</a>"</span> |
| 29 |
|
|
<a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="dbprim__int_8h.html">dbprim_int.h</a>"</span> |
| 30 |
|
|
<a name="l00030"></a>00030 |
| 31 |
|
|
<a name="l00031"></a>00031 <a class="code" href="dbprim__int_8h.html#a0">RCSTAG</a>(<span class="stringliteral">"@(#)$Id: ll__flush_8c-source.html,v 1.3 2006/09/04 15:12:17 spale Exp $"</span>); |
| 32 |
|
|
<a name="l00032"></a>00032 |
| 33 |
|
|
<a name="l00033"></a>00033 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> |
| 34 |
|
|
<a name="l00034"></a><a class="code" href="group__dbprim__link.html#ga11">00034</a> <a class="code" href="group__dbprim__link.html#ga11">ll_flush</a>(<a class="code" href="struct__link__head__s.html">link_head_t</a> *list, <a class="code" href="group__dbprim__link.html#ga2">link_iter_t</a> flush_func, <span class="keywordtype">void</span> *extra) |
| 35 |
|
|
<a name="l00035"></a>00035 { |
| 36 |
|
|
<a name="l00036"></a>00036 <a class="code" href="struct__link__elem__s.html">link_elem_t</a> *elem; |
| 37 |
|
|
<a name="l00037"></a>00037 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> retval; |
| 38 |
|
|
<a name="l00038"></a>00038 |
| 39 |
|
|
<a name="l00039"></a>00039 initialize_dbpr_error_table(); <span class="comment">/* initialize error table */</span> |
| 40 |
|
|
<a name="l00040"></a>00040 |
| 41 |
|
|
<a name="l00041"></a>00041 <span class="keywordflow">if</span> (!<a class="code" href="group__dbprim__link.html#ga15">ll_verify</a>(list)) <span class="comment">/* Verify arguments */</span> |
| 42 |
|
|
<a name="l00042"></a>00042 <span class="keywordflow">return</span> DB_ERR_BADARGS; |
| 43 |
|
|
<a name="l00043"></a>00043 |
| 44 |
|
|
<a name="l00044"></a>00044 <span class="keywordflow">while</span> ((elem = list-><a class="code" href="struct__link__head__s.html#o2">lh_first</a>)) { <span class="comment">/* Walk through the list... */</span> |
| 45 |
|
|
<a name="l00045"></a>00045 <a class="code" href="group__dbprim__link.html#ga8">ll_remove</a>(list, elem); <span class="comment">/* remove the element */</span> |
| 46 |
|
|
<a name="l00046"></a>00046 <span class="comment">/* call flush function, erroring out if it fails */</span> |
| 47 |
|
|
<a name="l00047"></a>00047 <span class="keywordflow">if</span> (flush_func && (retval = (*flush_func)(list, elem, extra))) |
| 48 |
|
|
<a name="l00048"></a>00048 <span class="keywordflow">return</span> retval; |
| 49 |
|
|
<a name="l00049"></a>00049 } |
| 50 |
|
|
<a name="l00050"></a>00050 |
| 51 |
|
|
<a name="l00051"></a>00051 list-><a class="code" href="struct__link__head__s.html#o1">lh_count</a> = 0; <span class="comment">/* clear the list head */</span> |
| 52 |
|
|
<a name="l00052"></a>00052 list-><a class="code" href="struct__link__head__s.html#o2">lh_first</a> = 0; |
| 53 |
|
|
<a name="l00053"></a>00053 list-><a class="code" href="struct__link__head__s.html#o3">lh_last</a> = 0; |
| 54 |
|
|
<a name="l00054"></a>00054 |
| 55 |
|
|
<a name="l00055"></a>00055 <span class="keywordflow">return</span> 0; |
| 56 |
|
|
<a name="l00056"></a>00056 } |
| 57 |
|
|
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sat Jul 15 14:10:33 2006 for DatabasePrimitivesLibrary by |
| 58 |
|
|
<a href="http://www.doxygen.org/index.html"> |
| 59 |
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4 </small></address> |
| 60 |
|
|
</body> |
| 61 |
|
|
</html> |