LibreOffice Module onlineupdate (master) 1
Classes | Typedefs | Functions
bspatch.h File Reference
#include <stdint.h>
#include <stdio.h>
Include dependency graph for bspatch.h:
This graph shows which files directly or indirectly include this file:

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 Documentation

◆ MBSPatchHeader

◆ MBSPatchTriple

Function Documentation

◆ MBS_ApplyPatch()

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.

Parameters
patchfdMust have been processed by MBS_ReadHeader
fbufferThe original file read into a memory buffer of length header->slen.
filefdMust 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().

◆ MBS_ReadHeader()

int MBS_ReadHeader ( FILE *  file,
MBSPatchHeader header 
)

Read the header of a patch file into the MBSPatchHeader structure.

Parameters
fdMust 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().