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 
00039 
00051 typedef struct gdsl_2darray* gdsl_2darray_t;
00052 
00053 /******************************************************************************/
00054 /* Management functions of 2D-arrays                                          */
00055 /******************************************************************************/
00056 
00081 extern gdsl_2darray_t
00082 gdsl_2darray_alloc (const char* NAME,
00083             const ulong R,
00084             const ulong C,
00085             const gdsl_alloc_func_t ALLOC_F,
00086             const gdsl_free_func_t FREE_F
00087             );
00088 
00104 extern void 
00105 gdsl_2darray_free (gdsl_2darray_t A
00106            );
00107 
00108 /******************************************************************************/
00109 /* Consultation functions of 2D-arrays                                        */
00110 /******************************************************************************/
00111 
00121 extern const char*
00122 gdsl_2darray_get_name (const gdsl_2darray_t A
00123                );
00124 
00134 extern ulong
00135 gdsl_2darray_get_rows_number (const gdsl_2darray_t A
00136                   );
00137 
00147 extern ulong
00148 gdsl_2darray_get_columns_number (const gdsl_2darray_t A
00149                  );
00150 
00160 extern ulong
00161 gdsl_2darray_get_size (const gdsl_2darray_t A
00162                );
00163 
00176 extern gdsl_element_t
00177 gdsl_2darray_get_content (const gdsl_2darray_t A,
00178               const ulong R,
00179               const ulong C
00180               );
00181 
00182 /******************************************************************************/
00183 /* Modification functions of 2D-arrays                                        */
00184 /******************************************************************************/
00185 
00199 extern gdsl_2darray_t
00200 gdsl_2darray_set_name (gdsl_2darray_t A,
00201                const char* NEW_NAME
00202                );
00203 
00225 extern gdsl_element_t
00226 gdsl_2darray_set_content (gdsl_2darray_t A,
00227               const ulong R,
00228               const ulong C,
00229               void* VALUE
00230               );
00231 
00232 /******************************************************************************/
00233 /* Input/output functions of 2D-arrays                                        */
00234 /******************************************************************************/
00235 
00252 extern void
00253 gdsl_2darray_write (const gdsl_2darray_t A,
00254             const gdsl_write_func_t WRITE_F,
00255             FILE* OUTPUT_FILE,
00256             void* USER_DATA
00257             );
00258 
00276 extern void
00277 gdsl_2darray_write_xml (const gdsl_2darray_t A,
00278             const gdsl_write_func_t WRITE_F,
00279             FILE* OUTPUT_FILE,
00280             void* USER_DATA
00281             );
00282 
00300 extern void
00301 gdsl_2darray_dump (const gdsl_2darray_t A,
00302            const gdsl_write_func_t WRITE_F,
00303            FILE* OUTPUT_FILE,
00304            void* USER_DATA
00305            );
00306 
00307 /*
00308  * @}
00309  */
00310 
00311 
00312 #ifdef __cplusplus
00313 }
00314 #endif /* __cplusplus */
00315 
00316 
00317 #endif /* _GDSL_2DARRAY_H_ */
00318 
00319