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-2018 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 
00019 /*
00020  * GDSL - Generic Data Structures Library
00021  * $RCSfile: gdsl_2darray.h,v $
00022  * $Revision: 1.18 $
00023  * $Date: 2015/02/17 12:22:56 $
00024  */
00025 
00026 
00027 #ifndef _GDSL_2DARRAY_H_
00028 #define _GDSL_2DARRAY_H_
00029 
00030 
00031 #include <stdio.h>
00032 
00033 
00034 #include "gdsl_types.h"
00035 
00036 
00037 #ifdef __cplusplus
00038 extern "C" 
00039 {
00040 #endif /* __cplusplus */
00041 
00054 typedef struct gdsl_2darray* gdsl_2darray_t;
00055 
00056 /******************************************************************************/
00057 /* Management functions of 2D-arrays                                          */
00058 /******************************************************************************/
00059 
00084 extern gdsl_2darray_t
00085 gdsl_2darray_alloc (const char* NAME,
00086             const ulong R,
00087             const ulong C,
00088             const gdsl_alloc_func_t ALLOC_F,
00089             const gdsl_free_func_t FREE_F
00090             );
00091 
00107 extern void 
00108 gdsl_2darray_free (gdsl_2darray_t A
00109            );
00110 
00111 /******************************************************************************/
00112 /* Consultation functions of 2D-arrays                                        */
00113 /******************************************************************************/
00114 
00124 extern const char*
00125 gdsl_2darray_get_name (const gdsl_2darray_t A
00126                );
00127 
00137 extern ulong
00138 gdsl_2darray_get_rows_number (const gdsl_2darray_t A
00139                   );
00140 
00150 extern ulong
00151 gdsl_2darray_get_columns_number (const gdsl_2darray_t A
00152                  );
00153 
00163 extern ulong
00164 gdsl_2darray_get_size (const gdsl_2darray_t A
00165                );
00166 
00179 extern gdsl_element_t
00180 gdsl_2darray_get_content (const gdsl_2darray_t A,
00181               const ulong R,
00182               const ulong C
00183               );
00184 
00185 /******************************************************************************/
00186 /* Modification functions of 2D-arrays                                        */
00187 /******************************************************************************/
00188 
00202 extern gdsl_2darray_t
00203 gdsl_2darray_set_name (gdsl_2darray_t A,
00204                const char* NEW_NAME
00205                );
00206 
00228 extern gdsl_element_t
00229 gdsl_2darray_set_content (gdsl_2darray_t A,
00230               const ulong R,
00231               const ulong C,
00232               void* VALUE
00233               );
00234 
00235 /******************************************************************************/
00236 /* Input/output functions of 2D-arrays                                        */
00237 /******************************************************************************/
00238 
00255 extern void
00256 gdsl_2darray_write (const gdsl_2darray_t A,
00257             const gdsl_write_func_t WRITE_F,
00258             FILE* OUTPUT_FILE,
00259             void* USER_DATA
00260             );
00261 
00279 extern void
00280 gdsl_2darray_write_xml (const gdsl_2darray_t A,
00281             const gdsl_write_func_t WRITE_F,
00282             FILE* OUTPUT_FILE,
00283             void* USER_DATA
00284             );
00285 
00303 extern void
00304 gdsl_2darray_dump (const gdsl_2darray_t A,
00305            const gdsl_write_func_t WRITE_F,
00306            FILE* OUTPUT_FILE,
00307            void* USER_DATA
00308            );
00309 
00315 #ifdef __cplusplus
00316 }
00317 #endif /* __cplusplus */
00318 
00319 
00320 #endif /* _GDSL_2DARRAY_H_ */
00321 
00322