Blender  V2.59
BKE_customdata_file.h
Go to the documentation of this file.
00001 /*
00002  * $Id: BKE_customdata_file.h 35215 2011-02-27 08:31:10Z campbellbarton $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * ***** END GPL LICENSE BLOCK *****
00021  */
00022 
00023 #ifndef BKE_CUSTOMDATA_FILE_H
00024 #define BKE_CUSTOMDATA_FILE_H
00025 
00030 #define CDF_TYPE_IMAGE  0
00031 #define CDF_TYPE_MESH   1
00032 
00033 #define CDF_LAYER_NAME_MAX      64
00034 
00035 typedef struct CDataFile CDataFile;
00036 typedef struct CDataFileLayer CDataFileLayer;
00037 
00038 /* Create/Free */
00039 
00040 CDataFile *cdf_create(int type);
00041 void cdf_free(CDataFile *cdf);
00042 
00043 /* File read/write/remove */
00044 
00045 int cdf_read_open(CDataFile *cdf, char *filename);
00046 int cdf_read_layer(CDataFile *cdf, CDataFileLayer *blay);
00047 int cdf_read_data(CDataFile *cdf, unsigned int size, void *data);
00048 void cdf_read_close(CDataFile *cdf);
00049 
00050 int cdf_write_open(CDataFile *cdf, char *filename);
00051 int cdf_write_layer(CDataFile *cdf, CDataFileLayer *blay);
00052 int cdf_write_data(CDataFile *cdf, unsigned int size, void *data);
00053 void cdf_write_close(CDataFile *cdf);
00054 
00055 void cdf_remove(char *filename);
00056 
00057 /* Layers */
00058 
00059 CDataFileLayer *cdf_layer_find(CDataFile *cdf, int type, char *name);
00060 CDataFileLayer *cdf_layer_add(CDataFile *cdf, int type, char *name, size_t datasize);
00061 
00062 #endif /* BKE_CUSTOMDATA_FILE_H */
00063