binary_react_output_state.h 916 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef BINARY_REACT_OUTPUT_STATE_H
  2. #define BINARY_REACT_OUTPUT_STATE_H
  3. /* required for binary data reader */
  4. #include <zlib.h>
  5. #include <bzlib.h>
  6. /* some helper macros */
  7. #define COMPRESS_GZIP 1
  8. #define COMPRESS_BZIP2 2
  9. /*
  10. * struct keeping track of mcell simulation state required for
  11. * binary reaction data output
  12. */
  13. struct binary_output
  14. {
  15. /* number of reaction data items present in output block */
  16. int num_react_data;
  17. /* array holding the type of stored data (int or double) in each
  18. * data block */
  19. char *type_array;
  20. /* output filename and directory */
  21. char *filename;
  22. char *directory;
  23. /* file pointer to output file for uncompressed output */
  24. FILE *output_file;
  25. /* file pointer to gzip compressed file stream and compression
  26. * level */
  27. gzFile gz_compressed_output_file;
  28. BZFILE* bz_compressed_output_file;
  29. int compression_type;
  30. int compression_level;
  31. };
  32. #endif