123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #ifndef bspatch_h__
- #define bspatch_h__
- #define OK 0
- #define MEM_ERROR 1
- #define USAGE_ERROR 3
- #define CRC_ERROR 4
- #define PARSE_ERROR 5
- #define READ_ERROR 6
- #define WRITE_ERROR 7
- #define UNEXPECTED_ERROR 8
- typedef struct MBSPatchHeader_ {
-
- char tag[8];
-
-
- unsigned int slen;
-
- unsigned int scrc32;
-
- unsigned int dlen;
-
- unsigned int cblen;
-
- unsigned int difflen;
-
- unsigned int extralen;
-
-
-
- } MBSPatchHeader;
- int MBS_ReadHeader(int fd, MBSPatchHeader *header);
- int MBS_ApplyPatch(const MBSPatchHeader *header, int patchfd,
- unsigned char *fbuffer, int filefd);
- typedef struct MBSPatchTriple_ {
- unsigned int x;
- unsigned int y;
- int z;
- } MBSPatchTriple;
- int ApplyBinaryPatch(const wchar_t *old_file, const wchar_t *patch_file,
- const wchar_t *new_file);
- int CalculateCrc(const unsigned char *buf, int size);
- #endif
|