mat5.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (C) 2008 Christopher C. Hulbert
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef MAT5_H
  19. #define MAT5_H
  20. #include "matio.h"
  21. #ifdef __cplusplus
  22. # define EXTERN extern "C"
  23. #else
  24. # define EXTERN extern
  25. #endif
  26. EXTERN int WriteCellArrayField(mat_t *mat,matvar_t *matvar );
  27. EXTERN int WriteCellArrayFieldInfo(mat_t *mat,matvar_t *matvar);
  28. EXTERN int WriteStructField(mat_t *mat,matvar_t *matvar);
  29. #if defined(HAVE_ZLIB)
  30. EXTERN size_t WriteCompressedCellArrayField(mat_t *mat,matvar_t *matvar,
  31. z_stream *z);
  32. EXTERN size_t WriteCompressedStructField(mat_t *mat,matvar_t *matvar,
  33. z_stream *z);
  34. #endif
  35. EXTERN int ReadNextStructField( mat_t *mat, matvar_t *matvar );
  36. EXTERN int ReadNextCell( mat_t *mat, matvar_t *matvar );
  37. EXTERN int WriteEmptyCharData(mat_t *mat, int N, int data_type);
  38. /* mat5.c */
  39. void Mat_VarPrint5( matvar_t *matvar, int printdata );
  40. matvar_t *Mat_VarReadNextInfo5( mat_t *mat );
  41. void Read5(mat_t *mat, matvar_t *matvar);
  42. int ReadData5(mat_t *mat,matvar_t *matvar,void *data,
  43. int *start,int *stride,int *edge);
  44. int Write5(mat_t *mat,matvar_t *matvar,int compress);
  45. int WriteCharDataSlab2(mat_t *mat,void *data,int data_type,int *dims,
  46. int *start,int *stride,int *edge);
  47. #if defined(HAVE_ZLIB)
  48. size_t WriteCompressedData(mat_t *mat,z_stream *z,void *data,int N,
  49. int data_type);
  50. size_t WriteCompressedCharData(mat_t *mat,z_stream *z,void *data,int N,
  51. int data_type);
  52. #endif
  53. int WriteData(mat_t *mat,void *data,int N,int data_type);
  54. int WriteDataSlab2(mat_t *mat,void *data,int data_type,int *dims,
  55. int *start,int *stride,int *edge);
  56. void WriteInfo5(mat_t *mat, matvar_t *matvar);
  57. #endif