LibreOffice Module onlineupdate (master) 1
Macros | Functions | Variables
bsdiff.cxx File Reference
#include "bspatch.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <stdarg.h>
#include <unistd.h>
#include <arpa/inet.h>
Include dependency graph for bsdiff.cxx:

Go to the source code of this file.

Macros

#define _O_BINARY   0
 
#define MIN(x, y)   (((x)<(y)) ? (x) : (y))
 

Functions

static unsigned int crc32 (const unsigned char *buf, unsigned int len)
 
static void reporterr (int e, const char *fmt,...)
 
static void split (int32_t *I, int32_t *V, int32_t start, int32_t len, int32_t h)
 
static void qsufsort (int32_t *I, int32_t *V, unsigned char *old, int32_t oldsize)
 
static int32_t matchlen (unsigned char *old, int32_t oldsize, unsigned char *newbuf, int32_t newsize)
 
static int32_t search (int32_t *I, unsigned char *old, int32_t oldsize, unsigned char *newbuf, int32_t newsize, int32_t st, int32_t en, int32_t *pos)
 
int main (int argc, char *argv[])
 

Variables

unsigned int BZ2_crc32Table [256]
 

Macro Definition Documentation

◆ _O_BINARY

#define _O_BINARY   0

Definition at line 32 of file bsdiff.cxx.

◆ MIN

#define MIN (   x,
  y 
)    (((x)<(y)) ? (x) : (y))

Definition at line 36 of file bsdiff.cxx.

Function Documentation

◆ crc32()

static unsigned int crc32 ( const unsigned char *  buf,
unsigned int  len 
)
static

Definition at line 46 of file bsdiff.cxx.

References BZ2_crc32Table, and end.

Referenced by main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ matchlen()

static int32_t matchlen ( unsigned char *  old,
int32_t  oldsize,
unsigned char *  newbuf,
int32_t  newsize 
)
static

Definition at line 175 of file bsdiff.cxx.

References i.

Referenced by search().

◆ qsufsort()

static void qsufsort ( int32_t *  I,
int32_t *  V,
unsigned char *  old,
int32_t  oldsize 
)
static

Definition at line 136 of file bsdiff.cxx.

References h, i, I, split(), and V.

Referenced by main().

◆ reporterr()

static void reporterr ( int  e,
const char *  fmt,
  ... 
)
static

Definition at line 61 of file bsdiff.cxx.

References args.

Referenced by main().

◆ search()

static int32_t search ( int32_t *  I,
unsigned char *  old,
int32_t  oldsize,
unsigned char *  newbuf,
int32_t  newsize,
int32_t  st,
int32_t  en,
int32_t *  pos 
)
static

Definition at line 186 of file bsdiff.cxx.

References I, matchlen(), MIN, pos, search(), x, and y.

Referenced by main(), and search().

◆ split()

static void split ( int32_t *  I,
int32_t *  V,
int32_t  start,
int32_t  len,
int32_t  h 
)
static

Definition at line 74 of file bsdiff.cxx.

References h, i, I, split(), start, V, and x.

Referenced by qsufsort(), and split().

Variable Documentation

◆ BZ2_crc32Table

unsigned int BZ2_crc32Table[256]

Definition at line 43 of file bsdiff.cxx.

Referenced by crc32().