00001
00002 /*---------------------------------------------------------------------------
00003
00004 File name : charmatrix.h
00005 Author : N. Devillard
00006 Created on : July 2000
00007 Description : ASCII table generic reading to 2d char matrix.
00008
00009 *--------------------------------------------------------------------------*/
00010
00011 /*
00012 $Id
00013 $Author
00014 $Date
00015 $Revision
00016 */
00017
00018 #ifndef _CHARMATRIX_H_
00019 #define _CHARMATRIX_H_
00020
00021 /*---------------------------------------------------------------------------
00022 Includes
00023 ---------------------------------------------------------------------------*/
00024
00025 #include <stdio.h>
00026 #include <stdlib.h>
00027 #include <string.h>
00028 #include <unistd.h>
00029
00030 /*---------------------------------------------------------------------------
00031 New types
00032 ---------------------------------------------------------------------------*/
00033
00034 typedef struct _charmatrix_ {
00035 int lx ;
00036 int ly ;
00037 char ** c ;
00038 } charmatrix ;
00039
00040
00041 /*---------------------------------------------------------------------------
00042 Macros
00043 ---------------------------------------------------------------------------*/
00044
00045
00046 /*-------------------------------------------------------------------------*/
00061 /*--------------------------------------------------------------------------*/
00062
00063 #define charmatrix_elem(m,i,j) ((m)->c[i+j*(m)->lx])
00064
00065 /*---------------------------------------------------------------------------
00066 Function prototypes
00067 ---------------------------------------------------------------------------*/
00068
00069
00070 /*-------------------------------------------------------------------------*/
00085 /*--------------------------------------------------------------------------*/
00086
00087 charmatrix * charmatrix_new(int lx, int ly);
00088
00089
00090 /*-------------------------------------------------------------------------*/
00101 /*--------------------------------------------------------------------------*/
00102 void charmatrix_del(charmatrix * m);
00103
00104
00105
00106 /*-------------------------------------------------------------------------*/
00118 /*--------------------------------------------------------------------------*/
00119
00120 charmatrix * charmatrix_copy(charmatrix * c);
00121
00122
00123
00124 /*-------------------------------------------------------------------------*/
00138 /*--------------------------------------------------------------------------*/
00139
00140 void charmatrix_dump(charmatrix * m, FILE * out);
00141
00142 /*-------------------------------------------------------------------------*/
00163 /*--------------------------------------------------------------------------*/
00164
00165 charmatrix * charmatrix_read(char * filename);
00166
00167 #endif
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001