You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
1002 B

/**
* @file mpqapi.h
*
* Interface of functions for creating and editing MPQ files.
*/
#pragma once
#include <cstdint>
#include "engine.h"
namespace devilution {
struct _FILEHEADER {
int signature;
int headersize;
uint32_t filesize;
uint16_t version;
int16_t sectorsizeid;
int hashoffset;
int blockoffset;
int hashcount;
int blockcount;
uint8_t pad[72];
};
struct _HASHENTRY {
uint32_t hashcheck[2];
uint32_t lcid;
int32_t block;
};
struct _BLOCKENTRY {
uint32_t offset;
uint32_t sizealloc;
uint32_t sizefile;
uint32_t flags;
};
void mpqapi_remove_hash_entry(const char *pszName);
void mpqapi_remove_hash_entries(bool (*fnGetName)(uint8_t, char *));
bool mpqapi_write_file(const char *pszName, const byte *pbData, size_t dwLen);
void mpqapi_rename(char *pszOld, char *pszNew);
bool mpqapi_has_file(const char *pszName);
bool OpenMPQ(const char *pszArchive);
bool mpqapi_flush_and_close(bool bFree);
} // namespace devilution