1BackupPC::XS(3) User Contributed Perl Documentation BackupPC::XS(3)
2
3
4
6 BackupPC::XS - Perl extension for BackupPC libraries
7
9 use BackupPC::XS;
10 use BackupPC::XS qw( :all );
11
13 BackupPC::XS provides various submodules that implement various
14 BackupPC library functions. The following sections describe each
15 submodule.
16
17 This documentation is very terse. BackupPC::XS is not intended to be a
18 general-purpose module - it is closely tied to BackupPC. Look in the
19 BackupPC code to see examples of using this module.
20
21 BackupPC::XS::FileZIO
22 Compressed file I/O using zlib:
23
24 $fd = BackupPC::XS::FileZIO::open($fileName, $writeFlag, $compressLevel);
25 $fd = BackupPC::XS::FileZIO::fdopen($stream, $writeFlag, $compressLevel);
26 $nWrite = $fd->write($dataRef);
27 $nRead = $fd->read($dataRef, $maxRead);
28 $textLine = $fd->readLine();
29 $fd->rewind();
30 $fd->close();
31 $fd->writeTeeStderr($boolean);
32
33 BackupPC::XS::PoolRefCnt
34 Pool file reference counting:
35
36 $countDB = BackupPC::XS::PoolRefCnt::new(initialEntryCnt);
37 $refCount = $countDB->get($digest);
38 $countDB->set($digest, $refCount);
39 $countDB->delete($digest);
40 $countDB->incr($digest, $refIncr);
41 ($digest, $refCnt, $idx) = $countDB->iterate($idx);
42 $countDB->read($fileName);
43 $countDB->write($fileName);
44 $countDB->print();
45
46 Pool file delta accumulation:
47
48 BackupPC::XS::PoolRefCnt::DeltaFileInit($hostDir);
49 BackupPC::XS::PoolRefCnt::DeltaFileFlush();
50 BackupPC::XS::PoolRefCnt::DeltaUpdate($digest, $refIncr);
51 BackupPC::XS::PoolRefCnt::DeltaPrint();
52
53 BackupPC::XS::PoolWrite
54 Writing and matching files in the pool:
55
56 $poolWrite = BackupPC::XS::PoolWrite::new($compressLevel [, $digest]);
57 $poolWrite->write($dataRef);
58 ($match, $digest, $poolSize, $error) = $poolWrite->close();
59 $poolWrite->addToPool($fileName, $isV3PoolFile);
60
61 BackupPC::XS::Attrib
62 Manipulating a set of files and attributes (typically one directory's
63 worth):
64
65 $a = BackupPC::XS::Attrib::new($compressLevel);
66 $attrHash = $a->get($fileName);
67 $a->set($fileName, $attrHash);
68 $numDirEntries = $a->count();
69 $a->read($dirPath, $attribFileName);
70 $a->write($dirPath, $attribFileName);
71
72 $textType = BackupPC::XS::Attrib::fileType2Text(BPC_FTYPE_....);
73
74 BackupPC::XS::AttribCache
75 Maintain a cache of directories, with full share/path semantics.
76
77 $ac = BackupPC::XS::AttribCache::new($host, $backupNum, $shareNameUM, $compress);
78
79 $attrHash = $ac->get($fileName, $allocateIfMissing, $dontReadInode);
80 $ac->set($fileName, $attrHash, $dontOverwriteInode);
81 $ac->delete($fileName);
82
83 $attrHash = $ac->getInode($inode, $allocateIfMissing);
84 $ac->setInode($inode, $attrHash);
85 $ac->deleteInode($inode);
86
87 $ac->getAll($path, $dontReadInode);
88
89 $ac->flush($all, $path);
90 $ac->getFullMangledPath($path);
91
92 BackupPC::XS::DirOps
93 $zeroMeansOk = BackupPC::XS::DirOps::path_create($path);
94 $errorCnt = BackupPC::XS::DirOps::path_remove($path, $compress);
95
96 $errorCnt = BackupPC::XS::DirOps::refCountAll($path, $compress);
97
98 $lockFd = BackupPC::XS::DirOps::lockRangeFile($lockFile, $offset, $len, $block);
99 BackupPC::XS::DirOps::unlockRangeFile($lockFd);
100
101 BackupPC::XS::Lib
102 BackupPC::XS::Lib::ConfInit($topDir, $hardLinkMax, $poolV3Enabled, $logLevel)
103
104 $messageArrayRef = BackupPC::XS::Lib::logMsgGet();
105 $errorCnt = BackupPC::XS::Lib::logErrorCntGet;
106 BackupPC::XS::Lib::logLevelSet($level);
107
109 If you specify :all (see SYNOPSIS), then the BPC_FTYPE_ values are
110 exported.
111
113 BackupPC, backuppc.sourceforge.net.
114
115 rsync-bpc.
116
118 Craig Barratt, <cbarratt@users.sourceforge.net<gt>
119
121 BackupPC code is copyright (C) 2013-2017 Craig Barratt
122 <cbarratt@users.sourceforge.net>.
123
124 bpc_hashTable.c is based on code from rsync. Rsync is Copyright (C)
125 1996-2001 by Andrew Tridgell, 1996 by Paul Mackerras, 2001-2002 by
126 Martin Pool, and 2003-2009 by Wayne Davison, and others.
127
128 The md5 library is from the rsync codebase, and is Copyright (C)
129 2001-2003 Christophe Devine. See the code for the license.
130
131 The zlib library is from the rsync codebase, and is Copyright (C)
132 1995-2005 Jean-loup Gailly and Mark Adler. See the code for the
133 license.
134
135 This program is free software; you can redistribute it and/or modify it
136 under the terms of the GNU General Public License as published by the
137 Free Software Foundation; either version 3 of the License, or (at your
138 option) any later version.
139
140 This program is distributed in the hope that it will be useful, but
141 WITHOUT ANY WARRANTY; without even the implied warranty of
142 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
143 General Public License for more details.
144
145 You should have received a copy of the GNU General Public License along
146 with this program; if not, visit the http://fsf.org website.
147
148
149
150perl v5.32.1 2021-01-25 BackupPC::XS(3)