Main Page | Modules | File List | Globals

gdsl_2darray.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__2darray_8h-source.html,v $
00021  * $Revision: 1.4 $
00022  * $Date: 2004/10/03 14:35:38 $
00023  */
00024 
00025 #ifndef _GDSL_2DARRAY_H_
00026 #define _GDSL_2DARRAY_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 
00052 typedef struct gdsl_2darray* gdsl_2darray_t;
00053 
00057 typedef enum
00058 {
00060     GDSL_2DARRAY_POSITION_FIRST_ROW = 1,
00061 
00063     GDSL_2DARRAY_POSITION_LAST_ROW = 2,
00064 
00066     GDSL_2DARRAY_POSITION_FIRST_COL = 4,
00067 
00069     GDSL_2DARRAY_POSITION_LAST_COL = 8
00070 
00071 } gdsl_2darray_position_t;
00072 
00081 typedef void (* gdsl_2darray_write_func_t) 
00082      (gdsl_element_t E,
00083       const FILE* OUTPUT_FILE,
00084       gdsl_2darray_position_t POSITION,
00085       void* USER_DATA
00086       );
00087 
00088 /******************************************************************************/
00089 /* Management functions of 2D-arrays                                          */
00090 /******************************************************************************/
00091 
00116 extern gdsl_2darray_t
00117 gdsl_2darray_alloc (const char* NAME,
00118             const ulong R,
00119             const ulong C,
00120             const gdsl_alloc_func_t ALLOC_F,
00121             const gdsl_free_func_t FREE_F
00122             );
00123 
00139 extern void 
00140 gdsl_2darray_free (gdsl_2darray_t A
00141            );
00142 
00143 /******************************************************************************/
00144 /* Consultation functions of 2D-arrays                                        */
00145 /******************************************************************************/
00146 
00156 extern const char*
00157 gdsl_2darray_get_name (const gdsl_2darray_t A
00158                );
00159 
00169 extern ulong
00170 gdsl_2darray_get_rows_number (const gdsl_2darray_t A
00171                   );
00172 
00182 extern ulong
00183 gdsl_2darray_get_columns_number (const gdsl_2darray_t A
00184                  );
00185 
00195 extern ulong
00196 gdsl_2darray_get_size (const gdsl_2darray_t A
00197                );
00198 
00211 extern gdsl_element_t
00212 gdsl_2darray_get_content (const gdsl_2darray_t A,
00213               const ulong R,
00214               const ulong C
00215               );
00216 
00217 /******************************************************************************/
00218 /* Modification functions of 2D-arrays                                        */
00219 /******************************************************************************/
00220 
00234 extern gdsl_2darray_t
00235 gdsl_2darray_set_name (gdsl_2darray_t A,
00236                const char* NEW_NAME
00237                );
00238 
00260 extern gdsl_element_t
00261 gdsl_2darray_set_content (gdsl_2darray_t A,
00262               const ulong R,
00263               const ulong C,
00264               void* VALUE
00265               );
00266 
00267 /******************************************************************************/
00268 /* Input/output functions of 2D-arrays                                        */
00269 /******************************************************************************/
00270 
00287 extern void
00288 gdsl_2darray_write (const gdsl_2darray_t A,
00289             const gdsl_2darray_write_func_t WRITE_F,
00290             FILE* OUTPUT_FILE,
00291             void* USER_DATA
00292             );
00293 
00311 extern void
00312 gdsl_2darray_write_xml (const gdsl_2darray_t A,
00313             const gdsl_write_func_t WRITE_F,
00314             FILE* OUTPUT_FILE,
00315             void* USER_DATA
00316             );
00317 
00335 extern void
00336 gdsl_2darray_dump (const gdsl_2darray_t A,
00337            const gdsl_write_func_t WRITE_F,
00338            FILE* OUTPUT_FILE,
00339            void* USER_DATA
00340            );
00341 
00342 /*
00343  * @}
00344  */
00345 
00346 
00347 #ifdef __cplusplus
00348 }
00349 #endif /* __cplusplus */
00350 
00351 
00352 #endif /* _GDSL_2DARRAY_H_ */
00353 

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