gdsl  1.6
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-2006 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.2 $
00022  * $Date: 2012/08/21 14:01:03 $
00023  */
00024 
00025 
00026 #ifndef _GDSL_2DARRAY_H_
00027 #define _GDSL_2DARRAY_H_
00028 
00029 
00030 #include <stdio.h>
00031 
00032 
00033 #include "gdsl_types.h"
00034 
00035 
00036 #ifdef __cplusplus
00037 extern "C" 
00038 {
00039 #endif /* __cplusplus */
00040 
00041 
00053 typedef struct gdsl_2darray* gdsl_2darray_t;
00054 
00055 /******************************************************************************/
00056 /* Management functions of 2D-arrays                                          */
00057 /******************************************************************************/
00058 
00083 extern gdsl_2darray_t
00084 gdsl_2darray_alloc (const char* NAME,
00085             const ulong R,
00086             const ulong C,
00087             const gdsl_alloc_func_t ALLOC_F,
00088             const gdsl_free_func_t FREE_F
00089             );
00090 
00106 extern void 
00107 gdsl_2darray_free (gdsl_2darray_t A
00108            );
00109 
00110 /******************************************************************************/
00111 /* Consultation functions of 2D-arrays                                        */
00112 /******************************************************************************/
00113 
00123 extern const char*
00124 gdsl_2darray_get_name (const gdsl_2darray_t A
00125                );
00126 
00136 extern ulong
00137 gdsl_2darray_get_rows_number (const gdsl_2darray_t A
00138                   );
00139 
00149 extern ulong
00150 gdsl_2darray_get_columns_number (const gdsl_2darray_t A
00151                  );
00152 
00162 extern ulong
00163 gdsl_2darray_get_size (const gdsl_2darray_t A
00164                );
00165 
00178 extern gdsl_element_t
00179 gdsl_2darray_get_content (const gdsl_2darray_t A,
00180               const ulong R,
00181               const ulong C
00182               );
00183 
00184 /******************************************************************************/
00185 /* Modification functions of 2D-arrays                                        */
00186 /******************************************************************************/
00187 
00201 extern gdsl_2darray_t
00202 gdsl_2darray_set_name (gdsl_2darray_t A,
00203                const char* NEW_NAME
00204                );
00205 
00227 extern gdsl_element_t
00228 gdsl_2darray_set_content (gdsl_2darray_t A,
00229               const ulong R,
00230               const ulong C,
00231               void* VALUE
00232               );
00233 
00234 /******************************************************************************/
00235 /* Input/output functions of 2D-arrays                                        */
00236 /******************************************************************************/
00237 
00254 extern void
00255 gdsl_2darray_write (const gdsl_2darray_t A,
00256             const gdsl_write_func_t WRITE_F,
00257             FILE* OUTPUT_FILE,
00258             void* USER_DATA
00259             );
00260 
00278 extern void
00279 gdsl_2darray_write_xml (const gdsl_2darray_t A,
00280             const gdsl_write_func_t WRITE_F,
00281             FILE* OUTPUT_FILE,
00282             void* USER_DATA
00283             );
00284 
00302 extern void
00303 gdsl_2darray_dump (const gdsl_2darray_t A,
00304            const gdsl_write_func_t WRITE_F,
00305            FILE* OUTPUT_FILE,
00306            void* USER_DATA
00307            );
00308 
00309 /*
00310  * @}
00311  */
00312 
00313 
00314 #ifdef __cplusplus
00315 }
00316 #endif /* __cplusplus */
00317 
00318 
00319 #endif /* _GDSL_2DARRAY_H_ */
00320 
00321