ds.h

Go to the documentation of this file.
00001 /*
00002     $Id: ds_8h-source.html,v 1.9 2006/10/27 11:16:41 rocky Exp $
00003 
00004     Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
00005     Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 */
00021 
00029 
00030 #ifndef __CDIO_DS_H__
00031 #define __CDIO_DS_H__
00032 
00033 #include <cdio/types.h>
00034 
00036 typedef struct _CdioList CdioList_t;
00037 typedef struct _CdioListNode CdioListNode_t;
00038 
00039 typedef int (*_cdio_list_cmp_func_t) (void *p_data1, void *p_data2);
00040 typedef int (*_cdio_list_iterfunc_t) (void *p_data, void *p_user_data);
00041 
00044 #define CdioList CdioList_t
00045 #define CdioListNode CdioListNode_t
00046 #define _cdio_list_cmp_func _cdio_list_cmp_func_t
00047 #define _cdio_list_iterfunc _cdio_list_iterfunc_t
00048 
00049 #ifdef __cplusplus
00050 extern "C" {
00051 #endif /* __cplusplus */
00052 
00054 CdioList_t *_cdio_list_new (void);
00055 
00056 void _cdio_list_free (CdioList_t *p_list, int free_data);
00057 
00058 unsigned _cdio_list_length (const CdioList_t *list);
00059 
00060 void _cdio_list_prepend (CdioList_t *p_list, void *p_data);
00061 
00062 void _cdio_list_append (CdioList_t *p_list, void *p_data);
00063 
00064 void _cdio_list_foreach (CdioList_t *p_list, _cdio_list_iterfunc_t func, 
00065                          void *p_user_data);
00066 
00067 CdioListNode_t *_cdio_list_find (CdioList_t *p_list, 
00068                                  _cdio_list_iterfunc_t cmp_func, 
00069                                  void *p_user_data);
00070 
00071 #define _CDIO_LIST_FOREACH(node, list) \
00072  for (node = _cdio_list_begin (list); node; node = _cdio_list_node_next (node))
00073 
00076 CdioListNode_t *_cdio_list_begin (const CdioList_t *p_list);
00077 
00078 CdioListNode_t *_cdio_list_end (CdioList_t *p_list);
00079 
00080 CdioListNode_t *_cdio_list_node_next (CdioListNode_t *p_node);
00081 
00082 void _cdio_list_node_free (CdioListNode_t *p_node, int i_free_data);
00083 
00084 void *_cdio_list_node_data (CdioListNode_t *p_node);
00085 
00086 #ifdef __cplusplus
00087 }
00088 #endif /* __cplusplus */
00089 
00090 #endif /* __CDIO_DS_H__ */
00091 
00092 /* 
00093  * Local variables:
00094  *  c-file-style: "gnu"
00095  *  tab-width: 8
00096  *  indent-tabs-mode: nil
00097  * End:
00098  */
00099 

Generated on Fri Oct 27 06:38:08 2006 for libcdio by  doxygen 1.4.6