Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

protectcorrectfile.cc File Reference

#include "protectcorrectfile.h"
#include "options.h"
#include "header.h"
#include "footprint.h"
#include "hyperblkcodec.h"
#include <sys/stat.h>
#include <assert.h>

Include dependency graph for protectcorrectfile.cc:

Include dependency graph

Go to the source code of this file.

Functions

long interleaveskip (const long len, const long stripenum)
 Calculate distance to next block for file striping Filelength len (in blocks), at least stripenum stripes.

char * readandinterleave (int fblocks, int stripe, FILE *infile)
 read a file fil into buffer buf while interleaving it for better correction.

void writeanddeinterleave (char *buf, int fblocks, int stripe, FILE *outfile)
 write a file from interleaved buffer.

void protectfile ()
 
Id
protectcorrectfile.h,v 1.3 2003/12/29 18:06:32 stoerr Exp
protect the file protectedfile

bool correctfile ()
 correct the protectedfile to correctedfile returns true iff file is OK now.


Function Documentation

bool correctfile  ) 
 

correct the protectedfile to correctedfile returns true iff file is OK now.

Definition at line 151 of file protectcorrectfile.cc.

References blklen, correctedfname, eccfname, footprint(), footPrintDiff(), hbcorr, hblen, headerlen, hyperblockcorrect(), P, progname, protectedfname, readandinterleave(), readheader(), verbose, and writeanddeinterleave().

Referenced by main().

Here is the call graph for this function:

long interleaveskip const long  len,
const long  stripenum
 

Calculate distance to next block for file striping Filelength len (in blocks), at least stripenum stripes.

Definition at line 17 of file protectcorrectfile.cc.

Referenced by protectfile().

void protectfile  ) 
 

Id
protectcorrectfile.h,v 1.3 2003/12/29 18:06:32 stoerr Exp
protect the file protectedfile

Definition at line 70 of file protectcorrectfile.cc.

References addheaderitem(), blklen, eccfname, footprint(), hbcorr, hblen, hyperblockprotect(), interleaveskip(), P, protectedfname, readandinterleave(), verbose, writeanddeinterleave(), and writeheader().

Referenced by main().

Here is the call graph for this function:

char* readandinterleave int  fblocks,
int  stripe,
FILE *  infile
 

read a file fil into buffer buf while interleaving it for better correction.

returns buffer to read into fblocks: number of blklen char blocks in infile stripe: striping parameter

Definition at line 35 of file protectcorrectfile.cc.

References blklen, hblen, and progname.

Referenced by correctfile(), and protectfile().

void writeanddeinterleave char *  buf,
int  fblocks,
int  stripe,
FILE *  outfile
 

write a file from interleaved buffer.

Inverse of readandinterleave. fblocks: number of blklen char blocks in infile stripe: striping parameter outfile: file to write to

Definition at line 59 of file protectcorrectfile.cc.

References blklen.

Referenced by correctfile(), and protectfile().


Generated on Tue Dec 30 12:07:39 2003 for ErrorProtect by doxygen 1.3.2