Blender V2.61 - r43446

BKE_packedFile.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  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 #ifndef BKE_PACKEDFILE_H
00028 #define BKE_PACKEDFILE_H
00029 
00035 #define RET_OK      0
00036 #define RET_ERROR   1
00037 
00038 struct bSound;
00039 struct Image;
00040 struct Main;
00041 struct PackedFile;
00042 struct ReportList;
00043 struct VFont;
00044 
00045 /* pack */
00046 struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename, const char *relabase);
00047 struct PackedFile *newPackedFileMemory(void *mem, int memlen);
00048 
00049 void packAll(struct Main *bmain, struct ReportList *reports);
00050 
00051 /* unpack */
00052 char *unpackFile(struct ReportList *reports, const char *abs_name, const char *local_name, struct PackedFile *pf, int how);
00053 int unpackVFont(struct ReportList *reports, struct VFont *vfont, int how);
00054 int unpackSound(struct Main *bmain, struct ReportList *reports, struct bSound *sound, int how);
00055 int unpackImage(struct ReportList *reports, struct Image *ima, int how);
00056 void unpackAll(struct Main *bmain, struct ReportList *reports, int how);
00057 
00058 int writePackedFile(struct ReportList *reports, const char *filename, struct PackedFile *pf, int guimode);
00059 
00060 /* free */
00061 void freePackedFile(struct PackedFile *pf);
00062 
00063 /* info */
00064 int countPackedFiles(struct Main *bmain);
00065 int checkPackedFile(const char *filename, struct PackedFile *pf);
00066 
00067 /* read */
00068 int seekPackedFile(struct PackedFile *pf, int offset, int whence);
00069 void rewindPackedFile(struct PackedFile *pf);
00070 int readPackedFile(struct PackedFile *pf, void *data, int size);
00071 
00072 #endif
00073