Blender V2.61 - r43446

BKE_customdata_file.h

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