LibreOffice Module onlineupdate (master) 1
|
#include <stdint.h>
#include <stdio.h>
Go to the source code of this file.
Classes | |
struct | MBSPatchHeader_ |
struct | MBSPatchTriple_ |
Typedefs | |
typedef struct MBSPatchHeader_ | MBSPatchHeader |
typedef struct MBSPatchTriple_ | MBSPatchTriple |
Functions | |
int | MBS_ReadHeader (FILE *file, MBSPatchHeader *header) |
Read the header of a patch file into the MBSPatchHeader structure. More... | |
int | MBS_ApplyPatch (const MBSPatchHeader *header, FILE *patchFile, unsigned char *fbuffer, FILE *file) |
Apply a patch. More... | |
typedef struct MBSPatchHeader_ MBSPatchHeader |
typedef struct MBSPatchTriple_ MBSPatchTriple |
int MBS_ApplyPatch | ( | const MBSPatchHeader * | header, |
FILE * | patchFile, | ||
unsigned char * | fbuffer, | ||
FILE * | file | ||
) |
Apply a patch.
This method does not validate the checksum of the original file: client code should validate the checksum before calling this method.
patchfd | Must have been processed by MBS_ReadHeader |
fbuffer | The original file read into a memory buffer of length header->slen. |
filefd | Must have been opened for writing. Should be truncated to header->dlen if it is an existing file. The offset should be at the beginning of the file. |
Definition at line 91 of file bspatch.cxx.
References BSPATCH_MEM_ERROR, count, end, header, i, ntohl(), OK, READ_ERROR, SSIZE_MAX, UNEXPECTED_BSPATCH_ERROR, WRITE_ERROR_PATCH_FILE, MBSPatchTriple_::x, MBSPatchTriple_::y, and MBSPatchTriple_::z.
Referenced by PatchFile::Execute().
int MBS_ReadHeader | ( | FILE * | file, |
MBSPatchHeader * | header | ||
) |
Read the header of a patch file into the MBSPatchHeader structure.
fd | Must have been opened for reading, and be at the beginning of the file. |
Definition at line 60 of file bspatch.cxx.
References header, ntohl(), OK, READ_ERROR, and UNEXPECTED_BSPATCH_ERROR.
Referenced by PatchFile::Execute().