diff --git a/archivers/par2cmdline/Makefile b/archivers/par2cmdline/Makefile new file mode 100644 index 00000000000..c0c456bf983 --- /dev/null +++ b/archivers/par2cmdline/Makefile @@ -0,0 +1,28 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ + +COMMENT= "command line implementation of the PAR v2.0 specification" +DISTNAME= par2cmdline-0.3 +CATEGORIES= archivers +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=parchive/} + +HOMEPAGE= http://parchive.sourceforge.net/\#client_par2cmdline + +MAINTAINER= Jolan Luff + +# GPL +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes + +MODULES=gcc3 +MODGCC3_ARCHES= sparc64 +MODGCC3_LANGS= C++ + +CONFIGURE_STYLE=gnu + +post-install: + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/par2cmdline + ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/par2cmdline + +.include diff --git a/archivers/par2cmdline/distinfo b/archivers/par2cmdline/distinfo new file mode 100644 index 00000000000..97a058f6fad --- /dev/null +++ b/archivers/par2cmdline/distinfo @@ -0,0 +1,3 @@ +MD5 (par2cmdline-0.3.tar.gz) = 705c97bc41b862d281dd41c219a60849 +RMD160 (par2cmdline-0.3.tar.gz) = d4bd5a5c8f3bd1218f1e61fa1b981c5b22c26ed1 +SHA1 (par2cmdline-0.3.tar.gz) = 4202ffec5d5fa1e9d83da8e0c6e936832082f17d diff --git a/archivers/par2cmdline/patches/patch-Makefile_in b/archivers/par2cmdline/patches/patch-Makefile_in new file mode 100644 index 00000000000..4337fd8ebf8 --- /dev/null +++ b/archivers/par2cmdline/patches/patch-Makefile_in @@ -0,0 +1,11 @@ +$OpenBSD: patch-Makefile_in,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- Makefile.in.orig 2003-07-15 05:34:19.000000000 -0500 ++++ Makefile.in 2004-01-19 01:50:36.000000000 -0600 +@@ -637,7 +637,6 @@ install-data-am: + + install-exec-am: install-binPROGRAMS + @$(NORMAL_INSTALL) +- $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + + install-info: install-info-am + diff --git a/archivers/par2cmdline/patches/patch-README b/archivers/par2cmdline/patches/patch-README new file mode 100644 index 00000000000..fca0aac5784 --- /dev/null +++ b/archivers/par2cmdline/patches/patch-README @@ -0,0 +1,16 @@ +$OpenBSD: patch-README,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- README.orig 2003-05-26 13:01:29.000000000 -0500 ++++ README 2004-01-19 01:47:51.000000000 -0600 +@@ -81,12 +81,6 @@ The command line parameters for par2cmdl + par2 v(erify) [options] [files] + par2 r(epair) [options] [files] + +- Also: +- +- par2create [options] [files] +- par2verify [options] [files] +- par2repair [options] [files] +- + Options: + + -b : Set the Block-Count diff --git a/archivers/par2cmdline/patches/patch-commandline_cpp b/archivers/par2cmdline/patches/patch-commandline_cpp new file mode 100644 index 00000000000..0249dd765c6 --- /dev/null +++ b/archivers/par2cmdline/patches/patch-commandline_cpp @@ -0,0 +1,16 @@ +$OpenBSD: patch-commandline_cpp,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- commandline.cpp.orig 2003-06-24 08:11:02.000000000 -0500 ++++ commandline.cpp 2004-01-19 01:47:14.000000000 -0600 +@@ -82,12 +82,6 @@ void CommandLine::usage(void) + " par2 v(erify) [options] [files] : Verify files using PAR2 file\n" + " par2 r(epair) [options] [files] : Repair files using PAR2 files\n" + "\n" +- "Also:\n" +- "\n" +- " par2create [options] [files]\n" +- " par2verify [options] [files]\n" +- " par2repair [options] [files]\n" +- "\n" + "Options:\n" + "\n" + " -b : Set the Block-Count\n" diff --git a/archivers/par2cmdline/patches/patch-diskfile_cpp b/archivers/par2cmdline/patches/patch-diskfile_cpp new file mode 100644 index 00000000000..4137acd0c6d --- /dev/null +++ b/archivers/par2cmdline/patches/patch-diskfile_cpp @@ -0,0 +1,21 @@ +$OpenBSD: patch-diskfile_cpp,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- diskfile.cpp.orig 2003-05-26 13:01:14.000000000 -0500 ++++ diskfile.cpp 2004-01-19 02:04:20.000000000 -0600 +@@ -17,6 +17,8 @@ + // along with this program; if not, write to the Free Software + // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ++#include ++ + #include "par2cmdline.h" + + #ifdef _MSC_VER +@@ -550,7 +552,7 @@ string DiskFile::GetCanonicalPathname(st + return filename; + + // Get the current directory +- char curdir[1000]; ++ char curdir[MAXPATHLEN]; + if (0 == getcwd(curdir, sizeof(curdir))) + { + return filename; diff --git a/archivers/par2cmdline/patches/patch-galois_h b/archivers/par2cmdline/patches/patch-galois_h new file mode 100644 index 00000000000..fd46a6e3196 --- /dev/null +++ b/archivers/par2cmdline/patches/patch-galois_h @@ -0,0 +1,12 @@ +$OpenBSD: patch-galois_h,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- galois.h.orig 2003-06-13 18:22:04.000000000 -0500 ++++ galois.h 2004-01-21 18:06:05.000000000 -0600 +@@ -156,7 +156,7 @@ GaloisTable Ga + + + template +-inline Galois::Galois(Galois::ValueType v) ++inline Galois::Galois(typename Galois::ValueType v) + { + value = v; + } diff --git a/archivers/par2cmdline/patches/patch-md5_h b/archivers/par2cmdline/patches/patch-md5_h new file mode 100644 index 00000000000..d404ae6cd2d --- /dev/null +++ b/archivers/par2cmdline/patches/patch-md5_h @@ -0,0 +1,52 @@ +$OpenBSD: patch-md5_h,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- md5.h.orig 2003-05-26 13:01:20.000000000 -0500 ++++ md5.h 2004-01-22 15:52:42.000000000 -0600 +@@ -114,14 +114,7 @@ protected: + + inline bool MD5Hash::operator==(const MD5Hash &other) const + { +- for (unsigned int i=0; i<4; i++) +- { +- if (((u32*)&hash)[i] != ((u32*)&other.hash)[i]) +- { +- return false; +- } +- } +- return true; ++ return (0==memcmp(&hash, &other.hash, sizeof(hash))); + } + inline bool MD5Hash::operator!=(const MD5Hash &other) const + { +@@ -130,25 +123,13 @@ inline bool MD5Hash::operator!=(const MD + + inline bool MD5Hash::operator<(const MD5Hash &other) const + { +- if (*(u32*)(&hash[12]) < *(u32*)(&other.hash[12])) +- return true; +- else if (*(u32*)(&hash[12]) > *(u32*)(&other.hash[12])) +- return false; +- +- else if (*(u32*)(&hash[8]) < *(u32*)(&other.hash[8])) +- return true; +- else if (*(u32*)(&hash[8]) > *(u32*)(&other.hash[8])) +- return false; +- +- else if (*(u32*)(&hash[4]) < *(u32*)(&other.hash[4])) +- return true; +- else if (*(u32*)(&hash[4]) > *(u32*)(&other.hash[4])) +- return false; +- +- else if (*(u32*)(&hash[0]) < *(u32*)(&other.hash[0])) +- return true; +- else +- return false; ++ size_t index = 15; ++ while (index > 0 && hash[index] == other.hash[index]) ++ { ++ index--; ++ } ++ ++ return hash[index] < other.hash[index]; + } + inline bool MD5Hash::operator>=(const MD5Hash &other) const + { diff --git a/archivers/par2cmdline/patches/patch-par1fileformat_h b/archivers/par2cmdline/patches/patch-par1fileformat_h new file mode 100644 index 00000000000..88b157174a1 --- /dev/null +++ b/archivers/par2cmdline/patches/patch-par1fileformat_h @@ -0,0 +1,13 @@ +$OpenBSD: patch-par1fileformat_h,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- par1fileformat.h.orig 2003-05-26 13:01:20.000000000 -0500 ++++ par1fileformat.h 2004-01-21 18:06:05.000000000 -0600 +@@ -77,8 +77,7 @@ enum FILEENTRYSTATUS + + inline bool operator == (const PAR1MAGIC &left, const PAR1MAGIC &right) + { +- return ((u32*)&left)[0] == ((u32*)&right)[0] && +- ((u32*)&left)[1] == ((u32*)&right)[1]; ++ return (0==memcmp(&left, &right, sizeof(left))); + } + + inline bool operator != (const PAR1MAGIC &left, const PAR1MAGIC &right) diff --git a/archivers/par2cmdline/patches/patch-par1repairer_cpp b/archivers/par2cmdline/patches/patch-par1repairer_cpp new file mode 100644 index 00000000000..1508dff9e52 --- /dev/null +++ b/archivers/par2cmdline/patches/patch-par1repairer_cpp @@ -0,0 +1,12 @@ +$OpenBSD: patch-par1repairer_cpp,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- par1repairer.cpp.orig 2003-06-11 08:45:01.000000000 -0500 ++++ par1repairer.cpp 2004-01-21 18:06:05.000000000 -0600 +@@ -372,7 +372,7 @@ bool Par1Repairer::LoadRecoveryFile(stri + blocksize = fileentry->filesize; + + // Copy whole of file entry +- memcpy((void*)fileentry, (void*)current, fileentry->entrysize); ++ memcpy((void*)fileentry, (void*)current, (size_t)(u64)fileentry->entrysize); + + // Create source file and add it to the appropriate list + Par1RepairerSourceFile *sourcefile = new Par1RepairerSourceFile(fileentry, searchpath); diff --git a/archivers/par2cmdline/patches/patch-par1repairersourcefile_cpp b/archivers/par2cmdline/patches/patch-par1repairersourcefile_cpp new file mode 100644 index 00000000000..96b3e877c02 --- /dev/null +++ b/archivers/par2cmdline/patches/patch-par1repairersourcefile_cpp @@ -0,0 +1,19 @@ +$OpenBSD: patch-par1repairersourcefile_cpp,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- par1repairersourcefile.cpp.orig 2003-05-26 13:01:20.000000000 -0500 ++++ par1repairersourcefile.cpp 2004-01-21 18:06:05.000000000 -0600 +@@ -60,9 +60,12 @@ Par1RepairerSourceFile::Par1RepairerSour + + // Strip the path from the filename + string::size_type where; +- if (string::npos != (where = filename.find_last_of('\\')) || +- string::npos != (where = filename.find_last_of('/')) || +- string::npos != (where = filename.find_last_of(':'))) ++ if (string::npos != (where = filename.find_last_of('\\')) ++ || string::npos != (where = filename.find_last_of('/')) ++#ifdef WIN32 ++ || string::npos != (where = filename.find_last_of(':')) ++#endif ++ ) + { + filename = filename.substr(where+1); + } diff --git a/archivers/par2cmdline/patches/patch-par2cmdline_h b/archivers/par2cmdline/patches/patch-par2cmdline_h new file mode 100644 index 00000000000..b84c52835af --- /dev/null +++ b/archivers/par2cmdline/patches/patch-par2cmdline_h @@ -0,0 +1,20 @@ +$OpenBSD: patch-par2cmdline_h,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- par2cmdline.h.orig 2003-06-07 17:43:38.000000000 -0500 ++++ par2cmdline.h 2004-01-21 18:06:05.000000000 -0600 +@@ -35,6 +35,7 @@ + + #include + #include ++#include + + #include + +@@ -105,7 +106,7 @@ typedef unsigned int size_t; + # endif + #endif + +-#if STC_HEADERS ++#if STDC_HEADERS + # include + #else + # if !HAVE_STRCHR diff --git a/archivers/par2cmdline/patches/patch-par2creator_cpp b/archivers/par2cmdline/patches/patch-par2creator_cpp new file mode 100644 index 00000000000..d3d92b3075d --- /dev/null +++ b/archivers/par2cmdline/patches/patch-par2creator_cpp @@ -0,0 +1,12 @@ +$OpenBSD: patch-par2creator_cpp,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- par2creator.cpp.orig 2003-06-24 09:13:59.000000000 -0500 ++++ par2creator.cpp 2004-01-21 18:06:05.000000000 -0600 +@@ -835,7 +835,7 @@ bool Par2Creator::ProcessData(u64 blocko + return false; + } + +- cout << "Wrote " << recoveryblockcount * chunksize << " bytes to disk" << endl; ++ cout << "Wrote " << recoveryblockcount * blocklength << " bytes to disk" << endl; + + return true; + } diff --git a/archivers/par2cmdline/patches/patch-par2fileformat_h b/archivers/par2cmdline/patches/patch-par2fileformat_h new file mode 100644 index 00000000000..220886886c8 --- /dev/null +++ b/archivers/par2cmdline/patches/patch-par2fileformat_h @@ -0,0 +1,25 @@ +$OpenBSD: patch-par2fileformat_h,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- par2fileformat.h.orig 2003-05-26 13:01:25.000000000 -0500 ++++ par2fileformat.h 2004-01-21 18:06:05.000000000 -0600 +@@ -169,8 +169,7 @@ struct RECOVERYBLOCKPACKET + + inline bool operator == (const MAGIC &left, const MAGIC &right) + { +- return ((u32*)&left)[0] == ((u32*)&right)[0] && +- ((u32*)&left)[1] == ((u32*)&right)[1]; ++ return (0==memcmp(&left, &right, sizeof(left))); + } + + inline bool operator != (const MAGIC &left, const MAGIC &right) +@@ -180,10 +179,7 @@ inline bool operator != (const MAGIC &le + + inline bool operator == (const PACKETTYPE &left, const PACKETTYPE &right) + { +- return ((u32*)&left)[0] == ((u32*)&right)[0] && +- ((u32*)&left)[1] == ((u32*)&right)[1] && +- ((u32*)&left)[2] == ((u32*)&right)[2] && +- ((u32*)&left)[3] == ((u32*)&right)[3]; ++ return (0==memcmp(&left, &right, sizeof(left))); + } + + inline bool operator != (const PACKETTYPE &left, const PACKETTYPE &right) diff --git a/archivers/par2cmdline/patches/patch-par2repairer_cpp b/archivers/par2cmdline/patches/patch-par2repairer_cpp new file mode 100644 index 00000000000..1aba6d79685 --- /dev/null +++ b/archivers/par2cmdline/patches/patch-par2repairer_cpp @@ -0,0 +1,153 @@ +$OpenBSD: patch-par2repairer_cpp,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- par2repairer.cpp.orig 2003-05-26 13:01:26.000000000 -0500 ++++ par2repairer.cpp 2004-01-21 18:06:05.000000000 -0600 +@@ -341,7 +341,7 @@ bool Par2Repairer::LoadPacketsFromFile(s + // Did we find the magic + if (current <= limit) + { +- header = *(PACKET_HEADER*)current; ++ memcpy(&header, current, sizeof(header)); + break; + } + } +@@ -820,6 +820,9 @@ bool Par2Repairer::CheckPacketConsistenc + continue; + } + ++ // Compute and store the block count from the filesize and blocksize ++ sf->second->SetBlockCount(blocksize); ++ + // Do we have a verification packet + VerificationPacket *verificationpacket = sf->second->GetVerificationPacket(); + if (verificationpacket == 0) +@@ -916,14 +919,14 @@ bool Par2Repairer::AllocateSourceBlocks( + Par2RepairerSourceFile *sourcefile = *sf; + if (sourcefile) + { +- sourceblockcount += sourcefile->GetVerificationPacket()->BlockCount(); ++ sourceblockcount += sourcefile->BlockCount(); + } + else + { + // No details for this source file so we don't know what the + // total number of source blocks is +- sourceblockcount = 0; +- break; ++// sourceblockcount = 0; ++// break; + } + + ++sf; +@@ -955,16 +958,19 @@ bool Par2Repairer::AllocateSourceBlocks( + { + Par2RepairerSourceFile *sourcefile = *sf; + +- totalsize += sourcefile->GetDescriptionPacket()->FileSize(); +- u32 blockcount = sourcefile->GetVerificationPacket()->BlockCount(); ++ if (sourcefile) ++ { ++ totalsize += sourcefile->GetDescriptionPacket()->FileSize(); ++ u32 blockcount = sourcefile->BlockCount(); + +- // Allocate the source and target DataBlocks to the sourcefile +- sourcefile->SetBlocks(blocknumber, blockcount, sourceblock, targetblock, blocksize); ++ // Allocate the source and target DataBlocks to the sourcefile ++ sourcefile->SetBlocks(blocknumber, blockcount, sourceblock, targetblock, blocksize); + +- blocknumber++; ++ blocknumber++; + +- sourceblock += blockcount; +- targetblock += blockcount; ++ sourceblock += blockcount; ++ targetblock += blockcount; ++ } + + ++sf; + ++filenumber; +@@ -1069,7 +1075,7 @@ bool Par2Repairer::VerifySourceFiles(voi + // Was this one of the recoverable files + if (filenumber < mainpacket->RecoverableFileCount()) + { +- cerr << "No details available for recoverable file number " << filenumber+1 << ". Recovery will not be possible." << endl; ++ cerr << "No details available for recoverable file number " << filenumber+1 << "." << endl << "Recovery will not be possible." << endl; + + // Set error but let verification of other files continue + finalresult = false; +@@ -1676,42 +1682,49 @@ void Par2Repairer::UpdateVerificationRes + { + Par2RepairerSourceFile *sourcefile = *sf; + +- // Was a perfect match for the file found +- if (sourcefile->GetCompleteFile() != 0) ++ if (sourcefile) + { +- // Is it the target file or a different one +- if (sourcefile->GetCompleteFile() == sourcefile->GetTargetFile()) ++ // Was a perfect match for the file found ++ if (sourcefile->GetCompleteFile() != 0) + { +- completefilecount++; ++ // Is it the target file or a different one ++ if (sourcefile->GetCompleteFile() == sourcefile->GetTargetFile()) ++ { ++ completefilecount++; ++ } ++ else ++ { ++ renamedfilecount++; ++ } ++ ++ availableblockcount += sourcefile->BlockCount(); + } + else + { +- renamedfilecount++; +- } ++ // Count the number of blocks that have been found ++ vector::iterator sb = sourcefile->SourceBlocks(); ++ for (u32 blocknumber=0; blocknumberBlockCount(); ++blocknumber, ++sb) ++ { ++ DataBlock &datablock = *sb; ++ ++ if (datablock.IsSet()) ++ availableblockcount++; ++ } + +- availableblockcount += sourcefile->BlockCount(); ++ // Does the target file exist ++ if (sourcefile->GetTargetExists()) ++ { ++ damagedfilecount++; ++ } ++ else ++ { ++ missingfilecount++; ++ } ++ } + } + else + { +- // Count the number of blocks that have been found +- vector::iterator sb = sourcefile->SourceBlocks(); +- for (u32 blocknumber=0; blocknumberBlockCount(); ++blocknumber, ++sb) +- { +- DataBlock &datablock = *sb; +- +- if (datablock.IsSet()) +- availableblockcount++; +- } +- +- // Does the target file exist +- if (sourcefile->GetTargetExists()) +- { +- damagedfilecount++; +- } +- else +- { +- missingfilecount++; +- } ++ missingfilecount++; + } + + ++filenumber; diff --git a/archivers/par2cmdline/patches/patch-par2repairersourcefile_cpp b/archivers/par2cmdline/patches/patch-par2repairersourcefile_cpp new file mode 100644 index 00000000000..73324ff1fcd --- /dev/null +++ b/archivers/par2cmdline/patches/patch-par2repairersourcefile_cpp @@ -0,0 +1,36 @@ +$OpenBSD: patch-par2repairersourcefile_cpp,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- par2repairersourcefile.cpp.orig 2003-05-26 13:01:27.000000000 -0500 ++++ par2repairersourcefile.cpp 2004-01-21 18:06:05.000000000 -0600 +@@ -68,9 +68,12 @@ void Par2RepairerSourceFile::ComputeTarg + + // Strip the path from the filename + string::size_type where; +- if (string::npos != (where = filename.find_last_of('\\')) || +- string::npos != (where = filename.find_last_of('/')) || +- string::npos != (where = filename.find_last_of(':'))) ++ if (string::npos != (where = filename.find_last_of('\\')) ++ || string::npos != (where = filename.find_last_of('/')) ++#ifdef WIN32 ++ || string::npos != (where = filename.find_last_of(':')) ++#endif ++ ) + { + filename = filename.substr(where+1); + } +@@ -141,3 +144,16 @@ void Par2RepairerSourceFile::SetBlocks(u + } + } + } ++ ++// Determine the block count from the file size and block size. ++void Par2RepairerSourceFile::SetBlockCount(u64 blocksize) ++{ ++ if (descriptionpacket) ++ { ++ blockcount = (u32)((descriptionpacket->FileSize() + blocksize-1) / blocksize); ++ } ++ else ++ { ++ blockcount = 0; ++ } ++} diff --git a/archivers/par2cmdline/patches/patch-par2repairersourcefile_h b/archivers/par2cmdline/patches/patch-par2repairersourcefile_h new file mode 100644 index 00000000000..0624faf2dfe --- /dev/null +++ b/archivers/par2cmdline/patches/patch-par2repairersourcefile_h @@ -0,0 +1,13 @@ +$OpenBSD: patch-par2repairersourcefile_h,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- par2repairersourcefile.h.orig 2003-05-26 13:01:28.000000000 -0500 ++++ par2repairersourcefile.h 2004-01-21 18:06:05.000000000 -0600 +@@ -55,6 +55,9 @@ public: + vector::iterator _targetblocks, + u64 blocksize); + ++ // Determine the block count from the file size and block size. ++ void SetBlockCount(u64 blocksize); ++ + // Set/Get which DiskFile will contain the final repaired version of the file + void SetTargetFile(DiskFile *diskfile); + DiskFile* GetTargetFile(void) const; diff --git a/archivers/par2cmdline/patches/patch-reedsolomon_h b/archivers/par2cmdline/patches/patch-reedsolomon_h new file mode 100644 index 00000000000..062ef1af2e9 --- /dev/null +++ b/archivers/par2cmdline/patches/patch-reedsolomon_h @@ -0,0 +1,73 @@ +$OpenBSD: patch-reedsolomon_h,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +--- reedsolomon.h.orig 2003-05-26 13:01:31.000000000 -0500 ++++ reedsolomon.h 2004-01-21 18:06:05.000000000 -0600 +@@ -326,9 +326,7 @@ inline bool ReedSolomon::Compute(void + // Perform Gaussian Elimination and then delete the right matrix (which + // will no longer be required). + bool success = GaussElim(outcount, incount, leftmatrix, rightmatrix, datamissing); +-cout << "GaussElim done" << endl; + delete [] rightmatrix; +-cout << "Exiting RS::Compute" << endl; + return success; + } + +@@ -339,6 +337,29 @@ cout << "Exiting RS::Compute" << endl; + template + inline bool ReedSolomon::GaussElim(unsigned int rows, unsigned int leftcols, G *leftmatrix, G *rightmatrix, unsigned int datamissing) + { ++#ifdef DUMPRSMATRIX ++ for (unsigned int row=0; row8?4:2) << setfill('0') ++ << (unsigned int)leftmatrix[row*leftcols+col]; ++ } ++ cout << ((row==0) ? " \\ /" : (row==rows-1) ? " / \\" : " | |"); ++ for (unsigned int col=0; col8?4:2) << setfill('0') ++ << (unsigned int)rightmatrix[row*rows+col]; ++ } ++ cout << ((row==0) ? " \\" : (row==rows-1) ? " /" : " | |"); ++ cout << endl; ++ ++ cout << dec << setw(0) << setfill(' '); ++ } ++#endif + // Because the matrices being operated on are Vandermonde matrices + // they are guaranteed not to be singular. + +@@ -442,7 +463,29 @@ inline bool ReedSolomon::GaussElim(un + } + } + cout << "Solving: done." << endl; ++#ifdef DUMPRSMATRIX ++ for (unsigned int row=0; row8?4:2) << setfill('0') ++ << (unsigned int)leftmatrix[row*leftcols+col]; ++ } ++ cout << ((row==0) ? " \\ /" : (row==rows-1) ? " / \\" : " | |"); ++ for (unsigned int col=0; col8?4:2) << setfill('0') ++ << (unsigned int)rightmatrix[row*rows+col]; ++ } ++ cout << ((row==0) ? " \\" : (row==rows-1) ? " /" : " | |"); ++ cout << endl; + ++ cout << dec << setw(0) << setfill(' '); ++ } ++#endif + return true; + } + diff --git a/archivers/par2cmdline/pkg/DESCR b/archivers/par2cmdline/pkg/DESCR new file mode 100644 index 00000000000..545ca52dcc8 --- /dev/null +++ b/archivers/par2cmdline/pkg/DESCR @@ -0,0 +1,2 @@ +par2cmdline is a command line implementation of the PAR v2.0 +specification. diff --git a/archivers/par2cmdline/pkg/PLIST b/archivers/par2cmdline/pkg/PLIST new file mode 100644 index 00000000000..f21600f9975 --- /dev/null +++ b/archivers/par2cmdline/pkg/PLIST @@ -0,0 +1,4 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $ +bin/par2 +share/doc/par2cmdline/README +@dirrm share/doc/par2cmdline