#include <ncbi_pch.hpp>
#include <util/compress/tar.hpp>
#include <util/error_codes.hpp>
#include "../../../corelib/ncbi_os_unix_p.hpp"
#include <grp.h>
#include <pwd.h>
#include <unistd.h>
Go to the source code of this file.
Go to the SVN repository for this file.
#define _FORTIFY_SOURCE 0 #define NCBI_USE_ERRCODE_X Util_Compress #define NCBI_MODULE NCBITAR #define ALIGN_SIZE(size) (((size) + (BLOCK_SIZE-1)) & ~(BLOCK_SIZE-1)) Round up to the nearest multiple of BLOCK_SIZE: More...Definition at line 52 of file tar.cpp.
◆ ALIGN_SIZERound up to the nearest multiple of BLOCK_SIZE:
Definition at line 371 of file tar.cpp.
◆ BLOCK_OF #define BLOCK_OF ( pos ) ((pos) >> 9)Definition at line 373 of file tar.cpp.
◆ BLOCK_SIZETar block size (512 bytes)
Definition at line 377 of file tar.cpp.
◆ NCBI_FILE_WO #define NCBI_FILE_WO "wb"Definition at line 3885 of file tar.cpp.
◆ NCBI_MODULE #define NCBI_MODULE NCBITARDefinition at line 90 of file tar.cpp.
◆ NCBI_USE_ERRCODE_X #define NCBI_USE_ERRCODE_X Util_CompressDefinition at line 89 of file tar.cpp.
◆ OFFSET_OF ◆ offsetof #define offsetof ( T, F ) ((char*) &(((T*) 0)->F) - (char*) 0)Definition at line 735 of file tar.cpp.
◆ SIZE_OF #define SIZE_OF ( blk ) ((blk) << 9)Definition at line 374 of file tar.cpp.
◆ TAR_GNU_CONTIND #define TAR_GNU_CONTIND "[gnu.contind]: "Definition at line 749 of file tar.cpp.
◆ TAR_GNU_REGION #define TAR_GNU_REGION "[gnu.region]: "Definition at line 748 of file tar.cpp.
◆ TAR_POST #define TAR_POST ( subcode, severity, message ) Value:m_Current.GetName()) + (message))
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
static string s_PositionAsString(const string &file, Uint8 pos, size_t recsize, const string &entryname)
Definition at line 1376 of file tar.cpp.
◆ TAR_PRINTABLE ◆ TAR_PRINTABLE_EX #define TAR_PRINTABLE_EX ( field, text, size ) Value:#define NCBI_AS_STRING(value)
Convert some value to string even if this value is macro itself.
static void text(MDB_val *v)
const struct ncbi::grid::netcache::search::fields::SIZE size
static string s_Printable(const char *field, size_t maxsize, bool text)
static string s_OffsetAsString(size_t offset)
Definition at line 738 of file tar.cpp.
◆ TAR_THROW #define TAR_THROW ( who, errcode, message ) Value:who->m_BufferSize, \
who->m_Current.GetName()) + (message))
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition at line 1364 of file tar.cpp.
◆ TAR_THROW_EX #define TAR_THROW_EX ( who, errcode, message, hdr, fmt ) Value:who->m_Flags & fDumpEntryHeaders \
?
string(message) +
":\n"+
s_DumpHeader(hdr, fmt,
true) \
: string(message))
#define TAR_THROW(who, errcode, message)
static string s_DumpHeader(const STarHeader *h, ETar_Format fmt, bool excpt=false)
Definition at line 1370 of file tar.cpp.
◆ TPAXBits ◆ EPAXBit Enumerator fPAXNone fPAXSparseGNU_1_0 fPAXSparse fPAXMtime fPAXAtime fPAXCtime fPAXSize fPAXUid fPAXGidDefinition at line 1828 of file tar.cpp.
◆ ETar_FormatRecognized TAR formats.
Enumerator eTar_Unknown eTar_Legacy eTar_OldGNU eTar_Ustar eTar_Posix eTar_StarDefinition at line 381 of file tar.cpp.
◆ ipow10() ◆ memcchr() ◆ operator<<() ◆ s_AllLowerCase() ◆ s_Base256ToNum() ◆ s_BaseDir() ◆ s_DecodeUint8() ◆ s_Dump()Definition at line 2070 of file tar.cpp.
References _ASSERT, ALIGN_SIZE, BLOCK_OF, blocks, eDiag_Info, ERR_POST, eTar_OldGNU, file, STarHeader::gnu, Info(), kEmptyStr, NStr::NumericToString(), OFFSET_OF, s_DumpHeader(), s_PositionAsString(), SetDiagPostLevel(), and STarHeader::typeflag.
Referenced by CTar::x_ReadEntryInfo().
◆ s_DumpHeader()Definition at line 828 of file tar.cpp.
References _ASSERT, CTime::AsString(), BLOCK_SIZE, STarHeader::checksum, STarHeader::devmajor, STarHeader::devminor, dump, eTar_Legacy, eTar_OldGNU, eTar_Posix, eTar_Star, eTar_Ustar, CTime::GetTimeT(), STarHeader::gid, STarHeader::gnu, len, memcchr(), STarHeader::mode, STarHeader::mtime, n, STarHeader::name, NStr::NumericToString(), offset, ok, STarHeader::prefix, NStr::PrintableString(), s_DecodeUint8(), s_DumpSparseMap(), s_Length(), s_ModeAsString(), s_OctalToNum(), s_OffsetAsString(), s_Printable(), ncbi::grid::netcache::search::fields::size, STarHeader::size, STarHeader::star, string, NStr::strncasecmp(), TAR_PRINTABLE, TAR_PRINTABLE_EX, CTime::ToLocalTime(), true, STarHeader::typeflag, STarHeader::uid, val, STarHeader::version, and dtl::version.
Referenced by s_Dump().
◆ s_DumpSparse() [1/2]Definition at line 2089 of file tar.cpp.
References _ASSERT, ALIGN_SIZE, BLOCK_OF, blocks, eDiag_Info, ERR_POST, file, Info(), kEmptyStr, NStr::NumericToString(), OFFSET_OF, s_DumpSparseMap(), s_PositionAsString(), and SetDiagPostLevel().
Referenced by CTar::x_ExtractSparseFile(), and CTar::x_ReadEntryInfo().
◆ s_DumpSparse() [2/2] ◆ s_DumpSparseMap() [1/2]Definition at line 751 of file tar.cpp.
References done, dump, len, memcchr(), NStr::NumericToString(), offset, NStr::PrintableString(), s_DecodeUint8(), s_OffsetAsString(), s_Printable(), string, TAR_GNU_CONTIND, and TAR_GNU_REGION.
Referenced by s_DumpHeader(), and s_DumpSparse().
◆ s_DumpSparseMap() [2/2] ◆ s_DumpZero() ◆ s_EncodeUint8() ◆ s_FraqToNanosec() ◆ s_IsOctal() ◆ s_Length() static size_t s_Length ( const char * ptr, size_t maxsize ) static ◆ s_MajorMinor() ◆ s_MatchExcludeMask() ◆ s_ModeAsString()Definition at line 509 of file tar.cpp.
References buf, fTarGExecute, fTarGRead, fTarGWrite, fTarOExecute, fTarORead, fTarOWrite, fTarSetGID, fTarSetUID, fTarSticky, fTarUExecute, fTarURead, fTarUWrite, and string.
Referenced by operator<<(), and s_DumpHeader().
◆ s_ModeToTar()Definition at line 289 of file tar.cpp.
References fTarGExecute, fTarGRead, fTarGWrite, fTarOExecute, fTarORead, fTarOWrite, fTarSetGID, fTarSetUID, fTarSticky, fTarUExecute, fTarURead, fTarUWrite, and mask.
Referenced by CTar::x_Append(), and CArchive::x_Append().
◆ s_NumToBase256() ◆ s_NumToOctal() ◆ s_OctalToNum() ◆ s_OffsetAsString() ◆ s_OSReason()Definition at line 646 of file tar.cpp.
References _ASSERT, kEmptyStr, kUnknownError, CNcbiError::SetErrno(), strerror(), string, and NStr::strncasecmp().
Referenced by CTarReader::Read(), CTar::x_Append(), CTar::x_AppendFile(), CTar::x_AppendStream(), CTar::x_Close(), CTar::x_ExtractEntry(), CTar::x_ExtractPlainFile(), CTar::x_ExtractSparseFile(), CTar::x_Flush(), CTar::x_Open(), CTar::x_ProcessEntry(), CTar::x_RestoreAttrs(), and CTar::x_WriteArchive().
◆ s_ParsePAXNumeric() ◆ s_PositionAsString()Definition at line 672 of file tar.cpp.
References _ASSERT, BLOCK_OF, BLOCK_SIZE, CDirEntry::eFile, file, NStr::fWithCommas, CDirEntry::GetName(), CDirEntry::GetType(), NStr::NumericToString(), OFFSET_OF, and result.
Referenced by s_Dump(), s_DumpSparse(), s_DumpZero(), and CTar::x_ReadEntryInfo().
◆ s_Printable() ◆ s_SetStateSafe() void s_SetStateSafe ( CNcbiIos & ios, IOS_BASE::iostate state ) throw ( ) inline ◆ s_SizeOrMajorMinor()Definition at line 603 of file tar.cpp.
References CTarEntryInfo::eBlockDev, CTarEntryInfo::eCharDev, CTarEntryInfo::eDir, CTarEntryInfo::ePipe, CTarEntryInfo::eSparseFile, CTarEntryInfo::eSymLink, CTarEntryInfo::eVolHeader, info, NStr::NumericToString(), s_MajorMinor(), and string.
Referenced by operator<<().
◆ s_TarChecksum() ◆ s_TarToMode() [1/2]Definition at line 239 of file tar.cpp.
References fTarGExecute, fTarGRead, fTarGWrite, fTarOExecute, fTarORead, fTarOWrite, fTarSetGID, fTarSetUID, fTarSticky, fTarUExecute, fTarURead, and fTarUWrite.
◆ s_TarToMode() [2/2]Definition at line 203 of file tar.cpp.
References CDirEntry::fExecute, CDirEntry::fRead, CDirEntry::fSetGID, CDirEntry::fSetUID, CDirEntry::fSticky, fTarGExecute, fTarGRead, fTarGWrite, fTarOExecute, fTarORead, fTarOWrite, fTarSetGID, fTarSetUID, fTarSticky, fTarUExecute, fTarURead, fTarUWrite, and CDirEntry::fWrite.
Referenced by CTarEntryInfo::GetMode(), CTar::x_Append(), and CTar::x_RestoreAttrs().
◆ s_ToArchiveName() ◆ s_ToFilesystemPath() ◆ s_TruncateFile() ◆ s_TypeAsChar() ◆ s_UserGroupAsString() ◆ sx_Signature() ◆ x_DropTrailingSlashes()RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4