2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software Foundation,
14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17 * All rights reserved.
19 #ifndef __BKE_PACKEDFILE_H__
20 #define __BKE_PACKEDFILE_H__
37 struct PackedFile *BKE_packedfile_duplicate(const struct PackedFile *pf_src);
38 struct PackedFile *BKE_packedfile_new(struct ReportList *reports,
40 const char *relabase);
41 struct PackedFile *BKE_packedfile_new_from_memory(void *mem, int memlen);
43 void BKE_packedfile_pack_all(struct Main *bmain, struct ReportList *reports, bool verbose);
44 void BKE_packedfile_pack_all_libraries(struct Main *bmain, struct ReportList *reports);
47 char *BKE_packedfile_unpack_to_file(struct ReportList *reports,
48 const char *ref_file_name,
50 const char *local_name,
51 struct PackedFile *pf,
53 int BKE_packedfile_unpack_vfont(struct Main *bmain,
54 struct ReportList *reports,
57 int BKE_packedfile_unpack_sound(struct Main *bmain,
58 struct ReportList *reports,
61 int BKE_packedfile_unpack_image(struct Main *bmain,
62 struct ReportList *reports,
65 void BKE_packedfile_unpack_all(struct Main *bmain, struct ReportList *reports, int how);
66 int BKE_packedfile_unpack_all_libraries(struct Main *bmain, struct ReportList *reports);
68 int BKE_packedfile_write_to_file(struct ReportList *reports,
69 const char *ref_file_name,
71 struct PackedFile *pf,
75 void BKE_packedfile_free(struct PackedFile *pf);
78 int BKE_packedfile_count_all(struct Main *bmain);
79 int BKE_packedfile_compare_to_file(const char *ref_file_name,
81 struct PackedFile *pf);
84 int BKE_packedfile_seek(struct PackedFile *pf, int offset, int whence);
85 void BKE_packedfile_rewind(struct PackedFile *pf);
86 int BKE_packedfile_read(struct PackedFile *pf, void *data, int size);
88 /* ID should be not NULL, return 1 if there's a packed file */
89 bool BKE_packedfile_id_check(struct ID *id);
90 /* ID should be not NULL, throws error when ID is Library */
91 void BKE_packedfile_id_unpack(struct Main *bmain,
93 struct ReportList *reports,