Main Page | Modules | File List | Globals

gdsl_queue.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of the Generic Data Structures Library (GDSL).
00003  * Copyright (C) 1998-2004 Nicolas Darnis <ndarnis@free.fr>.
00004  *
00005  * The GDSL library is free software; you can redistribute it and/or 
00006  * modify it under the terms of the GNU General Public License as 
00007  * published by the Free Software Foundation; either version 2 of
00008  * the License, or (at your option) any later version.
00009  *
00010  * The GDSL library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with the GDSL library; see the file COPYING.
00017  * If not, write to the Free Software Foundation, Inc., 
00018  * 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
00019  *
00020  * $RCSfile: gdsl__queue_8h-source.html,v $
00021  * $Revision: 1.4 $
00022  * $Date: 2004/10/03 14:35:38 $
00023  */
00024 
00025 #ifndef _GDSL_QUEUE_H_
00026 #define _GDSL_QUEUE_H_
00027 
00028 
00029 #include <stdio.h>
00030 
00031 
00032 #include "gdsl_types.h"
00033 
00034 
00035 #ifdef __cplusplus
00036 extern "C" 
00037 {
00038 #endif /* __cplusplus */
00039 
00040 
00053 typedef struct _gdsl_queue* gdsl_queue_t;
00054 
00055 /******************************************************************************/
00056 /* Management functions of queues                                             */
00057 /******************************************************************************/
00058 
00079 extern gdsl_queue_t
00080 gdsl_queue_alloc (const char* NAME,
00081           gdsl_alloc_func_t ALLOC_F,
00082           gdsl_free_func_t FREE_F
00083           );
00084 
00098 extern void 
00099 gdsl_queue_free (gdsl_queue_t Q
00100          );
00101 
00115 extern void
00116 gdsl_queue_flush (gdsl_queue_t Q
00117           );
00118 
00119 /******************************************************************************/
00120 /* Consultation functions of queues                                           */
00121 /******************************************************************************/
00122 
00132 extern const char*
00133 gdsl_queue_get_name (const gdsl_queue_t Q
00134              );
00135 
00143 extern ulong
00144 gdsl_queue_get_size (const gdsl_queue_t Q
00145              );
00146 
00155 extern bool 
00156 gdsl_queue_is_empty (const gdsl_queue_t Q
00157              );
00158 
00169 extern gdsl_element_t
00170 gdsl_queue_get_head (const gdsl_queue_t Q
00171              );
00172 
00183 extern gdsl_element_t
00184 gdsl_queue_get_tail (const gdsl_queue_t Q
00185              );
00186 
00187 /******************************************************************************/
00188 /* Modification functions of queues                                           */
00189 /******************************************************************************/
00190 
00204 extern gdsl_queue_t
00205 gdsl_queue_set_name (gdsl_queue_t Q,
00206              const char* NEW_NAME
00207              );
00208 
00224 extern gdsl_element_t
00225 gdsl_queue_insert (gdsl_queue_t Q,
00226            void* VALUE
00227            );
00228 
00241 extern gdsl_element_t
00242 gdsl_queue_remove (gdsl_queue_t Q
00243            );
00244 
00245 /******************************************************************************/
00246 /* Search functions of queues                                                 */
00247 /******************************************************************************/
00248 
00264 extern gdsl_element_t
00265 gdsl_queue_search (const gdsl_queue_t Q,
00266            gdsl_compare_func_t COMP_F,
00267            void* VALUE
00268            );
00269 
00280 extern gdsl_element_t
00281 gdsl_queue_search_by_position (const gdsl_queue_t Q,
00282                    ulong POS
00283                    );
00284 
00285 /******************************************************************************/
00286 /* Parse functions of queues                                                  */
00287 /******************************************************************************/
00288 
00306 extern gdsl_element_t
00307 gdsl_queue_map_forward (const gdsl_queue_t Q,
00308             gdsl_map_func_t MAP_F,
00309             void* USER_DATA
00310             );
00311 
00329 extern gdsl_element_t
00330 gdsl_queue_map_backward (const gdsl_queue_t Q,
00331              gdsl_map_func_t MAP_F,
00332              void* USER_DATA
00333              );
00334 
00335 /******************************************************************************/
00336 /* Input/output functions of queues                                           */
00337 /******************************************************************************/
00338 
00354 extern void
00355 gdsl_queue_write (const gdsl_queue_t Q,
00356           gdsl_write_func_t WRITE_F,
00357           FILE* OUTPUT_FILE,
00358           void* USER_DATA
00359           );
00360 
00377 extern void
00378 gdsl_queue_write_xml (const gdsl_queue_t Q,
00379               gdsl_write_func_t WRITE_F,
00380               FILE* OUTPUT_FILE,
00381               void* USER_DATA
00382               );
00383 
00400 extern void 
00401 gdsl_queue_dump (const gdsl_queue_t Q,
00402          gdsl_write_func_t WRITE_F,
00403          FILE* OUTPUT_FILE,
00404          void* USER_DATA
00405          );
00406 
00407 /*
00408  * @}
00409  */
00410 
00411 
00412 #ifdef __cplusplus
00413 }
00414 #endif /* __cplusplus */
00415 
00416 
00417 #endif /* _GDSL_QUEUE_H_ */
00418 

Generated on Sun Oct 3 16:15:50 2004 for GDSL by doxygen 1.3.5