Blender V2.61 - r43446
|
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_image_types.h"
#include "DNA_sound_types.h"
#include "DNA_vfont_types.h"
#include "DNA_packedFile_types.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "BKE_utildefines.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_sound.h"
#include "BKE_image.h"
#include "BKE_packedFile.h"
#include "BKE_report.h"
Go to the source code of this file.
Functions | |
int | seekPackedFile (PackedFile *pf, int offset, int whence) |
void | rewindPackedFile (PackedFile *pf) |
int | readPackedFile (PackedFile *pf, void *data, int size) |
int | countPackedFiles (Main *bmain) |
void | freePackedFile (PackedFile *pf) |
PackedFile * | newPackedFileMemory (void *mem, int memlen) |
PackedFile * | newPackedFile (ReportList *reports, const char *filename, const char *basepath) |
void | packAll (Main *bmain, ReportList *reports) |
int | writePackedFile (ReportList *reports, const char *filename, PackedFile *pf, int guimode) |
int | checkPackedFile (const char *filename, PackedFile *pf) |
char * | unpackFile (ReportList *reports, const char *abs_name, const char *local_name, PackedFile *pf, int how) |
int | unpackVFont (ReportList *reports, VFont *vfont, int how) |
int | unpackSound (Main *bmain, ReportList *reports, bSound *sound, int how) |
int | unpackImage (ReportList *reports, Image *ima, int how) |
void | unpackAll (Main *bmain, ReportList *reports, int how) |
Definition in file packedFile.c.
int checkPackedFile | ( | const char * | filename, |
PackedFile * | pf | ||
) |
Definition at line 335 of file packedFile.c.
References BLI_path_abs(), BLI_strncpy(), PackedFile::data, FILE_MAX, G, i, len(), O_BINARY, PF_DIFFERS, PF_EQUAL, PF_NOFILE, and PackedFile::size.
Referenced by unpack_menu().
int countPackedFiles | ( | Main * | bmain | ) |
Definition at line 125 of file packedFile.c.
References ListBase::first, bSound::id, VFont::id, Image::id, Main::image, ID::next, bSound::packedfile, VFont::packedfile, Image::packedfile, Main::sound, and Main::vfont.
Referenced by unpack_all_invoke().
void freePackedFile | ( | PackedFile * | pf | ) |
Definition at line 148 of file packedFile.c.
References PackedFile::data, and MEM_freeN().
Referenced by BKE_image_memorypack(), BKE_image_signal(), free_image(), free_ttfont(), free_vfont(), load_vfont(), sound_free(), unpackImage(), unpackSound(), unpackVFont(), and vfont_get_data().
PackedFile* newPackedFile | ( | ReportList * | reports, |
const char * | filename, | ||
const char * | basepath | ||
) | [read] |
Definition at line 167 of file packedFile.c.
References BKE_reportf(), BLI_file_descriptor_size(), BLI_path_abs(), BLI_strncpy(), data, FILE_MAX, MEM_mallocN(), newPackedFileMemory(), NULL, O_BINARY, pf, and RPT_ERROR.
Referenced by BKE_image_signal(), image_load_image_file(), image_pack_exec(), load_vfont(), packAll(), sound_pack_exec(), and vfont_get_data().
PackedFile* newPackedFileMemory | ( | void * | mem, |
int | memlen | ||
) | [read] |
Definition at line 158 of file packedFile.c.
References PackedFile::data, MEM_callocN(), pf, and PackedFile::size.
Referenced by get_builtin_packedfile(), and newPackedFile().
void packAll | ( | Main * | bmain, |
ReportList * | reports | ||
) |
Definition at line 214 of file packedFile.c.
References BKE_reportf(), ELEM, ListBase::first, FO_BUILTIN_NAME, bSound::id, VFont::id, Image::id, ID_BLEND_PATH, IMA_SRC_FILE, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, Main::image, ID::lib, bSound::name, Main::name, VFont::name, ID::name, Image::name, newPackedFile(), ID::next, NULL, bSound::packedfile, VFont::packedfile, Image::packedfile, RPT_WARNING, Main::sound, Image::source, and Main::vfont.
Referenced by pack_all_exec(), and WM_write_file().
int readPackedFile | ( | PackedFile * | pf, |
void * | data, | ||
int | size | ||
) |
Definition at line 104 of file packedFile.c.
References PackedFile::data, NULL, PackedFile::seek, size(), and PackedFile::size.
void rewindPackedFile | ( | PackedFile * | pf | ) |
Definition at line 99 of file packedFile.c.
References seekPackedFile().
int seekPackedFile | ( | PackedFile * | pf, |
int | offset, | ||
int | whence | ||
) |
Definition at line 69 of file packedFile.c.
References PackedFile::seek, rna_dump::seek(), and PackedFile::size.
Referenced by rewindPackedFile().
void unpackAll | ( | Main * | bmain, |
ReportList * | reports, | ||
int | how | ||
) |
Definition at line 524 of file packedFile.c.
References ListBase::first, bSound::id, VFont::id, Image::id, Main::image, ID::next, bSound::packedfile, VFont::packedfile, Image::packedfile, Main::sound, unpackImage(), unpackSound(), unpackVFont(), and Main::vfont.
Referenced by unpack_all_exec().
char* unpackFile | ( | ReportList * | reports, |
const char * | abs_name, | ||
const char * | local_name, | ||
PackedFile * | pf, | ||
int | how | ||
) |
Definition at line 392 of file packedFile.c.
References BLI_exists(), BLI_strdup(), NULL, PF_KEEP, PF_REMOVE, PF_USE_LOCAL, PF_USE_ORIGINAL, PF_WRITE_LOCAL, PF_WRITE_ORIGINAL, RET_OK, and writePackedFile().
Referenced by unpackImage(), unpackSound(), and unpackVFont().
int unpackImage | ( | ReportList * | reports, |
Image * | ima, | ||
int | how | ||
) |
Definition at line 499 of file packedFile.c.
References BKE_image_signal(), BLI_snprintf(), BLI_splitdirstring(), BLI_strncpy(), FILE_MAX, FILE_MAXDIR, freePackedFile(), IMA_SIGNAL_RELOAD, MEM_freeN(), Image::name, NULL, Image::packedfile, RET_ERROR, RET_OK, and unpackFile().
Referenced by image_unpack_exec(), and unpackAll().
int unpackSound | ( | Main * | bmain, |
ReportList * | reports, | ||
bSound * | sound, | ||
int | how | ||
) |
Definition at line 471 of file packedFile.c.
References BLI_snprintf(), BLI_splitdirstring(), BLI_strncpy(), FILE_MAX, FILE_MAXDIR, freePackedFile(), MEM_freeN(), bSound::name, NULL, bSound::packedfile, RET_ERROR, RET_OK, sound_load(), and unpackFile().
Referenced by sound_unpack_exec(), and unpackAll().
int unpackVFont | ( | ReportList * | reports, |
VFont * | vfont, | ||
int | how | ||
) |
Definition at line 446 of file packedFile.c.
References BLI_snprintf(), BLI_splitdirstring(), BLI_strncpy(), FILE_MAX, FILE_MAXFILE, freePackedFile(), MEM_freeN(), VFont::name, NULL, VFont::packedfile, RET_ERROR, RET_OK, and unpackFile().
Referenced by unpackAll().
int writePackedFile | ( | ReportList * | reports, |
const char * | filename, | ||
PackedFile * | pf, | ||
int | guimode | ||
) |
Definition at line 267 of file packedFile.c.
References BKE_reportf(), BLI_copy(), BLI_delete(), BLI_exists(), BLI_make_existing_file(), BLI_path_abs(), BLI_rename(), BLI_snprintf(), BLI_strncpy(), PackedFile::data, FALSE, FILE_MAX, G, O_BINARY, RET_ERROR, RET_OK, RPT_ERROR, PackedFile::size, TRUE, and io_export_cycles_xml::write().
Referenced by unpackFile().