gdsl  1.8
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-2017 Nicolas Darnis <ndarnis@free.fr>.
00004  *
00005  * GDSL is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation, either version 3 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * GDSL 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 GDSL.  If not, see <http://www.gnu.org/licenses/>. 
00017  *
00018  * $RCSfile: gdsl_2darray.h,v $
00019  * $Revision: 1.18 $
00020  * $Date: 2015/02/17 12:22:56 $
00021  */
00022 
00023 
00024 #ifndef _GDSL_2DARRAY_H_
00025 #define _GDSL_2DARRAY_H_
00026 
00027 
00028 #include <stdio.h>
00029 
00030 
00031 #include "gdsl_types.h"
00032 
00033 
00034 #ifdef __cplusplus
00035 extern "C" 
00036 {
00037 #endif /* __cplusplus */
00038 
00069 typedef struct gdsl_2darray* gdsl_2darray_t;
00070 
00071 /******************************************************************************/
00072 /* Management functions of 2D-arrays                                          */
00073 /******************************************************************************/
00074 
00099 extern gdsl_2darray_t
00100 gdsl_2darray_alloc (const char* NAME,
00101             const ulong R,
00102             const ulong C,
00103             const gdsl_alloc_func_t ALLOC_F,
00104             const gdsl_free_func_t FREE_F
00105             );
00106 
00122 extern void 
00123 gdsl_2darray_free (gdsl_2darray_t A
00124            );
00125 
00126 /******************************************************************************/
00127 /* Consultation functions of 2D-arrays                                        */
00128 /******************************************************************************/
00129 
00139 extern const char*
00140 gdsl_2darray_get_name (const gdsl_2darray_t A
00141                );
00142 
00152 extern ulong
00153 gdsl_2darray_get_rows_number (const gdsl_2darray_t A
00154                   );
00155 
00165 extern ulong
00166 gdsl_2darray_get_columns_number (const gdsl_2darray_t A
00167                  );
00168 
00178 extern ulong
00179 gdsl_2darray_get_size (const gdsl_2darray_t A
00180                );
00181 
00194 extern gdsl_element_t
00195 gdsl_2darray_get_content (const gdsl_2darray_t A,
00196               const ulong R,
00197               const ulong C
00198               );
00199 
00200 /******************************************************************************/
00201 /* Modification functions of 2D-arrays                                        */
00202 /******************************************************************************/
00203 
00217 extern gdsl_2darray_t
00218 gdsl_2darray_set_name (gdsl_2darray_t A,
00219                const char* NEW_NAME
00220                );
00221 
00243 extern gdsl_element_t
00244 gdsl_2darray_set_content (gdsl_2darray_t A,
00245               const ulong R,
00246               const ulong C,
00247               void* VALUE
00248               );
00249 
00250 /******************************************************************************/
00251 /* Input/output functions of 2D-arrays                                        */
00252 /******************************************************************************/
00253 
00270 extern void
00271 gdsl_2darray_write (const gdsl_2darray_t A,
00272             const gdsl_write_func_t WRITE_F,
00273             FILE* OUTPUT_FILE,
00274             void* USER_DATA
00275             );
00276 
00294 extern void
00295 gdsl_2darray_write_xml (const gdsl_2darray_t A,
00296             const gdsl_write_func_t WRITE_F,
00297             FILE* OUTPUT_FILE,
00298             void* USER_DATA
00299             );
00300 
00318 extern void
00319 gdsl_2darray_dump (const gdsl_2darray_t A,
00320            const gdsl_write_func_t WRITE_F,
00321            FILE* OUTPUT_FILE,
00322            void* USER_DATA
00323            );
00324 
00330 #ifdef __cplusplus
00331 }
00332 #endif /* __cplusplus */
00333 
00334 
00335 #endif /* _GDSL_2DARRAY_H_ */
00336 
00337