BKE_customdata_file.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * ***** BEGIN GPL LICENSE BLOCK *****
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program 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
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software Foundation,
  16. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. *
  18. * ***** END GPL LICENSE BLOCK *****
  19. */
  20. #ifndef __BKE_CUSTOMDATA_FILE_H__
  21. #define __BKE_CUSTOMDATA_FILE_H__
  22. /** \file BKE_customdata_file.h
  23. * \ingroup bke
  24. */
  25. #define CDF_TYPE_IMAGE 0
  26. #define CDF_TYPE_MESH 1
  27. #define CDF_LAYER_NAME_MAX 64
  28. typedef struct CDataFile CDataFile;
  29. typedef struct CDataFileLayer CDataFileLayer;
  30. /* Create/Free */
  31. CDataFile *cdf_create(int type);
  32. void cdf_free(CDataFile *cdf);
  33. /* File read/write/remove */
  34. bool cdf_read_open(CDataFile *cdf, const char *filename);
  35. bool cdf_read_layer(CDataFile *cdf, CDataFileLayer *blay);
  36. bool cdf_read_data(CDataFile *cdf, unsigned int size, void *data);
  37. void cdf_read_close(CDataFile *cdf);
  38. bool cdf_write_open(CDataFile *cdf, const char *filename);
  39. bool cdf_write_layer(CDataFile *cdf, CDataFileLayer *blay);
  40. bool cdf_write_data(CDataFile *cdf, unsigned int size, void *data);
  41. void cdf_write_close(CDataFile *cdf);
  42. void cdf_remove(const char *filename);
  43. /* Layers */
  44. CDataFileLayer *cdf_layer_find(CDataFile *cdf, int type, const char *name);
  45. CDataFileLayer *cdf_layer_add(CDataFile *cdf, int type, const char *name, size_t datasize);
  46. #endif /* __BKE_CUSTOMDATA_FILE_H__ */